ReactOS  0.4.11-dev-765-g5e024bf
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 (_In_ LPWSTR pszDeviceInstance, _In_ ULONG ulFlags)
 
DWORD WINAPI PNP_DeviceInstanceAction (handle_t hBinding, DWORD ulAction, DWORD ulFlags, LPWSTR pszDeviceInstance1, LPWSTR pszDeviceInstance2)
 
DWORD WINAPI PNP_GetDeviceStatus (handle_t hBinding, LPWSTR pDeviceID, DWORD *pulStatus, DWORD *pulProblem, DWORD ulFlags)
 
DWORD WINAPI PNP_SetDeviceProblem (handle_t hBinding, LPWSTR pDeviceID, DWORD ulProblem, DWORD ulFlags)
 
DWORD WINAPI PNP_DisableDevInst (handle_t hBinding, LPWSTR pDeviceID, PPNP_VETO_TYPE pVetoType, LPWSTR pszVetoName, DWORD ulNameLength, DWORD ulFlags)
 
DWORD WINAPI PNP_UninstallDevInst (handle_t hBinding, LPWSTR pDeviceID, DWORD ulFlags)
 
static BOOL CheckForDeviceId (LPWSTR lpDeviceIdList, LPWSTR lpDeviceId)
 
static VOID AppendDeviceId (LPWSTR lpDeviceIdList, LPDWORD lpDeviceIdListSize, LPWSTR lpDeviceId)
 
DWORD WINAPI PNP_AddID (handle_t hBinding, LPWSTR pszDeviceID, LPWSTR pszID, DWORD ulFlags)
 
DWORD WINAPI PNP_RegisterDriver (handle_t hBinding, LPWSTR pszDeviceID, DWORD ulFlags)
 
DWORD WINAPI PNP_QueryRemove (handle_t hBinding, LPWSTR pszDeviceID, PPNP_VETO_TYPE pVetoType, LPWSTR pszVetoName, DWORD ulNameLength, DWORD ulFlags)
 
DWORD WINAPI PNP_RequestDeviceEject (handle_t hBinding, LPWSTR pszDeviceID, PPNP_VETO_TYPE pVetoType, LPWSTR pszVetoName, DWORD ulNameLength, DWORD ulFlags)
 
CONFIGRET WINAPI PNP_IsDockStationPresent (handle_t hBinding, BOOL *Present)
 
DWORD WINAPI PNP_RequestEjectPC (handle_t hBinding)
 
DWORD WINAPI PNP_HwProfFlags (handle_t hBinding, DWORD ulAction, LPWSTR pDeviceID, DWORD ulConfig, DWORD *pulValue, PPNP_VETO_TYPE pVetoType, LPWSTR pszVetoName, DWORD ulNameLength, DWORD ulFlags)
 
DWORD WINAPI PNP_GetHwProfInfo (handle_t hBinding, DWORD ulIndex, HWPROFILEINFO *pHWProfileInfo, DWORD ulProfileInfoSize, DWORD ulFlags)
 
DWORD WINAPI PNP_AddEmptyLogConf (handle_t hBinding, LPWSTR pDeviceID, DWORD ulPriority, DWORD *pulLogConfTag, DWORD ulFlags)
 
DWORD WINAPI PNP_FreeLogConf (handle_t hBinding, LPWSTR pDeviceID, DWORD ulLogConfType, DWORD ulLogConfTag, DWORD ulFlags)
 
DWORD WINAPI PNP_GetFirstLogConf (handle_t hBinding, LPWSTR pDeviceID, DWORD ulLogConfType, DWORD *pulLogConfTag, DWORD ulFlags)
 
DWORD WINAPI PNP_GetNextLogConf (handle_t hBinding, LPWSTR pDeviceID, DWORD ulLogConfType, DWORD ulCurrentTag, DWORD *pulNextTag, DWORD ulFlags)
 
DWORD WINAPI PNP_GetLogConfPriority (handle_t hBinding, LPWSTR pDeviceID, DWORD ulType, DWORD ulTag, DWORD *pPriority, DWORD ulFlags)
 
DWORD WINAPI PNP_AddResDes (handle_t hBinding, LPWSTR pDeviceID, DWORD ulLogConfTag, DWORD ulLogConfType, RESOURCEID ResourceID, DWORD *pulResourceTag, BYTE *ResourceData, PNP_RPC_BUFFER_SIZE ResourceLen, DWORD ulFlags)
 
DWORD WINAPI PNP_FreeResDes (handle_t hBinding, LPWSTR pDeviceID, DWORD ulLogConfTag, DWORD ulLogConfType, RESOURCEID ResourceID, DWORD ulResourceTag, DWORD *pulPreviousResType, DWORD *pulPreviousResTag, DWORD ulFlags)
 
DWORD WINAPI PNP_GetNextResDes (handle_t hBinding, LPWSTR pDeviceID, DWORD ulLogConfTag, DWORD ulLogConfType, RESOURCEID ResourceID, DWORD ulResourceTag, DWORD *pulNextResType, DWORD *pulNextResTag, DWORD ulFlags)
 
DWORD WINAPI PNP_GetResDesData (handle_t hBinding, LPWSTR pDeviceID, DWORD ulLogConfTag, DWORD ulLogConfType, RESOURCEID ResourceID, DWORD ulResourceTag, BYTE *Buffer, PNP_RPC_BUFFER_SIZE BufferLen, DWORD ulFlags)
 
DWORD WINAPI PNP_GetResDesDataSize (handle_t hBinding, LPWSTR pDeviceID, DWORD ulLogConfTag, DWORD ulLogConfType, RESOURCEID ResourceID, DWORD ulResourceTag, DWORD *pulSize, DWORD ulFlags)
 
DWORD WINAPI PNP_ModifyResDes (handle_t hBinding, LPWSTR pDeviceID, DWORD ulLogConfTag, DWORD ulLogConfType, RESOURCEID CurrentResourceID, RESOURCEID NewResourceID, DWORD ulResourceTag, BYTE *ResourceData, PNP_RPC_BUFFER_SIZE ResourceLen, DWORD ulFlags)
 
DWORD WINAPI PNP_DetectResourceConflict (handle_t hBinding, LPWSTR pDeviceID, RESOURCEID ResourceID, BYTE *ResourceData, PNP_RPC_BUFFER_SIZE ResourceLen, BOOL *pbConflictDetected, DWORD ulFlags)
 
DWORD WINAPI PNP_QueryResConfList (handle_t hBinding, LPWSTR pDeviceID, RESOURCEID ResourceID, BYTE *ResourceData, PNP_RPC_BUFFER_SIZE ResourceLen, BYTE *Buffer, PNP_RPC_BUFFER_SIZE BufferLen, DWORD ulFlags)
 
DWORD WINAPI PNP_SetHwProf (handle_t hBinding, DWORD ulHardwareProfile, DWORD ulFlags)
 
DWORD WINAPI PNP_QueryArbitratorFreeData (handle_t hBinding, BYTE *pData, DWORD DataLen, LPWSTR pDeviceID, RESOURCEID ResourceID, DWORD ulFlags)
 
DWORD WINAPI PNP_QueryArbitratorFreeSize (handle_t hBinding, DWORD *pulSize, LPWSTR pDeviceID, RESOURCEID ResourceID, DWORD ulFlags)
 
CONFIGRET WINAPI PNP_RunDetection (handle_t hBinding, DWORD ulFlags)
 
DWORD WINAPI PNP_RegisterNotification (handle_t hBinding, DWORD 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 2090 of file umpnpmgr.c.

Referenced by PNP_AddID().

2093 {
2094  DWORD dwLen;
2095  DWORD dwPos;
2096 
2097  dwLen = wcslen(lpDeviceId);
2098  dwPos = (*lpDeviceIdListSize / sizeof(WCHAR)) - 1;
2099 
2100  wcscpy(&lpDeviceIdList[dwPos], lpDeviceId);
2101 
2102  dwPos += (dwLen + 1);
2103 
2104  lpDeviceIdList[dwPos] = 0;
2105 
2106  *lpDeviceIdListSize = dwPos * sizeof(WCHAR);
2107 }
#define WCHAR
Definition: msvc.h:43
DWORD DWORD
Definition: winlogon.h:84
_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 2069 of file umpnpmgr.c.

Referenced by PNP_AddID().

2071 {
2072  LPWSTR lpPtr;
2073  DWORD dwLength;
2074 
2075  lpPtr = lpDeviceIdList;
2076  while (*lpPtr != 0)
2077  {
2078  dwLength = wcslen(lpPtr);
2079  if (0 == _wcsicmp(lpPtr, lpDeviceId))
2080  return TRUE;
2081 
2082  lpPtr += (dwLength + 1);
2083  }
2084 
2085  return FALSE;
2086 }
#define TRUE
Definition: types.h:120
DWORD DWORD
Definition: winlogon.h:84
#define FALSE
Definition: types.h:117
static DWORD DWORD * dwLength
Definition: fusion.c:83
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 1688 of file umpnpmgr.c.

Referenced by PNP_CreateDevInst().

1689 {
1690  WCHAR szEnumerator[MAX_DEVICE_ID_LEN];
1691  WCHAR szDevice[MAX_DEVICE_ID_LEN];
1692  WCHAR szInstance[MAX_DEVICE_ID_LEN];
1693  HKEY hKeyEnumerator;
1694  HKEY hKeyDevice;
1695  HKEY hKeyInstance;
1696  HKEY hKeyControl;
1697  LONG lError;
1698 
1699  /* Split the instance ID */
1700  SplitDeviceInstanceID(pszDeviceID,
1701  szEnumerator,
1702  szDevice,
1703  szInstance);
1704 
1705  /* Open or create the enumerator key */
1706  lError = RegCreateKeyExW(hEnumKey,
1707  szEnumerator,
1708  0,
1709  NULL,
1712  NULL,
1713  &hKeyEnumerator,
1714  NULL);
1715  if (lError != ERROR_SUCCESS)
1716  {
1717  return CR_REGISTRY_ERROR;
1718  }
1719 
1720  /* Open or create the device key */
1721  lError = RegCreateKeyExW(hKeyEnumerator,
1722  szDevice,
1723  0,
1724  NULL,
1727  NULL,
1728  &hKeyDevice,
1729  NULL);
1730 
1731  /* Close the enumerator key */
1732  RegCloseKey(hKeyEnumerator);
1733 
1734  if (lError != ERROR_SUCCESS)
1735  {
1736  return CR_REGISTRY_ERROR;
1737  }
1738 
1739  /* Try to open the instance key and fail if it exists */
1740  lError = RegOpenKeyExW(hKeyDevice,
1741  szInstance,
1742  0,
1743  KEY_SET_VALUE,
1744  &hKeyInstance);
1745  if (lError == ERROR_SUCCESS)
1746  {
1747  DPRINT1("Instance %S already exists!\n", szInstance);
1748  RegCloseKey(hKeyInstance);
1749  RegCloseKey(hKeyDevice);
1750  return CR_ALREADY_SUCH_DEVINST;
1751  }
1752 
1753  /* Create a new instance key */
1754  lError = RegCreateKeyExW(hKeyDevice,
1755  szInstance,
1756  0,
1757  NULL,
1760  NULL,
1761  &hKeyInstance,
1762  NULL);
1763 
1764  /* Close the device key */
1765  RegCloseKey(hKeyDevice);
1766 
1767  if (lError != ERROR_SUCCESS)
1768  {
1769  return CR_REGISTRY_ERROR;
1770  }
1771 
1772  /* Create the 'Control' sub key */
1773  lError = RegCreateKeyExW(hKeyInstance,
1774  L"Control",
1775  0,
1776  NULL,
1779  NULL,
1780  &hKeyControl,
1781  NULL);
1782  if (lError == ERROR_SUCCESS)
1783  {
1784  RegCloseKey(hKeyControl);
1785  }
1786 
1787  RegCloseKey(hKeyInstance);
1788 
1789  return (lError == ERROR_SUCCESS) ? CR_SUCCESS : CR_REGISTRY_ERROR;
1790 }
#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:1643
#define KEY_SET_VALUE
Definition: nt_native.h:1017
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_DEVICE_ID_LEN
Definition: pnpmgr.c:28
#define CR_ALREADY_SUCH_DEVINST
Definition: cfgmgr32.h:862
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c: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:416
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
HANDLE HKEY
Definition: registry.h:24
static const WCHAR L[]
Definition: oid.c:1087
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define DPRINT1
Definition: precomp.h:8
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
#define CR_REGISTRY_ERROR
Definition: cfgmgr32.h:875
static DWORD WINAPI DeviceInstallThread ( LPVOID  lpParameter)
static

Definition at line 3462 of file umpnpmgr.c.

Referenced by ServiceMain().

3463 {
3464 #ifdef HAVE_SLIST_ENTRY_IMPLEMENTED
3465  PSLIST_ENTRY ListEntry;
3466 #else
3467  PLIST_ENTRY ListEntry;
3468 #endif
3469  DeviceInstallParams* Params;
3470  BOOL showWizard;
3471 
3472  UNREFERENCED_PARAMETER(lpParameter);
3473 
3475 
3476  showWizard = !SetupIsActive() && !IsConsoleBoot();
3477 
3478  while (TRUE)
3479  {
3480 #ifdef HAVE_SLIST_ENTRY_IMPLEMENTED
3482 #else
3484  ListEntry = NULL;
3485  else
3486  ListEntry = RemoveHeadList(&DeviceInstallListHead);
3487 #endif
3488  if (ListEntry == NULL)
3489  {
3492  }
3493  else
3494  {
3496  Params = CONTAINING_RECORD(ListEntry, DeviceInstallParams, ListEntry);
3497  InstallDevice(Params->DeviceIds, showWizard);
3498  }
3499  }
3500 
3501  return 0;
3502 }
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:679
static BOOL SetupIsActive(VOID)
Definition: umpnpmgr.c:3386
_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:416
FORCEINLINE PLIST_ENTRY RemoveHeadList(_Inout_ PLIST_ENTRY ListHead)
Definition: rtlfuncs.h:128
static BOOL IsConsoleBoot(VOID)
Definition: umpnpmgr.c:3417
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
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:3167
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 INFINITE
Definition: serial.h:102
static HANDLE hDeviceInstallListNotEmpty
Definition: umpnpmgr.c:77
static CONFIGRET DisableDeviceInstance ( LPWSTR  pszDeviceInstance)
static

Definition at line 1890 of file umpnpmgr.c.

Referenced by PNP_DeviceInstanceAction().

1891 {
1892  DPRINT("DisableDeviceInstance: not implemented\n");
1893  /* FIXME */
1894  return CR_CALL_NOT_IMPLEMENTED;
1895 }
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 3845 of file umpnpmgr.c.

3848 {
3849  switch (fdwReason)
3850  {
3851  case DLL_PROCESS_ATTACH:
3852  DisableThreadLibraryCalls(hinstDLL);
3854  break;
3855 
3856  case DLL_PROCESS_DETACH:
3857  break;
3858  }
3859 
3860  return TRUE;
3861 }
#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:3774
#define DLL_PROCESS_DETACH
Definition: compat.h:119
static CONFIGRET EnableDeviceInstance ( LPWSTR  pszDeviceInstance)
static

Definition at line 1872 of file umpnpmgr.c.

Referenced by PNP_DeviceInstanceAction().

1873 {
1874  PLUGPLAY_CONTROL_RESET_DEVICE_DATA ResetDeviceData;
1876  NTSTATUS Status;
1877 
1878  DPRINT("Enable device instance %S\n", pszDeviceInstance);
1879 
1880  RtlInitUnicodeString(&ResetDeviceData.DeviceInstance, pszDeviceInstance);
1882  if (!NT_SUCCESS(Status))
1883  ret = NtStatusToCrError(Status);
1884 
1885  return ret;
1886 }
#define CR_SUCCESS
Definition: cfgmgr32.h:842
void DPRINT(...)
Definition: polytest.cpp:61
LONG NTSTATUS
Definition: precomp.h:26
#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:1245
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 3774 of file umpnpmgr.c.

Referenced by DllMain().

3775 {
3776  BOOLEAN OldValue;
3777  DWORD dwError;
3778 
3779  DPRINT("UMPNPMGR: InitializePnPManager() started\n");
3780 
3781  /* We need this privilege for using CreateProcessAsUserW */
3783 
3785  if (hInstallEvent == NULL)
3786  {
3787  dwError = GetLastError();
3788  DPRINT1("Could not create the Install Event! (Error %lu)\n", dwError);
3789  return dwError;
3790  }
3791 
3794  {
3795  dwError = GetLastError();
3796  DPRINT1("Could not create the Event! (Error %lu)\n", dwError);
3797  return dwError;
3798  }
3799 
3801  TRUE,
3802  FALSE,
3803  L"Global\\PnP_No_Pending_Install_Events");
3804  if (hNoPendingInstalls == NULL)
3805  {
3806  dwError = GetLastError();
3807  DPRINT1("Could not create the Event! (Error %lu)\n", dwError);
3808  return dwError;
3809  }
3810 
3811 #ifdef HAVE_SLIST_ENTRY_IMPLEMENTED
3813 #else
3815 #endif
3816 
3818  L"System\\CurrentControlSet\\Enum",
3819  0,
3821  &hEnumKey);
3822  if (dwError != ERROR_SUCCESS)
3823  {
3824  DPRINT1("Could not open the Enum Key! (Error %lu)\n", dwError);
3825  return dwError;
3826  }
3827 
3829  L"System\\CurrentControlSet\\Control\\Class",
3830  0,
3832  &hClassKey);
3833  if (dwError != ERROR_SUCCESS)
3834  {
3835  DPRINT1("Could not open the Class Key! (Error %lu)\n", dwError);
3836  return dwError;
3837  }
3838 
3839  DPRINT("UMPNPMGR: InitializePnPManager() done\n");
3840 
3841  return 0;
3842 }
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
NTSYSAPI NTSTATUS NTAPI RtlAdjustPrivilege(_In_ ULONG Privilege, _In_ BOOLEAN NewValue, _In_ BOOLEAN ForThread, _Out_ PBOOLEAN OldValue)
static BOOL SetupIsActive(VOID)
Definition: umpnpmgr.c:3386
DWORD DWORD
Definition: winlogon.h:84
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:416
void DPRINT(...)
Definition: polytest.cpp:61
static HANDLE hNoPendingInstalls
Definition: umpnpmgr.c:70
unsigned char BOOLEAN
static const WCHAR L[]
Definition: oid.c:1087
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:657
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 3167 of file umpnpmgr.c.

Referenced by DeviceInstallThread().

3168 {
3169  BOOL DeviceInstalled = FALSE;
3171  DWORD Value;
3173  HANDLE hPipe = INVALID_HANDLE_VALUE;
3175  PROCESS_INFORMATION ProcessInfo;
3176  STARTUPINFOW StartupInfo;
3177  UUID RandomUuid;
3178  HKEY DeviceKey;
3179 
3180  /* The following lengths are constant (see below), they cannot overflow */
3181  WCHAR CommandLine[116];
3182  WCHAR InstallEventName[73];
3183  WCHAR PipeName[74];
3184  WCHAR UuidString[39];
3185 
3186  DPRINT("InstallDevice(%S, %d)\n", DeviceInstance, ShowWizard);
3187 
3188  ZeroMemory(&ProcessInfo, sizeof(ProcessInfo));
3189 
3190  if (RegOpenKeyExW(hEnumKey,
3192  0,
3194  &DeviceKey) == ERROR_SUCCESS)
3195  {
3196  if (RegQueryValueExW(DeviceKey,
3197  L"Class",
3198  NULL,
3199  NULL,
3200  NULL,
3201  NULL) == ERROR_SUCCESS)
3202  {
3203  DPRINT("No need to install: %S\n", DeviceInstance);
3204  RegCloseKey(DeviceKey);
3205  return TRUE;
3206  }
3207 
3208  BytesWritten = sizeof(DWORD);
3209  if (RegQueryValueExW(DeviceKey,
3210  L"ConfigFlags",
3211  NULL,
3212  NULL,
3213  (PBYTE)&Value,
3214  &BytesWritten) == ERROR_SUCCESS)
3215  {
3216  if (Value & CONFIGFLAG_FAILEDINSTALL)
3217  {
3218  DPRINT("No need to install: %S\n", DeviceInstance);
3219  RegCloseKey(DeviceKey);
3220  return TRUE;
3221  }
3222  }
3223 
3224  RegCloseKey(DeviceKey);
3225  }
3226 
3227  DPRINT1("Installing: %S\n", DeviceInstance);
3228 
3229  /* Create a random UUID for the named pipe & event*/
3230  UuidCreate(&RandomUuid);
3231  swprintf(UuidString, L"{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
3232  RandomUuid.Data1, RandomUuid.Data2, RandomUuid.Data3,
3233  RandomUuid.Data4[0], RandomUuid.Data4[1], RandomUuid.Data4[2],
3234  RandomUuid.Data4[3], RandomUuid.Data4[4], RandomUuid.Data4[5],
3235  RandomUuid.Data4[6], RandomUuid.Data4[7]);
3236 
3237  /* Create the event */
3238  wcscpy(InstallEventName, L"Global\\PNP_Device_Install_Event_0.");
3239  wcscat(InstallEventName, UuidString);
3240  hInstallEvent = CreateEventW(NULL, TRUE, FALSE, InstallEventName);
3241  if (!hInstallEvent)
3242  {
3243  DPRINT1("CreateEventW('%ls') failed with error %lu\n", InstallEventName, GetLastError());
3244  goto cleanup;
3245  }
3246 
3247  /* Create the named pipe */
3248  wcscpy(PipeName, L"\\\\.\\pipe\\PNP_Device_Install_Pipe_0.");
3249  wcscat(PipeName, UuidString);
3250  hPipe = CreateNamedPipeW(PipeName, PIPE_ACCESS_OUTBOUND, PIPE_TYPE_BYTE, 1, 512, 512, 0, NULL);
3251  if (hPipe == INVALID_HANDLE_VALUE)
3252  {
3253  DPRINT1("CreateNamedPipeW failed with error %u\n", GetLastError());
3254  goto cleanup;
3255  }
3256 
3257  /* Launch rundll32 to call ClientSideInstallW */
3258  wcscpy(CommandLine, L"rundll32.exe newdev.dll,ClientSideInstall ");
3259  wcscat(CommandLine, PipeName);
3260 
3261  ZeroMemory(&StartupInfo, sizeof(StartupInfo));
3262  StartupInfo.cb = sizeof(StartupInfo);
3263 
3264  if (hUserToken)
3265  {
3266  /* newdev has to run under the environment of the current user */
3267  if (!CreateEnvironmentBlock(&Environment, hUserToken, FALSE))
3268  {
3269  DPRINT1("CreateEnvironmentBlock failed with error %d\n", GetLastError());
3270  goto cleanup;
3271  }
3272 
3273  if (!CreateProcessAsUserW(hUserToken, NULL, CommandLine, NULL, NULL, FALSE, CREATE_UNICODE_ENVIRONMENT, Environment, NULL, &StartupInfo, &ProcessInfo))
3274  {
3275  DPRINT1("CreateProcessAsUserW failed with error %u\n", GetLastError());
3276  goto cleanup;
3277  }
3278  }
3279  else
3280  {
3281  /* FIXME: This is probably not correct, I guess newdev should never be run with SYSTEM privileges.
3282 
3283  Still, we currently do that in 2nd stage setup and probably Console mode as well, so allow it here.
3284  (ShowWizard is only set to FALSE for these two modes) */
3285  ASSERT(!ShowWizard);
3286 
3287  if (!CreateProcessW(NULL, CommandLine, NULL, NULL, FALSE, 0, NULL, NULL, &StartupInfo, &ProcessInfo))
3288  {
3289  DPRINT1("CreateProcessW failed with error %u\n", GetLastError());
3290  goto cleanup;
3291  }
3292  }
3293 
3294  /* Wait for the function to connect to our pipe */
3295  if (!ConnectNamedPipe(hPipe, NULL))
3296  {
3298  {
3299  DPRINT1("ConnectNamedPipe failed with error %u\n", GetLastError());
3300  goto cleanup;
3301  }
3302  }
3303 
3304  /* Pass the data. The following output is partly compatible to Windows XP SP2 (researched using a modified newdev.dll to log this stuff) */
3305  Value = sizeof(InstallEventName);
3306  WriteFile(hPipe, &Value, sizeof(Value), &BytesWritten, NULL);
3307  WriteFile(hPipe, InstallEventName, Value, &BytesWritten, NULL);
3308 
3309  /* I couldn't figure out what the following value means under WinXP. It's usually 0 in my tests, but was also 5 once.
3310  Therefore the following line is entirely ReactOS-specific. We use the value here to pass the ShowWizard variable. */
3311  WriteFile(hPipe, &ShowWizard, sizeof(ShowWizard), &BytesWritten, NULL);
3312 
3313  Value = (wcslen(DeviceInstance) + 1) * sizeof(WCHAR);
3314  WriteFile(hPipe, &Value, sizeof(Value), &BytesWritten, NULL);
3315  WriteFile(hPipe, DeviceInstance, Value, &BytesWritten, NULL);
3316 
3317  /* Wait for newdev.dll to finish processing */
3318  WaitForSingleObject(ProcessInfo.hProcess, INFINITE);
3319 
3320  /* If the event got signalled, this is success */
3321  DeviceInstalled = WaitForSingleObject(hInstallEvent, 0) == WAIT_OBJECT_0;
3322 
3323 cleanup:
3324  if (hInstallEvent)
3325  CloseHandle(hInstallEvent);
3326 
3327  if (hPipe != INVALID_HANDLE_VALUE)
3328  CloseHandle(hPipe);
3329 
3330  if (Environment)
3331  DestroyEnvironmentBlock(Environment);
3332 
3333  if (ProcessInfo.hProcess)
3334  CloseHandle(ProcessInfo.hProcess);
3335 
3336  if (ProcessInfo.hThread)
3337  CloseHandle(ProcessInfo.hThread);
3338 
3339  if (!DeviceInstalled)
3340  {
3341  DPRINT1("InstallDevice failed for DeviceInstance '%ws'\n", DeviceInstance);
3342  }
3343 
3344  return DeviceInstalled;
3345 }
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
#define CREATE_UNICODE_ENVIRONMENT
Definition: winbase.h:186
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:1059
#define ZeroMemory
Definition: winbase.h:1635
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:84
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:167
static HKEY hEnumKey
Definition: umpnpmgr.c:65
smooth NULL
Definition: ftsmooth.c:416
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:4623
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:387
DWORD cb
Definition: winbase.h:817
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:166
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1087
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:5184
UINTN UINT8 Value
Definition: acefiex.h:751
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessAsUserW(_In_opt_ HANDLE hToken, _In_opt_ LPCWSTR lpApplicationName, _Inout_opt_ LPWSTR lpCommandLine, _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes, _In_ BOOL bInheritHandles, _In_ DWORD dwCreationFlags, _In_opt_ LPVOID lpEnvironment, _In_opt_ LPCWSTR lpCurrentDirectory, _In_ LPSTARTUPINFOW lpStartupInfo, _Out_ LPPROCESS_INFORMATION lpProcessInformation)
Definition: logon.c:318
DWORD *typedef HANDLE
Definition: winlogon.h:61
RPC_STATUS WINAPI UuidCreate(UUID *Uuid)
Definition: rpcrt4_main.c:306
#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:246
#define INFINITE
Definition: serial.h:102
BOOL WINAPI ConnectNamedPipe(IN HANDLE hNamedPipe, IN LPOVERLAPPED lpOverlapped)
Definition: npipe.c:701
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 3417 of file umpnpmgr.c.

Referenced by DeviceInstallThread().

3418 {
3419  HKEY ControlKey = NULL;
3420  LPWSTR SystemStartOptions = NULL;
3421  LPWSTR CurrentOption, NextOption; /* Pointers into SystemStartOptions */
3422  BOOL ConsoleBoot = FALSE;
3423  LONG rc;
3424 
3425  rc = RegOpenKeyExW(
3427  L"SYSTEM\\CurrentControlSet\\Control",
3428  0,
3430  &ControlKey);
3431 
3432  rc = ReadRegSzKey(ControlKey, L"SystemStartOptions", &SystemStartOptions);
3433  if (rc != ERROR_SUCCESS)
3434  goto cleanup;
3435 
3436  /* Check for CONSOLE switch in SystemStartOptions */
3437  CurrentOption = SystemStartOptions;
3438  while (CurrentOption)
3439  {
3440  NextOption = wcschr(CurrentOption, L' ');
3441  if (NextOption)
3442  *NextOption = L'\0';
3443  if (_wcsicmp(CurrentOption, L"CONSOLE") == 0)
3444  {
3445  DPRINT("Found %S. Switching to console boot\n", CurrentOption);
3446  ConsoleBoot = TRUE;
3447  goto cleanup;
3448  }
3449  CurrentOption = NextOption ? NextOption + 1 : NULL;
3450  }
3451 
3452 cleanup:
3453  if (ControlKey != NULL)
3454  RegCloseKey(ControlKey);
3455  HeapFree(GetProcessHeap(), 0, SystemStartOptions);
3456  return ConsoleBoot;
3457 }
static LONG ReadRegSzKey(IN HKEY hKey, IN LPCWSTR pszKey, OUT LPWSTR *pValue)
Definition: umpnpmgr.c:3349
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
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:416
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
static const WCHAR L[]
Definition: oid.c:1087
#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:27
#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 1852 of file umpnpmgr.c.

Referenced by PNP_DeviceInstanceAction().

1854 {
1855  DPRINT("MoveDeviceInstance: not implemented\n");
1856  /* FIXME */
1857  return CR_CALL_NOT_IMPLEMENTED;
1858 }
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(), PNP_GetRelatedDeviceInstance(), and ReenumerateDeviceInstance().

169 {
170  switch (Status)
171  {
174 
176  return CR_INVALID_DATA;
177 
179  return CR_NO_SUCH_DEVINST;
180 
182  return CR_ACCESS_DENIED;
183 
185  return CR_BUFFER_SMALL;
186 
188  return CR_NO_SUCH_VALUE;
189 
190  default:
191  return CR_FAILURE;
192  }
193 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define CR_NO_SUCH_VALUE
Definition: cfgmgr32.h:883
#define CR_ACCESS_DENIED
Definition: cfgmgr32.h:897
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:52
#define STATUS_NO_SUCH_DEVICE
Definition: udferr_usr.h:136
#define CR_BUFFER_SMALL
Definition: cfgmgr32.h:872
#define CR_FAILURE
Definition: cfgmgr32.h:865
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
Status
Definition: gdiplustypes.h:24
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
#define STATUS_OBJECT_NAME_NOT_FOUND
Definition: udferr_usr.h:149
#define CR_NO_SUCH_DEVINST
Definition: cfgmgr32.h:858
DWORD WINAPI PNP_AddEmptyLogConf ( handle_t  hBinding,
LPWSTR  pDeviceID,
DWORD  ulPriority,
DWORD pulLogConfTag,
DWORD  ulFlags 
)

Definition at line 2549 of file umpnpmgr.c.

Referenced by CM_Add_Empty_Log_Conf_Ex().

2555 {
2556  UNIMPLEMENTED;
2557  return CR_CALL_NOT_IMPLEMENTED;
2558 }
#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 2113 of file umpnpmgr.c.

Referenced by CM_Add_ID_ExW().

2118 {
2120  HKEY hDeviceKey;
2121  LPWSTR pszSubKey;
2122  DWORD dwDeviceIdListSize;
2123  DWORD dwNewDeviceIdSize;
2124  WCHAR * pszDeviceIdList = NULL;
2125 
2126  UNREFERENCED_PARAMETER(hBinding);
2127 
2128  DPRINT("PNP_AddID() called\n");
2129  DPRINT(" DeviceInstance: %S\n", pszDeviceID);
2130  DPRINT(" DeviceId: %S\n", pszID);
2131  DPRINT(" Flags: %lx\n", ulFlags);
2132 
2133  if (RegOpenKeyExW(hEnumKey,
2134  pszDeviceID,
2135  0,
2137  &hDeviceKey) != ERROR_SUCCESS)
2138  {
2139  DPRINT("Failed to open the device key!\n");
2140  return CR_INVALID_DEVNODE;
2141  }
2142 
2143  pszSubKey = (ulFlags & CM_ADD_ID_COMPATIBLE) ? L"CompatibleIDs" : L"HardwareID";
2144 
2145  if (RegQueryValueExW(hDeviceKey,
2146  pszSubKey,
2147  NULL,
2148  NULL,
2149  NULL,
2150  &dwDeviceIdListSize) != ERROR_SUCCESS)
2151  {
2152  DPRINT("Failed to query the desired ID string!\n");
2153  ret = CR_REGISTRY_ERROR;
2154  goto Done;
2155  }
2156 
2157  dwNewDeviceIdSize = lstrlenW(pszDeviceID);
2158  if (!dwNewDeviceIdSize)
2159  {
2160  ret = CR_INVALID_POINTER;
2161  goto Done;
2162  }
2163 
2164  dwDeviceIdListSize += (dwNewDeviceIdSize + 2) * sizeof(WCHAR);
2165 
2166  pszDeviceIdList = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwDeviceIdListSize);
2167  if (!pszDeviceIdList)
2168  {
2169  DPRINT("Failed to allocate memory for the desired ID string!\n");
2170  ret = CR_OUT_OF_MEMORY;
2171  goto Done;
2172  }
2173 
2174  if (RegQueryValueExW(hDeviceKey,
2175  pszSubKey,
2176  NULL,
2177  NULL,
2178  (LPBYTE)pszDeviceIdList,
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  /* Check whether the device ID is already in use */
2187  if (CheckForDeviceId(pszDeviceIdList, pszDeviceID))
2188  {
2189  DPRINT("Device ID was found in the ID string!\n");
2190  ret = CR_SUCCESS;
2191  goto Done;
2192  }
2193 
2194  /* Append the Device ID */
2195  AppendDeviceId(pszDeviceIdList, &dwDeviceIdListSize, pszID);
2196 
2197  if (RegSetValueExW(hDeviceKey,
2198  pszSubKey,
2199  0,
2200  REG_MULTI_SZ,
2201  (LPBYTE)pszDeviceIdList,
2202  dwDeviceIdListSize) != ERROR_SUCCESS)
2203  {
2204  DPRINT("Failed to set the desired ID string!\n");
2205  ret = CR_REGISTRY_ERROR;
2206  }
2207 
2208 Done:
2209  RegCloseKey(hDeviceKey);
2210  if (pszDeviceIdList)
2211  HeapFree(GetProcessHeap(), 0, pszDeviceIdList);
2212 
2213  DPRINT("PNP_AddID() done (returns %lx)\n", ret);
2214 
2215  return ret;
2216 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_SET_VALUE
Definition: nt_native.h:1017
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
__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:84
#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:416
void DPRINT(...)
Definition: polytest.cpp:61
#define CR_OUT_OF_MEMORY
Definition: cfgmgr32.h:844
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4917
static VOID AppendDeviceId(LPWSTR lpDeviceIdList, LPDWORD lpDeviceIdListSize, LPWSTR lpDeviceId)
Definition: umpnpmgr.c:2090
#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:2069
int ret
static const WCHAR L[]
Definition: oid.c:1087
#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 2626 of file umpnpmgr.c.

2636 {
2637  UNIMPLEMENTED;
2638  return CR_CALL_NOT_IMPLEMENTED;
2639 }
#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 3101 of file umpnpmgr.c.

3103 {
3104  UNIMPLEMENTED;
3105  return CR_CALL_NOT_IMPLEMENTED;
3106 }
#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 210 of file umpnpmgr.c.

212 {
213  UNREFERENCED_PARAMETER(hBinding);
214  return CR_SUCCESS;
215 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#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 1796 of file umpnpmgr.c.

Referenced by CM_Create_DevNode_ExW().

1802 {
1804 
1805  DPRINT("PNP_CreateDevInst: %S\n", pszDeviceID);
1806 
1807  if (ulFlags & CM_CREATE_DEVNODE_GENERATE_ID)
1808  {
1809  WCHAR szGeneratedInstance[MAX_DEVICE_ID_LEN];
1810  DWORD dwInstanceNumber;
1811 
1812  /* Generated ID is: Root<Device ID><Instance number> */
1813  dwInstanceNumber = 0;
1814  do
1815  {
1816  swprintf(szGeneratedInstance, L"Root\\%ls\\%04lu",
1817  pszDeviceID, dwInstanceNumber);
1818 
1819  /* Try to create a device instance with this ID */
1820  ret = CreateDeviceInstance(szGeneratedInstance);
1821 
1822  dwInstanceNumber++;
1823  }
1824  while (ret == CR_ALREADY_SUCH_DEVINST);
1825 
1826  if (ret == CR_SUCCESS)
1827  {
1828  /* pszDeviceID is an out parameter too for generated IDs */
1829  if (wcslen(szGeneratedInstance) > ulLength)
1830  {
1831  ret = CR_BUFFER_SMALL;
1832  }
1833  else
1834  {
1835  wcscpy(pszDeviceID, szGeneratedInstance);
1836  }
1837  }
1838  }
1839  else
1840  {
1841  /* Create the device instance */
1842  ret = CreateDeviceInstance(pszDeviceID);
1843  }
1844 
1845  DPRINT("PNP_CreateDevInst() done (returns %lx)\n", ret);
1846 
1847  return ret;
1848 }
#define CM_CREATE_DEVNODE_GENERATE_ID
Definition: cfgmgr32.h:622
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_DEVICE_ID_LEN
Definition: pnpmgr.c:28
#define CR_ALREADY_SUCH_DEVINST
Definition: cfgmgr32.h:862
DWORD DWORD
Definition: winlogon.h:84
#define CR_SUCCESS
Definition: cfgmgr32.h:842
void DPRINT(...)
Definition: polytest.cpp:61
static CONFIGRET CreateDeviceInstance(LPWSTR pszDeviceID)
Definition: umpnpmgr.c:1688
#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)
static const WCHAR L[]
Definition: oid.c:1087
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 1111 of file umpnpmgr.c.

1116 {
1117  HKEY hKey = 0;
1118 
1120  pszSubKey,
1121  0,
1122  NULL,
1123  0,
1125  NULL,
1126  &hKey,
1127  NULL))
1128  return CR_REGISTRY_ERROR;
1129 
1130  /* FIXME: Set security key */
1131 
1132  RegCloseKey(hKey);
1133 
1134  return CR_SUCCESS;
1135 }
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:416
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 1255 of file umpnpmgr.c.

Referenced by CM_Delete_Class_Key_Ex().

1259 {
1261 
1262  UNREFERENCED_PARAMETER(hBinding);
1263 
1264  DPRINT("PNP_GetClassName(%S, %lx) called\n", pszClassGuid, ulFlags);
1265 
1266  if (ulFlags & CM_DELETE_CLASS_SUBKEYS)
1267  {
1268  if (SHDeleteKeyW(hClassKey, pszClassGuid) != ERROR_SUCCESS)
1269  ret = CR_REGISTRY_ERROR;
1270  }
1271  else
1272  {
1273  if (RegDeleteKeyW(hClassKey, pszClassGuid) != ERROR_SUCCESS)
1274  ret = CR_REGISTRY_ERROR;
1275  }
1276 
1277  DPRINT("PNP_DeleteClassKey() done (returns %lx)\n", ret);
1278 
1279  return ret;
1280 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define CM_DELETE_CLASS_SUBKEYS
Definition: cfgmgr32.h:635
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
Definition: reg.c: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:1546
#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 1141 of file umpnpmgr.c.

1147 {
1148  UNIMPLEMENTED;
1149  return CR_CALL_NOT_IMPLEMENTED;
1150 }
#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 3158 of file umpnpmgr.c.

3160 {
3161  UNIMPLEMENTED;
3162  return CR_CALL_NOT_IMPLEMENTED;
3163 }
#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 2740 of file umpnpmgr.c.

2748 {
2749  DPRINT("PNP_DetectResourceConflict()\n");
2750 
2751  if (pbConflictDetected != NULL)
2752  *pbConflictDetected = FALSE;
2753 
2754  return CR_CALL_NOT_IMPLEMENTED;
2755 }
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
DWORD WINAPI PNP_DeviceInstanceAction ( handle_t  hBinding,
DWORD  ulAction,
DWORD  ulFlags,
LPWSTR  pszDeviceInstance1,
LPWSTR  pszDeviceInstance2 
)

Definition at line 1935 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().

1941 {
1943 
1944  UNREFERENCED_PARAMETER(hBinding);
1945 
1946  DPRINT("PNP_DeviceInstanceAction() called\n");
1947 
1948  switch (ulAction)
1949  {
1950  case PNP_DEVINST_MOVE:
1951  ret = MoveDeviceInstance(pszDeviceInstance1,
1952  pszDeviceInstance2);
1953  break;
1954 
1955  case PNP_DEVINST_SETUP:
1956  ret = SetupDeviceInstance(pszDeviceInstance1,
1957  ulFlags);
1958  break;
1959 
1960  case PNP_DEVINST_ENABLE:
1961  ret = EnableDeviceInstance(pszDeviceInstance1);
1962  break;
1963 
1964  case PNP_DEVINST_DISABLE:
1965  ret = DisableDeviceInstance(pszDeviceInstance1);
1966  break;
1967 
1968  case PNP_DEVINST_REENUMERATE:
1969  ret = ReenumerateDeviceInstance(pszDeviceInstance1,
1970  ulFlags);
1971  break;
1972 
1973  default:
1974  DPRINT1("Unknown device action %lu: not implemented\n", ulAction);
1976  }
1977 
1978  DPRINT("PNP_DeviceInstanceAction() done (returns %lx)\n", ret);
1979 
1980  return ret;
1981 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
static CONFIGRET DisableDeviceInstance(LPWSTR pszDeviceInstance)
Definition: umpnpmgr.c:1890
static CONFIGRET ReenumerateDeviceInstance(_In_ LPWSTR pszDeviceInstance, _In_ ULONG ulFlags)
Definition: umpnpmgr.c:1899
#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:1862
static CONFIGRET EnableDeviceInstance(LPWSTR pszDeviceInstance)
Definition: umpnpmgr.c:1872
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define DPRINT1
Definition: precomp.h:8
static CONFIGRET MoveDeviceInstance(LPWSTR pszDeviceInstanceDestination, LPWSTR pszDeviceInstanceSource)
Definition: umpnpmgr.c:1852
DWORD WINAPI PNP_DisableDevInst ( handle_t  hBinding,
LPWSTR  pDeviceID,
PPNP_VETO_TYPE  pVetoType,
LPWSTR  pszVetoName,
DWORD  ulNameLength,
DWORD  ulFlags 
)

Definition at line 2043 of file umpnpmgr.c.

2050 {
2051  UNIMPLEMENTED;
2052  return CR_CALL_NOT_IMPLEMENTED;
2053 }
#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 199 of file umpnpmgr.c.

201 {
202  UNREFERENCED_PARAMETER(hBinding);
203  return CR_SUCCESS;
204 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define CR_SUCCESS
Definition: cfgmgr32.h:842
DWORD WINAPI PNP_DriverStoreAddDriverPackage ( handle_t  hBinding)

Definition at line 3112 of file umpnpmgr.c.

3114 {
3115  UNIMPLEMENTED;
3116  return CR_CALL_NOT_IMPLEMENTED;
3117 }
#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 3123 of file umpnpmgr.c.

3125 {
3126  UNIMPLEMENTED;
3127  return CR_CALL_NOT_IMPLEMENTED;
3128 }
#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 438 of file umpnpmgr.c.

Referenced by CM_Enumerate_Classes_Ex(), and CM_Enumerate_Enumerators_ExW().

446 {
448  HKEY hKey;
449  DWORD dwError;
450 
451  UNREFERENCED_PARAMETER(hBinding);
452  UNREFERENCED_PARAMETER(ulFlags);
453 
454  DPRINT("PNP_EnumerateSubKeys() called\n");
455 
456  switch (ulBranch)
457  {
458  case PNP_ENUMERATOR_SUBKEYS:
459  hKey = hEnumKey;
460  break;
461 
462  case PNP_CLASS_SUBKEYS:
463  hKey = hClassKey;
464  break;
465 
466  default:
467  return CR_FAILURE;
468  }
469 
470  *pulRequiredLen = ulLength;
471  dwError = RegEnumKeyExW(hKey,
472  ulIndex,
473  Buffer,
474  pulRequiredLen,
475  NULL,
476  NULL,
477  NULL,
478  NULL);
479  if (dwError != ERROR_SUCCESS)
480  {
481  ret = (dwError == ERROR_NO_MORE_ITEMS) ? CR_NO_SUCH_VALUE : CR_FAILURE;
482  }
483  else
484  {
485  (*pulRequiredLen)++;
486  }
487 
488  DPRINT("PNP_EnumerateSubKeys() done (returns %lx)\n", ret);
489 
490  return ret;
491 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:95
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define CR_NO_SUCH_VALUE
Definition: cfgmgr32.h:883
DWORD DWORD
Definition: winlogon.h:84
#define CR_SUCCESS
Definition: cfgmgr32.h:842
static HKEY hEnumKey
Definition: umpnpmgr.c:65
smooth NULL
Definition: ftsmooth.c:416
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 2564 of file umpnpmgr.c.

Referenced by CM_Free_Log_Conf_Ex().

2570 {
2571  UNIMPLEMENTED;
2572  return CR_CALL_NOT_IMPLEMENTED;
2573 }
#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 2645 of file umpnpmgr.c.

2655 {
2656  UNIMPLEMENTED;
2657  return CR_CALL_NOT_IMPLEMENTED;
2658 }
#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 2992 of file umpnpmgr.c.

Referenced by CMP_GetBlockedDriverInfo().

2998 {
2999  UNIMPLEMENTED;
3000  return CR_CALL_NOT_IMPLEMENTED;
3001 }
#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 1156 of file umpnpmgr.c.

1160 {
1161  HKEY hKey;
1162  DWORD dwError;
1163 
1164  UNREFERENCED_PARAMETER(hBinding);
1165  UNREFERENCED_PARAMETER(ulFlags);
1166 
1169  0,
1171  &hKey);
1172  if (dwError != ERROR_SUCCESS)
1173  return CR_INVALID_DATA;
1174 
1175  dwError = RegQueryInfoKeyW(hKey,
1176  NULL,
1177  NULL,
1178  NULL,
1179  pulClassCount,
1180  NULL,
1181  NULL,
1182  NULL,
1183  NULL,
1184  NULL,
1185  NULL,
1186  NULL);
1187  RegCloseKey(hKey);
1188  if (dwError != ERROR_SUCCESS)
1189  return CR_INVALID_DATA;
1190 
1191  return CR_SUCCESS;
1192 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
DWORD DWORD
Definition: winlogon.h:84
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
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 1097 of file umpnpmgr.c.

1102 {
1103  UNIMPLEMENTED;
1104  return CR_CALL_NOT_IMPLEMENTED;
1105 }
#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 1198 of file umpnpmgr.c.

Referenced by CM_Get_Class_Name_ExW().

1204 {
1205  WCHAR szKeyName[MAX_PATH];
1207  HKEY hKey;
1208  DWORD dwSize;
1209 
1210  UNREFERENCED_PARAMETER(hBinding);
1211  UNREFERENCED_PARAMETER(ulFlags);
1212 
1213  DPRINT("PNP_GetClassName() called\n");
1214 
1215  lstrcpyW(szKeyName, L"System\\CurrentControlSet\\Control\\Class\\");
1216  if (lstrlenW(pszClassGuid) + 1 < sizeof(szKeyName)/sizeof(WCHAR)-(lstrlenW(szKeyName) * sizeof(WCHAR)))
1217  lstrcatW(szKeyName, pszClassGuid);
1218  else
1219  return CR_INVALID_DATA;
1220 
1222  szKeyName,
1223  0,
1225  &hKey))
1226  return CR_REGISTRY_ERROR;
1227 
1228  dwSize = *pulLength * sizeof(WCHAR);
1229  if (RegQueryValueExW(hKey,
1230  L"Class",
1231  NULL,
1232  NULL,
1233  (LPBYTE)Buffer,
1234  &dwSize))
1235  {
1236  *pulLength = 0;
1237  ret = CR_REGISTRY_ERROR;
1238  }
1239  else
1240  {
1241  *pulLength = dwSize / sizeof(WCHAR);
1242  }
1243 
1244  RegCloseKey(hKey);
1245 
1246  DPRINT("PNP_GetClassName() done (returns %lx)\n", ret);
1247 
1248  return ret;
1249 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
__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:84
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
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
static const WCHAR L[]
Definition: oid.c:1087
#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 1419 of file umpnpmgr.c.

Referenced by CM_Get_Class_Registry_PropertyW().

1428 {
1430  LPWSTR lpValueName = NULL;
1431  HKEY hInstKey = NULL;
1432  HKEY hPropKey = NULL;
1433  LONG lError;
1434 
1435  UNREFERENCED_PARAMETER(hBinding);
1436 
1437  DPRINT("PNP_GetClassRegProp() called\n");
1438 
1439  if (pulTransferLen == NULL || pulLength == NULL)
1440  {
1441  ret = CR_INVALID_POINTER;
1442  goto done;
1443  }
1444 
1445  if (ulFlags != 0)
1446  {
1447  ret = CR_INVALID_FLAG;
1448  goto done;
1449  }
1450 
1451  if (*pulLength < *pulTransferLen)
1452  *pulLength = *pulTransferLen;
1453 
1454  *pulTransferLen = 0;
1455 
1456  switch (ulProperty)
1457  {
1458  case CM_CRP_SECURITY:
1459  lpValueName = L"Security";
1460  break;
1461 
1462  case CM_CRP_DEVTYPE:
1463  lpValueName = L"DeviceType";
1464  break;
1465 
1466  case CM_CRP_EXCLUSIVE:
1467  lpValueName = L"Exclusive";
1468  break;
1469 
1471  lpValueName = L"DeviceCharacteristics";
1472  break;
1473 
1474  default:
1475  ret = CR_INVALID_PROPERTY;
1476  goto done;
1477  }
1478 
1479  DPRINT("Value name: %S\n", lpValueName);
1480 
1481  lError = RegOpenKeyExW(hClassKey,
1482  pszClassGuid,
1483  0,
1484  KEY_READ,
1485  &hInstKey);
1486  if (lError != ERROR_SUCCESS)
1487  {
1488  *pulLength = 0;
1490  goto done;
1491  }
1492 
1493  lError = RegOpenKeyExW(hInstKey,
1494  L"Properties",
1495  0,
1496  KEY_READ,
1497  &hPropKey);
1498  if (lError != ERROR_SUCCESS)
1499  {
1500  *pulLength = 0;
1502  goto done;
1503  }
1504 
1505  lError = RegQueryValueExW(hPropKey,
1506  lpValueName,
1507  NULL,
1508  pulRegDataType,
1509  Buffer,
1510  pulLength);
1511  if (lError != ERROR_SUCCESS)
1512  {
1513  if (lError == ERROR_MORE_DATA)
1514  {
1515  ret = CR_BUFFER_SMALL;
1516  }
1517  else
1518  {
1519  *pulLength = 0;
1520  ret = CR_NO_SUCH_VALUE;
1521  }
1522  }
1523 
1524 done:
1525  if (ret == CR_SUCCESS)
1526  *pulTransferLen = *pulLength;
1527 
1528  if (hPropKey != NULL)
1529  RegCloseKey(hPropKey);
1530 
1531  if (hInstKey != NULL)
1532  RegCloseKey(hInstKey);
1533 
1534  DPRINT("PNP_GetClassRegProp() done (returns %lx)\n", ret);
1535 
1536  return ret;
1537 }
#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
#define KEY_READ
Definition: nt_native.h:1023
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define CM_CRP_DEVTYPE
Definition: cfgmgr32.h:710
#define CR_NO_SUCH_VALUE
Definition: cfgmgr32.h:883
#define CM_CRP_CHARACTERISTICS
Definition: cfgmgr32.h:714
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
#define CM_CRP_EXCLUSIVE
Definition: cfgmgr32.h:712
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
#define CR_INVALID_PROPERTY
Definition: cfgmgr32.h:899
void DPRINT(...)
Definition: polytest.cpp:61
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
static const WCHAR L[]
Definition: oid.c:1087
#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 2882 of file umpnpmgr.c.

Referenced by CM_Get_DevNode_Custom_Property_ExW().

2891 {
2892  HKEY hDeviceKey = NULL;
2893  HKEY hParamKey = NULL;
2894  LONG lError;
2896 
2897  UNREFERENCED_PARAMETER(hBinding);
2898 
2899  DPRINT("PNP_GetCustomDevProp() called\n");
2900 
2901  if (pulTransferLen == NULL || pulLength == NULL)
2902  {
2903  ret = CR_INVALID_POINTER;
2904  goto done;
2905  }
2906 
2907  if (ulFlags & ~CM_CUSTOMDEVPROP_BITS)
2908  {
2909  ret = CR_INVALID_FLAG;
2910  goto done;
2911  }
2912 
2913  if (*pulLength < *pulTransferLen)
2914  *pulLength = *pulTransferLen;
2915 
2916  *pulTransferLen = 0;
2917 
2918  lError = RegOpenKeyExW(hEnumKey,
2919  pDeviceID,
2920  0,
2921  KEY_READ,
2922  &hDeviceKey);
2923  if (lError != ERROR_SUCCESS)
2924  {
2925  ret = CR_REGISTRY_ERROR;
2926  goto done;
2927  }
2928 
2929  lError = RegOpenKeyExW(hDeviceKey,
2930  L"Device Parameters",
2931  0,
2932  KEY_READ,
2933  &hParamKey);
2934  if (lError != ERROR_SUCCESS)
2935  {
2936  ret = CR_REGISTRY_ERROR;
2937  goto done;
2938  }
2939 
2940  lError = RegQueryValueExW(hParamKey,
2941  CustomPropName,
2942  NULL,
2943  pulRegDataType,
2944  Buffer,
2945  pulLength);
2946  if (lError != ERROR_SUCCESS)
2947  {
2948  if (lError == ERROR_MORE_DATA)
2949  {
2950  ret = CR_BUFFER_SMALL;
2951  }
2952  else
2953  {
2954  *pulLength = 0;
2955  ret = CR_NO_SUCH_VALUE;
2956  }
2957  }
2958 
2959 done:
2960  if (ret == CR_SUCCESS)
2961  *pulTransferLen = *pulLength;
2962 
2963  if (hParamKey != NULL)
2964  RegCloseKey(hParamKey);
2965 
2966  if (hDeviceKey != NULL)
2967  RegCloseKey(hDeviceKey);
2968 
2969  DPRINT("PNP_GetCustomDevProp() done (returns %lx)\n", ret);
2970 
2971  return ret;
2972 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
#define KEY_READ
Definition: nt_native.h:1023
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#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:416
void DPRINT(...)
Definition: polytest.cpp:61
Definition: bufpool.h:45
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
HANDLE HKEY
Definition: registry.h:24
#define CR_BUFFER_SMALL
Definition: cfgmgr32.h:872
int ret
static const WCHAR L[]
Definition: oid.c:1087
#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 659 of file umpnpmgr.c.

Referenced by CM_Get_Depth_Ex().

664 {
665  PLUGPLAY_CONTROL_DEPTH_DATA PlugPlayData;
668 
669  UNREFERENCED_PARAMETER(hBinding);
670  UNREFERENCED_PARAMETER(ulFlags);
671 
672  DPRINT("PNP_GetDepth() called\n");
673 
674  RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
675  pszDeviceID);
676 
678  (PVOID)&PlugPlayData,
680  if (NT_SUCCESS(Status))
681  {
682  *pulDepth = PlugPlayData.Depth;
683  }
684  else
685  {
686  ret = NtStatusToCrError(Status);
687  }
688 
689  DPRINT("PNP_GetDepth() done (returns %lx)\n", ret);
690 
691  return ret;
692 }
DWORD *typedef PVOID
Definition: winlogon.h:61
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define CR_SUCCESS
Definition: cfgmgr32.h:842
void DPRINT(...)
Definition: polytest.cpp:61
LONG NTSTATUS
Definition: precomp.h:26
#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:1245
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:495
DWORD WINAPI PNP_GetDeviceList ( handle_t  hBinding,
LPWSTR  pszFilter,
LPWSTR  Buffer,
PNP_RPC_STRING_LEN pulLength,
DWORD  ulFlags 
)

Definition at line 497 of file umpnpmgr.c.

Referenced by CM_Get_Device_ID_List_ExW().

503 {
507 
508  DPRINT("PNP_GetDeviceList() called\n");
509 
510  if (ulFlags & ~CM_GETIDLIST_FILTER_BITS)
511  return CR_INVALID_FLAG;
512 
513  if (pulLength == NULL || pszFilter == NULL)
514  return CR_INVALID_POINTER;
515 
516 // if (Buffer == NULL)
517 // return CR_INVALID_POINTER;
518 
519  if (ulFlags &
524  {
525  RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
526  pszFilter);
527  if (ulFlags & CM_GETIDLIST_FILTER_BUSRELATIONS)
528  {
529  PlugPlayData.Relations = 3;
530  }
531  else if (ulFlags & CM_GETIDLIST_FILTER_POWERRELATIONS)
532  {
533  PlugPlayData.Relations = 2;
534  }
535  else if (ulFlags & CM_GETIDLIST_FILTER_REMOVALRELATIONS)
536  {
537  PlugPlayData.Relations = 1;
538  }
539  else if (ulFlags & CM_GETIDLIST_FILTER_EJECTRELATIONS)
540  {
541  PlugPlayData.Relations = 0;
542  }
543 
544  PlugPlayData.BufferSize = *pulLength * sizeof(WCHAR);
545  PlugPlayData.Buffer = Buffer;
546 
548  (PVOID)&PlugPlayData,
550  if (NT_SUCCESS(Status))
551  {
552  *pulLength = PlugPlayData.BufferSize / sizeof(WCHAR);
553  }
554  else
555  {
556  ret = NtStatusToCrError(Status);
557  }
558  }
559  else if (ulFlags & CM_GETIDLIST_FILTER_SERVICE)
560  {
562  }
563  else if (ulFlags & CM_GETIDLIST_FILTER_ENUMERATOR)
564  {
566  }
567  else /* CM_GETIDLIST_FILTER_NONE */
568  {
570  }
571 
572  return ret;
573 }
DWORD *typedef PVOID
Definition: winlogon.h:61
#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
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define CM_GETIDLIST_FILTER_REMOVALRELATIONS
Definition: cfgmgr32.h:658
LONG NTSTATUS
Definition: precomp.h:26
#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:1245
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 579 of file umpnpmgr.c.

Referenced by CM_Get_Device_ID_List_Size_ExW().

584 {
588 
589  DPRINT("PNP_GetDeviceListSize() called\n");
590 
591  if (ulFlags & ~CM_GETIDLIST_FILTER_BITS)
592  return CR_INVALID_FLAG;
593 
594  if (pulLength == NULL || pszFilter == NULL)
595  return CR_INVALID_POINTER;
596 
597  *pulLength = 0;
598 
599  if (ulFlags &
604  {
605  RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
606  pszFilter);
607  if (ulFlags & CM_GETIDLIST_FILTER_BUSRELATIONS)
608  {
609  PlugPlayData.Relations = 3;
610  }
611  else if (ulFlags & CM_GETIDLIST_FILTER_POWERRELATIONS)
612  {
613  PlugPlayData.Relations = 2;
614  }
615  else if (ulFlags & CM_GETIDLIST_FILTER_REMOVALRELATIONS)
616  {
617  PlugPlayData.Relations = 1;
618  }
619  else if (ulFlags & CM_GETIDLIST_FILTER_EJECTRELATIONS)
620  {
621  PlugPlayData.Relations = 0;
622  }
623 
624  PlugPlayData.BufferSize = 0;
625  PlugPlayData.Buffer = NULL;
626 
628  (PVOID)&PlugPlayData,
630  if (NT_SUCCESS(Status))
631  {
632  *pulLength = PlugPlayData.BufferSize / sizeof(WCHAR);
633  }
634  else
635  {
636  ret = NtStatusToCrError(Status);
637  }
638  }
639  else if (ulFlags & CM_GETIDLIST_FILTER_SERVICE)
640  {
642  }
643  else if (ulFlags & CM_GETIDLIST_FILTER_ENUMERATOR)
644  {
646  }
647  else /* CM_GETIDLIST_FILTER_NONE */
648  {
650  }
651 
652  return ret;
653 }
DWORD *typedef PVOID
Definition: winlogon.h:61
#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:416
void DPRINT(...)
Definition: polytest.cpp:61
#define CM_GETIDLIST_FILTER_REMOVALRELATIONS
Definition: cfgmgr32.h:658
LONG NTSTATUS
Definition: precomp.h:26
#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:1245
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 698 of file umpnpmgr.c.

Referenced by CM_Get_DevNode_Registry_Property_ExW(), and GetDeviceInstanceKeyPath().

707 {
708  PLUGPLAY_CONTROL_PROPERTY_DATA PlugPlayData;
710  LPWSTR lpValueName = NULL;
711  HKEY hKey = NULL;
712  LONG lError;
714 
715  UNREFERENCED_PARAMETER(hBinding);
716 
717  DPRINT("PNP_GetDeviceRegProp() called\n");
718 
719  if (pulTransferLen == NULL || pulLength == NULL)
720  {
721  ret = CR_INVALID_POINTER;
722  goto done;
723  }
724 
725  if (ulFlags != 0)
726  {
727  ret = CR_INVALID_FLAG;
728  goto done;
729  }
730 
731  /* FIXME: Check pDeviceID */
732 
733  if (*pulLength < *pulTransferLen)
734  *pulLength = *pulTransferLen;
735 
736  *pulTransferLen = 0;
737 
738  switch (ulProperty)
739  {
740  case CM_DRP_DEVICEDESC:
741  lpValueName = L"DeviceDesc";
742  break;
743 
744  case CM_DRP_HARDWAREID:
745  lpValueName = L"HardwareID";
746  break;
747 
749  lpValueName = L"CompatibleIDs";
750  break;
751 
752  case CM_DRP_SERVICE:
753  lpValueName = L"Service";
754  break;
755 
756  case CM_DRP_CLASS:
757  lpValueName = L"Class";
758  break;
759 
760  case CM_DRP_CLASSGUID:
761  lpValueName = L"ClassGUID";
762  break;
763 
764  case CM_DRP_DRIVER:
765  lpValueName = L"Driver";
766  break;
767 
768  case CM_DRP_CONFIGFLAGS:
769  lpValueName = L"ConfigFlags";
770  break;
771 
772  case CM_DRP_MFG:
773  lpValueName = L"Mfg";
774  break;
775 
776  case CM_DRP_FRIENDLYNAME:
777  lpValueName = L"FriendlyName";
778  break;
779 
781  lpValueName = L"LocationInformation";
782  break;
783 
786  break;
787 
788  case CM_DRP_CAPABILITIES:
789  lpValueName = L"Capabilities";
790  break;
791 
792  case CM_DRP_UI_NUMBER:
793  PlugPlayData.Property = PNP_PROPERTY_UI_NUMBER;
794  break;
795 
796  case CM_DRP_UPPERFILTERS:
797  lpValueName = L"UpperFilters";
798  break;
799 
800  case CM_DRP_LOWERFILTERS:
801  lpValueName = L"LowerFilters";
802  break;
803 
804  case CM_DRP_BUSTYPEGUID:
805  PlugPlayData.Property = PNP_PROPERTY_BUSTYPEGUID;
806  break;
807 
809  PlugPlayData.Property = PNP_PROPERTY_LEGACYBUSTYPE;
810  break;
811 
812  case CM_DRP_BUSNUMBER:
813  PlugPlayData.Property = PNP_PROPERTY_BUSNUMBER;
814  break;
815 
817  PlugPlayData.Property = PNP_PROPERTY_ENUMERATOR_NAME;
818  break;
819 
820  case CM_DRP_SECURITY:
821  lpValueName = L"Security";
822  break;
823 
824  case CM_DRP_DEVTYPE:
825  lpValueName = L"DeviceType";
826  break;
827 
828  case CM_DRP_EXCLUSIVE:
829  lpValueName = L"Exclusive";
830  break;
831 
833  lpValueName = L"DeviceCharacteristics";
834  break;
835 
836  case CM_DRP_ADDRESS:
837  PlugPlayData.Property = PNP_PROPERTY_ADDRESS;
838  break;
839 
841  lpValueName = L"UINumberDescFormat";
842  break;
843 
845  PlugPlayData.Property = PNP_PROPERTY_POWER_DATA;
846  break;
847 
849  PlugPlayData.Property = PNP_PROPERTY_REMOVAL_POLICY;
850  break;
851 
854  break;
855 
857  lpValueName = L"RemovalPolicy";
858  break;
859 
861  PlugPlayData.Property = PNP_PROPERTY_INSTALL_STATE;
862  break;
863 
864 #if (WINVER >= _WIN32_WINNT_WS03)
866  PlugPlayData.Property = PNP_PROPERTY_LOCATION_PATHS;
867  break;
868 #endif
869 
870 #if (WINVER >= _WIN32_WINNT_WIN7)
872  PlugPlayData.Property = PNP_PROPERTY_CONTAINERID;
873  break;
874 #endif
875 
876  default:
877  ret = CR_INVALID_PROPERTY;
878  goto done;
879  }
880 
881  DPRINT("Value name: %S\n", lpValueName);
882 
883  if (lpValueName)
884  {
885  /* Retrieve information from the Registry */
886  lError = RegOpenKeyExW(hEnumKey,
887  pDeviceID,
888  0,
890  &hKey);
891  if (lError != ERROR_SUCCESS)
892  {
893  hKey = NULL;
894  *pulLength = 0;
895  ret = CR_INVALID_DEVNODE;
896  goto done;
897  }
898 
899  lError = RegQueryValueExW(hKey,
900  lpValueName,
901  NULL,
902  pulRegDataType,
903  Buffer,
904  pulLength);
905  if (lError != ERROR_SUCCESS)
906  {
907  if (lError == ERROR_MORE_DATA)
908  {
909  ret = CR_BUFFER_SMALL;
910  }
911  else
912  {
913  *pulLength = 0;
914  ret = CR_NO_SUCH_VALUE;
915  }
916  }
917  }
918  else
919  {
920  /* Retrieve information from the Device Node */
921  RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
922  pDeviceID);
923  PlugPlayData.Buffer = Buffer;
924  PlugPlayData.BufferSize = *pulLength;
925 
927  (PVOID)&PlugPlayData,
929  if (NT_SUCCESS(Status))
930  {
931  *pulLength = PlugPlayData.BufferSize;
932  }
933  else
934  {
935  ret = NtStatusToCrError(Status);
936  }
937  }
938 
939 done:
940  if (pulTransferLen)
941  *pulTransferLen = (ret == CR_SUCCESS) ? *pulLength : 0;
942 
943  if (hKey != NULL)
944  RegCloseKey(hKey);
945 
946  DPRINT("PNP_GetDeviceRegProp() done (returns %lx)\n", ret);
947 
948  return ret;
949 }
DWORD *typedef PVOID
Definition: winlogon.h:61
#define PNP_PROPERTY_POWER_DATA
Definition: cmtypes.h:39
#define ERROR_SUCCESS
Definition: deptool.c:10
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define CM_DRP_REMOVAL_POLICY_HW_DEFAULT
Definition: cfgmgr32.h:720
#define CM_DRP_FRIENDLYNAME
Definition: cfgmgr32.h:688
#define CM_DRP_EXCLUSIVE
Definition: cfgmgr32.h:711
#define CM_DRP_LEGACYBUSTYPE
Definition: cfgmgr32.h:702
#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
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
#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:416
#define CM_DRP_CLASSGUID
Definition: cfgmgr32.h:684
#define PNP_PROPERTY_BUSTYPEGUID
Definition: cmtypes.h:36
#define CR_INVALID_PROPERTY
Definition: cfgmgr32.h:899
#define PNP_PROPERTY_REMOVAL_POLICY_HARDWARE_DEFAULT
Definition: cmtypes.h:44
void DPRINT(...)
Definition: polytest.cpp:61
Definition: bufpool.h:45
#define CM_DRP_DEVTYPE
Definition: cfgmgr32.h:709
#define PNP_PROPERTY_ADDRESS
Definition: cmtypes.h:42
UNICODE_STRING DeviceInstance
Definition: cmtypes.h:468
#define PNP_PROPERTY_LOCATION_PATHS
Definition: cmtypes.h:46
#define PNP_PROPERTY_ENUMERATOR_NAME
Definition: cmtypes.h:43
LONG NTSTATUS
Definition: precomp.h:26
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 PNP_PROPERTY_REMOVAL_POLICY
Definition: cmtypes.h:40
#define CR_BUFFER_SMALL
Definition: cfgmgr32.h:872
#define CM_DRP_HARDWAREID
Definition: cfgmgr32.h:677
#define CM_DRP_REMOVAL_POLICY_OVERRIDE
Definition: cfgmgr32.h:721
#define CM_DRP_LOCATION_INFORMATION
Definition: cfgmgr32.h:689
#define CM_DRP_BASE_CONTAINERID
Definition: cfgmgr32.h:728
#define PNP_PROPERTY_UI_NUMBER
Definition: cmtypes.h:34
#define CM_DRP_DRIVER
Definition: cfgmgr32.h:685
int ret
static const WCHAR L[]
Definition: oid.c:1087
#define CM_DRP_DEVICEDESC
Definition: cfgmgr32.h:676
#define CM_DRP_PHYSICAL_DEVICE_OBJECT_NAME
Definition: cfgmgr32.h:690
#define PNP_PROPERTY_PHYSICAL_DEVICE_OBJECT_NAME
Definition: cmtypes.h:35
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
#define CM_DRP_UI_NUMBER
Definition: cfgmgr32.h:692
#define CM_DRP_DEVICE_POWER_DATA
Definition: cfgmgr32.h:718
#define CM_DRP_MFG
Definition: cfgmgr32.h:687
#define ERROR_MORE_DATA
Definition: dderror.h:13
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI NtPlugPlayControl(IN PLUGPLAY_CONTROL_CLASS PlugPlayControlClass, IN OUT PVOID Buffer, IN ULONG BufferLength)
Definition: plugplay.c:1245
#define CM_DRP_CHARACTERISTICS
Definition: cfgmgr32.h:713
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 PNP_PROPERTY_LEGACYBUSTYPE
Definition: cmtypes.h:37
#define CM_DRP_CLASS
Definition: cfgmgr32.h:683
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define PNP_PROPERTY_INSTALL_STATE
Definition: cmtypes.h:45
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c: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 PNP_PROPERTY_BUSNUMBER
Definition: cmtypes.h:38
#define PNP_PROPERTY_CONTAINERID
Definition: cmtypes.h:47
#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 1987 of file umpnpmgr.c.

Referenced by CM_Get_DevNode_Status_Ex().

1993 {
1994  PLUGPLAY_CONTROL_STATUS_DATA PlugPlayData;
1996  NTSTATUS Status;
1997 
1998  UNREFERENCED_PARAMETER(hBinding);
1999  UNREFERENCED_PARAMETER(ulFlags);
2000 
2001  DPRINT("PNP_GetDeviceStatus() called\n");
2002 
2003  RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
2004  pDeviceID);
2005  PlugPlayData.Operation = 0; /* Get status */
2006 
2008  (PVOID)&PlugPlayData,
2010  if (NT_SUCCESS(Status))
2011  {
2012  *pulStatus = PlugPlayData.DeviceStatus;
2013  *pulProblem = PlugPlayData.DeviceProblem;
2014  }
2015  else
2016  {
2017  ret = NtStatusToCrError(Status);
2018  }
2019 
2020  DPRINT("PNP_GetDeviceStatus() done (returns %lx)\n", ret);
2021 
2022  return ret;
2023 }
DWORD *typedef PVOID
Definition: winlogon.h:61
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
UNICODE_STRING DeviceInstance
Definition: cmtypes.h:486
#define CR_SUCCESS
Definition: cfgmgr32.h:842
void DPRINT(...)
Definition: polytest.cpp:61
LONG NTSTATUS
Definition: precomp.h:26
#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:1245
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 2579 of file umpnpmgr.c.

Referenced by CM_Get_First_Log_Conf_Ex().

2585 {
2586  UNIMPLEMENTED;
2587  return CR_CALL_NOT_IMPLEMENTED;
2588 }
#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 235 of file umpnpmgr.c.

Referenced by CM_Get_Global_State_Ex().

239 {
240  UNREFERENCED_PARAMETER(hBinding);
241  UNREFERENCED_PARAMETER(ulFlags);
242 
244  return CR_SUCCESS;
245 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define CM_GLOBAL_STATE_SERVICES_AVAILABLE
Definition: cfgmgr32.h:910
#define CM_GLOBAL_STATE_CAN_DO_UI
Definition: cfgmgr32.h:908
DWORD WINAPI PNP_GetHwProfInfo ( handle_t  hBinding,
DWORD  ulIndex,
HWPROFILEINFO pHWProfileInfo,
DWORD  ulProfileInfoSize,
DWORD  ulFlags 
)

Definition at line 2414 of file umpnpmgr.c.

Referenced by CM_Get_Hardware_Profile_Info_ExW().

2420 {
2421  WCHAR szProfileName[5];
2422  HKEY hKeyConfig = NULL;
2423  HKEY hKeyProfiles = NULL;
2424  HKEY hKeyProfile = NULL;
2425  DWORD dwDisposition;
2426  DWORD dwSize;
2427  LONG lError;
2429 
2430  UNREFERENCED_PARAMETER(hBinding);
2431 
2432  DPRINT("PNP_GetHwProfInfo() called\n");
2433 
2434  if (ulProfileInfoSize == 0)
2435  {
2436  ret = CR_INVALID_DATA;
2437  goto done;
2438  }
2439 
2440  if (ulFlags != 0)
2441  {
2442  ret = CR_INVALID_FLAG;
2443  goto done;
2444  }
2445 
2446  /* Initialize the profile information */
2447  pHWProfileInfo->HWPI_ulHWProfile = 0;
2448  pHWProfileInfo->HWPI_szFriendlyName[0] = 0;
2449  pHWProfileInfo->HWPI_dwFlags = 0;
2450 
2451  /* Open the 'IDConfigDB' key */
2453  L"System\\CurrentControlSet\\Control\\IDConfigDB",
2454  0,
2455  NULL,
2458  NULL,
2459  &hKeyConfig,
2460  &dwDisposition);
2461  if (lError != ERROR_SUCCESS)
2462  {
2463  ret = CR_REGISTRY_ERROR;
2464  goto done;
2465  }
2466 
2467  /* Open the 'Hardware Profiles' subkey */
2468  lError = RegCreateKeyExW(hKeyConfig,
2469  L"Hardware Profiles",
2470  0,
2471  NULL,
2474  NULL,
2475  &hKeyProfiles,
2476  &dwDisposition);
2477  if (lError != ERROR_SUCCESS)
2478  {
2479  ret = CR_REGISTRY_ERROR;
2480  goto done;
2481  }
2482 
2483  if (ulIndex == (ULONG)-1)
2484  {
2485  dwSize = sizeof(ULONG);
2486  lError = RegQueryValueExW(hKeyConfig,
2487  L"CurrentConfig",
2488  NULL,
2489  NULL,
2490  (LPBYTE)&pHWProfileInfo->HWPI_ulHWProfile,
2491  &dwSize);
2492  if (lError != ERROR_SUCCESS)
2493  {
2494  pHWProfileInfo->HWPI_ulHWProfile = 0;
2495  ret = CR_REGISTRY_ERROR;
2496  goto done;
2497  }
2498  }
2499  else
2500  {
2501  /* FIXME: not implemented yet */
2503  goto done;
2504  }
2505 
2506  swprintf(szProfileName, L"%04lu", pHWProfileInfo->HWPI_ulHWProfile);
2507 
2508  lError = RegOpenKeyExW(hKeyProfiles,
2509  szProfileName,
2510  0,
2512  &hKeyProfile);
2513  if (lError != ERROR_SUCCESS)
2514  {
2515  ret = CR_REGISTRY_ERROR;
2516  goto done;
2517  }
2518 
2519  dwSize = sizeof(pHWProfileInfo->HWPI_szFriendlyName);
2520  lError = RegQueryValueExW(hKeyProfile,
2521  L"FriendlyName",
2522  NULL,
2523  NULL,
2524  (LPBYTE)&pHWProfileInfo->HWPI_szFriendlyName,
2525  &dwSize);
2526  if (lError != ERROR_SUCCESS)
2527  {
2528  ret = CR_REGISTRY_ERROR;
2529  goto done;
2530  }
2531 
2532 done:
2533  if (hKeyProfile != NULL)
2534  RegCloseKey(hKeyProfile);
2535 
2536  if (hKeyProfiles != NULL)
2537  RegCloseKey(hKeyProfiles);
2538 
2539  if (hKeyConfig != NULL)
2540  RegCloseKey(hKeyConfig);
2541 
2542  return ret;
2543 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
DWORD HWPI_dwFlags
Definition: cfgmgr32.h:556
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned char * LPBYTE
Definition: typedefs.h:52
DWORD DWORD
Definition: winlogon.h:84
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:416
void DPRINT(...)
Definition: polytest.cpp:61
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c: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
static const WCHAR L[]
Definition: oid.c:1087
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 1286 of file umpnpmgr.c.

Referenced by CM_Get_Device_Interface_Alias_ExW().

1294 {
1295  UNIMPLEMENTED;
1296  return CR_CALL_NOT_IMPLEMENTED;
1297 }
#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 1303 of file umpnpmgr.c.

Referenced by CM_Get_Device_Interface_List_ExW().

1310 {
1311  NTSTATUS Status;
1313  DWORD ret = CR_SUCCESS;
1314 
1315  UNREFERENCED_PARAMETER(hBinding);
1316 
1317  RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
1318  pszDeviceID);
1319 
1320  PlugPlayData.Flags = ulFlags;
1321  PlugPlayData.FilterGuid = InterfaceGuid;
1322  PlugPlayData.Buffer = Buffer;
1323  PlugPlayData.BufferSize = *pulLength;
1324 
1326  (PVOID)&PlugPlayData,
1328  if (NT_SUCCESS(Status))
1329  {
1330  *pulLength = PlugPlayData.BufferSize;
1331  }
1332  else
1333  {
1334  ret = NtStatusToCrError(Status);
1335  }
1336 
1337  DPRINT("PNP_GetInterfaceDeviceListSize() done (returns %lx)\n", ret);
1338  return ret;
1339 }
DWORD *typedef PVOID
Definition: winlogon.h:61
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
DWORD DWORD
Definition: winlogon.h:84
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
#define CR_SUCCESS
Definition: cfgmgr32.h:842
void DPRINT(...)
Definition: polytest.cpp:61
LONG NTSTATUS
Definition: precomp.h:26
#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:1245
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 1345 of file umpnpmgr.c.

Referenced by CM_Get_Device_Interface_List_Size_ExW().

1351 {
1352  NTSTATUS Status;
1354  DWORD ret = CR_SUCCESS;
1355 
1356  UNREFERENCED_PARAMETER(hBinding);
1357 
1358  DPRINT("PNP_GetInterfaceDeviceListSize() called\n");
1359 
1360  RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
1361  pszDeviceID);
1362 
1363  PlugPlayData.FilterGuid = InterfaceGuid;
1364  PlugPlayData.Buffer = NULL;
1365  PlugPlayData.BufferSize = 0;
1366  PlugPlayData.Flags = ulFlags;
1367 
1369  (PVOID)&PlugPlayData,
1371  if (NT_SUCCESS(Status))
1372  {
1373  *pulLen = PlugPlayData.BufferSize;
1374  }
1375  else
1376  {
1377  ret = NtStatusToCrError(Status);
1378  }
1379 
1380  DPRINT("PNP_GetInterfaceDeviceListSize() done (returns %lx)\n", ret);
1381  return ret;
1382 }
DWORD *typedef PVOID
Definition: winlogon.h:61
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
DWORD DWORD
Definition: winlogon.h:84
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
LONG NTSTATUS
Definition: precomp.h:26
#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:1245
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 2610 of file umpnpmgr.c.

Referenced by CM_Get_Log_Conf_Priority_Ex().

2617 {
2618  UNIMPLEMENTED;
2619  return CR_CALL_NOT_IMPLEMENTED;
2620 }
#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 2594 of file umpnpmgr.c.

Referenced by CM_Get_Next_Log_Conf_Ex().

2601 {
2602  UNIMPLEMENTED;
2603  return CR_CALL_NOT_IMPLEMENTED;
2604 }
#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 2664 of file umpnpmgr.c.

2674 {
2675  UNIMPLEMENTED;
2676  return CR_CALL_NOT_IMPLEMENTED;
2677 }
#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 3051 of file umpnpmgr.c.

3062 {
3063  UNIMPLEMENTED;
3064  return CR_CALL_NOT_IMPLEMENTED;
3065 }
#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 3033 of file umpnpmgr.c.

3042 {
3043  UNIMPLEMENTED;
3044  return CR_CALL_NOT_IMPLEMENTED;
3045 }
#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 390 of file umpnpmgr.c.

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

397 {
401 
402  UNREFERENCED_PARAMETER(hBinding);
403  UNREFERENCED_PARAMETER(ulFlags);
404 
405  DPRINT("PNP_GetRelatedDeviceInstance() called\n");
406  DPRINT(" Relationship %ld\n", ulRelationship);
407  DPRINT(" DeviceId %S\n", pDeviceID);
408 
410  pDeviceID);
411 
412  PlugPlayData.Relation = ulRelationship;
413 
414  PlugPlayData.RelatedDeviceInstanceLength = *pulLength;
415  PlugPlayData.RelatedDeviceInstance = pRelatedDeviceId;
416 
418  (PVOID)&PlugPlayData,
420  if (!NT_SUCCESS(Status))
421  {
422  ret = NtStatusToCrError(Status);
423  }
424 
425  DPRINT("PNP_GetRelatedDeviceInstance() done (returns %lx)\n", ret);
426  if (ret == CR_SUCCESS)
427  {
428  DPRINT("RelatedDevice: %wZ\n", &PlugPlayData.RelatedDeviceInstance);
429  }
430 
431  return ret;
432 }
DWORD *typedef PVOID
Definition: winlogon.h:61
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define CR_SUCCESS
Definition: cfgmgr32.h:842
void DPRINT(...)
Definition: polytest.cpp:61
LONG NTSTATUS
Definition: precomp.h:26
#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:1245
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 2683 of file umpnpmgr.c.

2693 {
2694  UNIMPLEMENTED;
2695  return CR_CALL_NOT_IMPLEMENTED;
2696 }
#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 2702 of file umpnpmgr.c.

2711 {
2712  UNIMPLEMENTED;
2713  return CR_CALL_NOT_IMPLEMENTED;
2714 }
#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 355 of file umpnpmgr.c.

Referenced by CM_Locate_DevNode_ExW().

359 {
361 
362  UNREFERENCED_PARAMETER(hBinding);
363 
364  DPRINT("PNP_GetRootDeviceInstance() called\n");
365 
366  if (!pDeviceID)
367  {
368  ret = CR_INVALID_POINTER;
369  goto Done;
370  }
371  if (ulLength < lstrlenW(szRootDeviceId) + 1)
372  {
373  ret = CR_BUFFER_SMALL;
374  goto Done;
375  }
376 
377  lstrcpyW(pDeviceID,
379 
380 Done:
381  DPRINT("PNP_GetRootDeviceInstance() done (returns %lx)\n", ret);
382 
383  return ret;
384 }
static WCHAR szRootDeviceId[]
Definition: umpnpmgr.c:63
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#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 3007 of file umpnpmgr.c.

Referenced by CMP_GetServerSideDeviceInstallFlags().

3011 {
3012  UNREFERENCED_PARAMETER(hBinding);
3013 
3014  DPRINT1("PNP_GetServerSideDeviceInstallFlags(%p %p %lu)\n",
3015  hBinding, pulSSDIFlags, ulFlags);
3016 
3017  if (pulSSDIFlags == NULL)
3018  return CR_INVALID_POINTER;
3019 
3020  if (ulFlags != 0)
3021  return CR_INVALID_FLAG;
3022 
3023  /* FIXME */
3024  *pulSSDIFlags = 0;
3025 
3026  return CR_SUCCESS;
3027 }
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
#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 221 of file umpnpmgr.c.

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

224 {
225  UNREFERENCED_PARAMETER(hBinding);
226 
227  *pVersion = 0x0400;
228  return CR_SUCCESS;
229 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define CR_SUCCESS
Definition: cfgmgr32.h:842
DWORD WINAPI PNP_GetVersionInternal ( handle_t  hBinding,
WORD pwVersion 
)

Definition at line 2978 of file umpnpmgr.c.

2981 {
2982  UNREFERENCED_PARAMETER(hBinding);
2983 
2984  *pwVersion = 0x501;
2985  return CR_SUCCESS;
2986 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#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 2333 of file umpnpmgr.c.

Referenced by CM_Get_HW_Prof_Flags_ExW(), and CM_Set_HW_Prof_Flags_ExW().

2343 {
2345  WCHAR szKeyName[MAX_PATH];
2346  HKEY hKey;
2347  HKEY hDeviceKey;
2348  DWORD dwSize;
2349 
2350  UNREFERENCED_PARAMETER(hBinding);
2351 
2352  DPRINT("PNP_HwProfFlags() called\n");
2353 
2354  if (ulConfig == 0)
2355  {
2356  wcscpy(szKeyName,
2357  L"System\\CurrentControlSet\\HardwareProfiles\\Current\\System\\CurrentControlSet\\Enum");
2358  }
2359  else
2360  {
2361  swprintf(szKeyName,
2362  L"System\\CurrentControlSet\\HardwareProfiles\\%04lu\\System\\CurrentControlSet\\Enum",
2363  ulConfig);
2364  }
2365 
2367  szKeyName,
2368  0,
2370  &hKey) != ERROR_SUCCESS)
2371  return CR_REGISTRY_ERROR;
2372 
2373  if (ulAction == PNP_GET_HWPROFFLAGS)
2374  {
2375  if (RegOpenKeyExW(hKey,
2376  pDeviceID,
2377  0,
2379  &hDeviceKey) != ERROR_SUCCESS)
2380  {
2381  *pulValue = 0;
2382  }
2383  else
2384  {
2385  dwSize = sizeof(DWORD);
2386  if (RegQueryValueExW(hDeviceKey,
2387  L"CSConfigFlags",
2388  NULL,
2389  NULL,
2390  (LPBYTE)pulValue,
2391  &dwSize) != ERROR_SUCCESS)
2392  {
2393  *pulValue = 0;
2394  }
2395 
2396  RegCloseKey(hDeviceKey);
2397  }
2398  }
2399  else if (ulAction == PNP_SET_HWPROFFLAGS)
2400  {
2401  /* FIXME: not implemented yet */
2403  }
2404 
2405  RegCloseKey(hKey);
2406 
2407  return ret;
2408 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
__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:84
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
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)
static const WCHAR L[]
Definition: oid.c:1087
#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 251 of file umpnpmgr.c.

Referenced by CMP_Init_Detection().

253 {
254  UNREFERENCED_PARAMETER(hBinding);
255 
256  DPRINT("PNP_InitDetection() called\n");
257  return CR_SUCCESS;
258 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define CR_SUCCESS
Definition: cfgmgr32.h:842
void DPRINT(...)
Definition: polytest.cpp:61
DWORD WINAPI PNP_InstallDevInst ( handle_t  hBinding)

Definition at line 3090 of file umpnpmgr.c.

3092 {
3093  UNIMPLEMENTED;
3094  return CR_CALL_NOT_IMPLEMENTED;
3095 }
#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 2267 of file umpnpmgr.c.

Referenced by CM_Is_Dock_Station_Present_Ex().

2270 {
2271  HKEY hKey;
2272  DWORD dwType;
2273  DWORD dwValue;
2274  DWORD dwSize;
2276 
2277  UNREFERENCED_PARAMETER(hBinding);
2278 
2279  DPRINT1("PNP_IsDockStationPresent() called\n");
2280 
2281  *Present = FALSE;
2282 
2284  L"CurrentDockInfo",
2285  0,
2286  KEY_READ,
2287  &hKey) != ERROR_SUCCESS)
2288  return CR_REGISTRY_ERROR;
2289 
2290  dwSize = sizeof(DWORD);
2291  if (RegQueryValueExW(hKey,
2292  L"DockingState",
2293  NULL,
2294  &dwType,
2295  (LPBYTE)&dwValue,
2296  &dwSize) != ERROR_SUCCESS)
2297  ret = CR_REGISTRY_ERROR;
2298 
2299  RegCloseKey(hKey);
2300 
2301  if (ret == CR_SUCCESS)
2302  {
2303  if (dwType != REG_DWORD || dwSize != sizeof(DWORD))
2304  {
2305  ret = CR_REGISTRY_ERROR;
2306  }
2307  else if (dwValue != 0)
2308  {
2309  *Present = TRUE;
2310  }
2311  }
2312 
2313  DPRINT1("PNP_IsDockStationPresent() done (returns %lx)\n", ret);
2314 
2315  return ret;
2316 }
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_READ
Definition: nt_native.h:1023
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
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:84
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:416
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
static const WCHAR L[]
Definition: oid.c:1087
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 REG_DWORD
Definition: sdbapi.c:539
#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 2720 of file umpnpmgr.c.

2731 {
2732  UNIMPLEMENTED;
2733  return CR_CALL_NOT_IMPLEMENTED;
2734 }
#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 2792 of file umpnpmgr.c.

Referenced by CM_Query_Arbitrator_Free_Data_Ex().

2799 {
2800  UNIMPLEMENTED;
2801  return CR_CALL_NOT_IMPLEMENTED;
2802 }
#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 2808 of file umpnpmgr.c.

Referenced by CM_Query_Arbitrator_Free_Size_Ex().

2814 {
2815  UNIMPLEMENTED;
2816  return CR_CALL_NOT_IMPLEMENTED;
2817 }
#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 2235 of file umpnpmgr.c.

Referenced by CM_Query_And_Remove_SubTree_ExW().

2242 {
2243  UNIMPLEMENTED;
2244  return CR_CALL_NOT_IMPLEMENTED;
2245 }
#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 2761 of file umpnpmgr.c.

Referenced by CM_Query_Resource_Conflict_List().

2770 {
2771  UNIMPLEMENTED;
2772  return CR_CALL_NOT_IMPLEMENTED;
2773 }
#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 1388 of file umpnpmgr.c.

Referenced by CM_Register_Device_Interface_ExW().

1397 {
1398  UNIMPLEMENTED;
1399  return CR_CALL_NOT_IMPLEMENTED;
1400 }
#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 2222 of file umpnpmgr.c.

Referenced by CM_Register_Device_Driver_Ex().

2226 {
2227  UNIMPLEMENTED;
2228  return CR_CALL_NOT_IMPLEMENTED;
2229 }
#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 2834 of file umpnpmgr.c.

Referenced by CMP_RegisterNotification().

2838 {
2839 #if 0
2840  PNOTIFY_DATA pNotifyData;
2841 #endif
2842 
2843  DPRINT1("PNP_RegisterNotification(%p 0x%lx %p)\n",
2844  hBinding, ulFlags, pulNotify);
2845 
2846 #if 0
2847  pNotifyData = RtlAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(NOTIFY_DATA));
2848  if (pNotifyData == NULL)
2849  return CR_OUT_OF_MEMORY;
2850 
2851  *pulNotify = (DWORD)pNotifyData;
2852 #endif
2853 
2854  *pulNotify = 1;
2855 
2856  return CR_SUCCESS;
2857 }
#define DWORD
Definition: msvc.h:34
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
#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 3134 of file umpnpmgr.c.

3136 {
3137  UNIMPLEMENTED;
3138  return CR_CALL_NOT_IMPLEMENTED;
3139 }
#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 264 of file umpnpmgr.c.

Referenced by CMP_Report_LogOn().

268 {
271 
272  UNREFERENCED_PARAMETER(hBinding);
273  UNREFERENCED_PARAMETER(Admin);
274 
275  DPRINT("PNP_ReportLogOn(%u, %u) called\n", Admin, ProcessId);
276 
277  /* Get the users token */
279 
280  if (!hProcess)
281  {
282  DPRINT1("OpenProcess failed with error %u\n", GetLastError());
283  goto cleanup;
284  }
285 
286  if (hUserToken)
287  {
289  hUserToken = NULL;
290  }
291 
293  {
294  DPRINT1("OpenProcessToken failed with error %u\n", GetLastError());
295  goto cleanup;
296  }
297 
298  /* Trigger the installer thread */
299  if (hInstallEvent)
301 
302  ReturnValue = CR_SUCCESS;
303 
304 cleanup:
305  if (hProcess)
306  CloseHandle(hProcess);
307 
308  return ReturnValue;
309 }
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2697
#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:323
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:679
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define TOKEN_ASSIGN_PRIMARY
Definition: setypes.h:871
_In_ BOOL _In_ HANDLE hProcess
Definition: mapping.h:70
DWORD DWORD
Definition: winlogon.h:84
static HANDLE hInstallEvent
Definition: umpnpmgr.c:69
static HANDLE hUserToken
Definition: umpnpmgr.c:68
UINT32 void void ** ReturnValue
Definition: acevents.h:213
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
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:1257
DWORD *typedef HANDLE
Definition: winlogon.h:61
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:292
#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 2251 of file umpnpmgr.c.

Referenced by CM_Request_Device_Eject_ExW().

2258 {
2259  UNIMPLEMENTED;
2260  return CR_CALL_NOT_IMPLEMENTED;
2261 }
#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 2322 of file umpnpmgr.c.

Referenced by CM_Request_Eject_PC_Ex().

2324 {
2325  UNIMPLEMENTED;
2326  return CR_CALL_NOT_IMPLEMENTED;
2327 }
#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 2823 of file umpnpmgr.c.

Referenced by CM_Run_Detection_Ex().

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

Definition at line 3145 of file umpnpmgr.c.

3149 {
3150  UNIMPLEMENTED;
3151  return CR_CALL_NOT_IMPLEMENTED;
3152 }
#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 1543 of file umpnpmgr.c.

1551 {
1553  LPWSTR lpValueName = NULL;
1554  HKEY hInstKey = 0;
1555  HKEY hPropKey = 0;
1556  LONG lError;
1557 
1558  UNREFERENCED_PARAMETER(hBinding);
1559 
1560  DPRINT("PNP_SetClassRegProp() called\n");
1561 
1562  if (ulFlags != 0)
1563  return CR_INVALID_FLAG;
1564 
1565  switch (ulProperty)
1566  {
1567  case CM_CRP_SECURITY:
1568  lpValueName = L"Security";
1569  break;
1570 
1571  case CM_CRP_DEVTYPE:
1572  lpValueName = L"DeviceType";
1573  break;
1574 
1575  case CM_CRP_EXCLUSIVE:
1576  lpValueName = L"Exclusive";
1577  break;
1578 
1580  lpValueName = L"DeviceCharacteristics";
1581  break;
1582 
1583  default:
1584  return CR_INVALID_PROPERTY;
1585  }
1586 
1587  lError = RegOpenKeyExW(hClassKey,
1588  pszClassGuid,
1589  0,
1590  KEY_WRITE,
1591  &hInstKey);
1592  if (lError != ERROR_SUCCESS)
1593  {
1595  goto done;
1596  }
1597 
1598  /* FIXME: Set security descriptor */
1599  lError = RegCreateKeyExW(hInstKey,
1600  L"Properties",
1601  0,
1602  NULL,
1605  NULL,
1606  &hPropKey,
1607  NULL);
1608  if (lError != ERROR_SUCCESS)
1609  {
1610  ret = CR_REGISTRY_ERROR;
1611  goto done;
1612  }
1613 
1614  if (ulLength == 0)
1615  {
1616  if (RegDeleteValueW(hPropKey,
1617  lpValueName))
1618  ret = CR_REGISTRY_ERROR;
1619  }
1620  else
1621  {
1622  if (RegSetValueExW(hPropKey,
1623  lpValueName,
1624  0,
1625  ulDataType,
1626  Buffer,
1627  ulLength))
1628  ret = CR_REGISTRY_ERROR;
1629  }
1630 
1631 done:
1632  if (hPropKey != NULL)
1633  RegCloseKey(hPropKey);
1634 
1635  if (hInstKey != NULL)
1636  RegCloseKey(hInstKey);
1637 
1638  return ret;
1639 }
#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
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#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:416
#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
static const WCHAR L[]
Definition: oid.c:1087
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 2029 of file umpnpmgr.c.

Referenced by CM_Set_DevNode_Problem_Ex().

2034 {
2035  UNIMPLEMENTED;
2036  return CR_CALL_NOT_IMPLEMENTED;
2037 }
#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 955 of file umpnpmgr.c.

Referenced by CM_Set_DevNode_Registry_Property_ExW().

963 {
965  LPWSTR lpValueName = NULL;
966  HKEY hKey = 0;
967 
968  UNREFERENCED_PARAMETER(hBinding);
969<