STDMETHODIMP CGeometry::ls2ps(long lsect, long *cyl, short *head, short *sector) { HRESULT hr; dsk_pcyl_t c; dsk_phead_t h; dsk_psect_t s; hr = MapError(dg_ls2ps(&m_g, lsect, &c, &h, &s)); *cyl = c; *head = h; *sector = s; return hr; }
LDPUBLIC32 dsk_err_t LDPUBLIC16 dsk_lwrite(DSK_DRIVER *self, const DSK_GEOMETRY *geom, const void *buf, dsk_lsect_t sector) { dsk_pcyl_t c; dsk_phead_t h; dsk_psect_t s; dsk_err_t e; if (self && self->dr_compress && self->dr_compress->cd_readonly) return DSK_ERR_RDONLY; e = dg_ls2ps(geom, sector, &c, &h, &s); if (e != DSK_ERR_OK) return e; e = dsk_pwrite(self, geom, buf, c, h, s); if (e == DSK_ERR_OK) self->dr_dirty = 1; return e; }