ReactOS  r76032
umpnpmgr.c File Reference
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#include <winsvc.h>
#include <winuser.h>
#include <dbt.h>
#include <stdio.h>
#include <cmfuncs.h>
#include <rtlfuncs.h>
#include <setypes.h>
#include <umpnpmgr/sysguid.h>
#include <cfgmgr32.h>
#include <regstr.h>
#include <userenv.h>
#include <shlwapi.h>
#include <pnp_s.h>
#include <debug.h>
Include dependency graph for umpnpmgr.c:

Go to the source code of this file.

Classes

struct  DeviceInstallParams
 

Macros

#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COM_NO_WINDOWS_H
 
#define NDEBUG
 

Functions

static 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)
 
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)
 
DWORD WINAPI PNP_GetDeviceList (handle_t hBinding, LPWSTR pszFilter, LPWSTR Buffer, PNP_RPC_STRING_LEN *pulLength, DWORD ulFlags)
 
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 VOID SplitDeviceInstanceID (IN LPWSTR pszDeviceInstanceID, OUT LPWSTR pszEnumerator, OUT LPWSTR pszDevice, OUT LPWSTR pszInstance)
 
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 (LPWSTR pszDeviceInstance)
 
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 ulFlags, DWORD *pulNotify)
 
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)
 
static BOOL InstallDevice (PCWSTR DeviceInstance, BOOL ShowWizard)
 
static LONG ReadRegSzKey (IN HKEY hKey, IN LPCWSTR pszKey, OUT LPWSTR *pValue)
 
static BOOL SetupIsActive (VOID)
 
static BOOL IsConsoleBoot (VOID)
 
static DWORD WINAPI DeviceInstallThread (LPVOID lpParameter)
 
static DWORD WINAPI PnpEventThread (LPVOID lpParameter)
 
static VOID UpdateServiceStatus (DWORD dwState)
 
static DWORD WINAPI ServiceControlHandler (DWORD dwControl, DWORD dwEventType, LPVOID lpEventData, LPVOID lpContext)
 
VOID WINAPI ServiceMain (DWORD argc, LPTSTR *argv)
 
static DWORD InitializePnPManager (VOID)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 

Variables

static WCHAR ServiceName [] = L"PlugPlay"
 
static SERVICE_STATUS_HANDLE ServiceStatusHandle
 
static SERVICE_STATUS ServiceStatus
 
static WCHAR szRootDeviceId [] = L"HTREE\\ROOT\\0"
 
static HKEY hEnumKey = NULL
 
static HKEY hClassKey = NULL
 
static HANDLE hUserToken = NULL
 
static HANDLE hInstallEvent = NULL
 
static HANDLE hNoPendingInstalls = NULL
 
static LIST_ENTRY DeviceInstallListHead
 
static HANDLE hDeviceInstallListNotEmpty
 

Macro Definition Documentation

#define _INC_WINDOWS

Definition at line 33 of file umpnpmgr.c.

#define COM_NO_WINDOWS_H

Definition at line 34 of file umpnpmgr.c.

#define NDEBUG

Definition at line 53 of file umpnpmgr.c.

#define WIN32_NO_STATUS

Definition at line 32 of file umpnpmgr.c.

Function Documentation

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

Definition at line 2119 of file umpnpmgr.c.

Referenced by PNP_AddID().

2122 {
2123  DWORD dwLen;
2124  DWORD dwPos;
2125 
2126  dwLen = wcslen(lpDeviceId);
2127  dwPos = (*lpDeviceIdListSize / sizeof(WCHAR)) - 1;
2128 
2129  wcscpy(&lpDeviceIdList[dwPos], lpDeviceId);
2130 
2131  dwPos += (dwLen + 1);
2132 
2133  lpDeviceIdList[dwPos] = 0;
2134 
2135  *lpDeviceIdListSize = dwPos * sizeof(WCHAR);
2136 }
#define WCHAR
Definition: msvc.h:43
DWORD DWORD
Definition: winlogon.h:75
_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)
static BOOL CheckForDeviceId ( LPWSTR  lpDeviceIdList,
LPWSTR  lpDeviceId 
)
static

Definition at line 2098 of file umpnpmgr.c.

Referenced by PNP_AddID().

2100 {
2101  LPWSTR lpPtr;
2102  DWORD dwLength;
2103 
2104  lpPtr = lpDeviceIdList;
2105  while (*lpPtr != 0)
2106  {
2107  dwLength = wcslen(lpPtr);
2108  if (0 == _wcsicmp(lpPtr, lpDeviceId))
2109  return TRUE;
2110 
2111  lpPtr += (dwLength + 1);
2112  }
2113 
2114  return FALSE;
2115 }
#define TRUE
Definition: types.h:120
DWORD DWORD
Definition: winlogon.h:75
#define FALSE
Definition: types.h:117
static DWORD DWORD * dwLength
Definition: fusion.c:70
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)
static CONFIGRET CreateDeviceInstance ( LPWSTR  pszDeviceID)
static

Definition at line 1743 of file umpnpmgr.c.

Referenced by PNP_CreateDevInst().

1744 {
1745  WCHAR szEnumerator[MAX_DEVICE_ID_LEN];
1746  WCHAR szDevice[MAX_DEVICE_ID_LEN];
1747  WCHAR szInstance[MAX_DEVICE_ID_LEN];
1748  HKEY hKeyEnumerator;
1749  HKEY hKeyDevice;
1750  HKEY hKeyInstance;
1751  HKEY hKeyControl;
1752  LONG lError;
1753 
1754  /* Split the instance ID */
1755  SplitDeviceInstanceID(pszDeviceID,
1756  szEnumerator,
1757  szDevice,
1758  szInstance);
1759 
1760  /* Open or create the enumerator key */
1761  lError = RegCreateKeyExW(hEnumKey,
1762  szEnumerator,
1763  0,
1764  NULL,
1767  NULL,
1768  &hKeyEnumerator,
1769  NULL);
1770  if (lError != ERROR_SUCCESS)
1771  {
1772  return CR_REGISTRY_ERROR;
1773  }
1774 
1775  /* Open or create the device key */
1776  lError = RegCreateKeyExW(hKeyEnumerator,
1777  szDevice,
1778  0,
1779  NULL,
1782  NULL,
1783  &hKeyDevice,
1784  NULL);
1785 
1786  /* Close the enumerator key */
1787  RegCloseKey(hKeyEnumerator);
1788 
1789  if (lError != ERROR_SUCCESS)
1790  {
1791  return CR_REGISTRY_ERROR;
1792  }
1793 
1794  /* Try to open the instance key and fail if it exists */
1795  lError = RegOpenKeyExW(hKeyDevice,
1796  szInstance,
1797  0,
1798  KEY_SET_VALUE,
1799  &hKeyInstance);
1800  if (lError == ERROR_SUCCESS)
1801  {
1802  DPRINT1("Instance %S already exists!\n", szInstance);
1803  RegCloseKey(hKeyInstance);
1804  RegCloseKey(hKeyDevice);
1805  return CR_ALREADY_SUCH_DEVINST;
1806  }
1807 
1808  /* Create a new instance key */
1809  lError = RegCreateKeyExW(hKeyDevice,
1810  szInstance,
1811  0,
1812  NULL,
1815  NULL,
1816  &hKeyInstance,
1817  NULL);
1818 
1819  /* Close the device key */
1820  RegCloseKey(hKeyDevice);
1821 
1822  if (lError != ERROR_SUCCESS)
1823  {
1824  return CR_REGISTRY_ERROR;
1825  }
1826 
1827  /* Create the 'Control' sub key */
1828  lError = RegCreateKeyExW(hKeyInstance,
1829  L"Control",
1830  0,
1831  NULL,
1834  NULL,
1835  &hKeyControl,
1836  NULL);
1837  if (lError == ERROR_SUCCESS)
1838  {
1839  RegCloseKey(hKeyControl);
1840  }
1841 
1842  RegCloseKey(hKeyInstance);
1843 
1844  return (lError == ERROR_SUCCESS) ? CR_SUCCESS : CR_REGISTRY_ERROR;
1845 }
#define ERROR_SUCCESS
Definition: deptool.c:10
static VOID SplitDeviceInstanceID(IN LPWSTR pszDeviceInstanceID, OUT LPWSTR pszEnumerator, OUT LPWSTR pszDevice, OUT LPWSTR pszInstance)
Definition: umpnpmgr.c:1698
#define KEY_SET_VALUE
Definition: nt_native.h:1017
Definition: bidi.c:75
__wchar_t WCHAR
Definition: xmlstorage.h:180
#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:1094
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
#define CR_SUCCESS
Definition: cfgmgr32.h:842
static HKEY hEnumKey
Definition: umpnpmgr.c:65
smooth NULL
Definition: ftsmooth.c:557
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
HANDLE HKEY
Definition: registry.h:24
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define MAX_DEVICE_ID_LEN
Definition: cfgmgr32.h:49
#define DPRINT1
Definition: precomp.h:8
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
#define CR_REGISTRY_ERROR
Definition: cfgmgr32.h:875
static DWORD WINAPI DeviceInstallThread ( LPVOID  lpParameter)
static

Definition at line 3487 of file umpnpmgr.c.

Referenced by ServiceMain().

3488 {
3489 #ifdef HAVE_SLIST_ENTRY_IMPLEMENTED
3490  PSLIST_ENTRY ListEntry;
3491 #else
3492  PLIST_ENTRY ListEntry;
3493 #endif
3494  DeviceInstallParams* Params;
3495  BOOL showWizard;
3496 
3497  UNREFERENCED_PARAMETER(lpParameter);
3498 
3500 
3501  showWizard = !SetupIsActive() && !IsConsoleBoot();
3502 
3503  while (TRUE)
3504  {
3505 #ifdef HAVE_SLIST_ENTRY_IMPLEMENTED
3507 #else
3509  ListEntry = NULL;
3510  else
3511  ListEntry = RemoveHeadList(&DeviceInstallListHead);
3512 #endif
3513  if (ListEntry == NULL)
3514  {
3517  }
3518  else
3519  {
3521  Params = CONTAINING_RECORD(ListEntry, DeviceInstallParams, ListEntry);
3522  InstallDevice(Params->DeviceIds, showWizard);
3523  }
3524  }
3525 
3526  return 0;
3527 }
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:679
static BOOL SetupIsActive(VOID)
Definition: umpnpmgr.c:3411
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
PSLIST_ENTRY WINAPI InterlockedPopEntrySList(PSLIST_HEADER ListHead)
Definition: interlocked.c:55
static HANDLE hInstallEvent
Definition: umpnpmgr.c:69
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
smooth NULL
Definition: ftsmooth.c:557
FORCEINLINE PLIST_ENTRY RemoveHeadList(_Inout_ PLIST_ENTRY ListHead)
Definition: rtlfuncs.h:128
static BOOL IsConsoleBoot(VOID)
Definition: umpnpmgr.c:3442
WCHAR DeviceIds[1]
Definition: umpnpmgr.c:86
static HANDLE hNoPendingInstalls
Definition: umpnpmgr.c:70
unsigned int BOOL
Definition: ntddk_ex.h:94
#define PSLIST_ENTRY
Definition: rtltypes.h:130
static BOOL InstallDevice(PCWSTR DeviceInstance, BOOL ShowWizard)
Definition: umpnpmgr.c:3192
Definition: typedefs.h:117
static LIST_ENTRY DeviceInstallListHead
Definition: umpnpmgr.c:75
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Definition: synch.c:660
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:259
#define INFINITE
Definition: serial.h:102
static HANDLE hDeviceInstallListNotEmpty
Definition: umpnpmgr.c:77
static CONFIGRET DisableDeviceInstance ( LPWSTR  pszDeviceInstance)
static

Definition at line 1945 of file umpnpmgr.c.

Referenced by PNP_DeviceInstanceAction().

1946 {
1947  DPRINT("DisableDeviceInstance: not implemented\n");
1948  /* FIXME */
1949  return CR_CALL_NOT_IMPLEMENTED;
1950 }
void DPRINT(...)
Definition: polytest.cpp:61
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
BOOL WINAPI DllMain ( HINSTANCE  hinstDLL,
DWORD  fdwReason,
LPVOID  lpvReserved 
)

Definition at line 3870 of file umpnpmgr.c.

3873 {
3874  switch (fdwReason)
3875  {
3876  case DLL_PROCESS_ATTACH:
3877  DisableThreadLibraryCalls(hinstDLL);
3879  break;
3880 
3881  case DLL_PROCESS_DETACH:
3882  break;
3883  }
3884 
3885  return TRUE;
3886 }
#define TRUE
Definition: types.h:120
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
static DWORD InitializePnPManager(VOID)
Definition: umpnpmgr.c:3799
#define DLL_PROCESS_DETACH
Definition: compat.h:119
static CONFIGRET EnableDeviceInstance ( LPWSTR  pszDeviceInstance)
static

Definition at line 1927 of file umpnpmgr.c.

Referenced by PNP_DeviceInstanceAction().

1928 {
1929  PLUGPLAY_CONTROL_RESET_DEVICE_DATA ResetDeviceData;
1931  NTSTATUS Status;
1932 
1933  DPRINT("Enable device instance %S\n", pszDeviceInstance);
1934 
1935  RtlInitUnicodeString(&ResetDeviceData.DeviceInstance, pszDeviceInstance);
1937  if (!NT_SUCCESS(Status))
1938  ret = NtStatusToCrError(Status);
1939 
1940  return ret;
1941 }
#define CR_SUCCESS
Definition: cfgmgr32.h:842
void DPRINT(...)
Definition: polytest.cpp:61
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
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:1115
LONG NTSTATUS
Definition: DriverTester.h:11
static CONFIGRET WINAPI NtStatusToCrError(NTSTATUS Status)
Definition: umpnpmgr.c:168
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
static DWORD InitializePnPManager ( VOID  )
static

Definition at line 3799 of file umpnpmgr.c.

Referenced by DllMain().

3800 {
3801  BOOLEAN OldValue;
3802  DWORD dwError;
3803 
3804  DPRINT("UMPNPMGR: InitializePnPManager() started\n");
3805 
3806  /* We need this privilege for using CreateProcessAsUserW */
3808 
3810  if (hInstallEvent == NULL)
3811  {
3812  dwError = GetLastError();
3813  DPRINT1("Could not create the Install Event! (Error %lu)\n", dwError);
3814  return dwError;
3815  }
3816 
3819  {
3820  dwError = GetLastError();
3821  DPRINT1("Could not create the Event! (Error %lu)\n", dwError);
3822  return dwError;
3823  }
3824 
3826  TRUE,
3827  FALSE,
3828  L"Global\\PnP_No_Pending_Install_Events");
3829  if (hNoPendingInstalls == NULL)
3830  {
3831  dwError = GetLastError();
3832  DPRINT1("Could not create the Event! (Error %lu)\n", dwError);
3833  return dwError;
3834  }
3835 
3836 #ifdef HAVE_SLIST_ENTRY_IMPLEMENTED
3838 #else
3840 #endif
3841 
3843  L"System\\CurrentControlSet\\Enum",
3844  0,
3846  &hEnumKey);
3847  if (dwError != ERROR_SUCCESS)
3848  {
3849  DPRINT1("Could not open the Enum Key! (Error %lu)\n", dwError);
3850  return dwError;
3851  }
3852 
3854  L"System\\CurrentControlSet\\Control\\Class",
3855  0,
3857  &hClassKey);
3858  if (dwError != ERROR_SUCCESS)
3859  {
3860  DPRINT1("Could not open the Class Key! (Error %lu)\n", dwError);
3861  return dwError;
3862  }
3863 
3864  DPRINT("UMPNPMGR: InitializePnPManager() done\n");
3865 
3866  return 0;
3867 }
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
Definition: bidi.c:75
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1056
NTSYSAPI NTSTATUS NTAPI RtlAdjustPrivilege(_In_ ULONG Privilege, _In_ BOOLEAN NewValue, _In_ BOOLEAN ForThread, _Out_ PBOOLEAN OldValue)
static BOOL SetupIsActive(VOID)
Definition: umpnpmgr.c:3411
DWORD DWORD
Definition: winlogon.h:75
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:597
static HANDLE hInstallEvent
Definition: umpnpmgr.c:69
#define FALSE
Definition: types.h:117
static HKEY hEnumKey
Definition: umpnpmgr.c:65
smooth NULL
Definition: ftsmooth.c:557
void DPRINT(...)
Definition: polytest.cpp:61
static HANDLE hNoPendingInstalls
Definition: umpnpmgr.c:70
unsigned char BOOLEAN
static LIST_ENTRY DeviceInstallListHead
Definition: umpnpmgr.c:75
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define DPRINT1
Definition: precomp.h:8
#define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE
Definition: security.c:663
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
static HANDLE hDeviceInstallListNotEmpty
Definition: umpnpmgr.c:77
WINBASEAPI VOID WINAPI InitializeSListHead(_Out_ PSLIST_HEADER ListHead)
Definition: rtlfuncs.h:3353
static HKEY hClassKey
Definition: umpnpmgr.c:66
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
static BOOL InstallDevice ( PCWSTR  DeviceInstance,
BOOL  ShowWizard 
)
static

Definition at line 3192 of file umpnpmgr.c.

Referenced by DeviceInstallThread().

3193 {
3194  BOOL DeviceInstalled = FALSE;
3196  DWORD Value;
3198  HANDLE hPipe = INVALID_HANDLE_VALUE;
3200  PROCESS_INFORMATION ProcessInfo;
3201  STARTUPINFOW StartupInfo;
3202  UUID RandomUuid;
3203  HKEY DeviceKey;
3204 
3205  /* The following lengths are constant (see below), they cannot overflow */
3206  WCHAR CommandLine[116];
3207  WCHAR InstallEventName[73];
3208  WCHAR PipeName[74];
3209  WCHAR UuidString[39];
3210 
3211  DPRINT("InstallDevice(%S, %d)\n", DeviceInstance, ShowWizard);
3212 
3213  ZeroMemory(&ProcessInfo, sizeof(ProcessInfo));
3214 
3215  if (RegOpenKeyExW(hEnumKey,
3217  0,
3219  &DeviceKey) == ERROR_SUCCESS)
3220  {
3221  if (RegQueryValueExW(DeviceKey,
3222  L"Class",
3223  NULL,
3224  NULL,
3225  NULL,
3226  NULL) == ERROR_SUCCESS)
3227  {
3228  DPRINT("No need to install: %S\n", DeviceInstance);
3229  RegCloseKey(DeviceKey);
3230  return TRUE;
3231  }
3232 
3233  BytesWritten = sizeof(DWORD);
3234  if (RegQueryValueExW(DeviceKey,
3235  L"ConfigFlags",
3236  NULL,
3237  NULL,
3238  (PBYTE)&Value,
3239  &BytesWritten) == ERROR_SUCCESS)
3240  {
3241  if (Value & CONFIGFLAG_FAILEDINSTALL)
3242  {
3243  DPRINT("No need to install: %S\n", DeviceInstance);
3244  RegCloseKey(DeviceKey);
3245  return TRUE;
3246  }
3247  }
3248 
3249  RegCloseKey(DeviceKey);
3250  }
3251 
3252  DPRINT1("Installing: %S\n", DeviceInstance);
3253 
3254  /* Create a random UUID for the named pipe & event*/
3255  UuidCreate(&RandomUuid);
3256  swprintf(UuidString, L"{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
3257  RandomUuid.Data1, RandomUuid.Data2, RandomUuid.Data3,
3258  RandomUuid.Data4[0], RandomUuid.Data4[1], RandomUuid.Data4[2],
3259  RandomUuid.Data4[3], RandomUuid.Data4[4], RandomUuid.Data4[5],
3260  RandomUuid.Data4[6], RandomUuid.Data4[7]);
3261 
3262  /* Create the event */
3263  wcscpy(InstallEventName, L"Global\\PNP_Device_Install_Event_0.");
3264  wcscat(InstallEventName, UuidString);
3265  hInstallEvent = CreateEventW(NULL, TRUE, FALSE, InstallEventName);
3266  if (!hInstallEvent)
3267  {
3268  DPRINT1("CreateEventW('%ls') failed with error %lu\n", InstallEventName, GetLastError());
3269  goto cleanup;
3270  }
3271 
3272  /* Create the named pipe */
3273  wcscpy(PipeName, L"\\\\.\\pipe\\PNP_Device_Install_Pipe_0.");
3274  wcscat(PipeName, UuidString);
3275  hPipe = CreateNamedPipeW(PipeName, PIPE_ACCESS_OUTBOUND, PIPE_TYPE_BYTE, 1, 512, 512, 0, NULL);
3276  if (hPipe == INVALID_HANDLE_VALUE)
3277  {
3278  DPRINT1("CreateNamedPipeW failed with error %u\n", GetLastError());
3279  goto cleanup;
3280  }
3281 
3282  /* Launch rundll32 to call ClientSideInstallW */
3283  wcscpy(CommandLine, L"rundll32.exe newdev.dll,ClientSideInstall ");
3284  wcscat(CommandLine, PipeName);
3285 
3286  ZeroMemory(&StartupInfo, sizeof(StartupInfo));
3287  StartupInfo.cb = sizeof(StartupInfo);
3288 
3289  if (hUserToken)
3290  {
3291  /* newdev has to run under the environment of the current user */
3292  if (!CreateEnvironmentBlock(&Environment, hUserToken, FALSE))
3293  {
3294  DPRINT1("CreateEnvironmentBlock failed with error %d\n", GetLastError());
3295  goto cleanup;
3296  }
3297 
3298  if (!CreateProcessAsUserW(hUserToken, NULL, CommandLine, NULL, NULL, FALSE, CREATE_UNICODE_ENVIRONMENT, Environment, NULL, &StartupInfo, &ProcessInfo))
3299  {
3300  DPRINT1("CreateProcessAsUserW failed with error %u\n", GetLastError());
3301  goto cleanup;
3302  }
3303  }
3304  else
3305  {
3306  /* FIXME: This is probably not correct, I guess newdev should never be run with SYSTEM privileges.
3307 
3308  Still, we currently do that in 2nd stage setup and probably Console mode as well, so allow it here.
3309  (ShowWizard is only set to FALSE for these two modes) */
3310  ASSERT(!ShowWizard);
3311 
3312  if (!CreateProcessW(NULL, CommandLine, NULL, NULL, FALSE, 0, NULL, NULL, &StartupInfo, &ProcessInfo))
3313  {
3314  DPRINT1("CreateProcessW failed with error %u\n", GetLastError());
3315  goto cleanup;
3316  }
3317  }
3318 
3319  /* Wait for the function to connect to our pipe */
3320  if (!ConnectNamedPipe(hPipe, NULL))
3321  {
3323  {
3324  DPRINT1("ConnectNamedPipe failed with error %u\n", GetLastError());
3325  goto cleanup;
3326  }
3327  }
3328 
3329  /* Pass the data. The following output is partly compatible to Windows XP SP2 (researched using a modified newdev.dll to log this stuff) */
3330  Value = sizeof(InstallEventName);
3331  WriteFile(hPipe, &Value, sizeof(Value), &BytesWritten, NULL);
3332  WriteFile(hPipe, InstallEventName, Value, &BytesWritten, NULL);
3333 
3334  /* I couldn't figure out what the following value means under WinXP. It's usually 0 in my tests, but was also 5 once.
3335  Therefore the following line is entirely ReactOS-specific. We use the value here to pass the ShowWizard variable. */
3336  WriteFile(hPipe, &ShowWizard, sizeof(ShowWizard), &BytesWritten, NULL);
3337 
3338  Value = (wcslen(DeviceInstance) + 1) * sizeof(WCHAR);
3339  WriteFile(hPipe, &Value, sizeof(Value), &BytesWritten, NULL);
3340  WriteFile(hPipe, DeviceInstance, Value, &BytesWritten, NULL);
3341 
3342  /* Wait for newdev.dll to finish processing */
3343  WaitForSingleObject(ProcessInfo.hProcess, INFINITE);
3344 
3345  /* If the event got signalled, this is success */
3346  DeviceInstalled = WaitForSingleObject(hInstallEvent, 0) == WAIT_OBJECT_0;
3347 
3348 cleanup:
3349  if (hInstallEvent)
3350  CloseHandle(hInstallEvent);
3351 
3352  if (hPipe != INVALID_HANDLE_VALUE)
3353  CloseHandle(hPipe);
3354 
3355  if (Environment)
3356  DestroyEnvironmentBlock(Environment);
3357 
3358  if (ProcessInfo.hProcess)
3359  CloseHandle(ProcessInfo.hProcess);
3360 
3361  if (ProcessInfo.hThread)
3362  CloseHandle(ProcessInfo.hThread);
3363 
3364  if (!DeviceInstalled)
3365  {
3366  DPRINT1("InstallDevice failed for DeviceInstance '%ws'\n", DeviceInstance);
3367  }
3368 
3369  return DeviceInstalled;
3370 }
PVOID PVOID PWCHAR PVOID Environment
Definition: env.c:45
_Must_inspect_result_ _In_ PFILE_OBJECT _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ FLT_IO_OPERATION_FLAGS _Out_opt_ PULONG BytesWritten
Definition: fltkernel.h:1293
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
#define ERROR_SUCCESS
Definition: deptool.c:10
Definition: bidi.c:75
#define CREATE_UNICODE_ENVIRONMENT
Definition: winbase.h:184
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel)?(CompletionRoutine!=NULL):TRUE)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1056
#define ZeroMemory
Definition: winbase.h:1621
BOOL WINAPI CreateEnvironmentBlock(OUT LPVOID *lpEnvironment, IN HANDLE hToken, IN BOOL bInherit)
Definition: environment.c:505
#define DWORD
Definition: msvc.h:34
DWORD DWORD
Definition: winlogon.h:75
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:597
static HANDLE hInstallEvent
Definition: umpnpmgr.c:69
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
static HANDLE hUserToken
Definition: umpnpmgr.c:68
#define FALSE
Definition: types.h:117
#define PIPE_TYPE_BYTE
Definition: winbase.h:165
static HKEY hEnumKey
Definition: umpnpmgr.c:65
smooth NULL
Definition: ftsmooth.c:557
void DPRINT(...)
Definition: polytest.cpp:61
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4619
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
unsigned int BOOL
Definition: ntddk_ex.h:94
#define WAIT_OBJECT_0
Definition: winbase.h:378
DWORD cb
Definition: winbase.h:803
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
HANDLE HKEY
Definition: registry.h:24
#define swprintf(buf, format,...)
Definition: sprintf.c:56
#define PIPE_ACCESS_OUTBOUND
Definition: winbase.h:164
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
BOOL WINAPI DestroyEnvironmentBlock(IN LPVOID lpEnvironment)
Definition: environment.c:727
#define ERROR_PIPE_CONNECTED
Definition: winerror.h:352
_In_ PNDIS_STRING DeviceInstance
Definition: ndis.h:5183
UINTN UINT8 Value
Definition: acefiex.h:751
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessAsUserW(HANDLE hToken, LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: logon.c:161
DWORD *typedef HANDLE
Definition: winlogon.h:52
RPC_STATUS WINAPI UuidCreate(UUID *Uuid)
Definition: rpcrt4_main.c:281
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define DPRINT1
Definition: precomp.h:8
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
char * cleanup(char *str)
Definition: wpickclick.c:99
HANDLE WINAPI CreateNamedPipeW(LPCWSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD nMaxInstances, DWORD nOutBufferSize, DWORD nInBufferSize, DWORD nDefaultTimeOut, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: npipe.c:157
#define INFINITE
Definition: serial.h:102
BOOL WINAPI ConnectNamedPipe(IN HANDLE hNamedPipe, IN LPOVERLAPPED lpOverlapped)
Definition: npipe.c:568
BYTE * PBYTE
Definition: pedump.c:66
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define CONFIGFLAG_FAILEDINSTALL
Definition: regstr.h:396
static BOOL IsConsoleBoot ( VOID  )
static

Definition at line 3442 of file umpnpmgr.c.

Referenced by DeviceInstallThread().

3443 {
3444  HKEY ControlKey = NULL;
3445  LPWSTR SystemStartOptions = NULL;
3446  LPWSTR CurrentOption, NextOption; /* Pointers into SystemStartOptions */
3447  BOOL ConsoleBoot = FALSE;
3448  LONG rc;
3449 
3450  rc = RegOpenKeyExW(
3452  L"SYSTEM\\CurrentControlSet\\Control",
3453  0,
3455  &ControlKey);
3456 
3457  rc = ReadRegSzKey(ControlKey, L"SystemStartOptions", &SystemStartOptions);
3458  if (rc != ERROR_SUCCESS)
3459  goto cleanup;
3460 
3461  /* Check for CONSOLE switch in SystemStartOptions */
3462  CurrentOption = SystemStartOptions;
3463  while (CurrentOption)
3464  {
3465  NextOption = wcschr(CurrentOption, L' ');
3466  if (NextOption)
3467  *NextOption = L'\0';
3468  if (_wcsicmp(CurrentOption, L"CONSOLE") == 0)
3469  {
3470  DPRINT("Found %S. Switching to console boot\n", CurrentOption);
3471  ConsoleBoot = TRUE;
3472  goto cleanup;
3473  }
3474  CurrentOption = NextOption ? NextOption + 1 : NULL;
3475  }
3476 
3477 cleanup:
3478  if (ControlKey != NULL)
3479  RegCloseKey(ControlKey);
3480  HeapFree(GetProcessHeap(), 0, SystemStartOptions);
3481  return ConsoleBoot;
3482 }
static LONG ReadRegSzKey(IN HKEY hKey, IN LPCWSTR pszKey, OUT LPWSTR *pValue)
Definition: umpnpmgr.c:3374
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
Definition: bidi.c:75
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:557
void DPRINT(...)
Definition: polytest.cpp:61
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GetProcessHeap()
Definition: compat.h:395
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)
HANDLE HKEY
Definition: registry.h:24
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
char * cleanup(char *str)
Definition: wpickclick.c:99
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:394
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
static char * NextOption(const char *const ostr)
Definition: getopt.c:31
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
void __RPC_FAR* __RPC_USER midl_user_allocate ( SIZE_T  len)

Definition at line 155 of file umpnpmgr.c.

156 {
158 }
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
GLenum GLsizei len
Definition: glext.h:6722
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
void __RPC_USER midl_user_free ( void __RPC_FAR ptr)

Definition at line 161 of file umpnpmgr.c.

162 {
163  HeapFree(GetProcessHeap(), 0, ptr);
164 }
static PVOID ptr
Definition: dispmode.c:30
#define GetProcessHeap()
Definition: compat.h:395
#define HeapFree(x, y, z)
Definition: compat.h:394
static CONFIGRET MoveDeviceInstance ( LPWSTR  pszDeviceInstanceDestination,
LPWSTR  pszDeviceInstanceSource 
)
static

Definition at line 1907 of file umpnpmgr.c.

Referenced by PNP_DeviceInstanceAction().

1909 {
1910  DPRINT("MoveDeviceInstance: not implemented\n");
1911  /* FIXME */
1912  return CR_CALL_NOT_IMPLEMENTED;
1913 }
void DPRINT(...)
Definition: polytest.cpp:61
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
static CONFIGRET WINAPI NtStatusToCrError ( NTSTATUS  Status)
static

Definition at line 168 of file umpnpmgr.c.

Referenced by EnableDeviceInstance(), PNP_GetDepth(), PNP_GetDeviceList(), PNP_GetDeviceListSize(), PNP_GetDeviceRegProp(), PNP_GetDeviceStatus(), PNP_GetInterfaceDeviceList(), PNP_GetInterfaceDeviceListSize(), and PNP_GetRelatedDeviceInstance().

169 {
170  switch (Status)
171  {
173  return CR_NO_SUCH_DEVINST;
176 
177  default:
178  /* FIXME: add more mappings */
179  DPRINT1("Unable to map status 0x%08lx\n", Status);
180  return CR_FAILURE;
181  }
182 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
#define STATUS_NO_SUCH_DEVICE
Definition: udferr_usr.h:136
#define CR_FAILURE
Definition: cfgmgr32.h:865
Status
Definition: gdiplustypes.h:24
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define DPRINT1
Definition: precomp.h:8
#define CR_NO_SUCH_DEVINST
Definition: cfgmgr32.h:858
DWORD WINAPI PNP_AddEmptyLogConf ( handle_t  hBinding,
LPWSTR  pDeviceID,
DWORD  ulPriority,
DWORD pulLogConfTag,
DWORD  ulFlags 
)

Definition at line 2578 of file umpnpmgr.c.

Referenced by CM_Add_Empty_Log_Conf_Ex().

2584 {
2585  UNIMPLEMENTED;
2586  return CR_CALL_NOT_IMPLEMENTED;
2587 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_AddID ( handle_t  hBinding,
LPWSTR  pszDeviceID,
LPWSTR  pszID,
DWORD  ulFlags 
)

Definition at line 2142 of file umpnpmgr.c.

Referenced by CM_Add_ID_ExW().

2147 {
2149  HKEY hDeviceKey;
2150  LPWSTR pszSubKey;
2151  DWORD dwDeviceIdListSize;
2152  DWORD dwNewDeviceIdSize;
2153  WCHAR * pszDeviceIdList = NULL;
2154 
2155  UNREFERENCED_PARAMETER(hBinding);
2156 
2157  DPRINT("PNP_AddID() called\n");
2158  DPRINT(" DeviceInstance: %S\n", pszDeviceID);
2159  DPRINT(" DeviceId: %S\n", pszID);
2160  DPRINT(" Flags: %lx\n", ulFlags);
2161 
2162  if (RegOpenKeyExW(hEnumKey,
2163  pszDeviceID,
2164  0,
2166  &hDeviceKey) != ERROR_SUCCESS)
2167  {
2168  DPRINT("Failed to open the device key!\n");
2169  return CR_INVALID_DEVNODE;
2170  }
2171 
2172  pszSubKey = (ulFlags & CM_ADD_ID_COMPATIBLE) ? L"CompatibleIDs" : L"HardwareID";
2173 
2174  if (RegQueryValueExW(hDeviceKey,
2175  pszSubKey,
2176  NULL,
2177  NULL,
2178  NULL,
2179  &dwDeviceIdListSize) != ERROR_SUCCESS)
2180  {
2181  DPRINT("Failed to query the desired ID string!\n");
2182  ret = CR_REGISTRY_ERROR;
2183  goto Done;
2184  }
2185 
2186  dwNewDeviceIdSize = lstrlenW(pszDeviceID);
2187  if (!dwNewDeviceIdSize)
2188  {
2189  ret = CR_INVALID_POINTER;
2190  goto Done;
2191  }
2192 
2193  dwDeviceIdListSize += (dwNewDeviceIdSize + 2) * sizeof(WCHAR);
2194 
2195  pszDeviceIdList = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwDeviceIdListSize);
2196  if (!pszDeviceIdList)
2197  {
2198  DPRINT("Failed to allocate memory for the desired ID string!\n");
2199  ret = CR_OUT_OF_MEMORY;
2200  goto Done;
2201  }
2202 
2203  if (RegQueryValueExW(hDeviceKey,
2204  pszSubKey,
2205  NULL,
2206  NULL,
2207  (LPBYTE)pszDeviceIdList,
2208  &dwDeviceIdListSize) != ERROR_SUCCESS)
2209  {
2210  DPRINT("Failed to query the desired ID string!\n");
2211  ret = CR_REGISTRY_ERROR;
2212  goto Done;
2213  }
2214 
2215  /* Check whether the device ID is already in use */
2216  if (CheckForDeviceId(pszDeviceIdList, pszDeviceID))
2217  {
2218  DPRINT("Device ID was found in the ID string!\n");
2219  ret = CR_SUCCESS;
2220  goto Done;
2221  }
2222 
2223  /* Append the Device ID */
2224  AppendDeviceId(pszDeviceIdList, &dwDeviceIdListSize, pszID);
2225 
2226  if (RegSetValueExW(hDeviceKey,
2227  pszSubKey,
2228  0,
2229  REG_MULTI_SZ,
2230  (LPBYTE)pszDeviceIdList,
2231  dwDeviceIdListSize) != ERROR_SUCCESS)
2232  {
2233  DPRINT("Failed to set the desired ID string!\n");
2234  ret = CR_REGISTRY_ERROR;
2235  }
2236 
2237 Done:
2238  RegCloseKey(hDeviceKey);
2239  if (pszDeviceIdList)
2240  HeapFree(GetProcessHeap(), 0, pszDeviceIdList);
2241 
2242  DPRINT("PNP_AddID() done (returns %lx)\n", ret);
2243 
2244  return ret;
2245 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_SET_VALUE
Definition: nt_native.h:1017
Definition: bidi.c:75
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned char * LPBYTE
Definition: typedefs.h:52
#define lstrlenW
Definition: compat.h:407
DWORD DWORD
Definition: winlogon.h:75
#define CM_ADD_ID_COMPATIBLE
Definition: cfgmgr32.h:615
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define REG_MULTI_SZ
Definition: nt_native.h:1501
#define CR_SUCCESS
Definition: cfgmgr32.h:842
static HKEY hEnumKey
Definition: umpnpmgr.c:65
smooth NULL
Definition: ftsmooth.c:557
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:4917
static VOID AppendDeviceId(LPWSTR lpDeviceIdList, LPDWORD lpDeviceIdListSize, LPWSTR lpDeviceId)
Definition: umpnpmgr.c:2119
#define GetProcessHeap()
Definition: compat.h:395
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:4134
HANDLE HKEY
Definition: registry.h:24
static BOOL CheckForDeviceId(LPWSTR lpDeviceIdList, LPWSTR lpDeviceId)
Definition: umpnpmgr.c:2098
int ret
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
#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:3381
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:394
#define CR_REGISTRY_ERROR
Definition: cfgmgr32.h:875
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 2655 of file umpnpmgr.c.

2665 {
2666  UNIMPLEMENTED;
2667  return CR_CALL_NOT_IMPLEMENTED;
2668 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_ApplyPowerSettings ( handle_t  hBinding)

Definition at line 3126 of file umpnpmgr.c.

3128 {
3129  UNIMPLEMENTED;
3130  return CR_CALL_NOT_IMPLEMENTED;
3131 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_Connect ( handle_t  hBinding)

Definition at line 199 of file umpnpmgr.c.

201 {
202  UNREFERENCED_PARAMETER(hBinding);
203  return CR_SUCCESS;
204 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
#define CR_SUCCESS
Definition: cfgmgr32.h:842
DWORD WINAPI PNP_CreateDevInst ( handle_t  hBinding,
LPWSTR  pszDeviceID,
LPWSTR  pszParentDeviceID,
PNP_RPC_STRING_LEN  ulLength,
DWORD  ulFlags 
)

Definition at line 1851 of file umpnpmgr.c.

Referenced by CM_Create_DevNode_ExW().

1857 {
1859 
1860  DPRINT("PNP_CreateDevInst: %S\n", pszDeviceID);
1861 
1862  if (ulFlags & CM_CREATE_DEVNODE_GENERATE_ID)
1863  {
1864  WCHAR szGeneratedInstance[MAX_DEVICE_ID_LEN];
1865  DWORD dwInstanceNumber;
1866 
1867  /* Generated ID is: Root<Device ID><Instance number> */
1868  dwInstanceNumber = 0;
1869  do
1870  {
1871  swprintf(szGeneratedInstance, L"Root\\%ls\\%04lu",
1872  pszDeviceID, dwInstanceNumber);
1873 
1874  /* Try to create a device instance with this ID */
1875  ret = CreateDeviceInstance(szGeneratedInstance);
1876 
1877  dwInstanceNumber++;
1878  }
1879  while (ret == CR_ALREADY_SUCH_DEVINST);
1880 
1881  if (ret == CR_SUCCESS)
1882  {
1883  /* pszDeviceID is an out parameter too for generated IDs */
1884  if (wcslen(szGeneratedInstance) > ulLength)
1885  {
1886  ret = CR_BUFFER_SMALL;
1887  }
1888  else
1889  {
1890  wcscpy(pszDeviceID, szGeneratedInstance);
1891  }
1892  }
1893  }
1894  else
1895  {
1896  /* Create the device instance */
1897  ret = CreateDeviceInstance(pszDeviceID);
1898  }
1899 
1900  DPRINT("PNP_CreateDevInst() done (returns %lx)\n", ret);
1901 
1902  return ret;
1903 }
Definition: bidi.c:75
#define CM_CREATE_DEVNODE_GENERATE_ID
Definition: cfgmgr32.h:622
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CR_ALREADY_SUCH_DEVINST
Definition: cfgmgr32.h:862
DWORD DWORD
Definition: winlogon.h:75
#define CR_SUCCESS
Definition: cfgmgr32.h:842
void DPRINT(...)
Definition: polytest.cpp:61
static CONFIGRET CreateDeviceInstance(LPWSTR pszDeviceID)
Definition: umpnpmgr.c:1743
#define CR_BUFFER_SMALL
Definition: cfgmgr32.h:872
#define swprintf(buf, format,...)
Definition: sprintf.c:56
int ret
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define MAX_DEVICE_ID_LEN
Definition: cfgmgr32.h:49
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
DWORD WINAPI PNP_CreateKey ( handle_t  hBinding,
LPWSTR  pszSubKey,
DWORD  samDesired,
DWORD  ulFlags 
)

Definition at line 1166 of file umpnpmgr.c.

1171 {
1172  HKEY hKey = 0;
1173 
1175  pszSubKey,
1176  0,
1177  NULL,
1178  0,
1180  NULL,
1181  &hKey,
1182  NULL))
1183  return CR_REGISTRY_ERROR;
1184 
1185  /* FIXME: Set security key */
1186 
1187  RegCloseKey(hKey);
1188 
1189  return CR_SUCCESS;
1190 }
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:1094
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:557
HANDLE HKEY
Definition: registry.h:24
#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
DWORD WINAPI PNP_DeleteClassKey ( handle_t  hBinding,
LPWSTR  pszClassGuid,
DWORD  ulFlags 
)

Definition at line 1310 of file umpnpmgr.c.

Referenced by CM_Delete_Class_Key_Ex().

1314 {
1316 
1317  UNREFERENCED_PARAMETER(hBinding);
1318 
1319  DPRINT("PNP_GetClassName(%S, %lx) called\n", pszClassGuid, ulFlags);
1320 
1321  if (ulFlags & CM_DELETE_CLASS_SUBKEYS)
1322  {
1323  if (SHDeleteKeyW(hClassKey, pszClassGuid) != ERROR_SUCCESS)
1324  ret = CR_REGISTRY_ERROR;
1325  }
1326  else
1327  {
1328  if (RegDeleteKeyW(hClassKey, pszClassGuid) != ERROR_SUCCESS)
1329  ret = CR_REGISTRY_ERROR;
1330  }
1331 
1332  DPRINT("PNP_DeleteClassKey() done (returns %lx)\n", ret);
1333 
1334  return ret;
1335 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
#define CM_DELETE_CLASS_SUBKEYS
Definition: cfgmgr32.h:635
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
Definition: reg.c:1240
#define CR_SUCCESS
Definition: cfgmgr32.h:842
void DPRINT(...)
Definition: polytest.cpp:61
int ret
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
DWORD WINAPI SHDeleteKeyW(HKEY hKey, LPCWSTR lpszSubKey)
Definition: reg.c:1535
#define CR_REGISTRY_ERROR
Definition: cfgmgr32.h:875
static HKEY hClassKey
Definition: umpnpmgr.c:66
DWORD WINAPI PNP_DeleteRegistryKey ( handle_t  hBinding,
LPWSTR  pszDeviceID,
LPWSTR  pszParentKey,
LPWSTR  pszChildKey,
DWORD  ulFlags 
)

Definition at line 1196 of file umpnpmgr.c.

1202 {
1203  UNIMPLEMENTED;
1204  return CR_CALL_NOT_IMPLEMENTED;
1205 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_DeleteServiceDevices ( handle_t  hBinding)

Definition at line 3183 of file umpnpmgr.c.

3185 {
3186  UNIMPLEMENTED;
3187  return CR_CALL_NOT_IMPLEMENTED;
3188 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
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 2769 of file umpnpmgr.c.

2777 {
2778  UNIMPLEMENTED;
2779  return CR_CALL_NOT_IMPLEMENTED;
2780 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_DeviceInstanceAction ( handle_t  hBinding,
DWORD  ulAction,
DWORD  ulFlags,
LPWSTR  pszDeviceInstance1,
LPWSTR  pszDeviceInstance2 
)

Definition at line 1965 of file umpnpmgr.c.

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

1971 {
1973 
1974  UNREFERENCED_PARAMETER(hBinding);
1975 
1976  DPRINT("PNP_DeviceInstanceAction() called\n");
1977 
1978  switch (ulAction)
1979  {
1980  case PNP_DEVINST_MOVE:
1981  ret = MoveDeviceInstance(pszDeviceInstance1,
1982  pszDeviceInstance2);
1983  break;
1984 
1985  case PNP_DEVINST_SETUP:
1986  ret = SetupDeviceInstance(pszDeviceInstance1,
1987  ulFlags);
1988  break;
1989 
1990  case PNP_DEVINST_ENABLE:
1991  ret = EnableDeviceInstance(pszDeviceInstance1);
1992  break;
1993 
1994  case PNP_DEVINST_DISABLE:
1995  ret = DisableDeviceInstance(pszDeviceInstance1);
1996  break;
1997 
1998  case PNP_DEVINST_REENUMERATE:
1999  ret = ReenumerateDeviceInstance(pszDeviceInstance1);
2000  break;
2001 
2002  default:
2003  DPRINT1("Unknown device action %lu: not implemented\n", ulAction);
2005  }
2006 
2007  DPRINT("PNP_DeviceInstanceAction() done (returns %lx)\n", ret);
2008 
2009  return ret;
2010 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
static CONFIGRET DisableDeviceInstance(LPWSTR pszDeviceInstance)
Definition: umpnpmgr.c:1945
#define CR_SUCCESS
Definition: cfgmgr32.h:842
void DPRINT(...)
Definition: polytest.cpp:61
int ret
static CONFIGRET SetupDeviceInstance(LPWSTR pszDeviceInstance, DWORD ulFlags)
Definition: umpnpmgr.c:1917
static CONFIGRET EnableDeviceInstance(LPWSTR pszDeviceInstance)
Definition: umpnpmgr.c:1927
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define DPRINT1
Definition: precomp.h:8
static CONFIGRET ReenumerateDeviceInstance(LPWSTR pszDeviceInstance)
Definition: umpnpmgr.c:1954
static CONFIGRET MoveDeviceInstance(LPWSTR pszDeviceInstanceDestination, LPWSTR pszDeviceInstanceSource)
Definition: umpnpmgr.c:1907
DWORD WINAPI PNP_DisableDevInst ( handle_t  hBinding,
LPWSTR  pDeviceID,
PPNP_VETO_TYPE  pVetoType,
LPWSTR  pszVetoName,
DWORD  ulNameLength,
DWORD  ulFlags 
)

Definition at line 2072 of file umpnpmgr.c.

2079 {
2080  UNIMPLEMENTED;
2081  return CR_CALL_NOT_IMPLEMENTED;
2082 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_Disconnect ( handle_t  hBinding)

Definition at line 188 of file umpnpmgr.c.

190 {
191  UNREFERENCED_PARAMETER(hBinding);
192  return CR_SUCCESS;
193 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
#define CR_SUCCESS
Definition: cfgmgr32.h:842
DWORD WINAPI PNP_DriverStoreAddDriverPackage ( handle_t  hBinding)

Definition at line 3137 of file umpnpmgr.c.

3139 {
3140  UNIMPLEMENTED;
3141  return CR_CALL_NOT_IMPLEMENTED;
3142 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_DriverStoreDeleteDriverPackage ( handle_t  hBinding)

Definition at line 3148 of file umpnpmgr.c.

3150 {
3151  UNIMPLEMENTED;
3152  return CR_CALL_NOT_IMPLEMENTED;
3153 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
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 427 of file umpnpmgr.c.

Referenced by CM_Enumerate_Classes_Ex(), and CM_Enumerate_Enumerators_ExW().

435 {
437  HKEY hKey;
438  DWORD dwError;
439 
440  UNREFERENCED_PARAMETER(hBinding);
441  UNREFERENCED_PARAMETER(ulFlags);
442 
443  DPRINT("PNP_EnumerateSubKeys() called\n");
444 
445  switch (ulBranch)
446  {
447  case PNP_ENUMERATOR_SUBKEYS:
448  hKey = hEnumKey;
449  break;
450 
451  case PNP_CLASS_SUBKEYS:
452  hKey = hClassKey;
453  break;
454 
455  default:
456  return CR_FAILURE;
457  }
458 
459  *pulRequiredLen = ulLength;
460  dwError = RegEnumKeyExW(hKey,
461  ulIndex,
462  Buffer,
463  pulRequiredLen,
464  NULL,
465  NULL,
466  NULL,
467  NULL);
468  if (dwError != ERROR_SUCCESS)
469  {
470  ret = (dwError == ERROR_NO_MORE_ITEMS) ? CR_NO_SUCH_VALUE : CR_FAILURE;
471  }
472  else
473  {
474  (*pulRequiredLen)++;
475  }
476 
477  DPRINT("PNP_EnumerateSubKeys() done (returns %lx)\n", ret);
478 
479  return ret;
480 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:95
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
#define CR_NO_SUCH_VALUE
Definition: cfgmgr32.h:883
DWORD DWORD
Definition: winlogon.h:75
#define CR_SUCCESS
Definition: cfgmgr32.h:842
static HKEY hEnumKey
Definition: umpnpmgr.c:65
smooth NULL
Definition: ftsmooth.c:557
void DPRINT(...)
Definition: polytest.cpp:61
Definition: bufpool.h:45
HANDLE HKEY
Definition: registry.h:24
#define CR_FAILURE
Definition: cfgmgr32.h:865
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:2541
static HKEY hClassKey
Definition: umpnpmgr.c:66
DWORD WINAPI PNP_FreeLogConf ( handle_t  hBinding,
LPWSTR  pDeviceID,
DWORD  ulLogConfType,
DWORD  ulLogConfTag,
DWORD  ulFlags 
)

Definition at line 2593 of file umpnpmgr.c.

Referenced by CM_Free_Log_Conf_Ex().

2599 {
2600  UNIMPLEMENTED;
2601  return CR_CALL_NOT_IMPLEMENTED;
2602 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
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 2674 of file umpnpmgr.c.

2684 {
2685  UNIMPLEMENTED;
2686  return CR_CALL_NOT_IMPLEMENTED;
2687 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_GetBlockedDriverInfo ( handle_t  hBinding,
BYTE Buffer,
PNP_RPC_BUFFER_SIZE pulTransferLen,
PNP_RPC_BUFFER_SIZE pulLength,
DWORD  ulFlags 
)

Definition at line 3017 of file umpnpmgr.c.

Referenced by CMP_GetBlockedDriverInfo().

3023 {
3024  UNIMPLEMENTED;
3025  return CR_CALL_NOT_IMPLEMENTED;
3026 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_GetClassCount ( handle_t  hBinding,
DWORD pulClassCount,
DWORD  ulFlags 
)

Definition at line 1211 of file umpnpmgr.c.

1215 {
1216  HKEY hKey;
1217  DWORD dwError;
1218 
1219  UNREFERENCED_PARAMETER(hBinding);
1220  UNREFERENCED_PARAMETER(ulFlags);
1221 
1224  0,
1226  &hKey);
1227  if (dwError != ERROR_SUCCESS)
1228  return CR_INVALID_DATA;
1229 
1230  dwError = RegQueryInfoKeyW(hKey,
1231  NULL,
1232  NULL,
1233  NULL,
1234  pulClassCount,
1235  NULL,
1236  NULL,
1237  NULL,
1238  NULL,
1239  NULL,
1240  NULL,
1241  NULL);
1242  RegCloseKey(hKey);
1243  if (dwError != ERROR_SUCCESS)
1244  return CR_INVALID_DATA;
1245 
1246  return CR_SUCCESS;
1247 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
DWORD DWORD
Definition: winlogon.h:75
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:557
HANDLE HKEY
Definition: registry.h:24
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:3704
#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:3381
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
DWORD WINAPI PNP_GetClassInstance ( handle_t  hBinding,
LPWSTR  pDeviceId,
LPWSTR  pszClassInstance,
PNP_RPC_STRING_LEN  ulLength 
)

Definition at line 1152 of file umpnpmgr.c.

1157 {
1158  UNIMPLEMENTED;
1159  return CR_CALL_NOT_IMPLEMENTED;
1160 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_GetClassName ( handle_t  hBinding,
LPWSTR  pszClassGuid,
LPWSTR  Buffer,
PNP_RPC_STRING_LEN pulLength,
DWORD  ulFlags 
)

Definition at line 1253 of file umpnpmgr.c.

Referenced by CM_Get_Class_Name_ExW().

1259 {
1260  WCHAR szKeyName[MAX_PATH];
1262  HKEY hKey;
1263  DWORD dwSize;
1264 
1265  UNREFERENCED_PARAMETER(hBinding);
1266  UNREFERENCED_PARAMETER(ulFlags);
1267 
1268  DPRINT("PNP_GetClassName() called\n");
1269 
1270  lstrcpyW(szKeyName, L"System\\CurrentControlSet\\Control\\Class\\");
1271  if (lstrlenW(pszClassGuid) + 1 < sizeof(szKeyName)/sizeof(WCHAR)-(lstrlenW(szKeyName) * sizeof(WCHAR)))
1272  lstrcatW(szKeyName, pszClassGuid);
1273  else
1274  return CR_INVALID_DATA;
1275 
1277  szKeyName,
1278  0,
1280  &hKey))
1281  return CR_REGISTRY_ERROR;
1282 
1283  dwSize = *pulLength * sizeof(WCHAR);
1284  if (RegQueryValueExW(hKey,
1285  L"Class",
1286  NULL,
1287  NULL,
1288  (LPBYTE)Buffer,
1289  &dwSize))
1290  {
1291  *pulLength = 0;
1292  ret = CR_REGISTRY_ERROR;
1293  }
1294  else
1295  {
1296  *pulLength = dwSize / sizeof(WCHAR);
1297  }
1298 
1299  RegCloseKey(hKey);
1300 
1301  DPRINT("PNP_GetClassName() done (returns %lx)\n", ret);
1302 
1303  return ret;
1304 }
Definition: bidi.c:75
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned char * LPBYTE
Definition: typedefs.h:52
#define WCHAR
Definition: msvc.h:43
#define lstrlenW
Definition: compat.h:407
DWORD DWORD
Definition: winlogon.h:75
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:557
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:4134
HANDLE HKEY
Definition: registry.h:24
#define MAX_PATH
Definition: compat.h:26
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
int ret
#define lstrcpyW
Definition: compat.h:406
#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:3381
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
#define CR_REGISTRY_ERROR
Definition: cfgmgr32.h:875
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
DWORD dwSize
Definition: wglext.h:734
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 1474 of file umpnpmgr.c.

Referenced by CM_Get_Class_Registry_PropertyW().

1483 {
1485  LPWSTR lpValueName = NULL;
1486  HKEY hInstKey = NULL;
1487  HKEY hPropKey = NULL;
1488  LONG lError;
1489 
1490  UNREFERENCED_PARAMETER(hBinding);
1491 
1492  DPRINT("PNP_GetClassRegProp() called\n");
1493 
1494  if (pulTransferLen == NULL || pulLength == NULL)
1495  {
1496  ret = CR_INVALID_POINTER;
1497  goto done;
1498  }
1499 
1500  if (ulFlags != 0)
1501  {
1502  ret = CR_INVALID_FLAG;
1503  goto done;
1504  }
1505 
1506  if (*pulLength < *pulTransferLen)
1507  *pulLength = *pulTransferLen;
1508 
1509  *pulTransferLen = 0;
1510 
1511  switch (ulProperty)
1512  {
1513  case CM_CRP_SECURITY:
1514  lpValueName = L"Security";
1515  break;
1516 
1517  case CM_CRP_DEVTYPE:
1518  lpValueName = L"DeviceType";
1519  break;
1520 
1521  case CM_CRP_EXCLUSIVE:
1522  lpValueName = L"Exclusive";
1523  break;
1524 
1526  lpValueName = L"DeviceCharacteristics";
1527  break;
1528 
1529  default:
1530  ret = CR_INVALID_PROPERTY;
1531  goto done;
1532  }
1533 
1534  DPRINT("Value name: %S\n", lpValueName);
1535 
1536  lError = RegOpenKeyExW(hClassKey,
1537  pszClassGuid,
1538  0,
1539  KEY_READ,
1540  &hInstKey);
1541  if (lError != ERROR_SUCCESS)
1542  {
1543  *pulLength = 0;
1545  goto done;
1546  }
1547 
1548  lError = RegOpenKeyExW(hInstKey,
1549  L"Properties",
1550  0,
1551  KEY_READ,
1552  &hPropKey);
1553  if (lError != ERROR_SUCCESS)
1554  {
1555  *pulLength = 0;
1557  goto done;
1558  }
1559 
1560  lError = RegQueryValueExW(hPropKey,
1561  lpValueName,
1562  NULL,
1563  pulRegDataType,
1564  Buffer,
1565  pulLength);
1566  if (lError != ERROR_SUCCESS)
1567  {
1568  if (lError == ERROR_MORE_DATA)
1569  {
1570  ret = CR_BUFFER_SMALL;
1571  }
1572  else
1573  {
1574  *pulLength = 0;
1575  ret = CR_NO_SUCH_VALUE;
1576  }
1577  }
1578 
1579 done:
1580  if (ret == CR_SUCCESS)
1581  *pulTransferLen = *pulLength;
1582 
1583  if (hPropKey != NULL)
1584  RegCloseKey(hPropKey);
1585 
1586  if (hInstKey != NULL)
1587  RegCloseKey(hInstKey);
1588 
1589  DPRINT("PNP_GetClassRegProp() done (returns %lx)\n", ret);
1590 
1591  return ret;
1592 }
#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
Definition: bidi.c:75
#define KEY_READ
Definition: nt_native.h:1023
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
#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:557
#define CR_INVALID_PROPERTY
Definition: cfgmgr32.h:899
void DPRINT(...)
Definition: polytest.cpp:61
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:4134
HANDLE HKEY
Definition: registry.h:24
#define CR_BUFFER_SMALL
Definition: cfgmgr32.h:872
int ret
#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:3381
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static HKEY hClassKey
Definition: umpnpmgr.c:66
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 2907 of file umpnpmgr.c.

Referenced by CM_Get_DevNode_Custom_Property_ExW().

2916 {
2917  HKEY hDeviceKey = NULL;
2918  HKEY hParamKey = NULL;
2919  LONG lError;
2921 
2922  UNREFERENCED_PARAMETER(hBinding);
2923 
2924  DPRINT("PNP_GetCustomDevProp() called\n");
2925 
2926  if (pulTransferLen == NULL || pulLength == NULL)
2927  {
2928  ret = CR_INVALID_POINTER;
2929  goto done;
2930  }
2931 
2932  if (ulFlags & ~CM_CUSTOMDEVPROP_BITS)
2933  {
2934  ret = CR_INVALID_FLAG;
2935  goto done;
2936  }
2937 
2938  if (*pulLength < *pulTransferLen)
2939  *pulLength = *pulTransferLen;
2940 
2941  *pulTransferLen = 0;
2942 
2943  lError = RegOpenKeyExW(hEnumKey,
2944  pDeviceID,
2945  0,
2946  KEY_READ,
2947  &hDeviceKey);
2948  if (lError != ERROR_SUCCESS)
2949  {
2950  ret = CR_REGISTRY_ERROR;
2951  goto done;
2952  }
2953 
2954  lError = RegOpenKeyExW(hDeviceKey,
2955  L"Device Parameters",
2956  0,
2957  KEY_READ,
2958  &hParamKey);
2959  if (lError != ERROR_SUCCESS)
2960  {
2961  ret = CR_REGISTRY_ERROR;
2962  goto done;
2963  }
2964 
2965  lError = RegQueryValueExW(hParamKey,
2966  CustomPropName,
2967  NULL,
2968  pulRegDataType,
2969  Buffer,
2970  pulLength);
2971  if (lError != ERROR_SUCCESS)
2972  {
2973  if (lError == ERROR_MORE_DATA)
2974  {
2975  ret = CR_BUFFER_SMALL;
2976  }
2977  else
2978  {
2979  *pulLength = 0;
2980  ret = CR_NO_SUCH_VALUE;
2981  }
2982  }
2983 
2984 done:
2985  if (ret == CR_SUCCESS)
2986  *pulTransferLen = *pulLength;
2987 
2988  if (hParamKey != NULL)
2989  RegCloseKey(hParamKey);
2990 
2991  if (hDeviceKey != NULL)
2992  RegCloseKey(hDeviceKey);
2993 
2994  DPRINT("PNP_GetCustomDevProp() done (returns %lx)\n", ret);
2995 
2996  return ret;
2997 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
Definition: bidi.c:75
#define KEY_READ
Definition: nt_native.h:1023
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
#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
static HKEY hEnumKey
Definition: umpnpmgr.c:65
smooth NULL
Definition: ftsmooth.c:557
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:4134
HANDLE HKEY
Definition: registry.h:24
#define CR_BUFFER_SMALL
Definition: cfgmgr32.h:872
int ret
#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:3381
#define CR_REGISTRY_ERROR
Definition: cfgmgr32.h:875
DWORD WINAPI PNP_GetDepth ( handle_t  hBinding,
LPWSTR  pszDeviceID,
DWORD pulDepth,
DWORD  ulFlags 
)

Definition at line 648 of file umpnpmgr.c.

Referenced by CM_Get_Depth_Ex().

653 {
654  PLUGPLAY_CONTROL_DEPTH_DATA PlugPlayData;
657 
658  UNREFERENCED_PARAMETER(hBinding);
659  UNREFERENCED_PARAMETER(ulFlags);
660 
661  DPRINT("PNP_GetDepth() called\n");
662 
663  RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
664  pszDeviceID);
665 
667  (PVOID)&PlugPlayData,
669  if (NT_SUCCESS(Status))
670  {
671  *pulDepth = PlugPlayData.Depth;
672  }
673  else
674  {
675  ret = NtStatusToCrError(Status);
676  }
677 
678  DPRINT("PNP_GetDepth() done (returns %lx)\n", ret);
679 
680  return ret;
681 }
DWORD *typedef PVOID
Definition: winlogon.h:52
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
#define CR_SUCCESS
Definition: cfgmgr32.h:842
void DPRINT(...)
Definition: polytest.cpp:61
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
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:1115
LONG NTSTATUS
Definition: DriverTester.h:11
static CONFIGRET WINAPI NtStatusToCrError(NTSTATUS Status)
Definition: umpnpmgr.c:168
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
UNICODE_STRING DeviceInstance
Definition: cmtypes.h:461
DWORD WINAPI PNP_GetDeviceList ( handle_t  hBinding,
LPWSTR  pszFilter,
LPWSTR  Buffer,
PNP_RPC_STRING_LEN pulLength,
DWORD  ulFlags 
)

Definition at line 486 of file umpnpmgr.c.

Referenced by CM_Get_Device_ID_List_ExW().

492 {
496 
497  DPRINT("PNP_GetDeviceList() called\n");
498 
499  if (ulFlags & ~CM_GETIDLIST_FILTER_BITS)
500  return CR_INVALID_FLAG;
501 
502  if (pulLength == NULL || pszFilter == NULL)
503  return CR_INVALID_POINTER;
504 
505 // if (Buffer == NULL)
506 // return CR_INVALID_POINTER;
507 
508  if (ulFlags &
513  {
514  RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
515  pszFilter);
516  if (ulFlags & CM_GETIDLIST_FILTER_BUSRELATIONS)
517  {
518  PlugPlayData.Relations = 3;
519  }
520  else if (ulFlags & CM_GETIDLIST_FILTER_POWERRELATIONS)
521  {
522  PlugPlayData.Relations = 2;
523  }
524  else if (ulFlags & CM_GETIDLIST_FILTER_REMOVALRELATIONS)
525  {
526  PlugPlayData.Relations = 1;
527  }
528  else if (ulFlags & CM_GETIDLIST_FILTER_EJECTRELATIONS)
529  {
530  PlugPlayData.Relations = 0;
531  }
532 
533  PlugPlayData.BufferSize = *pulLength * sizeof(WCHAR);
534  PlugPlayData.Buffer = Buffer;
535 
537  (PVOID)&PlugPlayData,
539  if (NT_SUCCESS(Status))
540  {
541  *pulLength = PlugPlayData.BufferSize / sizeof(WCHAR);
542  }
543  else
544  {
545  ret = NtStatusToCrError(Status);
546  }
547  }
548  else if (ulFlags & CM_GETIDLIST_FILTER_SERVICE)
549  {
551  }
552  else if (ulFlags & CM_GETIDLIST_FILTER_ENUMERATOR)
553  {
555  }
556  else /* CM_GETIDLIST_FILTER_NONE */
557  {
559  }
560 
561  return ret;
562 }
DWORD *typedef PVOID
Definition: winlogon.h:52
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
#define CM_GETIDLIST_FILTER_SERVICE
Definition: cfgmgr32.h:656
#define WCHAR
Definition: msvc.h:43
#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:557
void DPRINT(...)
Definition: polytest.cpp:61
#define CM_GETIDLIST_FILTER_REMOVALRELATIONS
Definition: cfgmgr32.h:658
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
UINTN VOID * Buffer
Definition: acefiex.h:370
#define CM_GETIDLIST_FILTER_POWERRELATIONS
Definition: cfgmgr32.h:659
int ret
Status
Definition: gdiplustypes.h:24
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
NTSTATUS NTAPI NtPlugPlayControl(IN PLUGPLAY_CONTROL_CLASS PlugPlayControlClass, IN OUT PVOID Buffer, IN ULONG BufferLength)
Definition: plugplay.c:1115
LONG NTSTATUS
Definition: DriverTester.h:11
static CONFIGRET WINAPI NtStatusToCrError(NTSTATUS Status)
Definition: umpnpmgr.c:168
#define CM_GETIDLIST_FILTER_ENUMERATOR
Definition: cfgmgr32.h:655
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define CM_GETIDLIST_FILTER_BITS
Definition: cfgmgr32.h:669
DWORD WINAPI PNP_GetDeviceListSize ( handle_t  hBinding,
LPWSTR  pszFilter,
PNP_RPC_BUFFER_SIZE pulLength,
DWORD  ulFlags 
)

Definition at line 568 of file umpnpmgr.c.

Referenced by CM_Get_Device_ID_List_Size_ExW().

573 {
577 
578  DPRINT("PNP_GetDeviceListSize() called\n");
579 
580  if (ulFlags & ~CM_GETIDLIST_FILTER_BITS)
581  return CR_INVALID_FLAG;
582 
583  if (pulLength == NULL || pszFilter == NULL)
584  return CR_INVALID_POINTER;
585 
586  *pulLength = 0;
587 
588  if (ulFlags &
593  {
594  RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
595  pszFilter);
596  if (ulFlags & CM_GETIDLIST_FILTER_BUSRELATIONS)
597  {
598  PlugPlayData.Relations = 3;
599  }
600  else if (ulFlags & CM_GETIDLIST_FILTER_POWERRELATIONS)
601  {
602  PlugPlayData.Relations = 2;
603  }
604  else if (ulFlags & CM_GETIDLIST_FILTER_REMOVALRELATIONS)
605  {
606  PlugPlayData.Relations = 1;
607  }
608  else if (ulFlags & CM_GETIDLIST_FILTER_EJECTRELATIONS)
609  {
610  PlugPlayData.Relations = 0;
611  }
612 
613  PlugPlayData.BufferSize = 0;
614  PlugPlayData.Buffer = NULL;
615 
617  (PVOID)&PlugPlayData,
619  if (NT_SUCCESS(Status))
620  {
621  *pulLength = PlugPlayData.BufferSize / sizeof(WCHAR);
622  }
623  else
624  {
625  ret = NtStatusToCrError(Status);
626  }
627  }
628  else if (ulFlags & CM_GETIDLIST_FILTER_SERVICE)
629  {
631  }
632  else if (ulFlags & CM_GETIDLIST_FILTER_ENUMERATOR)
633  {
635  }
636  else /* CM_GETIDLIST_FILTER_NONE */
637  {
639  }
640 
641  return ret;
642 }
DWORD *typedef PVOID
Definition: winlogon.h:52
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
#define CM_GETIDLIST_FILTER_SERVICE
Definition: cfgmgr32.h:656
#define WCHAR
Definition: msvc.h:43
#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:557
void DPRINT(...)
Definition: polytest.cpp:61
#define CM_GETIDLIST_FILTER_REMOVALRELATIONS
Definition: cfgmgr32.h:658
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
#define CM_GETIDLIST_FILTER_POWERRELATIONS
Definition: cfgmgr32.h:659
int ret
Status
Definition: gdiplustypes.h:24
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
NTSTATUS NTAPI NtPlugPlayControl(IN PLUGPLAY_CONTROL_CLASS PlugPlayControlClass, IN OUT PVOID Buffer, IN ULONG BufferLength)
Definition: plugplay.c:1115
LONG NTSTATUS
Definition: DriverTester.h:11
static CONFIGRET WINAPI NtStatusToCrError(NTSTATUS Status)
Definition: umpnpmgr.c:168
#define CM_GETIDLIST_FILTER_ENUMERATOR
Definition: cfgmgr32.h:655
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define CM_GETIDLIST_FILTER_BITS
Definition: cfgmgr32.h:669
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 687 of file umpnpmgr.c.

Referenced by CM_Get_DevNode_Registry_Property_ExW().

696 {
697  PLUGPLAY_CONTROL_PROPERTY_DATA PlugPlayData;
699  LPWSTR lpValueName = NULL;
700  HKEY hKey = NULL;
701  LONG lError;
703 
704  UNREFERENCED_PARAMETER(hBinding);
705 
706  DPRINT("PNP_GetDeviceRegProp() called\n");
707 
708  if (pulTransferLen == NULL || pulLength == NULL)
709  {
710  ret = CR_INVALID_POINTER;
711  goto done;
712  }
713 
714  if (ulFlags != 0)
715  {
716  ret = CR_INVALID_FLAG;
717  goto done;
718  }
719 
720  /* FIXME: Check pDeviceID */
721 
722  if (*pulLength < *pulTransferLen)
723  *pulLength = *pulTransferLen;
724 
725  *pulTransferLen = 0;
726 
727  switch (ulProperty)
728  {
729  case CM_DRP_DEVICEDESC:
730  lpValueName = L"DeviceDesc";
731  break;
732 
733  case CM_DRP_HARDWAREID:
734  lpValueName = L"HardwareID";
735  break;
736 
738  lpValueName = L"CompatibleIDs";
739  break;
740 
741  case CM_DRP_SERVICE:
742  lpValueName = L"Service";
743  break;
744 
745  case CM_DRP_CLASS:
746  lpValueName = L"Class";
747  break;
748 
749  case CM_DRP_CLASSGUID:
750  lpValueName = L"ClassGUID";
751  break;
752 
753  case CM_DRP_DRIVER:
754  lpValueName = L"Driver";
755  break;
756 
757  case CM_DRP_CONFIGFLAGS:
758  lpValueName = L"ConfigFlags";
759  break;
760 
761  case CM_DRP_MFG:
762  lpValueName = L"Mfg";
763  break;
764 
765  case CM_DRP_FRIENDLYNAME:
766  lpValueName = L"FriendlyName";
767  break;
768 
770  lpValueName = L"LocationInformation";
771  break;
772 
774  lpValueName = NULL;
775  break;
776 
777  case CM_DRP_CAPABILITIES:
778  lpValueName = L"Capabilities";
779  break;
780 
781  case CM_DRP_UI_NUMBER:
782  lpValueName = NULL;
783  break;
784 
785  case CM_DRP_UPPERFILTERS:
786  lpValueName = L"UpperFilters";
787  break;
788 
789  case CM_DRP_LOWERFILTERS:
790  lpValueName = L"LowerFilters";
791  break;
792 
793  case CM_DRP_BUSTYPEGUID:
794  lpValueName = NULL;
795  break;
796 
798  lpValueName = NULL;
799  break;
800 
801  case CM_DRP_BUSNUMBER:
802  lpValueName = NULL;
803  break;
804 
806  lpValueName = NULL;
807  break;
808 
809  case CM_DRP_SECURITY:
810  lpValueName = L"Security";
811  break;
812 
813  case CM_DRP_DEVTYPE:
814  lpValueName = L"DeviceType";
815  break;
816 
817  case CM_DRP_EXCLUSIVE:
818  lpValueName = L"Exclusive";
819  break;
820 
822  lpValueName = L"DeviceCharacteristics";
823  break;
824 
825  case CM_DRP_ADDRESS:
826  lpValueName = NULL;
827  break;
828 
830  lpValueName = L"UINumberDescFormat";
831  break;
832 
834  lpValueName = NULL;
835  break;
836 
838  lpValueName = NULL;
839  break;
840 
842  lpValueName = NULL;
843  break;
844 
846  lpValueName = L"RemovalPolicy";
847  break;
848 
850  lpValueName = NULL;
851  break;
852 
853 #if (WINVER >= _WIN32_WINNT_WS03)
855  lpValueName = NULL;
856  break;
857 #endif
858 
859 #if (WINVER >= _WIN32_WINNT_WIN7)
861  lpValueName = NULL;
862  break;
863 #endif
864 
865  default:
866  ret = CR_INVALID_PROPERTY;
867  goto done;
868  }
869 
870  DPRINT("Value name: %S\n", lpValueName);
871 
872  if (lpValueName)
873  {
874  /* Retrieve information from the Registry */
875  lError = RegOpenKeyExW(hEnumKey,
876  pDeviceID,
877  0,
879  &hKey);
880  if (lError != ERROR_SUCCESS)
881  {
882  hKey = NULL;
883  *pulLength = 0;
884  ret = CR_INVALID_DEVNODE;
885  goto done;
886  }
887 
888  lError = RegQueryValueExW(hKey,
889  lpValueName,
890  NULL,
891  pulRegDataType,
892  Buffer,
893  pulLength);
894  if (lError != ERROR_SUCCESS)
895  {
896  if (lError == ERROR_MORE_DATA)
897  {
898  ret = CR_BUFFER_SMALL;
899  }
900  else
901  {
902  *pulLength = 0;
903  ret = CR_NO_SUCH_VALUE;
904  }
905  }
906  }
907  else
908  {
909  /* Retrieve information from the Device Node */
910  RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
911  pDeviceID);
912  PlugPlayData.Buffer = Buffer;
913  PlugPlayData.BufferSize = *pulLength;
914 
915  switch (ulProperty)
916  {
918  PlugPlayData.Property = 0xb; // DevicePropertyPhysicalDeviceObjectName;
919  break;
920 
921  case CM_DRP_UI_NUMBER:
922  PlugPlayData.Property = 0x11; // DevicePropertyUINumber;
923  break;
924 
925  case CM_DRP_BUSTYPEGUID:
926  PlugPlayData.Property = 0xc; // DevicePropertyBusTypeGuid;
927  break;
928 
930  PlugPlayData.Property = 0xd; // DevicePropertyLegacyBusType;
931  break;
932 
933  case CM_DRP_BUSNUMBER:
934  PlugPlayData.Property = 0xe; // DevicePropertyBusNumber;
935  break;
936 
938  PlugPlayData.Property = 0xf; // DevicePropertyEnumeratorName;
939  break;
940 
941  case CM_DRP_ADDRESS:
942  PlugPlayData.Property = 0x10; // DevicePropertyAddress;
943  break;
944 
945 #if 0
946  /* FIXME: This property is not supported by IoGetDeviceProperty */
948 #endif
949 
951  PlugPlayData.Property = 0x13; // DevicePropertyRemovalPolicy
952  break;
953 
954 #if 0
955  /* FIXME: This property is not supported by IoGetDeviceProperty */
957 #endif
958 
960  PlugPlayData.Property = 0x12; // DevicePropertyInstallState;
961  break;
962 
963 #if 0
964  /* FIXME: This property is not supported by IoGetDeviceProperty */
965 #if (WINVER >= _WIN32_WINNT_WS03)
967 #endif
968 #endif
969 
970 #if (WINVER >= _WIN32_WINNT_WIN7)
972  PlugPlayData.Property = 0x16; // DevicePropertyContainerID;
973  break;
974 #endif
975 
976  default:
977  return CR_INVALID_PROPERTY;
978  }
979 
981  (PVOID)&PlugPlayData,
983  if (NT_SUCCESS(Status))
984  {
985  *pulLength = PlugPlayData.BufferSize;
986  }
987  else
988  {
989  ret = NtStatusToCrError(Status);
990  }
991  }
992 
993 done:
994 
995  if (pulTransferLen)
996  *pulTransferLen = (ret == CR_SUCCESS) ? *pulLength : 0;
997 
998  if (hKey != NULL)
999  RegCloseKey(hKey);
1000 
1001  DPRINT("PNP_GetDeviceRegProp() done (returns %lx)\n", ret);
1002 
1003  return ret;
1004 }
DWORD *typedef PVOID
Definition: winlogon.h:52
#define ERROR_SUCCESS
Definition: deptool.c:10
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
Definition: bidi.c:75
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
#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
#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
static HKEY hEnumKey
Definition: umpnpmgr.c:65
smooth NULL
Definition: ftsmooth.c:557
#define CM_DRP_CLASSGUID
Definition: cfgmgr32.h:684
#define CR_INVALID_PROPERTY
Definition: cfgmgr32.h:899
void DPRINT(...)
Definition: polytest.cpp:61
Definition: bufpool.h:45
#define CM_DRP_DEVTYPE
Definition: cfgmgr32.h:709
UNICODE_STRING DeviceInstance
Definition: cmtypes.h:434
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
HANDLE HKEY
Definition: registry.h:24
#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
UINTN VOID * Buffer
Definition: acefiex.h:370
#define CM_DRP_BASE_CONTAINERID
Definition: cfgmgr32.h:728
#define CM_DRP_DRIVER
Definition: cfgmgr32.h:685
int ret
#define CM_DRP_DEVICEDESC
Definition: cfgmgr32.h:676
#define CM_DRP_PHYSICAL_DEVICE_OBJECT_NAME
Definition: cfgmgr32.h:690
#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:1115
#define CM_DRP_CHARACTERISTICS
Definition: cfgmgr32.h:713
LONG NTSTATUS
Definition: DriverTester.h:11
static CONFIGRET WINAPI NtStatusToCrError(NTSTATUS Status)
Definition: umpnpmgr.c:168
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define CM_DRP_CONFIGFLAGS
Definition: cfgmgr32.h:686
#define CM_DRP_CLASS
Definition: cfgmgr32.h:683
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:3381
#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 CM_DRP_INSTALL_STATE
Definition: cfgmgr32.h:722
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define CM_DRP_CAPABILITIES
Definition: cfgmgr32.h:691
#define CM_DRP_BUSNUMBER
Definition: cfgmgr32.h:703
DWORD WINAPI PNP_GetDeviceStatus ( handle_t  hBinding,
LPWSTR  pDeviceID,
DWORD pulStatus,
DWORD pulProblem,
DWORD  ulFlags 
)

Definition at line 2016 of file umpnpmgr.c.

Referenced by CM_Get_DevNode_Status_Ex().

2022 {
2023  PLUGPLAY_CONTROL_STATUS_DATA PlugPlayData;
2025  NTSTATUS Status;
2026 
2027  UNREFERENCED_PARAMETER(hBinding);
2028  UNREFERENCED_PARAMETER(ulFlags);
2029 
2030  DPRINT("PNP_GetDeviceStatus() called\n");
2031 
2032  RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
2033  pDeviceID);
2034  PlugPlayData.Operation = 0; /* Get status */
2035 
2037  (PVOID)&PlugPlayData,
2039  if (NT_SUCCESS(Status))
2040  {
2041  *pulStatus = PlugPlayData.DeviceStatus;
2042  *pulProblem = PlugPlayData.DeviceProblem;
2043  }
2044  else
2045  {
2046  ret = NtStatusToCrError(Status);
2047  }
2048 
2049  DPRINT("PNP_GetDeviceStatus() done (returns %lx)\n", ret);
2050 
2051  return ret;
2052 }
DWORD *typedef PVOID
Definition: winlogon.h:52
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
UNICODE_STRING DeviceInstance
Definition: cmtypes.h:452
#define CR_SUCCESS
Definition: cfgmgr32.h:842
void DPRINT(...)
Definition: polytest.cpp:61
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
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:1115
LONG NTSTATUS
Definition: DriverTester.h:11
static CONFIGRET WINAPI NtStatusToCrError(NTSTATUS Status)
Definition: umpnpmgr.c:168
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
DWORD WINAPI PNP_GetFirstLogConf ( handle_t  hBinding,
LPWSTR  pDeviceID,
DWORD  ulLogConfType,
DWORD pulLogConfTag,
DWORD  ulFlags 
)

Definition at line 2608 of file umpnpmgr.c.

Referenced by CM_Get_First_Log_Conf_Ex().

2614 {
2615  UNIMPLEMENTED;
2616  return CR_CALL_NOT_IMPLEMENTED;
2617 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_GetGlobalState ( handle_t  hBinding,
DWORD pulState,
DWORD  ulFlags 
)

Definition at line 224 of file umpnpmgr.c.

Referenced by CM_Get_Global_State_Ex().

228 {
229  UNREFERENCED_PARAMETER(hBinding);
230  UNREFERENCED_PARAMETER(ulFlags);
231 
233  return CR_SUCCESS;
234 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
#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
DWORD WINAPI PNP_GetHwProfInfo ( handle_t  hBinding,
DWORD  ulIndex,
HWPROFILEINFO pHWProfileInfo,
DWORD  ulProfileInfoSize,
DWORD  ulFlags 
)

Definition at line 2443 of file umpnpmgr.c.

Referenced by CM_Get_Hardware_Profile_Info_ExW().

2449 {
2450  WCHAR szProfileName[5];
2451  HKEY hKeyConfig = NULL;
2452  HKEY hKeyProfiles = NULL;
2453  HKEY hKeyProfile = NULL;
2454  DWORD dwDisposition;
2455  DWORD dwSize;
2456  LONG lError;
2458 
2459  UNREFERENCED_PARAMETER(hBinding);
2460 
2461  DPRINT("PNP_GetHwProfInfo() called\n");
2462 
2463  if (ulProfileInfoSize == 0)
2464  {
2465  ret = CR_INVALID_DATA;
2466  goto done;
2467  }
2468 
2469  if (ulFlags != 0)
2470  {
2471  ret = CR_INVALID_FLAG;
2472  goto done;
2473  }
2474 
2475  /* Initialize the profile information */
2476  pHWProfileInfo->HWPI_ulHWProfile = 0;
2477  pHWProfileInfo->HWPI_szFriendlyName[0] = 0;
2478  pHWProfileInfo->HWPI_dwFlags = 0;
2479 
2480  /* Open the 'IDConfigDB' key */
2482  L"System\\CurrentControlSet\\Control\\IDConfigDB",
2483  0,
2484  NULL,
2487  NULL,
2488  &hKeyConfig,
2489  &dwDisposition);
2490  if (lError != ERROR_SUCCESS)
2491  {
2492  ret = CR_REGISTRY_ERROR;
2493  goto done;
2494  }
2495 
2496  /* Open the 'Hardware Profiles' subkey */
2497  lError = RegCreateKeyExW(hKeyConfig,
2498  L"Hardware Profiles",
2499  0,
2500  NULL,
2503  NULL,
2504  &hKeyProfiles,
2505  &dwDisposition);
2506  if (lError != ERROR_SUCCESS)
2507  {
2508  ret = CR_REGISTRY_ERROR;
2509  goto done;
2510  }
2511 
2512  if (ulIndex == (ULONG)-1)
2513  {
2514  dwSize = sizeof(ULONG);
2515  lError = RegQueryValueExW(hKeyConfig,
2516  L"CurrentConfig",
2517  NULL,
2518  NULL,
2519  (LPBYTE)&pHWProfileInfo->HWPI_ulHWProfile,
2520  &dwSize);
2521  if (lError != ERROR_SUCCESS)
2522  {
2523  pHWProfileInfo->HWPI_ulHWProfile = 0;
2524  ret = CR_REGISTRY_ERROR;
2525  goto done;
2526  }
2527  }
2528  else
2529  {
2530  /* FIXME: not implemented yet */
2532  goto done;
2533  }
2534 
2535  swprintf(szProfileName, L"%04lu", pHWProfileInfo->HWPI_ulHWProfile);
2536 
2537  lError = RegOpenKeyExW(hKeyProfiles,
2538  szProfileName,
2539  0,
2541  &hKeyProfile);
2542  if (lError != ERROR_SUCCESS)
2543  {
2544  ret = CR_REGISTRY_ERROR;
2545  goto done;
2546  }
2547 
2548  dwSize = sizeof(pHWProfileInfo->HWPI_szFriendlyName);
2549  lError = RegQueryValueExW(hKeyProfile,
2550  L"FriendlyName",
2551  NULL,
2552  NULL,
2553  (LPBYTE)&pHWProfileInfo->HWPI_szFriendlyName,
2554  &dwSize);
2555  if (lError != ERROR_SUCCESS)
2556  {
2557  ret = CR_REGISTRY_ERROR;
2558  goto done;
2559  }
2560 
2561 done:
2562  if (hKeyProfile != NULL)
2563  RegCloseKey(hKeyProfile);
2564 
2565  if (hKeyProfiles != NULL)
2566  RegCloseKey(hKeyProfiles);
2567 
2568  if (hKeyConfig != NULL)
2569  RegCloseKey(hKeyConfig);
2570 
2571  return ret;
2572 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
Definition: bidi.c:75
DWORD HWPI_dwFlags
Definition: cfgmgr32.h:556
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned char * LPBYTE
Definition: typedefs.h:52
DWORD DWORD
Definition: winlogon.h:75
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:1094
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:557
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:4134
HANDLE HKEY
Definition: registry.h:24
#define swprintf(buf, format,...)
Definition: sprintf.c:56
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
int ret
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:3381
#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
DWORD dwSize
Definition: wglext.h:734
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 1341 of file umpnpmgr.c.

Referenced by CM_Get_Device_Interface_Alias_ExW().

1349 {
1350  UNIMPLEMENTED;
1351  return CR_CALL_NOT_IMPLEMENTED;
1352 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_GetInterfaceDeviceList ( handle_t  hBinding,
GUID InterfaceGuid,
LPWSTR  pszDeviceID,
BYTE Buffer,
PNP_RPC_BUFFER_SIZE pulLength,
DWORD  ulFlags 
)

Definition at line 1358 of file umpnpmgr.c.

Referenced by CM_Get_Device_Interface_List_ExW().

1365 {
1366  NTSTATUS Status;
1368  DWORD ret = CR_SUCCESS;
1369 
1370  UNREFERENCED_PARAMETER(hBinding);
1371 
1372  RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
1373  pszDeviceID);
1374 
1375  PlugPlayData.Flags = ulFlags;
1376  PlugPlayData.FilterGuid = InterfaceGuid;
1377  PlugPlayData.Buffer = Buffer;
1378  PlugPlayData.BufferSize = *pulLength;
1379 
1381  (PVOID)&PlugPlayData,
1383  if (NT_SUCCESS(Status))
1384  {
1385  *pulLength = PlugPlayData.BufferSize;
1386  }
1387  else
1388  {
1389  ret = NtStatusToCrError(Status);
1390  }
1391 
1392  DPRINT("PNP_GetInterfaceDeviceListSize() done (returns %lx)\n", ret);
1393  return ret;
1394 }
DWORD *typedef PVOID
Definition: winlogon.h:52
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
DWORD DWORD
Definition: winlogon.h:75
#define CR_SUCCESS
Definition: cfgmgr32.h:842
void DPRINT(...)
Definition: polytest.cpp:61
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
UINTN VOID * Buffer
Definition: acefiex.h:370
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:1115
LONG NTSTATUS
Definition: DriverTester.h:11
static CONFIGRET WINAPI NtStatusToCrError(NTSTATUS Status)
Definition: umpnpmgr.c:168
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
DWORD WINAPI PNP_GetInterfaceDeviceListSize ( handle_t  hBinding,
PNP_RPC_BUFFER_SIZE pulLen,
GUID InterfaceGuid,
LPWSTR  pszDeviceID,
DWORD  ulFlags 
)

Definition at line 1400 of file umpnpmgr.c.

Referenced by CM_Get_Device_Interface_List_Size_ExW().

1406 {
1407  NTSTATUS Status;
1409  DWORD ret = CR_SUCCESS;
1410 
1411  UNREFERENCED_PARAMETER(hBinding);
1412 
1413  DPRINT("PNP_GetInterfaceDeviceListSize() called\n");
1414 
1415  RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
1416  pszDeviceID);
1417 
1418  PlugPlayData.FilterGuid = InterfaceGuid;
1419  PlugPlayData.Buffer = NULL;
1420  PlugPlayData.BufferSize = 0;
1421  PlugPlayData.Flags = ulFlags;
1422 
1424  (PVOID)&PlugPlayData,
1426  if (NT_SUCCESS(Status))
1427  {
1428  *pulLen = PlugPlayData.BufferSize;
1429  }
1430  else
1431  {
1432  ret = NtStatusToCrError(Status);
1433  }
1434 
1435  DPRINT("PNP_GetInterfaceDeviceListSize() done (returns %lx)\n", ret);
1436  return ret;
1437 }
DWORD *typedef PVOID
Definition: winlogon.h:52
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
DWORD DWORD
Definition: winlogon.h:75
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:557
void DPRINT(...)
Definition: polytest.cpp:61
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
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:1115
LONG NTSTATUS
Definition: DriverTester.h:11
static CONFIGRET WINAPI NtStatusToCrError(NTSTATUS Status)
Definition: umpnpmgr.c:168
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
DWORD WINAPI PNP_GetLogConfPriority ( handle_t  hBinding,
LPWSTR  pDeviceID,
DWORD  ulType,
DWORD  ulTag,
DWORD pPriority,
DWORD  ulFlags 
)

Definition at line 2639 of file umpnpmgr.c.

Referenced by CM_Get_Log_Conf_Priority_Ex().

2646 {
2647  UNIMPLEMENTED;
2648  return CR_CALL_NOT_IMPLEMENTED;
2649 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_GetNextLogConf ( handle_t  hBinding,
LPWSTR  pDeviceID,
DWORD  ulLogConfType,
DWORD  ulCurrentTag,
DWORD pulNextTag,
DWORD  ulFlags 
)

Definition at line 2623 of file umpnpmgr.c.

Referenced by CM_Get_Next_Log_Conf_Ex().

2630 {
2631  UNIMPLEMENTED;
2632  return CR_CALL_NOT_IMPLEMENTED;
2633 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
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 2693 of file umpnpmgr.c.

2703 {
2704  UNIMPLEMENTED;
2705  return CR_CALL_NOT_IMPLEMENTED;
2706 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
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 3076 of file umpnpmgr.c.

3087 {
3088  UNIMPLEMENTED;
3089  return CR_CALL_NOT_IMPLEMENTED;
3090 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
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 3058 of file umpnpmgr.c.

3067 {
3068  UNIMPLEMENTED;
3069  return CR_CALL_NOT_IMPLEMENTED;
3070 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_GetRelatedDeviceInstance ( handle_t  hBinding,
DWORD  ulRelationship,
LPWSTR  pDeviceID,
LPWSTR  pRelatedDeviceId,
PNP_RPC_STRING_LEN pulLength,
DWORD  ulFlags 
)

Definition at line 379 of file umpnpmgr.c.

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

386 {
390 
391  UNREFERENCED_PARAMETER(hBinding);
392  UNREFERENCED_PARAMETER(ulFlags);
393 
394  DPRINT("PNP_GetRelatedDeviceInstance() called\n");
395  DPRINT(" Relationship %ld\n", ulRelationship);
396  DPRINT(" DeviceId %S\n", pDeviceID);
397 
399  pDeviceID);
400 
401  PlugPlayData.Relation = ulRelationship;
402 
403  PlugPlayData.RelatedDeviceInstanceLength = *pulLength;
404  PlugPlayData.RelatedDeviceInstance = pRelatedDeviceId;
405 
407  (PVOID)&PlugPlayData,
409  if (!NT_SUCCESS(Status))
410  {
411  ret = NtStatusToCrError(Status);
412  }
413 
414  DPRINT("PNP_GetRelatedDeviceInstance() done (returns %lx)\n", ret);
415  if (ret == CR_SUCCESS)
416  {
417  DPRINT("RelatedDevice: %wZ\n", &PlugPlayData.RelatedDeviceInstance);
418  }
419 
420  return ret;
421 }
DWORD *typedef PVOID
Definition: winlogon.h:52
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
#define CR_SUCCESS
Definition: cfgmgr32.h:842
void DPRINT(...)
Definition: polytest.cpp:61
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
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:1115
LONG NTSTATUS
Definition: DriverTester.h:11
static CONFIGRET WINAPI NtStatusToCrError(NTSTATUS Status)
Definition: umpnpmgr.c:168
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
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 2712 of file umpnpmgr.c.

2722 {
2723  UNIMPLEMENTED;
2724  return CR_CALL_NOT_IMPLEMENTED;
2725 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_GetResDesDataSize ( handle_t  hBinding,
LPWSTR  pDeviceID,
DWORD  ulLogConfTag,
DWORD  ulLogConfType,
RESOURCEID  ResourceID,
DWORD  ulResourceTag,
DWORD pulSize,
DWORD  ulFlags 
)

Definition at line 2731 of file umpnpmgr.c.

2740 {
2741  UNIMPLEMENTED;
2742  return CR_CALL_NOT_IMPLEMENTED;
2743 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_GetRootDeviceInstance ( handle_t  hBinding,
LPWSTR  pDeviceID,
PNP_RPC_STRING_LEN  ulLength 
)

Definition at line 344 of file umpnpmgr.c.

Referenced by CM_Locate_DevNode_ExW().

348 {
350 
351  UNREFERENCED_PARAMETER(hBinding);
352 
353  DPRINT("PNP_GetRootDeviceInstance() called\n");
354 
355  if (!pDeviceID)
356  {
357  ret = CR_INVALID_POINTER;
358  goto Done;
359  }
360  if (ulLength < lstrlenW(szRootDeviceId) + 1)
361  {
362  ret = CR_BUFFER_SMALL;
363  goto Done;
364  }
365 
366  lstrcpyW(pDeviceID,
368 
369 Done:
370  DPRINT("PNP_GetRootDeviceInstance() done (returns %lx)\n", ret);
371 
372  return ret;
373 }
static WCHAR szRootDeviceId[]
Definition: umpnpmgr.c:63
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
#define lstrlenW
Definition: compat.h:407
#define CR_SUCCESS
Definition: cfgmgr32.h:842
void DPRINT(...)
Definition: polytest.cpp:61
#define CR_BUFFER_SMALL
Definition: cfgmgr32.h:872
int ret
#define lstrcpyW
Definition: compat.h:406
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
DWORD WINAPI PNP_GetServerSideDeviceInstallFlags ( handle_t  hBinding,
DWORD pulSSDIFlags,
DWORD  ulFlags 
)

Definition at line 3032 of file umpnpmgr.c.

Referenced by CMP_GetServerSideDeviceInstallFlags().

3036 {
3037  UNREFERENCED_PARAMETER(hBinding);
3038 
3039  DPRINT1("PNP_GetServerSideDeviceInstallFlags(%p %p %lu)\n",
3040  hBinding, pulSSDIFlags, ulFlags);
3041 
3042  if (pulSSDIFlags == NULL)
3043  return CR_INVALID_POINTER;
3044 
3045  if (ulFlags != 0)
3046  return CR_INVALID_FLAG;
3047 
3048  /* FIXME */
3049  *pulSSDIFlags = 0;
3050 
3051  return CR_SUCCESS;
3052 }
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:557
#define DPRINT1
Definition: precomp.h:8
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
DWORD WINAPI PNP_GetVersion ( handle_t  hBinding,
WORD pVersion 
)

Definition at line 210 of file umpnpmgr.c.

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

213 {
214  UNREFERENCED_PARAMETER(hBinding);
215 
216  *pVersion = 0x0400;
217  return CR_SUCCESS;
218 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
#define CR_SUCCESS
Definition: cfgmgr32.h:842
DWORD WINAPI PNP_GetVersionInternal ( handle_t  hBinding,
WORD pwVersion 
)

Definition at line 3003 of file umpnpmgr.c.

3006 {
3007  UNREFERENCED_PARAMETER(hBinding);
3008 
3009  *pwVersion = 0x501;
3010  return CR_SUCCESS;
3011 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
#define CR_SUCCESS
Definition: cfgmgr32.h:842
DWORD WINAPI PNP_HwProfFlags ( handle_t  hBinding,
DWORD  ulAction,
LPWSTR  pDeviceID,
DWORD  ulConfig,
DWORD pulValue,
PPNP_VETO_TYPE  pVetoType,
LPWSTR  pszVetoName,
DWORD  ulNameLength,
DWORD  ulFlags 
)

Definition at line 2362 of file umpnpmgr.c.

Referenced by CM_Get_HW_Prof_Flags_ExW(), and CM_Set_HW_Prof_Flags_ExW().

2372 {
2374  WCHAR szKeyName[MAX_PATH];
2375  HKEY hKey;
2376  HKEY hDeviceKey;
2377  DWORD dwSize;
2378 
2379  UNREFERENCED_PARAMETER(hBinding);
2380 
2381  DPRINT("PNP_HwProfFlags() called\n");
2382 
2383  if (ulConfig == 0)
2384  {
2385  wcscpy(szKeyName,
2386  L"System\\CurrentControlSet\\HardwareProfiles\\Current\\System\\CurrentControlSet\\Enum");
2387  }
2388  else
2389  {
2390  swprintf(szKeyName,
2391  L"System\\CurrentControlSet\\HardwareProfiles\\%04lu\\System\\CurrentControlSet\\Enum",
2392  ulConfig);
2393  }
2394 
2396  szKeyName,
2397  0,
2399  &hKey) != ERROR_SUCCESS)
2400  return CR_REGISTRY_ERROR;
2401 
2402  if (ulAction == PNP_GET_HWPROFFLAGS)
2403  {
2404  if (RegOpenKeyExW(hKey,
2405  pDeviceID,
2406  0,
2408  &hDeviceKey) != ERROR_SUCCESS)
2409  {
2410  *pulValue = 0;
2411  }
2412  else
2413  {
2414  dwSize = sizeof(DWORD);
2415  if (!RegQueryValueExW(hDeviceKey,
2416  L"CSConfigFlags",
2417  NULL,
2418  NULL,
2419  (LPBYTE)pulValue,
2420  &dwSize) != ERROR_SUCCESS)
2421  {
2422  *pulValue = 0;
2423  }
2424 
2425  RegCloseKey(hDeviceKey);
2426  }
2427  }
2428  else if (ulAction == PNP_SET_HWPROFFLAGS)
2429  {
2430  /* FIXME: not implemented yet */
2432  }
2433 
2434  RegCloseKey(hKey);
2435 
2436  return ret;
2437 }
#define ERROR_SUCCESS
Definition: deptool.c:10
Definition: bidi.c:75
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned char * LPBYTE
Definition: typedefs.h:52
#define DWORD
Definition: msvc.h:34
DWORD DWORD
Definition: winlogon.h:75
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:557
void DPRINT(...)
Definition: polytest.cpp:61
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
HANDLE HKEY
Definition: registry.h:24
#define MAX_PATH
Definition: compat.h:26
#define swprintf(buf, format,...)
Definition: sprintf.c:56
int ret
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#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:3381
#define CR_REGISTRY_ERROR
Definition: cfgmgr32.h:875
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
DWORD dwSize
Definition: wglext.h:734
DWORD WINAPI PNP_InitDetection ( handle_t  hBinding)

Definition at line 240 of file umpnpmgr.c.

Referenced by CMP_Init_Detection().

242 {
243  UNREFERENCED_PARAMETER(hBinding);
244 
245  DPRINT("PNP_InitDetection() called\n");
246  return CR_SUCCESS;
247 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
#define CR_SUCCESS
Definition: cfgmgr32.h:842
void DPRINT(...)
Definition: polytest.cpp:61
DWORD WINAPI PNP_InstallDevInst ( handle_t  hBinding)

Definition at line 3115 of file umpnpmgr.c.

3117 {
3118  UNIMPLEMENTED;
3119  return CR_CALL_NOT_IMPLEMENTED;
3120 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
CONFIGRET WINAPI PNP_IsDockStationPresent ( handle_t  hBinding,
BOOL Present 
)

Definition at line 2296 of file umpnpmgr.c.

Referenced by CM_Is_Dock_Station_Present_Ex().

2299 {
2300  HKEY hKey;
2301  DWORD dwType;
2302  DWORD dwValue;
2303  DWORD dwSize;
2305 
2306  UNREFERENCED_PARAMETER(hBinding);
2307 
2308  DPRINT1("PNP_IsDockStationPresent() called\n");
2309 
2310  *Present = FALSE;
2311 
2313  L"CurrentDockInfo",
2314  0,
2315  KEY_READ,
2316  &hKey) != ERROR_SUCCESS)
2317  return CR_REGISTRY_ERROR;
2318 
2319  dwSize = sizeof(DWORD);
2320  if (RegQueryValueExW(hKey,
2321  L"DockingState",
2322  NULL,
2323  &dwType,
2324  (LPBYTE)&dwValue,
2325  &dwSize) != ERROR_SUCCESS)
2326  ret = CR_REGISTRY_ERROR;
2327 
2328  RegCloseKey(hKey);
2329 
2330  if (ret == CR_SUCCESS)
2331  {
2332  if (dwType != REG_DWORD || dwSize != sizeof(DWORD))
2333  {
2334  ret = CR_REGISTRY_ERROR;
2335  }
2336  else if (dwValue != 0)
2337  {
2338  *Present = TRUE;
2339  }
2340  }
2341 
2342  DPRINT1("PNP_IsDockStationPresent() done (returns %lx)\n", ret);
2343 
2344  return ret;
2345 }
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
Definition: bidi.c:75
#define KEY_READ
Definition: nt_native.h:1023
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
unsigned char * LPBYTE
Definition: typedefs.h:52
#define HKEY_CURRENT_CONFIG
Definition: winreg.h:15
#define DWORD
Definition: msvc.h:34
DWORD DWORD
Definition: winlogon.h:75
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define FALSE
Definition: types.h:117
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:557
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
HANDLE HKEY
Definition: registry.h:24
int ret
#define REG_DWORD
Definition: nt_native.h:1497
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define DPRINT1
Definition: precomp.h:8
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
#define CR_REGISTRY_ERROR
Definition: cfgmgr32.h:875
DWORD dwSize
Definition: wglext.h:734
DWORD WINAPI PNP_ModifyResDes ( handle_t  hBinding,
LPWSTR  pDeviceID,
DWORD  ulLogConfTag,
DWORD  ulLogConfType,
RESOURCEID  CurrentResourceID,
RESOURCEID  NewResourceID,
DWORD  ulResourceTag,
BYTE ResourceData,
PNP_RPC_BUFFER_SIZE  ResourceLen,
DWORD  ulFlags 
)

Definition at line 2749 of file umpnpmgr.c.

2760 {
2761  UNIMPLEMENTED;
2762  return CR_CALL_NOT_IMPLEMENTED;
2763 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_QueryArbitratorFreeData ( handle_t  hBinding,
BYTE pData,
DWORD  DataLen,
LPWSTR  pDeviceID,
RESOURCEID  ResourceID,
DWORD  ulFlags 
)

Definition at line 2817 of file umpnpmgr.c.

Referenced by CM_Query_Arbitrator_Free_Data_Ex().

2824 {
2825  UNIMPLEMENTED;
2826  return CR_CALL_NOT_IMPLEMENTED;
2827 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_QueryArbitratorFreeSize ( handle_t  hBinding,
DWORD pulSize,
LPWSTR  pDeviceID,
RESOURCEID  ResourceID,
DWORD  ulFlags 
)

Definition at line 2833 of file umpnpmgr.c.

Referenced by CM_Query_Arbitrator_Free_Size_Ex().

2839 {
2840  UNIMPLEMENTED;
2841  return CR_CALL_NOT_IMPLEMENTED;
2842 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_QueryRemove ( handle_t  hBinding,
LPWSTR  pszDeviceID,
PPNP_VETO_TYPE  pVetoType,
LPWSTR  pszVetoName,
DWORD  ulNameLength,
DWORD  ulFlags 
)

Definition at line 2264 of file umpnpmgr.c.

Referenced by CM_Query_And_Remove_SubTree_ExW().

2271 {
2272  UNIMPLEMENTED;
2273  return CR_CALL_NOT_IMPLEMENTED;
2274 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_QueryResConfList ( handle_t  hBinding,
LPWSTR  pDeviceID,
RESOURCEID  ResourceID,
BYTE ResourceData,
PNP_RPC_BUFFER_SIZE  ResourceLen,
BYTE Buffer,
PNP_RPC_BUFFER_SIZE  BufferLen,
DWORD  ulFlags 
)

Definition at line 2786 of file umpnpmgr.c.

2795 {
2796  UNIMPLEMENTED;
2797  return CR_CALL_NOT_IMPLEMENTED;
2798 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_RegisterDeviceClassAssociation ( handle_t  hBinding,
LPWSTR  pszDeviceID,
GUID InterfaceGuid,
LPWSTR  pszReference,
LPWSTR  pszSymLink,
PNP_RPC_STRING_LEN pulLength,
PNP_RPC_STRING_LEN pulTransferLen,
DWORD  ulFlags 
)

Definition at line 1443 of file umpnpmgr.c.

Referenced by CM_Register_Device_Interface_ExW().

1452 {
1453  UNIMPLEMENTED;
1454  return CR_CALL_NOT_IMPLEMENTED;
1455 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_RegisterDriver ( handle_t  hBinding,
LPWSTR  pszDeviceID,
DWORD  ulFlags 
)

Definition at line 2251 of file umpnpmgr.c.

Referenced by CM_Register_Device_Driver_Ex().

2255 {
2256  UNIMPLEMENTED;
2257  return CR_CALL_NOT_IMPLEMENTED;
2258 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_RegisterNotification ( handle_t  hBinding,
DWORD  ulFlags,
DWORD pulNotify 
)

Definition at line 2859 of file umpnpmgr.c.

Referenced by CMP_RegisterNotification().

2863 {
2864 #if 0
2865  PNOTIFY_DATA pNotifyData;
2866 #endif
2867 
2868  DPRINT1("PNP_RegisterNotification(%p 0x%lx %p)\n",
2869  hBinding, ulFlags, pulNotify);
2870 
2871 #if 0
2872  pNotifyData = RtlAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(NOTIFY_DATA));
2873  if (pNotifyData == NULL)
2874  return CR_OUT_OF_MEMORY;
2875 
2876  *pulNotify = (DWORD)pNotifyData;
2877 #endif
2878 
2879  *pulNotify = 1;
2880 
2881  return CR_SUCCESS;
2882 }
#define DWORD
Definition: msvc.h:34
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:557
#define CR_OUT_OF_MEMORY
Definition: cfgmgr32.h:844
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:585
#define GetProcessHeap()
Definition: compat.h:395
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define DPRINT1
Definition: precomp.h:8
DWORD WINAPI PNP_RegisterServiceNotification ( handle_t  hBinding)

Definition at line 3159 of file umpnpmgr.c.

3161 {
3162  UNIMPLEMENTED;
3163  return CR_CALL_NOT_IMPLEMENTED;
3164 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_ReportLogOn ( handle_t  hBinding,
BOOL  Admin,
DWORD  ProcessId 
)

Definition at line 253 of file umpnpmgr.c.

Referenced by CMP_Report_LogOn().

257 {
260 
261  UNREFERENCED_PARAMETER(hBinding);
262  UNREFERENCED_PARAMETER(Admin);
263 
264  DPRINT("PNP_ReportLogOn(%u, %u) called\n", Admin, ProcessId);
265 
266  /* Get the users token */
268 
269  if (!hProcess)
270  {
271  DPRINT1("OpenProcess failed with error %u\n", GetLastError());
272  goto cleanup;
273  }
274 
275  if (hUserToken)
276  {
278  hUserToken = NULL;
279  }
280 
282  {
283  DPRINT1("OpenProcessToken failed with error %u\n", GetLastError());
284  goto cleanup;
285  }
286 
287  /* Trigger the installer thread */
288  if (hInstallEvent)
290 
291  ReturnValue = CR_SUCCESS;
292 
293 cleanup:
294  if (hProcess)
295  CloseHandle(hProcess);
296 
297  return ReturnValue;
298 }
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
#define PROCESS_ALL_ACCESS
Definition: nt_native.h:1324
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:679
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1056
#define TOKEN_ASSIGN_PRIMARY
Definition: setypes.h:871
_In_ BOOL _In_ HANDLE hProcess
Definition: mapping.h:70
_In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ PEPROCESS ProcessId
Definition: iotypes.h:1451
DWORD DWORD
Definition: winlogon.h:75
static HANDLE hInstallEvent
Definition: umpnpmgr.c:69
static HANDLE hUserToken
Definition: umpnpmgr.c:68
UINT32 void void ** ReturnValue
Definition: acevents.h:192
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:557
void DPRINT(...)
Definition: polytest.cpp:61
#define TOKEN_QUERY
Definition: setypes.h:874
#define CR_FAILURE
Definition: cfgmgr32.h:865
#define TOKEN_DUPLICATE
Definition: setypes.h:872
HANDLE WINAPI OpenProcess(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwProcessId)
Definition: proc.c:1272
DWORD *typedef HANDLE
Definition: winlogon.h:52
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:286
#define DPRINT1
Definition: precomp.h:8
char * cleanup(char *str)
Definition: wpickclick.c:99
DWORD WINAPI PNP_RequestDeviceEject ( handle_t  hBinding,
LPWSTR  pszDeviceID,
PPNP_VETO_TYPE  pVetoType,
LPWSTR  pszVetoName,
DWORD  ulNameLength,
DWORD  ulFlags 
)

Definition at line 2280 of file umpnpmgr.c.

Referenced by CM_Request_Device_Eject_ExW().

2287 {
2288  UNIMPLEMENTED;
2289  return CR_CALL_NOT_IMPLEMENTED;
2290 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_RequestEjectPC ( handle_t  hBinding)

Definition at line 2351 of file umpnpmgr.c.

Referenced by CM_Request_Eject_PC_Ex().

2353 {
2354  UNIMPLEMENTED;
2355  return CR_CALL_NOT_IMPLEMENTED;
2356 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
CONFIGRET WINAPI PNP_RunDetection ( handle_t  hBinding,
DWORD  ulFlags 
)

Definition at line 2848 of file umpnpmgr.c.

Referenced by CM_Run_Detection_Ex().

2851 {
2852  return CR_CALL_NOT_IMPLEMENTED;
2853 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
DWORD WINAPI PNP_SetActiveService ( handle_t  hBinding,
LPWSTR  pszFilter,
DWORD  ulFlags 
)

Definition at line 3170 of file umpnpmgr.c.

3174 {
3175  UNIMPLEMENTED;
3176  return CR_CALL_NOT_IMPLEMENTED;
3177 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_SetClassRegProp ( handle_t  hBinding,
LPWSTR  pszClassGuid,
DWORD  ulProperty,
DWORD  ulDataType,
BYTE Buffer,
PNP_PROP_SIZE  ulLength,
DWORD  ulFlags 
)

Definition at line 1598 of file umpnpmgr.c.

1606 {
1608  LPWSTR lpValueName = NULL;
1609  HKEY hInstKey = 0;
1610  HKEY hPropKey = 0;
1611  LONG lError;
1612 
1613  UNREFERENCED_PARAMETER(hBinding);
1614 
1615  DPRINT("PNP_SetClassRegProp() called\n");
1616 
1617  if (ulFlags != 0)
1618  return CR_INVALID_FLAG;
1619 
1620  switch (ulProperty)
1621  {
1622  case CM_CRP_SECURITY:
1623  lpValueName = L"Security";
1624  break;
1625 
1626  case CM_CRP_DEVTYPE:
1627  lpValueName = L"DeviceType";
1628  break;
1629 
1630  case CM_CRP_EXCLUSIVE:
1631  lpValueName = L"Exclusive";
1632  break;
1633 
1635  lpValueName = L"DeviceCharacteristics";
1636  break;
1637 
1638  default:
1639  return CR_INVALID_PROPERTY;
1640  }
1641 
1642  lError = RegOpenKeyExW(hClassKey,
1643  pszClassGuid,
1644  0,
1645  KEY_WRITE,
1646  &hInstKey);
1647  if (lError != ERROR_SUCCESS)
1648  {
1650  goto done;
1651  }
1652 
1653  /* FIXME: Set security descriptor */
1654  lError = RegCreateKeyExW(hInstKey,
1655  L"Properties",
1656  0,
1657  NULL,
1660  NULL,
1661  &hPropKey,
1662  NULL);
1663  if (lError != ERROR_SUCCESS)
1664  {
1665  ret = CR_REGISTRY_ERROR;
1666  goto done;
1667  }
1668 
1669  if (ulLength == 0)
1670  {
1671  if (RegDeleteValueW(hPropKey,
1672  lpValueName))
1673  ret = CR_REGISTRY_ERROR;
1674  }
1675  else
1676  {
1677  if (RegSetValueExW(hPropKey,
1678  lpValueName,
1679  0,
1680  ulDataType,
1681  Buffer,
1682  ulLength))
1683  ret = CR_REGISTRY_ERROR;
1684  }
1685 
1686 done:
1687  if (hPropKey != NULL)
1688  RegCloseKey(hPropKey);
1689 
1690  if (hInstKey != NULL)
1691  RegCloseKey(hInstKey);
1692 
1693  return ret;
1694 }
#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
Definition: bidi.c:75
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:315
#define CM_CRP_DEVTYPE
Definition: cfgmgr32.h:710
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:1094
#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:557
#define CR_INVALID_PROPERTY
Definition: cfgmgr32.h:899
void DPRINT(...)
Definition: polytest.cpp:61
Definition: bufpool.h:45
#define CM_CRP_SECURITY
Definition: cfgmgr32.h:706
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_WRITE
Definition: nt_native.h:1031
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:4917
HANDLE HKEY
Definition: registry.h:24
int ret
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
Definition: reg.c:2368
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define CR_REGISTRY_ERROR
Definition: cfgmgr32.h:875
static HKEY hClassKey
Definition: umpnpmgr.c:66
DWORD WINAPI PNP_SetDeviceProblem ( handle_t  hBinding,
LPWSTR  pDeviceID,
DWORD  ulProblem,
DWORD  ulFlags 
)

Definition at line 2058 of file umpnpmgr.c.

Referenced by CM_Set_DevNode_Problem_Ex().

2063 {
2064  UNIMPLEMENTED;
2065  return CR_CALL_NOT_IMPLEMENTED;
2066 }
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define UNIMPLEMENTED
Definition: debug.h:114
DWORD WINAPI PNP_SetDeviceRegProp ( handle_t  hBinding,
LPWSTR  pDeviceId,
DWORD  ulProperty,
DWORD  ulDataType,
BYTE Buffer,
PNP_PROP_SIZE  ulLength,
DWORD  ulFlags 
)

Definition at line 1010 of file umpnpmgr.c.

Referenced by CM_Set_DevNode_Registry_Property_ExW().

1018 {
1020  LPWSTR lpValueName = NULL;
1021  HKEY hKey = 0;
1022 
1023  UNREFERENCED_PARAMETER(hBinding);
1024  UNREFERENCED_PARAMETER(ulFlags);
1025 
1026  DPRINT("PNP_SetDeviceRegProp() called\n");
1027 
1028  DPRINT("DeviceId: %S\n", pDeviceId);
1029  DPRINT("Property: %lu\n", ulProperty);
1030  DPRINT("DataType: %lu\n", ulDataType);
1031  DPRINT("Length: %lu\n", ulLength);
1032 
1033  switch (ulProperty)
1034  {
1035  case CM_DRP_DEVICEDESC:
1036  lpValueName = L"DeviceDesc";
1037  break;
1038 
1039  case CM_DRP_HARDWAREID:
1040  lpValueName = L"HardwareID";
1041