Coherent hard x-ray imaging of nonisolated weak phase objects is demonstrated by confining x-ray beam in a region of a few micrometers in cross section using a micrometer-sized aperture. Two major obstacles in the hard x-ray coherent diffraction imaging, isolating samples and obtaining central speckles, are addressed by using the aperture. The usefulness of the proposed method is illustrated by reconstructing the exit wave field of a nanoscale trench structure fabricated on silicon which serves as a weak phase object. The quantitative phase information of the exit wave field was used to reconstruct the depth profile of the trench structure. The scanning capability of this method was also briefly discussed.