60 if ((!nt32) || (!nt64))
76 if (
count !=
sizeof dos_hdr)
83 if (pe_offset !=
NULL)
163 TRACE(
"ret = %d size = %x addr = %x\n",
ret,
sd->Size,
sd->VirtualAddress);
166 *pdwOfs =
sd->VirtualAddress;
183 int ret, nt_hdr_size = 0;
209 sd->VirtualAddress = dwOfs;
211 TRACE(
"size = %x addr = %x\n",
sd->Size,
sd->VirtualAddress);
226 if (
count != nt_hdr_size)
282 *pdwOfs = sd_VirtualAddr +
offset;
364 if (
count != nt_hdr_size)
385 const size_t cert_hdr_size =
sizeof hdr -
sizeof hdr.bCertificate;
393 if ((
r) && (sd_VirtualAddr != 0))
399 FIXME(
"Security directory already present but not located at EOF, not adding certificate\n");
419 if (
count != cert_hdr_size)
423 if (
hdr.dwLength < cert_hdr_size)
433 if (
hdr.dwLength % 8)
492 const size_t cert_hdr_size =
sizeof hdr -
sizeof hdr.bCertificate;
495 TRACE(
"%p %hd %p %p %d\n",
496 handle, TypeFilter, CertificateCount, Indices, IndexCount);
504 *CertificateCount = 0;
515 if(
count != cert_hdr_size )
518 TRACE(
"Size = %08x id = %08hx\n",
519 hdr.dwLength,
hdr.wCertificateType );
522 if(
hdr.dwLength < cert_hdr_size )
528 (TypeFilter ==
hdr.wCertificateType) )
530 (*CertificateCount)++;
531 if(Indices && *CertificateCount <= IndexCount)
539 if (
hdr.dwLength % 8)
608 const size_t cert_hdr_size =
sizeof *pCert -
sizeof pCert->
bCertificate;
615 if(
size < cert_hdr_size )
625 if(
count != cert_hdr_size )
686 DigestFunction, DigestHandle );
698 for(
i = 0;
ret &&
i < num_sections;
i++,
hdr++ )
702 hdr->SizeOfRawData,
map, fileSize, DigestFunction, DigestHandle );
733 DigestFunction, DigestHandle );
736 FIXME(
"not supported except for CERT_PE_IMAGE_DIGEST_ALL_IMPORT_INFO\n");
800 goto invalid_parameter;
803 goto invalid_parameter;
808 goto invalid_parameter;
811 goto invalid_parameter;
815 goto invalid_parameter;
819 goto invalid_parameter;
822 goto invalid_parameter;
829 goto invalid_parameter;
832 goto invalid_parameter;
849 goto invalid_parameter;
856 map, fileSize, DigestFunction, DigestHandle );
858 map, fileSize, DigestFunction, DigestHandle );
860 map, fileSize, DigestFunction, DigestHandle );
862 map, fileSize, DigestLevel, DigestFunction, DigestHandle );
865 map, fileSize, DigestFunction, DigestHandle );
868 map, fileSize, DigestFunction, DigestHandle );
890 DWORD data_size = 0, cert_size = 0, cert_size_padded = 0,
ret = 0;
907 cert_size_padded = cert_size + (8 - (cert_size % 8));
909 cert_size_padded = cert_size;
911 data_size =
size - (
offset - sd_VirtualAddr) - cert_size_padded;
935 if ((!
r) || (
count != data_size))
943 if ((!
r) || (
count != data_size))
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define ERROR_INSUFFICIENT_BUFFER
#define ERROR_INVALID_PARAMETER
#define INVALID_SET_FILE_POINTER
#define ReadFile(a, b, c, d, e)
#define INVALID_HANDLE_VALUE
#define CreateFileMappingW(a, b, c, d, e, f)
#define ERROR_NOT_SUPPORTED
#define HeapFree(x, y, z)
BOOL WINAPI ImageGetCertificateData(HANDLE handle, DWORD Index, LPWIN_CERTIFICATE Certificate, PDWORD RequiredLength)
BOOL WINAPI ImageAddCertificate(HANDLE FileHandle, LPWIN_CERTIFICATE Certificate, PDWORD Index)
static int IMAGEHLP_GetNTHeaders(HANDLE handle, DWORD *pe_offset, IMAGE_NT_HEADERS32 *nt32, IMAGE_NT_HEADERS64 *nt64)
static BOOL IMAGEHLP_RecalculateChecksum(HANDLE handle)
static BOOL IMAGEHLP_ReportSectionFromOffset(DWORD offset, DWORD size, BYTE *map, DWORD fileSize, DIGEST_FUNCTION DigestFunction, DIGEST_HANDLE DigestHandle)
BOOL WINAPI ImageEnumerateCertificates(HANDLE handle, WORD TypeFilter, PDWORD CertificateCount, PDWORD Indices, DWORD IndexCount)
static BOOL IMAGEHLP_ReportCodeSections(IMAGE_SECTION_HEADER *hdr, DWORD num_sections, BYTE *map, DWORD fileSize, DIGEST_FUNCTION DigestFunction, DIGEST_HANDLE DigestHandle)
static BOOL IMAGEHLP_ReportImportSection(IMAGE_SECTION_HEADER *hdr, DWORD num_sections, BYTE *map, DWORD fileSize, DWORD DigestLevel, DIGEST_FUNCTION DigestFunction, DIGEST_HANDLE DigestHandle)
BOOL WINAPI ImageGetDigestStream(HANDLE FileHandle, DWORD DigestLevel, DIGEST_FUNCTION DigestFunction, DIGEST_HANDLE DigestHandle)
static BOOL IMAGEHLP_GetSecurityDirOffset(HANDLE handle, DWORD *pdwOfs, DWORD *pdwSize)
static BOOL IMAGEHLP_GetCertificateOffset(HANDLE handle, DWORD num, DWORD *pdwOfs, DWORD *pdwSize)
BOOL WINAPI ImageRemoveCertificate(HANDLE FileHandle, DWORD Index)
static BOOL IMAGEHLP_ReportSection(IMAGE_SECTION_HEADER *section_headers, DWORD num_sections, LPCSTR section, BYTE *map, DWORD fileSize, DIGEST_FUNCTION DigestFunction, DIGEST_HANDLE DigestHandle)
BOOL WINAPI ImageGetCertificateHeader(HANDLE handle, DWORD index, LPWIN_CERTIFICATE pCert)
static DWORD IMAGEHLP_GetSectionOffset(IMAGE_SECTION_HEADER *hdr, DWORD num_sections, LPCSTR section, PDWORD size, PDWORD base)
static BOOL IMAGEHLP_SetSecurityDirOffset(HANDLE handle, DWORD dwOfs, DWORD dwSize)
BOOL WINAPI SetEndOfFile(HANDLE hFile)
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
static const WCHAR Certificate[]
struct _IMAGE_NT_HEADERS IMAGE_NT_HEADERS32
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
GLuint GLuint GLsizei count
GLdouble GLdouble GLdouble r
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
PIMAGE_NT_HEADERS WINAPI CheckSumMappedFile(LPVOID BaseAddress, DWORD FileLength, LPDWORD HeaderSum, LPDWORD CheckSum)
BOOL(WINAPI * DIGEST_FUNCTION)(DIGEST_HANDLE refdata, PBYTE pData, DWORD dwLength)
#define CERT_PE_IMAGE_DIGEST_ALL_IMPORT_INFO
#define CERT_PE_IMAGE_DIGEST_DEBUG_INFO
#define CERT_PE_IMAGE_DIGEST_RESOURCES
#define CERT_SECTION_TYPE_ANY
static IMAGE_SECTION_HEADER section_headers[]
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
_Out_ PNDIS_HANDLE _Out_ PUINT FileLength
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
#define IMAGE_NT_OPTIONAL_HDR32_MAGIC
#define IMAGE_NT_OPTIONAL_HDR64_MAGIC
#define IMAGE_SCN_CNT_CODE
struct _IMAGE_NT_HEADERS64 IMAGE_NT_HEADERS64
#define IMAGE_NT_SIGNATURE
#define IMAGE_DOS_SIGNATURE
struct _IMAGE_SECTION_HEADER IMAGE_SECTION_HEADER
BYTE bCertificate[ANYSIZE_ARRAY]
_In_ WDFCOLLECTION _In_ ULONG Index
#define INVALID_FILE_SIZE
#define IMAGE_FILE_SECURITY_DIRECTORY
_In_ ULONG _Out_opt_ PULONG RequiredLength