ReactOS 0.4.16-dev-597-gdbf7844
rpcserver.c File Reference
#include "precomp.h"
#include <debug.h>
Include dependency graph for rpcserver.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

DWORD WINAPI RpcServerThread (LPVOID lpParameter)
 
void __RPC_FAR *__RPC_USER midl_user_allocate (SIZE_T len)
 
void __RPC_USER midl_user_free (void __RPC_FAR *ptr)
 
static CONFIGRET WINAPI NtStatusToCrError (NTSTATUS Status)
 
static VOID SplitDeviceInstanceID (IN LPWSTR pszDeviceInstanceID, OUT LPWSTR pszEnumerator, OUT LPWSTR pszDevice, OUT LPWSTR pszInstance)
 
static CONFIGRET ClearDeviceStatus (_In_ LPWSTR pszDeviceID, _In_ DWORD ulStatus, _In_ DWORD ulProblem)
 
static CONFIGRET GetDeviceStatus (_In_ LPWSTR pszDeviceID, _Out_ DWORD *pulStatus, _Out_ DWORD *pulProblem)
 
static CONFIGRET SetDeviceStatus (_In_ LPWSTR pszDeviceID, _In_ DWORD ulStatus, _In_ DWORD ulProblem)
 
static CONFIGRET DisableDeviceInstance (_In_ LPWSTR pszDeviceInstance, _Inout_opt_ PPNP_VETO_TYPE pVetoType, _Inout_opt_ LPWSTR pszVetoName, _In_ DWORD ulNameLength)
 
static BOOL IsValidDeviceInstanceID (_In_ PWSTR pszDeviceInstanceID)
 
static BOOL IsRootDeviceInstanceID (_In_ PWSTR pszDeviceInstanceID)
 
static BOOL IsPresentDeviceInstanceID (_In_ LPWSTR pszDeviceInstanceID)
 
static CONFIGRET OpenConfigurationKey (_In_ LPCWSTR pszDeviceID, _In_ DWORD ulLogConfType, _Out_ PHKEY phKey)
 
static CONFIGRET GetConfigurationData (_In_ HKEY hKey, _In_ ULONG ulLogConfType, _Out_ PULONG pulRegDataType, _Out_ PULONG pulDataSize, _Out_ LPBYTE *ppBuffer)
 
static BOOL IsCallerInteractive (_In_ handle_t hBinding)
 
VOID __RPC_USER PNP_NOTIFY_HANDLE_rundown (PNP_NOTIFY_HANDLE pHandle)
 
DWORD WINAPI PNP_Disconnect (handle_t hBinding)
 
DWORD WINAPI PNP_Connect (handle_t hBinding)
 
DWORD WINAPI PNP_GetVersion (handle_t hBinding, WORD *pVersion)
 
DWORD WINAPI PNP_GetGlobalState (handle_t hBinding, DWORD *pulState, DWORD ulFlags)
 
DWORD WINAPI PNP_InitDetection (handle_t hBinding)
 
DWORD WINAPI PNP_ReportLogOn (handle_t hBinding, BOOL Admin, DWORD ProcessId)
 
DWORD WINAPI PNP_ValidateDeviceInstance (handle_t hBinding, LPWSTR pDeviceID, DWORD ulFlags)
 
DWORD WINAPI PNP_GetRootDeviceInstance (handle_t hBinding, LPWSTR pDeviceID, PNP_RPC_STRING_LEN ulLength)
 
DWORD WINAPI PNP_GetRelatedDeviceInstance (handle_t hBinding, DWORD ulRelationship, LPWSTR pDeviceID, LPWSTR pRelatedDeviceId, PNP_RPC_STRING_LEN *pulLength, DWORD ulFlags)
 
DWORD WINAPI PNP_EnumerateSubKeys (handle_t hBinding, DWORD ulBranch, DWORD ulIndex, LPWSTR Buffer, PNP_RPC_STRING_LEN ulLength, PNP_RPC_STRING_LEN *pulRequiredLen, DWORD ulFlags)
 
static CONFIGRET GetRelationsInstanceList (_In_ PWSTR pszDevice, _In_ DWORD ulFlags, _Inout_ PWSTR pszBuffer, _Inout_ PDWORD pulLength)
 
static CONFIGRET GetServiceInstanceList (_In_ PWSTR pszService, _Inout_ PWSTR pszBuffer, _Inout_ PDWORD pulLength)
 
static CONFIGRET GetDeviceInstanceList (_In_ PWSTR pszDevice, _Inout_ PWSTR pszBuffer, _Inout_ PDWORD pulLength)
 
CONFIGRET GetEnumeratorInstanceList (_In_ PWSTR pszEnumerator, _Inout_ PWSTR pszBuffer, _Inout_ PDWORD pulLength)
 
static CONFIGRET GetAllInstanceList (_Inout_ PWSTR pszBuffer, _Inout_ PDWORD pulLength)
 
DWORD WINAPI PNP_GetDeviceList (handle_t hBinding, LPWSTR pszFilter, LPWSTR Buffer, PNP_RPC_STRING_LEN *pulLength, DWORD ulFlags)
 
static CONFIGRET GetRelationsInstanceListSize (_In_ PWSTR pszDevice, _In_ DWORD ulFlags, _Inout_ PDWORD pulLength)
 
static CONFIGRET GetServiceInstanceListSize (_In_ PWSTR pszService, _Out_ PDWORD pulLength)
 
static CONFIGRET GetDeviceInstanceListSize (_In_ LPCWSTR pszDevice, _Out_ PULONG pulLength)
 
static CONFIGRET GetEnumeratorInstanceListSize (_In_ LPCWSTR pszEnumerator, _Out_ PULONG pulLength)
 
static CONFIGRET GetAllInstanceListSize (_Out_ PULONG pulLength)
 
DWORD WINAPI PNP_GetDeviceListSize (handle_t hBinding, LPWSTR pszFilter, PNP_RPC_BUFFER_SIZE *pulLength, DWORD ulFlags)
 
DWORD WINAPI PNP_GetDepth (handle_t hBinding, LPWSTR pszDeviceID, DWORD *pulDepth, DWORD ulFlags)
 
DWORD WINAPI PNP_GetDeviceRegProp (handle_t hBinding, LPWSTR pDeviceID, DWORD ulProperty, DWORD *pulRegDataType, BYTE *Buffer, PNP_PROP_SIZE *pulTransferLen, PNP_PROP_SIZE *pulLength, DWORD ulFlags)
 
DWORD WINAPI PNP_SetDeviceRegProp (handle_t hBinding, LPWSTR pDeviceId, DWORD ulProperty, DWORD ulDataType, BYTE *Buffer, PNP_PROP_SIZE ulLength, DWORD ulFlags)
 
DWORD WINAPI PNP_GetClassInstance (handle_t hBinding, LPWSTR pDeviceId, LPWSTR pszClassInstance, PNP_RPC_STRING_LEN ulLength)
 
DWORD WINAPI PNP_CreateKey (handle_t hBinding, LPWSTR pszSubKey, DWORD samDesired, DWORD ulFlags)
 
DWORD WINAPI PNP_DeleteRegistryKey (handle_t hBinding, LPWSTR pszDeviceID, LPWSTR pszParentKey, LPWSTR pszChildKey, DWORD ulFlags)
 
DWORD WINAPI PNP_GetClassCount (handle_t hBinding, DWORD *pulClassCount, DWORD ulFlags)
 
DWORD WINAPI PNP_GetClassName (handle_t hBinding, LPWSTR pszClassGuid, LPWSTR Buffer, PNP_RPC_STRING_LEN *pulLength, DWORD ulFlags)
 
DWORD WINAPI PNP_DeleteClassKey (handle_t hBinding, LPWSTR pszClassGuid, DWORD ulFlags)
 
DWORD WINAPI PNP_GetInterfaceDeviceAlias (handle_t hBinding, LPWSTR pszInterfaceDevice, GUID *AliasInterfaceGuid, LPWSTR pszAliasInterfaceDevice, PNP_RPC_STRING_LEN *pulLength, PNP_RPC_STRING_LEN *pulTransferLen, DWORD ulFlags)
 
DWORD WINAPI PNP_GetInterfaceDeviceList (handle_t hBinding, GUID *InterfaceGuid, LPWSTR pszDeviceID, BYTE *Buffer, PNP_RPC_BUFFER_SIZE *pulLength, DWORD ulFlags)
 
DWORD WINAPI PNP_GetInterfaceDeviceListSize (handle_t hBinding, PNP_RPC_BUFFER_SIZE *pulLen, GUID *InterfaceGuid, LPWSTR pszDeviceID, DWORD ulFlags)
 
DWORD WINAPI PNP_RegisterDeviceClassAssociation (handle_t hBinding, LPWSTR pszDeviceID, GUID *InterfaceGuid, LPWSTR pszReference, LPWSTR pszSymLink, PNP_RPC_STRING_LEN *pulLength, PNP_RPC_STRING_LEN *pulTransferLen, DWORD ulFlags)
 
DWORD WINAPI PNP_UnregisterDeviceClassAssociation (handle_t hBinding, LPWSTR pszInterfaceDevice, DWORD ulFlags)
 
DWORD WINAPI PNP_GetClassRegProp (handle_t hBinding, LPWSTR pszClassGuid, DWORD ulProperty, DWORD *pulRegDataType, BYTE *Buffer, PNP_RPC_STRING_LEN *pulTransferLen, PNP_RPC_STRING_LEN *pulLength, DWORD ulFlags)
 
DWORD WINAPI PNP_SetClassRegProp (handle_t hBinding, LPWSTR pszClassGuid, DWORD ulProperty, DWORD ulDataType, BYTE *Buffer, PNP_PROP_SIZE ulLength, DWORD ulFlags)
 
static CONFIGRET CreateDeviceInstance (_In_ LPWSTR pszDeviceID, _In_ BOOL bPhantomDevice)
 
static CONFIGRET GenerateDeviceID (_Inout_ LPWSTR pszDeviceID, _In_ PNP_RPC_STRING_LEN ulLength)
 
DWORD WINAPI PNP_CreateDevInst (handle_t hBinding, LPWSTR pszDeviceID, LPWSTR pszParentDeviceID, PNP_RPC_STRING_LEN ulLength, DWORD ulFlags)
 
static CONFIGRET SetupDeviceInstance (_In_ LPWSTR pszDeviceInstance, _In_ DWORD ulMinorAction)
 
static CONFIGRET EnableDeviceInstance (_In_ LPWSTR pszDeviceInstance)
 
static CONFIGRET ReenumerateDeviceInstance (_In_ LPWSTR pszDeviceInstance, _In_ ULONG ulMinorAction)
 
DWORD WINAPI PNP_DeviceInstanceAction (handle_t hBinding, DWORD ulMajorAction, DWORD ulMinorAction, LPWSTR pszDeviceInstance1, LPWSTR pszDeviceInstance2)
 
DWORD WINAPI PNP_GetDeviceStatus (handle_t hBinding, LPWSTR pDeviceID, DWORD *pulStatus, DWORD *pulProblem, DWORD ulFlags)
 
DWORD WINAPI PNP_SetDeviceProblem (handle_t hBinding, LPWSTR pDeviceID, DWORD ulProblem, DWORD ulFlags)
 
DWORD WINAPI PNP_DisableDevInst (handle_t hBinding, LPWSTR pDeviceID, PPNP_VETO_TYPE pVetoType, LPWSTR pszVetoName, DWORD ulNameLength, DWORD ulFlags)
 
DWORD WINAPI PNP_UninstallDevInst (handle_t hBinding, LPWSTR pDeviceID, DWORD ulFlags)
 
static BOOL CheckForDeviceId (LPWSTR lpDeviceIdList, LPWSTR lpDeviceId)
 
static VOID AppendDeviceId (LPWSTR lpDeviceIdList, LPDWORD lpDeviceIdListSize, LPWSTR lpDeviceId)
 
DWORD WINAPI PNP_AddID (handle_t hBinding, LPWSTR pszDeviceID, LPWSTR pszID, DWORD ulFlags)
 
DWORD WINAPI PNP_RegisterDriver (handle_t hBinding, LPWSTR pszDeviceID, DWORD ulFlags)
 
DWORD WINAPI PNP_QueryRemove (handle_t hBinding, LPWSTR pszDeviceID, PPNP_VETO_TYPE pVetoType, LPWSTR pszVetoName, DWORD ulNameLength, DWORD ulFlags)
 
DWORD WINAPI PNP_RequestDeviceEject (handle_t hBinding, LPWSTR pszDeviceID, PPNP_VETO_TYPE pVetoType, LPWSTR pszVetoName, DWORD ulNameLength, DWORD ulFlags)
 
CONFIGRET WINAPI PNP_IsDockStationPresent (handle_t hBinding, BOOL *Present)
 
DWORD WINAPI PNP_RequestEjectPC (handle_t hBinding)
 
DWORD WINAPI PNP_HwProfFlags (handle_t hBinding, DWORD ulAction, LPWSTR pDeviceID, DWORD ulConfig, DWORD *pulValue, PPNP_VETO_TYPE pVetoType, LPWSTR pszVetoName, DWORD ulNameLength, DWORD ulFlags)
 
DWORD WINAPI PNP_GetHwProfInfo (handle_t hBinding, DWORD ulIndex, HWPROFILEINFO *pHWProfileInfo, DWORD ulProfileInfoSize, DWORD ulFlags)
 
DWORD WINAPI PNP_AddEmptyLogConf (handle_t hBinding, LPWSTR pDeviceID, DWORD ulPriority, DWORD *pulLogConfTag, DWORD ulFlags)
 
DWORD WINAPI PNP_FreeLogConf (handle_t hBinding, LPWSTR pDeviceID, DWORD ulLogConfType, DWORD ulLogConfTag, DWORD ulFlags)
 
DWORD WINAPI PNP_GetFirstLogConf (handle_t hBinding, LPWSTR pDeviceID, DWORD ulLogConfType, DWORD *pulLogConfTag, DWORD ulFlags)
 
DWORD WINAPI PNP_GetNextLogConf (handle_t hBinding, LPWSTR pDeviceID, DWORD ulLogConfType, DWORD ulCurrentTag, DWORD *pulNextTag, DWORD ulFlags)
 
DWORD WINAPI PNP_GetLogConfPriority (handle_t hBinding, LPWSTR pDeviceID, DWORD ulType, DWORD ulTag, DWORD *pPriority, DWORD ulFlags)
 
DWORD WINAPI PNP_AddResDes (handle_t hBinding, LPWSTR pDeviceID, DWORD ulLogConfTag, DWORD ulLogConfType, RESOURCEID ResourceID, DWORD *pulResourceTag, BYTE *ResourceData, PNP_RPC_BUFFER_SIZE ResourceLen, DWORD ulFlags)
 
DWORD WINAPI PNP_FreeResDes (handle_t hBinding, LPWSTR pDeviceID, DWORD ulLogConfTag, DWORD ulLogConfType, RESOURCEID ResourceID, DWORD ulResourceTag, DWORD *pulPreviousResType, DWORD *pulPreviousResTag, DWORD ulFlags)
 
DWORD WINAPI PNP_GetNextResDes (handle_t hBinding, LPWSTR pDeviceID, DWORD ulLogConfTag, DWORD ulLogConfType, RESOURCEID ResourceID, DWORD ulResourceTag, DWORD *pulNextResType, DWORD *pulNextResTag, DWORD ulFlags)
 
DWORD WINAPI PNP_GetResDesData (handle_t hBinding, LPWSTR pDeviceID, DWORD ulLogConfTag, DWORD ulLogConfType, RESOURCEID ResourceID, DWORD ulResourceTag, BYTE *Buffer, PNP_RPC_BUFFER_SIZE BufferLen, DWORD ulFlags)
 
DWORD WINAPI PNP_GetResDesDataSize (handle_t hBinding, LPWSTR pDeviceID, DWORD ulLogConfTag, DWORD ulLogConfType, RESOURCEID ResourceID, DWORD ulResourceTag, DWORD *pulSize, DWORD ulFlags)
 
DWORD WINAPI PNP_ModifyResDes (handle_t hBinding, LPWSTR pDeviceID, DWORD ulLogConfTag, DWORD ulLogConfType, RESOURCEID CurrentResourceID, RESOURCEID NewResourceID, DWORD ulResourceTag, BYTE *ResourceData, PNP_RPC_BUFFER_SIZE ResourceLen, DWORD ulFlags)
 
DWORD WINAPI PNP_DetectResourceConflict (handle_t hBinding, LPWSTR pDeviceID, RESOURCEID ResourceID, BYTE *ResourceData, PNP_RPC_BUFFER_SIZE ResourceLen, BOOL *pbConflictDetected, DWORD ulFlags)
 
DWORD WINAPI PNP_QueryResConfList (handle_t hBinding, LPWSTR pDeviceID, RESOURCEID ResourceID, BYTE *ResourceData, PNP_RPC_BUFFER_SIZE ResourceLen, BYTE *Buffer, PNP_RPC_BUFFER_SIZE BufferLen, DWORD ulFlags)
 
DWORD WINAPI PNP_SetHwProf (handle_t hBinding, DWORD ulHardwareProfile, DWORD ulFlags)
 
DWORD WINAPI PNP_QueryArbitratorFreeData (handle_t hBinding, BYTE *pData, DWORD DataLen, LPWSTR pDeviceID, RESOURCEID ResourceID, DWORD ulFlags)
 
DWORD WINAPI PNP_QueryArbitratorFreeSize (handle_t hBinding, DWORD *pulSize, LPWSTR pDeviceID, RESOURCEID ResourceID, DWORD ulFlags)
 
CONFIGRET WINAPI PNP_RunDetection (handle_t hBinding, DWORD ulFlags)
 
DWORD WINAPI PNP_RegisterNotification (handle_t hBinding, DWORD_PTR hRecipient, LPWSTR pszName, BYTE *pNotificationFilter, DWORD ulNotificationFilterSize, DWORD ulFlags, PNP_NOTIFY_HANDLE *pNotifyHandle, DWORD ulProcessId, DWORD *pulUnknown9)
 
DWORD WINAPI PNP_UnregisterNotification (handle_t hBinding, PNP_NOTIFY_HANDLE *pNotifyHandle)
 
DWORD WINAPI PNP_GetCustomDevProp (handle_t hBinding, LPWSTR pDeviceID, LPWSTR CustomPropName, DWORD *pulRegDataType, BYTE *Buffer, PNP_RPC_STRING_LEN *pulTransferLen, PNP_RPC_STRING_LEN *pulLength, DWORD ulFlags)
 
DWORD WINAPI PNP_GetVersionInternal (handle_t hBinding, WORD *pwVersion)
 
DWORD WINAPI PNP_GetBlockedDriverInfo (handle_t hBinding, BYTE *Buffer, PNP_RPC_BUFFER_SIZE *pulTransferLen, PNP_RPC_BUFFER_SIZE *pulLength, DWORD ulFlags)
 
DWORD WINAPI PNP_GetServerSideDeviceInstallFlags (handle_t hBinding, DWORD *pulSSDIFlags, DWORD ulFlags)
 
DWORD WINAPI PNP_GetObjectPropKeys (handle_t hBinding, LPWSTR ObjectName, DWORD ObjectType, LPWSTR PropertyCultureName, PNP_PROP_COUNT *PropertyCount, PNP_PROP_COUNT *TransferLen, DEVPROPKEY *PropertyKeys, DWORD Flags)
 
DWORD WINAPI PNP_GetObjectProp (handle_t hBinding, LPWSTR ObjectName, DWORD ObjectType, LPWSTR PropertyCultureName, const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PNP_PROP_SIZE *PropertySize, PNP_PROP_SIZE *TransferLen, BYTE *PropertyBuffer, DWORD Flags)
 
DWORD WINAPI PNP_SetObjectProp (handle_t hBinding, LPWSTR ObjectName, DWORD ObjectType, LPWSTR PropertyCultureName, const DEVPROPKEY *PropertyKey, DEVPROPTYPE PropertyType, PNP_PROP_SIZE PropertySize, BYTE *PropertyBuffer, DWORD Flags)
 
DWORD WINAPI PNP_InstallDevInst (handle_t hBinding)
 
DWORD WINAPI PNP_ApplyPowerSettings (handle_t hBinding)
 
DWORD WINAPI PNP_DriverStoreAddDriverPackage (handle_t hBinding)
 
DWORD WINAPI PNP_DriverStoreDeleteDriverPackage (handle_t hBinding)
 
DWORD WINAPI PNP_RegisterServiceNotification (handle_t hBinding)
 
DWORD WINAPI PNP_SetActiveService (handle_t hBinding, LPWSTR pszFilter, DWORD ulFlags)
 
DWORD WINAPI PNP_DeleteServiceDevices (handle_t hBinding)
 

Variables

static WCHAR szRootDeviceInstanceID [] = L"HTREE\\ROOT\\0"
 
LIST_ENTRY NotificationListHead
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 33 of file rpcserver.c.

Function Documentation

◆ AppendDeviceId()

static VOID AppendDeviceId ( LPWSTR  lpDeviceIdList,
LPDWORD  lpDeviceIdListSize,
LPWSTR  lpDeviceId 
)
static

Definition at line 3607 of file rpcserver.c.

3610{
3611 DWORD dwLen;
3612 DWORD dwPos;
3613
3614 dwLen = wcslen(lpDeviceId);
3615 dwPos = (*lpDeviceIdListSize / sizeof(WCHAR)) - 1;
3616
3617 wcscpy(&lpDeviceIdList[dwPos], lpDeviceId);
3618
3619 dwPos += (dwLen + 1);
3620
3621 lpDeviceIdList[dwPos] = 0;
3622
3623 *lpDeviceIdListSize = dwPos * sizeof(WCHAR);
3624}
wcscpy
unsigned long DWORD
Definition: ntddk_ex.h:95
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by PNP_AddID().

◆ CheckForDeviceId()

static BOOL CheckForDeviceId ( LPWSTR  lpDeviceIdList,
LPWSTR  lpDeviceId 
)
static

Definition at line 3586 of file rpcserver.c.

3588{
3589 LPWSTR lpPtr;
3591
3592 lpPtr = lpDeviceIdList;
3593 while (*lpPtr != 0)
3594 {
3595 dwLength = wcslen(lpPtr);
3596 if (0 == _wcsicmp(lpPtr, lpDeviceId))
3597 return TRUE;
3598
3599 lpPtr += (dwLength + 1);
3600 }
3601
3602 return FALSE;
3603}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static DWORD DWORD * dwLength
Definition: fusion.c:86
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by PNP_AddID().

◆ ClearDeviceStatus()

static CONFIGRET ClearDeviceStatus ( _In_ LPWSTR  pszDeviceID,
_In_ DWORD  ulStatus,
_In_ DWORD  ulProblem 
)
static

Definition at line 199 of file rpcserver.c.

203{
204 PLUGPLAY_CONTROL_STATUS_DATA PlugPlayData;
207
208 DPRINT1("ClearDeviceStatus(%S 0x%lx 0x%lx)\n",
209 pszDeviceID, ulStatus, ulProblem);
210
212 pszDeviceID);
213 PlugPlayData.Operation = PNP_CLEAR_DEVICE_STATUS;
214 PlugPlayData.DeviceStatus = ulStatus;
215 PlugPlayData.DeviceProblem = ulProblem;
216
218 (PVOID)&PlugPlayData,
220 if (!NT_SUCCESS(Status))
222
223 return ret;
224}
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
static CONFIGRET WINAPI NtStatusToCrError(NTSTATUS Status)
Definition: rpcserver.c:124
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
Status
Definition: gdiplustypes.h:25
@ PlugPlayControlDeviceStatus
Definition: cmtypes.h:223
#define PNP_CLEAR_DEVICE_STATUS
Definition: cmtypes.h:61
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSTATUS NTAPI NtPlugPlayControl(IN PLUGPLAY_CONTROL_CLASS PlugPlayControlClass, IN OUT PVOID Buffer, IN ULONG BufferLength)
Definition: plugplay.c:1494
UNICODE_STRING DeviceInstance
Definition: cmtypes.h:525
int ret

Referenced by PNP_SetDeviceProblem(), and SetupDeviceInstance().

◆ CreateDeviceInstance()

static CONFIGRET CreateDeviceInstance ( _In_ LPWSTR  pszDeviceID,
_In_ BOOL  bPhantomDevice 
)
static

Definition at line 2959 of file rpcserver.c.

2962{
2963 WCHAR szEnumerator[MAX_DEVICE_ID_LEN];
2964 WCHAR szDevice[MAX_DEVICE_ID_LEN];
2965 WCHAR szInstance[MAX_DEVICE_ID_LEN];
2966 HKEY hKeyEnumerator;
2967 HKEY hKeyDevice;
2968 HKEY hKeyInstance;
2969 HKEY hKeyControl;
2970 LONG lError;
2971
2972 /* Split the instance ID */
2973 SplitDeviceInstanceID(pszDeviceID,
2974 szEnumerator,
2975 szDevice,
2976 szInstance);
2977
2978 /* Open or create the enumerator key */
2979 lError = RegCreateKeyExW(hEnumKey,
2980 szEnumerator,
2981 0,
2982 NULL,
2985 NULL,
2986 &hKeyEnumerator,
2987 NULL);
2988 if (lError != ERROR_SUCCESS)
2989 {
2990 return CR_REGISTRY_ERROR;
2991 }
2992
2993 /* Open or create the device key */
2994 lError = RegCreateKeyExW(hKeyEnumerator,
2995 szDevice,
2996 0,
2997 NULL,
3000 NULL,
3001 &hKeyDevice,
3002 NULL);
3003
3004 /* Close the enumerator key */
3005 RegCloseKey(hKeyEnumerator);
3006
3007 if (lError != ERROR_SUCCESS)
3008 {
3009 return CR_REGISTRY_ERROR;
3010 }
3011
3012 /* Try to open the instance key and fail if it exists */
3013 lError = RegOpenKeyExW(hKeyDevice,
3014 szInstance,
3015 0,
3017 &hKeyInstance);
3018 if (lError == ERROR_SUCCESS)
3019 {
3020 DPRINT1("Instance %S already exists!\n", szInstance);
3021 RegCloseKey(hKeyInstance);
3022 RegCloseKey(hKeyDevice);
3024 }
3025
3026 /* Create a new instance key */
3027 lError = RegCreateKeyExW(hKeyDevice,
3028 szInstance,
3029 0,
3030 NULL,
3033 NULL,
3034 &hKeyInstance,
3035 NULL);
3036
3037 /* Close the device key */
3038 RegCloseKey(hKeyDevice);
3039
3040 if (lError != ERROR_SUCCESS)
3041 {
3042 return CR_REGISTRY_ERROR;
3043 }
3044
3045 if (bPhantomDevice)
3046 {
3047 DWORD dwPhantomValue = 1;
3048 RegSetValueExW(hKeyInstance,
3049 L"Phantom",
3050 0,
3051 REG_DWORD,
3052 (PBYTE)&dwPhantomValue,
3053 sizeof(dwPhantomValue));
3054 }
3055
3056 /* Create the 'Control' sub key */
3057 lError = RegCreateKeyExW(hKeyInstance,
3058 L"Control",
3059 0,
3060 NULL,
3063 NULL,
3064 &hKeyControl,
3065 NULL);
3066 if (lError == ERROR_SUCCESS)
3067 {
3068 RegCloseKey(hKeyControl);
3069 }
3070
3071 RegCloseKey(hKeyInstance);
3072
3073 return (lError == ERROR_SUCCESS) ? CR_SUCCESS : CR_REGISTRY_ERROR;
3074}
HKEY hEnumKey
Definition: umpnpmgr.c:44
static VOID SplitDeviceInstanceID(IN LPWSTR pszDeviceInstanceID, OUT LPWSTR pszEnumerator, OUT LPWSTR pszDevice, OUT LPWSTR pszInstance)
Definition: rpcserver.c:153
#define RegCloseKey(hKey)
Definition: registry.h:49
#define CR_ALREADY_SUCH_DEVINST
Definition: cfgmgr32.h:862
#define CR_REGISTRY_ERROR
Definition: cfgmgr32.h:875
#define ERROR_SUCCESS
Definition: deptool.c:10
#define MAX_DEVICE_ID_LEN
Definition: devaction.c:40
#define NULL
Definition: types.h:112
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_SET_VALUE
Definition: nt_native.h:1017
#define L(x)
Definition: ntvdm.h:50
BYTE * PBYTE
Definition: pedump.c:66
long LONG
Definition: pedump.c:60
#define REG_DWORD
Definition: sdbapi.c:596

Referenced by PNP_CreateDevInst().

◆ DisableDeviceInstance()

static CONFIGRET DisableDeviceInstance ( _In_ LPWSTR  pszDeviceInstance,
_Inout_opt_ PPNP_VETO_TYPE  pVetoType,
_Inout_opt_ LPWSTR  pszVetoName,
_In_ DWORD  ulNameLength 
)
static

Definition at line 294 of file rpcserver.c.

299{
303
304 DPRINT1("DisableDeviceInstance(%S %p %p %lu)\n",
305 pszDeviceInstance, pVetoType, pszVetoName, ulNameLength);
306
307 RtlInitUnicodeString(&QueryRemoveData.DeviceInstance,
308 pszDeviceInstance);
309
310 QueryRemoveData.Flags = 0;
311 QueryRemoveData.VetoType = 0;
312 QueryRemoveData.VetoName = pszVetoName;
313 QueryRemoveData.NameLength = ulNameLength;
314
316 &QueryRemoveData,
319 {
321 }
323 {
324 if (pVetoType != NULL)
325 *pVetoType = QueryRemoveData.VetoType;
326
328 }
329 else if (!NT_SUCCESS(Status))
330 {
332 }
333
334 return ret;
335}
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
#define CR_REMOVE_VETOED
Definition: cfgmgr32.h:869
@ PlugPlayControlQueryAndRemoveDevice
Definition: cmtypes.h:215
#define STATUS_PLUGPLAY_QUERY_VETOED
Definition: ntstatus.h:219
#define STATUS_NO_SUCH_DEVICE
Definition: udferr_usr.h:136

Referenced by PNP_DisableDevInst().

◆ EnableDeviceInstance()

static CONFIGRET EnableDeviceInstance ( _In_ LPWSTR  pszDeviceInstance)
static

Definition at line 3314 of file rpcserver.c.

3316{
3320
3321 DPRINT("Enable device instance %S\n", pszDeviceInstance);
3322
3323 RtlInitUnicodeString(&ControlData.DeviceInstance, pszDeviceInstance);
3324 Status = NtPlugPlayControl(PlugPlayControlStartDevice, &ControlData, sizeof(ControlData));
3325 if (!NT_SUCCESS(Status))
3327
3328 return ret;
3329}
@ PlugPlayControlStartDevice
Definition: cmtypes.h:213
#define DPRINT
Definition: sndvol32.h:73

Referenced by PNP_DeviceInstanceAction().

◆ GenerateDeviceID()

static CONFIGRET GenerateDeviceID ( _Inout_ LPWSTR  pszDeviceID,
_In_ PNP_RPC_STRING_LEN  ulLength 
)
static

Definition at line 3079 of file rpcserver.c.

3082{
3083 WCHAR szGeneratedInstance[MAX_DEVICE_ID_LEN];
3084 HKEY hKey;
3085 DWORD dwInstanceNumber;
3086 DWORD dwError = ERROR_SUCCESS;
3088
3089 /* Fail, if the device name contains backslashes */
3090 if (wcschr(pszDeviceID, L'\\') != NULL)
3091 return CR_INVALID_DEVICE_ID;
3092
3093 /* Generated ID is: Root<Device ID><Instance number> */
3094 dwInstanceNumber = 0;
3095 while (dwError == ERROR_SUCCESS)
3096 {
3097 if (dwInstanceNumber >= 10000)
3098 return CR_FAILURE;
3099
3100 swprintf(szGeneratedInstance, L"Root\\%ls\\%04lu",
3101 pszDeviceID, dwInstanceNumber);
3102
3103 /* Try to open the enum key of the device instance */
3104 dwError = RegOpenKeyEx(hEnumKey, szGeneratedInstance, 0, KEY_QUERY_VALUE, &hKey);
3105 if (dwError == ERROR_SUCCESS)
3106 {
3108 dwInstanceNumber++;
3109 }
3110 }
3111
3112 /* pszDeviceID is an out parameter too for generated IDs */
3113 if (wcslen(szGeneratedInstance) > ulLength)
3114 {
3116 }
3117 else
3118 {
3119 wcscpy(pszDeviceID, szGeneratedInstance);
3120 }
3121
3122 return ret;
3123}
#define CR_INVALID_DEVICE_ID
Definition: cfgmgr32.h:876
#define CR_FAILURE
Definition: cfgmgr32.h:865
#define CR_BUFFER_SMALL
Definition: cfgmgr32.h:872
#define wcschr
Definition: compat.h:17
#define swprintf
Definition: precomp.h:40
FxAutoRegKey hKey
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define RegOpenKeyEx
Definition: winreg.h:520

Referenced by PNP_CreateDevInst().

◆ GetAllInstanceList()

static CONFIGRET GetAllInstanceList ( _Inout_ PWSTR  pszBuffer,
_Inout_ PDWORD  pulLength 
)
static

Definition at line 1300 of file rpcserver.c.

1303{
1304 WCHAR szEnumeratorBuffer[MAX_DEVICE_ID_LEN];
1305 PWSTR pPtr;
1306 DWORD dwIndex, dwEnumeratorLength, dwUsedLength, dwRemainingLength, dwPathLength;
1307 DWORD dwError;
1309
1310 dwUsedLength = 0;
1311 dwRemainingLength = *pulLength;
1312 pPtr = pszBuffer;
1313
1314 for (dwIndex = 0; ; dwIndex++)
1315 {
1316 dwEnumeratorLength = MAX_DEVICE_ID_LEN;
1317 dwError = RegEnumKeyExW(hEnumKey,
1318 dwIndex,
1319 szEnumeratorBuffer,
1320 &dwEnumeratorLength,
1321 NULL, NULL, NULL, NULL);
1322 if (dwError != ERROR_SUCCESS)
1323 break;
1324
1325 dwPathLength = dwRemainingLength;
1326 ret = GetEnumeratorInstanceList(szEnumeratorBuffer,
1327 pPtr,
1328 &dwPathLength);
1329 if (ret != CR_SUCCESS)
1330 break;
1331
1332 dwUsedLength += dwPathLength - 1;
1333 dwRemainingLength -= dwPathLength - 1;
1334 pPtr += dwPathLength - 1;
1335 }
1336
1337 if (ret == CR_SUCCESS)
1338 *pulLength = dwUsedLength + 1;
1339 else
1340 *pulLength = 0;
1341
1342 return ret;
1343}
CONFIGRET GetEnumeratorInstanceList(_In_ PWSTR pszEnumerator, _Inout_ PWSTR pszBuffer, _Inout_ PDWORD pulLength)
Definition: rpcserver.c:1229
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2504
uint16_t * PWSTR
Definition: typedefs.h:56

Referenced by PNP_GetDeviceList().

◆ GetAllInstanceListSize()

static CONFIGRET GetAllInstanceListSize ( _Out_ PULONG  pulLength)
static

Definition at line 1685 of file rpcserver.c.

1687{
1688 WCHAR szEnumeratorBuffer[MAX_DEVICE_ID_LEN];
1689 DWORD dwIndex, dwEnumeratorLength, dwBufferLength;
1690 DWORD dwError;
1692
1693 for (dwIndex = 0; ; dwIndex++)
1694 {
1695 dwEnumeratorLength = MAX_DEVICE_ID_LEN;
1696 dwError = RegEnumKeyExW(hEnumKey,
1697 dwIndex,
1698 szEnumeratorBuffer,
1699 &dwEnumeratorLength,
1700 NULL, NULL, NULL, NULL);
1701 if (dwError != ERROR_SUCCESS)
1702 break;
1703
1704 /* Get the size of all device instances for the enumerator */
1705 ret = GetEnumeratorInstanceListSize(szEnumeratorBuffer,
1706 &dwBufferLength);
1707 if (ret != CR_SUCCESS)
1708 break;
1709
1710 *pulLength += dwBufferLength;
1711 }
1712
1713 return ret;
1714}
static CONFIGRET GetEnumeratorInstanceListSize(_In_ LPCWSTR pszEnumerator, _Out_ PULONG pulLength)
Definition: rpcserver.c:1624

Referenced by PNP_GetDeviceListSize().

◆ GetConfigurationData()

static CONFIGRET GetConfigurationData ( _In_ HKEY  hKey,
_In_ ULONG  ulLogConfType,
_Out_ PULONG  pulRegDataType,
_Out_ PULONG  pulDataSize,
_Out_ LPBYTE ppBuffer 
)
static

Definition at line 492 of file rpcserver.c.

498{
499 LPCWSTR pszValueName;
500
501 switch (ulLogConfType)
502 {
503 case BOOT_LOG_CONF:
504 pszValueName = L"BootConfig";
505 *pulRegDataType = REG_RESOURCE_LIST;
506 break;
507
508 case ALLOC_LOG_CONF:
509 pszValueName = L"AllocConfig";
510 *pulRegDataType = REG_RESOURCE_LIST;
511 break;
512
513 case FORCED_LOG_CONF:
514 pszValueName = L"ForcedConfig";
515 *pulRegDataType = REG_RESOURCE_LIST;
516 break;
517
519 pszValueName = L"FilteredConfigVector";
520 *pulRegDataType = REG_RESOURCE_REQUIREMENTS_LIST;
521 break;
522
523 case BASIC_LOG_CONF:
524 pszValueName = L"BasicConfigVector";
525 *pulRegDataType = REG_RESOURCE_REQUIREMENTS_LIST;
526 break;
527
529 pszValueName = L"OverrideConfigVector";
530 *pulRegDataType = REG_RESOURCE_REQUIREMENTS_LIST;
531 break;
532
533 default:
534 DPRINT1("Unsupported configuration type!\n");
535 return CR_FAILURE;
536 }
537
538 /* Get the configuration data size */
540 pszValueName,
541 NULL,
542 NULL,
543 NULL,
544 pulDataSize) != ERROR_SUCCESS)
545 {
546 return CR_INVALID_LOG_CONF;
547 }
548
549 /* Allocate the buffer */
550 *ppBuffer = HeapAlloc(GetProcessHeap(), 0, *pulDataSize);
551 if (*ppBuffer == NULL)
552 {
553 return CR_OUT_OF_MEMORY;
554 }
555
556 /* Retrieve the configuration data */
558 pszValueName,
559 NULL,
560 NULL,
561 (LPBYTE)*ppBuffer,
562 pulDataSize) != ERROR_SUCCESS)
563 {
564 return CR_INVALID_LOG_CONF;
565 }
566
567 return CR_SUCCESS;
568}
#define FILTERED_LOG_CONF
Definition: cfgmgr32.h:597
#define BASIC_LOG_CONF
Definition: cfgmgr32.h:596
#define CR_OUT_OF_MEMORY
Definition: cfgmgr32.h:844
#define CR_INVALID_LOG_CONF
Definition: cfgmgr32.h:850
#define BOOT_LOG_CONF
Definition: cfgmgr32.h:599
#define OVERRIDE_LOG_CONF
Definition: cfgmgr32.h:601
#define ALLOC_LOG_CONF
Definition: cfgmgr32.h:598
#define FORCED_LOG_CONF
Definition: cfgmgr32.h:600
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define REG_RESOURCE_LIST
Definition: nt_native.h:1502
#define REG_RESOURCE_REQUIREMENTS_LIST
Definition: nt_native.h:1504
unsigned char * LPBYTE
Definition: typedefs.h:53
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by PNP_GetFirstLogConf(), PNP_GetNextLogConf(), and PNP_GetNextResDes().

◆ GetDeviceInstanceList()

static CONFIGRET GetDeviceInstanceList ( _In_ PWSTR  pszDevice,
_Inout_ PWSTR  pszBuffer,
_Inout_ PDWORD  pulLength 
)
static

Definition at line 1158 of file rpcserver.c.

1162{
1163 WCHAR szInstanceBuffer[MAX_DEVICE_ID_LEN];
1164 WCHAR szPathBuffer[512];
1165 HKEY hDeviceKey;
1166 DWORD dwInstanceLength, dwPathLength, dwUsedLength;
1167 DWORD dwIndex, dwError;
1168 PWSTR pPtr;
1170
1171 /* Open the device key */
1172 dwError = RegOpenKeyExW(hEnumKey,
1173 pszDevice,
1174 0,
1176 &hDeviceKey);
1177 if (dwError != ERROR_SUCCESS)
1178 {
1179 DPRINT("Failed to open the device key (Error %lu)\n", dwError);
1180 return CR_REGISTRY_ERROR;
1181 }
1182
1183 dwUsedLength = 0;
1184 pPtr = pszBuffer;
1185
1186 for (dwIndex = 0; ; dwIndex++)
1187 {
1188 dwInstanceLength = MAX_DEVICE_ID_LEN;
1189 dwError = RegEnumKeyExW(hDeviceKey,
1190 dwIndex,
1191 szInstanceBuffer,
1192 &dwInstanceLength,
1193 NULL,
1194 NULL,
1195 NULL,
1196 NULL);
1197 if (dwError != ERROR_SUCCESS)
1198 break;
1199
1200 wsprintf(szPathBuffer, L"%s\\%s", pszDevice, szInstanceBuffer);
1201 DPRINT("Path: %S\n", szPathBuffer);
1202
1203 dwPathLength = wcslen(szPathBuffer) + 1;
1204 if (dwUsedLength + dwPathLength + 1 > *pulLength)
1205 {
1207 break;
1208 }
1209
1210 wcscpy(pPtr, szPathBuffer);
1211 dwUsedLength += dwPathLength;
1212 pPtr += dwPathLength;
1213
1214 *pPtr = UNICODE_NULL;
1215 }
1216
1217 RegCloseKey(hDeviceKey);
1218
1219 if (ret == CR_SUCCESS)
1220 *pulLength = dwUsedLength + 1;
1221 else
1222 *pulLength = 0;
1223
1224 return ret;
1225}
#define KEY_ENUMERATE_SUB_KEYS
Definition: nt_native.h:1019
#define UNICODE_NULL
#define wsprintf
Definition: winuser.h:5877

Referenced by GetEnumeratorInstanceList(), and PNP_GetDeviceList().

◆ GetDeviceInstanceListSize()

static CONFIGRET GetDeviceInstanceListSize ( _In_ LPCWSTR  pszDevice,
_Out_ PULONG  pulLength 
)
static

Definition at line 1572 of file rpcserver.c.

1575{
1576 HKEY hDeviceKey;
1577 DWORD dwSubKeys, dwMaxSubKeyLength;
1578 DWORD dwError;
1579
1580 /* Open the device key */
1581 dwError = RegOpenKeyExW(hEnumKey,
1582 pszDevice,
1583 0,
1584 KEY_READ,
1585 &hDeviceKey);
1586 if (dwError != ERROR_SUCCESS)
1587 {
1588 DPRINT("Failed to open the device key (Error %lu)\n", dwError);
1589 return CR_REGISTRY_ERROR;
1590 }
1591
1592 /* Retrieve the number of device instances and the maximum name length */
1593 dwError = RegQueryInfoKeyW(hDeviceKey,
1594 NULL,
1595 NULL,
1596 NULL,
1597 &dwSubKeys,
1598 &dwMaxSubKeyLength,
1599 NULL,
1600 NULL,
1601 NULL,
1602 NULL,
1603 NULL,
1604 NULL);
1605 if (dwError != ERROR_SUCCESS)
1606 {
1607 DPRINT("RegQueryInfoKeyW failed (Error %lu)\n", dwError);
1608 dwSubKeys = 0;
1609 dwMaxSubKeyLength = 0;
1610 }
1611
1612 /* Close the device key */
1613 RegCloseKey(hDeviceKey);
1614
1615 /* Return the largest possible buffer size */
1616 *pulLength = dwSubKeys * (wcslen(pszDevice) + 1 + dwMaxSubKeyLength + 1);
1617
1618 return CR_SUCCESS;
1619}
LONG WINAPI RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
Definition: reg.c:3662
#define KEY_READ
Definition: nt_native.h:1023

Referenced by GetEnumeratorInstanceListSize(), and PNP_GetDeviceListSize().

◆ GetDeviceStatus()

static CONFIGRET GetDeviceStatus ( _In_ LPWSTR  pszDeviceID,
_Out_ DWORD pulStatus,
_Out_ DWORD pulProblem 
)
static

Definition at line 229 of file rpcserver.c.

233{
234 PLUGPLAY_CONTROL_STATUS_DATA PlugPlayData;
237
238 DPRINT("GetDeviceStatus(%S %p %p)\n",
239 pszDeviceID, pulStatus, pulProblem);
240
242 pszDeviceID);
243 PlugPlayData.Operation = PNP_GET_DEVICE_STATUS;
244
246 (PVOID)&PlugPlayData,
248 if (NT_SUCCESS(Status))
249 {
250 *pulStatus = PlugPlayData.DeviceStatus;
251 *pulProblem = PlugPlayData.DeviceProblem;
252 }
253 else
254 {
256 }
257
258 return ret;
259}
#define PNP_GET_DEVICE_STATUS
Definition: cmtypes.h:59

Referenced by DECLARE_INTERFACE_(), IsPresentDeviceInstanceID(), PNP_GetDeviceStatus(), PNP_SetDeviceProblem(), and SetupDeviceInstance().

◆ GetEnumeratorInstanceList()

CONFIGRET GetEnumeratorInstanceList ( _In_ PWSTR  pszEnumerator,
_Inout_ PWSTR  pszBuffer,
_Inout_ PDWORD  pulLength 
)

Definition at line 1229 of file rpcserver.c.

1233{
1234 WCHAR szDeviceBuffer[MAX_DEVICE_ID_LEN];
1235 WCHAR szPathBuffer[512];
1236 HKEY hEnumeratorKey;
1237 PWSTR pPtr;
1238 DWORD dwIndex, dwDeviceLength, dwUsedLength, dwRemainingLength, dwPathLength;
1239 DWORD dwError;
1241
1242 /* Open the enumerator key */
1243 dwError = RegOpenKeyExW(hEnumKey,
1244 pszEnumerator,
1245 0,
1247 &hEnumeratorKey);
1248 if (dwError != ERROR_SUCCESS)
1249 {
1250 DPRINT("Failed to open the enumerator key (Error %lu)\n", dwError);
1251 return CR_REGISTRY_ERROR;
1252 }
1253
1254 dwUsedLength = 0;
1255 dwRemainingLength = *pulLength;
1256 pPtr = pszBuffer;
1257
1258 for (dwIndex = 0; ; dwIndex++)
1259 {
1260 dwDeviceLength = MAX_DEVICE_ID_LEN;
1261 dwError = RegEnumKeyExW(hEnumeratorKey,
1262 dwIndex,
1263 szDeviceBuffer,
1264 &dwDeviceLength,
1265 NULL,
1266 NULL,
1267 NULL,
1268 NULL);
1269 if (dwError != ERROR_SUCCESS)
1270 break;
1271
1272 wsprintf(szPathBuffer, L"%s\\%s", pszEnumerator, szDeviceBuffer);
1273 DPRINT("Path: %S\n", szPathBuffer);
1274
1275 dwPathLength = dwRemainingLength;
1276 ret = GetDeviceInstanceList(szPathBuffer,
1277 pPtr,
1278 &dwPathLength);
1279 if (ret != CR_SUCCESS)
1280 break;
1281
1282 dwUsedLength += dwPathLength - 1;
1283 dwRemainingLength -= dwPathLength - 1;
1284 pPtr += dwPathLength - 1;
1285 }
1286
1287 RegCloseKey(hEnumeratorKey);
1288
1289 if (ret == CR_SUCCESS)
1290 *pulLength = dwUsedLength + 1;
1291 else
1292 *pulLength = 0;
1293
1294 return ret;
1295}
static CONFIGRET GetDeviceInstanceList(_In_ PWSTR pszDevice, _Inout_ PWSTR pszBuffer, _Inout_ PDWORD pulLength)
Definition: rpcserver.c:1158

Referenced by GetAllInstanceList(), and PNP_GetDeviceList().

◆ GetEnumeratorInstanceListSize()

static CONFIGRET GetEnumeratorInstanceListSize ( _In_ LPCWSTR  pszEnumerator,
_Out_ PULONG  pulLength 
)
static

Definition at line 1624 of file rpcserver.c.

1627{
1628 WCHAR szDeviceBuffer[MAX_DEVICE_ID_LEN];
1629 WCHAR szPathBuffer[512];
1630 HKEY hEnumeratorKey;
1631 DWORD dwIndex, dwDeviceLength, dwBufferLength;
1632 DWORD dwError;
1634
1635 *pulLength = 0;
1636
1637 /* Open the enumerator key */
1638 dwError = RegOpenKeyExW(hEnumKey,
1639 pszEnumerator,
1640 0,
1642 &hEnumeratorKey);
1643 if (dwError != ERROR_SUCCESS)
1644 {
1645 DPRINT("Failed to open the enumerator key (Error %lu)\n", dwError);
1646 return CR_REGISTRY_ERROR;
1647 }
1648
1649 for (dwIndex = 0; ; dwIndex++)
1650 {
1651 dwDeviceLength = MAX_DEVICE_ID_LEN;
1652 dwError = RegEnumKeyExW(hEnumeratorKey,
1653 dwIndex,
1654 szDeviceBuffer,
1655 &dwDeviceLength,
1656 NULL,
1657 NULL,
1658 NULL,
1659 NULL);
1660 if (dwError != ERROR_SUCCESS)
1661 break;
1662
1663 wsprintf(szPathBuffer, L"%s\\%s", pszEnumerator, szDeviceBuffer);
1664 DPRINT("Path: %S\n", szPathBuffer);
1665
1666 ret = GetDeviceInstanceListSize(szPathBuffer, &dwBufferLength);
1667 if (ret != CR_SUCCESS)
1668 {
1669 *pulLength = 0;
1670 break;
1671 }
1672
1673 *pulLength += dwBufferLength;
1674 }
1675
1676 /* Close the enumerator key */
1677 RegCloseKey(hEnumeratorKey);
1678
1679 return ret;
1680}
static CONFIGRET GetDeviceInstanceListSize(_In_ LPCWSTR pszDevice, _Out_ PULONG pulLength)
Definition: rpcserver.c:1572

Referenced by GetAllInstanceListSize(), and PNP_GetDeviceListSize().

◆ GetRelationsInstanceList()

static CONFIGRET GetRelationsInstanceList ( _In_ PWSTR  pszDevice,
_In_ DWORD  ulFlags,
_Inout_ PWSTR  pszBuffer,
_Inout_ PDWORD  pulLength 
)
static

Definition at line 988 of file rpcserver.c.

993{
997
999 pszDevice);
1000
1002 {
1003 PlugPlayData.Relations = 3;
1004 }
1005 else if (ulFlags & CM_GETIDLIST_FILTER_POWERRELATIONS)
1006 {
1007 PlugPlayData.Relations = 2;
1008 }
1009 else if (ulFlags & CM_GETIDLIST_FILTER_REMOVALRELATIONS)
1010 {
1011 PlugPlayData.Relations = 1;
1012 }
1013 else if (ulFlags & CM_GETIDLIST_FILTER_EJECTRELATIONS)
1014 {
1015 PlugPlayData.Relations = 0;
1016 }
1017
1018 PlugPlayData.BufferSize = *pulLength * sizeof(WCHAR);
1019 PlugPlayData.Buffer = pszBuffer;
1020
1022 (PVOID)&PlugPlayData,
1024 if (NT_SUCCESS(Status))
1025 {
1026 *pulLength = PlugPlayData.BufferSize / sizeof(WCHAR);
1027 }
1028 else
1029 {
1031 }
1032
1033 return ret;
1034}
#define CM_GETIDLIST_FILTER_REMOVALRELATIONS
Definition: cfgmgr32.h:658
#define CM_GETIDLIST_FILTER_EJECTRELATIONS
Definition: cfgmgr32.h:657
#define CM_GETIDLIST_FILTER_BUSRELATIONS
Definition: cfgmgr32.h:660
#define CM_GETIDLIST_FILTER_POWERRELATIONS
Definition: cfgmgr32.h:659
@ PlugPlayControlQueryDeviceRelations
Definition: cmtypes.h:225

Referenced by PNP_GetDeviceList().

◆ GetRelationsInstanceListSize()

static CONFIGRET GetRelationsInstanceListSize ( _In_ PWSTR  pszDevice,
_In_ DWORD  ulFlags,
_Inout_ PDWORD  pulLength 
)
static

Definition at line 1423 of file rpcserver.c.

1427{
1431
1433 pszDevice);
1434
1436 {
1437 PlugPlayData.Relations = 3;
1438 }
1439 else if (ulFlags & CM_GETIDLIST_FILTER_POWERRELATIONS)
1440 {
1441 PlugPlayData.Relations = 2;
1442 }
1443 else if (ulFlags & CM_GETIDLIST_FILTER_REMOVALRELATIONS)
1444 {
1445 PlugPlayData.Relations = 1;
1446 }
1447 else if (ulFlags & CM_GETIDLIST_FILTER_EJECTRELATIONS)
1448 {
1449 PlugPlayData.Relations = 0;
1450 }
1451
1452 PlugPlayData.BufferSize = 0;
1453 PlugPlayData.Buffer = NULL;
1454
1456 (PVOID)&PlugPlayData,
1458 if (NT_SUCCESS(Status))
1459 {
1460 *pulLength = PlugPlayData.BufferSize / sizeof(WCHAR);
1461 }
1462 else
1463 {
1465 }
1466
1467 return ret;
1468}

Referenced by PNP_GetDeviceListSize().

◆ GetServiceInstanceList()

static CONFIGRET GetServiceInstanceList ( _In_ PWSTR  pszService,
_Inout_ PWSTR  pszBuffer,
_Inout_ PDWORD  pulLength 
)
static

Definition at line 1039 of file rpcserver.c.

1043{
1044 WCHAR szPathBuffer[512];
1045 WCHAR szName[16];
1046 HKEY hServicesKey = NULL, hServiceKey = NULL, hEnumKey = NULL;
1047 DWORD dwValues, dwSize, dwIndex, dwUsedLength, dwPathLength;
1048 DWORD dwError;
1049 PWSTR pPtr;
1051
1052 /* Open the device key */
1054 L"System\\CurrentControlSet\\Services",
1055 0,
1056 KEY_READ,
1057 &hServicesKey);
1058 if (dwError != ERROR_SUCCESS)
1059 {
1060 DPRINT("Failed to open the services key (Error %lu)\n", dwError);
1061 return CR_REGISTRY_ERROR;
1062 }
1063
1064 dwError = RegOpenKeyExW(hServicesKey,
1065 pszService,
1066 0,
1067 KEY_READ,
1068 &hServiceKey);
1069 if (dwError != ERROR_SUCCESS)
1070 {
1071 DPRINT("Failed to open the service key (Error %lu)\n", dwError);
1073 goto Done;
1074 }
1075
1076 dwError = RegOpenKeyExW(hServiceKey,
1077 L"Enum",
1078 0,
1079 KEY_READ,
1080 &hEnumKey);
1081 if (dwError != ERROR_SUCCESS)
1082 {
1083 DPRINT("Failed to open the service enum key (Error %lu)\n", dwError);
1085 goto Done;
1086 }
1087
1088 /* Retrieve the number of device instances */
1089 dwSize = sizeof(DWORD);
1090 dwError = RegQueryValueExW(hEnumKey,
1091 L"Count",
1092 NULL,
1093 NULL,
1094 (LPBYTE)&dwValues,
1095 &dwSize);
1096 if (dwError != ERROR_SUCCESS)
1097 {
1098 DPRINT("RegQueryValueExW failed (Error %lu)\n", dwError);
1099 dwValues = 1;
1100 }
1101
1102 DPRINT("dwValues %lu\n", dwValues);
1103
1104 dwUsedLength = 0;
1105 pPtr = pszBuffer;
1106
1107 for (dwIndex = 0; dwIndex < dwValues; dwIndex++)
1108 {
1109 wsprintf(szName, L"%lu", dwIndex);
1110
1111 dwSize = sizeof(szPathBuffer);
1112 dwError = RegQueryValueExW(hEnumKey,
1113 szName,
1114 NULL,
1115 NULL,
1116 (LPBYTE)szPathBuffer,
1117 &dwSize);
1118 if (dwError != ERROR_SUCCESS)
1119 break;
1120
1121 DPRINT("Path: %S\n", szPathBuffer);
1122
1123 dwPathLength = wcslen(szPathBuffer) + 1;
1124 if (dwUsedLength + dwPathLength + 1 > *pulLength)
1125 {
1127 break;
1128 }
1129
1130 wcscpy(pPtr, szPathBuffer);
1131 dwUsedLength += dwPathLength;
1132 pPtr += dwPathLength;
1133
1134 *pPtr = UNICODE_NULL;
1135 }
1136
1137Done:
1138 if (hEnumKey != NULL)
1140
1141 if (hServiceKey != NULL)
1142 RegCloseKey(hServiceKey);
1143
1144 if (hServicesKey != NULL)
1146
1147 if (ret == CR_SUCCESS)
1148 *pulLength = dwUsedLength + 1;
1149 else
1150 *pulLength = 0;
1151
1152 return ret;
1153}
static HANDLE hServicesKey
Definition: devinst.c:21
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define DWORD
Definition: nt_native.h:44
static const WCHAR szName[]
Definition: powrprof.c:45
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by PNP_GetDeviceList().

◆ GetServiceInstanceListSize()

static CONFIGRET GetServiceInstanceListSize ( _In_ PWSTR  pszService,
_Out_ PDWORD  pulLength 
)
static

Definition at line 1473 of file rpcserver.c.

1476{
1477 HKEY hServicesKey = NULL, hServiceKey = NULL, hEnumKey = NULL;
1478 DWORD dwValues, dwMaxValueLength, dwSize;
1479 DWORD dwError;
1481
1482 /* Open the device key */
1484 L"System\\CurrentControlSet\\Services",
1485 0,
1486 KEY_READ,
1487 &hServicesKey);
1488 if (dwError != ERROR_SUCCESS)
1489 {
1490 DPRINT("Failed to open the services key (Error %lu)\n", dwError);
1491 return CR_REGISTRY_ERROR;
1492 }
1493
1494 dwError = RegOpenKeyExW(hServicesKey,
1495 pszService,
1496 0,
1497 KEY_READ,
1498 &hServiceKey);
1499 if (dwError != ERROR_SUCCESS)
1500 {
1501 DPRINT("Failed to open the service key (Error %lu)\n", dwError);
1503 goto Done;
1504 }
1505
1506 dwError = RegOpenKeyExW(hServiceKey,
1507 L"Enum",
1508 0,
1509 KEY_READ,
1510 &hEnumKey);
1511 if (dwError != ERROR_SUCCESS)
1512 {
1513 DPRINT("Failed to open the service enum key (Error %lu)\n", dwError);
1515 goto Done;
1516 }
1517
1518 /* Retrieve the number of device instances */
1519 dwSize = sizeof(DWORD);
1520 dwError = RegQueryValueExW(hEnumKey,
1521 L"Count",
1522 NULL,
1523 NULL,
1524 (LPBYTE)&dwValues,
1525 &dwSize);
1526 if (dwError != ERROR_SUCCESS)
1527 {
1528 DPRINT("RegQueryValueExW failed (Error %lu)\n", dwError);
1529 dwValues = 1;
1530 }
1531
1532 /* Retrieve the maximum instance name length */
1533 dwError = RegQueryInfoKeyW(hEnumKey,
1534 NULL,
1535 NULL,
1536 NULL,
1537 NULL,
1538 NULL,
1539 NULL,
1540 NULL,
1541 NULL,
1542 &dwMaxValueLength,
1543 NULL,
1544 NULL);
1545 if (dwError != ERROR_SUCCESS)
1546 {
1547 DPRINT("RegQueryInfoKeyW failed (Error %lu)\n", dwError);
1548 dwMaxValueLength = MAX_DEVICE_ID_LEN;
1549 }
1550
1551 DPRINT("dwValues %lu dwMaxValueLength %lu\n", dwValues, dwMaxValueLength / sizeof(WCHAR));
1552
1553 /* Return the largest possible buffer size */
1554 *pulLength = dwValues * dwMaxValueLength / sizeof(WCHAR) + 2;
1555
1556Done:
1557 if (hEnumKey != NULL)
1559
1560 if (hServiceKey != NULL)
1561 RegCloseKey(hServiceKey);
1562
1563 if (hServicesKey != NULL)
1565
1566 return ret;
1567}

Referenced by PNP_GetDeviceListSize().

◆ IsCallerInteractive()

static BOOL IsCallerInteractive ( _In_ handle_t  hBinding)
static

Definition at line 573 of file rpcserver.c.

575{
577 HANDLE hToken;
578 PSID pInteractiveSid = NULL;
579 BOOL bInteractive = FALSE;
580 RPC_STATUS RpcStatus;
581
582 DPRINT("IsCallerInteractive(%p)\n", hBinding);
583
584 /* Allocate an interactive user sid */
586 1,
588 0, 0, 0, 0, 0, 0, 0,
589 &pInteractiveSid))
590 {
591 DPRINT1("AllocateAndInitializeSid failed\n");
592 return FALSE;
593 }
594
595 /* Impersonate the client */
596 RpcStatus = RpcImpersonateClient(hBinding);
597 if (RpcStatus != RPC_S_OK)
598 {
599 DPRINT1("RpcImpersonateClient failed (Status 0x%08lx)\n", RpcStatus);
600 goto done;
601 }
602
603 /* Open the thread token and check for interactive user membership */
605 {
606 CheckTokenMembership(hToken, pInteractiveSid, &bInteractive);
607 CloseHandle(hToken);
608 }
609
610 /* Revert the impersonation */
612
613done:
614 if (pInteractiveSid)
615 FreeSid(pInteractiveSid);
616
617 return bInteractive;
618}
static SID_IDENTIFIER_AUTHORITY NtAuthority
Definition: security.c:40
handle_t hBinding
Definition: ctx_c.c:54
BOOL WINAPI CheckTokenMembership(IN HANDLE ExistingTokenHandle, IN PSID SidToCheck, OUT PBOOL IsMember)
Definition: token.c:21
BOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, BYTE nSubAuthorityCount, DWORD nSubAuthority0, DWORD nSubAuthority1, DWORD nSubAuthority2, DWORD nSubAuthority3, DWORD nSubAuthority4, DWORD nSubAuthority5, DWORD nSubAuthority6, DWORD nSubAuthority7, PSID *pSid)
Definition: security.c:674
BOOL WINAPI OpenThreadToken(HANDLE ThreadHandle, DWORD DesiredAccess, BOOL OpenAsSelf, HANDLE *TokenHandle)
Definition: security.c:336
PVOID WINAPI FreeSid(PSID pSid)
Definition: security.c:698
#define CloseHandle
Definition: compat.h:739
unsigned int BOOL
Definition: ntddk_ex.h:94
RPC_STATUS WINAPI RpcRevertToSelf(void)
Definition: rpc_binding.c:1463
RPC_STATUS WINAPI RpcImpersonateClient(RPC_BINDING_HANDLE BindingHandle)
Definition: rpc_binding.c:1056
#define RPC_S_OK
Definition: rpcnterr.h:22
long RPC_STATUS
Definition: rpc.h:48
HANDLE WINAPI GetCurrentThread(void)
Definition: proc.c:1148
#define SECURITY_INTERACTIVE_RID
Definition: setypes.h:559
#define TOKEN_QUERY
Definition: setypes.h:928
#define SECURITY_NT_AUTHORITY
Definition: setypes.h:554

Referenced by PNP_ReportLogOn().

◆ IsPresentDeviceInstanceID()

static BOOL IsPresentDeviceInstanceID ( _In_ LPWSTR  pszDeviceInstanceID)
static

Definition at line 418 of file rpcserver.c.

420{
421 DWORD ulStatus, ulProblem;
422
423 return (GetDeviceStatus(pszDeviceInstanceID, &ulStatus, &ulProblem) == CR_SUCCESS);
424}
static CONFIGRET GetDeviceStatus(_In_ LPWSTR pszDeviceID, _Out_ DWORD *pulStatus, _Out_ DWORD *pulProblem)
Definition: rpcserver.c:229

Referenced by PNP_CreateDevInst(), and PNP_GetRelatedDeviceInstance().

◆ IsRootDeviceInstanceID()

static BOOL IsRootDeviceInstanceID ( _In_ PWSTR  pszDeviceInstanceID)
static

Definition at line 406 of file rpcserver.c.

408{
409 if (_wcsicmp(pszDeviceInstanceID, szRootDeviceInstanceID) == 0)
410 return TRUE;
411
412 return FALSE;
413}
static WCHAR szRootDeviceInstanceID[]
Definition: rpcserver.c:39

Referenced by PNP_CreateDevInst(), PNP_DisableDevInst(), PNP_GetRelatedDeviceInstance(), PNP_QueryRemove(), and SetupDeviceInstance().

◆ IsValidDeviceInstanceID()

static BOOL IsValidDeviceInstanceID ( _In_ PWSTR  pszDeviceInstanceID)
static

Definition at line 340 of file rpcserver.c.

342{
343 INT nPartLength[3] = {0, 0, 0};
344 INT nLength = 0, nParts = 0;
345 PWCHAR p;
346
347 DPRINT("IsValidDeviceInstanceID(%S)\n",
348 pszDeviceInstanceID);
349
350 if (pszDeviceInstanceID == NULL)
351 {
352 DPRINT("Device instance ID is NULL!\n");
353 return FALSE;
354 }
355
356 p = pszDeviceInstanceID;
357 while (*p != UNICODE_NULL)
358 {
359 if (*p == L'\\')
360 {
361 nParts++;
362 if (nParts >= 3)
363 {
364 DPRINT("Too many separators: %d\n", nParts);
365 return FALSE;
366 }
367 }
368 else
369 {
370 nPartLength[nParts]++;
371 }
372
373 nLength++;
375 {
376 DPRINT("Too long: %d\n", nLength);
377 return FALSE;
378 }
379
380 p++;
381 }
382
383 if (nParts != 2)
384 {
385 DPRINT("Invalid number of separtors: %d\n", nParts);
386 return FALSE;
387 }
388
389 if ((nPartLength[0] == 0) ||
390 (nPartLength[1] == 0) ||
391 (nPartLength[2] == 0))
392 {
393 DPRINT("Invalid part lengths: %d %d %d\n",
394 nPartLength[0], nPartLength[1], nPartLength[2]);
395 return FALSE;
396 }
397
398 DPRINT("Valid device instance ID!\n");
399
400 return TRUE;
401}
GLfloat GLfloat p
Definition: glext.h:8902
int32_t INT
Definition: typedefs.h:58
uint16_t * PWCHAR
Definition: typedefs.h:56
_In_ DWORD nLength
Definition: wincon.h:473

Referenced by PNP_CreateKey(), PNP_DisableDevInst(), PNP_GetClassInstance(), PNP_GetCustomDevProp(), PNP_GetDepth(), PNP_GetDeviceRegProp(), PNP_GetDeviceStatus(), PNP_GetFirstLogConf(), PNP_GetInterfaceDeviceList(), PNP_GetInterfaceDeviceListSize(), PNP_GetNextLogConf(), PNP_GetNextResDes(), PNP_GetRelatedDeviceInstance(), PNP_HwProfFlags(), PNP_QueryRemove(), PNP_RegisterDriver(), PNP_RequestDeviceEject(), PNP_SetDeviceProblem(), PNP_SetDeviceRegProp(), and PNP_ValidateDeviceInstance().

◆ midl_user_allocate()

void __RPC_FAR *__RPC_USER midl_user_allocate ( SIZE_T  len)

Definition at line 111 of file rpcserver.c.

112{
114}
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
GLenum GLsizei len
Definition: glext.h:6722

◆ midl_user_free()

void __RPC_USER midl_user_free ( void __RPC_FAR ptr)

Definition at line 117 of file rpcserver.c.

118{
120}
#define HeapFree(x, y, z)
Definition: compat.h:735
static PVOID ptr
Definition: dispmode.c:27

◆ NtStatusToCrError()

static CONFIGRET WINAPI NtStatusToCrError ( NTSTATUS  Status)
static

Definition at line 124 of file rpcserver.c.

125{
126 switch (Status)
127 {
130
132 return CR_INVALID_DATA;
133
135 return CR_NO_SUCH_DEVINST;
136
138 return CR_ACCESS_DENIED;
139
141 return CR_BUFFER_SMALL;
142
144 return CR_NO_SUCH_VALUE;
145
146 default:
147 return CR_FAILURE;
148 }
149}
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
#define CR_NO_SUCH_DEVINST
Definition: cfgmgr32.h:858
#define CR_ACCESS_DENIED
Definition: cfgmgr32.h:897
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define CR_NO_SUCH_VALUE
Definition: cfgmgr32.h:883
#define STATUS_NOT_IMPLEMENTED
Definition: d3dkmdt.h:42
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_OBJECT_NAME_NOT_FOUND
Definition: udferr_usr.h:149

Referenced by ClearDeviceStatus(), DisableDeviceInstance(), EnableDeviceInstance(), GetDeviceStatus(), GetRelationsInstanceList(), GetRelationsInstanceListSize(), PNP_GetDepth(), PNP_GetDeviceRegProp(), PNP_GetInterfaceDeviceList(), PNP_GetInterfaceDeviceListSize(), PNP_GetRelatedDeviceInstance(), PNP_QueryRemove(), PNP_RequestDeviceEject(), PNP_RequestEjectPC(), ReenumerateDeviceInstance(), SetDeviceStatus(), and SetupDeviceInstance().

◆ OpenConfigurationKey()

static CONFIGRET OpenConfigurationKey ( _In_ LPCWSTR  pszDeviceID,
_In_ DWORD  ulLogConfType,
_Out_ PHKEY  phKey 
)
static

Definition at line 429 of file rpcserver.c.

433{
434 WCHAR szKeyName[MAX_PATH];
435 PCWSTR pszSubKeyName;
436 HKEY hInstanceKey;
437 DWORD dwError;
438
439 /* Build the full device instance key name */
440 wcscpy(szKeyName, L"System\\CurrentControlSet\\Enum\\");
441 wcscat(szKeyName, pszDeviceID);
442
443 /* Open the device instance key */
445 szKeyName,
446 0,
448 &hInstanceKey);
449 if (dwError != ERROR_SUCCESS)
450 return CR_INVALID_DEVINST;
451
452 switch (ulLogConfType)
453 {
454 case BOOT_LOG_CONF:
455 case BASIC_LOG_CONF:
456 pszSubKeyName = L"LogConf";
457 break;
458
459 case ALLOC_LOG_CONF:
461 pszSubKeyName = L"Control";
462 break;
463
464 default:
465 DPRINT1("Unsupported configuration type!\n");
466 return CR_FAILURE;
467 }
468
469 /* Create or open the LogConf key */
470 dwError = RegCreateKeyExW(hInstanceKey,
471 pszSubKeyName,
472 0,
473 NULL,
476 NULL,
477 phKey,
478 NULL);
479
480 /* Close the device instance key */
481 RegCloseKey(hInstanceKey);
482
483 if (dwError != ERROR_SUCCESS)
484 return CR_REGISTRY_ERROR;
485
486 return CR_SUCCESS;
487}
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
wcscat
#define MAX_PATH
Definition: compat.h:34
#define KEY_CREATE_SUB_KEY
Definition: nt_native.h:1018
const uint16_t * PCWSTR
Definition: typedefs.h:57

Referenced by PNP_GetFirstLogConf(), PNP_GetNextLogConf(), and PNP_GetNextResDes().

◆ PNP_AddEmptyLogConf()

DWORD WINAPI PNP_AddEmptyLogConf ( handle_t  hBinding,
LPWSTR  pDeviceID,
DWORD  ulPriority,
DWORD pulLogConfTag,
DWORD  ulFlags 
)

Definition at line 4164 of file rpcserver.c.

4170{
4173}
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15

Referenced by CM_Add_Empty_Log_Conf_Ex().

◆ PNP_AddID()

DWORD WINAPI PNP_AddID ( handle_t  hBinding,
LPWSTR  pszDeviceID,
LPWSTR  pszID,
DWORD  ulFlags 
)

Definition at line 3630 of file rpcserver.c.

3635{
3637 HKEY hDeviceKey;
3638 LPWSTR pszSubKey;
3639 DWORD dwDeviceIdListSize;
3640 DWORD dwNewDeviceIdSize;
3641 WCHAR * pszDeviceIdList = NULL;
3642
3644
3645 DPRINT("PNP_AddID(%p %S %S 0x%08lx)\n",
3646 hBinding, pszDeviceID, pszID, ulFlags);
3647
3649 pszDeviceID,
3650 0,
3652 &hDeviceKey) != ERROR_SUCCESS)
3653 {
3654 DPRINT("Failed to open the device key!\n");
3655 return CR_INVALID_DEVNODE;
3656 }
3657
3658 pszSubKey = (ulFlags & CM_ADD_ID_COMPATIBLE) ? L"CompatibleIDs" : L"HardwareID";
3659
3660 if (RegQueryValueExW(hDeviceKey,
3661 pszSubKey,
3662 NULL,
3663 NULL,
3664 NULL,
3665 &dwDeviceIdListSize) != ERROR_SUCCESS)
3666 {
3667 DPRINT("Failed to query the desired ID string!\n");
3669 goto Done;
3670 }
3671
3672 dwNewDeviceIdSize = lstrlenW(pszDeviceID);
3673 if (!dwNewDeviceIdSize)
3674 {
3676 goto Done;
3677 }
3678
3679 dwDeviceIdListSize += (dwNewDeviceIdSize + 2) * sizeof(WCHAR);
3680
3681 pszDeviceIdList = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwDeviceIdListSize);
3682 if (!pszDeviceIdList)
3683 {
3684 DPRINT("Failed to allocate memory for the desired ID string!\n");
3686 goto Done;
3687 }
3688
3689 if (RegQueryValueExW(hDeviceKey,
3690 pszSubKey,
3691 NULL,
3692 NULL,
3693 (LPBYTE)pszDeviceIdList,
3694 &dwDeviceIdListSize) != ERROR_SUCCESS)
3695 {
3696 DPRINT("Failed to query the desired ID string!\n");
3698 goto Done;
3699 }
3700
3701 /* Check whether the device ID is already in use */
3702 if (CheckForDeviceId(pszDeviceIdList, pszDeviceID))
3703 {
3704 DPRINT("Device ID was found in the ID string!\n");
3705 ret = CR_SUCCESS;
3706 goto Done;
3707 }
3708
3709 /* Append the Device ID */
3710 AppendDeviceId(pszDeviceIdList, &dwDeviceIdListSize, pszID);
3711
3712 if (RegSetValueExW(hDeviceKey,
3713 pszSubKey,
3714 0,
3716 (LPBYTE)pszDeviceIdList,
3717 dwDeviceIdListSize) != ERROR_SUCCESS)
3718 {
3719 DPRINT("Failed to set the desired ID string!\n");
3721 }
3722
3723Done:
3724 RegCloseKey(hDeviceKey);
3725 if (pszDeviceIdList)
3726 HeapFree(GetProcessHeap(), 0, pszDeviceIdList);
3727
3728 DPRINT("PNP_AddID() done (returns %lx)\n", ret);
3729
3730 return ret;
3731}
static VOID AppendDeviceId(LPWSTR lpDeviceIdList, LPDWORD lpDeviceIdListSize, LPWSTR lpDeviceId)
Definition: rpcserver.c:3607
static BOOL CheckForDeviceId(LPWSTR lpDeviceIdList, LPWSTR lpDeviceId)
Definition: rpcserver.c:3586
#define CM_ADD_ID_COMPATIBLE
Definition: cfgmgr32.h:615
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
#define lstrlenW
Definition: compat.h:750
#define REG_MULTI_SZ
Definition: nt_native.h:1501
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:325

Referenced by CM_Add_ID_ExW().

◆ PNP_AddResDes()

DWORD WINAPI PNP_AddResDes ( handle_t  hBinding,
LPWSTR  pDeviceID,
DWORD  ulLogConfTag,
DWORD  ulLogConfType,
RESOURCEID  ResourceID,
DWORD pulResourceTag,
BYTE ResourceData,
PNP_RPC_BUFFER_SIZE  ResourceLen,
DWORD  ulFlags 
)

Definition at line 4426 of file rpcserver.c.

4436{
4439}

◆ PNP_ApplyPowerSettings()

DWORD WINAPI PNP_ApplyPowerSettings ( handle_t  hBinding)

Definition at line 5049 of file rpcserver.c.

5051{
5054}

◆ PNP_Connect()

DWORD WINAPI PNP_Connect ( handle_t  hBinding)

Definition at line 646 of file rpcserver.c.

648{
650 return CR_SUCCESS;
651}

◆ PNP_CreateDevInst()

DWORD WINAPI PNP_CreateDevInst ( handle_t  hBinding,
LPWSTR  pszDeviceID,
LPWSTR  pszParentDeviceID,
PNP_RPC_STRING_LEN  ulLength,
DWORD  ulFlags 
)

Definition at line 3129 of file rpcserver.c.

3135{
3137 HKEY hKey = NULL;
3138 DWORD dwSize, dwPhantom;
3141
3142 DPRINT("PNP_CreateDevInst(%p %S %S %lu 0x%08lx)\n",
3143 hBinding, pszParentDeviceID, pszDeviceID, ulLength, ulFlags);
3144
3145 if (ulFlags & ~CM_CREATE_DEVNODE_BITS)
3146 return CR_INVALID_FLAG;
3147
3148 if (pszDeviceID == NULL || pszParentDeviceID == NULL)
3149 return CR_INVALID_POINTER;
3150
3151 /* Fail, if the parent device is not the root device */
3152 if (!IsRootDeviceInstanceID(pszParentDeviceID))
3153 return CR_INVALID_DEVINST;
3154
3155 if (ulFlags & CM_CREATE_DEVNODE_GENERATE_ID)
3156 {
3157 ret = GenerateDeviceID(pszDeviceID,
3158 ulLength);
3159 if (ret != CR_SUCCESS)
3160 return ret;
3161 }
3162
3163 /* Try to open the device instance key */
3164 RegOpenKeyEx(hEnumKey, pszDeviceID, 0, KEY_READ | KEY_WRITE, &hKey);
3165
3166 if (ulFlags & CM_CREATE_DEVNODE_PHANTOM)
3167 {
3168 /* Fail, if the device already exists */
3169 if (hKey != NULL)
3170 {
3172 goto done;
3173 }
3174
3175 /* Create the phantom device instance */
3176 ret = CreateDeviceInstance(pszDeviceID, TRUE);
3177 }
3178 else
3179 {
3180 /* Fail, if the device exists and is present */
3181 if ((hKey != NULL) && (IsPresentDeviceInstanceID(pszDeviceID)))
3182 {
3184 goto done;
3185 }
3186
3187 /* If it does not already exist ... */
3188 if (hKey == NULL)
3189 {
3190 /* Create the device instance */
3191 ret = CreateDeviceInstance(pszDeviceID, FALSE);
3192
3193 /* Open the device instance key */
3194 RegOpenKeyEx(hEnumKey, pszDeviceID, 0, KEY_READ | KEY_WRITE, &hKey);
3195 }
3196
3197 /* Create a device node for the device */
3198 RtlInitUnicodeString(&ControlData.DeviceInstance, pszDeviceID);
3200 &ControlData,
3201 sizeof(ControlData));
3202 if (!NT_SUCCESS(Status))
3203 {
3204 ret = CR_FAILURE;
3205 goto done;
3206 }
3207
3208 /* If the device is a phantom device, turn it into a normal device */
3209 if (hKey != NULL)
3210 {
3211 dwPhantom = 0;
3212 dwSize = sizeof(DWORD);
3213 RegQueryValueEx(hKey, L"Phantom", NULL, NULL, (PBYTE)&dwPhantom, &dwSize);
3214
3215 if (dwPhantom != 0)
3216 RegDeleteValue(hKey, L"Phantom");
3217 }
3218 }
3219
3220done:
3221 if (hKey)
3223
3224 DPRINT("PNP_CreateDevInst() done (returns %lx)\n", ret);
3225
3226 return ret;
3227}
static CONFIGRET GenerateDeviceID(_Inout_ LPWSTR pszDeviceID, _In_ PNP_RPC_STRING_LEN ulLength)
Definition: rpcserver.c:3079
static BOOL IsPresentDeviceInstanceID(_In_ LPWSTR pszDeviceInstanceID)
Definition: rpcserver.c:418
static BOOL IsRootDeviceInstanceID(_In_ PWSTR pszDeviceInstanceID)
Definition: rpcserver.c:406
static CONFIGRET CreateDeviceInstance(_In_ LPWSTR pszDeviceID, _In_ BOOL bPhantomDevice)
Definition: rpcserver.c:2959
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
#define CM_CREATE_DEVNODE_BITS
Definition: cfgmgr32.h:624
#define CM_CREATE_DEVNODE_GENERATE_ID
Definition: cfgmgr32.h:622
#define CM_CREATE_DEVNODE_PHANTOM
Definition: cfgmgr32.h:621
@ PlugPlayControlInitializeDevice
Definition: cmtypes.h:212
#define KEY_WRITE
Definition: nt_native.h:1031
#define RegQueryValueEx
Definition: winreg.h:524
#define RegDeleteValue
Definition: winreg.h:508

Referenced by CM_Create_DevNode_ExW().

◆ PNP_CreateKey()

DWORD WINAPI PNP_CreateKey ( handle_t  hBinding,
LPWSTR  pszSubKey,
DWORD  samDesired,
DWORD  ulFlags 
)

Definition at line 2373 of file rpcserver.c.

2378{
2379 HKEY hDeviceKey = NULL, hParametersKey = NULL;
2380 DWORD dwError;
2382
2384 UNREFERENCED_PARAMETER(samDesired);
2385
2386 DPRINT("PNP_CreateKey(%p %S 0x%lx 0x%08lx)\n",
2387 hBinding, pszSubKey, samDesired, ulFlags);
2388
2389 if (ulFlags != 0)
2390 return CR_INVALID_FLAG;
2391
2392 if (!IsValidDeviceInstanceID(pszSubKey))
2393 return CR_INVALID_DEVINST;
2394
2395 dwError = RegOpenKeyExW(hEnumKey,
2396 pszSubKey,
2397 0,
2398 KEY_WRITE,
2399 &hDeviceKey);
2400 if (dwError != ERROR_SUCCESS)
2401 {
2403 goto done;
2404 }
2405
2406 dwError = RegCreateKeyExW(hDeviceKey,
2407 L"Device Parameters",
2408 0,
2409 NULL,
2412 NULL,
2413 &hParametersKey,
2414 NULL);
2415 if (dwError != ERROR_SUCCESS)
2416 {
2418 goto done;
2419 }
2420
2421 /* FIXME: Set key security */
2422
2423done:
2424 if (hParametersKey != NULL)
2425 RegCloseKey(hParametersKey);
2426
2427 if (hDeviceKey != NULL)
2428 RegCloseKey(hDeviceKey);
2429
2430 return ret;
2431}
static BOOL IsValidDeviceInstanceID(_In_ PWSTR pszDeviceInstanceID)
Definition: rpcserver.c:340

◆ PNP_DeleteClassKey()

DWORD WINAPI PNP_DeleteClassKey ( handle_t  hBinding,
LPWSTR  pszClassGuid,
DWORD  ulFlags 
)

Definition at line 2555 of file rpcserver.c.

2559{
2561
2563
2564 DPRINT("PNP_DeleteClassKey(%p %S 0x%08lx)\n",
2565 hBinding, pszClassGuid, ulFlags);
2566
2567 if (ulFlags & CM_DELETE_CLASS_SUBKEYS)
2568 {
2569 if (SHDeleteKeyW(hClassKey, pszClassGuid) != ERROR_SUCCESS)
2571 }
2572 else
2573 {
2574 if (RegDeleteKeyW(hClassKey, pszClassGuid) != ERROR_SUCCESS)
2576 }
2577
2578 DPRINT("PNP_DeleteClassKey() done (returns %lx)\n", ret);
2579
2580 return ret;
2581}
HKEY hClassKey
Definition: umpnpmgr.c:45
#define CM_DELETE_CLASS_SUBKEYS
Definition: cfgmgr32.h:635
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
Definition: reg.c:1239
DWORD WINAPI SHDeleteKeyW(HKEY hKey, LPCWSTR lpszSubKey)
Definition: reg.c:1546

Referenced by CM_Delete_Class_Key_Ex().

◆ PNP_DeleteRegistryKey()

DWORD WINAPI PNP_DeleteRegistryKey ( handle_t  hBinding,
LPWSTR  pszDeviceID,
LPWSTR  pszParentKey,
LPWSTR  pszChildKey,
DWORD  ulFlags 
)

Definition at line 2437 of file rpcserver.c.

2443{
2446}

Referenced by CM_Delete_DevNode_Key_Ex().

◆ PNP_DeleteServiceDevices()

DWORD WINAPI PNP_DeleteServiceDevices ( handle_t  hBinding)

Definition at line 5106 of file rpcserver.c.

5108{
5111}

◆ PNP_DetectResourceConflict()

DWORD WINAPI PNP_DetectResourceConflict ( handle_t  hBinding,
LPWSTR  pDeviceID,
RESOURCEID  ResourceID,
BYTE ResourceData,
PNP_RPC_BUFFER_SIZE  ResourceLen,
BOOL pbConflictDetected,
DWORD  ulFlags 
)

Definition at line 4616 of file rpcserver.c.

4624{
4625 DPRINT("PNP_DetectResourceConflict()\n");
4626
4627 if (pbConflictDetected != NULL)
4628 *pbConflictDetected = FALSE;
4629
4631}

◆ PNP_DeviceInstanceAction()

DWORD WINAPI PNP_DeviceInstanceAction ( handle_t  hBinding,
DWORD  ulMajorAction,
DWORD  ulMinorAction,
LPWSTR  pszDeviceInstance1,
LPWSTR  pszDeviceInstance2 
)

Definition at line 3369 of file rpcserver.c.

3375{
3377
3379
3380 DPRINT("PNP_DeviceInstanceAction(%p %lu 0x%08lx %S %S)\n",
3381 hBinding, ulMajorAction, ulMinorAction,
3382 pszDeviceInstance1, pszDeviceInstance2);
3383
3384 switch (ulMajorAction)
3385 {
3386 case PNP_DEVINST_SETUP:
3387 ret = SetupDeviceInstance(pszDeviceInstance1,
3388 ulMinorAction);
3389 break;
3390
3391 case PNP_DEVINST_ENABLE:
3392 ret = EnableDeviceInstance(pszDeviceInstance1);
3393 break;
3394
3395 case PNP_DEVINST_REENUMERATE:
3396 ret = ReenumerateDeviceInstance(pszDeviceInstance1,
3397 ulMinorAction);
3398 break;
3399
3400 default:
3401 DPRINT1("Unknown device action %lu: not implemented\n", ulMajorAction);
3403 }
3404
3405 DPRINT("PNP_DeviceInstanceAction() done (returns %lx)\n", ret);
3406
3407 return ret;
3408}
static CONFIGRET SetupDeviceInstance(_In_ LPWSTR pszDeviceInstance, _In_ DWORD ulMinorAction)
Definition: rpcserver.c:3231
static CONFIGRET ReenumerateDeviceInstance(_In_ LPWSTR pszDeviceInstance, _In_ ULONG ulMinorAction)
Definition: rpcserver.c:3333
static CONFIGRET EnableDeviceInstance(_In_ LPWSTR pszDeviceInstance)
Definition: rpcserver.c:3314

Referenced by CM_Enable_DevNode_Ex(), CM_Move_DevNode_Ex(), CM_Reenumerate_DevNode_Ex(), and CM_Setup_DevNode_Ex().

◆ PNP_DisableDevInst()

DWORD WINAPI PNP_DisableDevInst ( handle_t  hBinding,
LPWSTR  pDeviceID,
PPNP_VETO_TYPE  pVetoType,
LPWSTR  pszVetoName,
DWORD  ulNameLength,
DWORD  ulFlags 
)

Definition at line 3545 of file rpcserver.c.

3552{
3554
3555 DPRINT1("PNP_DisableDevInst(%p %S %p %p %lu 0x%08lx)\n",
3556 hBinding, pDeviceID, pVetoType, pszVetoName, ulNameLength, ulFlags);
3557
3558 if (ulFlags & ~CM_DISABLE_BITS)
3559 return CR_INVALID_FLAG;
3560
3561 if (!IsValidDeviceInstanceID(pDeviceID) ||
3562 IsRootDeviceInstanceID(pDeviceID))
3563 return CR_INVALID_DEVINST;
3564
3565 return DisableDeviceInstance(pDeviceID,
3566 pVetoType,
3567 pszVetoName,
3568 ulNameLength);
3569}
static CONFIGRET DisableDeviceInstance(_In_ LPWSTR pszDeviceInstance, _Inout_opt_ PPNP_VETO_TYPE pVetoType, _Inout_opt_ LPWSTR pszVetoName, _In_ DWORD ulNameLength)
Definition: rpcserver.c:294
#define CM_DISABLE_BITS
Definition: cfgmgr32.h:652

Referenced by CM_Disable_DevNode_Ex().

◆ PNP_Disconnect()

DWORD WINAPI PNP_Disconnect ( handle_t  hBinding)

Definition at line 635 of file rpcserver.c.

637{
639 return CR_SUCCESS;
640}

◆ PNP_DriverStoreAddDriverPackage()

DWORD WINAPI PNP_DriverStoreAddDriverPackage ( handle_t  hBinding)

Definition at line 5060 of file rpcserver.c.

5062{
5065}

◆ PNP_DriverStoreDeleteDriverPackage()

DWORD WINAPI PNP_DriverStoreDeleteDriverPackage ( handle_t  hBinding)

Definition at line 5071 of file rpcserver.c.

5073{
5076}

◆ PNP_EnumerateSubKeys()

DWORD WINAPI PNP_EnumerateSubKeys ( handle_t  hBinding,
DWORD  ulBranch,
DWORD  ulIndex,
LPWSTR  Buffer,
PNP_RPC_STRING_LEN  ulLength,
PNP_RPC_STRING_LEN pulRequiredLen,
DWORD  ulFlags 
)

Definition at line 928 of file rpcserver.c.

936{
938 HKEY hKey;
939 DWORD dwError;
940
942 UNREFERENCED_PARAMETER(ulFlags);
943
944 DPRINT("PNP_EnumerateSubKeys(%p %lu %lu %p %lu %p 0x%08lx)\n",
945 hBinding, ulBranch, ulIndex, Buffer, ulLength,
946 pulRequiredLen, ulFlags);
947
948 switch (ulBranch)
949 {
950 case PNP_ENUMERATOR_SUBKEYS:
951 hKey = hEnumKey;
952 break;
953
954 case PNP_CLASS_SUBKEYS:
955 hKey = hClassKey;
956 break;
957
958 default:
959 return CR_FAILURE;
960 }
961
962 *pulRequiredLen = ulLength;
963 dwError = RegEnumKeyExW(hKey,
964 ulIndex,
965 Buffer,
966 pulRequiredLen,
967 NULL,
968 NULL,
969 NULL,
970 NULL);
971 if (dwError != ERROR_SUCCESS)
972 {
974 }
975 else
976 {
977 (*pulRequiredLen)++;
978 }
979
980 DPRINT("PNP_EnumerateSubKeys() done (returns %lx)\n", ret);
981
982 return ret;
983}
Definition: bufpool.h:45
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105

Referenced by CM_Enumerate_Classes_Ex(), and CM_Enumerate_Enumerators_ExW().

◆ PNP_FreeLogConf()

DWORD WINAPI PNP_FreeLogConf ( handle_t  hBinding,
LPWSTR  pDeviceID,
DWORD  ulLogConfType,
DWORD  ulLogConfTag,
DWORD  ulFlags 
)

Definition at line 4179 of file rpcserver.c.

4185{
4188}

Referenced by CM_Free_Log_Conf_Ex().

◆ PNP_FreeResDes()

DWORD WINAPI PNP_FreeResDes ( handle_t  hBinding,
LPWSTR  pDeviceID,
DWORD  ulLogConfTag,
DWORD  ulLogConfType,
RESOURCEID  ResourceID,
DWORD  ulResourceTag,
DWORD pulPreviousResType,
DWORD pulPreviousResTag,
DWORD  ulFlags 
)

Definition at line 4445 of file rpcserver.c.

4455{
4458}

◆ PNP_GetBlockedDriverInfo()

DWORD WINAPI PNP_GetBlockedDriverInfo ( handle_t  hBinding,
BYTE Buffer,
PNP_RPC_BUFFER_SIZE pulTransferLen,
PNP_RPC_BUFFER_SIZE pulLength,
DWORD  ulFlags 
)

Definition at line 4940 of file rpcserver.c.

4946{
4949}

Referenced by CMP_GetBlockedDriverInfo().

◆ PNP_GetClassCount()

DWORD WINAPI PNP_GetClassCount ( handle_t  hBinding,
DWORD pulClassCount,
DWORD  ulFlags 
)

Definition at line 2452 of file rpcserver.c.

2456{
2457 HKEY hKey;
2458 DWORD dwError;
2459
2461 UNREFERENCED_PARAMETER(ulFlags);
2462
2463 DPRINT("PNP_GetClassCount(%p %p 0x%08lx)\n",
2464 hBinding, pulClassCount, ulFlags);
2465
2468 0,
2470 &hKey);
2471 if (dwError != ERROR_SUCCESS)
2472 return CR_INVALID_DATA;
2473
2474 dwError = RegQueryInfoKeyW(hKey,
2475 NULL,
2476 NULL,
2477 NULL,
2478 pulClassCount,
2479 NULL,
2480 NULL,
2481 NULL,
2482 NULL,
2483 NULL,
2484 NULL,
2485 NULL);
2487 if (dwError != ERROR_SUCCESS)
2488 return CR_INVALID_DATA;
2489
2490 return CR_SUCCESS;
2491}
#define REGSTR_PATH_CLASS
Definition: regstr.h:42

◆ PNP_GetClassInstance()

DWORD WINAPI PNP_GetClassInstance ( handle_t  hBinding,
LPWSTR  pDeviceId,
LPWSTR  pszClassInstance,
PNP_RPC_STRING_LEN  ulLength 
)

Definition at line 2257 of file rpcserver.c.

2262{
2263 WCHAR szClassGuid[40];
2264 WCHAR szClassInstance[5];
2265 HKEY hDeviceClassKey = NULL;
2266 HKEY hClassInstanceKey;
2267 ULONG ulTransferLength, ulDataLength;
2268 DWORD dwDataType, dwDisposition, i;
2269 DWORD dwError;
2271
2272 DPRINT("PNP_GetClassInstance(%p %S %p %lu)\n",
2273 hBinding, pDeviceId, pszClassInstance, ulLength);
2274
2275 if (!IsValidDeviceInstanceID(pDeviceId))
2276 return CR_INVALID_DEVINST;
2277
2278 ulTransferLength = ulLength;
2280 pDeviceId,
2282 &dwDataType,
2283 (BYTE *)pszClassInstance,
2284 &ulTransferLength,
2285 &ulLength,
2286 0);
2287 if (ret == CR_SUCCESS)
2288 return ret;
2289
2290 ulTransferLength = sizeof(szClassGuid);
2291 ulDataLength = sizeof(szClassGuid);
2293 pDeviceId,
2295 &dwDataType,
2296 (BYTE *)szClassGuid,
2297 &ulTransferLength,
2298 &ulDataLength,
2299 0);
2300 if (ret != CR_SUCCESS)
2301 {
2302 DPRINT1("PNP_GetDeviceRegProp() failed (Error %lu)\n", ret);
2303 goto done;
2304 }
2305
2306 dwError = RegOpenKeyExW(hClassKey,
2307 szClassGuid,
2308 0,
2309 KEY_READ,
2310 &hDeviceClassKey);
2311 if (dwError != ERROR_SUCCESS)
2312 {
2313 DPRINT1("RegOpenKeyExW() failed (Error %lu)\n", dwError);
2314 ret = CR_FAILURE;
2315 goto done;
2316 }
2317
2318 for (i = 0; i < 10000; i++)
2319 {
2320 wsprintf(szClassInstance, L"%04lu", i);
2321
2322 dwError = RegCreateKeyExW(hDeviceClassKey,
2323 szClassInstance,
2324 0,
2325 NULL,
2328 NULL,
2329 &hClassInstanceKey,
2330 &dwDisposition);
2331 if (dwError == ERROR_SUCCESS)
2332 {
2333 RegCloseKey(hClassInstanceKey);
2334
2335 if (dwDisposition == REG_CREATED_NEW_KEY)
2336 {
2337 wsprintf(pszClassInstance,
2338 L"%s\\%s",
2339 szClassGuid,
2340 szClassInstance);
2341
2342 ulDataLength = (wcslen(pszClassInstance) + 1) * sizeof(WCHAR);
2344 pDeviceId,
2346 REG_SZ,
2347 (BYTE *)pszClassInstance,
2348 ulDataLength,
2349 0);
2350 if (ret != CR_SUCCESS)
2351 {
2352 DPRINT1("PNP_SetDeviceRegProp() failed (Error %lu)\n", ret);
2353 RegDeleteKeyW(hDeviceClassKey,
2354 szClassInstance);
2355 }
2356
2357 break;
2358 }
2359 }
2360 }
2361
2362done:
2363 if (hDeviceClassKey != NULL)
2364 RegCloseKey(hDeviceClassKey);
2365
2366 return ret;
2367}
DWORD WINAPI PNP_GetDeviceRegProp(handle_t hBinding, LPWSTR pDeviceID, DWORD ulProperty, DWORD *pulRegDataType, BYTE *Buffer, PNP_PROP_SIZE *pulTransferLen, PNP_PROP_SIZE *pulLength, DWORD ulFlags)
Definition: rpcserver.c:1838
DWORD WINAPI PNP_SetDeviceRegProp(handle_t hBinding, LPWSTR pDeviceId, DWORD ulProperty, DWORD ulDataType, BYTE *Buffer, PNP_PROP_SIZE ulLength, DWORD ulFlags)
Definition: rpcserver.c:2115
#define CM_DRP_DRIVER
Definition: cfgmgr32.h:685
#define CM_DRP_CLASSGUID
Definition: cfgmgr32.h:684
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define REG_SZ
Definition: layer.c:22
#define REG_CREATED_NEW_KEY
Definition: nt_native.h:1084
uint32_t ULONG
Definition: typedefs.h:59
unsigned char BYTE
Definition: xxhash.c:193

Referenced by GetDeviceInstanceKeyPath().

◆ PNP_GetClassName()

DWORD WINAPI PNP_GetClassName ( handle_t  hBinding,
LPWSTR  pszClassGuid,
LPWSTR  Buffer,
PNP_RPC_STRING_LEN pulLength,
DWORD  ulFlags 
)

Definition at line 2497 of file rpcserver.c.

2503{
2504 WCHAR szKeyName[MAX_PATH];
2506 HKEY hKey;
2507 DWORD dwSize;
2508
2510 UNREFERENCED_PARAMETER(ulFlags);
2511
2512 DPRINT("PNP_GetClassName(%p %S %p %p 0x%08lx)\n",
2513 hBinding, pszClassGuid, Buffer, pulLength, ulFlags);
2514
2515 lstrcpyW(szKeyName, L"System\\CurrentControlSet\\Control\\Class\\");
2516 if (lstrlenW(pszClassGuid) + 1 < sizeof(szKeyName)/sizeof(WCHAR)-(lstrlenW(szKeyName) * sizeof(WCHAR)))
2517 lstrcatW(szKeyName, pszClassGuid);
2518 else
2519 return CR_INVALID_DATA;
2520
2522 szKeyName,
2523 0,
2525 &hKey))
2526 return CR_REGISTRY_ERROR;
2527
2528 dwSize = *pulLength * sizeof(WCHAR);
2530 L"Class",
2531 NULL,
2532 NULL,
2533 (LPBYTE)Buffer,
2534 &dwSize))
2535 {
2536 *pulLength = 0;
2538 }
2539 else
2540 {
2541 *pulLength = dwSize / sizeof(WCHAR);
2542 }
2543
2545
2546 DPRINT("PNP_GetClassName() done (returns %lx)\n", ret);
2547
2548 return ret;
2549}
#define lstrcpyW
Definition: compat.h:749
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274

Referenced by CM_Get_Class_Name_ExW().

◆ PNP_GetClassRegProp()

DWORD WINAPI PNP_GetClassRegProp ( handle_t  hBinding,
LPWSTR  pszClassGuid,
DWORD  ulProperty,
DWORD pulRegDataType,
BYTE Buffer,
PNP_RPC_STRING_LEN pulTransferLen,
PNP_RPC_STRING_LEN pulLength,
DWORD  ulFlags 
)

Definition at line 2730 of file rpcserver.c.

2739{
2741 LPWSTR lpValueName = NULL;
2742 HKEY hInstKey = NULL;
2743 HKEY hPropKey = NULL;
2744 LONG lError;
2745
2747
2748 DPRINT("PNP_GetClassRegProp(%p %S %lu %p %p %p %p 0x%08lx)\n",
2749 hBinding, pszClassGuid, ulProperty, pulRegDataType,
2750 Buffer, pulTransferLen, pulLength, ulFlags);
2751
2752 if (pulTransferLen == NULL || pulLength == NULL)
2753 {
2755 goto done;
2756 }
2757
2758 if (ulFlags != 0)
2759 {
2761 goto done;
2762 }
2763
2764 if (*pulLength < *pulTransferLen)
2765 *pulLength = *pulTransferLen;
2766
2767 *pulTransferLen = 0;
2768
2769 switch (ulProperty)
2770 {
2771 case CM_CRP_SECURITY:
2772 lpValueName = L"Security";
2773 break;
2774
2775 case CM_CRP_DEVTYPE:
2776 lpValueName = L"DeviceType";
2777 break;
2778
2779 case CM_CRP_EXCLUSIVE:
2780 lpValueName = L"Exclusive";
2781 break;
2782
2784 lpValueName = L"DeviceCharacteristics";
2785 break;
2786
2787 default:
2789 goto done;
2790 }
2791
2792 DPRINT("Value name: %S\n", lpValueName);
2793
2794 lError = RegOpenKeyExW(hClassKey,
2795 pszClassGuid,
2796 0,
2797 KEY_READ,
2798 &hInstKey);
2799 if (lError != ERROR_SUCCESS)
2800 {
2801 *pulLength = 0;
2803 goto done;
2804 }
2805
2806 lError = RegOpenKeyExW(hInstKey,
2807 L"Properties",
2808 0,
2809 KEY_READ,
2810 &hPropKey);
2811 if (lError != ERROR_SUCCESS)
2812 {
2813 *pulLength = 0;
2815 goto done;
2816 }
2817
2818 lError = RegQueryValueExW(hPropKey,
2819 lpValueName,
2820 NULL,
2821 pulRegDataType,
2822 Buffer,
2823 pulLength);
2824 if (lError != ERROR_SUCCESS)
2825 {
2826 if (lError == ERROR_MORE_DATA)
2827 {
2829 }
2830 else
2831 {
2832 *pulLength = 0;
2834 }
2835 }
2836
2837done:
2838 if (ret == CR_SUCCESS)
2839 *pulTransferLen = *pulLength;
2840
2841 if (hPropKey != NULL)
2842 RegCloseKey(hPropKey);
2843
2844 if (hInstKey != NULL)
2845 RegCloseKey(hInstKey);
2846
2847 DPRINT("PNP_GetClassRegProp() done (returns %lx)\n", ret);
2848
2849 return ret;
2850}
#define CR_INVALID_PROPERTY
Definition: cfgmgr32.h:899
#define CM_CRP_DEVTYPE
Definition: cfgmgr32.h:710
#define CM_CRP_SECURITY
Definition: cfgmgr32.h:706
#define CM_CRP_EXCLUSIVE
Definition: cfgmgr32.h:712
#define CM_CRP_CHARACTERISTICS
Definition: cfgmgr32.h:714
#define CR_NO_SUCH_REGISTRY_KEY
Definition: cfgmgr32.h:892
#define ERROR_MORE_DATA
Definition: dderror.h:13

Referenced by CM_Get_Class_Registry_PropertyW().

◆ PNP_GetCustomDevProp()

DWORD WINAPI PNP_GetCustomDevProp ( handle_t  hBinding,
LPWSTR  pDeviceID,
LPWSTR  CustomPropName,
DWORD pulRegDataType,
BYTE Buffer,
PNP_RPC_STRING_LEN pulTransferLen,
PNP_RPC_STRING_LEN pulLength,
DWORD  ulFlags 
)

Definition at line 4827 of file rpcserver.c.

4836{
4837 HKEY hDeviceKey = NULL;
4838 HKEY hParamKey = NULL;
4839 LONG lError;
4841
4843
4844 DPRINT("PNP_GetCustomDevProp() called\n");
4845
4846 if (pulTransferLen == NULL || pulLength == NULL)
4847 {
4849 goto done;
4850 }
4851
4852 if (ulFlags & ~CM_CUSTOMDEVPROP_BITS)
4853 {
4855 goto done;
4856 }
4857
4858 if (!IsValidDeviceInstanceID(pDeviceID))
4859 return CR_INVALID_DEVINST;
4860
4861 if (*pulLength < *pulTransferLen)
4862 *pulLength = *pulTransferLen;
4863
4864 *pulTransferLen = 0;
4865
4866 lError = RegOpenKeyExW(hEnumKey,
4867 pDeviceID,
4868 0,
4869 KEY_READ,
4870 &hDeviceKey);
4871 if (lError != ERROR_SUCCESS)
4872 {
4874 goto done;
4875 }
4876
4877 lError = RegOpenKeyExW(hDeviceKey,
4878 L"Device Parameters",
4879 0,
4880 KEY_READ,
4881 &hParamKey);
4882 if (lError != ERROR_SUCCESS)
4883 {
4885 goto done;
4886 }
4887
4888 lError = RegQueryValueExW(hParamKey,
4889 CustomPropName,
4890 NULL,
4891 pulRegDataType,
4892 Buffer,
4893 pulLength);
4894 if (lError != ERROR_SUCCESS)
4895 {
4896 if (lError == ERROR_MORE_DATA)
4897 {
4899 }
4900 else
4901 {
4902 *pulLength = 0;
4904 }
4905 }
4906
4907done:
4908 if (ret == CR_SUCCESS)
4909 *pulTransferLen = *pulLength;
4910
4911 if (hParamKey != NULL)
4912 RegCloseKey(hParamKey);
4913
4914 if (hDeviceKey != NULL)
4915 RegCloseKey(hDeviceKey);
4916
4917 DPRINT("PNP_GetCustomDevProp() done (returns %lx)\n", ret);
4918
4919 return ret;
4920}
#define CM_CUSTOMDEVPROP_BITS
Definition: cfgmgr32.h:836

Referenced by CM_Get_DevNode_Custom_Property_ExW().

◆ PNP_GetDepth()

DWORD WINAPI PNP_GetDepth ( handle_t  hBinding,
LPWSTR  pszDeviceID,
DWORD pulDepth,
DWORD  ulFlags 
)

Definition at line 1795 of file rpcserver.c.

1800{
1801 PLUGPLAY_CONTROL_DEPTH_DATA PlugPlayData;
1804
1806 UNREFERENCED_PARAMETER(ulFlags);
1807
1808 DPRINT("PNP_GetDepth(%p %S %p 0x%08lx)\n",
1809 hBinding, pszDeviceID, pulDepth, ulFlags);
1810
1811 if (!IsValidDeviceInstanceID(pszDeviceID))
1812 return CR_INVALID_DEVINST;
1813
1815 pszDeviceID);
1816
1818 (PVOID)&PlugPlayData,
1820 if (NT_SUCCESS(Status))
1821 {
1822 *pulDepth = PlugPlayData.Depth;
1823 }
1824 else
1825 {
1827 }
1828
1829 DPRINT("PNP_GetDepth() done (returns %lx)\n", ret);
1830
1831 return ret;
1832}
@ PlugPlayControlGetDeviceDepth
Definition: cmtypes.h:224
UNICODE_STRING DeviceInstance
Definition: cmtypes.h:534

Referenced by CM_Get_Depth_Ex().

◆ PNP_GetDeviceList()

DWORD WINAPI PNP_GetDeviceList ( handle_t  hBinding,
LPWSTR  pszFilter,
LPWSTR  Buffer,
PNP_RPC_STRING_LEN pulLength,
DWORD  ulFlags 
)

Definition at line 1349 of file rpcserver.c.

1355{
1356 WCHAR szEnumerator[MAX_DEVICE_ID_LEN];
1357 WCHAR szDevice[MAX_DEVICE_ID_LEN];
1358 WCHAR szInstance[MAX_DEVICE_ID_LEN];
1360
1361 DPRINT("PNP_GetDeviceList(%p %S %p %p 0x%08lx)\n",
1362 hBinding, pszFilter, Buffer, pulLength, ulFlags);
1363
1364 if (ulFlags & ~CM_GETIDLIST_FILTER_BITS)
1365 return CR_INVALID_FLAG;
1366
1367 if (pulLength == NULL)
1368 return CR_INVALID_POINTER;
1369
1370 if ((ulFlags != CM_GETIDLIST_FILTER_NONE) &&
1371 (pszFilter == NULL))
1372 return CR_INVALID_POINTER;
1373
1374 if (ulFlags &
1379 {
1380 ret = GetRelationsInstanceList(pszFilter,
1381 ulFlags,
1382 Buffer,
1383 pulLength);
1384 }
1385 else if (ulFlags & CM_GETIDLIST_FILTER_SERVICE)
1386 {
1387 ret = GetServiceInstanceList(pszFilter,
1388 Buffer,
1389 pulLength);
1390 }
1391 else if (ulFlags & CM_GETIDLIST_FILTER_ENUMERATOR)
1392 {
1393 SplitDeviceInstanceID(pszFilter,
1394 szEnumerator,
1395 szDevice,
1396 szInstance);
1397
1398 if (*szEnumerator != UNICODE_NULL && *szDevice != UNICODE_NULL)
1399 {
1400 ret = GetDeviceInstanceList(pszFilter,
1401 Buffer,
1402 pulLength);
1403 }
1404 else
1405 {
1406 ret = GetEnumeratorInstanceList(pszFilter,
1407 Buffer,
1408 pulLength);
1409 }
1410 }
1411 else /* CM_GETIDLIST_FILTER_NONE */
1412 {
1414 pulLength);
1415 }
1416
1417 return ret;
1418}
static CONFIGRET GetRelationsInstanceList(_In_ PWSTR pszDevice, _In_ DWORD ulFlags, _Inout_ PWSTR pszBuffer, _Inout_ PDWORD pulLength)
Definition: rpcserver.c:988
static CONFIGRET GetAllInstanceList(_Inout_ PWSTR pszBuffer, _Inout_ PDWORD pulLength)
Definition: rpcserver.c:1300
static CONFIGRET GetServiceInstanceList(_In_ PWSTR pszService, _Inout_ PWSTR pszBuffer, _Inout_ PDWORD pulLength)
Definition: rpcserver.c:1039
#define CM_GETIDLIST_FILTER_BITS
Definition: cfgmgr32.h:669
#define CM_GETIDLIST_FILTER_ENUMERATOR
Definition: cfgmgr32.h:655
#define CM_GETIDLIST_FILTER_SERVICE
Definition: cfgmgr32.h:656
#define CM_GETIDLIST_FILTER_NONE
Definition: cfgmgr32.h:654

Referenced by CM_Get_Device_ID_List_ExW(), and DeviceInstallThread().

◆ PNP_GetDeviceListSize()

DWORD WINAPI PNP_GetDeviceListSize ( handle_t  hBinding,
LPWSTR  pszFilter,
PNP_RPC_BUFFER_SIZE pulLength,
DWORD  ulFlags 
)

Definition at line 1720 of file rpcserver.c.

1725{
1726 WCHAR szEnumerator[MAX_DEVICE_ID_LEN];
1727 WCHAR szDevice[MAX_DEVICE_ID_LEN];
1728 WCHAR szInstance[MAX_DEVICE_ID_LEN];
1730
1731 DPRINT("PNP_GetDeviceListSize(%p %S %p 0x%08lx)\n",
1732 hBinding, pszFilter, pulLength, ulFlags);
1733
1734 if (ulFlags & ~CM_GETIDLIST_FILTER_BITS)
1735 return CR_INVALID_FLAG;
1736
1737 if (pulLength == NULL)
1738 return CR_INVALID_POINTER;
1739
1740 if ((ulFlags != CM_GETIDLIST_FILTER_NONE) &&
1741 (pszFilter == NULL))
1742 return CR_INVALID_POINTER;
1743
1744 *pulLength = 0;
1745
1746 if (ulFlags &
1751 {
1753 ulFlags,
1754 pulLength);
1755 }
1756 else if (ulFlags & CM_GETIDLIST_FILTER_SERVICE)
1757 {
1758 ret = GetServiceInstanceListSize(pszFilter,
1759 pulLength);
1760 }
1761 else if (ulFlags & CM_GETIDLIST_FILTER_ENUMERATOR)
1762 {
1763 SplitDeviceInstanceID(pszFilter,
1764 szEnumerator,
1765 szDevice,
1766 szInstance);
1767
1768 if (*szEnumerator != UNICODE_NULL && *szDevice != UNICODE_NULL)
1769 {
1770 ret = GetDeviceInstanceListSize(pszFilter,
1771 pulLength);
1772 }
1773 else
1774 {
1776 pulLength);
1777 }
1778 }
1779 else /* CM_GETIDLIST_FILTER_NONE */
1780 {
1781 ret = GetAllInstanceListSize(pulLength);
1782 }
1783
1784 /* Add one character for the terminating double UNICODE_NULL */
1785 if (ret == CR_SUCCESS)
1786 (*pulLength) += 1;
1787
1788 return ret;
1789}
static CONFIGRET GetServiceInstanceListSize(_In_ PWSTR pszService, _Out_ PDWORD pulLength)
Definition: rpcserver.c:1473
static CONFIGRET GetAllInstanceListSize(_Out_ PULONG pulLength)
Definition: rpcserver.c:1685
static CONFIGRET GetRelationsInstanceListSize(_In_ PWSTR pszDevice, _In_ DWORD ulFlags, _Inout_ PDWORD pulLength)
Definition: rpcserver.c:1423

Referenced by CM_Get_Device_ID_List_Size_ExW(), and DeviceInstallThread().

◆ PNP_GetDeviceRegProp()

DWORD WINAPI PNP_GetDeviceRegProp ( handle_t  hBinding,
LPWSTR  pDeviceID,
DWORD  ulProperty,
DWORD pulRegDataType,
BYTE Buffer,
PNP_PROP_SIZE pulTransferLen,
PNP_PROP_SIZE pulLength,
DWORD  ulFlags 
)

Definition at line 1838 of file rpcserver.c.

1847{
1848 PLUGPLAY_CONTROL_PROPERTY_DATA PlugPlayData;
1850 LPWSTR lpValueName = NULL;
1851 HKEY hKey = NULL;
1852 LONG lError;
1854
1856
1857 DPRINT("PNP_GetDeviceRegProp(%p %S %lu %p %p %p %p 0x%08lx)\n",
1858 hBinding, pDeviceID, ulProperty, pulRegDataType, Buffer,
1859 pulTransferLen, pulLength, ulFlags);
1860
1861 if (pulTransferLen == NULL || pulLength == NULL)
1862 {
1864 goto done;
1865 }
1866
1867 if (ulFlags != 0)
1868 {
1870 goto done;
1871 }
1872
1873 /* Check pDeviceID */
1874 if (!IsValidDeviceInstanceID(pDeviceID))
1875 {
1877 goto done;
1878 }
1879
1880 if (*pulLength < *pulTransferLen)
1881 *pulLength = *pulTransferLen;
1882
1883 *pulTransferLen = 0;
1884
1885 switch (ulProperty)
1886 {
1887 case CM_DRP_DEVICEDESC:
1888 lpValueName = L"DeviceDesc";
1889 break;
1890
1891 case CM_DRP_HARDWAREID:
1892 lpValueName = L"HardwareID";
1893 break;
1894
1896 lpValueName = L"CompatibleIDs";
1897 break;
1898
1899 case CM_DRP_SERVICE:
1900 lpValueName = L"Service";
1901 break;
1902
1903 case CM_DRP_CLASS:
1904 lpValueName = L"Class";
1905 break;
1906
1907 case CM_DRP_CLASSGUID:
1908 lpValueName = L"ClassGUID";
1909 break;
1910
1911 case CM_DRP_DRIVER:
1912 lpValueName = L"Driver";
1913 break;
1914
1915 case CM_DRP_CONFIGFLAGS:
1916 lpValueName = L"ConfigFlags";
1917 break;
1918
1919 case CM_DRP_MFG:
1920 lpValueName = L"Mfg";
1921 break;
1922
1924 lpValueName = L"FriendlyName";
1925 break;
1926
1928 lpValueName = L"LocationInformation";
1929 break;
1930
1933 *pulRegDataType = REG_SZ;
1934 break;
1935
1937 lpValueName = L"Capabilities";
1938 break;
1939
1940 case CM_DRP_UI_NUMBER:
1941 PlugPlayData.Property = PNP_PROPERTY_UI_NUMBER;
1942 break;
1943
1945 lpValueName = L"UpperFilters";
1946 break;
1947
1949 lpValueName = L"LowerFilters";
1950 break;
1951
1952 case CM_DRP_BUSTYPEGUID:
1953 PlugPlayData.Property = PNP_PROPERTY_BUSTYPEGUID;
1954 *pulRegDataType = REG_BINARY;
1955 break;
1956
1958 PlugPlayData.Property = PNP_PROPERTY_LEGACYBUSTYPE;
1959 *pulRegDataType = REG_DWORD;
1960 break;
1961
1962 case CM_DRP_BUSNUMBER:
1963 PlugPlayData.Property = PNP_PROPERTY_BUSNUMBER;
1964 *pulRegDataType = REG_DWORD;
1965 break;
1966
1969 *pulRegDataType = REG_SZ;
1970 break;
1971
1972 case CM_DRP_SECURITY:
1973 lpValueName = L"Security";
1974 break;
1975
1976 case CM_DRP_DEVTYPE:
1977 lpValueName = L"DeviceType";
1978 break;
1979
1980 case CM_DRP_EXCLUSIVE:
1981 lpValueName = L"Exclusive";
1982 break;
1983
1985 lpValueName = L"DeviceCharacteristics";
1986 break;
1987
1988 case CM_DRP_ADDRESS:
1989 PlugPlayData.Property = PNP_PROPERTY_ADDRESS;
1990 *pulRegDataType = REG_DWORD;
1991 break;
1992
1994 lpValueName = L"UINumberDescFormat";
1995 break;
1996
1998 PlugPlayData.Property = PNP_PROPERTY_POWER_DATA;
1999 *pulRegDataType = REG_BINARY;
2000 break;
2001
2004 *pulRegDataType = REG_DWORD;
2005 break;
2006
2009 *pulRegDataType = REG_DWORD;
2010 break;
2011
2013 lpValueName = L"RemovalPolicy";
2014 *pulRegDataType = REG_DWORD;
2015 break;
2016
2018 PlugPlayData.Property = PNP_PROPERTY_INSTALL_STATE;
2019 *pulRegDataType = REG_DWORD;
2020 break;
2021
2022#if (WINVER >= _WIN32_WINNT_WS03)
2025 *pulRegDataType = REG_MULTI_SZ;
2026 break;
2027#endif
2028
2029#if (WINVER >= _WIN32_WINNT_WIN7)
2031 PlugPlayData.Property = PNP_PROPERTY_CONTAINERID;
2032 *pulRegDataType = REG_SZ;
2033 break;
2034#endif
2035
2036 default:
2038 goto done;
2039 }
2040
2041 DPRINT("Value name: %S\n", lpValueName);
2042
2043 if (lpValueName)
2044 {
2045 /* Retrieve information from the Registry */
2046 lError = RegOpenKeyExW(hEnumKey,
2047 pDeviceID,
2048 0,
2050 &hKey);
2051 if (lError != ERROR_SUCCESS)
2052 {
2053 hKey = NULL;
2054 *pulLength = 0;
2056 goto done;
2057 }
2058
2059 lError = RegQueryValueExW(hKey,
2060 lpValueName,
2061 NULL,
2062 pulRegDataType,
2063 Buffer,
2064 pulLength);
2065 if (lError != ERROR_SUCCESS)
2066 {
2067 if (lError == ERROR_MORE_DATA)
2068 {
2070 }
2071 else
2072 {
2073 *pulLength = 0;
2075 }
2076 }
2077 }
2078 else
2079 {
2080 /* Retrieve information from the Device Node */
2082 pDeviceID);
2083 PlugPlayData.Buffer = Buffer;
2084 PlugPlayData.BufferSize = *pulLength;
2085
2087 (PVOID)&PlugPlayData,
2089 if (NT_SUCCESS(Status))
2090 {
2091 *pulLength = PlugPlayData.BufferSize;
2092 }
2093 else
2094 {
2096 }
2097 }
2098
2099done:
2100 if (pulTransferLen)
2101 *pulTransferLen = (ret == CR_SUCCESS) ? *pulLength : 0;
2102
2103 if (hKey != NULL)
2105
2106 DPRINT("PNP_GetDeviceRegProp() done (returns %lx)\n", ret);
2107
2108 return ret;
2109}
#define CM_DRP_BUSNUMBER
Definition: cfgmgr32.h:703
#define CM_DRP_LOCATION_INFORMATION
Definition: cfgmgr32.h:689
#define CM_DRP_CONFIGFLAGS
Definition: cfgmgr32.h:686
#define CM_DRP_REMOVAL_POLICY
Definition: cfgmgr32.h:719
#define CM_DRP_ENUMERATOR_NAME
Definition: cfgmgr32.h:704
#define CM_DRP_REMOVAL_POLICY_HW_DEFAULT
Definition: cfgmgr32.h:720
#define CM_DRP_BUSTYPEGUID
Definition: cfgmgr32.h:701
#define CM_DRP_LOWERFILTERS
Definition: cfgmgr32.h:697
#define CM_DRP_SECURITY
Definition: cfgmgr32.h:705
#define CM_DRP_MFG
Definition: cfgmgr32.h:687
#define CM_DRP_EXCLUSIVE
Definition: cfgmgr32.h:711
#define CM_DRP_LOCATION_PATHS
Definition: cfgmgr32.h:725
#define CM_DRP_REMOVAL_POLICY_OVERRIDE
Definition: cfgmgr32.h:721
#define CM_DRP_CAPABILITIES
Definition: cfgmgr32.h:691
#define CM_DRP_UPPERFILTERS
Definition: cfgmgr32.h:693
#define CM_DRP_COMPATIBLEIDS
Definition: cfgmgr32.h:678
#define CM_DRP_DEVICEDESC
Definition: cfgmgr32.h:676
#define CM_DRP_CLASS
Definition: cfgmgr32.h:683
#define CM_DRP_LEGACYBUSTYPE
Definition: cfgmgr32.h:702
#define CM_DRP_PHYSICAL_DEVICE_OBJECT_NAME
Definition: cfgmgr32.h:690
#define CM_DRP_DEVTYPE
Definition: cfgmgr32.h:709
#define CM_DRP_FRIENDLYNAME
Definition: cfgmgr32.h:688
#define CM_DRP_INSTALL_STATE
Definition: cfgmgr32.h:722
#define CM_DRP_UI_NUMBER
Definition: cfgmgr32.h:692
#define CM_DRP_CHARACTERISTICS
Definition: cfgmgr32.h:713
#define CM_DRP_BASE_CONTAINERID
Definition: cfgmgr32.h:728
#define CM_DRP_UI_NUMBER_DESC_FORMAT
Definition: cfgmgr32.h:716
#define CM_DRP_ADDRESS
Definition: cfgmgr32.h:715
#define CM_DRP_DEVICE_POWER_DATA
Definition: cfgmgr32.h:718
#define CM_DRP_HARDWAREID
Definition: cfgmgr32.h:677
#define CM_DRP_SERVICE
Definition: cfgmgr32.h:680
#define PNP_PROPERTY_UI_NUMBER
Definition: cmtypes.h:34
#define PNP_PROPERTY_REMOVAL_POLICY
Definition: cmtypes.h:40
#define PNP_PROPERTY_POWER_DATA
Definition: cmtypes.h:39
#define PNP_PROPERTY_ENUMERATOR_NAME
Definition: cmtypes.h:43
#define PNP_PROPERTY_PHYSICAL_DEVICE_OBJECT_NAME
Definition: cmtypes.h:35
@ PlugPlayControlProperty
Definition: cmtypes.h:219
#define PNP_PROPERTY_INSTALL_STATE
Definition: cmtypes.h:45
#define PNP_PROPERTY_LOCATION_PATHS
Definition: cmtypes.h:46
#define PNP_PROPERTY_REMOVAL_POLICY_HARDWARE_DEFAULT
Definition: cmtypes.h:44
#define PNP_PROPERTY_LEGACYBUSTYPE
Definition: cmtypes.h:37
#define PNP_PROPERTY_BUSTYPEGUID
Definition: cmtypes.h:36
#define PNP_PROPERTY_ADDRESS
Definition: cmtypes.h:42
#define PNP_PROPERTY_BUSNUMBER
Definition: cmtypes.h:38
#define PNP_PROPERTY_CONTAINERID
Definition: cmtypes.h:47
#define REG_BINARY
Definition: nt_native.h:1496
UNICODE_STRING DeviceInstance
Definition: cmtypes.h:507

Referenced by CM_Get_DevNode_Registry_Property_ExW(), GetDeviceInstanceKeyPath(), PNP_GetClassInstance(), and PNP_GetDeviceStatus().

◆ PNP_GetDeviceStatus()

DWORD WINAPI PNP_GetDeviceStatus ( handle_t  hBinding,
LPWSTR  pDeviceID,
DWORD pulStatus,
DWORD pulProblem,
DWORD  ulFlags 
)

Definition at line 3414 of file rpcserver.c.

3420{
3421 DWORD ulDataType, ulTransferLength, ulLength;
3422 DWORD ulCapabilities, ulConfigFlags;
3423 CONFIGRET ret;
3424
3426 UNREFERENCED_PARAMETER(ulFlags);
3427
3428 DPRINT("PNP_GetDeviceStatus(%p %S %p %p 0x%08lx)\n",
3429 hBinding, pDeviceID, pulStatus, pulProblem, ulFlags);
3430
3431 if (ulFlags != 0)
3432 return CR_INVALID_FLAG;
3433
3434 if ((pulStatus == NULL) || (pulProblem == NULL))
3435 return CR_INVALID_POINTER;
3436
3437 if (!IsValidDeviceInstanceID(pDeviceID))
3438 return CR_INVALID_DEVINST;
3439
3440 ret = GetDeviceStatus(pDeviceID, pulStatus, pulProblem);
3441 if (ret != CR_SUCCESS)
3442 return ret;
3443
3444 /* Check for DN_REMOVABLE */
3445 ulTransferLength = sizeof(ulCapabilities);
3446 ulLength = sizeof(ulCapabilities);
3448 pDeviceID,
3450 &ulDataType,
3451 (PBYTE)&ulCapabilities,
3452 &ulTransferLength,
3453 &ulLength,
3454 0);
3455 if (ret != CR_SUCCESS)
3456 ulCapabilities = 0;
3457
3458 if (ulCapabilities & CM_DEVCAP_REMOVABLE)
3459 *pulStatus |= DN_REMOVABLE;
3460
3461 /* Check for DN_MANUAL */
3462 ulTransferLength = sizeof(ulConfigFlags);
3463 ulLength = sizeof(ulConfigFlags);
3465 pDeviceID,
3467 &ulDataType,
3468 (PBYTE)&ulConfigFlags,
3469 &ulTransferLength,
3470 &ulLength,
3471 0);
3472 if (ret != CR_SUCCESS)
3473 ulConfigFlags = 0;
3474
3475 if (ulConfigFlags & CONFIGFLAG_MANUAL_INSTALL)
3476 *pulStatus |= DN_MANUAL;
3477
3478 /* Check for failed install */
3479 if (((*pulStatus & DN_HAS_PROBLEM) == 0) && (ulConfigFlags & CONFIGFLAG_FAILEDINSTALL))
3480 {
3481 *pulStatus |= DN_HAS_PROBLEM;
3482 *pulProblem = CM_PROB_FAILED_INSTALL;
3483 }
3484
3485 return CR_SUCCESS;
3486}
#define DN_REMOVABLE
Definition: cfg.h:132
#define DN_HAS_PROBLEM
Definition: cfg.h:128
#define DN_MANUAL
Definition: cfg.h:122
#define CM_PROB_FAILED_INSTALL
Definition: cfg.h:58
#define CM_DEVCAP_REMOVABLE
Definition: cfgmgr32.h:737
#define CONFIGFLAG_MANUAL_INSTALL
Definition: regstr.h:392
#define CONFIGFLAG_FAILEDINSTALL
Definition: regstr.h:396

Referenced by CM_Get_DevNode_Status_Ex().

◆ PNP_GetFirstLogConf()

DWORD WINAPI PNP_GetFirstLogConf ( handle_t  hBinding,
LPWSTR  pDeviceID,
DWORD  ulLogConfType,
DWORD pulLogConfTag,
DWORD  ulFlags 
)

Definition at line 4194 of file rpcserver.c.

4200{
4201 HKEY hConfigKey = NULL;
4202 DWORD RegDataType = 0;
4203 ULONG ulDataSize = 0;
4204 LPBYTE lpData = NULL;
4206
4207 DPRINT("PNP_GetFirstLogConf(%p %S %lu %p 0x%08lx)\n",
4208 hBinding, pDeviceID, ulLogConfType, pulLogConfTag, ulFlags);
4209
4210 if (pulLogConfTag == NULL)
4211 return CR_INVALID_POINTER;
4212
4213 *pulLogConfTag = (DWORD)0;
4214
4215 if (ulFlags & ~LOG_CONF_BITS)
4216 return CR_INVALID_FLAG;
4217
4218 if (!IsValidDeviceInstanceID(pDeviceID))
4219 return CR_INVALID_DEVINST;
4220
4221 ret = OpenConfigurationKey(pDeviceID,
4222 ulLogConfType,
4223 &hConfigKey);
4224 if (ret != CR_SUCCESS)
4225 {
4226 DPRINT1("OpenConfigurationKey() failed (Error %lu)\n", ret);
4228 goto done;
4229 }
4230
4231 ret = GetConfigurationData(hConfigKey,
4232 ulLogConfType,
4233 &RegDataType,
4234 &ulDataSize,
4235 &lpData);
4236 if (ret != CR_SUCCESS)
4237 {
4238 DPRINT1("GetConfigurationData() failed (Error %lu)\n", ret);
4240 goto done;
4241 }
4242
4243 DPRINT1("Data size %lu\n", ulDataSize);
4244 if (ulDataSize == 0 || lpData == NULL)
4245 {
4246 DPRINT1("No config data available!\n");
4248 goto done;
4249 }
4250
4251 /* Get the first tag */
4252 if (RegDataType == REG_RESOURCE_LIST)
4253 {
4254 DPRINT("REG_RESOURCE_LIST->Count %lu\n", ((PCM_RESOURCE_LIST)lpData)->Count);
4255
4256 /* Fail, if we do not have any resource */
4257 if (((PCM_RESOURCE_LIST)lpData)->Count == 0)
4258 {
4259 DPRINT1("No resource descriptors!\n");
4261 goto done;
4262 }
4263 }
4264 else if (RegDataType == REG_RESOURCE_REQUIREMENTS_LIST)
4265 {
4266 DPRINT("REG_RESOURCE_REQUIREMENTS_LIST->AlternativeLists %lu\n",
4267 ((PIO_RESOURCE_REQUIREMENTS_LIST)lpData)->AlternativeLists);
4268
4269 /* Fail, if we do not have any requirements */
4270 if (((PIO_RESOURCE_REQUIREMENTS_LIST)lpData)->AlternativeLists == 0)
4271 {
4273 goto done;
4274 }
4275 }
4276
4277done:
4278 if (lpData != NULL)
4279 HeapFree(GetProcessHeap(), 0, lpData);
4280
4281 if (hConfigKey != NULL)
4282 RegCloseKey(hConfigKey);
4283
4284 DPRINT("PNP_GetFirstLogConf() returns %lu\n", ret);
4285
4286 return ret;
4287}
static CONFIGRET GetConfigurationData(_In_ HKEY hKey, _In_ ULONG ulLogConfType, _Out_ PULONG pulRegDataType, _Out_ PULONG pulDataSize, _Out_ LPBYTE *ppBuffer)
Definition: rpcserver.c:492
static CONFIGRET OpenConfigurationKey(_In_ LPCWSTR pszDeviceID, _In_ DWORD ulLogConfType, _Out_ PHKEY phKey)
Definition: rpcserver.c:429
#define CR_NO_MORE_LOG_CONF
Definition: cfgmgr32.h:859
#define LOG_CONF_BITS
Definition: cfgmgr32.h:603
int Count
Definition: noreturn.cpp:7

Referenced by CM_Get_First_Log_Conf_Ex().

◆ PNP_GetGlobalState()

DWORD WINAPI PNP_GetGlobalState ( handle_t  hBinding,
DWORD pulState,
DWORD  ulFlags 
)

Definition at line 675 of file rpcserver.c.

679{
681
682 DPRINT("PNP_GetGlobalState(%p %p 0x%08lx)\n",
683 hBinding, pulState, ulFlags);
684
685 if (ulFlags != 0)
686 return CR_INVALID_FLAG;
687
689
690 if (g_ShuttingDown)
692
693 return CR_SUCCESS;
694}
BOOL g_ShuttingDown
Definition: umpnpmgr.c:47
#define CM_GLOBAL_STATE_SERVICES_AVAILABLE
Definition: cfgmgr32.h:910
#define CM_GLOBAL_STATE_CAN_DO_UI
Definition: cfgmgr32.h:908
#define CM_GLOBAL_STATE_SHUTTING_DOWN
Definition: cfgmgr32.h:911

Referenced by CM_Get_Global_State_Ex().

◆ PNP_GetHwProfInfo()

DWORD WINAPI PNP_GetHwProfInfo ( handle_t  hBinding,
DWORD  ulIndex,
HWPROFILEINFO pHWProfileInfo,
DWORD  ulProfileInfoSize,
DWORD  ulFlags 
)

Definition at line 4029 of file rpcserver.c.

4035{
4036 WCHAR szProfileName[5];
4037 HKEY hKeyConfig = NULL;
4038 HKEY hKeyProfiles = NULL;
4039 HKEY hKeyProfile = NULL;
4040 DWORD dwDisposition;
4041 DWORD dwSize;
4042 LONG lError;
4044
4046
4047 DPRINT("PNP_GetHwProfInfo() called\n");
4048
4049 if (ulProfileInfoSize == 0)
4050 {
4052 goto done;
4053 }
4054
4055 if (ulFlags != 0)
4056 {
4058 goto done;
4059 }
4060
4061 /* Initialize the profile information */
4062 pHWProfileInfo->HWPI_ulHWProfile = 0;
4063 pHWProfileInfo->HWPI_szFriendlyName[0] = 0;
4064 pHWProfileInfo->HWPI_dwFlags = 0;
4065
4066 /* Open the 'IDConfigDB' key */
4068 L"System\\CurrentControlSet\\Control\\IDConfigDB",
4069 0,
4070 NULL,
4073 NULL,
4074 &hKeyConfig,
4075 &dwDisposition);
4076 if (lError != ERROR_SUCCESS)
4077 {
4079 goto done;
4080 }
4081
4082 /* Open the 'Hardware Profiles' subkey */
4083 lError = RegCreateKeyExW(hKeyConfig,
4084 L"Hardware Profiles",
4085 0,
4086 NULL,
4089 NULL,
4090 &hKeyProfiles,
4091 &dwDisposition);
4092 if (lError != ERROR_SUCCESS)
4093 {
4095 goto done;
4096 }
4097
4098 if (ulIndex == (ULONG)-1)
4099 {
4100 dwSize = sizeof(ULONG);
4101 lError = RegQueryValueExW(hKeyConfig,
4102 L"CurrentConfig",
4103 NULL,
4104 NULL,
4105 (LPBYTE)&pHWProfileInfo->HWPI_ulHWProfile,
4106 &dwSize);
4107 if (lError != ERROR_SUCCESS)
4108 {
4109 pHWProfileInfo->HWPI_ulHWProfile = 0;
4111 goto done;
4112 }
4113 }
4114 else
4115 {
4116 /* FIXME: not implemented yet */
4118 goto done;
4119 }
4120
4121 swprintf(szProfileName, L"%04lu", pHWProfileInfo->HWPI_ulHWProfile);
4122
4123 lError = RegOpenKeyExW(hKeyProfiles,
4124 szProfileName,
4125 0,
4127 &hKeyProfile);
4128 if (lError != ERROR_SUCCESS)
4129 {
4131 goto done;
4132 }
4133
4134 dwSize = sizeof(pHWProfileInfo->HWPI_szFriendlyName);
4135 lError = RegQueryValueExW(hKeyProfile,
4136 L"FriendlyName",
4137 NULL,
4138 NULL,
4139 (LPBYTE)&pHWProfileInfo->HWPI_szFriendlyName,
4140 &dwSize);
4141 if (lError != ERROR_SUCCESS)
4142 {
4144 goto done;
4145 }
4146
4147done:
4148 if (hKeyProfile != NULL)
4149 RegCloseKey(hKeyProfile);
4150
4151 if (hKeyProfiles != NULL)
4152 RegCloseKey(hKeyProfiles);
4153
4154 if (hKeyConfig != NULL)
4155 RegCloseKey(hKeyConfig);
4156
4157 return ret;
4158}
ULONG HWPI_ulHWProfile
Definition: cfgmgr32.h:554
CHAR HWPI_szFriendlyName[MAX_PROFILE_LEN]
Definition: cfgmgr32.h:555
DWORD HWPI_dwFlags
Definition: cfgmgr32.h:556

Referenced by CM_Get_Hardware_Profile_Info_ExW().

◆ PNP_GetInterfaceDeviceAlias()

DWORD WINAPI PNP_GetInterfaceDeviceAlias ( handle_t  hBinding,
LPWSTR  pszInterfaceDevice,
GUID AliasInterfaceGuid,
LPWSTR  pszAliasInterfaceDevice,
PNP_RPC_STRING_LEN pulLength,
PNP_RPC_STRING_LEN pulTransferLen,
DWORD  ulFlags 
)

Definition at line 2587 of file rpcserver.c.

2595{
2598}

Referenced by CM_Get_Device_Interface_Alias_ExW().

◆ PNP_GetInterfaceDeviceList()

DWORD WINAPI PNP_GetInterfaceDeviceList ( handle_t  hBinding,
GUID InterfaceGuid,
LPWSTR  pszDeviceID,
BYTE Buffer,
PNP_RPC_BUFFER_SIZE pulLength,
DWORD  ulFlags 
)

Definition at line 2604 of file rpcserver.c.

2611{
2615
2617
2618 DPRINT("PNP_GetInterfaceDeviceList(%p %p %S %p %p 0x%08lx)\n",
2619 hBinding, InterfaceGuid, pszDeviceID, Buffer, pulLength, ulFlags);
2620
2621 if (!IsValidDeviceInstanceID(pszDeviceID))
2622 return CR_INVALID_DEVINST;
2623
2625 pszDeviceID);
2626
2627 PlugPlayData.Flags = ulFlags;
2628 PlugPlayData.FilterGuid = InterfaceGuid;
2629 PlugPlayData.Buffer = Buffer;
2630 PlugPlayData.BufferSize = *pulLength;
2631
2633 (PVOID)&PlugPlayData,
2635 if (NT_SUCCESS(Status))
2636 {
2637 *pulLength = PlugPlayData.BufferSize;
2638 }
2639 else
2640 {
2642 }
2643
2644 DPRINT("PNP_GetInterfaceDeviceList() done (returns %lx)\n", ret);
2645 return ret;
2646}
@ PlugPlayControlGetInterfaceDeviceList
Definition: cmtypes.h:218
static const GUID InterfaceGuid
Definition: wlanapi.c:25

Referenced by CM_Get_Device_Interface_List_ExW().

◆ PNP_GetInterfaceDeviceListSize()

DWORD WINAPI PNP_GetInterfaceDeviceListSize ( handle_t  hBinding,
PNP_RPC_BUFFER_SIZE pulLen,
GUID InterfaceGuid,
LPWSTR  pszDeviceID,
DWORD  ulFlags 
)

Definition at line 2652 of file rpcserver.c.

2658{
2662
2664
2665 DPRINT("PNP_GetInterfaceDeviceListSize(%p %p %p %S 0x%08lx)\n",
2666 hBinding, pulLen, InterfaceGuid, pszDeviceID, ulFlags);
2667
2668 if (!IsValidDeviceInstanceID(pszDeviceID))
2669 return CR_INVALID_DEVINST;
2670
2672 pszDeviceID);
2673
2674 PlugPlayData.FilterGuid = InterfaceGuid;
2675 PlugPlayData.Buffer = NULL;
2676 PlugPlayData.BufferSize = 0;
2677 PlugPlayData.Flags = ulFlags;
2678
2680 (PVOID)&PlugPlayData,
2682 if (NT_SUCCESS(Status))
2683 {
2684 *pulLen = PlugPlayData.BufferSize;
2685 }
2686 else
2687 {
2689 }
2690
2691 DPRINT("PNP_GetInterfaceDeviceListSize() done (returns %lx)\n", ret);
2692 return ret;
2693}

Referenced by CM_Get_Device_Interface_List_Size_ExW().

◆ PNP_GetLogConfPriority()

DWORD WINAPI PNP_GetLogConfPriority ( handle_t  hBinding,
LPWSTR  pDeviceID,
DWORD  ulType,
DWORD  ulTag,
DWORD pPriority,
DWORD  ulFlags 
)

Definition at line 4410 of file rpcserver.c.

4417{
4420}

Referenced by CM_Get_Log_Conf_Priority_Ex().

◆ PNP_GetNextLogConf()

DWORD WINAPI PNP_GetNextLogConf ( handle_t  hBinding,
LPWSTR  pDeviceID,
DWORD  ulLogConfType,
DWORD  ulCurrentTag,
DWORD pulNextTag,
DWORD  ulFlags 
)

Definition at line 4293 of file rpcserver.c.

4300{
4301 HKEY hConfigKey = NULL;
4302 DWORD RegDataType = 0;
4303 ULONG ulDataSize = 0;
4304 LPBYTE lpData = NULL;
4306
4307 DPRINT("PNP_GetNextLogConf(%p %S %lu %ul %p 0x%08lx)\n",
4308 hBinding, pDeviceID, ulLogConfType, ulCurrentTag, pulNextTag, ulFlags);
4309
4310 if (pulNextTag == NULL)
4311 return CR_INVALID_POINTER;
4312
4313 *pulNextTag = (DWORD)0;
4314
4315 if (ulFlags != 0)
4316 return CR_INVALID_FLAG;
4317
4318 if (!IsValidDeviceInstanceID(pDeviceID))
4319 return CR_INVALID_DEVINST;
4320
4321 ret = OpenConfigurationKey(pDeviceID,
4322 ulLogConfType,
4323 &hConfigKey);
4324 if (ret != CR_SUCCESS)
4325 {
4326 DPRINT1("OpenConfigurationKey() failed (Error %lu)\n", ret);
4328 goto done;
4329 }
4330
4331 ret = GetConfigurationData(hConfigKey,
4332 ulLogConfType,
4333 &RegDataType,
4334 &ulDataSize,
4335 &lpData);
4336 if (ret != CR_SUCCESS)
4337 {
4338 DPRINT1("GetConfigurationData() failed (Error %lu)\n", ret);
4340 goto done;
4341 }
4342
4343 DPRINT("Data size %lu\n", ulDataSize);
4344
4345 if (ulDataSize == 0 || lpData == NULL)
4346 {
4347 DPRINT1("No config data available!\n");
4349 goto done;
4350 }
4351
4352 /* Check if the next entry is available */
4353 if (RegDataType == REG_RESOURCE_LIST)
4354 {
4355 DPRINT("REG_RESOURCE_LIST->Count %lu\n", ((PCM_RESOURCE_LIST)lpData)->Count);
4356
4357 /* Fail, if we are beyond the end of the list */
4358 if (ulCurrentTag >= ((PCM_RESOURCE_LIST)lpData)->Count)
4359 {
4361 goto done;
4362 }
4363
4364 /* Indicate that we reached the end of the list */
4365 if (ulCurrentTag == ((PCM_RESOURCE_LIST)lpData)->Count - 1)
4366 {
4368 goto done;
4369 }
4370 }
4371 else if (RegDataType == REG_RESOURCE_REQUIREMENTS_LIST)
4372 {
4373 DPRINT("REG_RESOURCE_REQUIREMENTS_LIST->AlternativeLists %lu\n",
4374 ((PIO_RESOURCE_REQUIREMENTS_LIST)lpData)->AlternativeLists);
4375
4376 /* Fail, if we are beyond the end of the list */
4377 if (ulCurrentTag >= ((PIO_RESOURCE_REQUIREMENTS_LIST)lpData)->AlternativeLists)
4378 {
4380 goto done;
4381 }
4382
4383 /* Indicate that we reached the end of the list */
4384 if (ulCurrentTag == ((PIO_RESOURCE_REQUIREMENTS_LIST)lpData)->AlternativeLists - 1)
4385 {
4387 goto done;
4388 }
4389 }
4390
4391 /* Return the next tag value */
4392 *pulNextTag = ulCurrentTag + 1;
4393
4394done:
4395 if (lpData != NULL)
4396 HeapFree(GetProcessHeap(), 0, lpData);
4397
4398 if (hConfigKey != NULL)
4399 RegCloseKey(hConfigKey);
4400
4401 DPRINT("PNP_GetNextLogConf() returns %lu\n", ret);
4402
4403 return ret;
4404}

Referenced by CM_Get_Next_Log_Conf_Ex().

◆ PNP_GetNextResDes()

DWORD WINAPI PNP_GetNextResDes ( handle_t  hBinding,
LPWSTR  pDeviceID,
DWORD  ulLogConfTag,
DWORD  ulLogConfType,
RESOURCEID  ResourceID,
DWORD  ulResourceTag,
DWORD pulNextResType,
DWORD pulNextResTag,
DWORD  ulFlags 
)

Definition at line 4464 of file rpcserver.c.

4474{
4475 HKEY hConfigKey = NULL;
4476 DWORD RegDataType = 0;
4477 ULONG ulDataSize = 0;
4478 LPBYTE lpData = NULL;
4480
4481 DPRINT1("PNP_GetNextResDes(%p %S 0x%lx %lu %lu %ul %p %p 0x%08lx)\n",
4482 hBinding, pDeviceID, ulLogConfTag, ulLogConfType, ResourceID,
4483 ulResourceTag, pulNextResType, pulNextResTag, ulFlags);
4484
4485 if (pulNextResType == NULL)
4486 return CR_INVALID_POINTER;
4487
4488 *pulNextResType = 0;
4489
4490 if (ulFlags != 0)
4491 return CR_INVALID_FLAG;
4492
4493 if (!IsValidDeviceInstanceID(pDeviceID))
4494 return CR_INVALID_DEVINST;
4495
4496 ret = OpenConfigurationKey(pDeviceID,
4497 ulLogConfType,
4498 &hConfigKey);
4499 if (ret != CR_SUCCESS)
4500 {
4501 DPRINT1("OpenConfigurationKey() failed (Error %lu)\n", ret);
4503 goto done;
4504 }
4505
4506 ret = GetConfigurationData(hConfigKey,
4507 ulLogConfType,
4508 &RegDataType,
4509 &ulDataSize,
4510 &lpData);
4511 if (ret != CR_SUCCESS)
4512 {
4513 DPRINT1("GetConfigurationData() failed (Error %lu)\n", ret);
4515 goto done;
4516 }
4517
4518 DPRINT1("Data size %lu\n", ulDataSize);
4519
4520 if (ulDataSize == 0 || lpData == NULL)
4521 {
4522 DPRINT1("No config data available!\n");
4524 goto done;
4525 }
4526
4527 /* Get the next resource descriptor */
4528 if (RegDataType == REG_RESOURCE_LIST)
4529 {
4530 DPRINT1("FIXME: REG_RESOURCE_LIST\n");
4531 /* FIXME */
4533 goto done;
4534 }
4535 else if (RegDataType == REG_RESOURCE_REQUIREMENTS_LIST)
4536 {
4537 DPRINT1("FIXME: REG_RESOURCE_REQUIREMENTS_LIST\n");
4538 /* FIXME */
4540 goto done;
4541 }
4542
4543done:
4544 if (lpData != NULL)
4545 HeapFree(GetProcessHeap(), 0, lpData);
4546
4547 if (hConfigKey != NULL)
4548 RegCloseKey(hConfigKey);
4549
4550 DPRINT1("PNP_GetNextResDes() returns %lu\n", ret);
4551
4552 return ret;
4553}

Referenced by CM_Get_Next_Res_Des_Ex().

◆ PNP_GetObjectProp()

DWORD WINAPI PNP_GetObjectProp ( handle_t  hBinding,
LPWSTR  ObjectName,
DWORD  ObjectType,
LPWSTR  PropertyCultureName,
const DEVPROPKEY PropertyKey,
DEVPROPTYPE PropertyType,
PNP_PROP_SIZE PropertySize,
PNP_PROP_SIZE TransferLen,
BYTE PropertyBuffer,
DWORD  Flags 
)

Definition at line 4999 of file rpcserver.c.

5010{
5013}

◆ PNP_GetObjectPropKeys()

DWORD WINAPI PNP_GetObjectPropKeys ( handle_t  hBinding,
LPWSTR  ObjectName,
DWORD  ObjectType,
LPWSTR  PropertyCultureName,
PNP_PROP_COUNT PropertyCount,
PNP_PROP_COUNT TransferLen,
DEVPROPKEY PropertyKeys,
DWORD  Flags 
)

Definition at line 4981 of file rpcserver.c.

4990{
4993}

◆ PNP_GetRelatedDeviceInstance()

DWORD WINAPI PNP_GetRelatedDeviceInstance ( handle_t  hBinding,
DWORD  ulRelationship,
LPWSTR  pDeviceID,
LPWSTR  pRelatedDeviceId,
PNP_RPC_STRING_LEN pulLength,
DWORD  ulFlags 
)

Definition at line 850 of file rpcserver.c.

857{
861
863 UNREFERENCED_PARAMETER(ulFlags);
864
865 DPRINT("PNP_GetRelatedDeviceInstance(%p %lu %S %p %p 0x%lx)\n",
866 hBinding, ulRelationship, pDeviceID, pRelatedDeviceId,
867 pulLength, ulFlags);
868
869 if (!IsValidDeviceInstanceID(pDeviceID))
870 return CR_INVALID_DEVINST;
871
872 if (ulRelationship == PNP_GET_PARENT_DEVICE_INSTANCE)
873 {
874 /* The root device does not have a parent */
875 if (IsRootDeviceInstanceID(pDeviceID))
876 return CR_NO_SUCH_DEVINST;
877
878 /* Return the root device for non existing devices */
879 if (!IsPresentDeviceInstanceID(pDeviceID))
880 {
881 if ((wcslen(szRootDeviceInstanceID) + 1) > *pulLength)
882 {
883 *pulLength = wcslen(szRootDeviceInstanceID) + 1;
884 return CR_BUFFER_SMALL;
885 }
886
887 wcscpy(pRelatedDeviceId, szRootDeviceInstanceID);
888 *pulLength = wcslen(szRootDeviceInstanceID) + 1;
889 return CR_SUCCESS;
890 }
891 }
892 else if (ulRelationship == PNP_GET_SIBLING_DEVICE_INSTANCE)
893 {
894 /* The root device does not have siblings */
895 if (IsRootDeviceInstanceID(pDeviceID))
896 return CR_NO_SUCH_DEVINST;
897 }
898
900 pDeviceID);
901
902 PlugPlayData.Relation = ulRelationship;
903
904 PlugPlayData.RelatedDeviceInstanceLength = *pulLength;
905 PlugPlayData.RelatedDeviceInstance = pRelatedDeviceId;
906
908 (PVOID)&PlugPlayData,
910 if (!NT_SUCCESS(Status))
911 {
913 }
914
915 DPRINT("PNP_GetRelatedDeviceInstance() done (returns %lx)\n", ret);
916 if (ret == CR_SUCCESS)
917 {
918 DPRINT("RelatedDevice: %wZ\n", &PlugPlayData.RelatedDeviceInstance);
919 }
920
921 return ret;
922}
@ PlugPlayControlGetRelatedDevice
Definition: cmtypes.h:221

Referenced by CM_Get_Child_Ex(), CM_Get_Parent_Ex(), and CM_Get_Sibling_Ex().

◆ PNP_GetResDesData()

DWORD WINAPI PNP_GetResDesData ( handle_t  hBinding,
LPWSTR  pDeviceID,
DWORD  ulLogConfTag,
DWORD  ulLogConfType,
RESOURCEID  ResourceID,
DWORD  ulResourceTag,
BYTE Buffer,
PNP_RPC_BUFFER_SIZE  BufferLen,
DWORD  ulFlags 
)

Definition at line 4559 of file rpcserver.c.

4569{
4572}

◆ PNP_GetResDesDataSize()

DWORD WINAPI PNP_GetResDesDataSize ( handle_t  hBinding,
LPWSTR  pDeviceID,
DWORD  ulLogConfTag,
DWORD  ulLogConfType,
RESOURCEID  ResourceID,
DWORD  ulResourceTag,
DWORD pulSize,
DWORD  ulFlags 
)

Definition at line 4578 of file rpcserver.c.

4587{
4590}

◆ PNP_GetRootDeviceInstance()

DWORD WINAPI PNP_GetRootDeviceInstance ( handle_t  hBinding,
LPWSTR  pDeviceID,
PNP_RPC_STRING_LEN  ulLength 
)

Definition at line 813 of file rpcserver.c.

817{
819
821
822 DPRINT("PNP_GetRootDeviceInstance(%p %S %lu)\n",
823 hBinding, pDeviceID, ulLength);
824
825 if (!pDeviceID)
826 {
828 goto Done;
829 }
830
831 if (ulLength < lstrlenW(szRootDeviceInstanceID) + 1)
832 {
834 goto Done;
835 }
836
837 lstrcpyW(pDeviceID,
839
840Done:
841 DPRINT("PNP_GetRootDeviceInstance() done (returns %lx)\n", ret);
842
843 return ret;
844}

Referenced by CM_Locate_DevNode_ExW().

◆ PNP_GetServerSideDeviceInstallFlags()

DWORD WINAPI PNP_GetServerSideDeviceInstallFlags ( handle_t  hBinding,
DWORD pulSSDIFlags,
DWORD  ulFlags 
)

Definition at line 4955 of file rpcserver.c.

4959{
4961
4962 DPRINT1("PNP_GetServerSideDeviceInstallFlags(%p %p %lu)\n",
4963 hBinding, pulSSDIFlags, ulFlags);
4964
4965 if (pulSSDIFlags == NULL)
4966 return CR_INVALID_POINTER;
4967
4968 if (ulFlags != 0)
4969 return CR_INVALID_FLAG;
4970
4971 /* FIXME */
4972 *pulSSDIFlags = 0;
4973
4974 return CR_SUCCESS;
4975}

Referenced by CMP_GetServerSideDeviceInstallFlags().

◆ PNP_GetVersion()

DWORD WINAPI PNP_GetVersion ( handle_t  hBinding,
WORD pVersion 
)

Definition at line 657 of file rpcserver.c.

660{
662
663 DPRINT("PNP_GetVersion(%p %p)\n",
664 hBinding, pVersion);
665
666 *pVersion = CONFIGMG_VERSION;
667
668 return CR_SUCCESS;
669}
#define CONFIGMG_VERSION
Definition: cfgmgr32.h:64

Referenced by CM_Get_Version_Ex(), CM_Is_Version_Available_Ex(), and CMP_WaitServicesAvailable().

◆ PNP_GetVersionInternal()

DWORD WINAPI PNP_GetVersionInternal ( handle_t  hBinding,
WORD pwVersion 
)

Definition at line 4926 of file rpcserver.c.

4929{
4931
4932 *pwVersion = WINVER;
4933 return CR_SUCCESS;
4934}
#define WINVER
Definition: targetver.h:11

◆ PNP_HwProfFlags()

DWORD WINAPI PNP_HwProfFlags ( handle_t  hBinding,
DWORD  ulAction,
LPWSTR  pDeviceID,
DWORD  ulConfig,
DWORD pulValue,
PPNP_VETO_TYPE  pVetoType,
LPWSTR  pszVetoName,
DWORD  ulNameLength,
DWORD  ulFlags 
)

Definition at line 3945 of file rpcserver.c.

3955{
3957 WCHAR szKeyName[MAX_PATH];
3958 HKEY hKey;
3959 HKEY hDeviceKey;
3960 DWORD dwSize;
3961
3963
3964 DPRINT("PNP_HwProfFlags() called\n");
3965
3966 if (!IsValidDeviceInstanceID(pDeviceID))
3967 return CR_INVALID_DEVINST;
3968
3969 if (ulConfig == 0)
3970 {
3971 wcscpy(szKeyName,
3972 L"System\\CurrentControlSet\\HardwareProfiles\\Current\\System\\CurrentControlSet\\Enum");
3973 }
3974 else
3975 {
3976 swprintf(szKeyName,
3977 L"System\\CurrentControlSet\\HardwareProfiles\\%04lu\\System\\CurrentControlSet\\Enum",
3978 ulConfig);
3979 }
3980
3982 szKeyName,
3983 0,
3985 &hKey) != ERROR_SUCCESS)
3986 return CR_REGISTRY_ERROR;
3987
3988 if (ulAction == PNP_GET_HWPROFFLAGS)
3989 {
3990 if (RegOpenKeyExW(hKey,
3991 pDeviceID,
3992 0,
3994 &hDeviceKey) != ERROR_SUCCESS)
3995 {
3996 *pulValue = 0;
3997 }
3998 else
3999 {
4000 dwSize = sizeof(DWORD);
4001 if (RegQueryValueExW(hDeviceKey,
4002 L"CSConfigFlags",
4003 NULL,
4004 NULL,
4005 (LPBYTE)pulValue,
4006 &dwSize) != ERROR_SUCCESS)
4007 {
4008 *pulValue = 0;
4009 }
4010
4011 RegCloseKey(hDeviceKey);
4012 }
4013 }
4014 else if (ulAction == PNP_SET_HWPROFFLAGS)
4015 {
4016 /* FIXME: not implemented yet */
4018 }
4019
4021
4022 return ret;
4023}

Referenced by CM_Get_HW_Prof_Flags_ExW(), and CM_Set_HW_Prof_Flags_ExW().

◆ PNP_InitDetection()

DWORD WINAPI PNP_InitDetection ( handle_t  hBinding)

Definition at line 700 of file rpcserver.c.

702{
704
705 DPRINT("PNP_InitDetection(%p)\n",
706 hBinding);
707
708 return CR_SUCCESS;
709}

Referenced by CMP_Init_Detection().

◆ PNP_InstallDevInst()

DWORD WINAPI PNP_InstallDevInst ( handle_t  hBinding)

Definition at line 5038 of file rpcserver.c.

5040{
5043}

◆ PNP_IsDockStationPresent()

CONFIGRET WINAPI PNP_IsDockStationPresent ( handle_t  hBinding,
BOOL Present 
)

Definition at line 3857 of file rpcserver.c.

3860{
3861 HKEY hKey;
3862 DWORD dwType;
3863 DWORD dwValue;
3864 DWORD dwSize;
3866
3868
3869 DPRINT1("PNP_IsDockStationPresent(%p %p)\n",
3870 hBinding, Present);
3871
3872 *Present = FALSE;
3873
3875 L"CurrentDockInfo",
3876 0,
3877 KEY_READ,
3878 &hKey) != ERROR_SUCCESS)
3879 return CR_REGISTRY_ERROR;
3880
3881 dwSize = sizeof(DWORD);
3883 L"DockingState",
3884 NULL,
3885 &dwType,
3886 (LPBYTE)&dwValue,
3887 &dwSize) != ERROR_SUCCESS)
3889
3891
3892 if (ret == CR_SUCCESS)
3893 {
3894 if (dwType != REG_DWORD || dwSize != sizeof(DWORD))
3895 {
3897 }
3898 else if (dwValue != 0)
3899 {
3900 *Present = TRUE;
3901 }
3902 }
3903
3904 DPRINT1("PNP_IsDockStationPresent() done (returns %lx)\n", ret);
3905
3906 return ret;
3907}
#define HKEY_CURRENT_CONFIG
Definition: winreg.h:15

Referenced by CM_Is_Dock_Station_Present_Ex().

◆ PNP_ModifyResDes()

DWORD WINAPI PNP_ModifyResDes ( handle_t  hBinding,
LPWSTR  pDeviceID,
DWORD  ulLogConfTag,
DWORD  ulLogConfType,
RESOURCEID  CurrentResourceID,
RESOURCEID  NewResourceID,
DWORD  ulResourceTag,
BYTE ResourceData,
PNP_RPC_BUFFER_SIZE  ResourceLen,
DWORD  ulFlags 
)

Definition at line 4596 of file rpcserver.c.

4607{
4610}

◆ PNP_NOTIFY_HANDLE_rundown()

VOID __RPC_USER PNP_NOTIFY_HANDLE_rundown ( PNP_NOTIFY_HANDLE  pHandle)

Definition at line 623 of file rpcserver.c.

625{
626 DPRINT1("PNP_NOTIFY_HANDLE_rundown(%p)\n", pHandle);
627}

◆ PNP_QueryArbitratorFreeData()

DWORD WINAPI PNP_QueryArbitratorFreeData ( handle_t  hBinding,
BYTE pData,
DWORD  DataLen,
LPWSTR  pDeviceID,
RESOURCEID  ResourceID,
DWORD  ulFlags 
)

Definition at line 4667 of file rpcserver.c.

4674{
4676}

Referenced by CM_Query_Arbitrator_Free_Data_Ex().

◆ PNP_QueryArbitratorFreeSize()

DWORD WINAPI PNP_QueryArbitratorFreeSize ( handle_t  hBinding,
DWORD pulSize,
LPWSTR  pDeviceID,
RESOURCEID  ResourceID,
DWORD  ulFlags 
)

Definition at line 4682 of file rpcserver.c.

4688{
4689 if (pulSize != NULL)
4690 *pulSize = 0;
4691
4693}
_Check_return_ _Out_ PULONG pulSize
Definition: winddi.h:2120

Referenced by CM_Query_Arbitrator_Free_Size_Ex().

◆ PNP_QueryRemove()

DWORD WINAPI PNP_QueryRemove ( handle_t  hBinding,
LPWSTR  pszDeviceID,
PPNP_VETO_TYPE  pVetoType,
LPWSTR  pszVetoName,
DWORD  ulNameLength,
DWORD  ulFlags 
)

Definition at line 3760 of file rpcserver.c.

3767{
3771
3772 DPRINT1("PNP_QueryRemove(%p %S %p %p %lu 0x%lx)\n",
3773 hBinding, pszDeviceID, pVetoType, pszVetoName,
3774 ulNameLength, ulFlags);
3775
3776 if (ulFlags & ~CM_REMOVE_BITS)
3777 return CR_INVALID_FLAG;
3778
3779 if (!IsValidDeviceInstanceID(pszDeviceID) ||
3780 IsRootDeviceInstanceID(pszDeviceID))
3781 return CR_INVALID_DEVINST;
3782
3783 if (pVetoType != NULL)
3784 *pVetoType = PNP_VetoTypeUnknown;
3785
3786 if (pszVetoName != NULL && ulNameLength > 0)
3787 *pszVetoName = UNICODE_NULL;
3788
3789 RtlZeroMemory(&PlugPlayData, sizeof(PlugPlayData));
3791 pszDeviceID);
3792 PlugPlayData.VetoName = pszVetoName;
3793 PlugPlayData.NameLength = ulNameLength;
3794// PlugPlayData.Flags =
3795
3797 &PlugPlayData,
3798 sizeof(PlugPlayData));
3799 if (!NT_SUCCESS(Status))
3801
3802 return ret;
3803}
@ PNP_VetoTypeUnknown
Definition: cfg.h:180
#define CM_REMOVE_BITS
Definition: cfgmgr32.h:780
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262

Referenced by CM_Query_And_Remove_SubTree_ExW().

◆ PNP_QueryResConfList()

DWORD WINAPI PNP_QueryResConfList ( handle_t  hBinding,
LPWSTR  pDeviceID,
RESOURCEID  ResourceID,
BYTE ResourceData,
PNP_RPC_BUFFER_SIZE  ResourceLen,
BYTE Buffer,
PNP_RPC_BUFFER_SIZE  BufferLen,
DWORD  ulFlags 
)

Definition at line 4637 of file rpcserver.c.

4646{
4649}

Referenced by CM_Query_Resource_Conflict_List().

◆ PNP_RegisterDeviceClassAssociation()

DWORD WINAPI PNP_RegisterDeviceClassAssociation ( handle_t  hBinding,
LPWSTR  pszDeviceID,
GUID InterfaceGuid,
LPWSTR  pszReference,
LPWSTR  pszSymLink,
PNP_RPC_STRING_LEN pulLength,
PNP_RPC_STRING_LEN pulTransferLen,
DWORD  ulFlags 
)

Definition at line 2699 of file rpcserver.c.

2708{
2711}

Referenced by CM_Register_Device_Interface_ExW().

◆ PNP_RegisterDriver()