43 GUID actionid = { 0xdeadbe, 0xefde, 0xadbe, { 0xef,0xde,0xad,0xbe,0xef,0xde,0xad,0xbe }};
44 static WCHAR dummydll[] = {
'd',
'e',
'a',
'd',
'b',
'e',
'e',
'f',
'.',
'd',
'l',
'l',0 };
45 static WCHAR dummyfunction[] = {
'd',
'u',
'm',
'm',
'y',
'f',
'u',
'n',
'c',
't',
'i',
'o',
'n',0 };
50 ok (!
ret,
"Expected CryptSIPRemoveProvider to fail.\n");
52 "Expected ERROR_INVALID_PARAMETER, got %d.\n",
GetLastError());
60 skip(
"Need admin rights\n");
71 "Expected ERROR_FILE_NOT_FOUND, got %d.\n",
GetLastError());
90 skip(
"Need admin rights\n");
93 ok (
ret,
"CryptSIPAddProvider should have succeeded, last error %d\n",
GetLastError());
108 "Expected ERROR_FILE_NOT_FOUND, got %d.\n",
GetLastError());
127 ok (
ret,
"CryptSIPAddProvider should have succeeded, last error %d\n",
GetLastError());
132 ok (
ret,
"CryptSIPRemoveProvider should have succeeded, last error %d\n",
GetLastError());
1360x4d,0x53,0x43,0x46,0x00,0x00,0x00,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1370x2c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x01,0x01,0x00,0x01,0x00,0x00,0x00,
1380xef,0xbe,0xff,0xff,0x42,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x06,0x00,0x00,0x00,
1390x00,0x00,0x00,0x00,0x00,0x00,0xf7,0x38,0x4b,0xac,0x00,0x00,0x61,0x2e,0x74,0x78,
1400x74,0x00,0x6d,0x5a,0x72,0x78,0x06,0x00,0x06,0x00,0x61,0x2e,0x74,0x78,0x74,0x0a,
148 static const CHAR windir[] =
"windir";
149 static const CHAR regeditExe[] =
"regedit.exe";
150 static const GUID nullSubject = { 0x0, 0x0, 0x0, { 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 }};
151 static const WCHAR deadbeef[] = {
'c',
':',
'\\',
'd',
'e',
'a',
'd',
'b',
'e',
'e',
'f',
'.',
'd',
'b',
'f',0 };
153 static const GUID unknownGUID = { 0xC689AAB8, 0x8E78, 0x11D0, { 0x8C,0x47,0x00,0xC0,0x4F,0xC2,0x95,0xEE }};
154 static const GUID cabGUID = { 0xc689aaba, 0x8e78, 0x11d0, {0x8c,0x47,0x00,0xc0,0x4f,0xc2,0x95,0xee }};
165 ok ( !
ret,
"Expected CryptSIPRetrieveSubjectGuid to fail\n");
167 "Expected ERROR_INVALID_PARAMETER, got %d.\n",
GetLastError());
174 ok ( !
ret,
"Expected CryptSIPRetrieveSubjectGuid to fail\n");
177 "Expected ERROR_FILE_NOT_FOUND or ERROR_PATH_NOT_FOUND, got %d.\n",
180 "Expected a NULL GUID for c:\\deadbeef.dbf, not %s\n",
wine_dbgstr_guid(&subject));
187 ok (
ret > 0,
"expected GEVA(windir) to succeed, last error %d\n",
GetLastError());
188 strcat(regeditPath,
"\\");
189 strcat(regeditPath, regeditExe);
196 ok (
ret,
"Expected CryptSIPRetrieveSubjectGuid to succeed\n");
205 ok (
ret,
"Expected CryptSIPRetrieveSubjectGuid to succeed\n");
215 ok (
ret,
"Expected CryptSIPRetrieveSubjectGuid to succeed\n");
228 ok ( !
ret,
"Expected CryptSIPRetrieveSubjectGuid to fail\n");
233 "Expected ERROR_FILE_INVALID, ERROR_INVALID_PARAMETER, ERROR_SUCCESS or TRUST_E_SUBJECT_FORM_UNKNOWN, got 0x%08x\n",
GetLastError());
235 "Expected a NULL GUID for empty file %s, not %s\n", tempfile,
wine_dbgstr_guid(&subject));
245 ok ( !
ret,
"Expected CryptSIPRetrieveSubjectGuid to fail\n");
249 "Expected ERROR_INVALID_PARAMETER, ERROR_SUCCESS or TRUST_E_SUBJECT_FORM_UNKNOWN, got 0x%08x\n",
GetLastError());
251 "Expected a NULL GUID for empty file %s, not %s\n", tempfile,
wine_dbgstr_guid(&subject));
261 ok ( !
ret,
"Expected CryptSIPRetrieveSubjectGuid to fail\n");
264 "Expected TRUST_E_SUBJECT_FORM_UNKNOWN or ERROR_SUCCESS, got 0x%08x\n",
GetLastError());
266 "Expected a NULL GUID for empty file %s, not %s\n", tempfile,
wine_dbgstr_guid(&subject));
281 ok(
ret,
"CryptSIPRetrieveSubjectGuid failed: %d (0x%08x)\n",
299 ok(
ret,
"CryptSIPRetrieveSubjectGuid failed: %d (0x%08x)\n",
312 static GUID dummySubject = { 0xdeadbeef, 0xdead, 0xbeef, { 0xde,0xad,0xbe,0xef,0xde,0xad,0xbe,0xef }};
313 static GUID unknown = { 0xC689AABA, 0x8E78, 0x11D0, { 0x8C,0x47,0x00,0xC0,0x4F,0xC2,0x95,0xEE }};
314 static GUID unknown2 = { 0xDE351A43, 0x8E59, 0x11D0, { 0x8C,0x47,0x00,0xC0,0x4F,0xC2,0x95,0xEE }};
316 static GUID unknown3 = { 0x000C10F1, 0x0000, 0x0000, { 0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 }};
323 ok ( !
ret,
"Expected CryptSIPLoad to fail\n");
325 "Expected ERROR_INVALID_PARAMETER, got 0x%08x\n",
GetLastError());
330 ok ( !
ret,
"Expected CryptSIPLoad to fail\n");
332 "Expected ERROR_INVALID_PARAMETER, got 0x%08x\n",
GetLastError());
340 ok ( !
ret,
"Expected CryptSIPLoad to fail\n");
342 "Expected TRUST_E_SUBJECT_FORM_UNKNOWN, got 0x%08x\n",
GetLastError());
358 ok (
ret,
"Expected CryptSIPLoad to succeed\n");
371 if (funcCryptSIPGetSignedDataMsg && funcCryptSIPPutSignedDataMsg && funcCryptSIPCreateIndirectData &&
372 funcCryptSIPVerifyIndirectData && funcCryptSIPRemoveSignedDataMsg)
373 ok (sdi.
pfGet == funcCryptSIPGetSignedDataMsg &&
374 sdi.
pfPut == funcCryptSIPPutSignedDataMsg &&
375 sdi.
pfCreate == funcCryptSIPCreateIndirectData &&
376 sdi.
pfVerify == funcCryptSIPVerifyIndirectData &&
377 sdi.
pfRemove == funcCryptSIPRemoveSignedDataMsg,
378 "Expected function addresses to be from crypt32\n");
380 trace(
"Couldn't load function pointers\n");
388 ok (
ret,
"Expected CryptSIPLoad to succeed\n");
413 if (funcCryptSIPGetSignedDataMsg && funcCryptSIPPutSignedDataMsg && funcCryptSIPCreateIndirectData &&
414 funcCryptSIPVerifyIndirectData && funcCryptSIPRemoveSignedDataMsg)
415 ok (sdi.
pfGet == funcCryptSIPGetSignedDataMsg &&
416 sdi.
pfPut == funcCryptSIPPutSignedDataMsg &&
417 sdi.
pfCreate == funcCryptSIPCreateIndirectData &&
418 sdi.
pfVerify == funcCryptSIPVerifyIndirectData &&
419 sdi.
pfRemove == funcCryptSIPRemoveSignedDataMsg,
420 "Expected function addresses to be from crypt32\n");
422 trace(
"Couldn't load function pointers\n");
431 ok ( !
ret,
"Expected CryptSIPLoad to fail\n");
433 "Expected ERROR_INVALID_PARAMETER, got 0x%08x\n",
GetLastError());
ACPI_SIZE strlen(const char *String)
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
BOOL WINAPI CryptSIPRemoveProvider(GUID *pgProv)
BOOL WINAPI CryptSIPRetrieveSubjectGuid(LPCWSTR FileName, HANDLE hFileIn, GUID *pgSubject)
BOOL WINAPI CryptSIPLoad(const GUID *pgSubject, DWORD dwFlags, SIP_DISPATCH_INFO *pSipDispatch)
BOOL WINAPI CryptSIPAddProvider(SIP_ADD_NEWPROVIDER *psNewProv)
#define ERROR_INVALID_PARAMETER
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define GetEnvironmentVariableA(x, y, z)
#define MultiByteToWideChar
#define ERROR_ACCESS_DENIED
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
static const GUID cabGUID
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
static WCHAR tempfileW[MAX_PATH]
#define ERROR_FILE_NOT_FOUND
static void test_SIPLoad(void)
static void test_AddRemoveProvider(void)
static const BYTE cabFileData[]
static void test_SIPRetrieveSubjectGUID(void)
BOOL(WINAPI * pCryptSIPGetSignedDataMsg)(SIP_SUBJECTINFO *, DWORD *, DWORD, DWORD *, BYTE *)
struct SIP_DISPATCH_INFO_ SIP_DISPATCH_INFO
struct SIP_ADD_NEWPROVIDER_ SIP_ADD_NEWPROVIDER
#define IsEqualGUID(rguid1, rguid2)
static __inline const char * wine_dbgstr_guid(const GUID *id)
WCHAR * pwszCreateFuncName
WCHAR * pwszGetCapFuncName
WCHAR * pwszRemoveFuncName
WCHAR * pwszIsFunctionName
WCHAR * pwszIsFunctionNameFmt2
WCHAR * pwszVerifyFuncName
pCryptSIPVerifyIndirectData pfVerify
pCryptSIPRemoveSignedDataMsg pfRemove
pCryptSIPGetSignedDataMsg pfGet
pCryptSIPPutSignedDataMsg pfPut
pCryptSIPCreateIndirectData pfCreate
DWORD WINAPI GetLastError(void)
#define TRUST_E_SUBJECT_FORM_UNKNOWN
#define ERROR_PATH_NOT_FOUND
#define ERROR_FILE_INVALID