80 'L',
'P',
'T',
'P',
'o',
'r',
't',
81 'C',
'o',
'm',
'm',
'a',
'n',
'd',
'O',
'K',0};
82static const WCHAR cmd_DeletePortW[] = {
'D',
'e',
'l',
'e',
't',
'e',
'P',
'o',
'r',
't',0};
84 'T',
'r',
'a',
'n',
's',
'm',
'i',
's',
's',
'i',
'o',
'n',
85 'R',
'e',
't',
'r',
'y',
'T',
'i',
'm',
'e',
'o',
'u',
't',0};
89static const WCHAR cmd_PortIsValidW[] = {
'P',
'o',
'r',
't',
'I',
's',
'V',
'a',
'l',
'i',
'd',0};
90static WCHAR does_not_existW[] = {
'd',
'o',
'e',
's',
'_',
'n',
'o',
't',
'_',
'e',
'x',
'i',
's',
't',0};
93static WCHAR LocalPortW[] = {
'L',
'o',
'c',
'a',
'l',
' ',
'P',
'o',
'r',
't',0};
95 'S',
'y',
's',
't',
'e',
'm',
'\\',
96 'C',
'u',
'r',
'r',
'e',
'n',
't',
'C',
'o',
'n',
't',
'r',
'o',
'l',
'S',
'e',
't',
'\\',
97 'C',
'o',
'n',
't',
'r',
'o',
'l',
'\\',
98 'P',
'r',
'i',
'n',
't',
'\\',
99 'M',
'o',
'n',
'i',
't',
'o',
'r',
's',
'\\',
100 'L',
'o',
'c',
'a',
'l',
' ',
'P',
'o',
'r',
't',0};
118static WCHAR server_does_not_existW[] = {
'\\',
'\\',
'd',
'o',
'e',
's',
'_',
'n',
'o',
't',
'_',
'e',
'x',
'i',
's',
't',0};
120static const CHAR TransmissionRetryTimeoutA[] = {
'T',
'r',
'a',
'n',
's',
'm',
'i',
's',
's',
'i',
'o',
'n',
121 'R',
'e',
't',
'r',
'y',
'T',
'i',
'm',
'e',
'o',
'u',
't',0};
124 'M',
'i',
'c',
'r',
'o',
's',
'o',
'f',
't',
'\\',
125 'W',
'i',
'n',
'd',
'o',
'w',
's',
' ',
'N',
'T',
'\\',
126 'C',
'u',
'r',
'r',
'e',
'n',
't',
'V',
'e',
'r',
's',
'i',
'o',
'n',
'\\',
127 'W',
'i',
'n',
'd',
'o',
'w',
's',0};
133#define PORTNAME_PREFIX 3
134#define PORTNAME_MINSIZE 5
135#define PORTNAME_MAXSIZE 10
146 ok(0,
"should not be called\n");
153 ok(0,
"should not be called\n");
159 ok(0,
"should not be called\n");
165 ok(0,
"should not be called\n");
172 ok(0,
"should not be called\n");
181 ok(0,
"should not be called\n");
188 ok(0,
"should not be called\n");
194 ok(0,
"should not be called\n");
202 ok(0,
"should not be called\n");
232 res = pDeletePort(
NULL, 0, portname);
256 if (!pEnumPorts)
return;
258 res = pEnumPorts(
NULL, 1,
NULL, 0, &needed, &returned);
265 skip(
"no ports found\n");
271 while (
id < returned) {
304 if (!pAddPort)
return;
338 if ((!pDeletePort) && (!
hXcv)) {
339 skip(
"No API to delete a Port\n");
360 "got %u with %u (expected '0' with ERROR_INVALID_PARAMETER)\n",
371 "got %u with %u (expected '0' with ERROR_INVALID_PARAMETER)\n",
380 "got %u with %u (expected '0' with ERROR_INVALID_PARAMETER)\n",
389 "got %u with %u (expected '0' with ERROR_INVALID_PARAMETER)\n",
398 "got %u with %u (expected '0' with ERROR_INVALID_PARAMETER)\n",
412 "got %u with %u (expected '0' with ERROR_INVALID_LEVEL)\n",
421 "got %u with %u (expected '0' with ERROR_INVALID_LEVEL)\n",
429 "got %u with %u (expected '0' with ERROR_INVALID_LEVEL)\n",
448 if (!pOpenPort || !pClosePort)
return;
453 hPort = (
HANDLE) 0xdeadbeef;
455 hPort2 = (
HANDLE) 0xdeadbeef;
456 res2 = pOpenPort(
nameW, &hPort2);
458 if (res2 && (hPort2 != hPort)) {
460 res2 = pClosePort(hPort2);
461 ok(res2,
"got %u with %u (expected '!= 0')\n", res2,
GetLastError());
466 res = pClosePort(hPort);
475 hPort = (
HANDLE) 0xdeadbeef;
477 hPort2 = (
HANDLE) 0xdeadbeef;
478 res2 = pOpenPort(
nameW, &hPort2);
480 if (res2 && (hPort2 != hPort)) {
482 res2 = pClosePort(hPort2);
483 ok(res2,
"got %u with %u (expected '!= 0')\n", res2,
GetLastError());
488 res = pClosePort(hPort);
497 hPort = (
HANDLE) 0xdeadbeef;
499 hPort2 = (
HANDLE) 0xdeadbeef;
500 res2 = pOpenPort(
nameW, &hPort2);
502 if (res2 && (hPort2 != hPort)) {
504 res2 = pClosePort(hPort2);
505 ok(res2,
"got %u with %u (expected '!= 0')\n", res2,
GetLastError());
510 res = pClosePort(hPort);
541 if (!pConfigurePort)
return;
582 if (!pDeletePort)
return;
619 if (!pEnumPorts)
return;
634 "(%d) returned %d with %u and %d, %d (expected 0, 0)\n",
640 "(%d) returned %d with %u and %d, %d (expected '0' with "
641 "ERROR_INSUFFICIENT_BUFFER)\n",
651 ok(
res,
"(%d) returned %d with %u and %d, %d (expected '!= 0')\n",
659 ok(
res,
"(%d) returned %d with %u and %d, %d (expected '!= 0')\n",
667 "(%d) returned %d with %u and %d, %d (expected '0' with "
668 "ERROR_INSUFFICIENT_BUFFER)\n",
684 ok(
res,
"(%d) returned %d with %u and %d, %d (expected '!= 0')\n",
691 ok(
res,
"(%d) returned %d with %u and %d, %d (expected '!= 0')\n",
705 if (!pInitializePrintMonitor)
return;
708 res = pInitializePrintMonitor(
NULL);
711 "returned %p with %u\n (expected '!= NULL' or: NULL with "
717 "returned %p with %u\n (expected '!= NULL' or: NULL with "
725 ok(
res->dwMonitorSize ==
sizeof(
MONITOR),
"wrong dwMonitorSize %u\n",
res->dwMonitorSize);
734 if (!pInitializePrintMonitor2)
return;
738 init.hckRegistryRoot = 0;
742 monitor2 = pInitializePrintMonitor2(&
init, &
hmon);
757 if (!pOpenPort || !pClosePort)
return;
762 hPort = (
HANDLE) 0xdeadbeef;
765 ok(
res,
"got %u with %u and %p (expected '!= 0')\n",
769 hPort2 = (
HANDLE) 0xdeadbeef;
771 res2 = pOpenPort(
nameW, &hPort2);
772 ok( res2,
"got %u with %u and %p (expected '!= 0')\n",
775 if (
res) pClosePort(hPort);
776 if (res2 && (hPort2 != hPort)) pClosePort(hPort2);
782 hPort = (
HANDLE) 0xdeadbeef;
786 "got %u with %u and %p (expected '!= 0' or '0' with ERROR_ACCESS_DENIED)\n",
790 hPort2 = (
HANDLE) 0xdeadbeef;
792 res2 = pOpenPort(
nameW, &hPort2);
794 "got %u with %u and %p (expected '!= 0' or '0' with ERROR_ACCESS_DENIED)\n",
797 if (
res) pClosePort(hPort);
798 if (res2 && (hPort2 != hPort)) pClosePort(hPort2);
804 hPort = (
HANDLE) 0xdeadbeef;
807 ok(
res,
"got %u with %u and %p (expected '!= 0')\n",
811 hPort2 = (
HANDLE) 0xdeadbeef;
813 res2 = pOpenPort(
nameW, &hPort2);
814 ok( res2 && (hPort2 != hPort),
815 "got %u with %u and %p (expected '!= 0' and '!= %p')\n",
818 if (
res) pClosePort(hPort);
819 if (res2 && (hPort2 != hPort)) pClosePort(hPort2);
825 hPort = (
HANDLE) 0xdeadbeef;
832 hPort = (
HANDLE) 0xdeadbeef;
836 "got %u with 0x%x and %p (expected '0' and 0xdeadbeef)\n",
res,
GetLastError(), hPort);
837 if (
res) pClosePort(hPort);
839 hPort = (
HANDLE) 0xdeadbeef;
843 "got %u with 0x%x and %p (expected '0' and 0xdeadbeef)\n",
res,
GetLastError(), hPort);
844 if (
res) pClosePort(hPort);
849 hPort = (
HANDLE) 0xdeadbeef;
874 hXcv2 = (
HANDLE) 0xdeadbeef;
880 res = pXcvClosePort(hXcv2);
886 pXcvClosePort(hXcv2);
949 skip(
"ACCESS_DENIED\n");
959 needed =
sizeof(org_value)-1 ;
962 "returned %u and %u for \"%s\" (expected ERROR_SUCCESS or "
963 "ERROR_FILE_NOT_FOUND)\n",
res, needed, org_value);
968 needed = (
DWORD) 0xdeadbeef;
972 skip(
"'ConfigureLPTPortCommandOK' not supported\n");
976 needed =
sizeof(
buffer)-1 ;
979 "returned %d and '%s' (expected ERROR_SUCCESS and '%s')\n",
984 needed = (
DWORD) 0xdeadbeef;
988 needed =
sizeof(
buffer)-1 ;
991 "returned %d and '%s' (expected ERROR_SUCCESS and '%s')\n",
995 needed = (
DWORD) 0xdeadbeef;
999 needed =
sizeof(
buffer)-1 ;
1002 "returned %d and '%s' (expected ERROR_SUCCESS and '%s')\n",
1006 needed = (
DWORD) 0xdeadbeef;
1010 needed =
sizeof(
buffer)-1 ;
1013 "returned %d and '%s' (expected ERROR_SUCCESS and '%s')\n",
1040 needed = (
DWORD) 0xdeadbeef;
1044 "returned %d with %u (expected ERROR_SUCCESS or ERROR_FILE_NOT_FOUND)\n",
1052 needed = (
DWORD) 0xdeadbeef;
1056 "returned %d with %u (expected ERROR_FILE_NOT_FOUND)\n",
res,
GetLastError());
1076 needed = (
DWORD) 0xdeadbeef;
1080 skip(
"'GetTransmissionRetryTimeout' not supported\n");
1085 "returned %d with %u and %u (expected ERROR_INSUFFICIENT_BUFFER "
1092 skip(
"ACCESS_DENIED\n");
1102 org_value[0] =
'\0';
1103 needed =
sizeof(org_value)-1 ;
1106 "returned %u and %u for \"%s\" (expected ERROR_SUCCESS or "
1107 "ERROR_FILE_NOT_FOUND)\n",
res, needed, org_value);
1111 needed = (
DWORD) 0xdeadbeef;
1116 "returned %d with %u and %u for %d\n (expected ERROR_SUCCESS "
1122 needed = (
DWORD) 0xdeadbeef;
1127 "returned %d with %u and %u for %d\n (expected ERROR_SUCCESS "
1133 needed = (
DWORD) 0xdeadbeef;
1138 "returned %d with %u and %u for %d\n (expected ERROR_SUCCESS "
1144 needed = (
DWORD) 0xdeadbeef;
1149 "returned %d with %u and %u for %d\n (expected 'ERROR_SUCCESS' "
1154 needed = (
DWORD) 0xdeadbeef;
1159 "returned %d with %u and %u for %d\n (expected ERROR_SUCCESS "
1165 needed = (
DWORD) 0xdeadbeef;
1170 "returned %d with %u and %u for %d\n (expected ERROR_SUCCESS "
1194 needed = (
DWORD) 0xdeadbeef;
1198 skip(
"'MonitorUI' nor supported\n");
1202 "returned %d with %u and 0x%x (expected 'ERROR_INSUFFICIENT_BUFFER' "
1206 skip(
"buffer overflow (%u)\n", needed);
1212 needed = (
DWORD) 0xdeadbeef;
1216 "(expected 'ERROR_INVALID_PARAMETER')\n",
res,
GetLastError(), needed);
1227 needed = (
DWORD) 0xdeadbeef;
1236 needed = (
DWORD) 0xdeadbeef;
1240 "(expected 'ERROR_INVALID_PARAMETER')\n",
res,
GetLastError(), needed);
1243 needed = (
DWORD) 0xdeadbeef;
1252 needed = (
DWORD) 0xdeadbeef;
1256 "(expected 'ERROR_INSUFFICIENT_BUFFER')\n",
res,
GetLastError(), needed);
1260 needed = (
DWORD) 0xdeadbeef;
1272 needed = (
DWORD) 0xdeadbeef;
1287 needed = (
DWORD) 0xdeadbeef;
1291 skip(
"'PostIsValid' not supported\n");
1304 needed = (
DWORD) 0xdeadbeef;
1310 needed = (
DWORD) 0xdeadbeef;
1317 needed = (
DWORD) 0xdeadbeef;
1321 "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n",
1324 needed = (
DWORD) 0xdeadbeef;
1328 "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n",
1331 needed = (
DWORD) 0xdeadbeef;
1335 "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n",
1338 needed = (
DWORD) 0xdeadbeef;
1342 "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n",
1347 needed = (
DWORD) 0xdeadbeef;
1351 "returned %d with %u and 0x%x (expected ERROR_PATH_NOT_FOUND)\n",
1356 needed = (
DWORD) 0xdeadbeef;
1362 "(expected ERROR_INVALID_NAME, ERROR_PATH_NOT_FOUND or ERROR_ACCESS_DENIED)\n",
1367 needed = (
DWORD) 0xdeadbeef;
1371 "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n",
1375 needed = (
DWORD) 0xdeadbeef;
1379 "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n",
1383 needed = (
DWORD) 0xdeadbeef;
1387 "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n",
1391 needed = (
DWORD) 0xdeadbeef;
1395 "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n",
1400 needed = (
DWORD) 0xdeadbeef;
1404 "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n",
1412 needed = (
DWORD) 0xdeadbeef;
1437 hXcv2 = (
HANDLE) 0xdeadbeef;
1440 if (
res) pXcvClosePort(hXcv2);
1445 hXcv2 = (
HANDLE) 0xdeadbeef;
1448 if (
res) pXcvClosePort(hXcv2);
1453 hXcv2 = (
HANDLE) 0xdeadbeef;
1456 if (
res) pXcvClosePort(hXcv2);
1459 hXcv2 = (
HANDLE) 0xdeadbeef;
1462 if (
res) pXcvClosePort(hXcv2);
1468#define GET_MONITOR_FUNC(name) \
1469 if (pm) p##name = pm->Monitor.pfn##name; \
1470 else if (pm2) p##name = pm2->pfn##name;
1472#define GET_MONITOR_FUNC2(name) \
1473 if (pm) p##name = pm->Monitor.pfn##name; \
1474 else if (pm2) p##name##2 = pm2->pfn##name;
1485 skip(
"localspl.dll cannot be loaded, most likely running on Win9x\n");
1499 if (!pInitializePrintMonitor) {
1506 if (!pInitializePrintMonitor && !pInitializePrintMonitor2) {
1507 skip(
"InitializePrintMonitor or InitializePrintMonitor2 not found\n");
1515 if (pInitializePrintMonitor)
1517 else if (pInitializePrintMonitor2) {
1522 init.hckRegistryRoot = 0;
1536 ok( numentries == 14 || numentries == 17,
1537 "dwMonitorSize (%u) => %u Functions\n",
pm->
dwMonitorSize, numentries);
1541 ok( numentries >= 20,
1542 "cbSize (%u) => %u Functions\n",
pm2->
cbSize, numentries);
1563 if ((pXcvOpenPort) && (pXcvDataPort) && (pXcvClosePort)) {
1588 skip(
"Xcv not supported\n");
1601 pXcvClosePort(
hXcv);
static const WCHAR nameW[]
#define RegCloseKey(hKey)
#define ERROR_INSUFFICIENT_BUFFER
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
LONG WINAPI RegDeleteValueA(HKEY hKey, LPCSTR lpValueName)
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
#define ERROR_CALL_NOT_IMPLEMENTED
#define ERROR_INVALID_PARAMETER
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define HeapFree(x, y, z)
#define ERROR_ACCESS_DENIED
#define ERROR_INVALID_NAME
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
#define GET_MONITOR_FUNC(name)
static LONG WINAPI CloseKey(HANDLE hcKey, HANDLE hSpooler)
static WCHAR server_does_not_existW[]
static void test_XcvDataPort_GetTransmissionRetryTimeout(void)
static struct _MONITOR *static HANDLE
static WCHAR tempdirW[MAX_PATH]
static WCHAR does_not_existW[]
static const CHAR TransmissionRetryTimeoutA[]
static WCHAR Monitors_LocalPortW[]
static HANDLE hXcv_noaccess
static WCHAR num_999999W[]
static WCHAR have_file[PORTNAME_MAXSIZE]
static void test_XcvDataPort_MonitorUI(void)
static void test_OpenPort(void)
static void test_ConfigurePort(void)
static void test_XcvDataPort_AddPort(void)
static void test_XcvDataPort_PortIsValid(void)
static void find_installed_ports(void)
static void test_XcvClosePort(void)
static LONG WINAPI CreateKey(HANDLE hcKey, LPCWSTR pszSubKey, DWORD dwOptions, REGSAM samDesired, PSECURITY_ATTRIBUTES pSecurityAttributes, PHANDLE phckResult, PDWORD pdwDisposition, HANDLE hSpooler)
#define GET_MONITOR_FUNC2(name)
static const CHAR num_1A[]
static void test_XcvDataPort_ConfigureLPTPortCommandOK(void)
static void test_ClosePort(void)
static LONG WINAPI QueryValue(HANDLE hcKey, LPCWSTR pszValue, PDWORD pType, PBYTE pData, PDWORD pcbData, HANDLE hSpooler)
static LONG WINAPI OpenKey(HANDLE hcKey, LPCWSTR pszSubKey, REGSAM samDesired, PHANDLE phkResult, HANDLE hSpooler)
static WCHAR portname_lpt1W[]
static void test_InitializePrintMonitor2(void)
static LONG WINAPI QueryInfoKey(HANDLE hcKey, PDWORD pcSubKeys, PDWORD pcbKey, PDWORD pcValues, PDWORD pcbValue, PDWORD pcbData, PDWORD pcbSecurityDescriptor, PFILETIME pftLastWriteTime, HANDLE hSpooler)
static void test_AddPort(void)
static const CHAR emptyA[]
static const WCHAR cmd_PortIsValidW[]
static LONG WINAPI EnumValue(HANDLE hcKey, DWORD dwIndex, LPWSTR pszValue, PDWORD pcbValue, PDWORD pType, PBYTE pData, PDWORD pcbData, HANDLE hSpooler)
static void test_AddPortEx(void)
static void test_InitializePrintMonitor(void)
static WCHAR portname_com2W[]
static const CHAR WinNT_CV_WindowsA[]
static const WCHAR cmd_AddPortW[]
static LONG WINAPI EnumKey(HANDLE hcKey, DWORD dwIndex, LPWSTR pszName, PDWORD pcchName, PFILETIME pftLastWriteTime, HANDLE hSpooler)
static LONG WINAPI DeleteKey(HANDLE hcKey, LPCWSTR pszSubKey, HANDLE hSpooler)
static WCHAR portname_lpt2W[]
static WCHAR num_1000000W[]
static WCHAR portname_com1W[]
static const WCHAR cmd_MonitorUIW[]
static DWORD delete_port(LPWSTR portname)
static const CHAR num_999999A[]
static void test_XcvDataPort_DeletePort(void)
static WCHAR LocalPortW[]
static WCHAR portname_fileW[]
static const WCHAR cmd_ConfigureLPTPortCommandOKW[]
static const WCHAR portname_comW[]
static const WCHAR portname_lptW[]
static WCHAR tempfileW[MAX_PATH]
static const WCHAR cmd_DeletePortW[]
static const CHAR num_0A[]
static WCHAR have_lpt[PORTNAME_MAXSIZE]
static const WCHAR cmd_MonitorUI_lcaseW[]
static WCHAR have_com[PORTNAME_MAXSIZE]
static void test_DeletePort(void)
static const WCHAR cmd_GetTransmissionRetryTimeoutW[]
static void test_XcvOpenPort(void)
static void test_EnumPorts(void)
static const CHAR num_1000000A[]
int WINAPI lstrlenA(LPCSTR lpString)
#define memcpy(s1, s2, n)
#define ERROR_ALREADY_EXISTS
#define ERROR_FILE_NOT_FOUND
BOOL WINAPI XcvOpenPort(_In_ LPCWSTR pszObject, _In_ ACCESS_MASK GrantedAccess, _Out_ PHANDLE phXcv)
struct _MONITORINIT * PMONITORINIT
DWORD WINAPI XcvDataPort(_In_ HANDLE hXcv, _In_ LPCWSTR pszDataName, _In_reads_bytes_(cbInputData) PBYTE pInputData, _In_ DWORD cbInputData, _Out_writes_bytes_(cbOutputData) PBYTE pOutputData, _In_ DWORD cbOutputData, _Out_ PDWORD pcbOutputNeeded)
struct _MONITORREG MONITORREG
struct _MONITOR2 * LPMONITOR2
BOOL WINAPI ReadPort(_In_ HANDLE hPort, _Out_writes_bytes_(cbBuffer) LPBYTE pBuffer, _In_ DWORD cbBuffer, _Out_ LPDWORD pcbRead)
BOOL WINAPI XcvClosePort(_In_ HANDLE hXcv)
struct _MONITOREX * LPMONITOREX
BOOL WINAPI WritePort(_In_ HANDLE hPort, _In_reads_bytes_(cbBuf) LPBYTE pBuffer, _In_ DWORD cbBuf, _Out_ LPDWORD pcbWritten)
BOOL WINAPI OpenPort(_In_ LPWSTR pName, _Out_ PHANDLE pHandle)
BOOL WINAPI ClosePort(_In_ HANDLE hPort)
_In_opt_ LPWSTR _In_ DWORD _In_ DWORD _Out_ LPDWORD _Out_ LPDWORD pcReturned
_In_opt_ LPWSTR _In_ DWORD _In_ DWORD cbBuf
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
#define FIELD_OFFSET(t, f)
DWORD WINAPI GetLastError(void)
_In_ DWORD _Out_writes_bytes_to_opt_ pcbData void _Inout_ DWORD * pcbData
_In_ DWORD _Out_ PDWORD pcbNeeded
#define ERROR_INVALID_LEVEL
#define ERROR_PATH_NOT_FOUND
#define HKEY_LOCAL_MACHINE
#define SERVER_ALL_ACCESS
#define SERVER_ACCESS_ADMINISTER