Export (0) Print
Expand All

ImageAddCertificate function

Adds a certificate to the specified file.

Syntax


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

Parameters

FileHandle [in]

A handle to the image file to be modified. This handle must be opened for FILE_READ_DATA and FILE_WRITE_DATA access.

Certificate [in]

A pointer to 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]

A pointer to a variable that receives the index of the newly added certificate.

Return value

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.

All ImageHlp functions, such as this one, are single threaded. Therefore, calls from more than one thread to this function will likely result in unexpected behavior or memory corruption. To avoid this, you must synchronize all concurrent calls from more than one thread to this function.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Imagehlp.h

Library

Imagehlp.lib

DLL

Imagehlp.dll

See also

ImageHlp Functions
ImageRemoveCertificate

 

 

Community Additions

ADD
Show:
© 2014 Microsoft