3.2.4.1 CprepDiskRawRead (Opnum 3)

The CprepDiskRawRead method reads information directly from a single 512 byte sector on a given disk.

 HRESULT CprepDiskRawRead(
   [in] CPREP_DISKID DiskId,
   [in] unsigned long ulSector,
   [in] unsigned long cbData,
   [out, size_is(cbData), length_is(*pcbDataRead)] 
     byte* pbData,
   [out] unsigned long* pcbDataRead,
   [out] unsigned long* ulLatency
 );

DiskId: The identifier of the ClusPrepDisk representing the disk that holds the sector from which to read.

ulSector: The sector number to read from.

cbData: The size, in bytes, of the buffer pbData.

pbData: The data to read from the disk.

pcbDataRead: On successful completion, the server MUST set this to cbData. Otherwise the client MUST ignore this value.

ulLatency: The time, in milliseconds, that the read took to be performed.

Return Values: A signed 32-bit value that indicates return status. If the method returns a negative value, it has failed. Zero or positive values indicate success, with the lower 16 bits in positive nonzero values containing warnings or flags defined in the method implementation. For more information about Win32 error codes and HRESULT values, see [MS-ERREF] sections 2.2 and 2.1.

Return value/code

Description

0x00000000

S_OK

The call was successful.

0x80070002

ERROR_FILE_NOT_FOUND

The disk was not found.

0x8007001E

ERROR_READ_FAULT

An attempt to read a buffer size larger than 512 was performed.

0x80070548

ERROR_INVALID_SERVER_STATE

The server's Prepare State is not Online.

For any other condition, this method MUST return a value that is not one of the values listed in the preceding table. The client MUST behave in one consistent, identical manner for all values that are not listed in the preceding table.

Exceptions Thrown: No exceptions are thrown beyond those thrown by the underlying RPC protocol [MS-RPCE].

The opnum field value for this method is 3.

When processing this call, the server MUST do the following:

  • Obtain the ClusPrepDisk identified by the DiskId parameter as specified in section 3.2.4.

  • If cbData is larger than 512, then return ERROR_READ_FAULT.

  • Read a 512 byte sector from the disk at the correct sector and place the first cbData bytes from this data into the pbData buffer.

    Note While performing the read operation, use the Latency Time Source ADM element in an implementation-specific manner to determine the elapsed time. For example, prior to initiating the read operation, observe the current time of day in millisecond granularity. Upon completion of the read, again observe the current time of day. The elapsed time can be calculated by subtracting the first observed value from the second.

  • Set pcbDataRead to cbData.

  • Set ulLatency to the time, in milliseconds, that the read operation took to complete.

The server returns the following information to the client:

  • The data read

  • How long the read took to complete