3.1.4.1.23 ICertAdminD::BackupReadFile (Opnum 25)

The BackupReadFile method reads the database file and loads the contents into the buffer that is provided. The file MUST be initialized by a prior call to BackupOpenFile.

 HRESULT BackupReadFile(
   [ref, out, size_is(cbBuffer)] BYTE* pbBuffer,
   [in] LONG cbBuffer,
   [out] LONG* pcbRead
 );

pbBuffer: A pointer to the buffer that receives the read data.

cbBuffer: The size, in bytes, of the preceding buffer. This parameter MUST be a multiple of the page size of the operating system.

pcbRead: A pointer to an integer that receives the actual number of bytes read.

The CA server MUST enforce the sequencing rules for the BackupReadFile, as specified in section 3.1.4.1.18.<56>

The CA server MUST apply the following processing rules:

  • If Config_CA_Interface_Flags contains the value IF_NOREMOTEICERTADMINBACKUP, the server SHOULD return an error. <57>

  • If the BackupReadFile is called for the first time after the BackupOpenFile, the CA MUST read the content, in bytes, from the start of the file up to, at maximum, the value of the cbBuffer parameter.

  • Upon a subsequent call to the BackupReadFile, the CA MUST read the content, starting from a 1-byte offset of the last byte read in the previous call to the BackupReadFile.

  • If the CA has already reached end-of-file, the call MUST succeed with 0 as the value of *pcbRead; otherwise, *pcbRead MUST contain the actual number of bytes read from the file.