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;
440 wcscpy(szKeyName,
L"System\\CurrentControlSet\\Enum\\");
441 wcscat(szKeyName, pszDeviceID);
452 switch (ulLogConfType)
456 pszSubKeyName =
L"LogConf";
461 pszSubKeyName =
L"Control";
465 DPRINT1(
"Unsupported configuration type!\n");
501 switch (ulLogConfType)
504 pszValueName =
L"BootConfig";
509 pszValueName =
L"AllocConfig";
514 pszValueName =
L"ForcedConfig";
519 pszValueName =
L"FilteredConfigVector";
524 pszValueName =
L"BasicConfigVector";
529 pszValueName =
L"OverrideConfigVector";
534 DPRINT1(
"Unsupported configuration type!\n");
551 if (*ppBuffer ==
NULL)
591 DPRINT1(
"AllocateAndInitializeSid failed\n");
599 DPRINT1(
"RpcImpersonateClient failed (Status 0x%08lx)\n", RpcStatus);
626 DPRINT1(
"PNP_NOTIFY_HANDLE_rundown(%p)\n", pHandle);
663 DPRINT(
"PNP_GetVersion(%p %p)\n",
682 DPRINT(
"PNP_GetGlobalState(%p %p 0x%08lx)\n",
702 DPRINT(
"PNP_InitDetection(%p)\n",
722 DPRINT(
"PNP_ReportLogOn(%p %u, %u)\n",
778 DPRINT(
"PNP_ValidateDeviceInstance(%p %S 0x%08lx)\n",
790 DPRINT(
"Could not open the Device Key!\n");
798 if (hDeviceKey !=
NULL)
801 DPRINT(
"PNP_ValidateDeviceInstance() done (returns %lx)\n",
ret);
819 DPRINT(
"PNP_GetRootDeviceInstance(%p %S %lu)\n",
838 DPRINT(
"PNP_GetRootDeviceInstance() done (returns %lx)\n",
ret);
849 DWORD ulRelationship,
862 DPRINT(
"PNP_GetRelatedDeviceInstance(%p %lu %S %p %p 0x%lx)\n",
863 hBinding, ulRelationship, pDeviceID, pRelatedDeviceId,
869 if (ulRelationship == PNP_GET_PARENT_DEVICE_INSTANCE)
889 else if (ulRelationship == PNP_GET_SIBLING_DEVICE_INSTANCE)
899 PlugPlayData.
Relation = ulRelationship;
905 (
PVOID)&PlugPlayData,
912 DPRINT(
"PNP_GetRelatedDeviceInstance() done (returns %lx)\n",
ret);
941 DPRINT(
"PNP_EnumerateSubKeys(%p %lu %lu %p %lu %p 0x%08lx)\n",
943 pulRequiredLen, ulFlags);
947 case PNP_ENUMERATOR_SUBKEYS:
951 case PNP_CLASS_SUBKEYS:
959 *pulRequiredLen = ulLength;
977 DPRINT(
"PNP_EnumerateSubKeys() done (returns %lx)\n",
ret);
1016 PlugPlayData.
Buffer = pszBuffer;
1019 (
PVOID)&PlugPlayData,
1041 WCHAR szPathBuffer[512];
1044 DWORD dwValues,
dwSize, dwIndex, dwUsedLength, dwPathLength;
1051 L"System\\CurrentControlSet\\Services",
1057 DPRINT(
"Failed to open the services key (Error %lu)\n", dwError);
1068 DPRINT(
"Failed to open the service key (Error %lu)\n", dwError);
1080 DPRINT(
"Failed to open the service enum key (Error %lu)\n", dwError);
1095 DPRINT(
"RegQueryValueExW failed (Error %lu)\n", dwError);
1099 DPRINT(
"dwValues %lu\n", dwValues);
1104 for (dwIndex = 0; dwIndex < dwValues; dwIndex++)
1108 dwSize =
sizeof(szPathBuffer);
1118 DPRINT(
"Path: %S\n", szPathBuffer);
1120 dwPathLength =
wcslen(szPathBuffer) + 1;
1121 if (dwUsedLength + dwPathLength + 1 > *pulLength)
1127 wcscpy(pPtr, szPathBuffer);
1128 dwUsedLength += dwPathLength;
1129 pPtr += dwPathLength;
1138 if (hServiceKey !=
NULL)
1145 *pulLength = dwUsedLength + 1;
1161 WCHAR szPathBuffer[512];
1163 DWORD dwInstanceLength, dwPathLength, dwUsedLength;
1164 DWORD dwIndex, dwError;
1176 DPRINT(
"Failed to open the device key (Error %lu)\n", dwError);
1183 for (dwIndex = 0; ; dwIndex++)
1197 wsprintf(szPathBuffer,
L"%s\\%s", pszDevice, szInstanceBuffer);
1198 DPRINT(
"Path: %S\n", szPathBuffer);
1200 dwPathLength =
wcslen(szPathBuffer) + 1;
1201 if (dwUsedLength + dwPathLength + 1 > *pulLength)
1207 wcscpy(pPtr, szPathBuffer);
1208 dwUsedLength += dwPathLength;
1209 pPtr += dwPathLength;
1217 *pulLength = dwUsedLength + 1;
1232 WCHAR szPathBuffer[512];
1233 HKEY hEnumeratorKey;
1235 DWORD dwIndex, dwDeviceLength, dwUsedLength, dwRemainingLength, dwPathLength;
1247 DPRINT(
"Failed to open the enumerator key (Error %lu)\n", dwError);
1252 dwRemainingLength = *pulLength;
1255 for (dwIndex = 0; ; dwIndex++)
1269 wsprintf(szPathBuffer,
L"%s\\%s", pszEnumerator, szDeviceBuffer);
1270 DPRINT(
"Path: %S\n", szPathBuffer);
1272 dwPathLength = dwRemainingLength;
1279 dwUsedLength += dwPathLength - 1;
1280 dwRemainingLength -= dwPathLength - 1;
1281 pPtr += dwPathLength - 1;
1287 *pulLength = dwUsedLength + 1;
1303 DWORD dwIndex, dwEnumeratorLength, dwUsedLength, dwRemainingLength, dwPathLength;
1308 dwRemainingLength = *pulLength;
1311 for (dwIndex = 0; ; dwIndex++)
1317 &dwEnumeratorLength,
1322 dwPathLength = dwRemainingLength;
1329 dwUsedLength += dwPathLength - 1;
1330 dwRemainingLength -= dwPathLength - 1;
1331 pPtr += dwPathLength - 1;
1335 *pulLength = dwUsedLength + 1;
1358 DPRINT(
"PNP_GetDeviceList(%p %S %p %p 0x%08lx)\n",
1364 if (pulLength ==
NULL)
1368 (pszFilter ==
NULL))
1453 (
PVOID)&PlugPlayData,
1481 L"System\\CurrentControlSet\\Services",
1487 DPRINT(
"Failed to open the services key (Error %lu)\n", dwError);
1498 DPRINT(
"Failed to open the service key (Error %lu)\n", dwError);
1510 DPRINT(
"Failed to open the service enum key (Error %lu)\n", dwError);
1525 DPRINT(
"RegQueryValueExW failed (Error %lu)\n", dwError);
1544 DPRINT(
"RegQueryInfoKeyW failed (Error %lu)\n", dwError);
1548 DPRINT(
"dwValues %lu dwMaxValueLength %lu\n", dwValues, dwMaxValueLength /
sizeof(
WCHAR));
1551 *pulLength = dwValues * dwMaxValueLength /
sizeof(
WCHAR) + 2;
1557 if (hServiceKey !=
NULL)
1574 DWORD dwSubKeys, dwMaxSubKeyLength;
1585 DPRINT(
"Failed to open the device key (Error %lu)\n", dwError);
1604 DPRINT(
"RegQueryInfoKeyW failed (Error %lu)\n", dwError);
1606 dwMaxSubKeyLength = 0;
1613 *pulLength = dwSubKeys * (
wcslen(pszDevice) + 1 + dwMaxSubKeyLength + 1);
1626 WCHAR szPathBuffer[512];
1627 HKEY hEnumeratorKey;
1628 DWORD dwIndex, dwDeviceLength, dwBufferLength;
1642 DPRINT(
"Failed to open the enumerator key (Error %lu)\n", dwError);
1646 for (dwIndex = 0; ; dwIndex++)
1660 wsprintf(szPathBuffer,
L"%s\\%s", pszEnumerator, szDeviceBuffer);
1661 DPRINT(
"Path: %S\n", szPathBuffer);
1670 *pulLength += dwBufferLength;
1686 DWORD dwIndex, dwEnumeratorLength, dwBufferLength;
1690 for (dwIndex = 0; ; dwIndex++)
1696 &dwEnumeratorLength,
1707 *pulLength += dwBufferLength;
1728 DPRINT(
"PNP_GetDeviceListSize(%p %S %p 0x%08lx)\n",
1729 hBinding, pszFilter, pulLength, ulFlags);
1734 if (pulLength ==
NULL)
1738 (pszFilter ==
NULL))
1805 DPRINT(
"PNP_GetDepth(%p %S %p 0x%08lx)\n",
1806 hBinding, pszDeviceID, pulDepth, ulFlags);
1815 (
PVOID)&PlugPlayData,
1819 *pulDepth = PlugPlayData.
Depth;
1826 DPRINT(
"PNP_GetDepth() done (returns %lx)\n",
ret);
1839 DWORD *pulRegDataType,
1854 DPRINT(
"PNP_GetDeviceRegProp(%p %S %lu %p %p %p %p 0x%08lx)\n",
1856 pulTransferLen, pulLength, ulFlags);
1858 if (pulTransferLen ==
NULL || pulLength ==
NULL)
1877 if (*pulLength < *pulTransferLen)
1878 *pulLength = *pulTransferLen;
1880 *pulTransferLen = 0;
1885 lpValueName =
L"DeviceDesc";
1889 lpValueName =
L"HardwareID";
1893 lpValueName =
L"CompatibleIDs";
1897 lpValueName =
L"Service";
1901 lpValueName =
L"Class";
1905 lpValueName =
L"ClassGUID";
1909 lpValueName =
L"Driver";
1913 lpValueName =
L"ConfigFlags";
1917 lpValueName =
L"Mfg";
1921 lpValueName =
L"FriendlyName";
1925 lpValueName =
L"LocationInformation";
1930 *pulRegDataType =
REG_SZ;
1934 lpValueName =
L"Capabilities";
1942 lpValueName =
L"UpperFilters";
1946 lpValueName =
L"LowerFilters";
1966 *pulRegDataType =
REG_SZ;
1970 lpValueName =
L"Security";
1974 lpValueName =
L"DeviceType";
1978 lpValueName =
L"Exclusive";
1982 lpValueName =
L"DeviceCharacteristics";
1991 lpValueName =
L"UINumberDescFormat";
2010 lpValueName =
L"RemovalPolicy";
2019#if (WINVER >= _WIN32_WINNT_WS03)
2026#if (WINVER >= _WIN32_WINNT_WIN7)
2029 *pulRegDataType =
REG_SZ;
2038 DPRINT(
"Value name: %S\n", lpValueName);
2084 (
PVOID)&PlugPlayData,
2088 *pulLength = PlugPlayData.BufferSize;
2103 DPRINT(
"PNP_GetDeviceRegProp() done (returns %lx)\n",
ret);
2128 DPRINT(
"PNP_SetDeviceRegProp(%p %S %lu %lu %p %lu 0x%08lx)\n",
2138 lpValueName =
L"DeviceDesc";
2142 lpValueName =
L"HardwareID";
2146 lpValueName =
L"CompatibleIDs";
2150 lpValueName =
L"Service";
2154 lpValueName =
L"Class";
2158 lpValueName =
L"ClassGUID";
2162 lpValueName =
L"Driver";
2166 lpValueName =
L"ConfigFlags";
2170 lpValueName =
L"Mfg";
2174 lpValueName =
L"FriendlyName";
2178 lpValueName =
L"LocationInformation";
2182 lpValueName =
L"UpperFilters";
2186 lpValueName =
L"LowerFilters";
2190 lpValueName =
L"Security";
2194 lpValueName =
L"DeviceType";
2198 lpValueName =
L"Exclusive";
2202 lpValueName =
L"DeviceCharacteristics";
2206 lpValueName =
L"UINumberDescFormat";
2210 lpValueName =
L"RemovalPolicy";
2217 DPRINT(
"Value name: %S\n", lpValueName);
2245 DPRINT(
"PNP_SetDeviceRegProp() done (returns %lx)\n",
ret);
2260 WCHAR szClassGuid[40];
2261 WCHAR szClassInstance[5];
2263 HKEY hClassInstanceKey;
2264 ULONG ulTransferLength, ulDataLength;
2265 DWORD dwDataType, dwDisposition,
i;
2269 DPRINT(
"PNP_GetClassInstance(%p %S %p %lu)\n",
2270 hBinding, pDeviceId, pszClassInstance, ulLength);
2275 ulTransferLength = ulLength;
2280 (
BYTE *)pszClassInstance,
2287 ulTransferLength =
sizeof(szClassGuid);
2288 ulDataLength =
sizeof(szClassGuid);
2293 (
BYTE *)szClassGuid,
2299 DPRINT1(
"PNP_GetDeviceRegProp() failed (Error %lu)\n",
ret);
2310 DPRINT1(
"RegOpenKeyExW() failed (Error %lu)\n", dwError);
2315 for (
i = 0;
i < 10000;
i++)
2339 ulDataLength = (
wcslen(pszClassInstance) + 1) *
sizeof(
WCHAR);
2344 (
BYTE *)pszClassInstance,
2349 DPRINT1(
"PNP_SetDeviceRegProp() failed (Error %lu)\n",
ret);
2360 if (hDeviceClassKey !=
NULL)
2383 DPRINT(
"PNP_CreateKey(%p %S 0x%lx 0x%08lx)\n",
2384 hBinding, pszSubKey, samDesired, ulFlags);
2404 L"Device Parameters",
2421 if (hParametersKey !=
NULL)
2424 if (hDeviceKey !=
NULL)
2451 DWORD *pulClassCount,
2460 DPRINT(
"PNP_GetClassCount(%p %p 0x%08lx)\n",
2509 DPRINT(
"PNP_GetClassName(%p %S %p %p 0x%08lx)\n",
2512 lstrcpyW(szKeyName,
L"System\\CurrentControlSet\\Control\\Class\\");
2543 DPRINT(
"PNP_GetClassName() done (returns %lx)\n",
ret);
2561 DPRINT(
"PNP_DeleteClassKey(%p %S 0x%08lx)\n",
2575 DPRINT(
"PNP_DeleteClassKey() done (returns %lx)\n",
ret);
2586 LPWSTR pszInterfaceDevice,
2587 GUID *AliasInterfaceGuid,
2588 LPWSTR pszAliasInterfaceDevice,
2615 DPRINT(
"PNP_GetInterfaceDeviceList(%p %p %S %p %p 0x%08lx)\n",
2624 PlugPlayData.
Flags = ulFlags;
2630 (
PVOID)&PlugPlayData,
2641 DPRINT(
"PNP_GetInterfaceDeviceList() done (returns %lx)\n",
ret);
2662 DPRINT(
"PNP_GetInterfaceDeviceListSize(%p %p %p %S 0x%08lx)\n",
2674 PlugPlayData.
Flags = ulFlags;
2677 (
PVOID)&PlugPlayData,
2688 DPRINT(
"PNP_GetInterfaceDeviceListSize() done (returns %lx)\n",
ret);
2716 LPWSTR pszInterfaceDevice,
2731 DWORD *pulRegDataType,
2745 DPRINT(
"PNP_GetClassRegProp(%p %S %lu %p %p %p %p 0x%08lx)\n",
2746 hBinding, pszClassGuid, ulProperty, pulRegDataType,
2747 Buffer, pulTransferLen, pulLength, ulFlags);
2749 if (pulTransferLen ==
NULL || pulLength ==
NULL)
2761 if (*pulLength < *pulTransferLen)
2762 *pulLength = *pulTransferLen;
2764 *pulTransferLen = 0;
2769 lpValueName =
L"Security";
2773 lpValueName =
L"DeviceType";
2777 lpValueName =
L"Exclusive";
2781 lpValueName =
L"DeviceCharacteristics";
2789 DPRINT(
"Value name: %S\n", lpValueName);
2836 *pulTransferLen = *pulLength;
2838 if (hPropKey !=
NULL)
2841 if (hInstKey !=
NULL)
2844 DPRINT(
"PNP_GetClassRegProp() done (returns %lx)\n",
ret);
2870 DPRINT(
"PNP_SetClassRegProp(%p %S %lu %lu %p %lu 0x%08lx)\n",
2871 hBinding, pszClassGuid, ulProperty, ulDataType,
2872 Buffer, ulLength, ulFlags);
2880 lpValueName =
L"Security";
2884 lpValueName =
L"DeviceType";
2888 lpValueName =
L"Exclusive";
2892 lpValueName =
L"DeviceCharacteristics";
2944 if (hPropKey !=
NULL)
2947 if (hInstKey !=
NULL)
2963 HKEY hKeyEnumerator;
3017 DPRINT1(
"Instance %S already exists!\n", szInstance);
3044 DWORD dwPhantomValue = 1;
3049 (
PBYTE)&dwPhantomValue,
3050 sizeof(dwPhantomValue));
3082 DWORD dwInstanceNumber;
3091 dwInstanceNumber = 0;
3094 if (dwInstanceNumber >= 10000)
3097 swprintf(szGeneratedInstance,
L"Root\\%ls\\%04lu",
3098 pszDeviceID, dwInstanceNumber);
3110 if (
wcslen(szGeneratedInstance) > ulLength)
3116 wcscpy(pszDeviceID, szGeneratedInstance);
3129 LPWSTR pszParentDeviceID,
3139 DPRINT(
"PNP_CreateDevInst(%p %S %S %lu 0x%08lx)\n",
3140 hBinding, pszParentDeviceID, pszDeviceID, ulLength, ulFlags);
3145 if (pszDeviceID ==
NULL || pszParentDeviceID ==
NULL)
3198 sizeof(ControlData));
3221 DPRINT(
"PNP_CreateDevInst() done (returns %lx)\n",
ret);
3235 DWORD ulStatus, ulProblem;
3240 DPRINT1(
"SetupDeviceInstance(%S 0x%08lx)\n",
3241 pszDeviceInstance, ulMinorAction);
3261 dwSize =
sizeof(dwDisableCount);
3269 (dwDisableCount > 0))
3303 if (hDeviceKey !=
NULL)
3318 DPRINT(
"Enable device instance %S\n", pszDeviceInstance);
3338 DPRINT1(
"ReenumerateDeviceInstance(%S 0x%08lx)\n",
3339 pszDeviceInstance, ulMinorAction);
3346 DPRINT1(
"CM_REENUMERATE_RETRY_INSTALLATION not implemented!\n");
3351 EnumerateDeviceData.
Flags = 0;
3354 &EnumerateDeviceData,
3368 DWORD ulMajorAction,
3369 DWORD ulMinorAction,
3370 LPWSTR pszDeviceInstance1,
3371 LPWSTR pszDeviceInstance2)
3377 DPRINT(
"PNP_DeviceInstanceAction(%p %lu 0x%08lx %S %S)\n",
3378 hBinding, ulMajorAction, ulMinorAction,
3379 pszDeviceInstance1, pszDeviceInstance2);
3381 switch (ulMajorAction)
3383 case PNP_DEVINST_SETUP:
3388 case PNP_DEVINST_ENABLE:
3392 case PNP_DEVINST_REENUMERATE:
3398 DPRINT1(
"Unknown device action %lu: not implemented\n", ulMajorAction);
3402 DPRINT(
"PNP_DeviceInstanceAction() done (returns %lx)\n",
ret);
3418 DWORD ulDataType, ulTransferLength, ulLength;
3419 DWORD ulCapabilities, ulConfigFlags;
3425 DPRINT(
"PNP_GetDeviceStatus(%p %S %p %p 0x%08lx)\n",
3426 hBinding, pDeviceID, pulStatus, pulProblem, ulFlags);
3431 if ((pulStatus ==
NULL) || (pulProblem ==
NULL))
3442 ulTransferLength =
sizeof(ulCapabilities);
3443 ulLength =
sizeof(ulCapabilities);
3448 (
PBYTE)&ulCapabilities,
3459 ulTransferLength =
sizeof(ulConfigFlags);
3460 ulLength =
sizeof(ulConfigFlags);
3465 (
PBYTE)&ulConfigFlags,
3495 ULONG ulOldStatus, ulOldProblem;
3500 DPRINT1(
"PNP_SetDeviceProblem(%p %S %lu 0x%08lx)\n",
3501 hBinding, pDeviceID, ulProblem, ulFlags);
3516 (ulOldProblem != 0) &&
3517 (ulOldProblem != ulProblem))
3552 DPRINT1(
"PNP_DisableDevInst(%p %S %p %p %lu 0x%08lx)\n",
3553 hBinding, pDeviceID, pVetoType, pszVetoName, ulNameLength, ulFlags);
3589 lpPtr = lpDeviceIdList;
3593 if (0 ==
_wcsicmp(lpPtr, lpDeviceId))
3611 dwLen =
wcslen(lpDeviceId);
3612 dwPos = (*lpDeviceIdListSize /
sizeof(
WCHAR)) - 1;
3614 wcscpy(&lpDeviceIdList[dwPos], lpDeviceId);
3616 dwPos += (dwLen + 1);
3618 lpDeviceIdList[dwPos] = 0;
3620 *lpDeviceIdListSize = dwPos *
sizeof(
WCHAR);
3636 DWORD dwDeviceIdListSize;
3637 DWORD dwNewDeviceIdSize;
3642 DPRINT(
"PNP_AddID(%p %S %S 0x%08lx)\n",
3643 hBinding, pszDeviceID, pszID, ulFlags);
3651 DPRINT(
"Failed to open the device key!\n");
3664 DPRINT(
"Failed to query the desired ID string!\n");
3669 dwNewDeviceIdSize =
lstrlenW(pszDeviceID);
3670 if (!dwNewDeviceIdSize)
3676 dwDeviceIdListSize += (dwNewDeviceIdSize + 2) *
sizeof(
WCHAR);
3679 if (!pszDeviceIdList)
3681 DPRINT(
"Failed to allocate memory for the desired ID string!\n");
3693 DPRINT(
"Failed to query the desired ID string!\n");
3701 DPRINT(
"Device ID was found in the ID string!\n");
3716 DPRINT(
"Failed to set the desired ID string!\n");
3722 if (pszDeviceIdList)
3725 DPRINT(
"PNP_AddID() done (returns %lx)\n",
ret);
3739 DPRINT(
"PNP_RegisterDriver(%p %S 0x%lx)\n",
3769 DPRINT1(
"PNP_QueryRemove(%p %S %p %p %lu 0x%lx)\n",
3770 hBinding, pszDeviceID, pVetoType, pszVetoName,
3771 ulNameLength, ulFlags);
3780 if (pVetoType !=
NULL)
3783 if (pszVetoName !=
NULL && ulNameLength > 0)
3789 PlugPlayData.
VetoName = pszVetoName;
3795 sizeof(PlugPlayData));
3818 DPRINT1(
"PNP_RequestDeviceEject(%p %S %p %p %lu 0x%lx)\n",
3819 hBinding, pszDeviceID, pVetoType, pszVetoName,
3820 ulNameLength, ulFlags);
3828 if (pVetoType !=
NULL)
3831 if (pszVetoName !=
NULL && ulNameLength > 0)
3837 PlugPlayData.
VetoName = pszVetoName;
3843 sizeof(PlugPlayData));
3866 DPRINT1(
"PNP_IsDockStationPresent(%p %p)\n",
3895 else if (dwValue != 0)
3901 DPRINT1(
"PNP_IsDockStationPresent() done (returns %lx)\n",
ret);
3931 szDockDeviceInstance,
3961 DPRINT(
"PNP_HwProfFlags() called\n");
3969 L"System\\CurrentControlSet\\HardwareProfiles\\Current\\System\\CurrentControlSet\\Enum");
3974 L"System\\CurrentControlSet\\HardwareProfiles\\%04lu\\System\\CurrentControlSet\\Enum",
3985 if (ulAction == PNP_GET_HWPROFFLAGS)
4011 else if (ulAction == PNP_SET_HWPROFFLAGS)
4030 DWORD ulProfileInfoSize,
4033 WCHAR szProfileName[5];
4037 DWORD dwDisposition;
4044 DPRINT(
"PNP_GetHwProfInfo() called\n");
4046 if (ulProfileInfoSize == 0)
4065 L"System\\CurrentControlSet\\Control\\IDConfigDB",
4081 L"Hardware Profiles",
4095 if (ulIndex == (
ULONG)-1)
4145 if (hKeyProfile !=
NULL)
4148 if (hKeyProfiles !=
NULL)
4151 if (hKeyConfig !=
NULL)
4165 DWORD *pulLogConfTag,
4179 DWORD ulLogConfType,
4194 DWORD ulLogConfType,
4195 DWORD *pulLogConfTag,
4199 DWORD RegDataType = 0;
4200 ULONG ulDataSize = 0;
4204 DPRINT(
"PNP_GetFirstLogConf(%p %S %lu %p 0x%08lx)\n",
4205 hBinding, pDeviceID, ulLogConfType, pulLogConfTag, ulFlags);
4207 if (pulLogConfTag ==
NULL)
4210 *pulLogConfTag = (
DWORD)0;
4223 DPRINT1(
"OpenConfigurationKey() failed (Error %lu)\n",
ret);
4235 DPRINT1(
"GetConfigurationData() failed (Error %lu)\n",
ret);
4240 DPRINT1(
"Data size %lu\n", ulDataSize);
4241 if (ulDataSize == 0 || lpData ==
NULL)
4243 DPRINT1(
"No config data available!\n");
4256 DPRINT1(
"No resource descriptors!\n");
4263 DPRINT(
"REG_RESOURCE_REQUIREMENTS_LIST->AlternativeLists %lu\n",
4278 if (hConfigKey !=
NULL)
4281 DPRINT(
"PNP_GetFirstLogConf() returns %lu\n",
ret);
4293 DWORD ulLogConfType,
4299 DWORD RegDataType = 0;
4300 ULONG ulDataSize = 0;
4304 DPRINT(
"PNP_GetNextLogConf(%p %S %lu %ul %p 0x%08lx)\n",
4305 hBinding, pDeviceID, ulLogConfType, ulCurrentTag, pulNextTag, ulFlags);
4307 if (pulNextTag ==
NULL)
4310 *pulNextTag = (
DWORD)0;
4323 DPRINT1(
"OpenConfigurationKey() failed (Error %lu)\n",
ret);
4335 DPRINT1(
"GetConfigurationData() failed (Error %lu)\n",
ret);
4340 DPRINT(
"Data size %lu\n", ulDataSize);
4342 if (ulDataSize == 0 || lpData ==
NULL)
4344 DPRINT1(
"No config data available!\n");
4370 DPRINT(
"REG_RESOURCE_REQUIREMENTS_LIST->AlternativeLists %lu\n",
4389 *pulNextTag = ulCurrentTag + 1;
4395 if (hConfigKey !=
NULL)
4398 DPRINT(
"PNP_GetNextLogConf() returns %lu\n",
ret);
4427 DWORD ulLogConfType,
4429 DWORD *pulResourceTag,
4446 DWORD ulLogConfType,
4448 DWORD ulResourceTag,
4449 DWORD *pulPreviousResType,
4450 DWORD *pulPreviousResTag,
4465 DWORD ulLogConfType,
4467 DWORD ulResourceTag,
4468 DWORD *pulNextResType,
4469 DWORD *pulNextResTag,
4473 DWORD RegDataType = 0;
4474 ULONG ulDataSize = 0;
4478 DPRINT1(
"PNP_GetNextResDes(%p %S 0x%lx %lu %lu %ul %p %p 0x%08lx)\n",
4479 hBinding, pDeviceID, ulLogConfTag, ulLogConfType, ResourceID,
4480 ulResourceTag, pulNextResType, pulNextResTag, ulFlags);
4482 if (pulNextResType ==
NULL)
4485 *pulNextResType = 0;
4498 DPRINT1(
"OpenConfigurationKey() failed (Error %lu)\n",
ret);
4510 DPRINT1(
"GetConfigurationData() failed (Error %lu)\n",
ret);
4515 DPRINT1(
"Data size %lu\n", ulDataSize);
4517 if (ulDataSize == 0 || lpData ==
NULL)
4519 DPRINT1(
"No config data available!\n");
4527 DPRINT1(
"FIXME: REG_RESOURCE_LIST\n");
4534 DPRINT1(
"FIXME: REG_RESOURCE_REQUIREMENTS_LIST\n");
4544 if (hConfigKey !=
NULL)
4547 DPRINT1(
"PNP_GetNextResDes() returns %lu\n",
ret);
4560 DWORD ulLogConfType,
4562 DWORD ulResourceTag,
4579 DWORD ulLogConfType,
4581 DWORD ulResourceTag,
4597 DWORD ulLogConfType,
4600 DWORD ulResourceTag,
4619 BOOL *pbConflictDetected,
4622 DPRINT(
"PNP_DetectResourceConflict()\n");
4624 if (pbConflictDetected !=
NULL)
4625 *pbConflictDetected =
FALSE;
4654 DWORD ulHardwareProfile,
4711 BYTE *pNotificationFilter,
4712 DWORD ulNotificationFilterSize,
4722 DPRINT1(
"PNP_RegisterNotification(%p %p '%S' %p %lu 0x%lx %p %lx %p)\n",
4723 hBinding, hRecipient, pszName, pNotificationFilter,
4724 ulNotificationFilterSize, ulFlags, pNotifyHandle, ulProcessId, pulUnknown9);
4726 if (pNotifyHandle ==
NULL)
4729 *pNotifyHandle =
NULL;
4731 if (pNotificationFilter ==
NULL ||
4732 pulUnknown9 ==
NULL)
4744 DPRINT1(
"DBT_DEVTYP_DEVICEINTERFACE\n");
4752 if (pNotifyData ==
NULL)
4755 if (pszName !=
NULL)
4770 DPRINT(
"pNotifyData: %p\n", pNotifyData);
4775 DPRINT1(
"DBT_DEVTYP_HANDLE\n");
4782 if (ulFlags & DEVICE_NOTIFY_ALL_INTERFACE_CLASSES)
4804 DPRINT1(
"PNP_UnregisterNotification(%p %p)\n",
4815 *pNotifyHandle =
NULL;
4828 DWORD *pulRegDataType,
4841 DPRINT(
"PNP_GetCustomDevProp() called\n");
4843 if (pulTransferLen ==
NULL || pulLength ==
NULL)
4858 if (*pulLength < *pulTransferLen)
4859 *pulLength = *pulTransferLen;
4861 *pulTransferLen = 0;
4875 L"Device Parameters",
4906 *pulTransferLen = *pulLength;
4908 if (hParamKey !=
NULL)
4911 if (hDeviceKey !=
NULL)
4914 DPRINT(
"PNP_GetCustomDevProp() done (returns %lx)\n",
ret);
4954 DWORD *pulSSDIFlags,
4959 DPRINT1(
"PNP_GetServerSideDeviceInstallFlags(%p %p %lu)\n",
4962 if (pulSSDIFlags ==
NULL)
4982 LPWSTR PropertyCultureName,
5000 LPWSTR PropertyCultureName,
5020 LPWSTR PropertyCultureName,