43 GUID actionid = { 0xdeadbe, 0xefde, 0xadbe, { 0xef,0xde,0xad,0xbe,0xef,0xde,0xad,0xbe }};
48 ok (!
ret,
"Expected CryptSIPRemoveProvider to fail.\n");
50 "Expected ERROR_INVALID_PARAMETER, got %ld.\n",
GetLastError());
58 skip(
"Need admin rights\n");
77 skip(
"Need admin rights\n");
80 ok (
ret,
"CryptSIPAddProvider should have succeeded, last error %ld\n",
GetLastError());
89 "Expected ERROR_FILE_NOT_FOUND, got %ld.\n",
GetLastError());
108 ok (
ret,
"CryptSIPAddProvider should have succeeded, last error %ld\n",
GetLastError());
113 ok (
ret,
"CryptSIPRemoveProvider should have succeeded, last error %ld\n",
GetLastError());
1170x4d,0x53,0x43,0x46,0x00,0x00,0x00,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1180x2c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x01,0x01,0x00,0x01,0x00,0x00,0x00,
1190xef,0xbe,0xff,0xff,0x42,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x06,0x00,0x00,0x00,
1200x00,0x00,0x00,0x00,0x00,0x00,0xf7,0x38,0x4b,0xac,0x00,0x00,0x61,0x2e,0x74,0x78,
1210x74,0x00,0x6d,0x5a,0x72,0x78,0x06,0x00,0x06,0x00,0x61,0x2e,0x74,0x78,0x74,0x0a,
129 static const CHAR windir[] =
"windir";
130 static const CHAR regeditExe[] =
"regedit.exe";
131 static const GUID nullSubject = { 0x0, 0x0, 0x0, { 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 }};
133 static const GUID unknownGUID = { 0xC689AAB8, 0x8E78, 0x11D0, { 0x8C,0x47,0x00,0xC0,0x4F,0xC2,0x95,0xEE }};
134 static const GUID cabGUID = { 0xc689aaba, 0x8e78, 0x11d0, {0x8c,0x47,0x00,0xc0,0x4f,0xc2,0x95,0xee }};
145 ok ( !
ret,
"Expected CryptSIPRetrieveSubjectGuid to fail\n");
147 "Expected ERROR_INVALID_PARAMETER, got %ld.\n",
GetLastError());
154 ok ( !
ret,
"Expected CryptSIPRetrieveSubjectGuid to fail\n");
157 "Expected ERROR_FILE_NOT_FOUND or ERROR_PATH_NOT_FOUND, got %ld.\n",
160 "Expected a NULL GUID for c:\\deadbeef.dbf, not %s\n",
wine_dbgstr_guid(&subject));
167 ok (
ret > 0,
"expected GEVA(windir) to succeed, last error %ld\n",
GetLastError());
168 strcat(regeditPath,
"\\");
169 strcat(regeditPath, regeditExe);
176 ok (
ret,
"Expected CryptSIPRetrieveSubjectGuid to succeed\n");
185 ok (
ret,
"Expected CryptSIPRetrieveSubjectGuid to succeed\n");
195 ok (
ret,
"Expected CryptSIPRetrieveSubjectGuid to succeed\n");
208 ok ( !
ret,
"Expected CryptSIPRetrieveSubjectGuid to fail\n");
210 "Expected ERROR_FILE_INVALID, ERROR_INVALID_PARAMETER, got 0x%08lx\n",
GetLastError());
212 "Expected a NULL GUID for empty file %s, not %s\n", tempfile,
wine_dbgstr_guid(&subject));
222 ok ( !
ret,
"Expected CryptSIPRetrieveSubjectGuid to fail\n");
224 "Expected ERROR_INVALID_PARAMETER, got 0x%08lx\n",
GetLastError());
226 "Expected a NULL GUID for empty file %s, not %s\n", tempfile,
wine_dbgstr_guid(&subject));
236 ok ( !
ret,
"Expected CryptSIPRetrieveSubjectGuid to fail\n");
238 "Expected TRUST_E_SUBJECT_FORM_UNKNOWN or ERROR_SUCCESS, got 0x%08lx\n",
GetLastError());
240 "Expected a NULL GUID for empty file %s, not %s\n", tempfile,
wine_dbgstr_guid(&subject));
255 ok(
ret,
"CryptSIPRetrieveSubjectGuid failed: %ld (0x%08lx)\n",
273 ok(
ret,
"CryptSIPRetrieveSubjectGuid failed: %ld (0x%08lx)\n",
286 static GUID dummySubject = { 0xdeadbeef, 0xdead, 0xbeef, { 0xde,0xad,0xbe,0xef,0xde,0xad,0xbe,0xef }};
287 static GUID unknown = { 0xC689AABA, 0x8E78, 0x11D0, { 0x8C,0x47,0x00,0xC0,0x4F,0xC2,0x95,0xEE }};
288 static GUID unknown2 = { 0xDE351A43, 0x8E59, 0x11D0, { 0x8C,0x47,0x00,0xC0,0x4F,0xC2,0x95,0xEE }};
290 static GUID unknown3 = { 0x000C10F1, 0x0000, 0x0000, { 0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 }};
297 ok ( !
ret,
"Expected CryptSIPLoad to fail\n");
299 "Expected ERROR_INVALID_PARAMETER, got 0x%08lx\n",
GetLastError());
304 ok ( !
ret,
"Expected CryptSIPLoad to fail\n");
306 "Expected ERROR_INVALID_PARAMETER, got 0x%08lx\n",
GetLastError());
314 ok ( !
ret,
"Expected CryptSIPLoad to fail\n");
316 "Expected TRUST_E_SUBJECT_FORM_UNKNOWN, got 0x%08lx\n",
GetLastError());
332 ok (
ret,
"Expected CryptSIPLoad to succeed\n");
345 if (funcCryptSIPGetSignedDataMsg && funcCryptSIPPutSignedDataMsg && funcCryptSIPCreateIndirectData &&
346 funcCryptSIPVerifyIndirectData && funcCryptSIPRemoveSignedDataMsg)
347 ok (sdi.
pfGet == funcCryptSIPGetSignedDataMsg &&
348 sdi.
pfPut == funcCryptSIPPutSignedDataMsg &&
349 sdi.
pfCreate == funcCryptSIPCreateIndirectData &&
350 sdi.
pfVerify == funcCryptSIPVerifyIndirectData &&
351 sdi.
pfRemove == funcCryptSIPRemoveSignedDataMsg,
352 "Expected function addresses to be from crypt32\n");
354 trace(
"Couldn't load function pointers\n");
362 ok (
ret,
"Expected CryptSIPLoad to succeed\n");
387 if (funcCryptSIPGetSignedDataMsg && funcCryptSIPPutSignedDataMsg && funcCryptSIPCreateIndirectData &&
388 funcCryptSIPVerifyIndirectData && funcCryptSIPRemoveSignedDataMsg)
389 ok (sdi.
pfGet == funcCryptSIPGetSignedDataMsg &&
390 sdi.
pfPut == funcCryptSIPPutSignedDataMsg &&
391 sdi.
pfCreate == funcCryptSIPCreateIndirectData &&
392 sdi.
pfVerify == funcCryptSIPVerifyIndirectData &&
393 sdi.
pfRemove == funcCryptSIPRemoveSignedDataMsg,
394 "Expected function addresses to be from crypt32\n");
396 trace(
"Couldn't load function pointers\n");
405 ok ( !
ret,
"Expected CryptSIPLoad to fail\n");
407 "Expected ERROR_INVALID_PARAMETER, got 0x%08lx\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