Platform SDK: Debugging and Error Handling

ImageAddCertificate

The ImageAddCertificate function is used to add a certificate to the specified file.

BOOL ImageAddCertificate(
  HANDLE FileHandle,              
  LPWIN_CERTIFICATE Certificate,  
  PDWORD Index                   
);

Parameters

FileHandle
[in] Handle to the image file to be modified. This handle must be opened for FILE_READ_DATA and FILE_WRITE_DATA access.
Certificate
[in] Specifies a buffer containing a WIN_CERTIFICATE header and all associated sections. The Length member in the certificate header will be used to determine the length of this buffer.
Index
[out] Receives the index of the newly added certificate.

Return Values

If the function succeeds, the return value is TRUE.

If the function fails, the return value is FALSE. To retrieve extended error information, call GetLastError.

Remarks

The certificate is added at the end of the existing list of certificates and is assigned an index.

Requirements

  Windows NT/2000: Requires Windows NT 4.0 or later.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in Imagehlp.h.
  Library: Use Imagehlp.lib.

See Also

Image Help Library Overview, ImageHlp Functions, ImageRemoveCertificate