Further unified HAL and HEL mixing, and added some more intelligence
[wine/multimedia.git] / programs / regtest / regtest.c
blob0ad64f5ce85f68fcb77695dda74138a5f0017f37
1 /*
2 * Registry testing program
4 * Copyright 1998 Matthew Becker
6 * The return codes were generated in an NT40 environment, using lcc-win32
8 * NOTES
9 * When compiling under lcc-win32, I get three (3) warning, but they all
10 * seem to be issues with lcc.
12 * If creating a new testing sequence, please try to clean up any
13 * registry changes that are made.
16 #include <stdio.h>
17 #include <malloc.h>
18 #include <windows.h>
19 #include <winreg.h>
20 #include <winerror.h>
21 #include <winnt.h>
23 #ifndef __GNUC__
24 #define __FUNCTION__ "<function>"
25 #endif
27 /* True this when security is implemented */
28 #define CHECK_SAM FALSE
30 #define xERROR(s,d) fprintf(stderr, "%s:#%d(Status=%ld)\n", __FUNCTION__,s,d)
33 * NOTES: These individual routines are listed in alphabetical order.
35 * They are meant to test error conditions. Success conditions are
36 * tested in the sequences found at the end.
39 /******************************************************************************
40 * TestCloseKey
42 void TestCloseKey()
44 long lSts;
46 lSts = RegCloseKey((HKEY)2);
47 if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
49 lSts = RegCloseKey(HKEY_LOCAL_MACHINE);
50 if (lSts != ERROR_SUCCESS) xERROR(2,lSts);
52 /* Check twice just for kicks */
53 lSts = RegCloseKey(HKEY_LOCAL_MACHINE);
54 if (lSts != ERROR_SUCCESS) xERROR(3,lSts);
57 /******************************************************************************
58 * TestConnectRegistry
60 void TestConnectRegistry()
62 long lSts;
63 HKEY hkey;
65 lSts = RegConnectRegistry("",(HKEY)2,&hkey);
66 if (lSts != ERROR_SUCCESS) xERROR(1,lSts);
68 lSts = RegConnectRegistry("",HKEY_LOCAL_MACHINE,&hkey);
69 if (lSts != ERROR_SUCCESS) xERROR(2,lSts);
71 #if TOO_SLOW
72 lSts = RegConnectRegistry("\\\\regtest",HKEY_LOCAL_MACHINE,&hkey);
73 if (lSts != ERROR_BAD_NETPATH) xERROR(3,lSts);
74 #endif
77 /******************************************************************************
78 * TestCreateKey
80 void TestCreateKey()
82 long lSts;
83 HKEY hkey;
85 lSts = RegCreateKey((HKEY)2,"",&hkey);
86 if (lSts != ERROR_BADKEY) xERROR(1,lSts);
88 lSts = RegCreateKey(HKEY_LOCAL_MACHINE,"",&hkey);
89 if (lSts != ERROR_SUCCESS) xERROR(2,lSts);
90 RegCloseKey(hkey);
92 lSts = RegCreateKey(HKEY_LOCAL_MACHINE,"\\asdf",&hkey);
93 if (lSts != ERROR_BAD_PATHNAME) xERROR(3,lSts);
95 #if 0
96 lSts = RegCreateKey(HKEY_LOCAL_MACHINE,"asdf\\",&hkey);
97 if (lSts != ERROR_INVALID_PARAMETER) xERROR(4,lSts);
98 #endif
100 lSts = RegCreateKey(HKEY_LOCAL_MACHINE,"\\asdf\\",&hkey);
101 if (lSts != ERROR_BAD_PATHNAME) xERROR(5,lSts);
104 /******************************************************************************
105 * TestCreateKeyEx
107 void TestCreateKeyEx()
109 long lSts;
110 HKEY hkey;
111 DWORD dwDisp;
113 lSts = RegCreateKeyEx((HKEY)2,"",0,"",0,0,NULL,&hkey,&dwDisp);
114 if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
116 lSts = RegCreateKeyEx(HKEY_LOCAL_MACHINE,"regtest",0,"",0,0,NULL,&hkey,
117 &dwDisp);
118 if (lSts != ERROR_INVALID_PARAMETER) xERROR(2,lSts);
120 lSts = RegCreateKeyEx(HKEY_LOCAL_MACHINE,"regtest",0,"asdf",0,
121 KEY_ALL_ACCESS,NULL,&hkey,&dwDisp);
122 if (lSts != ERROR_INVALID_PARAMETER) xERROR(3,lSts);
124 lSts = RegCreateKeyEx(HKEY_LOCAL_MACHINE,"regtest",0,"",0,
125 KEY_ALL_ACCESS,NULL,&hkey,&dwDisp);
126 if (lSts != ERROR_INVALID_PARAMETER) xERROR(4,lSts);
130 /******************************************************************************
131 * TestCreateKeyEx
133 void TestCreateKeyEx1()
135 long lSts;
136 HKEY hkey,hkeyP;
137 DWORD dwDisp;
138 char keyname[]="regtest1";
140 lSts = RegOpenKeyEx(HKEY_LOCAL_MACHINE,"SOFTWARE",0,1,&hkeyP);
141 if (lSts != ERROR_SUCCESS)
143 xERROR(1,lSts);
144 return;
146 lSts = RegCreateKeyEx(hkeyP,keyname,0,0,0,0xf003f,0,&hkey,&dwDisp);
147 if (lSts != ERROR_SUCCESS)
149 xERROR(2,lSts);
150 RegCloseKey(hkeyP);
151 return;
153 lSts = RegDeleteKey( hkeyP,keyname);
154 if (lSts != ERROR_SUCCESS) xERROR(3,lSts);
155 RegCloseKey(hkeyP);
158 /******************************************************************************
159 * TestDeleteKey
161 void TestDeleteKey()
163 long lSts;
165 lSts = RegDeleteKey((HKEY)2, "asdf");
166 if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
168 lSts = RegDeleteKey(HKEY_CURRENT_USER, "asdf");
169 if (lSts != ERROR_FILE_NOT_FOUND) xERROR(2,lSts);
171 #if CHECK_SAM
172 lSts = RegDeleteKey(HKEY_CURRENT_USER, "");
173 if (lSts != ERROR_ACCESS_DENIED) xERROR(3,lSts);
174 #endif
177 /******************************************************************************
178 * TestDeleteValue
180 void TestDeleteValue()
182 long lSts;
184 lSts = RegDeleteValue((HKEY)2, "asdf");
185 if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
187 lSts = RegDeleteValue(HKEY_CURRENT_USER, "");
188 if (lSts != ERROR_FILE_NOT_FOUND) xERROR(2,lSts);
190 lSts = RegDeleteValue(HKEY_CURRENT_USER, "asdf");
191 if (lSts != ERROR_FILE_NOT_FOUND) xERROR(3,lSts);
193 lSts = RegDeleteValue(HKEY_CURRENT_USER, "\\asdf");
194 if (lSts != ERROR_FILE_NOT_FOUND) xERROR(4,lSts);
197 /******************************************************************************
198 * TestEnumKey
200 void TestEnumKey()
202 long lSts;
203 char *sVal;
204 long lVal;
206 lVal = 1;
207 sVal = (char *)malloc(lVal * sizeof(char));
209 lSts = RegEnumKey((HKEY)2,3,sVal,lVal);
210 if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
212 lSts = RegEnumKey(HKEY_CURRENT_USER,-1,sVal,lVal);
213 if (lSts != ERROR_NO_MORE_ITEMS) xERROR(2,lSts);
215 lSts = RegEnumKey(HKEY_CURRENT_USER,0,sVal,lVal);
216 if (lSts != ERROR_MORE_DATA) xERROR(3,lSts);
219 /******************************************************************************
220 * TestEnumKeyEx
222 void TestEnumKeyEx()
224 long lSts;
225 char *sVal;
226 char *sClass;
227 unsigned long lLen1;
228 unsigned long lLen2;
229 FILETIME ft;
231 lLen1 = 1;
232 sVal = (char *)malloc(lLen1 * sizeof(char));
233 lLen2 = 1;
234 sClass = (char *)malloc(lLen2 * sizeof(char));
236 lSts = RegEnumKeyEx((HKEY)2,0,sVal,&lLen1,0,sClass,&lLen2,&ft);
237 if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
239 lSts = RegEnumKeyEx(HKEY_LOCAL_MACHINE,0,sVal,&lLen1,0,sClass,&lLen2,&ft);
240 if (lSts != ERROR_MORE_DATA) xERROR(2,lSts);
242 lSts = RegEnumKeyEx(HKEY_LOCAL_MACHINE,0,sVal,&lLen1,0,sClass,&lLen2,&ft);
243 if (lSts != ERROR_MORE_DATA) xERROR(3,lSts);
246 /******************************************************************************
247 * TestEnumValue
249 void TestEnumValue()
251 long lSts;
252 char *sVal;
253 unsigned long lVal;
254 unsigned long lType;
255 unsigned long lLen1;
256 char *bVal;
258 lVal = 1;
259 sVal = (char *)malloc(lVal * sizeof(char));
260 lLen1 = 1;
261 bVal = (char *)malloc(lLen1 * sizeof(char));
263 lSts = RegEnumValue((HKEY)2,-1,sVal,&lVal,0,&lType,NULL,&lLen1);
264 if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
266 lSts = RegEnumValue(HKEY_LOCAL_MACHINE,-1,sVal,&lVal,0,&lType,NULL,&lLen1);
267 if (lSts != ERROR_NO_MORE_ITEMS) xERROR(2,lSts);
269 lSts = RegEnumValue(HKEY_LOCAL_MACHINE,0,sVal,&lVal,0,&lType,NULL,&lLen1);
270 if (lSts != ERROR_SUCCESS) xERROR(3,lSts);
272 lSts = RegEnumValue(HKEY_LOCAL_MACHINE,0,sVal,&lVal,0,NULL,NULL,&lLen1);
273 if (lSts != ERROR_SUCCESS) xERROR(4,lSts);
275 lSts = RegEnumValue(HKEY_LOCAL_MACHINE,1,sVal,&lVal,0,&lType,bVal,&lLen1);
276 if (lSts != ERROR_NO_MORE_ITEMS) xERROR(5,lSts);
279 /******************************************************************************
280 * TestFlushKey
282 void TestFlushKey()
284 long lSts;
286 lSts = RegFlushKey((HKEY)2);
287 if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
289 lSts = RegFlushKey(HKEY_LOCAL_MACHINE);
290 if (lSts != ERROR_SUCCESS) xERROR(2,lSts);
293 /******************************************************************************
294 * TestGetKeySecurity
296 void TestGetKeySecurity()
298 long lSts;
299 SECURITY_INFORMATION si;
300 SECURITY_DESCRIPTOR sd;
301 unsigned long lLen;
303 lLen = sizeof(sd);
304 si = 0;
305 lSts = RegGetKeySecurity((HKEY)2,si,&sd,&lLen);
306 if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
308 lSts = RegGetKeySecurity(HKEY_LOCAL_MACHINE,si,&sd,&lLen);
309 if (lSts != ERROR_INSUFFICIENT_BUFFER) xERROR(2,lSts);
311 si = GROUP_SECURITY_INFORMATION;
312 lSts = RegGetKeySecurity(HKEY_LOCAL_MACHINE,si,&sd,&lLen);
313 if (lSts != ERROR_SUCCESS) xERROR(3,lSts);
316 /******************************************************************************
317 * TestLoadKey
319 void TestLoadKey()
321 long lSts;
323 lSts = RegLoadKey((HKEY)2,"","");
324 if (lSts != ERROR_INVALID_PARAMETER) xERROR(1,lSts);
326 lSts = RegLoadKey(HKEY_CURRENT_USER,"","");
327 if (lSts != ERROR_INVALID_PARAMETER) xERROR(2,lSts);
329 lSts = RegLoadKey(HKEY_CURRENT_USER,"regtest","");
330 if (lSts != ERROR_INVALID_PARAMETER) xERROR(3,lSts);
332 lSts = RegLoadKey(HKEY_CURRENT_USER,"\\regtest","");
333 if (lSts != ERROR_INVALID_PARAMETER) xERROR(4,lSts);
335 #if CHECK_SAM
336 lSts = RegLoadKey(HKEY_CURRENT_USER,"regtest","regtest.dat");
337 if (lSts != ERROR_PRIVILEGE_NOT_HELD) xERROR(5,lSts);
339 lSts = RegLoadKey(HKEY_CURRENT_USER,"\\regtest","regtest.dat");
340 if (lSts != ERROR_PRIVILEGE_NOT_HELD) xERROR(6,lSts);
341 #endif
344 /******************************************************************************
345 * TestNotifyChangeKeyValue
347 void TestNotifyChangeKeyValue()
349 long lSts;
350 HANDLE hEvent;
352 hEvent = (HANDLE)0;
354 lSts = RegNotifyChangeKeyValue((HKEY)2, TRUE, REG_NOTIFY_CHANGE_NAME, 0, 0);
355 if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
357 lSts = RegNotifyChangeKeyValue(HKEY_CURRENT_USER, TRUE, REG_NOTIFY_CHANGE_NAME, 0, 1);
358 if (lSts != ERROR_INVALID_PARAMETER) xERROR(2,lSts);
360 hEvent = (HANDLE)HKEY_CURRENT_USER;
361 lSts = RegNotifyChangeKeyValue(HKEY_CURRENT_USER, TRUE, REG_NOTIFY_CHANGE_NAME, hEvent, 1);
362 if (lSts != ERROR_INVALID_HANDLE) xERROR(3,lSts);
365 /******************************************************************************
366 * TestOpenKey
368 void TestOpenKey()
370 long lSts;
371 HKEY hkey;
373 lSts = RegOpenKey((HKEY)72, "",&hkey);
374 if (lSts != ERROR_SUCCESS) xERROR(1,lSts);
375 RegCloseKey(hkey);
377 lSts = RegOpenKey((HKEY)2, "regtest",&hkey);
378 if (lSts != ERROR_INVALID_HANDLE) xERROR(2,lSts);
380 lSts = RegOpenKey(HKEY_CURRENT_USER, "regtest",&hkey);
381 if (lSts != ERROR_FILE_NOT_FOUND) xERROR(3,lSts);
383 lSts = RegOpenKey(HKEY_CURRENT_USER, "\\regtest",&hkey);
384 if (lSts != ERROR_BAD_PATHNAME) xERROR(4,lSts);
387 /******************************************************************************
388 * TestOpenKeyEx
390 void TestOpenKeyEx()
392 long lSts;
393 HKEY hkey;
395 lSts = RegOpenKeyEx((HKEY)2,"",0,KEY_ALL_ACCESS,&hkey);
396 if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
398 lSts = RegOpenKeyEx(HKEY_CURRENT_USER,"\\regtest",0,KEY_ALL_ACCESS,&hkey);
399 if (lSts != ERROR_BAD_PATHNAME) xERROR(2,lSts);
401 lSts = RegOpenKeyEx(HKEY_CURRENT_USER,"regtest",0,0,&hkey);
402 if (lSts != ERROR_FILE_NOT_FOUND) xERROR(3,lSts);
404 lSts = RegOpenKeyEx(HKEY_CURRENT_USER,"regtest\\",0,0,&hkey);
405 if (lSts != ERROR_FILE_NOT_FOUND) xERROR(4,lSts);
408 /******************************************************************************
409 * TestQueryInfoKey
411 void TestQueryInfoKey()
413 long lSts;
414 char *sClass;
415 unsigned long lClass;
416 unsigned long lSubKeys;
417 unsigned long lMaxSubLen;
418 unsigned long lMaxClassLen;
419 unsigned long lValues;
420 unsigned long lMaxValNameLen;
421 unsigned long lMaxValLen;
422 unsigned long lSecDescLen;
423 FILETIME ft;
425 lClass = 1;
426 sClass = (char *)malloc(lClass * sizeof(char));
428 lSts = RegQueryInfoKey((HKEY)2,sClass,&lClass,0,&lSubKeys,&lMaxSubLen,
429 &lMaxClassLen,&lValues,&lMaxValNameLen,&lMaxValLen,
430 &lSecDescLen, &ft);
431 if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
433 lSts = RegQueryInfoKey(HKEY_CURRENT_USER,sClass,&lClass,0,&lSubKeys,
434 &lMaxSubLen,&lMaxClassLen,&lValues,&lMaxValNameLen,
435 &lMaxValLen,&lSecDescLen, &ft);
436 if (lSts != ERROR_SUCCESS) xERROR(2,lSts);
439 /******************************************************************************
440 * TestQueryValue
442 void TestQueryValue()
444 long lSts;
445 long lLen;
446 char *sVal;
448 sVal = (char *)malloc(80 * sizeof(char));
449 lLen = strlen(sVal);
451 lSts = RegQueryValue((HKEY)2,"",NULL,&lLen);
452 if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
454 lSts = RegQueryValue(HKEY_CURRENT_USER,"",NULL,&lLen);
455 if (lSts != ERROR_SUCCESS) xERROR(2,lSts);
457 lSts = RegQueryValue(HKEY_CURRENT_USER,"\\regtest",NULL,&lLen);
458 if (lSts != ERROR_BAD_PATHNAME) xERROR(3,lSts);
460 lSts = RegQueryValue(HKEY_CURRENT_USER,"",sVal,&lLen);
461 if (lSts != ERROR_SUCCESS) xERROR(4,lSts);
464 /******************************************************************************
465 * TestQueryValueEx
467 void TestQueryValueEx()
469 char *sVal;
470 long lSts;
471 unsigned long lType;
472 unsigned long lLen;
474 lLen = 80;
475 sVal = (char *)malloc(lLen * sizeof(char));
477 lSts = RegQueryValueEx((HKEY)2,"",0,&lType,sVal,&lLen);
478 if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
480 lSts = RegQueryValueEx(HKEY_CURRENT_USER,"",(LPDWORD)1,&lType,sVal,&lLen);
481 if (lSts != ERROR_INVALID_PARAMETER) xERROR(2,lSts);
483 lSts = RegQueryValueEx(HKEY_LOCAL_MACHINE,"",0,&lType,sVal,&lLen);
484 if (lSts != ERROR_SUCCESS) xERROR(3,lSts);
487 /******************************************************************************
488 * TestReplaceKey
490 void TestReplaceKey()
492 long lSts;
494 lSts = RegReplaceKey((HKEY)2,"","","");
495 if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
497 #if CHECK_SAM
498 lSts = RegReplaceKey(HKEY_LOCAL_MACHINE,"","","");
499 if (lSts != ERROR_ACCESS_DENIED) xERROR(2,lSts);
501 lSts = RegReplaceKey(HKEY_LOCAL_MACHINE,"Software","","");
502 if (lSts != ERROR_ACCESS_DENIED) xERROR(3,lSts);
503 #endif
506 /******************************************************************************
507 * TestRestoreKey
509 void TestRestoreKey()
511 long lSts;
513 lSts = RegRestoreKey((HKEY)2,"",0);
514 if (lSts != ERROR_INVALID_PARAMETER) xERROR(1,lSts);
516 lSts = RegRestoreKey(HKEY_LOCAL_MACHINE,"",0);
517 if (lSts != ERROR_INVALID_PARAMETER) xERROR(2,lSts);
519 lSts = RegRestoreKey(HKEY_LOCAL_MACHINE,"a.a",0);
520 if (lSts != ERROR_FILE_NOT_FOUND) xERROR(3,lSts);
523 /******************************************************************************
524 * TestSaveKey
526 void TestSaveKey()
528 long lSts;
530 lSts = RegSaveKey((HKEY)2,"",NULL);
531 if (lSts != ERROR_INVALID_PARAMETER) xERROR(1,lSts);
533 lSts = RegSaveKey(HKEY_LOCAL_MACHINE,"",NULL);
534 if (lSts != ERROR_INVALID_PARAMETER) xERROR(2,lSts);
536 #if CHECK_SAM
537 lSts = RegSaveKey(HKEY_LOCAL_MACHINE,"a.a",NULL);
538 if (lSts != ERROR_PRIVILEGE_NOT_HELD) xERROR(3,lSts);
539 #endif
542 /******************************************************************************
543 * TestSetKeySecurity
545 void TestSetKeySecurity()
547 long lSts;
548 SECURITY_DESCRIPTOR sd;
550 lSts = RegSetKeySecurity((HKEY)2,0,NULL);
551 if (lSts != ERROR_INVALID_PARAMETER) xERROR(1,lSts);
553 lSts = RegSetKeySecurity(HKEY_LOCAL_MACHINE,0,NULL);
554 if (lSts != ERROR_INVALID_PARAMETER) xERROR(2,lSts);
556 lSts = RegSetKeySecurity(HKEY_LOCAL_MACHINE,OWNER_SECURITY_INFORMATION,NULL);
557 if (lSts != ERROR_INVALID_PARAMETER) xERROR(3,lSts);
559 lSts = RegSetKeySecurity(HKEY_LOCAL_MACHINE,OWNER_SECURITY_INFORMATION,&sd);
560 if (lSts != ERROR_INVALID_PARAMETER) xERROR(4,lSts);
563 /******************************************************************************
564 * TestSetValue
566 void TestSetValue()
568 #if MAKE_NT_CRASH
569 long lSts;
570 #endif
572 #if MAKE_NT_CRASH
573 lSts = RegSetValue((HKEY)2,"",0,NULL,0);
574 if (lSts != ERROR_INVALID_PARAMETER) xERROR(1,lSts);
575 #endif
577 #if MAKE_NT_CRASH
578 lSts = RegSetValue((HKEY)2,"regtest",0,NULL,0);
579 if (lSts != ERROR_INVALID_PARAMETER) xERROR(2,lSts);
580 #endif
582 #if MAKE_NT_CRASH
583 lSts = RegSetValue((HKEY)2,"regtest",REG_SZ,NULL,0);
584 if (lSts != ERROR_INVALID_HANDLE) xERROR(3,lSts);
585 #endif
587 #if MAKE_NT_CRASH
588 lSts = RegSetValue(HKEY_LOCAL_MACHINE,"regtest",REG_SZ,NULL,0);
589 if (lSts != ERROR_INVALID_HANDLE) xERROR(4,lSts);
590 #endif
593 /******************************************************************************
594 * TestSetValueEx
596 void TestSetValueEx()
598 long lSts;
600 lSts = RegSetValueEx((HKEY)2,"",0,0,NULL,0);
601 if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
603 lSts = RegSetValueEx(HKEY_LOCAL_MACHINE,"",0,0,NULL,0);
604 if (lSts != ERROR_SUCCESS) xERROR(2,lSts);
607 /******************************************************************************
608 * TestUnLoadKey
610 void TestUnLoadKey()
612 #if CHECK_SAM
613 long lSts;
614 #endif
616 #if CHECK_SAM
617 lSts = RegUnLoadKey((HKEY)2,"");
618 if (lSts != ERROR_PRIVILEGE_NOT_HELD) xERROR(1,lSts);
620 lSts = RegUnLoadKey(HKEY_LOCAL_MACHINE,"");
621 if (lSts != ERROR_PRIVILEGE_NOT_HELD) xERROR(2,lSts);
623 lSts = RegUnLoadKey(HKEY_LOCAL_MACHINE,"\\regtest");
624 if (lSts != ERROR_PRIVILEGE_NOT_HELD) xERROR(3,lSts);
625 #endif
628 /******************************************************************************
629 * TestSequence1
631 void TestSequence1()
633 HKEY hkey;
634 long lSts;
636 lSts = RegCreateKey(HKEY_CURRENT_USER,"regtest",&hkey);
637 if (lSts != ERROR_SUCCESS) xERROR(1,lSts);
639 /* fprintf(stderr, " hkey=0x%x\n", hkey); */
641 lSts = RegDeleteKey(HKEY_CURRENT_USER, "regtest");
642 if (lSts != ERROR_SUCCESS) xERROR(2,lSts);
643 lSts = RegCloseKey(hkey);
644 if (lSts != ERROR_SUCCESS) xERROR(3,lSts);
648 int PASCAL WinMain (HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
651 /* These can be in any order */
652 TestCloseKey();
653 TestConnectRegistry();
654 TestCreateKey();
655 TestCreateKeyEx();
656 TestDeleteKey();
657 TestDeleteValue();
658 TestEnumKey();
659 TestEnumKeyEx();
660 TestEnumValue();
661 TestFlushKey();
662 TestGetKeySecurity();
663 TestLoadKey();
664 TestNotifyChangeKeyValue();
665 TestOpenKey();
666 TestOpenKeyEx();
667 TestQueryInfoKey();
668 TestQueryValue();
669 TestQueryValueEx();
670 TestReplaceKey();
671 TestRestoreKey();
672 TestSaveKey();
673 TestSetKeySecurity();
674 TestSetValue();
675 TestSetValueEx();
676 TestUnLoadKey();
677 TestCreateKeyEx1();
679 /* Now we have some sequence testing */
680 TestSequence1();
682 return 0;