ReactOS  0.4.14-dev-342-gdc047f9
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 GetDeviceStatus (_In_ LPWSTR pDeviceID, _Out_ DWORD *pulStatus, _Out_ DWORD *pulProblem)
 
static BOOL IsValidDeviceInstanceID (_In_ PWSTR pszDeviceInstanceID)
 
static BOOL IsRootDeviceInstanceID (_In_ PWSTR pszDeviceInstanceID)
 
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 (LPWSTR pszDeviceID)
 
DWORD WINAPI PNP_CreateDevInst (handle_t hBinding, LPWSTR pszDeviceID, LPWSTR pszParentDeviceID, PNP_RPC_STRING_LEN ulLength, DWORD ulFlags)
 
static CONFIGRET MoveDeviceInstance (LPWSTR pszDeviceInstanceDestination, LPWSTR pszDeviceInstanceSource)
 
static CONFIGRET SetupDeviceInstance (LPWSTR pszDeviceInstance, DWORD ulFlags)
 
static CONFIGRET EnableDeviceInstance (LPWSTR pszDeviceInstance)
 
static CONFIGRET DisableDeviceInstance (LPWSTR pszDeviceInstance)
 
static CONFIGRET ReenumerateDeviceInstance (_In_ LPWSTR pszDeviceInstance, _In_ ULONG ulFlags)
 
DWORD WINAPI PNP_DeviceInstanceAction (handle_t hBinding, DWORD ulAction, DWORD ulFlags, 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 ulUnknown2, LPWSTR pszName, BYTE *pNotificationFilter, DWORD ulNotificationFilterSize, DWORD ulFlags, DWORD *pulNotify, DWORD ulUnknown8, DWORD *pulUnknown9)
 
DWORD WINAPI PNP_UnregisterNotification (handle_t hBinding, DWORD ulNotify)
 
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"
 

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 2918 of file rpcserver.c.

2921 {
2922  DWORD dwLen;
2923  DWORD dwPos;
2924 
2925  dwLen = wcslen(lpDeviceId);
2926  dwPos = (*lpDeviceIdListSize / sizeof(WCHAR)) - 1;
2927 
2928  wcscpy(&lpDeviceIdList[dwPos], lpDeviceId);
2929 
2930  dwPos += (dwLen + 1);
2931 
2932  lpDeviceIdList[dwPos] = 0;
2933 
2934  *lpDeviceIdListSize = dwPos * sizeof(WCHAR);
2935 }
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by PNP_AddID().

◆ CheckForDeviceId()

static BOOL CheckForDeviceId ( LPWSTR  lpDeviceIdList,
LPWSTR  lpDeviceId 
)
static

Definition at line 2897 of file rpcserver.c.

2899 {
2900  LPWSTR lpPtr;
2901  DWORD dwLength;
2902 
2903  lpPtr = lpDeviceIdList;
2904  while (*lpPtr != 0)
2905  {
2906  dwLength = wcslen(lpPtr);
2907  if (0 == _wcsicmp(lpPtr, lpDeviceId))
2908  return TRUE;
2909 
2910  lpPtr += (dwLength + 1);
2911  }
2912 
2913  return FALSE;
2914 }
#define TRUE
Definition: types.h:120
static DWORD DWORD * dwLength
Definition: fusion.c:85
unsigned long DWORD
Definition: ntddk_ex.h:95
WCHAR * LPWSTR
Definition: xmlstorage.h:184
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)

Referenced by PNP_AddID().

◆ CreateDeviceInstance()

static CONFIGRET CreateDeviceInstance ( LPWSTR  pszDeviceID)
static

Definition at line 2524 of file rpcserver.c.

2525 {
2526  WCHAR szEnumerator[MAX_DEVICE_ID_LEN];
2527  WCHAR szDevice[MAX_DEVICE_ID_LEN];
2528  WCHAR szInstance[MAX_DEVICE_ID_LEN];
2529  HKEY hKeyEnumerator;
2530  HKEY hKeyDevice;
2531  HKEY hKeyInstance;
2532  HKEY hKeyControl;
2533  LONG lError;
2534 
2535  /* Split the instance ID */
2536  SplitDeviceInstanceID(pszDeviceID,
2537  szEnumerator,
2538  szDevice,
2539  szInstance);
2540 
2541  /* Open or create the enumerator key */
2542  lError = RegCreateKeyExW(hEnumKey,
2543  szEnumerator,
2544  0,
2545  NULL,
2548  NULL,
2549  &hKeyEnumerator,
2550  NULL);
2551  if (lError != ERROR_SUCCESS)
2552  {
2553  return CR_REGISTRY_ERROR;
2554  }
2555 
2556  /* Open or create the device key */
2557  lError = RegCreateKeyExW(hKeyEnumerator,
2558  szDevice,
2559  0,
2560  NULL,
2563  NULL,
2564  &hKeyDevice,
2565  NULL);
2566 
2567  /* Close the enumerator key */
2568  RegCloseKey(hKeyEnumerator);
2569 
2570  if (lError != ERROR_SUCCESS)
2571  {
2572  return CR_REGISTRY_ERROR;
2573  }
2574 
2575  /* Try to open the instance key and fail if it exists */
2576  lError = RegOpenKeyExW(hKeyDevice,
2577  szInstance,
2578  0,
2579  KEY_SET_VALUE,
2580  &hKeyInstance);
2581  if (lError == ERROR_SUCCESS)
2582  {
2583  DPRINT1("Instance %S already exists!\n", szInstance);
2584  RegCloseKey(hKeyInstance);
2585  RegCloseKey(hKeyDevice);
2586  return CR_ALREADY_SUCH_DEVINST;
2587  }
2588 
2589  /* Create a new instance key */
2590  lError = RegCreateKeyExW(hKeyDevice,
2591  szInstance,
2592  0,
2593  NULL,
2596  NULL,
2597  &hKeyInstance,
2598  NULL);
2599 
2600  /* Close the device key */
2601  RegCloseKey(hKeyDevice);
2602 
2603  if (lError != ERROR_SUCCESS)
2604  {
2605  return CR_REGISTRY_ERROR;
2606  }
2607 
2608  /* Create the 'Control' sub key */
2609  lError = RegCreateKeyExW(hKeyInstance,
2610  L"Control",
2611  0,
2612  NULL,
2615  NULL,
2616  &hKeyControl,
2617  NULL);
2618  if (lError == ERROR_SUCCESS)
2619  {
2620  RegCloseKey(hKeyControl);
2621  }
2622 
2623  RegCloseKey(hKeyInstance);
2624 
2625  return (lError == ERROR_SUCCESS) ? CR_SUCCESS : CR_REGISTRY_ERROR;
2626 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_SET_VALUE
Definition: nt_native.h:1017
static VOID SplitDeviceInstanceID(IN LPWSTR pszDeviceInstanceID, OUT LPWSTR pszEnumerator, OUT LPWSTR pszDevice, OUT LPWSTR pszInstance)
Definition: rpcserver.c:150
#define MAX_DEVICE_ID_LEN
Definition: pnpmgr.c:28
#define CR_ALREADY_SUCH_DEVINST
Definition: cfgmgr32.h:862
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:1091
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
__wchar_t WCHAR
Definition: xmlstorage.h:180
HKEY hEnumKey
Definition: umpnpmgr.c:44
static const WCHAR L[]
Definition: oid.c:1250
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define DPRINT1
Definition: precomp.h:8
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define CR_REGISTRY_ERROR
Definition: cfgmgr32.h:875

Referenced by PNP_CreateDevInst().

◆ DisableDeviceInstance()

static CONFIGRET DisableDeviceInstance ( LPWSTR  pszDeviceInstance)
static

Definition at line 2737 of file rpcserver.c.

2738 {
2739  DPRINT("DisableDeviceInstance: not implemented\n");
2740  /* FIXME */
2741  return CR_CALL_NOT_IMPLEMENTED;
2742 }
void DPRINT(...)
Definition: polytest.cpp:61
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898

Referenced by PNP_DeviceInstanceAction().

◆ EnableDeviceInstance()

static CONFIGRET EnableDeviceInstance ( LPWSTR  pszDeviceInstance)
static

Definition at line 2719 of file rpcserver.c.

2720 {
2721  PLUGPLAY_CONTROL_RESET_DEVICE_DATA ResetDeviceData;
2723  NTSTATUS Status;
2724 
2725  DPRINT("Enable device instance %S\n", pszDeviceInstance);
2726 
2727  RtlInitUnicodeString(&ResetDeviceData.DeviceInstance, pszDeviceInstance);
2729  if (!NT_SUCCESS(Status))
2731 
2732  return ret;
2733 }
LONG NTSTATUS
Definition: precomp.h:26
static CONFIGRET WINAPI NtStatusToCrError(NTSTATUS Status)
Definition: rpcserver.c:121
#define CR_SUCCESS
Definition: cfgmgr32.h:842
void DPRINT(...)
Definition: polytest.cpp:61
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
int ret
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI NtPlugPlayControl(IN PLUGPLAY_CONTROL_CLASS PlugPlayControlClass, IN OUT PVOID Buffer, IN ULONG BufferLength)
Definition: plugplay.c:1299
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)

Referenced by PNP_DeviceInstanceAction().

◆ GetAllInstanceList()

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

Definition at line 927 of file rpcserver.c.

930 {
931  WCHAR szEnumeratorBuffer[MAX_DEVICE_ID_LEN];
932  PWSTR pPtr;
933  DWORD dwIndex, dwEnumeratorLength, dwUsedLength, dwRemainingLength, dwPathLength;
934  DWORD dwError;
936 
937  dwUsedLength = 0;
938  dwRemainingLength = *pulLength;
939  pPtr = pszBuffer;
940 
941  for (dwIndex = 0; ; dwIndex++)
942  {
943  dwEnumeratorLength = MAX_DEVICE_ID_LEN;
944  dwError = RegEnumKeyExW(hEnumKey,
945  dwIndex,
946  szEnumeratorBuffer,
947  &dwEnumeratorLength,
948  NULL, NULL, NULL, NULL);
949  if (dwError != ERROR_SUCCESS)
950  break;
951 
952  dwPathLength = dwRemainingLength;
953  ret = GetEnumeratorInstanceList(szEnumeratorBuffer,
954  pPtr,
955  &dwPathLength);
956  if (ret != CR_SUCCESS)
957  break;
958 
959  dwUsedLength += dwPathLength - 1;
960  dwRemainingLength += dwPathLength - 1;
961  pPtr += dwPathLength - 1;
962  }
963 
964  if (ret == CR_SUCCESS)
965  *pulLength = dwUsedLength + 1;
966  else
967  *pulLength = 0;
968 
969  return ret;
970 }
#define ERROR_SUCCESS
Definition: deptool.c:10
uint16_t * PWSTR
Definition: typedefs.h:54
#define MAX_DEVICE_ID_LEN
Definition: pnpmgr.c:28
CONFIGRET GetEnumeratorInstanceList(_In_ PWSTR pszEnumerator, _Inout_ PWSTR pszBuffer, _Inout_ PDWORD pulLength)
Definition: rpcserver.c:856
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
HKEY hEnumKey
Definition: umpnpmgr.c:44
int ret
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
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:2527

Referenced by PNP_GetDeviceList().

◆ GetAllInstanceListSize()

static CONFIGRET GetAllInstanceListSize ( _Out_ PULONG  pulLength)
static

Definition at line 1311 of file rpcserver.c.

1313 {
1314  WCHAR szEnumeratorBuffer[MAX_DEVICE_ID_LEN];
1315  DWORD dwIndex, dwEnumeratorLength, dwBufferLength;
1316  DWORD dwError;
1318 
1319  for (dwIndex = 0; ; dwIndex++)
1320  {
1321  dwEnumeratorLength = MAX_DEVICE_ID_LEN;
1322  dwError = RegEnumKeyExW(hEnumKey,
1323  dwIndex,
1324  szEnumeratorBuffer,
1325  &dwEnumeratorLength,
1326  NULL, NULL, NULL, NULL);
1327  if (dwError != ERROR_SUCCESS)
1328  break;
1329 
1330  /* Get the size of all device instances for the enumerator */
1331  ret = GetEnumeratorInstanceListSize(szEnumeratorBuffer,
1332  &dwBufferLength);
1333  if (ret != CR_SUCCESS)
1334  break;
1335 
1336  *pulLength += dwBufferLength;
1337  }
1338 
1339  return ret;
1340 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define MAX_DEVICE_ID_LEN
Definition: pnpmgr.c:28
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
HKEY hEnumKey
Definition: umpnpmgr.c:44
int ret
static CONFIGRET GetEnumeratorInstanceListSize(_In_ LPCWSTR pszEnumerator, _Out_ PULONG pulLength)
Definition: rpcserver.c:1250
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
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:2527

Referenced by PNP_GetDeviceListSize().

◆ GetDeviceInstanceList()

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

Definition at line 785 of file rpcserver.c.

789 {
790  WCHAR szInstanceBuffer[MAX_DEVICE_ID_LEN];
791  WCHAR szPathBuffer[512];
792  HKEY hDeviceKey;
793  DWORD dwInstanceLength, dwPathLength, dwUsedLength;
794  DWORD dwIndex, dwError;
795  PWSTR pPtr;
797 
798  /* Open the device key */
799  dwError = RegOpenKeyExW(hEnumKey,
800  pszDevice,
801  0,
803  &hDeviceKey);
804  if (dwError != ERROR_SUCCESS)
805  {
806  DPRINT("Failed to open the device key (Error %lu)\n", dwError);
807  return CR_REGISTRY_ERROR;
808  }
809 
810  dwUsedLength = 0;
811  pPtr = pszBuffer;
812 
813  for (dwIndex = 0; ; dwIndex++)
814  {
815  dwInstanceLength = MAX_DEVICE_ID_LEN;
816  dwError = RegEnumKeyExW(hDeviceKey,
817  dwIndex,
818  szInstanceBuffer,
819  &dwInstanceLength,
820  NULL,
821  NULL,
822  NULL,
823  NULL);
824  if (dwError != ERROR_SUCCESS)
825  break;
826 
827  wsprintf(szPathBuffer, L"%s\\%s", pszDevice, szInstanceBuffer);
828  DPRINT("Path: %S\n", szPathBuffer);
829 
830  dwPathLength = wcslen(szPathBuffer) + 1;
831  if (dwUsedLength + dwPathLength + 1 > *pulLength)
832  {
834  break;
835  }
836 
837  wcscpy(pPtr, szPathBuffer);
838  dwUsedLength += dwPathLength;
839  pPtr += dwPathLength;
840 
841  *pPtr = UNICODE_NULL;
842  }
843 
844  RegCloseKey(hDeviceKey);
845 
846  if (ret == CR_SUCCESS)
847  *pulLength = dwUsedLength + 1;
848  else
849  *pulLength = 0;
850 
851  return ret;
852 }
#define ERROR_SUCCESS
Definition: deptool.c:10
uint16_t * PWSTR
Definition: typedefs.h:54
#define MAX_DEVICE_ID_LEN
Definition: pnpmgr.c:28
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define UNICODE_NULL
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CR_BUFFER_SMALL
Definition: cfgmgr32.h:872
unsigned long DWORD
Definition: ntddk_ex.h:95
HKEY hEnumKey
Definition: umpnpmgr.c:44
int ret
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
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:2527
#define wsprintf
Definition: winuser.h:5766
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define CR_REGISTRY_ERROR
Definition: cfgmgr32.h:875
#define KEY_ENUMERATE_SUB_KEYS
Definition: nt_native.h:1019

Referenced by GetEnumeratorInstanceList(), and PNP_GetDeviceList().

◆ GetDeviceInstanceListSize()

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

Definition at line 1198 of file rpcserver.c.

1201 {
1202  HKEY hDeviceKey;
1203  DWORD dwSubKeys, dwMaxSubKeyLength;
1204  DWORD dwError;
1205 
1206  /* Open the device key */
1207  dwError = RegOpenKeyExW(hEnumKey,
1208  pszDevice,
1209  0,
1210  KEY_READ,
1211  &hDeviceKey);
1212  if (dwError != ERROR_SUCCESS)
1213  {
1214  DPRINT("Failed to open the device key (Error %lu)\n", dwError);
1215  return CR_REGISTRY_ERROR;
1216  }
1217 
1218  /* Retrieve the number of device instances and the maximum name length */
1219  dwError = RegQueryInfoKeyW(hDeviceKey,
1220  NULL,
1221  NULL,
1222  NULL,
1223  &dwSubKeys,
1224  &dwMaxSubKeyLength,
1225  NULL,
1226  NULL,
1227  NULL,
1228  NULL,
1229  NULL,
1230  NULL);
1231  if (dwError != ERROR_SUCCESS)
1232  {
1233  DPRINT("RegQueryInfoKeyW failed (Error %lu)\n", dwError);
1234  dwSubKeys = 0;
1235  dwMaxSubKeyLength = 0;
1236  }
1237 
1238  /* Close the device key */
1239  RegCloseKey(hDeviceKey);
1240 
1241  /* Return the largest possible buffer size */
1242  *pulLength = dwSubKeys * (wcslen(pszDevice) + 1 + dwMaxSubKeyLength + 1);
1243 
1244  return CR_SUCCESS;
1245 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_READ
Definition: nt_native.h:1023
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
unsigned long DWORD
Definition: ntddk_ex.h:95
HKEY hEnumKey
Definition: umpnpmgr.c:44
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:3686
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define CR_REGISTRY_ERROR
Definition: cfgmgr32.h:875

Referenced by GetEnumeratorInstanceListSize(), and PNP_GetDeviceListSize().

◆ GetDeviceStatus()

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

Definition at line 196 of file rpcserver.c.

200 {
201  PLUGPLAY_CONTROL_STATUS_DATA PlugPlayData;
204 
205  DPRINT("GetDeviceStatus(%S %p %p)\n",
206  pDeviceID, pulStatus, pulProblem);
207 
208  RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
209  pDeviceID);
210  PlugPlayData.Operation = 0; /* Get status */
211 
213  (PVOID)&PlugPlayData,
215  if (NT_SUCCESS(Status))
216  {
217  *pulStatus = PlugPlayData.DeviceStatus;
218  *pulProblem = PlugPlayData.DeviceProblem;
219  }
220  else
221  {
223  }
224 
225  return ret;
226 }
LONG NTSTATUS
Definition: precomp.h:26
static CONFIGRET WINAPI NtStatusToCrError(NTSTATUS Status)
Definition: rpcserver.c:121
UNICODE_STRING DeviceInstance
Definition: cmtypes.h:506
#define CR_SUCCESS
Definition: cfgmgr32.h:842
void DPRINT(...)
Definition: polytest.cpp:61
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
int ret
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI NtPlugPlayControl(IN PLUGPLAY_CONTROL_CLASS PlugPlayControlClass, IN OUT PVOID Buffer, IN ULONG BufferLength)
Definition: plugplay.c:1299
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)

Referenced by DECLARE_INTERFACE_(), and PNP_GetDeviceStatus().

◆ GetEnumeratorInstanceList()

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

Definition at line 856 of file rpcserver.c.

860 {
861  WCHAR szDeviceBuffer[MAX_DEVICE_ID_LEN];
862  WCHAR szPathBuffer[512];
863  HKEY hEnumeratorKey;
864  PWSTR pPtr;
865  DWORD dwIndex, dwDeviceLength, dwUsedLength, dwRemainingLength, dwPathLength;
866  DWORD dwError;
868 
869  /* Open the enumerator key */
870  dwError = RegOpenKeyExW(hEnumKey,
871  pszEnumerator,
872  0,
874  &hEnumeratorKey);
875  if (dwError != ERROR_SUCCESS)
876  {
877  DPRINT("Failed to open the enumerator key (Error %lu)\n", dwError);
878  return CR_REGISTRY_ERROR;
879  }
880 
881  dwUsedLength = 0;
882  dwRemainingLength = *pulLength;
883  pPtr = pszBuffer;
884 
885  for (dwIndex = 0; ; dwIndex++)
886  {
887  dwDeviceLength = MAX_DEVICE_ID_LEN;
888  dwError = RegEnumKeyExW(hEnumeratorKey,
889  dwIndex,
890  szDeviceBuffer,
891  &dwDeviceLength,
892  NULL,
893  NULL,
894  NULL,
895  NULL);
896  if (dwError != ERROR_SUCCESS)
897  break;
898 
899  wsprintf(szPathBuffer, L"%s\\%s", pszEnumerator, szDeviceBuffer);
900  DPRINT("Path: %S\n", szPathBuffer);
901 
902  dwPathLength = dwRemainingLength;
903  ret = GetDeviceInstanceList(szPathBuffer,
904  pPtr,
905  &dwPathLength);
906  if (ret != CR_SUCCESS)
907  break;
908 
909  dwUsedLength += dwPathLength - 1;
910  dwRemainingLength += dwPathLength - 1;
911  pPtr += dwPathLength - 1;
912  }
913 
914  RegCloseKey(hEnumeratorKey);
915 
916  if (ret == CR_SUCCESS)
917  *pulLength = dwUsedLength + 1;
918  else
919  *pulLength = 0;
920 
921  return ret;
922 }
#define ERROR_SUCCESS
Definition: deptool.c:10
uint16_t * PWSTR
Definition: typedefs.h:54
#define MAX_DEVICE_ID_LEN
Definition: pnpmgr.c:28
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
__wchar_t WCHAR
Definition: xmlstorage.h:180
static CONFIGRET GetDeviceInstanceList(_In_ PWSTR pszDevice, _Inout_ PWSTR pszBuffer, _Inout_ PDWORD pulLength)
Definition: rpcserver.c:785
unsigned long DWORD
Definition: ntddk_ex.h:95
HKEY hEnumKey
Definition: umpnpmgr.c:44
int ret
static const WCHAR L[]
Definition: oid.c:1250
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
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:2527
#define wsprintf
Definition: winuser.h:5766
#define CR_REGISTRY_ERROR
Definition: cfgmgr32.h:875
#define KEY_ENUMERATE_SUB_KEYS
Definition: nt_native.h:1019

Referenced by GetAllInstanceList(), and PNP_GetDeviceList().

◆ GetEnumeratorInstanceListSize()

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

Definition at line 1250 of file rpcserver.c.

1253 {
1254  WCHAR szDeviceBuffer[MAX_DEVICE_ID_LEN];
1255  WCHAR szPathBuffer[512];
1256  HKEY hEnumeratorKey;
1257  DWORD dwIndex, dwDeviceLength, dwBufferLength;
1258  DWORD dwError;
1260 
1261  *pulLength = 0;
1262 
1263  /* Open the enumerator key */
1264  dwError = RegOpenKeyExW(hEnumKey,
1265  pszEnumerator,
1266  0,
1268  &hEnumeratorKey);
1269  if (dwError != ERROR_SUCCESS)
1270  {
1271  DPRINT("Failed to open the enumerator key (Error %lu)\n", dwError);
1272  return CR_REGISTRY_ERROR;
1273  }
1274 
1275  for (dwIndex = 0; ; dwIndex++)
1276  {
1277  dwDeviceLength = MAX_DEVICE_ID_LEN;
1278  dwError = RegEnumKeyExW(hEnumeratorKey,
1279  dwIndex,
1280  szDeviceBuffer,
1281  &dwDeviceLength,
1282  NULL,
1283  NULL,
1284  NULL,
1285  NULL);
1286  if (dwError != ERROR_SUCCESS)
1287  break;
1288 
1289  wsprintf(szPathBuffer, L"%s\\%s", pszEnumerator, szDeviceBuffer);
1290  DPRINT("Path: %S\n", szPathBuffer);
1291 
1292  ret = GetDeviceInstanceListSize(szPathBuffer, &dwBufferLength);
1293  if (ret != CR_SUCCESS)
1294  {
1295  *pulLength = 0;
1296  break;
1297  }
1298 
1299  *pulLength += dwBufferLength;
1300  }
1301 
1302  /* Close the enumerator key */
1303  RegCloseKey(hEnumeratorKey);
1304 
1305  return ret;
1306 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define MAX_DEVICE_ID_LEN
Definition: pnpmgr.c:28
static CONFIGRET GetDeviceInstanceListSize(_In_ LPCWSTR pszDevice, _Out_ PULONG pulLength)
Definition: rpcserver.c:1198
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
HKEY hEnumKey
Definition: umpnpmgr.c:44
int ret
static const WCHAR L[]
Definition: oid.c:1250
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
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:2527
#define wsprintf
Definition: winuser.h:5766
#define CR_REGISTRY_ERROR
Definition: cfgmgr32.h:875
#define KEY_ENUMERATE_SUB_KEYS
Definition: nt_native.h:1019

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 615 of file rpcserver.c.

620 {
624 
625  RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
626  pszDevice);
627 
628  if (ulFlags & CM_GETIDLIST_FILTER_BUSRELATIONS)
629  {
630  PlugPlayData.Relations = 3;
631  }
632  else if (ulFlags & CM_GETIDLIST_FILTER_POWERRELATIONS)
633  {
634  PlugPlayData.Relations = 2;
635  }
636  else if (ulFlags & CM_GETIDLIST_FILTER_REMOVALRELATIONS)
637  {
638  PlugPlayData.Relations = 1;
639  }
640  else if (ulFlags & CM_GETIDLIST_FILTER_EJECTRELATIONS)
641  {
642  PlugPlayData.Relations = 0;
643  }
644 
645  PlugPlayData.BufferSize = *pulLength * sizeof(WCHAR);
646  PlugPlayData.Buffer = pszBuffer;
647 
649  (PVOID)&PlugPlayData,
651  if (NT_SUCCESS(Status))
652  {
653  *pulLength = PlugPlayData.BufferSize / sizeof(WCHAR);
654  }
655  else
656  {
658  }
659 
660  return ret;
661 }
LONG NTSTATUS
Definition: precomp.h:26
static CONFIGRET WINAPI NtStatusToCrError(NTSTATUS Status)
Definition: rpcserver.c:121
#define CM_GETIDLIST_FILTER_BUSRELATIONS
Definition: cfgmgr32.h:660
#define CM_GETIDLIST_FILTER_EJECTRELATIONS
Definition: cfgmgr32.h:657
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define CM_GETIDLIST_FILTER_REMOVALRELATIONS
Definition: cfgmgr32.h:658
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define CM_GETIDLIST_FILTER_POWERRELATIONS
Definition: cfgmgr32.h:659
int ret
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI NtPlugPlayControl(IN PLUGPLAY_CONTROL_CLASS PlugPlayControlClass, IN OUT PVOID Buffer, IN ULONG BufferLength)
Definition: plugplay.c:1299
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)

Referenced by PNP_GetDeviceList().

◆ GetRelationsInstanceListSize()

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

Definition at line 1049 of file rpcserver.c.

1053 {
1055  NTSTATUS Status;
1057 
1058  RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
1059  pszDevice);
1060 
1061  if (ulFlags & CM_GETIDLIST_FILTER_BUSRELATIONS)
1062  {
1063  PlugPlayData.Relations = 3;
1064  }
1065  else if (ulFlags & CM_GETIDLIST_FILTER_POWERRELATIONS)
1066  {
1067  PlugPlayData.Relations = 2;
1068  }
1069  else if (ulFlags & CM_GETIDLIST_FILTER_REMOVALRELATIONS)
1070  {
1071  PlugPlayData.Relations = 1;
1072  }
1073  else if (ulFlags & CM_GETIDLIST_FILTER_EJECTRELATIONS)
1074  {
1075  PlugPlayData.Relations = 0;
1076  }
1077 
1078  PlugPlayData.BufferSize = 0;
1079  PlugPlayData.Buffer = NULL;
1080 
1082  (PVOID)&PlugPlayData,
1084  if (NT_SUCCESS(Status))
1085  {
1086  *pulLength = PlugPlayData.BufferSize / sizeof(WCHAR);
1087  }
1088  else
1089  {
1091  }
1092 
1093  return ret;
1094 }
LONG NTSTATUS
Definition: precomp.h:26
static CONFIGRET WINAPI NtStatusToCrError(NTSTATUS Status)
Definition: rpcserver.c:121
#define CM_GETIDLIST_FILTER_BUSRELATIONS
Definition: cfgmgr32.h:660
#define CM_GETIDLIST_FILTER_EJECTRELATIONS
Definition: cfgmgr32.h:657
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
#define CM_GETIDLIST_FILTER_REMOVALRELATIONS
Definition: cfgmgr32.h:658
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define CM_GETIDLIST_FILTER_POWERRELATIONS
Definition: cfgmgr32.h:659
int ret
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI NtPlugPlayControl(IN PLUGPLAY_CONTROL_CLASS PlugPlayControlClass, IN OUT PVOID Buffer, IN ULONG BufferLength)
Definition: plugplay.c:1299
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)

Referenced by PNP_GetDeviceListSize().

◆ GetServiceInstanceList()

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

Definition at line 666 of file rpcserver.c.

670 {
671  WCHAR szPathBuffer[512];
672  WCHAR szName[16];
673  HKEY hServicesKey = NULL, hServiceKey = NULL, hEnumKey = NULL;
674  DWORD dwValues, dwSize, dwIndex, dwUsedLength, dwPathLength;
675  DWORD dwError;
676  PWSTR pPtr;
678 
679  /* Open the device key */
681  L"System\\CurrentControlSet\\Services",
682  0,
683  KEY_READ,
684  &hServicesKey);
685  if (dwError != ERROR_SUCCESS)
686  {
687  DPRINT("Failed to open the services key (Error %lu)\n", dwError);
688  return CR_REGISTRY_ERROR;
689  }
690 
691  dwError = RegOpenKeyExW(hServicesKey,
692  pszService,
693  0,
694  KEY_READ,
695  &hServiceKey);
696  if (dwError != ERROR_SUCCESS)
697  {
698  DPRINT("Failed to open the service key (Error %lu)\n", dwError);
700  goto Done;
701  }
702 
703  dwError = RegOpenKeyExW(hServiceKey,
704  L"Enum",
705  0,
706  KEY_READ,
707  &hEnumKey);
708  if (dwError != ERROR_SUCCESS)
709  {
710  DPRINT("Failed to open the service enum key (Error %lu)\n", dwError);
712  goto Done;
713  }
714 
715  /* Retrieve the number of device instances */
716  dwSize = sizeof(DWORD);
717  dwError = RegQueryValueExW(hEnumKey,
718  L"Count",
719  NULL,
720  NULL,
721  (LPBYTE)&dwValues,
722  &dwSize);
723  if (dwError != ERROR_SUCCESS)
724  {
725  DPRINT("RegQueryValueExW failed (Error %lu)\n", dwError);
726  dwValues = 1;
727  }
728 
729  DPRINT("dwValues %lu\n", dwValues);
730 
731  dwUsedLength = 0;
732  pPtr = pszBuffer;
733 
734  for (dwIndex = 0; dwIndex < dwValues; dwIndex++)
735  {
736  wsprintf(szName, L"%lu", dwIndex);
737 
738  dwSize = sizeof(szPathBuffer);
739  dwError = RegQueryValueExW(hEnumKey,
740  szName,
741  NULL,
742  NULL,
743  (LPBYTE)szPathBuffer,
744  &dwSize);
745  if (dwError != ERROR_SUCCESS)
746  break;
747 
748  DPRINT("Path: %S\n", szPathBuffer);
749 
750  dwPathLength = wcslen(szPathBuffer) + 1;
751  if (dwUsedLength + dwPathLength + 1 > *pulLength)
752  {
754  break;
755  }
756 
757  wcscpy(pPtr, szPathBuffer);
758  dwUsedLength += dwPathLength;
759  pPtr += dwPathLength;
760 
761  *pPtr = UNICODE_NULL;
762  }
763 
764 Done:
765  if (hEnumKey != NULL)
767 
768  if (hServiceKey != NULL)
769  RegCloseKey(hServiceKey);
770 
771  if (hServicesKey != NULL)
773 
774  if (ret == CR_SUCCESS)
775  *pulLength = dwUsedLength + 1;
776  else
777  *pulLength = 0;
778 
779  return ret;
780 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_READ
Definition: nt_native.h:1023
uint16_t * PWSTR
Definition: typedefs.h:54
#define DWORD
Definition: nt_native.h:44
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
#define UNICODE_NULL
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
static HANDLE hServicesKey
Definition: devinst.c:21
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CR_BUFFER_SMALL
Definition: cfgmgr32.h:872
unsigned long DWORD
Definition: ntddk_ex.h:95
HKEY hEnumKey
Definition: umpnpmgr.c:44
int ret
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
static const WCHAR szName[]
Definition: msipriv.h:1194
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define wsprintf
Definition: winuser.h:5766
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
#define CR_REGISTRY_ERROR
Definition: cfgmgr32.h:875
#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 1099 of file rpcserver.c.

1102 {
1103  HKEY hServicesKey = NULL, hServiceKey = NULL, hEnumKey = NULL;
1104  DWORD dwValues, dwMaxValueLength, dwSize;
1105  DWORD dwError;
1107 
1108  /* Open the device key */
1110  L"System\\CurrentControlSet\\Services",
1111  0,
1112  KEY_READ,
1113  &hServicesKey);
1114  if (dwError != ERROR_SUCCESS)
1115  {
1116  DPRINT("Failed to open the services key (Error %lu)\n", dwError);
1117  return CR_REGISTRY_ERROR;
1118  }
1119 
1120  dwError = RegOpenKeyExW(hServicesKey,
1121  pszService,
1122  0,
1123  KEY_READ,
1124  &hServiceKey);
1125  if (dwError != ERROR_SUCCESS)
1126  {
1127  DPRINT("Failed to open the service key (Error %lu)\n", dwError);
1129  goto Done;
1130  }
1131 
1132  dwError = RegOpenKeyExW(hServiceKey,
1133  L"Enum",
1134  0,
1135  KEY_READ,
1136  &hEnumKey);
1137  if (dwError != ERROR_SUCCESS)
1138  {
1139  DPRINT("Failed to open the service enum key (Error %lu)\n", dwError);
1141  goto Done;
1142  }
1143 
1144  /* Retrieve the number of device instances */
1145  dwSize = sizeof(DWORD);
1146  dwError = RegQueryValueExW(hEnumKey,
1147  L"Count",
1148  NULL,
1149  NULL,
1150  (LPBYTE)&dwValues,
1151  &dwSize);
1152  if (dwError != ERROR_SUCCESS)
1153  {
1154  DPRINT("RegQueryValueExW failed (Error %lu)\n", dwError);
1155  dwValues = 1;
1156  }
1157 
1158  /* Retrieve the maximum instance name length */
1159  dwError = RegQueryInfoKeyW(hEnumKey,
1160  NULL,
1161  NULL,
1162  NULL,
1163  NULL,
1164  NULL,
1165  NULL,
1166  NULL,
1167  NULL,
1168  &dwMaxValueLength,
1169  NULL,
1170  NULL);
1171  if (dwError != ERROR_SUCCESS)
1172  {
1173  DPRINT("RegQueryInfoKeyW failed (Error %lu)\n", dwError);
1174  dwMaxValueLength = MAX_DEVICE_ID_LEN;
1175  }
1176 
1177  DPRINT("dwValues %lu dwMaxValueLength %lu\n", dwValues, dwMaxValueLength / sizeof(WCHAR));
1178 
1179  /* Return the largest possible buffer size */
1180  *pulLength = dwValues * dwMaxValueLength / sizeof(WCHAR) + 2;
1181 
1182 Done:
1183  if (hEnumKey != NULL)
1185 
1186  if (hServiceKey != NULL)
1187  RegCloseKey(hServiceKey);
1188 
1189  if (hServicesKey != NULL)
1191 
1192  return ret;
1193 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_READ
Definition: nt_native.h:1023
#define MAX_DEVICE_ID_LEN
Definition: pnpmgr.c:28
#define DWORD
Definition: nt_native.h:44
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
static HANDLE hServicesKey
Definition: devinst.c:21
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
HKEY hEnumKey
Definition: umpnpmgr.c:44
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:3686
int ret
static const WCHAR L[]
Definition: oid.c:1250
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
#define CR_REGISTRY_ERROR
Definition: cfgmgr32.h:875
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by PNP_GetDeviceListSize().

◆ IsRootDeviceInstanceID()

static BOOL IsRootDeviceInstanceID ( _In_ PWSTR  pszDeviceInstanceID)
static

Definition at line 297 of file rpcserver.c.

299 {
300  if (_wcsicmp(pszDeviceInstanceID, szRootDeviceInstanceID) == 0)
301  return TRUE;
302 
303  return FALSE;
304 }
#define TRUE
Definition: types.h:120
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
static WCHAR szRootDeviceInstanceID[]
Definition: rpcserver.c:39

Referenced by PNP_CreateDevInst(), and PNP_QueryRemove().

◆ IsValidDeviceInstanceID()

static BOOL IsValidDeviceInstanceID ( _In_ PWSTR  pszDeviceInstanceID)
static

Definition at line 231 of file rpcserver.c.

233 {
234  INT nPartLength[3] = {0, 0, 0};
235  INT nLength = 0, nParts = 0;
236  PWCHAR p;
237 
238  DPRINT("IsValidDeviceInstanceID(%S)\n",
239  pszDeviceInstanceID);
240 
241  if (pszDeviceInstanceID == NULL)
242  {
243  DPRINT("Device instance ID is NULL!\n");
244  return FALSE;
245  }
246 
247  p = pszDeviceInstanceID;
248  while (*p != UNICODE_NULL)
249  {
250  if (*p == L'\\')
251  {
252  nParts++;
253  if (nParts >= 3)
254  {
255  DPRINT("Too many separators: %d\n", nParts);
256  return FALSE;
257  }
258  }
259  else
260  {
261  nPartLength[nParts]++;
262  }
263 
264  nLength++;
265  if (nLength >= MAX_DEVICE_ID_LEN)
266  {
267  DPRINT("Too long: %d\n", nLength);
268  return FALSE;
269  }
270 
271  p++;
272  }
273 
274  if (nParts != 2)
275  {
276  DPRINT("Invalid number of separtors: %d\n", nParts);
277  return FALSE;
278  }
279 
280  if ((nPartLength[0] == 0) ||
281  (nPartLength[1] == 0) ||
282  (nPartLength[2] == 0))
283  {
284  DPRINT("Invalid part lengths: %d %d %d\n",
285  nPartLength[0], nPartLength[1], nPartLength[2]);
286  return FALSE;
287  }
288 
289  DPRINT("Valid device instance ID!\n");
290 
291  return TRUE;
292 }
#define TRUE
Definition: types.h:120
_In_ DWORD nLength
Definition: wincon.h:461
#define MAX_DEVICE_ID_LEN
Definition: pnpmgr.c:28
uint16_t * PWCHAR
Definition: typedefs.h:54
int32_t INT
Definition: typedefs.h:56
#define UNICODE_NULL
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
static const WCHAR L[]
Definition: oid.c:1250
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by PNP_GetClassInstance(), PNP_GetCustomDevProp(), PNP_GetDepth(), PNP_GetDeviceRegProp(), PNP_GetDeviceStatus(), PNP_GetInterfaceDeviceList(), PNP_GetInterfaceDeviceListSize(), PNP_GetRelatedDeviceInstance(), PNP_HwProfFlags(), PNP_QueryRemove(), PNP_RequestDeviceEject(), PNP_SetDeviceRegProp(), and PNP_ValidateDeviceInstance().

◆ midl_user_allocate()

void __RPC_FAR* __RPC_USER midl_user_allocate ( SIZE_T  len)

Definition at line 108 of file rpcserver.c.

109 {
111 }
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
GLenum GLsizei len
Definition: glext.h:6722
#define HEAP_ZERO_MEMORY
Definition: compat.h:123

◆ midl_user_free()

void __RPC_USER midl_user_free ( void __RPC_FAR ptr)

Definition at line 114 of file rpcserver.c.

115 {
116  HeapFree(GetProcessHeap(), 0, ptr);
117 }
static PVOID ptr
Definition: dispmode.c:27
#define GetProcessHeap()
Definition: compat.h:403
#define HeapFree(x, y, z)
Definition: compat.h:402

◆ MoveDeviceInstance()

static CONFIGRET MoveDeviceInstance ( LPWSTR  pszDeviceInstanceDestination,
LPWSTR  pszDeviceInstanceSource 
)
static

Definition at line 2699 of file rpcserver.c.

2701 {
2702  DPRINT("MoveDeviceInstance: not implemented\n");
2703  /* FIXME */
2704  return CR_CALL_NOT_IMPLEMENTED;
2705 }
void DPRINT(...)
Definition: polytest.cpp:61
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898

Referenced by PNP_DeviceInstanceAction().

◆ NtStatusToCrError()

static CONFIGRET WINAPI NtStatusToCrError ( NTSTATUS  Status)
static

Definition at line 121 of file rpcserver.c.

122 {
123  switch (Status)
124  {
127 
129  return CR_INVALID_DATA;
130 
132  return CR_NO_SUCH_DEVINST;
133 
135  return CR_ACCESS_DENIED;
136 
138  return CR_BUFFER_SMALL;
139 
141  return CR_NO_SUCH_VALUE;
142 
143  default:
144  return CR_FAILURE;
145  }
146 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define CR_NO_SUCH_VALUE
Definition: cfgmgr32.h:883
#define CR_ACCESS_DENIED
Definition: cfgmgr32.h:897
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
#define STATUS_NO_SUCH_DEVICE
Definition: udferr_usr.h:136
#define CR_BUFFER_SMALL
Definition: cfgmgr32.h:872
#define CR_FAILURE
Definition: cfgmgr32.h:865
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
Status
Definition: gdiplustypes.h:24
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define STATUS_OBJECT_NAME_NOT_FOUND
Definition: udferr_usr.h:149
#define CR_NO_SUCH_DEVINST
Definition: cfgmgr32.h:858

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

◆ PNP_AddEmptyLogConf()

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

Definition at line 3466 of file rpcserver.c.

3472 {
3473  UNIMPLEMENTED;
3474  return CR_CALL_NOT_IMPLEMENTED;
3475 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114

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 2941 of file rpcserver.c.

2946 {
2948  HKEY hDeviceKey;
2949  LPWSTR pszSubKey;
2950  DWORD dwDeviceIdListSize;
2951  DWORD dwNewDeviceIdSize;
2952  WCHAR * pszDeviceIdList = NULL;
2953 
2955 
2956  DPRINT("PNP_AddID() called\n");
2957  DPRINT(" DeviceInstance: %S\n", pszDeviceID);
2958  DPRINT(" DeviceId: %S\n", pszID);
2959  DPRINT(" Flags: %lx\n", ulFlags);
2960 
2961  if (RegOpenKeyExW(hEnumKey,
2962  pszDeviceID,
2963  0,
2965  &hDeviceKey) != ERROR_SUCCESS)
2966  {
2967  DPRINT("Failed to open the device key!\n");
2968  return CR_INVALID_DEVNODE;
2969  }
2970 
2971  pszSubKey = (ulFlags & CM_ADD_ID_COMPATIBLE) ? L"CompatibleIDs" : L"HardwareID";
2972 
2973  if (RegQueryValueExW(hDeviceKey,
2974  pszSubKey,
2975  NULL,
2976  NULL,
2977  NULL,
2978  &dwDeviceIdListSize) != ERROR_SUCCESS)
2979  {
2980  DPRINT("Failed to query the desired ID string!\n");
2982  goto Done;
2983  }
2984 
2985  dwNewDeviceIdSize = lstrlenW(pszDeviceID);
2986  if (!dwNewDeviceIdSize)
2987  {
2989  goto Done;
2990  }
2991 
2992  dwDeviceIdListSize += (dwNewDeviceIdSize + 2) * sizeof(WCHAR);
2993 
2994  pszDeviceIdList = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwDeviceIdListSize);
2995  if (!pszDeviceIdList)
2996  {
2997  DPRINT("Failed to allocate memory for the desired ID string!\n");
2999  goto Done;
3000  }
3001 
3002  if (RegQueryValueExW(hDeviceKey,
3003  pszSubKey,
3004  NULL,
3005  NULL,
3006  (LPBYTE)pszDeviceIdList,
3007  &dwDeviceIdListSize) != ERROR_SUCCESS)
3008  {
3009  DPRINT("Failed to query the desired ID string!\n");
3011  goto Done;
3012  }
3013 
3014  /* Check whether the device ID is already in use */
3015  if (CheckForDeviceId(pszDeviceIdList, pszDeviceID))
3016  {
3017  DPRINT("Device ID was found in the ID string!\n");
3018  ret = CR_SUCCESS;
3019  goto Done;
3020  }
3021 
3022  /* Append the Device ID */
3023  AppendDeviceId(pszDeviceIdList, &dwDeviceIdListSize, pszID);
3024 
3025  if (RegSetValueExW(hDeviceKey,
3026  pszSubKey,
3027  0,
3028  REG_MULTI_SZ,
3029  (LPBYTE)pszDeviceIdList,
3030  dwDeviceIdListSize) != ERROR_SUCCESS)
3031  {
3032  DPRINT("Failed to set the desired ID string!\n");
3034  }
3035 
3036 Done:
3037  RegCloseKey(hDeviceKey);
3038  if (pszDeviceIdList)
3039  HeapFree(GetProcessHeap(), 0, pszDeviceIdList);
3040 
3041  DPRINT("PNP_AddID() done (returns %lx)\n", ret);
3042 
3043  return ret;
3044 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_SET_VALUE
Definition: nt_native.h:1017
handle_t hBinding
Definition: ctx_c.c:54
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define lstrlenW
Definition: compat.h:415
#define CM_ADD_ID_COMPATIBLE
Definition: cfgmgr32.h:615
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
#define REG_MULTI_SZ
Definition: nt_native.h:1501
static VOID AppendDeviceId(LPWSTR lpDeviceIdList, LPDWORD lpDeviceIdListSize, LPWSTR lpDeviceId)
Definition: rpcserver.c:2918
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define CR_OUT_OF_MEMORY
Definition: cfgmgr32.h:844
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:4895
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
HKEY hEnumKey
Definition: umpnpmgr.c:44
int ret
static const WCHAR L[]
Definition: oid.c:1250
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
static BOOL CheckForDeviceId(LPWSTR lpDeviceIdList, LPWSTR lpDeviceId)
Definition: rpcserver.c:2897
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:402
#define CR_REGISTRY_ERROR
Definition: cfgmgr32.h:875

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 3543 of file rpcserver.c.

3553 {
3554  UNIMPLEMENTED;
3555  return CR_CALL_NOT_IMPLEMENTED;
3556 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114

◆ PNP_ApplyPowerSettings()

DWORD WINAPI PNP_ApplyPowerSettings ( handle_t  hBinding)

Definition at line 4070 of file rpcserver.c.

4072 {
4073  UNIMPLEMENTED;
4074  return CR_CALL_NOT_IMPLEMENTED;
4075 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114

◆ PNP_Connect()

DWORD WINAPI PNP_Connect ( handle_t  hBinding)

Definition at line 323 of file rpcserver.c.

325 {
327  return CR_SUCCESS;
328 }
handle_t hBinding
Definition: ctx_c.c:54
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define CR_SUCCESS
Definition: cfgmgr32.h:842

◆ PNP_CreateDevInst()

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

Definition at line 2632 of file rpcserver.c.

2638 {
2640 
2641  DPRINT("PNP_CreateDevInst(%p %S %S %lu 0x%08lx)\n",
2642  hBinding, pszParentDeviceID, pszDeviceID, ulLength, ulFlags);
2643 
2644  if (ulFlags & ~CM_CREATE_DEVNODE_BITS)
2645  return CR_INVALID_FLAG;
2646 
2647  if (pszDeviceID == NULL || pszParentDeviceID == NULL)
2648  return CR_INVALID_POINTER;
2649 
2650  /* Fail, if the parent device is not the root device */
2651  if (!IsRootDeviceInstanceID(pszParentDeviceID))
2652  return CR_INVALID_DEVINST;
2653 
2654  if (ulFlags & CM_CREATE_DEVNODE_GENERATE_ID)
2655  {
2656  WCHAR szGeneratedInstance[MAX_DEVICE_ID_LEN];
2657  DWORD dwInstanceNumber;
2658 
2659  /* Generated ID is: Root<Device ID><Instance number> */
2660  dwInstanceNumber = 0;
2661  do
2662  {
2663  swprintf(szGeneratedInstance, L"Root\\%ls\\%04lu",
2664  pszDeviceID, dwInstanceNumber);
2665 
2666  /* Try to create a device instance with this ID */
2667  ret = CreateDeviceInstance(szGeneratedInstance);
2668 
2669  dwInstanceNumber++;
2670  }
2671  while (ret == CR_ALREADY_SUCH_DEVINST);
2672 
2673  if (ret == CR_SUCCESS)
2674  {
2675  /* pszDeviceID is an out parameter too for generated IDs */
2676  if (wcslen(szGeneratedInstance) > ulLength)
2677  {
2678  ret = CR_BUFFER_SMALL;
2679  }
2680  else
2681  {
2682  wcscpy(pszDeviceID, szGeneratedInstance);
2683  }
2684  }
2685  }
2686  else
2687  {
2688  /* Create the device instance */
2689  ret = CreateDeviceInstance(pszDeviceID);
2690  }
2691 
2692  DPRINT("PNP_CreateDevInst() done (returns %lx)\n", ret);
2693 
2694  return ret;
2695 }
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
handle_t hBinding
Definition: ctx_c.c:54
#define CM_CREATE_DEVNODE_GENERATE_ID
Definition: cfgmgr32.h:622
#define MAX_DEVICE_ID_LEN
Definition: pnpmgr.c:28
#define CR_ALREADY_SUCH_DEVINST
Definition: cfgmgr32.h:862
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define CM_CREATE_DEVNODE_BITS
Definition: cfgmgr32.h:624
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CR_BUFFER_SMALL
Definition: cfgmgr32.h:872
#define swprintf(buf, format,...)
Definition: sprintf.c:56
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL IsRootDeviceInstanceID(_In_ PWSTR pszDeviceInstanceID)
Definition: rpcserver.c:297
int ret
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
static CONFIGRET CreateDeviceInstance(LPWSTR pszDeviceID)
Definition: rpcserver.c:2524
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by CM_Create_DevNode_ExW().

◆ PNP_CreateKey()

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

Definition at line 1986 of file rpcserver.c.

1991 {
1992  HKEY hKey = 0;
1993 
1995  pszSubKey,
1996  0,
1997  NULL,
1998  0,
2000  NULL,
2001  &hKey,
2002  NULL))
2003  return CR_REGISTRY_ERROR;
2004 
2005  /* FIXME: Set security key */
2006 
2007  RegCloseKey(hKey);
2008 
2009  return CR_SUCCESS;
2010 }
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:1091
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define CR_REGISTRY_ERROR
Definition: cfgmgr32.h:875
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

◆ PNP_DeleteClassKey()

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

Definition at line 2130 of file rpcserver.c.

2134 {
2136 
2138 
2139  DPRINT("PNP_GetClassName(%S, %lx) called\n", pszClassGuid, ulFlags);
2140 
2141  if (ulFlags & CM_DELETE_CLASS_SUBKEYS)
2142  {
2143  if (SHDeleteKeyW(hClassKey, pszClassGuid) != ERROR_SUCCESS)
2145  }
2146  else
2147  {
2148  if (RegDeleteKeyW(hClassKey, pszClassGuid) != ERROR_SUCCESS)
2150  }
2151 
2152  DPRINT("PNP_DeleteClassKey() done (returns %lx)\n", ret);
2153 
2154  return ret;
2155 }
#define ERROR_SUCCESS
Definition: deptool.c:10
handle_t hBinding
Definition: ctx_c.c:54
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define CM_DELETE_CLASS_SUBKEYS
Definition: cfgmgr32.h:635
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
Definition: reg.c:1237
#define CR_SUCCESS
Definition: cfgmgr32.h:842
void DPRINT(...)
Definition: polytest.cpp:61
HKEY hClassKey
Definition: umpnpmgr.c:45
int ret
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
DWORD WINAPI SHDeleteKeyW(HKEY hKey, LPCWSTR lpszSubKey)
Definition: reg.c:1546
#define CR_REGISTRY_ERROR
Definition: cfgmgr32.h:875

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 2016 of file rpcserver.c.

2022 {
2023  UNIMPLEMENTED;
2024  return CR_CALL_NOT_IMPLEMENTED;
2025 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114

Referenced by CM_Delete_DevNode_Key_Ex().

◆ PNP_DeleteServiceDevices()

DWORD WINAPI PNP_DeleteServiceDevices ( handle_t  hBinding)

Definition at line 4127 of file rpcserver.c.

4129 {
4130  UNIMPLEMENTED;
4131  return CR_CALL_NOT_IMPLEMENTED;
4132 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114

◆ 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 3657 of file rpcserver.c.

3665 {
3666  DPRINT("PNP_DetectResourceConflict()\n");
3667 
3668  if (pbConflictDetected != NULL)
3669  *pbConflictDetected = FALSE;
3670 
3671  return CR_CALL_NOT_IMPLEMENTED;
3672 }
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898

◆ PNP_DeviceInstanceAction()

DWORD WINAPI PNP_DeviceInstanceAction ( handle_t  hBinding,
DWORD  ulAction,
DWORD  ulFlags,
LPWSTR  pszDeviceInstance1,
LPWSTR  pszDeviceInstance2 
)

Definition at line 2782 of file rpcserver.c.

2788 {
2790 
2792 
2793  DPRINT("PNP_DeviceInstanceAction() called\n");
2794 
2795  switch (ulAction)
2796  {
2797  case PNP_DEVINST_MOVE:
2798  ret = MoveDeviceInstance(pszDeviceInstance1,
2799  pszDeviceInstance2);
2800  break;
2801 
2802  case PNP_DEVINST_SETUP:
2803  ret = SetupDeviceInstance(pszDeviceInstance1,
2804  ulFlags);
2805  break;
2806 
2807  case PNP_DEVINST_ENABLE:
2808  ret = EnableDeviceInstance(pszDeviceInstance1);
2809  break;
2810 
2811  case PNP_DEVINST_DISABLE:
2812  ret = DisableDeviceInstance(pszDeviceInstance1);
2813  break;
2814 
2815  case PNP_DEVINST_REENUMERATE:
2816  ret = ReenumerateDeviceInstance(pszDeviceInstance1,
2817  ulFlags);
2818  break;
2819 
2820  default:
2821  DPRINT1("Unknown device action %lu: not implemented\n", ulAction);
2823  }
2824 
2825  DPRINT("PNP_DeviceInstanceAction() done (returns %lx)\n", ret);
2826 
2827  return ret;
2828 }
static CONFIGRET EnableDeviceInstance(LPWSTR pszDeviceInstance)
Definition: rpcserver.c:2719
handle_t hBinding
Definition: ctx_c.c:54
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
static CONFIGRET ReenumerateDeviceInstance(_In_ LPWSTR pszDeviceInstance, _In_ ULONG ulFlags)
Definition: rpcserver.c:2746
#define CR_SUCCESS
Definition: cfgmgr32.h:842
void DPRINT(...)
Definition: polytest.cpp:61
static CONFIGRET SetupDeviceInstance(LPWSTR pszDeviceInstance, DWORD ulFlags)
Definition: rpcserver.c:2709
static CONFIGRET DisableDeviceInstance(LPWSTR pszDeviceInstance)
Definition: rpcserver.c:2737
int ret
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define DPRINT1
Definition: precomp.h:8
static CONFIGRET MoveDeviceInstance(LPWSTR pszDeviceInstanceDestination, LPWSTR pszDeviceInstanceSource)
Definition: rpcserver.c:2699

Referenced by CM_Disable_DevNode_Ex(), 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 2871 of file rpcserver.c.

2878 {
2879  UNIMPLEMENTED;
2880  return CR_CALL_NOT_IMPLEMENTED;
2881 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114

◆ PNP_Disconnect()

DWORD WINAPI PNP_Disconnect ( handle_t  hBinding)

Definition at line 312 of file rpcserver.c.

314 {
316  return CR_SUCCESS;
317 }
handle_t hBinding
Definition: ctx_c.c:54
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define CR_SUCCESS
Definition: cfgmgr32.h:842

◆ PNP_DriverStoreAddDriverPackage()

DWORD WINAPI PNP_DriverStoreAddDriverPackage ( handle_t  hBinding)

Definition at line 4081 of file rpcserver.c.

4083 {
4084  UNIMPLEMENTED;
4085  return CR_CALL_NOT_IMPLEMENTED;
4086 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114

◆ PNP_DriverStoreDeleteDriverPackage()

DWORD WINAPI PNP_DriverStoreDeleteDriverPackage ( handle_t  hBinding)

Definition at line 4092 of file rpcserver.c.

4094 {
4095  UNIMPLEMENTED;
4096  return CR_CALL_NOT_IMPLEMENTED;
4097 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114

◆ 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 557 of file rpcserver.c.

565 {
567  HKEY hKey;
568  DWORD dwError;
569 
571  UNREFERENCED_PARAMETER(ulFlags);
572 
573  DPRINT("PNP_EnumerateSubKeys() called\n");
574 
575  switch (ulBranch)
576  {
577  case PNP_ENUMERATOR_SUBKEYS:
578  hKey = hEnumKey;
579  break;
580 
581  case PNP_CLASS_SUBKEYS:
582  hKey = hClassKey;
583  break;
584 
585  default:
586  return CR_FAILURE;
587  }
588 
589  *pulRequiredLen = ulLength;
590  dwError = RegEnumKeyExW(hKey,
591  ulIndex,
592  Buffer,
593  pulRequiredLen,
594  NULL,
595  NULL,
596  NULL,
597  NULL);
598  if (dwError != ERROR_SUCCESS)
599  {
601  }
602  else
603  {
604  (*pulRequiredLen)++;
605  }
606 
607  DPRINT("PNP_EnumerateSubKeys() done (returns %lx)\n", ret);
608 
609  return ret;
610 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:95
handle_t hBinding
Definition: ctx_c.c:54
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define CR_NO_SUCH_VALUE
Definition: cfgmgr32.h:883
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
HKEY hClassKey
Definition: umpnpmgr.c:45
Definition: bufpool.h:45
#define CR_FAILURE
Definition: cfgmgr32.h:865
unsigned long DWORD
Definition: ntddk_ex.h:95
HKEY hEnumKey
Definition: umpnpmgr.c:44
int ret
ULONG ulIndex
Definition: symbols.c:92
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
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:2527

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 3481 of file rpcserver.c.

3487 {
3488  UNIMPLEMENTED;
3489  return CR_CALL_NOT_IMPLEMENTED;
3490 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114

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 3562 of file rpcserver.c.

3572 {
3573  UNIMPLEMENTED;
3574  return CR_CALL_NOT_IMPLEMENTED;
3575 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114

◆ 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 3961 of file rpcserver.c.

3967 {
3968  UNIMPLEMENTED;
3969  return CR_CALL_NOT_IMPLEMENTED;
3970 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114

Referenced by CMP_GetBlockedDriverInfo().

◆ PNP_GetClassCount()

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

Definition at line 2031 of file rpcserver.c.

2035 {
2036  HKEY hKey;
2037  DWORD dwError;
2038 
2040  UNREFERENCED_PARAMETER(ulFlags);
2041 
2044  0,
2046  &hKey);
2047  if (dwError != ERROR_SUCCESS)
2048  return CR_INVALID_DATA;
2049 
2050  dwError = RegQueryInfoKeyW(hKey,
2051  NULL,
2052  NULL,
2053  NULL,
2054  pulClassCount,
2055  NULL,
2056  NULL,
2057  NULL,
2058  NULL,
2059  NULL,
2060  NULL,
2061  NULL);
2062  RegCloseKey(hKey);
2063  if (dwError != ERROR_SUCCESS)
2064  return CR_INVALID_DATA;
2065 
2066  return CR_SUCCESS;
2067 }
#define ERROR_SUCCESS
Definition: deptool.c:10
handle_t hBinding
Definition: ctx_c.c:54
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
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:3686
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define REGSTR_PATH_CLASS
Definition: regstr.h:42
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

◆ PNP_GetClassInstance()

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

Definition at line 1870 of file rpcserver.c.

1875 {
1876  WCHAR szClassGuid[40];
1877  WCHAR szClassInstance[5];
1878  HKEY hDeviceClassKey = NULL;
1879  HKEY hClassInstanceKey;
1880  ULONG ulTransferLength, ulDataLength;
1881  DWORD dwDataType, dwDisposition, i;
1882  DWORD dwError;
1884 
1885  DPRINT("PNP_GetClassInstance(%p %S %p %lu)\n",
1886  hBinding, pDeviceId, pszClassInstance, ulLength);
1887 
1888  if (!IsValidDeviceInstanceID(pDeviceId))
1889  return CR_INVALID_DEVINST;
1890 
1891  ulTransferLength = ulLength;
1893  pDeviceId,
1894  CM_DRP_DRIVER,
1895  &dwDataType,
1896  (BYTE *)pszClassInstance,
1897  &ulTransferLength,
1898  &ulLength,
1899  0);
1900  if (ret == CR_SUCCESS)
1901  return ret;
1902 
1903  ulTransferLength = sizeof(szClassGuid);
1904  ulDataLength = sizeof(szClassGuid);
1906  pDeviceId,
1908  &dwDataType,
1909  (BYTE *)szClassGuid,
1910  &ulTransferLength,
1911  &ulDataLength,
1912  0);
1913  if (ret != CR_SUCCESS)
1914  {
1915  DPRINT1("PNP_GetDeviceRegProp() failed (Error %lu)\n", ret);
1916  goto done;
1917  }
1918 
1919  dwError = RegOpenKeyExW(hClassKey,
1920  szClassGuid,
1921  0,
1922  KEY_READ,
1923  &hDeviceClassKey);
1924  if (dwError != ERROR_SUCCESS)
1925  {
1926  DPRINT1("RegOpenKeyExW() failed (Error %lu)\n", dwError);
1927  ret = CR_FAILURE;
1928  goto done;
1929  }
1930 
1931  for (i = 0; i < 10000; i++)
1932  {
1933  wsprintf(szClassInstance, L"%04lu", i);
1934 
1935  dwError = RegCreateKeyExW(hDeviceClassKey,
1936  szClassInstance,
1937  0,
1938  NULL,
1941  NULL,
1942  &hClassInstanceKey,
1943  &dwDisposition);
1944  if (dwError == ERROR_SUCCESS)
1945  {
1946  RegCloseKey(hClassInstanceKey);
1947 
1948  if (dwDisposition == REG_CREATED_NEW_KEY)
1949  {
1950  wsprintf(pszClassInstance,
1951  L"%s\\%s",
1952  szClassGuid,
1953  szClassInstance);
1954 
1955  ulDataLength = (wcslen(pszClassInstance) + 1) * sizeof(WCHAR);
1957  pDeviceId,
1958  CM_DRP_DRIVER,
1959  REG_SZ,
1960  (BYTE *)pszClassInstance,
1961  ulDataLength,
1962  0);
1963  if (ret != CR_SUCCESS)
1964  {
1965  DPRINT1("PNP_SetDeviceRegProp() failed (Error %lu)\n", ret);
1966  RegDeleteKeyW(hDeviceClassKey,
1967  szClassInstance);
1968  }
1969 
1970  break;
1971  }
1972  }
1973  }
1974 
1975 done:
1976  if (hDeviceClassKey != NULL)
1977  RegCloseKey(hDeviceClassKey);
1978 
1979  return ret;
1980 }
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
#define ERROR_SUCCESS
Definition: deptool.c:10
handle_t hBinding
Definition: ctx_c.c:54
#define KEY_READ
Definition: nt_native.h:1023
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
Definition: reg.c:1237
static BOOL IsValidDeviceInstanceID(_In_ PWSTR pszDeviceInstanceID)
Definition: rpcserver.c:231
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:1091
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:1463
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
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
#define CM_DRP_CLASSGUID
Definition: cfgmgr32.h:684
void DPRINT(...)
Definition: polytest.cpp:61
HKEY hClassKey
Definition: umpnpmgr.c:45
#define REG_CREATED_NEW_KEY
Definition: nt_native.h:1084
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CR_FAILURE
Definition: cfgmgr32.h:865
unsigned long DWORD
Definition: ntddk_ex.h:95
#define CM_DRP_DRIVER
Definition: cfgmgr32.h:685
int ret
static const WCHAR L[]
Definition: oid.c:1250
unsigned char BYTE
Definition: mem.h:68
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define DPRINT1
Definition: precomp.h:8
unsigned int ULONG
Definition: retypes.h:1
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define wsprintf
Definition: winuser.h:5766
DWORD WINAPI PNP_SetDeviceRegProp(handle_t hBinding, LPWSTR pDeviceId, DWORD ulProperty, DWORD ulDataType, BYTE *Buffer, PNP_PROP_SIZE ulLength, DWORD ulFlags)
Definition: rpcserver.c:1725
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define REG_SZ
Definition: layer.c:22

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 2073 of file rpcserver.c.

2079 {
2080  WCHAR szKeyName[MAX_PATH];
2082  HKEY hKey;
2083  DWORD dwSize;
2084 
2086  UNREFERENCED_PARAMETER(ulFlags);
2087 
2088  DPRINT("PNP_GetClassName() called\n");
2089 
2090  lstrcpyW(szKeyName, L"System\\CurrentControlSet\\Control\\Class\\");
2091  if (lstrlenW(pszClassGuid) + 1 < sizeof(szKeyName)/sizeof(WCHAR)-(lstrlenW(szKeyName) * sizeof(WCHAR)))
2092  lstrcatW(szKeyName, pszClassGuid);
2093  else
2094  return CR_INVALID_DATA;
2095 
2097  szKeyName,
2098  0,
2100  &hKey))
2101  return CR_REGISTRY_ERROR;
2102 
2103  dwSize = *pulLength * sizeof(WCHAR);
2104  if (RegQueryValueExW(hKey,
2105  L"Class",
2106  NULL,
2107  NULL,
2108  (LPBYTE)Buffer,
2109  &dwSize))
2110  {
2111  *pulLength = 0;
2113  }
2114  else
2115  {
2116  *pulLength = dwSize / sizeof(WCHAR);
2117  }
2118 
2119  RegCloseKey(hKey);
2120 
2121  DPRINT("PNP_GetClassName() done (returns %lx)\n", ret);
2122 
2123  return ret;
2124 }
handle_t hBinding
Definition: ctx_c.c:54
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define lstrlenW
Definition: compat.h:415
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
Definition: bufpool.h:45
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
int ret
static const WCHAR L[]
Definition: oid.c:1250
#define lstrcpyW
Definition: compat.h:414
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
#define CR_REGISTRY_ERROR
Definition: cfgmgr32.h:875
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

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 2300 of file rpcserver.c.

2309 {
2311  LPWSTR lpValueName = NULL;
2312  HKEY hInstKey = NULL;
2313  HKEY hPropKey = NULL;
2314  LONG lError;
2315 
2317 
2318  DPRINT("PNP_GetClassRegProp() called\n");
2319 
2320  if (pulTransferLen == NULL || pulLength == NULL)
2321  {
2323  goto done;
2324  }
2325 
2326  if (ulFlags != 0)
2327  {
2328  ret = CR_INVALID_FLAG;
2329  goto done;
2330  }
2331 
2332  if (*pulLength < *pulTransferLen)
2333  *pulLength = *pulTransferLen;
2334 
2335  *pulTransferLen = 0;
2336 
2337  switch (ulProperty)
2338  {
2339  case CM_CRP_SECURITY:
2340  lpValueName = L"Security";
2341  break;
2342 
2343  case CM_CRP_DEVTYPE:
2344  lpValueName = L"DeviceType";
2345  break;
2346 
2347  case CM_CRP_EXCLUSIVE:
2348  lpValueName = L"Exclusive";
2349  break;
2350 
2352  lpValueName = L"DeviceCharacteristics";
2353  break;
2354 
2355  default:
2357  goto done;
2358  }
2359 
2360  DPRINT("Value name: %S\n", lpValueName);
2361 
2362  lError = RegOpenKeyExW(hClassKey,
2363  pszClassGuid,
2364  0,
2365  KEY_READ,
2366  &hInstKey);
2367  if (lError != ERROR_SUCCESS)
2368  {
2369  *pulLength = 0;
2371  goto done;
2372  }
2373 
2374  lError = RegOpenKeyExW(hInstKey,
2375  L"Properties",
2376  0,
2377  KEY_READ,
2378  &hPropKey);
2379  if (lError != ERROR_SUCCESS)
2380  {
2381  *pulLength = 0;
2383  goto done;
2384  }
2385 
2386  lError = RegQueryValueExW(hPropKey,
2387  lpValueName,
2388  NULL,
2389  pulRegDataType,
2390  Buffer,
2391  pulLength);
2392  if (lError != ERROR_SUCCESS)
2393  {
2394  if (lError == ERROR_MORE_DATA)
2395  {
2396  ret = CR_BUFFER_SMALL;
2397  }
2398  else
2399  {
2400  *pulLength = 0;
2402  }
2403  }
2404 
2405 done:
2406  if (ret == CR_SUCCESS)
2407  *pulTransferLen = *pulLength;
2408 
2409  if (hPropKey != NULL)
2410  RegCloseKey(hPropKey);
2411 
2412  if (hInstKey != NULL)
2413  RegCloseKey(hInstKey);
2414 
2415  DPRINT("PNP_GetClassRegProp() done (returns %lx)\n", ret);
2416 
2417  return ret;
2418 }
#define CR_NO_SUCH_REGISTRY_KEY
Definition: cfgmgr32.h:892
#define ERROR_SUCCESS
Definition: deptool.c:10
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
handle_t hBinding
Definition: ctx_c.c:54
#define KEY_READ
Definition: nt_native.h:1023
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define CM_CRP_DEVTYPE
Definition: cfgmgr32.h:710
#define CR_NO_SUCH_VALUE
Definition: cfgmgr32.h:883
#define CM_CRP_CHARACTERISTICS
Definition: cfgmgr32.h:714
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
#define CM_CRP_EXCLUSIVE
Definition: cfgmgr32.h:712
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
#define CR_INVALID_PROPERTY
Definition: cfgmgr32.h:899
void DPRINT(...)
Definition: polytest.cpp:61
HKEY hClassKey
Definition: umpnpmgr.c:45
Definition: bufpool.h:45
#define CM_CRP_SECURITY
Definition: cfgmgr32.h:706
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
#define CR_BUFFER_SMALL
Definition: cfgmgr32.h:872
int ret
static const WCHAR L[]
Definition: oid.c:1250
#define ERROR_MORE_DATA
Definition: dderror.h:13
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
WCHAR * LPWSTR
Definition: xmlstorage.h:184

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 3848 of file rpcserver.c.

3857 {
3858  HKEY hDeviceKey = NULL;
3859  HKEY hParamKey = NULL;
3860  LONG lError;
3862 
3864 
3865  DPRINT("PNP_GetCustomDevProp() called\n");
3866 
3867  if (pulTransferLen == NULL || pulLength == NULL)
3868  {
3870  goto done;
3871  }
3872 
3873  if (ulFlags & ~CM_CUSTOMDEVPROP_BITS)
3874  {
3875  ret = CR_INVALID_FLAG;
3876  goto done;
3877  }
3878 
3879  if (!IsValidDeviceInstanceID(pDeviceID))
3880  return CR_INVALID_DEVINST;
3881 
3882  if (*pulLength < *pulTransferLen)
3883  *pulLength = *pulTransferLen;
3884 
3885  *pulTransferLen = 0;
3886 
3887  lError = RegOpenKeyExW(hEnumKey,
3888  pDeviceID,
3889  0,
3890  KEY_READ,
3891  &hDeviceKey);
3892  if (lError != ERROR_SUCCESS)
3893  {
3895  goto done;
3896  }
3897 
3898  lError = RegOpenKeyExW(hDeviceKey,
3899  L"Device Parameters",
3900  0,
3901  KEY_READ,
3902  &hParamKey);
3903  if (lError != ERROR_SUCCESS)
3904  {
3906  goto done;
3907  }
3908 
3909  lError = RegQueryValueExW(hParamKey,
3910  CustomPropName,
3911  NULL,
3912  pulRegDataType,
3913  Buffer,
3914  pulLength);
3915  if (lError != ERROR_SUCCESS)
3916  {
3917  if (lError == ERROR_MORE_DATA)
3918  {
3919  ret = CR_BUFFER_SMALL;
3920  }
3921  else
3922  {
3923  *pulLength = 0;
3925  }
3926  }
3927 
3928 done:
3929  if (ret == CR_SUCCESS)
3930  *pulTransferLen = *pulLength;
3931 
3932  if (hParamKey != NULL)
3933  RegCloseKey(hParamKey);
3934 
3935  if (hDeviceKey != NULL)
3936  RegCloseKey(hDeviceKey);
3937 
3938  DPRINT("PNP_GetCustomDevProp() done (returns %lx)\n", ret);
3939 
3940  return ret;
3941 }
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
#define ERROR_SUCCESS
Definition: deptool.c:10
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
handle_t hBinding
Definition: ctx_c.c:54
#define KEY_READ
Definition: nt_native.h:1023
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
static BOOL IsValidDeviceInstanceID(_In_ PWSTR pszDeviceInstanceID)
Definition: rpcserver.c:231
#define CR_NO_SUCH_VALUE
Definition: cfgmgr32.h:883
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
Definition: bufpool.h:45
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
#define CR_BUFFER_SMALL
Definition: cfgmgr32.h:872
HKEY hEnumKey
Definition: umpnpmgr.c:44
int ret
static const WCHAR L[]
Definition: oid.c:1250
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define CM_CUSTOMDEVPROP_BITS
Definition: cfgmgr32.h:836
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define CR_REGISTRY_ERROR
Definition: cfgmgr32.h:875

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 1421 of file rpcserver.c.

1426 {
1427  PLUGPLAY_CONTROL_DEPTH_DATA PlugPlayData;
1429  NTSTATUS Status;
1430 
1432  UNREFERENCED_PARAMETER(ulFlags);
1433 
1434  DPRINT("PNP_GetDepth() called\n");
1435 
1436  if (!IsValidDeviceInstanceID(pszDeviceID))
1437  return CR_INVALID_DEVINST;
1438 
1439  RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
1440  pszDeviceID);
1441 
1443  (PVOID)&PlugPlayData,
1444  sizeof(PLUGPLAY_CONTROL_DEPTH_DATA));
1445  if (NT_SUCCESS(Status))
1446  {
1447  *pulDepth = PlugPlayData.Depth;
1448  }
1449  else
1450  {
1452  }
1453 
1454  DPRINT("PNP_GetDepth() done (returns %lx)\n", ret);
1455 
1456  return ret;
1457 }
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
handle_t hBinding
Definition: ctx_c.c:54
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
LONG NTSTATUS
Definition: precomp.h:26
static BOOL IsValidDeviceInstanceID(_In_ PWSTR pszDeviceInstanceID)
Definition: rpcserver.c:231
static CONFIGRET WINAPI NtStatusToCrError(NTSTATUS Status)
Definition: rpcserver.c:121
#define CR_SUCCESS
Definition: cfgmgr32.h:842
void DPRINT(...)
Definition: polytest.cpp:61
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
int ret
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI NtPlugPlayControl(IN PLUGPLAY_CONTROL_CLASS PlugPlayControlClass, IN OUT PVOID Buffer, IN ULONG BufferLength)
Definition: plugplay.c:1299
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
UNICODE_STRING DeviceInstance
Definition: cmtypes.h:515

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 976 of file rpcserver.c.

982 {
983  WCHAR szEnumerator[MAX_DEVICE_ID_LEN];
984  WCHAR szDevice[MAX_DEVICE_ID_LEN];
985  WCHAR szInstance[MAX_DEVICE_ID_LEN];
987 
988  DPRINT("PNP_GetDeviceList() called\n");
989 
990  if (ulFlags & ~CM_GETIDLIST_FILTER_BITS)
991  return CR_INVALID_FLAG;
992 
993  if (pulLength == NULL)
994  return CR_INVALID_POINTER;
995 
996  if ((ulFlags != CM_GETIDLIST_FILTER_NONE) &&
997  (pszFilter == NULL))
998  return CR_INVALID_POINTER;
999 
1000  if (ulFlags &
1005  {
1006  ret = GetRelationsInstanceList(pszFilter,
1007  ulFlags,
1008  Buffer,
1009  pulLength);
1010  }
1011  else if (ulFlags & CM_GETIDLIST_FILTER_SERVICE)
1012  {
1013  ret = GetServiceInstanceList(pszFilter,
1014  Buffer,
1015  pulLength);
1016  }
1017  else if (ulFlags & CM_GETIDLIST_FILTER_ENUMERATOR)
1018  {
1019  SplitDeviceInstanceID(pszFilter,
1020  szEnumerator,
1021  szDevice,
1022  szInstance);
1023 
1024  if (*szEnumerator != UNICODE_NULL && *szDevice != UNICODE_NULL)
1025  {
1026  ret = GetDeviceInstanceList(pszFilter,
1027  Buffer,
1028  pulLength);
1029  }
1030  else
1031  {
1032  ret = GetEnumeratorInstanceList(pszFilter,
1033  Buffer,
1034  pulLength);
1035  }
1036  }
1037  else /* CM_GETIDLIST_FILTER_NONE */
1038  {
1040  pulLength);
1041  }
1042 
1043  return ret;
1044 }
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
static VOID SplitDeviceInstanceID(IN LPWSTR pszDeviceInstanceID, OUT LPWSTR pszEnumerator, OUT LPWSTR pszDevice, OUT LPWSTR pszInstance)
Definition: rpcserver.c:150
#define CM_GETIDLIST_FILTER_NONE
Definition: cfgmgr32.h:654
static CONFIGRET GetAllInstanceList(_Inout_ PWSTR pszBuffer, _Inout_ PDWORD pulLength)
Definition: rpcserver.c:927
#define CM_GETIDLIST_FILTER_SERVICE
Definition: cfgmgr32.h:656
#define MAX_DEVICE_ID_LEN
Definition: pnpmgr.c:28
CONFIGRET GetEnumeratorInstanceList(_In_ PWSTR pszEnumerator, _Inout_ PWSTR pszBuffer, _Inout_ PDWORD pulLength)
Definition: rpcserver.c:856
#define CM_GETIDLIST_FILTER_BUSRELATIONS
Definition: cfgmgr32.h:660
#define CM_GETIDLIST_FILTER_EJECTRELATIONS
Definition: cfgmgr32.h:657
#define UNICODE_NULL
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
Definition: bufpool.h:45
#define CM_GETIDLIST_FILTER_REMOVALRELATIONS
Definition: cfgmgr32.h:658
__wchar_t WCHAR
Definition: xmlstorage.h:180
static CONFIGRET GetDeviceInstanceList(_In_ PWSTR pszDevice, _Inout_ PWSTR pszBuffer, _Inout_ PDWORD pulLength)
Definition: rpcserver.c:785
#define CM_GETIDLIST_FILTER_POWERRELATIONS
Definition: cfgmgr32.h:659
int ret
#define CM_GETIDLIST_FILTER_ENUMERATOR
Definition: cfgmgr32.h:655
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
static CONFIGRET GetServiceInstanceList(_In_ PWSTR pszService, _Inout_ PWSTR pszBuffer, _Inout_ PDWORD pulLength)
Definition: rpcserver.c:666
#define CM_GETIDLIST_FILTER_BITS
Definition: cfgmgr32.h:669
static CONFIGRET GetRelationsInstanceList(_In_ PWSTR pszDevice, _In_ DWORD ulFlags, _Inout_ PWSTR pszBuffer, _Inout_ PDWORD pulLength)
Definition: rpcserver.c:615

Referenced by CM_Get_Device_ID_List_ExW().

◆ PNP_GetDeviceListSize()

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

Definition at line 1346 of file rpcserver.c.

1351 {
1352  WCHAR szEnumerator[MAX_DEVICE_ID_LEN];
1353  WCHAR szDevice[MAX_DEVICE_ID_LEN];
1354  WCHAR szInstance[MAX_DEVICE_ID_LEN];
1356 
1357  DPRINT("PNP_GetDeviceListSize(%p %S %p 0x%lx)\n",
1358  hBinding, pszFilter, pulLength, ulFlags);
1359 
1360  if (ulFlags & ~CM_GETIDLIST_FILTER_BITS)
1361  return CR_INVALID_FLAG;
1362 
1363  if (pulLength == NULL)
1364  return CR_INVALID_POINTER;
1365 
1366  if ((ulFlags != CM_GETIDLIST_FILTER_NONE) &&
1367  (pszFilter == NULL))
1368  return CR_INVALID_POINTER;
1369 
1370  *pulLength = 0;
1371 
1372  if (ulFlags &
1377  {
1378  ret = GetRelationsInstanceListSize(pszFilter,
1379  ulFlags,
1380  pulLength);
1381  }
1382  else if (ulFlags & CM_GETIDLIST_FILTER_SERVICE)
1383  {
1384  ret = GetServiceInstanceListSize(pszFilter,
1385  pulLength);
1386  }
1387  else if (ulFlags & CM_GETIDLIST_FILTER_ENUMERATOR)
1388  {
1389  SplitDeviceInstanceID(pszFilter,
1390  szEnumerator,
1391  szDevice,
1392  szInstance);
1393 
1394  if (*szEnumerator != UNICODE_NULL && *szDevice != UNICODE_NULL)
1395  {
1396  ret = GetDeviceInstanceListSize(pszFilter,
1397  pulLength);
1398  }
1399  else
1400  {
1401  ret = GetEnumeratorInstanceListSize(pszFilter,
1402  pulLength);
1403  }
1404  }
1405  else /* CM_GETIDLIST_FILTER_NONE */
1406  {
1407  ret = GetAllInstanceListSize(pulLength);
1408  }
1409 
1410  /* Add one character for the terminating double UNICODE_NULL */
1411  if (ret == CR_SUCCESS)
1412  (*pulLength) += 1;
1413 
1414  return ret;
1415 }
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
handle_t hBinding
Definition: ctx_c.c:54
static VOID SplitDeviceInstanceID(IN LPWSTR pszDeviceInstanceID, OUT LPWSTR pszEnumerator, OUT LPWSTR pszDevice, OUT LPWSTR pszInstance)
Definition: rpcserver.c:150
#define CM_GETIDLIST_FILTER_NONE
Definition: cfgmgr32.h:654
static CONFIGRET GetServiceInstanceListSize(_In_ PWSTR pszService, _Out_ PDWORD pulLength)
Definition: rpcserver.c:1099
#define CM_GETIDLIST_FILTER_SERVICE
Definition: cfgmgr32.h:656
static CONFIGRET GetAllInstanceListSize(_Out_ PULONG pulLength)
Definition: rpcserver.c:1311
#define MAX_DEVICE_ID_LEN
Definition: pnpmgr.c:28
static CONFIGRET GetDeviceInstanceListSize(_In_ LPCWSTR pszDevice, _Out_ PULONG pulLength)
Definition: rpcserver.c:1198
#define CM_GETIDLIST_FILTER_BUSRELATIONS
Definition: cfgmgr32.h:660
#define CM_GETIDLIST_FILTER_EJECTRELATIONS
Definition: cfgmgr32.h:657
#define UNICODE_NULL
#define CR_SUCCESS
Definition: cfgmgr32.h:842
static CONFIGRET GetRelationsInstanceListSize(_In_ PWSTR pszDevice, _In_ DWORD ulFlags, _Inout_ PDWORD pulLength)
Definition: rpcserver.c:1049
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define CM_GETIDLIST_FILTER_REMOVALRELATIONS
Definition: cfgmgr32.h:658
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CM_GETIDLIST_FILTER_POWERRELATIONS
Definition: cfgmgr32.h:659
int ret
static CONFIGRET GetEnumeratorInstanceListSize(_In_ LPCWSTR pszEnumerator, _Out_ PULONG pulLength)
Definition: rpcserver.c:1250
#define CM_GETIDLIST_FILTER_ENUMERATOR
Definition: cfgmgr32.h:655
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
#define CM_GETIDLIST_FILTER_BITS
Definition: cfgmgr32.h:669

Referenced by CM_Get_Device_ID_List_Size_ExW().

◆ 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 1463 of file rpcserver.c.

1472 {
1473  PLUGPLAY_CONTROL_PROPERTY_DATA PlugPlayData;
1475  LPWSTR lpValueName = NULL;
1476  HKEY hKey = NULL;
1477  LONG lError;
1478  NTSTATUS Status;
1479 
1481 
1482  DPRINT("PNP_GetDeviceRegProp() called\n");
1483 
1484  if (pulTransferLen == NULL || pulLength == NULL)
1485  {
1487  goto done;
1488  }
1489 
1490  if (ulFlags != 0)
1491  {
1492  ret = CR_INVALID_FLAG;
1493  goto done;
1494  }
1495 
1496  /* Check pDeviceID */
1497  if (!IsValidDeviceInstanceID(pDeviceID))
1498  {
1500  goto done;
1501  }
1502 
1503  if (*pulLength < *pulTransferLen)
1504  *pulLength = *pulTransferLen;
1505 
1506  *pulTransferLen = 0;
1507 
1508  switch (ulProperty)
1509  {
1510  case CM_DRP_DEVICEDESC:
1511  lpValueName = L"DeviceDesc";
1512  break;
1513 
1514  case CM_DRP_HARDWAREID:
1515  lpValueName = L"HardwareID";
1516  break;
1517 
1518  case CM_DRP_COMPATIBLEIDS:
1519  lpValueName = L"CompatibleIDs";
1520  break;
1521 
1522  case CM_DRP_SERVICE:
1523  lpValueName = L"Service";
1524  break;
1525 
1526  case CM_DRP_CLASS:
1527  lpValueName = L"Class";
1528  break;
1529 
1530  case CM_DRP_CLASSGUID:
1531  lpValueName = L"ClassGUID";
1532  break;
1533 
1534  case CM_DRP_DRIVER:
1535  lpValueName = L"Driver";
1536  break;
1537 
1538  case CM_DRP_CONFIGFLAGS:
1539  lpValueName = L"ConfigFlags";
1540  break;
1541 
1542  case CM_DRP_MFG:
1543  lpValueName = L"Mfg";
1544  break;
1545 
1546  case CM_DRP_FRIENDLYNAME:
1547  lpValueName = L"FriendlyName";
1548  break;
1549 
1551  lpValueName = L"LocationInformation";
1552  break;
1553 
1556  break;
1557 
1558  case CM_DRP_CAPABILITIES:
1559  lpValueName = L"Capabilities";
1560  break;
1561 
1562  case CM_DRP_UI_NUMBER:
1563  PlugPlayData.Property = PNP_PROPERTY_UI_NUMBER;
1564  break;
1565 
1566  case CM_DRP_UPPERFILTERS:
1567  lpValueName = L"UpperFilters";
1568  break;
1569 
1570  case CM_DRP_LOWERFILTERS:
1571  lpValueName = L"LowerFilters";
1572  break;
1573 
1574  case CM_DRP_BUSTYPEGUID:
1575  PlugPlayData.Property = PNP_PROPERTY_BUSTYPEGUID;
1576  break;
1577 
1578  case CM_DRP_LEGACYBUSTYPE:
1579  PlugPlayData.Property = PNP_PROPERTY_LEGACYBUSTYPE;
1580  break;
1581 
1582  case CM_DRP_BUSNUMBER:
1583  PlugPlayData.Property = PNP_PROPERTY_BUSNUMBER;
1584  break;
1585 
1587  PlugPlayData.Property = PNP_PROPERTY_ENUMERATOR_NAME;
1588  break;
1589 
1590  case CM_DRP_SECURITY:
1591  lpValueName = L"Security";
1592  break;
1593 
1594  case CM_DRP_DEVTYPE:
1595  lpValueName = L"DeviceType";
1596  break;
1597 
1598  case CM_DRP_EXCLUSIVE:
1599  lpValueName = L"Exclusive";
1600  break;
1601 
1603  lpValueName = L"DeviceCharacteristics";
1604  break;
1605 
1606  case CM_DRP_ADDRESS:
1607  PlugPlayData.Property = PNP_PROPERTY_ADDRESS;
1608  break;
1609 
1611  lpValueName = L"UINumberDescFormat";
1612  break;
1613 
1615  PlugPlayData.Property = PNP_PROPERTY_POWER_DATA;
1616  break;
1617 
1618  case CM_DRP_REMOVAL_POLICY:
1619  PlugPlayData.Property = PNP_PROPERTY_REMOVAL_POLICY;
1620  break;
1621 
1624  break;
1625 
1627  lpValueName = L"RemovalPolicy";
1628  break;
1629 
1630  case CM_DRP_INSTALL_STATE:
1631  PlugPlayData.Property = PNP_PROPERTY_INSTALL_STATE;
1632  break;
1633 
1634 #if (WINVER >= _WIN32_WINNT_WS03)
1635  case CM_DRP_LOCATION_PATHS:
1636  PlugPlayData.Property = PNP_PROPERTY_LOCATION_PATHS;
1637  break;
1638 #endif
1639 
1640 #if (WINVER >= _WIN32_WINNT_WIN7)
1642  PlugPlayData.Property = PNP_PROPERTY_CONTAINERID;
1643  break;
1644 #endif
1645 
1646  default:
1648  goto done;
1649  }
1650 
1651  DPRINT("Value name: %S\n", lpValueName);
1652 
1653  if (lpValueName)
1654  {
1655  /* Retrieve information from the Registry */
1656  lError = RegOpenKeyExW(hEnumKey,
1657  pDeviceID,
1658  0,
1660  &hKey);
1661  if (lError != ERROR_SUCCESS)
1662  {
1663  hKey = NULL;
1664  *pulLength = 0;
1666  goto done;
1667  }
1668 
1669  lError = RegQueryValueExW(hKey,
1670  lpValueName,
1671  NULL,
1672  pulRegDataType,
1673  Buffer,
1674  pulLength);
1675  if (lError != ERROR_SUCCESS)
1676  {
1677  if (lError == ERROR_MORE_DATA)
1678  {
1679  ret = CR_BUFFER_SMALL;
1680  }
1681  else
1682  {
1683  *pulLength = 0;
1685  }
1686  }
1687  }
1688  else
1689  {
1690  /* Retrieve information from the Device Node */
1691  RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
1692  pDeviceID);
1693  PlugPlayData.Buffer = Buffer;
1694  PlugPlayData.BufferSize = *pulLength;
1695 
1697  (PVOID)&PlugPlayData,
1699  if (NT_SUCCESS(Status))
1700  {
1701  *pulLength = PlugPlayData.BufferSize;
1702  }
1703  else
1704  {
1706  }
1707  }
1708 
1709 done:
1710  if (pulTransferLen)
1711  *pulTransferLen = (ret == CR_SUCCESS) ? *pulLength : 0;
1712 
1713  if (hKey != NULL)
1714  RegCloseKey(hKey);
1715 
1716  DPRINT("PNP_GetDeviceRegProp() done (returns %lx)\n", ret);
1717 
1718  return ret;
1719 }
#define PNP_PROPERTY_POWER_DATA
Definition: cmtypes.h:39
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
#define ERROR_SUCCESS
Definition: deptool.c:10
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
handle_t hBinding
Definition: ctx_c.c:54
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define CM_DRP_REMOVAL_POLICY_HW_DEFAULT
Definition: cfgmgr32.h:720
#define CM_DRP_FRIENDLYNAME
Definition: cfgmgr32.h:688
#define CM_DRP_EXCLUSIVE
Definition: cfgmgr32.h:711
#define CM_DRP_LEGACYBUSTYPE
Definition: cfgmgr32.h:702
LONG NTSTATUS
Definition: precomp.h:26
static BOOL IsValidDeviceInstanceID(_In_ PWSTR pszDeviceInstanceID)
Definition: rpcserver.c:231
static CONFIGRET WINAPI NtStatusToCrError(NTSTATUS Status)
Definition: rpcserver.c:121
#define CM_DRP_BUSTYPEGUID
Definition: cfgmgr32.h:701
#define CR_NO_SUCH_VALUE
Definition: cfgmgr32.h:883
#define CM_DRP_SERVICE
Definition: cfgmgr32.h:680
#define CM_DRP_COMPATIBLEIDS
Definition: cfgmgr32.h:678
#define CM_DRP_REMOVAL_POLICY
Definition: cfgmgr32.h:719
#define CM_DRP_SECURITY
Definition: cfgmgr32.h:705
#define CM_DRP_UPPERFILTERS
Definition: cfgmgr32.h:693
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define CM_DRP_LOWERFILTERS
Definition: cfgmgr32.h:697
long LONG
Definition: pedump.c:60
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define CM_DRP_ENUMERATOR_NAME
Definition: cfgmgr32.h:704
smooth NULL
Definition: ftsmooth.c:416
#define CM_DRP_CLASSGUID
Definition: cfgmgr32.h:684
#define PNP_PROPERTY_BUSTYPEGUID
Definition: cmtypes.h:36
#define CR_INVALID_PROPERTY
Definition: cfgmgr32.h:899
#define PNP_PROPERTY_REMOVAL_POLICY_HARDWARE_DEFAULT
Definition: cmtypes.h:44
void DPRINT(...)
Definition: polytest.cpp:61
Definition: bufpool.h:45
#define CM_DRP_DEVTYPE
Definition: cfgmgr32.h:709
#define PNP_PROPERTY_ADDRESS
Definition: cmtypes.h:42
UNICODE_STRING DeviceInstance
Definition: cmtypes.h:488
#define PNP_PROPERTY_LOCATION_PATHS
Definition: cmtypes.h:46
#define PNP_PROPERTY_ENUMERATOR_NAME
Definition: cmtypes.h:43
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define PNP_PROPERTY_REMOVAL_POLICY
Definition: cmtypes.h:40
#define CR_BUFFER_SMALL
Definition: cfgmgr32.h:872
#define CM_DRP_HARDWAREID
Definition: cfgmgr32.h:677
#define CM_DRP_REMOVAL_POLICY_OVERRIDE
Definition: cfgmgr32.h:721
#define CM_DRP_LOCATION_INFORMATION
Definition: cfgmgr32.h:689
HKEY hEnumKey
Definition: umpnpmgr.c:44
#define CM_DRP_BASE_CONTAINERID
Definition: cfgmgr32.h:728
#define PNP_PROPERTY_UI_NUMBER
Definition: cmtypes.h:34
#define CM_DRP_DRIVER
Definition: cfgmgr32.h:685
int ret
static const WCHAR L[]
Definition: oid.c:1250
#define CM_DRP_DEVICEDESC
Definition: cfgmgr32.h:676
#define CM_DRP_PHYSICAL_DEVICE_OBJECT_NAME
Definition: cfgmgr32.h:690
#define PNP_PROPERTY_PHYSICAL_DEVICE_OBJECT_NAME
Definition: cmtypes.h:35
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
#define CM_DRP_UI_NUMBER
Definition: cfgmgr32.h:692
#define CM_DRP_DEVICE_POWER_DATA
Definition: cfgmgr32.h:718
#define CM_DRP_MFG
Definition: cfgmgr32.h:687
#define ERROR_MORE_DATA
Definition: dderror.h:13
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI NtPlugPlayControl(IN PLUGPLAY_CONTROL_CLASS PlugPlayControlClass, IN OUT PVOID Buffer, IN ULONG BufferLength)
Definition: plugplay.c:1299
#define CM_DRP_CHARACTERISTICS
Definition: cfgmgr32.h:713
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define CM_DRP_CONFIGFLAGS
Definition: cfgmgr32.h:686
#define PNP_PROPERTY_LEGACYBUSTYPE
Definition: cmtypes.h:37
#define CM_DRP_CLASS
Definition: cfgmgr32.h:683
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define PNP_PROPERTY_INSTALL_STATE
Definition: cmtypes.h:45
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define CM_DRP_ADDRESS
Definition: cfgmgr32.h:715
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define CM_DRP_UI_NUMBER_DESC_FORMAT
Definition: cfgmgr32.h:716
#define CM_DRP_LOCATION_PATHS
Definition: cfgmgr32.h:725
#define PNP_PROPERTY_BUSNUMBER
Definition: cmtypes.h:38
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define PNP_PROPERTY_CONTAINERID
Definition: cmtypes.h:47
#define CM_DRP_INSTALL_STATE
Definition: cfgmgr32.h:722
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
#define CM_DRP_CAPABILITIES
Definition: cfgmgr32.h:691
#define CM_DRP_BUSNUMBER
Definition: cfgmgr32.h:703

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

◆ PNP_GetDeviceStatus()

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

Definition at line 2834 of file rpcserver.c.

2840 {
2842  UNREFERENCED_PARAMETER(ulFlags);
2843 
2844  DPRINT("PNP_GetDeviceStatus(%p %S %p %p)\n",
2845  hBinding, pDeviceID, pulStatus, pulProblem, ulFlags);
2846 
2847  if (!IsValidDeviceInstanceID(pDeviceID))
2848  return CR_INVALID_DEVINST;
2849 
2850  return GetDeviceStatus(pDeviceID, pulStatus, pulProblem);
2851 }
static CONFIGRET GetDeviceStatus(_In_ LPWSTR pDeviceID, _Out_ DWORD *pulStatus, _Out_ DWORD *pulProblem)
Definition: rpcserver.c:196
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
handle_t hBinding
Definition: ctx_c.c:54
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
static BOOL IsValidDeviceInstanceID(_In_ PWSTR pszDeviceInstanceID)
Definition: rpcserver.c:231
void DPRINT(...)
Definition: polytest.cpp:61

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 3496 of file rpcserver.c.

3502 {
3503  UNIMPLEMENTED;
3504  return CR_CALL_NOT_IMPLEMENTED;
3505 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114

Referenced by CM_Get_First_Log_Conf_Ex().

◆ PNP_GetGlobalState()

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

Definition at line 348 of file rpcserver.c.

352 {
354  UNREFERENCED_PARAMETER(ulFlags);
355 
357  return CR_SUCCESS;
358 }
handle_t hBinding
Definition: ctx_c.c:54
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define CM_GLOBAL_STATE_SERVICES_AVAILABLE
Definition: cfgmgr32.h:910
#define CM_GLOBAL_STATE_CAN_DO_UI
Definition: cfgmgr32.h:908

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 3331 of file rpcserver.c.

3337 {
3338  WCHAR szProfileName[5];
3339  HKEY hKeyConfig = NULL;
3340  HKEY hKeyProfiles = NULL;
3341  HKEY hKeyProfile = NULL;
3342  DWORD dwDisposition;
3343  DWORD dwSize;
3344  LONG lError;
3346 
3348 
3349  DPRINT("PNP_GetHwProfInfo() called\n");
3350 
3351  if (ulProfileInfoSize == 0)
3352  {
3353  ret = CR_INVALID_DATA;
3354  goto done;
3355  }
3356 
3357  if (ulFlags != 0)
3358  {
3359  ret = CR_INVALID_FLAG;
3360  goto done;
3361  }
3362 
3363  /* Initialize the profile information */
3364  pHWProfileInfo->HWPI_ulHWProfile = 0;
3365  pHWProfileInfo->HWPI_szFriendlyName[0] = 0;
3366  pHWProfileInfo->HWPI_dwFlags = 0;
3367 
3368  /* Open the 'IDConfigDB' key */
3370  L"System\\CurrentControlSet\\Control\\IDConfigDB",
3371  0,
3372  NULL,
3375  NULL,
3376  &hKeyConfig,
3377  &dwDisposition);
3378  if (lError != ERROR_SUCCESS)
3379  {
3381  goto done;
3382  }
3383 
3384  /* Open the 'Hardware Profiles' subkey */
3385  lError = RegCreateKeyExW(hKeyConfig,
3386  L"Hardware Profiles",
3387  0,
3388  NULL,
3391  NULL,
3392  &hKeyProfiles,
3393  &dwDisposition);
3394  if (lError != ERROR_SUCCESS)
3395  {
3397  goto done;
3398  }
3399 
3400  if (ulIndex == (ULONG)-1)
3401  {
3402  dwSize = sizeof(ULONG);
3403  lError = RegQueryValueExW(hKeyConfig,
3404  L"CurrentConfig",
3405  NULL,
3406  NULL,
3407  (LPBYTE)&pHWProfileInfo->HWPI_ulHWProfile,
3408  &dwSize);
3409  if (lError != ERROR_SUCCESS)
3410  {
3411  pHWProfileInfo->HWPI_ulHWProfile = 0;
3413  goto done;
3414  }
3415  }
3416  else
3417  {
3418  /* FIXME: not implemented yet */
3420  goto done;
3421  }
3422 
3423  swprintf(szProfileName, L"%04lu", pHWProfileInfo->HWPI_ulHWProfile);
3424 
3425  lError = RegOpenKeyExW(hKeyProfiles,
3426  szProfileName,
3427  0,
3429  &hKeyProfile);
3430  if (lError != ERROR_SUCCESS)
3431  {
3433  goto done;
3434  }
3435 
3436  dwSize = sizeof(pHWProfileInfo->HWPI_szFriendlyName);
3437  lError = RegQueryValueExW(hKeyProfile,
3438  L"FriendlyName",
3439  NULL,
3440  NULL,
3441  (LPBYTE)&pHWProfileInfo->HWPI_szFriendlyName,
3442  &dwSize);
3443  if (lError != ERROR_SUCCESS)
3444  {
3446  goto done;
3447  }
3448 
3449 done:
3450  if (hKeyProfile != NULL)
3451  RegCloseKey(hKeyProfile);
3452 
3453  if (hKeyProfiles != NULL)
3454  RegCloseKey(hKeyProfiles);
3455 
3456  if (hKeyConfig != NULL)
3457  RegCloseKey(hKeyConfig);
3458 
3459  return ret;
3460 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
handle_t hBinding
Definition: ctx_c.c:54
DWORD HWPI_dwFlags
Definition: cfgmgr32.h:556
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
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:1091
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
long LONG
Definition: pedump.c:60
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define swprintf(buf, format,...)
Definition: sprintf.c:56
unsigned long DWORD
Definition: ntddk_ex.h:95
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
int ret
static const WCHAR L[]
Definition: oid.c:1250
ULONG HWPI_ulHWProfile
Definition: cfgmgr32.h:554
ULONG ulIndex
Definition: symbols.c:92
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
CHAR HWPI_szFriendlyName[MAX_PROFILE_LEN]
Definition: cfgmgr32.h:555
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
unsigned int ULONG
Definition: retypes.h:1
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
#define CR_REGISTRY_ERROR
Definition: cfgmgr32.h:875
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define KEY_ENUMERATE_SUB_KEYS
Definition: nt_native.h:1019

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 2161 of file rpcserver.c.

2169 {
2170  UNIMPLEMENTED;
2171  return CR_CALL_NOT_IMPLEMENTED;
2172 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114

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 2178 of file rpcserver.c.

2185 {
2186  NTSTATUS Status;
2188  DWORD ret = CR_SUCCESS;
2189 
2191 
2192  if (!IsValidDeviceInstanceID(pszDeviceID))
2193  return CR_INVALID_DEVINST;
2194 
2195  RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
2196  pszDeviceID);
2197 
2198  PlugPlayData.Flags = ulFlags;
2199  PlugPlayData.FilterGuid = InterfaceGuid;
2200  PlugPlayData.Buffer = Buffer;
2201  PlugPlayData.BufferSize = *pulLength;
2202 
2204  (PVOID)&PlugPlayData,
2206  if (NT_SUCCESS(Status))
2207  {
2208  *pulLength = PlugPlayData.BufferSize;
2209  }
2210  else
2211  {
2213  }
2214 
2215  DPRINT("PNP_GetInterfaceDeviceListSize() done (returns %lx)\n", ret);
2216  return ret;
2217 }
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
handle_t hBinding
Definition: ctx_c.c:54
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
LONG NTSTATUS
Definition: precomp.h:26
static BOOL IsValidDeviceInstanceID(_In_ PWSTR pszDeviceInstanceID)
Definition: rpcserver.c:231
static CONFIGRET WINAPI NtStatusToCrError(NTSTATUS Status)
Definition: rpcserver.c:121
#define CR_SUCCESS
Definition: cfgmgr32.h:842
void DPRINT(...)
Definition: polytest.cpp:61
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static const GUID InterfaceGuid
Definition: wlanapi.c:25
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI NtPlugPlayControl(IN PLUGPLAY_CONTROL_CLASS PlugPlayControlClass, IN OUT PVOID Buffer, IN ULONG BufferLength)
Definition: plugplay.c:1299
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34

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 2223 of file rpcserver.c.

2229 {
2230  NTSTATUS Status;
2232  DWORD ret = CR_SUCCESS;
2233 
2235 
2236  DPRINT("PNP_GetInterfaceDeviceListSize() called\n");
2237 
2238  if (!IsValidDeviceInstanceID(pszDeviceID))
2239  return CR_INVALID_DEVINST;
2240 
2241  RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
2242  pszDeviceID);
2243 
2244  PlugPlayData.FilterGuid = InterfaceGuid;
2245  PlugPlayData.Buffer = NULL;
2246  PlugPlayData.BufferSize = 0;
2247  PlugPlayData.Flags = ulFlags;
2248 
2250  (PVOID)&PlugPlayData,
2252  if (NT_SUCCESS(Status))
2253  {
2254  *pulLen = PlugPlayData.BufferSize;
2255  }
2256  else
2257  {
2259  }
2260 
2261  DPRINT("PNP_GetInterfaceDeviceListSize() done (returns %lx)\n", ret);
2262  return ret;
2263 }
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
handle_t hBinding
Definition: ctx_c.c:54
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
LONG NTSTATUS
Definition: precomp.h:26
static BOOL IsValidDeviceInstanceID(_In_ PWSTR pszDeviceInstanceID)
Definition: rpcserver.c:231
static CONFIGRET WINAPI NtStatusToCrError(NTSTATUS Status)
Definition: rpcserver.c:121
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static const GUID InterfaceGuid
Definition: wlanapi.c:25
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI NtPlugPlayControl(IN PLUGPLAY_CONTROL_CLASS PlugPlayControlClass, IN OUT PVOID Buffer, IN ULONG BufferLength)
Definition: plugplay.c:1299
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)

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 3527 of file rpcserver.c.

3534 {
3535  UNIMPLEMENTED;
3536  return CR_CALL_NOT_IMPLEMENTED;
3537 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114

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 3511 of file rpcserver.c.

3518 {
3519  UNIMPLEMENTED;
3520  return CR_CALL_NOT_IMPLEMENTED;
3521 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114

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 3581 of file rpcserver.c.

3591 {
3592  UNIMPLEMENTED;
3593  return CR_CALL_NOT_IMPLEMENTED;
3594 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114

◆ 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 4020 of file rpcserver.c.

4031 {
4032  UNIMPLEMENTED;
4033  return CR_CALL_NOT_IMPLEMENTED;
4034 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114

◆ 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 4002 of file rpcserver.c.

4011 {
4012  UNIMPLEMENTED;
4013  return CR_CALL_NOT_IMPLEMENTED;
4014 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114

◆ 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 506 of file rpcserver.c.

513 {
517 
519  UNREFERENCED_PARAMETER(ulFlags);
520 
521  DPRINT("PNP_GetRelatedDeviceInstance() called\n");
522  DPRINT(" Relationship %ld\n", ulRelationship);
523  DPRINT(" DeviceId %S\n", pDeviceID);
524 
525  if (!IsValidDeviceInstanceID(pDeviceID))
526  return CR_INVALID_DEVINST;
527 
529  pDeviceID);
530 
531  PlugPlayData.Relation = ulRelationship;
532 
533  PlugPlayData.RelatedDeviceInstanceLength = *pulLength;
534  PlugPlayData.RelatedDeviceInstance = pRelatedDeviceId;
535 
537  (PVOID)&PlugPlayData,
539  if (!NT_SUCCESS(Status))
540  {
542  }
543 
544  DPRINT("PNP_GetRelatedDeviceInstance() done (returns %lx)\n", ret);
545  if (ret == CR_SUCCESS)
546  {
547  DPRINT("RelatedDevice: %wZ\n", &PlugPlayData.RelatedDeviceInstance);
548  }
549 
550  return ret;
551 }
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
handle_t hBinding
Definition: ctx_c.c:54
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
LONG NTSTATUS
Definition: precomp.h:26
static BOOL IsValidDeviceInstanceID(_In_ PWSTR pszDeviceInstanceID)
Definition: rpcserver.c:231
static CONFIGRET WINAPI NtStatusToCrError(NTSTATUS Status)
Definition: rpcserver.c:121
#define CR_SUCCESS
Definition: cfgmgr32.h:842
void DPRINT(...)
Definition: polytest.cpp:61
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
int ret
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI NtPlugPlayControl(IN PLUGPLAY_CONTROL_CLASS PlugPlayControlClass, IN OUT PVOID Buffer, IN ULONG BufferLength)
Definition: plugplay.c:1299
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)

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 3600 of file rpcserver.c.

3610 {
3611  UNIMPLEMENTED;
3612  return CR_CALL_NOT_IMPLEMENTED;
3613 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114

◆ 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 3619 of file rpcserver.c.

3628 {
3629  UNIMPLEMENTED;
3630  return CR_CALL_NOT_IMPLEMENTED;
3631 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114

◆ PNP_GetRootDeviceInstance()

DWORD WINAPI PNP_GetRootDeviceInstance ( handle_t  hBinding,
LPWSTR