2 * Plug and Play Manager RPC interface definition
7 const unsigned long PNP_MAX_STRING_LEN = 32767;
8 const unsigned long PNP_MAX_DEVICE_ID_LEN = 200;
9 const unsigned long PNP_MAX_GUID_STRING_LEN = 39;
10 const unsigned long PNP_MAX_DEVINTERFACE_LEN = PNP_MAX_STRING_LEN;
11 const unsigned long PNP_MAX_CULTURE_NAME_LEN = 85;
12 const unsigned long PNP_MAX_CM_PATH = 360;
13 const unsigned long PNP_MAX_PROP_SIZE = 65534;
14 const unsigned long PNP_MAX_PROP_COUNT = 32767;
15 const unsigned long PNP_MAX_BUFFER_SIZE = 16000000;
17 cpp_quote("#ifndef _CFGMGR32_H_")
18 typedef unsigned long RESOURCEID;
20 typedef struct _HWPROFILEINFO {
21 DWORD HWPI_ulHWProfile;
22 WCHAR HWPI_szFriendlyName[80];
27 typedef unsigned long DEVPROPTYPE;
28 typedef [range(0, PNP_MAX_PROP_SIZE)] unsigned long PNP_PROP_SIZE;
29 typedef [range(0, PNP_MAX_PROP_COUNT)] unsigned long PNP_PROP_COUNT;
30 typedef [range(0, PNP_MAX_STRING_LEN)] unsigned long PNP_RPC_STRING_LEN;
31 typedef [range(0, PNP_MAX_BUFFER_SIZE)] unsigned long PNP_RPC_BUFFER_SIZE;
32 typedef PNP_PROP_SIZE *PPNP_PROP_SIZE;
33 typedef PNP_PROP_COUNT *PPNP_PROP_COUNT;
34 typedef PNP_RPC_STRING_LEN *PPNP_RPC_STRING_LEN;
35 typedef PNP_RPC_BUFFER_SIZE *PPNP_RPC_BUFFER_SIZE;
37 cpp_quote("#ifndef _CFG_INCLUDED_")
39 typedef enum _PNP_VETO_TYPE {
40 PNP_VetoTypeUnknown = 0,
41 PNP_VetoLegacyDevice = 1,
42 PNP_VetoPendingClose = 2,
43 PNP_VetoWindowsApp = 3,
44 PNP_VetoWindowsService = 4,
45 PNP_VetoOutstandingOpen = 5,
48 PNP_VetoIllegalDeviceRequest = 8,
49 PNP_VetoInsufficientPower = 9,
50 PNP_VetoNonDisableable = 10,
51 PNP_VetoLegacyDriver = 11,
52 PNP_VetoInsufficientRights = 12,
59 typedef struct _BUSNUMBER_DES {
63 DWORD BUSD_Alloc_Base;
65 } BUSNUMBER_DES, *PBUSNUMBER_DES;
67 typedef struct _BUSNUMBER_RANGE {
70 DWORD BUSR_nBusNumbers;
72 } BUSNUMBER_RANGE, *PBUSNUMBER_RANGE;
74 typedef struct _BUSNUMBER_RESOURCE {
75 BUSNUMBER_DES BusNumber_Header;
76 BUSNUMBER_RANGE BusNumber_Data[1];
77 } BUSNUMBER_RESOURCE, *PBUSNUMBER_RESOURCE;
79 typedef struct _CS_DES {
80 DWORD CSD_SignatureLength;
81 DWORD CSD_LegacyDataOffset;
82 DWORD CSD_LegacyDataSize;
85 BYTE CSD_Signature[1];
88 typedef struct _CS_RESOURCE {
90 } CS_RESOURCE, *PCS_RESOURCE;
92 typedef struct _DEVPRIVATE_DES {
99 } DEVPRIVATE_DES, *PDEVPRIVATE_DES;
101 typedef struct _DEVPRIVATE_RANGE {
105 } DEVPRIVATE_RANGE, *PDEVPRIVATE_RANGE;
107 typedef struct _DEVPRIVATE_RESOURCE {
108 DEVPRIVATE_DES PRV_Header;
109 DEVPRIVATE_RANGE PRV_Data[1];
110 } DEVPRIVATE_RESOURCE, *PDEVPRIVATE_RESOURCE;
112 typedef struct _DMA_DES {
116 unsigned long DD_Alloc_Chan;
117 } DMA_DES, *PDMA_DES;
119 typedef struct _DMA_RANGE {
123 } DMA_RANGE, *PDMA_RANGE;
125 typedef struct _DMA_RESOURCE {
127 DMA_RANGE DMA_Data[1];
128 } DMA_RESOURCE, *PDMA_RESOURCE;
130 typedef struct _IO_DES {
133 unsigned __int64 IOD_AllocBase;
134 unsigned __int64 IOD_AllocEnd;
138 typedef struct _IO_RANGE {
139 unsigned __int64 IOR_Align;
141 unsigned __int64 IOR_Min;
142 unsigned __int64 IOR_Max;
143 DWORD IOR_RangeFlags;
144 unsigned __int64 IOR_Alias;
145 } IO_RANGE, *PIO_RANGE;
147 typedef struct _IO_RESOURCE {
150 } IO_RESOURCE, *PIO_RESOURCE;
152 typedef struct _IRQ_DES {
156 DWORD IRQD_Alloc_Num;
158 } IRQ_DES, *PIRQ_DES;
160 typedef struct _IRQ_RANGE {
164 } IRQ_RANGE, *PIRQ_RANGE;
166 typedef struct _IRQ_RESOURCE {
168 IRQ_RANGE IO_Data[1];
169 } IRQ_RESOURCE, *PIRQ_RESOURCE;
171 typedef struct _MEM_DES {
174 unsigned __int64 MD_Alloc_Base;
175 unsigned __int64 MD_Alloc_End;
178 } MEM_DES, *PMEM_DES;
180 typedef struct _MEM_RANGE {
187 } MEM_RANGE, *PMEM_RANGE;
189 typedef struct _MEM_RESOURCE {
191 MEM_RANGE MEM_Data[1];
192 } MEM_RESOURCE, *PMEM_RESOURCE;
194 typedef struct _MFCARD_DES {
198 BYTE PMF_ConfigOptions;
199 BYTE PMF_IoResourceIndex;
200 BYTE PMF_Reserved[2];
201 DWORD PMF_ConfigRegisterBase;
202 } MFCARD_DES, *PMFCARD_DES;
204 typedef struct _MFCARD_RESOURCE {
205 MFCARD_DES MfCard_Header;
206 } MFCARD_RESOURCE, *PMFCARD_RESOURCE;
208 typedef struct _PCCARD_DES {
212 BYTE PCD_ConfigIndex;
213 BYTE PCD_Reserved[3];
214 DWORD PCD_MemoryCardBase1;
215 DWORD PCD_MemoryCardBase2;
216 } PCCARD_DES, *PPCCARD_DES;
218 typedef struct _PCCARD_RESOURCE {
219 PCCARD_DES PcCard_Header;
220 } PCCARD_RESOURCE, *PPCARD_RESOURCE;
224 typedef struct _PNP_CONFLICT_ENTRY {
225 DWORD DeviceInstance;
228 __int64 ResourceStart;
231 } PNP_CONFLICT_ENTRY, *PPNP_CONFLICT_ENTRY;
233 typedef struct _PNP_CONFLICT_LIST {
236 DWORD ConflictsCounted;
237 DWORD ConflictsListed;
238 DWORD RequiredBufferSize;
239 PNP_CONFLICT_ENTRY ConflictEntry[1];
240 } PNP_CONFLICT_LIST, *PPNP_CONFLICT_LIST;
242 typedef struct _PNP_CONFLICT_STRINGS {
243 DWORD NullDeviceInstance;
244 WCHAR DeviceInstanceStrings[1];
245 } PNP_CONFLICT_STRINGS, *PPNP_CONFLICT_STRINGS;
247 typedef struct _DEVPROPKEY {
253 uuid (8D9F4E40-A03D-11CE-8F69-08003E30051B),
255 pointer_default(unique),
256 endpoint("ncacn_np:[\\pipe\\plugplay]")
267 [in] handle_t hBinding); /* FIXME */
273 [in] handle_t hBinding); /* FIXME */
279 [in] handle_t hBinding,
280 [out] WORD *pVersion);
286 [in] handle_t hBinding,
287 [out] DWORD *pulState,
294 [in] handle_t hBinding);
300 [in] handle_t hBinding,
302 [in] DWORD ProcessId);
307 PNP_ValidateDeviceInstance(
308 [in] handle_t hBinding,
309 [in, string, ref] LPWSTR pDeviceID,
315 PNP_GetRootDeviceInstance(
316 [in] handle_t hBinding,
317 [out, string, size_is(ulLength)] LPWSTR pDeviceID,
318 [in] PNP_RPC_STRING_LEN ulLength);
321 cpp_quote("#define PNP_GET_PARENT_DEVICE_INSTANCE 0x1")
322 cpp_quote("#define PNP_GET_CHILD_DEVICE_INSTANCE 0x2")
323 cpp_quote("#define PNP_GET_SIBLING_DEVICE_INSTANCE 0x3")
326 PNP_GetRelatedDeviceInstance(
327 [in] handle_t hBinding,
328 [in] DWORD ulRelationship,
329 [in, string, ref] LPWSTR pDeviceID,
330 [out, string, size_is(*pulLength)] LPWSTR pRelatedDeviceId,
331 [in, out] PNP_RPC_STRING_LEN *pulLength,
335 cpp_quote("#define PNP_ENUMERATOR_SUBKEYS 0x1")
336 cpp_quote("#define PNP_CLASS_SUBKEYS 0x2")
339 PNP_EnumerateSubKeys(
340 [in] handle_t hBinding,
343 [out, string, size_is(ulLength)] LPWSTR Buffer,
344 [in] PNP_RPC_STRING_LEN ulLength,
345 [out] PNP_RPC_STRING_LEN *pulRequiredLen,
352 [in] handle_t hBinding,
353 [in, string, unique] LPWSTR pszFilter,
354 [out, size_is(*pulLength), length_is(*pulLength)] LPWSTR Buffer,
355 [in, out] PNP_RPC_STRING_LEN *pulLength,
361 PNP_GetDeviceListSize(
362 [in] handle_t hBinding,
363 [in, string, unique] LPWSTR pszFilter,
364 [out] PNP_RPC_BUFFER_SIZE *pulLen,
371 [in] handle_t hBinding,
372 [in, string, ref] LPWSTR pszDeviceID,
373 [out] DWORD *pulDepth,
379 PNP_GetDeviceRegProp(
380 [in] handle_t hBinding,
381 [in, string, ref] LPWSTR pDeviceID,
382 [in] DWORD ulProperty,
383 [in, out] DWORD *pulRegDataType,
384 [out, size_is(*pulTransferLen), length_is(*pulTransferLen)] BYTE *Buffer,
385 [in, out] PNP_PROP_SIZE *pulTransferLen,
386 [in, out] PNP_PROP_SIZE *pulLength,
392 PNP_SetDeviceRegProp(
393 [in] handle_t hBinding,
394 [in, string, ref] LPWSTR pDeviceId,
395 [in] DWORD ulProperty,
396 [in] DWORD ulDataType,
397 [in, size_is(ulLength)] BYTE *Buffer,
398 [in] PNP_PROP_SIZE ulLength,
404 PNP_GetClassInstance(
405 [in] handle_t hBinding,
406 [in, string, ref] LPWSTR pDeviceId,
407 [out, string, size_is(ulLength)] LPWSTR pszClassInstance,
408 [in] PNP_RPC_STRING_LEN ulLength);
414 [in] handle_t hBinding,
415 [in, string, ref] LPWSTR pszSubKey,
416 [in] DWORD samDesired,
422 PNP_DeleteRegistryKey(
423 [in] handle_t hBinding,
424 [in, string, ref] LPWSTR pszDeviceID,
425 [in, string, ref] LPWSTR pszParentKey,
426 [in, string, ref] LPWSTR pszChildKey,
433 [in] handle_t hBinding,
434 [out] DWORD *pulClassCount,
441 [in] handle_t hBinding,
442 [in, string, ref] LPWSTR pszClassGuid,
443 [out, string, size_is(*pulLength)] LPWSTR Buffer,
444 [in, out] PNP_RPC_STRING_LEN *pulLength,
451 [in] handle_t hBinding,
452 [in, string, ref] LPWSTR pszClassGuid,
458 PNP_GetInterfaceDeviceAlias(
459 [in] handle_t hBinding,
460 [in, string, ref] LPWSTR pszInterfaceDevice,
461 [in] GUID *AliasInterfaceGuid,
462 [out, string, size_is(*pulTransferLen)] LPWSTR pszAliasInterfaceDevice,
463 [in, out] PNP_RPC_STRING_LEN *pulLength,
464 [in, out] PNP_RPC_STRING_LEN *pulTransferLen,
470 PNP_GetInterfaceDeviceList(
471 [in] handle_t hBinding,
472 [in] GUID *InterfaceGuid,
473 [in, string, unique] LPWSTR pszDeviceID,
474 [out, size_is(*pulLength), length_is(*pulLength)] BYTE *Buffer,
475 [in, out] PNP_RPC_BUFFER_SIZE *pulLength,
481 PNP_GetInterfaceDeviceListSize(
482 [in] handle_t hBinding,
483 [out] PNP_RPC_BUFFER_SIZE *pulLen,
484 [in] GUID *InterfaceGuid,
485 [in, string, unique] LPWSTR pszDeviceID,
491 PNP_RegisterDeviceClassAssociation(
492 [in] handle_t hBinding,
493 [in, string, unique] LPWSTR pszDeviceID,
494 [in] GUID *InterfaceGuid,
495 [in, string, unique] LPWSTR pszReference,
496 [out, string, size_is(*pulTransferLen)] LPWSTR pszSymLink,
497 [in, out] PNP_RPC_STRING_LEN *pulLength,
498 [in, out] PNP_RPC_STRING_LEN *pulTransferLen,
504 PNP_UnregisterDeviceClassAssociation(
505 [in] handle_t hBinding,
506 [in, string, unique] LPWSTR pszInterfaceDevice,
513 [in] handle_t hBinding,
514 [in, string, ref] LPWSTR pszClassGuid,
515 [in] DWORD ulProperty,
516 [in, out] DWORD *pulRegDataType,
517 [out, size_is(*pulTransferLen), length_is(*pulTransferLen)] BYTE *Buffer,
518 [in, out] PNP_RPC_STRING_LEN *pulTransferLen,
519 [in, out] PNP_RPC_STRING_LEN *pulLength,
526 [in] handle_t hBinding,
527 [in, string, ref] LPWSTR pszClassGuid,
528 [in] DWORD ulProperty,
529 [in] DWORD ulDataType,
530 [in, size_is(ulLength)] BYTE *Buffer,
531 [in] PNP_PROP_SIZE ulLength,
538 [in] handle_t hBinding,
539 [in, out, string, size_is(ulLength)] LPWSTR pszDeviceID,
540 [in, string, ref] LPWSTR pszParentDeviceID,
541 [in] PNP_RPC_STRING_LEN ulLength,
545 cpp_quote("#define PNP_DEVINST_MOVE 0x2")
546 cpp_quote("#define PNP_DEVINST_SETUP 0x3")
547 cpp_quote("#define PNP_DEVINST_ENABLE 0x4")
548 cpp_quote("#define PNP_DEVINST_DISABLE 0x5")
549 cpp_quote("#define PNP_DEVINST_REENUMERATE 0x7")
552 PNP_DeviceInstanceAction(
553 [in] handle_t hBinding,
556 [in, string, unique] LPWSTR pszDeviceInstance1,
557 [in, string, unique] LPWSTR pszDeviceInstance2);
563 [in] handle_t hBinding,
564 [in, string, unique] LPWSTR pDeviceID,
565 [out] DWORD *pulStatus,
566 [out] DWORD *pulProblem,
572 PNP_SetDeviceProblem(
573 [in] handle_t hBinding,
574 [in, string, unique] LPWSTR pDeviceID,
575 [in] DWORD ulProblem,
582 [in] handle_t hBinding,
583 [in, string, unique] LPWSTR pDeviceID,
584 [in, out, unique] PPNP_VETO_TYPE pVetoType,
585 [in, out, string, unique, size_is(ulNameLength)] LPWSTR pszVetoName,
586 [in] DWORD ulNameLength,
592 PNP_UninstallDevInst(
593 [in] handle_t hBinding,
594 [in, string, unique] LPWSTR pDeviceID,
601 [in] handle_t hBinding,
602 [in, string, unique] LPWSTR pszDeviceID,
603 [in, string, ref] LPWSTR pszID,
610 [in] handle_t hBinding,
611 [in, string, ref] LPWSTR pszDeviceID,
618 [in] handle_t hBinding,
619 [in, string, ref] LPWSTR pszDeviceID,
620 [in, out, unique] PPNP_VETO_TYPE pVetoType,
621 [in, out, string, unique, size_is(ulNameLength)] LPWSTR pszVetoName,
622 [in] DWORD ulNameLength,
628 PNP_RequestDeviceEject(
629 [in] handle_t hBinding,
630 [in, string, ref] LPWSTR pszDeviceID,
631 [in, out, unique] PPNP_VETO_TYPE pVetoType,
632 [in, out, string, unique, size_is(ulNameLength)] LPWSTR pszVetoName,
633 [in] DWORD ulNameLength,
639 PNP_IsDockStationPresent(
640 [in] handle_t hBinding,
641 [in, out, unique] BOOL *Present);
647 [in] handle_t hBinding);
650 cpp_quote("#define PNP_GET_HWPROFFLAGS 0x1")
651 cpp_quote("#define PNP_SET_HWPROFFLAGS 0x2")
655 [in] handle_t hBinding,
657 [in, string, ref] LPWSTR pDeviceID,
659 [in, out] DWORD *pulValue,
660 [in, out, unique] PPNP_VETO_TYPE pVetoType,
661 [in, out, string, unique, size_is(ulNameLength)] LPWSTR pszVetoName,
662 [in] DWORD ulNameLength,
669 [in] handle_t hBinding,
671 [in, out, ref] HWPROFILEINFO *pHWProfileInfo,
672 [in, range(0, 168)] DWORD ulProfileInfoSize,
673 /* FIXME: should be [in, range(0, sizeof(HWPROFILEINFO))] DWORD ulProfileInfoSize, */
680 [in] handle_t hBinding,
681 [in, string, ref] LPWSTR pDeviceID,
682 [in] DWORD ulPriority,
683 [out] DWORD *pulLogConfTag,
690 [in] handle_t hBinding,
691 [in, string, ref] LPWSTR pDeviceID,
692 [in] DWORD ulLogConfType,
693 [in] DWORD ulLogConfTag,
700 [in] handle_t hBinding,
701 [in, string, ref] LPWSTR pDeviceID,
702 [in] DWORD ulLogConfType,
703 [out] DWORD *pulLogConfTag,
710 [in] handle_t hBinding,
711 [in, string, ref] LPWSTR pDeviceID,
712 [in] DWORD ulLogConfType,
713 [in] DWORD ulCurrentTag,
714 [out] DWORD *pulNextTag,
720 PNP_GetLogConfPriority(
721 [in] handle_t hBinding,
722 [in, string, ref] LPWSTR pDeviceID,
725 [out] DWORD *pPriority,
732 [in] handle_t hBinding,
733 [in, string, ref] LPWSTR pDeviceID,
734 [in] DWORD ulLogConfTag,
735 [in] DWORD ulLogConfType,
736 [in] RESOURCEID ResourceID,
737 [out] DWORD *pulResourceTag,
738 [in, size_is(ResourceLen)] BYTE *ResourceData,
739 [in] PNP_RPC_BUFFER_SIZE ResourceLen,
746 [in] handle_t hBinding,
747 [in, string, ref] LPWSTR pDeviceID,
748 [in] DWORD ulLogConfTag,
749 [in] DWORD ulLogConfType,
750 [in] RESOURCEID ResourceID,
751 [in] DWORD ulResourceTag,
752 [out] DWORD *pulPreviousResType,
753 [out] DWORD *pulPreviousResTag,
760 [in] handle_t hBinding,
761 [in, string, ref] LPWSTR pDeviceID,
762 [in] DWORD ulLogConfTag,
763 [in] DWORD ulLogConfType,
764 [in] RESOURCEID ResourceID,
765 [in] DWORD ulResourceTag,
766 [out] DWORD *pulNextResType,
767 [out] DWORD *pulNextResTag,
774 [in] handle_t hBinding,
775 [in, string, ref] LPWSTR pDeviceID,
776 [in] DWORD ulLogConfTag,
777 [in] DWORD ulLogConfType,
778 [in] RESOURCEID ResourceID,
779 [in] DWORD ulResourceTag,
780 [out, size_is(BufferLen)] BYTE *Buffer,
781 [in] PNP_RPC_BUFFER_SIZE BufferLen,
787 PNP_GetResDesDataSize(
788 [in] handle_t hBinding,
789 [in, string, ref] LPWSTR pDeviceID,
790 [in] DWORD ulLogConfTag,
791 [in] DWORD ulLogConfType,
792 [in] RESOURCEID ResourceID,
793 [in] DWORD ulResourceTag,
794 [out] DWORD *pulSize,
801 [in] handle_t hBinding,
802 [in, string, ref] LPWSTR pDeviceID,
803 [in] DWORD ulLogConfTag,
804 [in] DWORD ulLogConfType,
805 [in] RESOURCEID CurrentResourceID,
806 [in] RESOURCEID NewResourceID,
807 [in] DWORD ulResourceTag,
808 [in, size_is(ResourceLen)] BYTE *ResourceData,
809 [in] PNP_RPC_BUFFER_SIZE ResourceLen,
815 PNP_DetectResourceConflict(
816 [in] handle_t hBinding,
817 [in, string, ref] LPWSTR pDeviceID,
818 [in] RESOURCEID ResourceID,
819 [in, size_is(ResourceLen)] BYTE *ResourceData,
820 [in] PNP_RPC_BUFFER_SIZE ResourceLen,
821 [out] BOOL *pbConflictDetected,
827 PNP_QueryResConfList(
828 [in] handle_t hBinding,
829 [in, string, ref] LPWSTR pDeviceID,
830 [in] RESOURCEID ResourceID,
831 [in, size_is(ResourceLen)] BYTE *ResourceData,
832 [in] PNP_RPC_BUFFER_SIZE ResourceLen,
833 [out, size_is(BufferLen)] BYTE *Buffer,
834 [in] PNP_RPC_BUFFER_SIZE BufferLen,
841 [in] handle_t hBinding,
842 [in] DWORD ulHardwareProfile,
848 PNP_QueryArbitratorFreeData(
849 [in] handle_t hBinding,
850 [out,size_is(DataLen)] BYTE *pData,
852 [in, string, ref] LPWSTR pDeviceID,
853 [in] RESOURCEID ResourceID,
859 PNP_QueryArbitratorFreeSize(
860 [in] handle_t hBinding,
861 [out] DWORD *pulSize,
862 [in, string, ref] LPWSTR pDeviceID,
863 [in] RESOURCEID ResourceID,
870 [in] handle_t hBinding,
876 PNP_RegisterNotification(
877 [in] handle_t hBinding,
879 [out] DWORD *pulNotifyData);
884 PNP_UnregisterNotification(
885 [in] handle_t hBinding,
886 [in] DWORD ulNotifyData);
888 cpp_quote("#if _WIN32_WINNT >= 0x0501")
893 PNP_GetCustomDevProp(
894 [in] handle_t hBinding,
895 [in, string, ref] LPWSTR pDeviceID,
896 [in, string, ref] LPWSTR CustomPropName,
897 [out] DWORD *pulRegDataType,
898 [out, size_is(*pulLength), length_is(*pulTransferLen)] BYTE *Buffer,
899 [out] PNP_RPC_STRING_LEN *pulTransferLen,
900 [in, out] PNP_RPC_STRING_LEN *pulLength,
906 PNP_GetVersionInternal(
907 [in] handle_t hBinding,
908 [in, out] WORD *pwVersion);
913 PNP_GetBlockedDriverInfo(
914 [in] handle_t hBinding,
915 [out, size_is(*pulLength), length_is(*pulTransferLen)] BYTE *Buffer,
916 [out] PNP_RPC_BUFFER_SIZE *pulTransferLen,
917 [in, out] PNP_RPC_BUFFER_SIZE *pulLength,
923 PNP_GetServerSideDeviceInstallFlags(
924 [in] handle_t hBinding,
925 [out] DWORD *pulSSDIFlags,
928 cpp_quote("#endif /* _WIN32_WINNT >= 0x0501 */")