53 DPRINT(
"RpcServerThread() called\n");
64 RegisteredProtSeq =
TRUE;
66 DPRINT1(
"RpcServerUseProtseqEpW() failed (Status %lx)\n",
Status);
75 RegisteredProtSeq =
TRUE;
77 DPRINT1(
"RpcServerUseProtseqEpW() failed (Status %lx)\n",
Status);
80 if (RegisteredProtSeq ==
FALSE)
88 DPRINT1(
"RpcServerRegisterIf() failed (Status %lx)\n",
Status);
102 DPRINT1(
"*** Other devices won't be installed correctly. If something\n");
103 DPRINT1(
"*** doesn't work, try to reboot to get a new chance.\n");
105 DPRINT(
"RpcServerThread() done\n");
164 wcscpy(szLocalDeviceInstanceID, pszDeviceInstanceID);
170 lpEnumerator = szLocalDeviceInstanceID;
186 if (lpEnumerator !=
NULL)
187 wcscpy(pszEnumerator, lpEnumerator);
189 if (lpDevice !=
NULL)
190 wcscpy(pszDevice, lpDevice);
192 if (lpInstance !=
NULL)
193 wcscpy(pszInstance, lpInstance);
208 DPRINT1(
"ClearDeviceStatus(%S 0x%lx 0x%lx)\n",
209 pszDeviceID, ulStatus, ulProblem);
218 (
PVOID)&PlugPlayData,
238 DPRINT(
"GetDeviceStatus(%S %p %p)\n",
239 pszDeviceID, pulStatus, pulProblem);
246 (
PVOID)&PlugPlayData,
273 DPRINT1(
"SetDeviceStatus(%S 0x%lx 0x%lx)\n",
274 pszDeviceID, ulStatus, ulProblem);
283 (
PVOID)&PlugPlayData,
304 DPRINT1(
"DisableDeviceInstance(%S %p %p %lu)\n",
305 pszDeviceInstance, pVetoType, pszVetoName, ulNameLength);
310 QueryRemoveData.
Flags = 0;
312 QueryRemoveData.
VetoName = pszVetoName;
324 if (pVetoType !=
NULL)
325 *pVetoType = QueryRemoveData.
VetoType;
343 INT nPartLength[3] = {0, 0, 0};
347 DPRINT(
"IsValidDeviceInstanceID(%S)\n",
348 pszDeviceInstanceID);
350 if (pszDeviceInstanceID ==
NULL)
352 DPRINT(
"Device instance ID is NULL!\n");
356 p = pszDeviceInstanceID;
364 DPRINT(
"Too many separators: %d\n", nParts);
370 nPartLength[nParts]++;
385 DPRINT(
"Invalid number of separtors: %d\n", nParts);
389 if ((nPartLength[0] == 0) ||
390 (nPartLength[1] == 0) ||
391 (nPartLength[2] == 0))
393 DPRINT(
"Invalid part lengths: %d %d %d\n",
394 nPartLength[0], nPartLength[1], nPartLength[2]);
398 DPRINT(
"Valid device instance ID!\n");
421 DWORD ulStatus, ulProblem;
438 wcscpy(szKeyName,
L"System\\CurrentControlSet\\Enum\\");
439 wcscat(szKeyName, pszDeviceID);
482 switch (ulLogConfType)
485 pszValueName =
L"BootConfig";
490 pszValueName =
L"AllocConfig";
495 pszValueName =
L"ForcedConfig";
500 pszValueName =
L"FilteredConfigVector";
505 pszValueName =
L"BasicConfigVector";
510 pszValueName =
L"OverrideConfigVector";
515 DPRINT1(
"Unsupported configuration type!\n");
532 if (*ppBuffer ==
NULL)
572 DPRINT1(
"AllocateAndInitializeSid failed\n");
580 DPRINT1(
"RpcImpersonateClient failed (Status 0x%08lx)\n", RpcStatus);
607 DPRINT1(
"PNP_NOTIFY_HANDLE_rundown(%p)\n", pHandle);
644 DPRINT(
"PNP_GetVersion(%p %p)\n",
663 DPRINT(
"PNP_GetGlobalState(%p %p 0x%08lx)\n",
683 DPRINT(
"PNP_InitDetection(%p)\n",
703 DPRINT(
"PNP_ReportLogOn(%p %u, %u)\n",
759 DPRINT(
"PNP_ValidateDeviceInstance(%p %S 0x%08lx)\n",
771 DPRINT(
"Could not open the Device Key!\n");
779 if (hDeviceKey !=
NULL)
782 DPRINT(
"PNP_ValidateDeviceInstance() done (returns %lx)\n",
ret);
800 DPRINT(
"PNP_GetRootDeviceInstance(%p %S %lu)\n",
819 DPRINT(
"PNP_GetRootDeviceInstance() done (returns %lx)\n",
ret);
830 DWORD ulRelationship,
843 DPRINT(
"PNP_GetRelatedDeviceInstance(%p %lu %S %p %p 0x%lx)\n",
844 hBinding, ulRelationship, pDeviceID, pRelatedDeviceId,
850 if (ulRelationship == PNP_GET_PARENT_DEVICE_INSTANCE)
870 else if (ulRelationship == PNP_GET_SIBLING_DEVICE_INSTANCE)
880 PlugPlayData.
Relation = ulRelationship;
886 (
PVOID)&PlugPlayData,
893 DPRINT(
"PNP_GetRelatedDeviceInstance() done (returns %lx)\n",
ret);
922 DPRINT(
"PNP_EnumerateSubKeys(%p %lu %lu %p %lu %p 0x%08lx)\n",
924 pulRequiredLen, ulFlags);
928 case PNP_ENUMERATOR_SUBKEYS:
932 case PNP_CLASS_SUBKEYS:
940 *pulRequiredLen = ulLength;
958 DPRINT(
"PNP_EnumerateSubKeys() done (returns %lx)\n",
ret);
997 PlugPlayData.
Buffer = pszBuffer;
1000 (
PVOID)&PlugPlayData,
1022 WCHAR szPathBuffer[512];
1025 DWORD dwValues,
dwSize, dwIndex, dwUsedLength, dwPathLength;
1032 L"System\\CurrentControlSet\\Services",
1038 DPRINT(
"Failed to open the services key (Error %lu)\n", dwError);
1049 DPRINT(
"Failed to open the service key (Error %lu)\n", dwError);
1061 DPRINT(
"Failed to open the service enum key (Error %lu)\n", dwError);
1076 DPRINT(
"RegQueryValueExW failed (Error %lu)\n", dwError);
1080 DPRINT(
"dwValues %lu\n", dwValues);
1085 for (dwIndex = 0; dwIndex < dwValues; dwIndex++)
1089 dwSize =
sizeof(szPathBuffer);
1099 DPRINT(
"Path: %S\n", szPathBuffer);
1101 dwPathLength =
wcslen(szPathBuffer) + 1;
1102 if (dwUsedLength + dwPathLength + 1 > *pulLength)
1108 wcscpy(pPtr, szPathBuffer);
1109 dwUsedLength += dwPathLength;
1110 pPtr += dwPathLength;
1119 if (hServiceKey !=
NULL)
1126 *pulLength = dwUsedLength + 1;
1142 WCHAR szPathBuffer[512];
1144 DWORD dwInstanceLength, dwPathLength, dwUsedLength;
1145 DWORD dwIndex, dwError;
1157 DPRINT(
"Failed to open the device key (Error %lu)\n", dwError);
1164 for (dwIndex = 0; ; dwIndex++)
1178 wsprintf(szPathBuffer,
L"%s\\%s", pszDevice, szInstanceBuffer);
1179 DPRINT(
"Path: %S\n", szPathBuffer);
1181 dwPathLength =
wcslen(szPathBuffer) + 1;
1182 if (dwUsedLength + dwPathLength + 1 > *pulLength)
1188 wcscpy(pPtr, szPathBuffer);
1189 dwUsedLength += dwPathLength;
1190 pPtr += dwPathLength;
1198 *pulLength = dwUsedLength + 1;
1213 WCHAR szPathBuffer[512];
1214 HKEY hEnumeratorKey;
1216 DWORD dwIndex, dwDeviceLength, dwUsedLength, dwRemainingLength, dwPathLength;
1228 DPRINT(
"Failed to open the enumerator key (Error %lu)\n", dwError);
1233 dwRemainingLength = *pulLength;
1236 for (dwIndex = 0; ; dwIndex++)
1250 wsprintf(szPathBuffer,
L"%s\\%s", pszEnumerator, szDeviceBuffer);
1251 DPRINT(
"Path: %S\n", szPathBuffer);
1253 dwPathLength = dwRemainingLength;
1260 dwUsedLength += dwPathLength - 1;
1261 dwRemainingLength -= dwPathLength - 1;
1262 pPtr += dwPathLength - 1;
1268 *pulLength = dwUsedLength + 1;
1284 DWORD dwIndex, dwEnumeratorLength, dwUsedLength, dwRemainingLength, dwPathLength;
1289 dwRemainingLength = *pulLength;
1292 for (dwIndex = 0; ; dwIndex++)
1298 &dwEnumeratorLength,
1303 dwPathLength = dwRemainingLength;
1310 dwUsedLength += dwPathLength - 1;
1311 dwRemainingLength -= dwPathLength - 1;
1312 pPtr += dwPathLength - 1;
1316 *pulLength = dwUsedLength + 1;
1339 DPRINT(
"PNP_GetDeviceList(%p %S %p %p 0x%08lx)\n",
1345 if (pulLength ==
NULL)
1349 (pszFilter ==
NULL))
1434 (
PVOID)&PlugPlayData,
1462 L"System\\CurrentControlSet\\Services",
1468 DPRINT(
"Failed to open the services key (Error %lu)\n", dwError);
1479 DPRINT(
"Failed to open the service key (Error %lu)\n", dwError);
1491 DPRINT(
"Failed to open the service enum key (Error %lu)\n", dwError);
1506 DPRINT(
"RegQueryValueExW failed (Error %lu)\n", dwError);
1525 DPRINT(
"RegQueryInfoKeyW failed (Error %lu)\n", dwError);
1529 DPRINT(
"dwValues %lu dwMaxValueLength %lu\n", dwValues, dwMaxValueLength /
sizeof(
WCHAR));
1532 *pulLength = dwValues * dwMaxValueLength /
sizeof(
WCHAR) + 2;
1538 if (hServiceKey !=
NULL)
1555 DWORD dwSubKeys, dwMaxSubKeyLength;
1566 DPRINT(
"Failed to open the device key (Error %lu)\n", dwError);
1585 DPRINT(
"RegQueryInfoKeyW failed (Error %lu)\n", dwError);
1587 dwMaxSubKeyLength = 0;
1594 *pulLength = dwSubKeys * (
wcslen(pszDevice) + 1 + dwMaxSubKeyLength + 1);
1607 WCHAR szPathBuffer[512];
1608 HKEY hEnumeratorKey;
1609 DWORD dwIndex, dwDeviceLength, dwBufferLength;
1623 DPRINT(
"Failed to open the enumerator key (Error %lu)\n", dwError);
1627 for (dwIndex = 0; ; dwIndex++)
1641 wsprintf(szPathBuffer,
L"%s\\%s", pszEnumerator, szDeviceBuffer);
1642 DPRINT(
"Path: %S\n", szPathBuffer);
1651 *pulLength += dwBufferLength;
1667 DWORD dwIndex, dwEnumeratorLength, dwBufferLength;
1671 for (dwIndex = 0; ; dwIndex++)
1677 &dwEnumeratorLength,
1688 *pulLength += dwBufferLength;
1709 DPRINT(
"PNP_GetDeviceListSize(%p %S %p 0x%08lx)\n",
1710 hBinding, pszFilter, pulLength, ulFlags);
1715 if (pulLength ==
NULL)
1719 (pszFilter ==
NULL))
1786 DPRINT(
"PNP_GetDepth(%p %S %p 0x%08lx)\n",
1787 hBinding, pszDeviceID, pulDepth, ulFlags);
1796 (
PVOID)&PlugPlayData,
1800 *pulDepth = PlugPlayData.
Depth;
1807 DPRINT(
"PNP_GetDepth() done (returns %lx)\n",
ret);
1820 DWORD *pulRegDataType,
1835 DPRINT(
"PNP_GetDeviceRegProp(%p %S %lu %p %p %p %p 0x%08lx)\n",
1837 pulTransferLen, pulLength, ulFlags);
1839 if (pulTransferLen ==
NULL || pulLength ==
NULL)
1858 if (*pulLength < *pulTransferLen)
1859 *pulLength = *pulTransferLen;
1861 *pulTransferLen = 0;
1866 lpValueName =
L"DeviceDesc";
1870 lpValueName =
L"HardwareID";
1874 lpValueName =
L"CompatibleIDs";
1878 lpValueName =
L"Service";
1882 lpValueName =
L"Class";
1886 lpValueName =
L"ClassGUID";
1890 lpValueName =
L"Driver";
1894 lpValueName =
L"ConfigFlags";
1898 lpValueName =
L"Mfg";
1902 lpValueName =
L"FriendlyName";
1906 lpValueName =
L"LocationInformation";
1911 *pulRegDataType =
REG_SZ;
1915 lpValueName =
L"Capabilities";
1923 lpValueName =
L"UpperFilters";
1927 lpValueName =
L"LowerFilters";
1947 *pulRegDataType =
REG_SZ;
1951 lpValueName =
L"Security";
1955 lpValueName =
L"DeviceType";
1959 lpValueName =
L"Exclusive";
1963 lpValueName =
L"DeviceCharacteristics";
1972 lpValueName =
L"UINumberDescFormat";
1991 lpValueName =
L"RemovalPolicy";
2000#if (WINVER >= _WIN32_WINNT_WS03)
2007#if (WINVER >= _WIN32_WINNT_WIN7)
2010 *pulRegDataType =
REG_SZ;
2019 DPRINT(
"Value name: %S\n", lpValueName);
2065 (
PVOID)&PlugPlayData,
2069 *pulLength = PlugPlayData.BufferSize;
2084 DPRINT(
"PNP_GetDeviceRegProp() done (returns %lx)\n",
ret);
2109 DPRINT(
"PNP_SetDeviceRegProp(%p %S %lu %lu %p %lu 0x%08lx)\n",
2119 lpValueName =
L"DeviceDesc";
2123 lpValueName =
L"HardwareID";
2127 lpValueName =
L"CompatibleIDs";
2131 lpValueName =
L"Service";
2135 lpValueName =
L"Class";
2139 lpValueName =
L"ClassGUID";
2143 lpValueName =
L"Driver";
2147 lpValueName =
L"ConfigFlags";
2151 lpValueName =
L"Mfg";
2155 lpValueName =
L"FriendlyName";
2159 lpValueName =
L"LocationInformation";
2163 lpValueName =
L"UpperFilters";
2167 lpValueName =
L"LowerFilters";
2171 lpValueName =
L"Security";
2175 lpValueName =
L"DeviceType";
2179 lpValueName =
L"Exclusive";
2183 lpValueName =
L"DeviceCharacteristics";
2187 lpValueName =
L"UINumberDescFormat";
2191 lpValueName =
L"RemovalPolicy";
2198 DPRINT(
"Value name: %S\n", lpValueName);
2226 DPRINT(
"PNP_SetDeviceRegProp() done (returns %lx)\n",
ret);
2241 WCHAR szClassGuid[40];
2242 WCHAR szClassInstance[5];
2244 HKEY hClassInstanceKey;
2245 ULONG ulTransferLength, ulDataLength;
2246 DWORD dwDataType, dwDisposition,
i;
2250 DPRINT(
"PNP_GetClassInstance(%p %S %p %lu)\n",
2251 hBinding, pDeviceId, pszClassInstance, ulLength);
2256 ulTransferLength = ulLength;
2261 (
BYTE *)pszClassInstance,
2268 ulTransferLength =
sizeof(szClassGuid);
2269 ulDataLength =
sizeof(szClassGuid);
2274 (
BYTE *)szClassGuid,
2280 DPRINT1(
"PNP_GetDeviceRegProp() failed (Error %lu)\n",
ret);
2291 DPRINT1(
"RegOpenKeyExW() failed (Error %lu)\n", dwError);
2296 for (
i = 0;
i < 10000;
i++)
2320 ulDataLength = (
wcslen(pszClassInstance) + 1) *
sizeof(
WCHAR);
2325 (
BYTE *)pszClassInstance,
2330 DPRINT1(
"PNP_SetDeviceRegProp() failed (Error %lu)\n",
ret);
2341 if (hDeviceClassKey !=
NULL)
2364 DPRINT(
"PNP_CreateKey(%p %S 0x%lx 0x%08lx)\n",
2365 hBinding, pszSubKey, samDesired, ulFlags);
2385 L"Device Parameters",
2402 if (hParametersKey !=
NULL)
2405 if (hDeviceKey !=
NULL)
2432 DWORD *pulClassCount,
2441 DPRINT(
"PNP_GetClassCount(%p %p 0x%08lx)\n",
2490 DPRINT(
"PNP_GetClassName(%p %S %p %p 0x%08lx)\n",
2493 lstrcpyW(szKeyName,
L"System\\CurrentControlSet\\Control\\Class\\");
2524 DPRINT(
"PNP_GetClassName() done (returns %lx)\n",
ret);
2542 DPRINT(
"PNP_DeleteClassKey(%p %S 0x%08lx)\n",
2556 DPRINT(
"PNP_DeleteClassKey() done (returns %lx)\n",
ret);
2567 LPWSTR pszInterfaceDevice,
2568 GUID *AliasInterfaceGuid,
2569 LPWSTR pszAliasInterfaceDevice,
2596 DPRINT(
"PNP_GetInterfaceDeviceList(%p %p %S %p %p 0x%08lx)\n",
2605 PlugPlayData.
Flags = ulFlags;
2611 (
PVOID)&PlugPlayData,
2622 DPRINT(
"PNP_GetInterfaceDeviceList() done (returns %lx)\n",
ret);
2643 DPRINT(
"PNP_GetInterfaceDeviceListSize(%p %p %p %S 0x%08lx)\n",
2655 PlugPlayData.
Flags = ulFlags;
2658 (
PVOID)&PlugPlayData,
2669 DPRINT(
"PNP_GetInterfaceDeviceListSize() done (returns %lx)\n",
ret);
2697 LPWSTR pszInterfaceDevice,
2712 DWORD *pulRegDataType,
2726 DPRINT(
"PNP_GetClassRegProp(%p %S %lu %p %p %p %p 0x%08lx)\n",
2727 hBinding, pszClassGuid, ulProperty, pulRegDataType,
2728 Buffer, pulTransferLen, pulLength, ulFlags);
2730 if (pulTransferLen ==
NULL || pulLength ==
NULL)
2742 if (*pulLength < *pulTransferLen)
2743 *pulLength = *pulTransferLen;
2745 *pulTransferLen = 0;
2750 lpValueName =
L"Security";
2754 lpValueName =
L"DeviceType";
2758 lpValueName =
L"Exclusive";
2762 lpValueName =
L"DeviceCharacteristics";
2770 DPRINT(
"Value name: %S\n", lpValueName);
2817 *pulTransferLen = *pulLength;
2819 if (hPropKey !=
NULL)
2822 if (hInstKey !=
NULL)
2825 DPRINT(
"PNP_GetClassRegProp() done (returns %lx)\n",
ret);
2851 DPRINT(
"PNP_SetClassRegProp(%p %S %lu %lu %p %lu 0x%08lx)\n",
2852 hBinding, pszClassGuid, ulProperty, ulDataType,
2853 Buffer, ulLength, ulFlags);
2861 lpValueName =
L"Security";
2865 lpValueName =
L"DeviceType";
2869 lpValueName =
L"Exclusive";
2873 lpValueName =
L"DeviceCharacteristics";
2925 if (hPropKey !=
NULL)
2928 if (hInstKey !=
NULL)
2944 HKEY hKeyEnumerator;
2998 DPRINT1(
"Instance %S already exists!\n", szInstance);
3025 DWORD dwPhantomValue = 1;
3030 (
PBYTE)&dwPhantomValue,
3031 sizeof(dwPhantomValue));
3063 DWORD dwInstanceNumber;
3072 dwInstanceNumber = 0;
3075 if (dwInstanceNumber >= 10000)
3078 swprintf(szGeneratedInstance,
L"Root\\%ls\\%04lu",
3079 pszDeviceID, dwInstanceNumber);
3091 if (
wcslen(szGeneratedInstance) > ulLength)
3097 wcscpy(pszDeviceID, szGeneratedInstance);
3110 LPWSTR pszParentDeviceID,
3120 DPRINT(
"PNP_CreateDevInst(%p %S %S %lu 0x%08lx)\n",
3121 hBinding, pszParentDeviceID, pszDeviceID, ulLength, ulFlags);
3126 if (pszDeviceID ==
NULL || pszParentDeviceID ==
NULL)
3179 sizeof(ControlData));
3202 DPRINT(
"PNP_CreateDevInst() done (returns %lx)\n",
ret);
3216 DWORD ulStatus, ulProblem;
3221 DPRINT1(
"SetupDeviceInstance(%S 0x%08lx)\n",
3222 pszDeviceInstance, ulMinorAction);
3242 dwSize =
sizeof(dwDisableCount);
3250 (dwDisableCount > 0))
3284 if (hDeviceKey !=
NULL)
3299 DPRINT(
"Enable device instance %S\n", pszDeviceInstance);
3319 DPRINT1(
"ReenumerateDeviceInstance(%S 0x%08lx)\n",
3320 pszDeviceInstance, ulMinorAction);
3327 DPRINT1(
"CM_REENUMERATE_RETRY_INSTALLATION not implemented!\n");
3332 EnumerateDeviceData.
Flags = 0;
3335 &EnumerateDeviceData,
3349 DWORD ulMajorAction,
3350 DWORD ulMinorAction,
3351 LPWSTR pszDeviceInstance1,
3352 LPWSTR pszDeviceInstance2)
3358 DPRINT(
"PNP_DeviceInstanceAction(%p %lu 0x%08lx %S %S)\n",
3359 hBinding, ulMajorAction, ulMinorAction,
3360 pszDeviceInstance1, pszDeviceInstance2);
3362 switch (ulMajorAction)
3364 case PNP_DEVINST_SETUP:
3369 case PNP_DEVINST_ENABLE:
3373 case PNP_DEVINST_REENUMERATE:
3379 DPRINT1(
"Unknown device action %lu: not implemented\n", ulMajorAction);
3383 DPRINT(
"PNP_DeviceInstanceAction() done (returns %lx)\n",
ret);
3399 DWORD ulDataType, ulTransferLength, ulLength;
3400 DWORD ulCapabilities, ulConfigFlags;
3406 DPRINT(
"PNP_GetDeviceStatus(%p %S %p %p 0x%08lx)\n",
3407 hBinding, pDeviceID, pulStatus, pulProblem, ulFlags);
3412 if ((pulStatus ==
NULL) || (pulProblem ==
NULL))
3423 ulTransferLength =
sizeof(ulCapabilities);
3424 ulLength =
sizeof(ulCapabilities);
3429 (
PBYTE)&ulCapabilities,
3440 ulTransferLength =
sizeof(ulConfigFlags);
3441 ulLength =
sizeof(ulConfigFlags);
3446 (
PBYTE)&ulConfigFlags,
3476 ULONG ulOldStatus, ulOldProblem;
3481 DPRINT1(
"PNP_SetDeviceProblem(%p %S %lu 0x%08lx)\n",
3482 hBinding, pDeviceID, ulProblem, ulFlags);
3497 (ulOldProblem != 0) &&
3498 (ulOldProblem != ulProblem))
3533 DPRINT1(
"PNP_DisableDevInst(%p %S %p %p %lu 0x%08lx)\n",
3534 hBinding, pDeviceID, pVetoType, pszVetoName, ulNameLength, ulFlags);
3570 lpPtr = lpDeviceIdList;
3574 if (0 ==
_wcsicmp(lpPtr, lpDeviceId))
3592 dwLen =
wcslen(lpDeviceId);
3593 dwPos = (*lpDeviceIdListSize /
sizeof(
WCHAR)) - 1;
3595 wcscpy(&lpDeviceIdList[dwPos], lpDeviceId);
3597 dwPos += (dwLen + 1);
3599 lpDeviceIdList[dwPos] = 0;
3601 *lpDeviceIdListSize = dwPos *
sizeof(
WCHAR);
3617 DWORD dwDeviceIdListSize;
3618 DWORD dwNewDeviceIdSize;
3623 DPRINT(
"PNP_AddID(%p %S %S 0x%08lx)\n",
3624 hBinding, pszDeviceID, pszID, ulFlags);
3632 DPRINT(
"Failed to open the device key!\n");
3645 DPRINT(
"Failed to query the desired ID string!\n");
3650 dwNewDeviceIdSize =
lstrlenW(pszDeviceID);
3651 if (!dwNewDeviceIdSize)
3657 dwDeviceIdListSize += (dwNewDeviceIdSize + 2) *
sizeof(
WCHAR);
3660 if (!pszDeviceIdList)
3662 DPRINT(
"Failed to allocate memory for the desired ID string!\n");
3674 DPRINT(
"Failed to query the desired ID string!\n");
3682 DPRINT(
"Device ID was found in the ID string!\n");
3697 DPRINT(
"Failed to set the desired ID string!\n");
3703 if (pszDeviceIdList)
3706 DPRINT(
"PNP_AddID() done (returns %lx)\n",
ret);
3720 DPRINT(
"PNP_RegisterDriver(%p %S 0x%lx)\n",
3750 DPRINT1(
"PNP_QueryRemove(%p %S %p %p %lu 0x%lx)\n",
3751 hBinding, pszDeviceID, pVetoType, pszVetoName,
3752 ulNameLength, ulFlags);
3761 if (pVetoType !=
NULL)
3764 if (pszVetoName !=
NULL && ulNameLength > 0)
3770 PlugPlayData.
VetoName = pszVetoName;
3776 sizeof(PlugPlayData));
3799 DPRINT1(
"PNP_RequestDeviceEject(%p %S %p %p %lu 0x%lx)\n",
3800 hBinding, pszDeviceID, pVetoType, pszVetoName,
3801 ulNameLength, ulFlags);
3809 if (pVetoType !=
NULL)
3812 if (pszVetoName !=
NULL && ulNameLength > 0)
3818 PlugPlayData.
VetoName = pszVetoName;
3824 sizeof(PlugPlayData));
3847 DPRINT1(
"PNP_IsDockStationPresent(%p %p)\n",
3876 else if (dwValue != 0)
3882 DPRINT1(
"PNP_IsDockStationPresent() done (returns %lx)\n",
ret);
3912 szDockDeviceInstance,
3942 DPRINT(
"PNP_HwProfFlags() called\n");
3950 L"System\\CurrentControlSet\\HardwareProfiles\\Current\\System\\CurrentControlSet\\Enum");
3955 L"System\\CurrentControlSet\\HardwareProfiles\\%04lu\\System\\CurrentControlSet\\Enum",
3966 if (ulAction == PNP_GET_HWPROFFLAGS)
3992 else if (ulAction == PNP_SET_HWPROFFLAGS)
4011 DWORD ulProfileInfoSize,
4014 WCHAR szProfileName[5];
4018 DWORD dwDisposition;
4025 DPRINT(
"PNP_GetHwProfInfo() called\n");
4027 if (ulProfileInfoSize == 0)
4046 L"System\\CurrentControlSet\\Control\\IDConfigDB",
4062 L"Hardware Profiles",
4076 if (ulIndex == (
ULONG)-1)
4126 if (hKeyProfile !=
NULL)
4129 if (hKeyProfiles !=
NULL)
4132 if (hKeyConfig !=
NULL)
4146 DWORD *pulLogConfTag,
4160 DWORD ulLogConfType,
4175 DWORD ulLogConfType,
4176 DWORD *pulLogConfTag,
4180 DWORD RegDataType = 0;
4181 ULONG ulDataSize = 0;
4185 DPRINT(
"PNP_GetFirstLogConf(%p %S %lu %p 0x%08lx)\n",
4186 hBinding, pDeviceID, ulLogConfType, pulLogConfTag, ulFlags);
4188 if (pulLogConfTag ==
NULL)
4191 *pulLogConfTag = (
DWORD)0;
4203 DPRINT1(
"OpenConfigurationKey() failed (Error %lu)\n",
ret);
4215 DPRINT1(
"GetConfigurationData() failed (Error %lu)\n",
ret);
4220 DPRINT(
"Data size %lu\n", ulDataSize);
4221 if (ulDataSize == 0 || lpData ==
NULL)
4223 DPRINT1(
"No config data available!\n");
4231 DPRINT(
"REG_RESOURCE_LIST\n");
4236 DPRINT1(
"No resource descriptors!\n");
4241 DPRINT(
"lpData %p\n", lpData);
4245 DPRINT(
"Offset (Tag): 0x%08lx\n", *pulLogConfTag);
4249 DPRINT1(
"FIXME: REG_RESOURCE_REQUIREMENTS_LIST\n");
4259 if (hConfigKey !=
NULL)
4262 DPRINT(
"PNP_GetFirstLogConf() returns %lu\n",
ret);
4274 DWORD ulLogConfType,
4280 DWORD RegDataType = 0;
4281 ULONG ulDataSize = 0;
4285 DPRINT(
"PNP_GetNextLogConf(%p %S %lu %ul %p 0x%08lx)\n",
4286 hBinding, pDeviceID, ulLogConfType, ulCurrentTag, pulNextTag, ulFlags);
4288 if (pulNextTag ==
NULL)
4291 *pulNextTag = (
DWORD)0;
4303 DPRINT1(
"OpenConfigurationKey() failed (Error %lu)\n",
ret);
4315 DPRINT1(
"GetConfigurationData() failed (Error %lu)\n",
ret);
4320 DPRINT(
"Data size %lu\n", ulDataSize);
4322 if (ulDataSize == 0 || lpData ==
NULL)
4324 DPRINT1(
"No config data available!\n");
4332 DPRINT1(
"FIXME: REG_RESOURCE_LIST\n");
4339 DPRINT1(
"FIXME: REG_RESOURCE_REQUIREMENTS_LIST\n");
4349 if (hConfigKey !=
NULL)
4352 DPRINT(
"PNP_GetNextLogConf() returns %lu\n",
ret);
4381 DWORD ulLogConfType,
4383 DWORD *pulResourceTag,
4400 DWORD ulLogConfType,
4402 DWORD ulResourceTag,
4403 DWORD *pulPreviousResType,
4404 DWORD *pulPreviousResTag,
4419 DWORD ulLogConfType,
4421 DWORD ulResourceTag,
4422 DWORD *pulNextResType,
4423 DWORD *pulNextResTag,
4427 DWORD RegDataType = 0;
4428 ULONG ulDataSize = 0;
4432 DPRINT1(
"PNP_GetNextResDes(%p %S 0x%lx %lu %lu %ul %p %p 0x%08lx)\n",
4433 hBinding, pDeviceID, ulLogConfTag, ulLogConfType, ResourceID,
4434 ulResourceTag, pulNextResType, pulNextResTag, ulFlags);
4436 if (pulNextResType ==
NULL)
4439 *pulNextResType = 0;
4451 DPRINT1(
"OpenConfigurationKey() failed (Error %lu)\n",
ret);
4463 DPRINT1(
"GetConfigurationData() failed (Error %lu)\n",
ret);
4468 DPRINT1(
"Data size %lu\n", ulDataSize);
4470 if (ulDataSize == 0 || lpData ==
NULL)
4472 DPRINT1(
"No config data available!\n");
4480 DPRINT1(
"FIXME: REG_RESOURCE_LIST\n");
4487 DPRINT1(
"FIXME: REG_RESOURCE_REQUIREMENTS_LIST\n");
4497 if (hConfigKey !=
NULL)
4500 DPRINT1(
"PNP_GetNextResDes() returns %lu\n",
ret);
4513 DWORD ulLogConfType,
4515 DWORD ulResourceTag,
4532 DWORD ulLogConfType,
4534 DWORD ulResourceTag,
4550 DWORD ulLogConfType,
4553 DWORD ulResourceTag,
4572 BOOL *pbConflictDetected,
4575 DPRINT(
"PNP_DetectResourceConflict()\n");
4577 if (pbConflictDetected !=
NULL)
4578 *pbConflictDetected =
FALSE;
4607 DWORD ulHardwareProfile,
4664 BYTE *pNotificationFilter,
4665 DWORD ulNotificationFilterSize,
4675 DPRINT1(
"PNP_RegisterNotification(%p %lx '%S' %p %lu 0x%lx %p %lx %p)\n",
4676 hBinding, ulUnknown2, pszName, pNotificationFilter,
4677 ulNotificationFilterSize, ulFlags, pNotifyHandle, ulUnknown8, pulUnknown9);
4679 if (pNotifyHandle ==
NULL)
4682 *pNotifyHandle =
NULL;
4684 if (pNotificationFilter ==
NULL ||
4685 pulUnknown9 ==
NULL)
4697 DPRINT1(
"DBT_DEVTYP_DEVICEINTERFACE\n");
4705 if (pNotifyData ==
NULL)
4708 if (pszName !=
NULL)
4723 DPRINT(
"pNotifyData: %p\n", pNotifyData);
4728 DPRINT1(
"DBT_DEVTYP_HANDLE\n");
4735 if (ulFlags & DEVICE_NOTIFY_ALL_INTERFACE_CLASSES)
4757 DPRINT1(
"PNP_UnregisterNotification(%p %p)\n",
4768 *pNotifyHandle =
NULL;
4781 DWORD *pulRegDataType,
4794 DPRINT(
"PNP_GetCustomDevProp() called\n");
4796 if (pulTransferLen ==
NULL || pulLength ==
NULL)
4811 if (*pulLength < *pulTransferLen)
4812 *pulLength = *pulTransferLen;
4814 *pulTransferLen = 0;
4828 L"Device Parameters",
4859 *pulTransferLen = *pulLength;
4861 if (hParamKey !=
NULL)
4864 if (hDeviceKey !=
NULL)
4867 DPRINT(
"PNP_GetCustomDevProp() done (returns %lx)\n",
ret);
4907 DWORD *pulSSDIFlags,
4912 DPRINT1(
"PNP_GetServerSideDeviceInstallFlags(%p %p %lu)\n",
4915 if (pulSSDIFlags ==
NULL)
4935 LPWSTR PropertyCultureName,
4953 LPWSTR PropertyCultureName,
4973 LPWSTR PropertyCultureName,