2 * Subject Interface Package tests
4 * Copyright 2006 Paul Vriens
5 * Copyright 2008 Juan Lang
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
31 #include "wine/test.h"
33 static BOOL (WINAPI
* funcCryptSIPGetSignedDataMsg
)(SIP_SUBJECTINFO
*,DWORD
*,DWORD
,DWORD
*,BYTE
*);
34 static BOOL (WINAPI
* funcCryptSIPPutSignedDataMsg
)(SIP_SUBJECTINFO
*,DWORD
,DWORD
*,DWORD
,BYTE
*);
35 static BOOL (WINAPI
* funcCryptSIPCreateIndirectData
)(SIP_SUBJECTINFO
*,DWORD
*,SIP_INDIRECT_DATA
*);
36 static BOOL (WINAPI
* funcCryptSIPVerifyIndirectData
)(SIP_SUBJECTINFO
*,SIP_INDIRECT_DATA
*);
37 static BOOL (WINAPI
* funcCryptSIPRemoveSignedDataMsg
)(SIP_SUBJECTINFO
*,DWORD
);
39 static char *show_guid(const GUID
*guid
, char *buf
)
42 "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
43 guid
->Data1
, guid
->Data2
, guid
->Data3
,
44 guid
->Data4
[0], guid
->Data4
[1], guid
->Data4
[2], guid
->Data4
[3],
45 guid
->Data4
[4], guid
->Data4
[5], guid
->Data4
[6], guid
->Data4
[7] );
50 static void test_AddRemoveProvider(void)
53 SIP_ADD_NEWPROVIDER newprov
;
54 GUID actionid
= { 0xdeadbe, 0xefde, 0xadbe, { 0xef,0xde,0xad,0xbe,0xef,0xde,0xad,0xbe }};
55 static WCHAR dummydll
[] = {'d','e','a','d','b','e','e','f','.','d','l','l',0 };
56 static WCHAR dummyfunction
[] = {'d','u','m','m','y','f','u','n','c','t','i','o','n',0 };
59 SetLastError(0xdeadbeef);
60 ret
= CryptSIPRemoveProvider(NULL
);
61 ok (!ret
, "Expected CryptSIPRemoveProvider to fail.\n");
62 ok (GetLastError() == ERROR_INVALID_PARAMETER
,
63 "Expected ERROR_INVALID_PARAMETER, got %d.\n", GetLastError());
65 /* nonexistent provider should result in a registry error */
66 SetLastError(0xdeadbeef);
67 ret
= CryptSIPRemoveProvider(&actionid
);
68 if (!ret
&& GetLastError() == ERROR_ACCESS_DENIED
)
70 /* Apparently the needed rights are checked before the existence of the provider */
71 skip("Need admin rights\n");
75 ok (!ret
, "Expected CryptSIPRemoveProvider to fail.\n");
76 ok (GetLastError() == ERROR_FILE_NOT_FOUND
,
77 "Expected ERROR_FILE_NOT_FOUND, got %d.\n", GetLastError());
80 /* Everything OK, pwszIsFunctionName and pwszIsFunctionNameFmt2 are left NULL
83 memset(&newprov
, 0, sizeof(SIP_ADD_NEWPROVIDER
));
84 newprov
.cbStruct
= sizeof(SIP_ADD_NEWPROVIDER
);
85 newprov
.pgSubject
= &actionid
;
86 newprov
.pwszDLLFileName
= dummydll
;
87 newprov
.pwszGetFuncName
= dummyfunction
;
88 newprov
.pwszPutFuncName
= dummyfunction
;
89 newprov
.pwszCreateFuncName
= dummyfunction
;
90 newprov
.pwszVerifyFuncName
= dummyfunction
;
91 newprov
.pwszRemoveFuncName
= dummyfunction
;
92 SetLastError(0xdeadbeef);
93 ret
= CryptSIPAddProvider(&newprov
);
94 if (!ret
&& GetLastError() == ERROR_ACCESS_DENIED
)
96 skip("Need admin rights\n");
99 ok ( ret
, "CryptSIPAddProvider should have succeeded\n");
101 /* Dummy provider will be deleted, but the function still fails because
102 * pwszIsFunctionName and pwszIsFunctionNameFmt2 are not present in the
105 SetLastError(0xdeadbeef);
106 ret
= CryptSIPRemoveProvider(&actionid
);
107 ok (!ret
, "Expected CryptSIPRemoveProvider to fail.\n");
108 ok (GetLastError() == ERROR_FILE_NOT_FOUND
,
109 "Expected ERROR_FILE_NOT_FOUND, got %d.\n", GetLastError());
112 memset(&newprov
, 0, sizeof(SIP_ADD_NEWPROVIDER
));
113 newprov
.cbStruct
= sizeof(SIP_ADD_NEWPROVIDER
);
114 newprov
.pgSubject
= &actionid
;
115 newprov
.pwszDLLFileName
= dummydll
;
116 newprov
.pwszGetFuncName
= dummyfunction
;
117 newprov
.pwszPutFuncName
= dummyfunction
;
118 newprov
.pwszCreateFuncName
= dummyfunction
;
119 newprov
.pwszVerifyFuncName
= dummyfunction
;
120 newprov
.pwszRemoveFuncName
= dummyfunction
;
121 newprov
.pwszIsFunctionNameFmt2
= dummyfunction
;
122 newprov
.pwszIsFunctionName
= dummyfunction
;
123 SetLastError(0xdeadbeef);
124 ret
= CryptSIPAddProvider(&newprov
);
125 ok ( ret
, "CryptSIPAddProvider should have succeeded\n");
127 /* Dummy provider should be deleted */
128 SetLastError(0xdeadbeef);
129 ret
= CryptSIPRemoveProvider(&actionid
);
130 ok ( ret
, "CryptSIPRemoveProvider should have succeeded\n");
133 static const BYTE cabFileData
[] = {
134 0x4d,0x53,0x43,0x46,0x00,0x00,0x00,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
135 0x2c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x01,0x01,0x00,0x01,0x00,0x00,0x00,
136 0xef,0xbe,0xff,0xff,0x42,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x06,0x00,0x00,0x00,
137 0x00,0x00,0x00,0x00,0x00,0x00,0xf7,0x38,0x4b,0xac,0x00,0x00,0x61,0x2e,0x74,0x78,
138 0x74,0x00,0x6d,0x5a,0x72,0x78,0x06,0x00,0x06,0x00,0x61,0x2e,0x74,0x78,0x74,0x0a,
141 static void test_SIPRetrieveSubjectGUID(void)
146 static const CHAR windir
[] = "windir";
147 static const CHAR regeditExe
[] = "regedit.exe";
148 static const GUID nullSubject
= { 0x0, 0x0, 0x0, { 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 }};
149 static const WCHAR deadbeef
[] = { 'c',':','\\','d','e','a','d','b','e','e','f','.','d','b','f',0 };
150 /* Couldn't find a name for this GUID, it's the one used for 95% of the files */
151 static const GUID unknownGUID
= { 0xC689AAB8, 0x8E78, 0x11D0, { 0x8C,0x47,0x00,0xC0,0x4F,0xC2,0x95,0xEE }};
152 static const GUID cabGUID
= { 0xc689aaba, 0x8e78, 0x11d0, {0x8c,0x47,0x00,0xc0,0x4f,0xc2,0x95,0xee }};
153 static CHAR regeditPath
[MAX_PATH
];
154 static WCHAR regeditPathW
[MAX_PATH
];
155 static CHAR path
[MAX_PATH
];
156 static CHAR tempfile
[MAX_PATH
];
157 static WCHAR tempfileW
[MAX_PATH
];
158 static char guid1
[39], guid2
[39];
162 SetLastError(0xdeadbeef);
163 ret
= CryptSIPRetrieveSubjectGuid(NULL
, NULL
, NULL
);
164 ok ( !ret
, "Expected CryptSIPRetrieveSubjectGuid to fail\n");
165 ok (GetLastError() == ERROR_INVALID_PARAMETER
,
166 "Expected ERROR_INVALID_PARAMETER, got %d.\n", GetLastError());
168 /* Test with a nonexistent file (hopefully) */
169 SetLastError(0xdeadbeef);
170 /* Set subject to something other than zeros */
171 memset(&subject
, 1, sizeof(GUID
));
172 ret
= CryptSIPRetrieveSubjectGuid(deadbeef
, NULL
, &subject
);
173 ok ( !ret
, "Expected CryptSIPRetrieveSubjectGuid to fail\n");
174 ok (GetLastError() == ERROR_FILE_NOT_FOUND
,
175 "Expected ERROR_FILE_NOT_FOUND, got %d.\n", GetLastError());
176 ok ( !memcmp(&subject
, &nullSubject
, sizeof(GUID
)),
177 "Expected a NULL GUID for c:\\deadbeef.dbf, not %s\n", show_guid(&subject
, guid1
));
179 /* Now with an executable that should exist
181 * Use A-functions where possible as that should be available on all platforms
183 ret
= GetEnvironmentVariableA(windir
, regeditPath
, MAX_PATH
);
184 ok (ret
> 0, "expected GEVA(windir) to succeed, last error %d\n", GetLastError());
185 strcat(regeditPath
, "\\");
186 strcat(regeditPath
, regeditExe
);
187 MultiByteToWideChar( CP_ACP
, 0, regeditPath
,
188 strlen(regeditPath
)+1, regeditPathW
,
189 sizeof(regeditPathW
)/sizeof(regeditPathW
[0]) );
191 SetLastError(0xdeadbeef);
192 memset(&subject
, 1, sizeof(GUID
));
193 ret
= CryptSIPRetrieveSubjectGuid(regeditPathW
, NULL
, &subject
);
194 ok ( ret
, "Expected CryptSIPRetrieveSubjectGuid to succeed\n");
195 ok ( !memcmp(&subject
, &unknownGUID
, sizeof(GUID
)),
196 "Expected (%s), got (%s).\n", show_guid(&unknownGUID
, guid1
), show_guid(&subject
, guid2
));
198 /* The same thing but now with a handle instead of a filename */
199 file
= CreateFileA(regeditPath
, GENERIC_READ
, 0, NULL
, OPEN_EXISTING
, 0, NULL
);
200 SetLastError(0xdeadbeef);
201 memset(&subject
, 1, sizeof(GUID
));
202 ret
= CryptSIPRetrieveSubjectGuid(NULL
, file
, &subject
);
203 ok ( ret
, "Expected CryptSIPRetrieveSubjectGuid to succeed\n");
204 ok ( !memcmp(&subject
, &unknownGUID
, sizeof(GUID
)),
205 "Expected (%s), got (%s).\n", show_guid(&unknownGUID
, guid1
), show_guid(&subject
, guid2
));
209 file
= CreateFileA(regeditPath
, GENERIC_READ
, 0, NULL
, OPEN_EXISTING
, 0, NULL
);
210 SetLastError(0xdeadbeef);
211 memset(&subject
, 1, sizeof(GUID
));
212 ret
= CryptSIPRetrieveSubjectGuid(regeditPathW
, file
, &subject
);
213 ok ( ret
, "Expected CryptSIPRetrieveSubjectGuid to succeed\n");
214 ok ( !memcmp(&subject
, &unknownGUID
, sizeof(GUID
)),
215 "Expected (%s), got (%s).\n", show_guid(&unknownGUID
, guid1
), show_guid(&subject
, guid2
));
218 /* Now with an empty file */
219 GetTempPathA(sizeof(path
), path
);
220 GetTempFileNameA(path
, "sip", 0 , tempfile
);
221 MultiByteToWideChar( CP_ACP
, 0, tempfile
,
222 strlen(tempfile
)+1, tempfileW
,
223 sizeof(tempfileW
)/sizeof(tempfileW
[0]) );
225 SetLastError(0xdeadbeef);
226 memset(&subject
, 1, sizeof(GUID
));
227 ret
= CryptSIPRetrieveSubjectGuid(tempfileW
, NULL
, &subject
);
228 ok ( !ret
, "Expected CryptSIPRetrieveSubjectGuid to fail\n");
229 ok ( GetLastError() == ERROR_FILE_INVALID
||
230 GetLastError() == ERROR_INVALID_PARAMETER
/* Vista */ ||
231 GetLastError() == ERROR_SUCCESS
/* Win98 */,
232 "Expected ERROR_FILE_INVALID, ERROR_INVALID_PARAMETER or ERROR_SUCCESS, got 0x%08x\n", GetLastError());
233 ok ( !memcmp(&subject
, &nullSubject
, sizeof(GUID
)),
234 "Expected a NULL GUID for empty file %s, not %s\n", tempfile
, show_guid(&subject
, guid1
));
236 /* Use a file with a size of 3 (at least < 4) */
237 file
= CreateFileA(tempfile
, GENERIC_WRITE
, 0, NULL
, OPEN_EXISTING
, 0, NULL
);
238 WriteFile(file
, "123", 3, &written
, NULL
);
241 SetLastError(0xdeadbeef);
242 memset(&subject
, 1, sizeof(GUID
));
243 ret
= CryptSIPRetrieveSubjectGuid(tempfileW
, NULL
, &subject
);
244 ok ( !ret
, "Expected CryptSIPRetrieveSubjectGuid to fail\n");
245 ok ( GetLastError() == ERROR_INVALID_PARAMETER
||
246 GetLastError() == ERROR_SUCCESS
/* Win98 */,
247 "Expected ERROR_INVALID_PARAMETER or ERROR_SUCCESS, got 0x%08x\n", GetLastError());
248 ok ( !memcmp(&subject
, &nullSubject
, sizeof(GUID
)),
249 "Expected a NULL GUID for empty file %s, not %s\n", tempfile
, show_guid(&subject
, guid1
));
252 file
= CreateFileA(tempfile
, GENERIC_WRITE
, 0, NULL
, OPEN_EXISTING
, 0, NULL
);
253 WriteFile(file
, "1234", 4, &written
, NULL
);
256 SetLastError(0xdeadbeef);
257 memset(&subject
, 1, sizeof(GUID
));
258 ret
= CryptSIPRetrieveSubjectGuid(tempfileW
, NULL
, &subject
);
259 ok ( !ret
, "Expected CryptSIPRetrieveSubjectGuid to fail\n");
260 ok ( GetLastError() == TRUST_E_SUBJECT_FORM_UNKNOWN
||
261 GetLastError() == ERROR_SUCCESS
/* Win98 */,
262 "Expected TRUST_E_SUBJECT_FORM_UNKNOWN or ERROR_SUCCESS, got 0x%08x\n", GetLastError());
263 ok ( !memcmp(&subject
, &nullSubject
, sizeof(GUID
)),
264 "Expected a NULL GUID for empty file %s, not %s\n", tempfile
, show_guid(&subject
, guid1
));
267 DeleteFileA(tempfile
);
269 /* Create a .cab file */
270 file
= CreateFileW(tempfileW
, GENERIC_WRITE
, 0, NULL
, CREATE_NEW
, 0, NULL
);
271 WriteFile(file
, cabFileData
, sizeof(cabFileData
), &written
, NULL
);
274 SetLastError(0xdeadbeef);
275 memset(&subject
, 1, sizeof(GUID
));
276 ret
= CryptSIPRetrieveSubjectGuid(tempfileW
, NULL
, &subject
);
278 ok( ret
, "CryptSIPRetrieveSubjectGuid failed: %d (0x%08x)\n",
279 GetLastError(), GetLastError() );
281 ok ( !memcmp(&subject
, &cabGUID
, sizeof(GUID
)),
282 "Expected GUID %s for cabinet file, not %s\n", show_guid(&cabGUID
, guid1
), show_guid(&subject
, guid2
));
284 DeleteFileW(tempfileW
);
287 static void test_SIPLoad(void)
291 static GUID dummySubject
= { 0xdeadbeef, 0xdead, 0xbeef, { 0xde,0xad,0xbe,0xef,0xde,0xad,0xbe,0xef }};
292 static GUID unknown
= { 0xC689AABA, 0x8E78, 0x11D0, { 0x8C,0x47,0x00,0xC0,0x4F,0xC2,0x95,0xEE }}; /* WINTRUST.DLL */
293 static GUID unknown2
= { 0xDE351A43, 0x8E59, 0x11D0, { 0x8C,0x47,0x00,0xC0,0x4F,0xC2,0x95,0xEE }}; /* WINTRUST.DLL */
294 /* The next SIP is available on Windows (not on a clean Wine install) */
295 static GUID unknown3
= { 0x000C10F1, 0x0000, 0x0000, { 0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 }}; /* MSISIP.DLL */
296 SIP_DISPATCH_INFO sdi
;
300 SetLastError(0xdeadbeef);
301 ret
= CryptSIPLoad(NULL
, 0, NULL
);
302 ok ( !ret
, "Expected CryptSIPLoad to fail\n");
303 ok ( GetLastError() == ERROR_INVALID_PARAMETER
,
304 "Expected ERROR_INVALID_PARAMETER, got 0x%08x\n", GetLastError());
306 /* Only pSipDispatch NULL */
307 SetLastError(0xdeadbeef);
308 ret
= CryptSIPLoad(&subject
, 0, NULL
);
309 ok ( !ret
, "Expected CryptSIPLoad to fail\n");
310 ok ( GetLastError() == ERROR_INVALID_PARAMETER
,
311 "Expected ERROR_INVALID_PARAMETER, got 0x%08x\n", GetLastError());
313 /* No NULLs, but nonexistent pgSubject */
314 SetLastError(0xdeadbeef);
315 memset(&sdi
, 0, sizeof(SIP_DISPATCH_INFO
));
316 sdi
.cbSize
= sizeof(SIP_DISPATCH_INFO
);
317 sdi
.pfGet
= (pCryptSIPGetSignedDataMsg
)0xdeadbeef;
318 ret
= CryptSIPLoad(&dummySubject
, 0, &sdi
);
319 ok ( !ret
, "Expected CryptSIPLoad to fail\n");
320 ok ( GetLastError() == TRUST_E_SUBJECT_FORM_UNKNOWN
,
321 "Expected TRUST_E_SUBJECT_FORM_UNKNOWN, got 0x%08x\n", GetLastError());
322 ok( sdi
.pfGet
== (pCryptSIPGetSignedDataMsg
)0xdeadbeef, "Expected no change to the function pointer\n");
324 hCrypt
= GetModuleHandleA("crypt32.dll");
325 funcCryptSIPGetSignedDataMsg
= (void*)GetProcAddress(hCrypt
, "CryptSIPGetSignedDataMsg");
326 funcCryptSIPPutSignedDataMsg
= (void*)GetProcAddress(hCrypt
, "CryptSIPPutSignedDataMsg");
327 funcCryptSIPCreateIndirectData
= (void*)GetProcAddress(hCrypt
, "CryptSIPCreateIndirectData");
328 funcCryptSIPVerifyIndirectData
= (void*)GetProcAddress(hCrypt
, "CryptSIPVerifyIndirectData");
329 funcCryptSIPRemoveSignedDataMsg
= (void*)GetProcAddress(hCrypt
, "CryptSIPRemoveSignedDataMsg");
332 SetLastError(0xdeadbeef);
333 memset(&sdi
, 0, sizeof(SIP_DISPATCH_INFO
));
334 sdi
.cbSize
= sizeof(SIP_DISPATCH_INFO
);
335 sdi
.pfGet
= (pCryptSIPGetSignedDataMsg
)0xdeadbeef;
336 ret
= CryptSIPLoad(&unknown
, 0, &sdi
);
337 ok ( ret
, "Expected CryptSIPLoad to succeed\n");
338 /* On native the last error will always be ERROR_PROC_NOT_FOUND as native searches for the function DllCanUnloadNow
339 * in WINTRUST.DLL (in this case). This function is not available in WINTRUST.DLL.
340 * For now there's no need to implement this is Wine as I doubt any program will rely on
341 * this last error when the call succeeded.
343 ok( sdi
.pfGet
!= (pCryptSIPGetSignedDataMsg
)0xdeadbeef, "Expected a function pointer to be loaded.\n");
345 /* The function addresses returned by CryptSIPLoad are actually the addresses of
346 * crypt32's own functions. A function calling these addresses will end up first
347 * calling crypt32 functions which in its turn call the equivalent in the SIP
348 * as dictated by the given GUID.
350 if (funcCryptSIPGetSignedDataMsg
&& funcCryptSIPPutSignedDataMsg
&& funcCryptSIPCreateIndirectData
&&
351 funcCryptSIPVerifyIndirectData
&& funcCryptSIPRemoveSignedDataMsg
)
352 ok (sdi
.pfGet
== funcCryptSIPGetSignedDataMsg
&&
353 sdi
.pfPut
== funcCryptSIPPutSignedDataMsg
&&
354 sdi
.pfCreate
== funcCryptSIPCreateIndirectData
&&
355 sdi
.pfVerify
== funcCryptSIPVerifyIndirectData
&&
356 sdi
.pfRemove
== funcCryptSIPRemoveSignedDataMsg
,
357 "Expected function addresses to be from crypt32\n");
359 trace("Couldn't load function pointers\n");
361 /* All OK, but different GUID (same SIP though) */
362 SetLastError(0xdeadbeef);
363 memset(&sdi
, 0, sizeof(SIP_DISPATCH_INFO
));
364 sdi
.cbSize
= sizeof(SIP_DISPATCH_INFO
);
365 sdi
.pfGet
= (pCryptSIPGetSignedDataMsg
)0xdeadbeef;
366 ret
= CryptSIPLoad(&unknown2
, 0, &sdi
);
367 ok ( ret
, "Expected CryptSIPLoad to succeed\n");
368 /* This call on its own would have resulted in an ERROR_PROC_NOT_FOUND, but the previous
369 * call to CryptSIPLoad already loaded wintrust.dll. As this information is cached,
370 * CryptSIPLoad will not try to search for the already mentioned DllCanUnloadNow.
372 ok( sdi
.pfGet
!= (pCryptSIPGetSignedDataMsg
)0xdeadbeef, "Expected a function pointer to be loaded.\n");
374 /* All OK, but other SIP */
375 SetLastError(0xdeadbeef);
376 memset(&sdi
, 0, sizeof(SIP_DISPATCH_INFO
));
377 sdi
.cbSize
= sizeof(SIP_DISPATCH_INFO
);
378 sdi
.pfGet
= (pCryptSIPGetSignedDataMsg
)0xdeadbeef;
379 ret
= CryptSIPLoad(&unknown3
, 0, &sdi
);
382 /* The SIP is known so we can safely assume that the next tests can be done */
384 /* As msisip.dll is not checked yet by any of the previous calls, the
385 * function DllCanUnloadNow will be checked again in msisip.dll (it's not present)
389 ok( sdi
.pfGet
!= (pCryptSIPGetSignedDataMsg
)0xdeadbeef, "Expected a function pointer to be loaded.\n");
391 /* This is another SIP but this test proves the function addresses are the same as
392 * in the previous test.
394 if (funcCryptSIPGetSignedDataMsg
&& funcCryptSIPPutSignedDataMsg
&& funcCryptSIPCreateIndirectData
&&
395 funcCryptSIPVerifyIndirectData
&& funcCryptSIPRemoveSignedDataMsg
)
396 ok (sdi
.pfGet
== funcCryptSIPGetSignedDataMsg
&&
397 sdi
.pfPut
== funcCryptSIPPutSignedDataMsg
&&
398 sdi
.pfCreate
== funcCryptSIPCreateIndirectData
&&
399 sdi
.pfVerify
== funcCryptSIPVerifyIndirectData
&&
400 sdi
.pfRemove
== funcCryptSIPRemoveSignedDataMsg
,
401 "Expected function addresses to be from crypt32\n");
403 trace("Couldn't load function pointers\n");
407 /* Reserved parameter not 0 */
408 SetLastError(0xdeadbeef);
409 memset(&sdi
, 0, sizeof(SIP_DISPATCH_INFO
));
410 sdi
.cbSize
= sizeof(SIP_DISPATCH_INFO
);
411 sdi
.pfGet
= (pCryptSIPGetSignedDataMsg
)0xdeadbeef;
412 ret
= CryptSIPLoad(&unknown
, 1, &sdi
);
413 ok ( !ret
, "Expected CryptSIPLoad to fail\n");
414 ok ( GetLastError() == ERROR_INVALID_PARAMETER
,
415 "Expected ERROR_INVALID_PARAMETER, got 0x%08x\n", GetLastError());
416 ok( sdi
.pfGet
== (pCryptSIPGetSignedDataMsg
)0xdeadbeef, "Expected no change to the function pointer\n");
421 test_AddRemoveProvider();
422 /* It seems that the caching for loaded dlls is shared between CryptSIPRetrieveSubjectGUID
423 * and CryptSIPLoad. The tests have to be in this order to succeed. This is because in the last
424 * test for CryptSIPRetrieveSubjectGUID, several SIPs will be loaded (on Windows).
427 test_SIPRetrieveSubjectGUID();