Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

687 lines
18 KiB

  1. /*++
  2. Copyright (c) 1997-1999 Microsoft Corporation
  3. Module Name:
  4. wmikmp.h
  5. Abstract:
  6. Private header for WMI kernel mode component
  7. Author:
  8. AlanWar
  9. Environment:
  10. Revision History:
  11. --*/
  12. #ifndef _WMIUMDS_
  13. #define _WMIUMDS_
  14. //
  15. // Define this to track reference counts
  16. //#define TRACK_REFERNECES
  17. #include <wchar.h>
  18. extern const GUID WmipBinaryMofGuid;
  19. extern const GUID RegChangeNotificationGuid;
  20. //
  21. // Chunk Management definitions
  22. // All structures that rely upon the chunk allocator must be defined so that
  23. // their members match that of ENTRYHEADER. These include DATASOURCE,
  24. // GUIDENTRY, INSTANCESET, DCENTRY, NOTIFICATIONENTRY, MOFCLASS, MOFRESOURCE
  25. // Also ENTRYHEADER reserves 0x80000000 for its own flag.
  26. struct _CHUNKINFO;
  27. struct _ENTRYHEADER;
  28. typedef void (*ENTRYCLEANUP)(
  29. struct _CHUNKINFO *,
  30. struct _ENTRYHEADER *
  31. );
  32. typedef struct _CHUNKINFO
  33. {
  34. LIST_ENTRY ChunkHead; // Head of list of chunks
  35. ULONG EntrySize; // Size of a single entry
  36. ULONG EntriesPerChunk; // Number of entries per chunk allocation
  37. ENTRYCLEANUP EntryCleanup; // Entry cleanup routine
  38. ULONG InitialFlags; // Initial flags for all entries
  39. ULONG Signature;
  40. #if DBG
  41. ULONG AllocCount;
  42. ULONG FreeCount;
  43. #endif
  44. } CHUNKINFO, *PCHUNKINFO;
  45. typedef struct
  46. {
  47. LIST_ENTRY ChunkList; // Node in list of chunks
  48. LIST_ENTRY FreeEntryHead; // Head of list of free entries in chunk
  49. ULONG EntriesInUse; // Count of entries being used
  50. } CHUNKHEADER, *PCHUNKHEADER;
  51. typedef struct _ENTRYHEADER
  52. {
  53. union
  54. {
  55. LIST_ENTRY FreeEntryList; // Node in list of free entries
  56. LIST_ENTRY InUseEntryList; // Node in list ofin use entries
  57. };
  58. PCHUNKHEADER Chunk; // Chunk in which entry is located
  59. ULONG Flags; // Flags
  60. ULONG RefCount; // Reference Count
  61. ULONG Signature;
  62. } ENTRYHEADER, *PENTRYHEADER;
  63. // Set if the entry is free
  64. #define FLAG_ENTRY_ON_FREE_LIST 0x80000000
  65. #define FLAG_ENTRY_ON_INUSE_LIST 0x40000000
  66. #define FLAG_ENTRY_INVALID 0x20000000
  67. #define FLAG_ENTRY_REMOVE_LIST 0x10000000
  68. #define WmipReferenceEntry(Entry) \
  69. InterlockedIncrement(&((PENTRYHEADER)(Entry))->RefCount)
  70. // chunk.c
  71. ULONG WmipUnreferenceEntry(
  72. PCHUNKINFO ChunkInfo,
  73. PENTRYHEADER Entry);
  74. PENTRYHEADER WmipAllocEntry(
  75. PCHUNKINFO ChunkInfo
  76. );
  77. void WmipFreeEntry(
  78. PCHUNKINFO ChunkInfo,
  79. PENTRYHEADER Entry
  80. );
  81. PWCHAR WmipCountedToSz(
  82. PWCHAR Counted
  83. );
  84. struct tagGUIDENTRY;
  85. typedef struct tagGUIDENTRY GUIDENTRY, *PGUIDENTRY, *PBGUIDENTRY;
  86. //
  87. // An INSTANCESET contains the information a set of instances that is provided
  88. // by a single data source. An instance set is part of two lists. One list is
  89. // the set of instance sets for a particular guid. The other list is the list
  90. // of instance sets supported by a data source.
  91. //
  92. //
  93. // Instance names for an instance set registered with a base name and count
  94. // are stored in a ISBASENAME structure. This structure is tracked by
  95. // PDFISBASENAME in wmicore.idl.
  96. typedef struct
  97. {
  98. ULONG BaseIndex; // First index to append to base name
  99. WCHAR BaseName[1]; // Actual base name
  100. } ISBASENAME, *PISBASENAME, *PBISBASENAME;
  101. //
  102. // This defines the maximum number of characters that can be part of a suffix
  103. // to a basename. The current value of 6 will allow up to 999999 instances
  104. // of a guid with a static base name
  105. #define MAXBASENAMESUFFIXSIZE 6
  106. //
  107. // Instance names for an instance set registerd with a set of static names
  108. // are kept in a ISSTATICNAMES structure. This structure is tracked by
  109. // PDFISSTATICNAMES defined in wmicore.idl
  110. typedef struct
  111. {
  112. PWCHAR StaticNamePtr[1]; // pointers to static names
  113. // WCHAR StaticNames[1];
  114. } ISSTATICENAMES, *PISSTATICNAMES, *PBISSTATICNAMES;
  115. typedef struct tagInstanceSet
  116. {
  117. union
  118. {
  119. // Entry in list of instances within a guid
  120. LIST_ENTRY GuidISList;
  121. // Entry in main list of free instances
  122. LIST_ENTRY FreeISList;
  123. };
  124. PCHUNKHEADER Chunk; // Chunk in which entry is located
  125. ULONG Flags;
  126. // Reference count of number of guids using this instance set
  127. ULONG RefCount;
  128. // Signature to identify entry
  129. ULONG Signature;
  130. // Entry in list of instances within a data source
  131. LIST_ENTRY DSISList;
  132. // Back link to guid that this instance set is a member
  133. PBGUIDENTRY GuidEntry;
  134. // Back link to data source that this instance set is a member
  135. struct tagDATASOURCE *DataSource;
  136. // Count of instances in instance set
  137. ULONG Count;
  138. // Size needed to place all instance names in a WNODE_ALL_DATA
  139. ULONG WADInstanceNameSize;
  140. // ProviderId for the DS associated with this IS
  141. ULONG ProviderId;
  142. // Count of Trace Transaction Guids for this Instance
  143. ULONG TransGuidCount;
  144. // Pointer to Trace Transaction Guids
  145. PTRACEGUIDMAP TraceGuidMap;
  146. //
  147. // If IS_INSTANCE_BASENAME is set then IsBaseName pointe at instance base
  148. // name structure. Else if IS_INSTANCE_STATICNAME is set then
  149. // IsStaticNames points to static instance name list. If
  150. union
  151. {
  152. PBISBASENAME IsBaseName;
  153. PBISSTATICNAMES IsStaticNames;
  154. };
  155. } INSTANCESET, *PINSTANCESET, *PBINSTANCESET;
  156. #define IS_SIGNATURE 'SImW'
  157. //
  158. // Guid Map Entry List maintains the list of Guid and their maps.
  159. // Only those Guids that are Unregistered while a logger session is in
  160. // progress is kept in this list.
  161. // It is also used as a placeholder for InstanceIds. Trace Guid Registration
  162. // calls return a handle to a GUIDMAPENTRY which maintains the map and the
  163. // Instance Ids.
  164. //
  165. typedef struct tagTRACE_REG_INFO
  166. {
  167. ULONG RegistrationCookie;
  168. HANDLE InProgressEvent; // Registration is in Progress Event
  169. BOOLEAN EnabledState; // Indicates if this GUID is Enabled or not.
  170. PVOID NotifyRoutine;
  171. PVOID TraceCtxHandle;
  172. } TRACE_REG_INFO, *PTRACE_REG_INFO;
  173. typedef struct
  174. {
  175. LIST_ENTRY Entry;
  176. TRACEGUIDMAP GuidMap;
  177. ULONG InstanceId;
  178. ULONG64 LoggerContext;
  179. PTRACE_REG_INFO pControlGuidData;
  180. } GUIDMAPENTRY, *PGUIDMAPENTRY;
  181. //
  182. // These flags are also by the WMIINSTANCEINFO structure in wmicore.idl
  183. #define IS_INSTANCE_BASENAME 0x00000001
  184. #define IS_INSTANCE_STATICNAMES 0x00000002
  185. #define IS_EXPENSIVE 0x00000004 // set if collection must be enabled
  186. #define IS_COLLECTING 0x00000008 // set when collecting
  187. #define IS_KM_PROVIDER 0x00000080 // KM data provider
  188. #define IS_SM_PROVIDER 0x00000100 // Shared memory provider
  189. #define IS_UM_PROVIDER 0x00000200 // User mode provider
  190. #define IS_NEWLY_REGISTERED 0x00000800 // set if IS is registering
  191. //
  192. // Any traced guids are used for trace logging and not querying
  193. #define IS_TRACED 0x00001000
  194. // Set when events are enabled for instance set
  195. #define IS_ENABLE_EVENT 0x00002000
  196. // Set when events are enabled for instance set
  197. #define IS_ENABLE_COLLECTION 0x00004000
  198. // Set if guid is used only for firing events and not querying
  199. #define IS_EVENT_ONLY 0x00008000
  200. // Set if data provider for instance set is expecting ansi instsance names
  201. #define IS_ANSI_INSTANCENAMES 0x00010000
  202. // Set if instance names are originated from a PDO
  203. #define IS_PDO_INSTANCENAME 0x00020000
  204. // Set if a Traced Guid is also a Trace Control Guid
  205. #define IS_CONTROL_GUID 0x00080000
  206. #define IS_ON_FREE_LIST 0x80000000
  207. typedef struct tagGUIDENTRY
  208. {
  209. union
  210. {
  211. // Entry in list of all guids registered with WMI
  212. LIST_ENTRY MainGEList;
  213. // Entry in list of free guid entry blocks
  214. LIST_ENTRY FreeGEList;
  215. };
  216. PCHUNKHEADER Chunk; // Chunk in which entry is located
  217. ULONG Flags;
  218. // Count of number of data sources using this guid
  219. ULONG RefCount;
  220. // Signature to identify entry
  221. ULONG Signature;
  222. // Head of list of open objects to this guid
  223. LIST_ENTRY ObjectHead;
  224. // Count of InstanceSets headed by this guid
  225. ULONG ISCount;
  226. // Head of list of all instances for guid
  227. LIST_ENTRY ISHead;
  228. // Guid that represents data block
  229. GUID Guid;
  230. ULONG EventRefCount; // Global count of event enables
  231. ULONG CollectRefCount; // Global count of collection enables
  232. ULONG64 LoggerContext; // Logger context handle
  233. PWMI_LOGGER_INFORMATION LoggerInfo; // LoggerInfo. Used in case of Ntdll tracing
  234. PKEVENT CollectInProgress; // Event set when all collect complete
  235. } GUIDENTRY, *PGUIDENTRY, *PBGUIDENTRY;
  236. #define GE_SIGNATURE 'EGmW'
  237. #define GE_ON_FREE_LIST 0x80000000
  238. //
  239. // When set this guid is an internally defined guid that has no data source
  240. // attached to it.
  241. #define GE_FLAG_INTERNAL 0x00000001
  242. // Set when a notification request is being processed by the data providers
  243. #define GE_FLAG_NOTIFICATION_IN_PROGRESS 0x00000002
  244. // Set when a collection request is being processed by the data providers
  245. #define GE_FLAG_COLLECTION_IN_PROGRESS 0x00000004
  246. // Set when a trace disable is being processed by a worker thread
  247. #define GE_FLAG_TRACEDISABLE_IN_PROGRESS 0x00000008
  248. // Set when there is a wait in progress for collect/event enable/disable
  249. #define GE_FLAG_WAIT_ENABLED 0x00000010
  250. // Set when the guid has had an enable collection sent to it
  251. #define GE_FLAG_COLLECTION_ENABLED 0x00000020
  252. // Set when the guid has had an enable notifications sent to it
  253. #define GE_FLAG_NOTIFICATIONS_ENABLED 0x00000040
  254. #define GE_NOTIFICATION_TRACE_FLAG 0x00000080
  255. // Set when an enabled guid receives another enable notification
  256. #define GE_NOTIFICATION_TRACE_UPDATE 0x00000100
  257. typedef struct
  258. {
  259. union
  260. {
  261. // Entry in list of all DS
  262. LIST_ENTRY MainMRList;
  263. // Entry in list of free DS
  264. LIST_ENTRY FreeMRList;
  265. };
  266. PCHUNKHEADER Chunk; // Chunk in which entry is located
  267. ULONG Flags;
  268. ULONG RefCount;
  269. // Signature to identify entry
  270. ULONG Signature;
  271. PWCHAR RegistryPath; // Path to image file with resource
  272. PWCHAR MofResourceName; // Name of resource containing mof data
  273. } MOFRESOURCE, *PMOFRESOURCE;
  274. #define MR_SIGNATURE 'RMmW'
  275. //
  276. // This is a user mode resource so the RegistryPath is really an image path
  277. #define MR_FLAG_USER_MODE 0x00000001
  278. #if DBG
  279. #define AVGMOFRESOURCECOUNT 1
  280. #else
  281. #define AVGMOFRESOURCECOUNT 4
  282. #endif
  283. struct _WMIGUIDOBJECT;
  284. typedef struct tagDATASOURCE
  285. {
  286. union
  287. {
  288. // Entry in list of all DS
  289. LIST_ENTRY MainDSList;
  290. // Entry in list of free DS
  291. LIST_ENTRY FreeDSList;
  292. };
  293. PCHUNKHEADER Chunk; // Chunk in which entry is located
  294. ULONG Flags;
  295. ULONG RefCount;
  296. ULONG Signature;
  297. // Head of list of instances for this DS
  298. LIST_ENTRY ISHead;
  299. // Provider id of kernel mode driver
  300. ULONG ProviderId;
  301. // Path to registry holding ACLs
  302. PTCHAR RegistryPath;
  303. // Head of list of MofResources attached to data source
  304. ULONG MofResourceCount;
  305. PMOFRESOURCE *MofResources;
  306. PMOFRESOURCE StaticMofResources[AVGMOFRESOURCECOUNT];
  307. // Guid object if this is a UM provider
  308. struct _WMIGUIDOBJECT *RequestObject;
  309. };
  310. #define DS_SIGNATURE 'SDmW'
  311. #define VERIFY_DPCTXHANDLE(DsCtxHandle) \
  312. ( ((DsCtxHandle) == NULL) || \
  313. (((PBDATASOURCE)(DsCtxHandle))->Signature == DS_SIGNATURE) )
  314. typedef struct tagDATASOURCE DATASOURCE, *PDATASOURCE, *PBDATASOURCE;
  315. #define DS_ALLOW_ALL_ACCESS 0x00000001
  316. #define DS_KERNEL_MODE 0x00000002
  317. #define DS_USER_MODE 0x00000008
  318. #define DS_ON_FREE_LIST 0x80000000
  319. //
  320. // AVGGUIDSPERDS defines a guess as to the number of guids that get registered
  321. // by any data provider. It is used to allocate the buffer used to deliver
  322. // registration change notifications.
  323. #if DBG
  324. #define AVGGUIDSPERDS 2
  325. #else
  326. #define AVGGUIDSPERDS 256
  327. #endif
  328. //
  329. // Guid and InstanceSet cache
  330. #if DBG
  331. #define PTRCACHEGROWSIZE 2
  332. #else
  333. #define PTRCACHEGROWSIZE 64
  334. #endif
  335. typedef struct
  336. {
  337. LPGUID Guid;
  338. PBINSTANCESET InstanceSet;
  339. } PTRCACHE;
  340. typedef struct
  341. {
  342. ULONG ProviderId;
  343. ULONG Flags;
  344. ULONG InstanceCount;
  345. ULONG InstanceNameSize;
  346. PWCHAR **StaticNamePtr;
  347. ULONG BaseIndex;
  348. PWCHAR BaseName;
  349. } WMIINSTANCEINFO, *PWMIINSTANCEINFO;
  350. // TODO: Since these were copied from wmium.h, we actually need to mov
  351. // them someplace else so they aren't copied
  352. //extern GUID GUID_REGISTRATION_CHANGE_NOTIFICATION;
  353. //extern GUID_MOF_RESOURCE_ADDED_NOTIFICATION;
  354. //extern GUID_MOF_RESOURCE_REMOVED_NOTIFICATION;
  355. //
  356. // Location of built in MOF for the system
  357. //
  358. #define WMICOREIMAGEPATH L"advapi32.dll"
  359. #define WMICORERESOURCENAME L"MofResourceName"
  360. void WmipGenerateBinaryMofNotification(
  361. PBINSTANCESET BinaryMofInstanceSet,
  362. LPCGUID Guid
  363. );
  364. void WmipGenerateMofResourceNotification(
  365. LPWSTR ImagePath,
  366. LPWSTR ResourceName,
  367. LPCGUID Guid,
  368. ULONG ActionCode
  369. );
  370. //
  371. // alloc.c
  372. extern LIST_ENTRY WmipGEHead;
  373. extern PLIST_ENTRY WmipGEHeadPtr;
  374. extern CHUNKINFO WmipGEChunkInfo;
  375. extern LIST_ENTRY WmipDSHead;
  376. extern PLIST_ENTRY WmipDSHeadPtr;
  377. extern CHUNKINFO WmipDSChunkInfo;
  378. extern LIST_ENTRY WmipMRHead;
  379. extern PLIST_ENTRY WmipMRHeadPtr;
  380. extern CHUNKINFO WmipMRChunkInfo;
  381. extern CHUNKINFO WmipISChunkInfo;
  382. extern LIST_ENTRY WmipGMHead;
  383. extern PLIST_ENTRY WmipGMHeadPtr;
  384. #ifdef TRACK_REFERNECES
  385. #define WmipUnreferenceDS(DataSource) \
  386. { \
  387. WmipDebugPrintEx((DPFLTR_WMICORE_ID, DPFLTR_INFO_LEVEL, "WMI: %p.%p Unref DS %x (%x) at %s %d\n", PsGetCurrentProcessId(), PsGetCurrentThreadId(), DataSource, DataSource->RefCount, __FILE__, __LINE__)); \
  388. WmipUnreferenceEntry(&WmipDSChunkInfo, (PENTRYHEADER)DataSource); \
  389. }
  390. #define WmipReferenceDS(DataSource) \
  391. { \
  392. WmipDebugPrintEx((DPFLTR_WMICORE_ID, DPFLTR_INFO_LEVEL, "WMI: %p.%p Ref DS %x (%x) at %s %d\n", PsGetCurrentProcessId(), PsGetCurrentThreadId(), DataSource, DataSource->RefCount, __FILE__, __LINE__)); \
  393. WmipReferenceEntry((PENTRYHEADER)DataSource); \
  394. }
  395. #define WmipUnreferenceGE(GuidEntry) \
  396. { \
  397. WmipDebugPrintEx((DPFLTR_WMICORE_ID, DPFLTR_INFO_LEVEL, "WMI: %p.%p Unref GE %x (%x) at %s %d\n", PsGetCurrentProcessId(), PsGetCurrentThreadId(), GuidEntry, GuidEntry->RefCount, __FILE__, __LINE__)); \
  398. WmipUnreferenceEntry(&WmipGEChunkInfo, (PENTRYHEADER)GuidEntry); \
  399. }
  400. #define WmipReferenceGE(GuidEntry) \
  401. { \
  402. WmipDebugPrintEx((DPFLTR_WMICORE_ID, DPFLTR_INFO_LEVEL, "WMI: %p.%p Ref GE %x (%x) at %s %d\n", PsGetCurrentProcessId(), PsGetCurrentThreadId(), GuidEntry, GuidEntry->RefCount, __FILE__, __LINE__)); \
  403. WmipReferenceEntry((PENTRYHEADER)GuidEntry); \
  404. }
  405. #define WmipUnreferenceIS(InstanceSet) \
  406. { \
  407. WmipDebugPrintEx((DPFLTR_WMICORE_ID, DPFLTR_INFO_LEVEL, "WMI: %p.%p Unref IS %x (%x) at %s %d\n", PsGetCurrentProcessId(), PsGetCurrentThreadId(), InstanceSet, InstanceSet->RefCount, __FILE__, __LINE__)); \
  408. WmipUnreferenceEntry(&WmipISChunkInfo, (PENTRYHEADER)InstanceSet); \
  409. }
  410. #define WmipReferenceIS(InstanceSet) \
  411. { \
  412. WmipDebugPrintEx((DPFLTR_WMICORE_ID, DPFLTR_INFO_LEVEL, "WMI: %p.%p Ref IS %x (%x) at %s %d\n", PsGetCurrentProcessId(), PsGetCurrentThreadId(), InstanceSet, InstanceSet->RefCount, __FILE__, __LINE__)); \
  413. WmipReferenceEntry((PENTRYHEADER)InstanceSet); \
  414. }
  415. #define WmipUnreferenceMR(MofResource) \
  416. { \
  417. WmipDebugPrintEx((DPFLTR_WMICORE_ID, DPFLTR_INFO_LEVEL, "WMI: %p.%p Unref MR %x (%x) at %s %d\n", PsGetCurrentProcessId(), PsGetCurrentThreadId(), MofResource, MofResource->RefCount, __FILE__, __LINE__)); \
  418. WmipUnreferenceEntry(&WmipMRChunkInfo, (PENTRYHEADER)MofResource); \
  419. }
  420. #define WmipReferenceMR(MofResource) \
  421. { \
  422. WmipDebugPrintEx((DPFLTR_WMICORE_ID, DPFLTR_INFO_LEVEL, "WMI: %p.%p Ref MR %x (%x) at %s %d\n", PsGetCurrentProcessId(), PsGetCurrentThreadId(), MofResource, MofResource->RefCount, __FILE__, __LINE__)); \
  423. WmipReferenceEntry((PENTRYHEADER)MofResource); \
  424. }
  425. #else
  426. #define WmipUnreferenceDS(DataSource) \
  427. WmipUnreferenceEntry(&WmipDSChunkInfo, (PENTRYHEADER)DataSource)
  428. #define WmipReferenceDS(DataSource) \
  429. WmipReferenceEntry((PENTRYHEADER)DataSource)
  430. #define WmipUnreferenceGE(GuidEntry) \
  431. WmipUnreferenceEntry(&WmipGEChunkInfo, (PENTRYHEADER)GuidEntry)
  432. #define WmipReferenceGE(GuidEntry) \
  433. WmipReferenceEntry((PENTRYHEADER)GuidEntry)
  434. #define WmipUnreferenceIS(InstanceSet) \
  435. WmipUnreferenceEntry(&WmipISChunkInfo, (PENTRYHEADER)InstanceSet)
  436. #define WmipReferenceIS(InstanceSet) \
  437. WmipReferenceEntry((PENTRYHEADER)InstanceSet)
  438. #define WmipUnreferenceDC(DataConsumer) \
  439. WmipUnreferenceEntry(&WmipDCChunkInfo, (PENTRYHEADER)DataConsumer)
  440. #define WmipReferenceDC(DataConsumer) \
  441. WmipReferenceEntry((PENTRYHEADER)DataConsumer)
  442. #define WmipUnreferenceMR(MofResource) \
  443. WmipUnreferenceEntry(&WmipMRChunkInfo, (PENTRYHEADER)MofResource)
  444. #define WmipReferenceMR(MofResource) \
  445. WmipReferenceEntry((PENTRYHEADER)MofResource)
  446. #endif
  447. PBDATASOURCE WmipAllocDataSource(
  448. void
  449. );
  450. PBGUIDENTRY WmipAllocGuidEntry(
  451. void
  452. );
  453. #define WmipAllocInstanceSet() ((PBINSTANCESET)WmipAllocEntry(&WmipISChunkInfo))
  454. #define WmipAllocMofResource() ((PMOFRESOURCE)WmipAllocEntry(&WmipMRChunkInfo))
  455. #define WmipAllocString(Size) \
  456. WmipAlloc((Size)*sizeof(WCHAR))
  457. #define WmipFreeString(Ptr) \
  458. WmipFree(Ptr)
  459. BOOLEAN WmipIsNumber(
  460. LPCWSTR String
  461. );
  462. #ifdef HEAPVALIDATION
  463. PVOID WmipAlloc(
  464. ULONG Size
  465. );
  466. PVOID WmipAllocWithTag(
  467. ULONG Size,
  468. ULONG Tag
  469. );
  470. void WmipFree(
  471. PVOID p
  472. );
  473. #else
  474. #define WmipAlloc(Size) \
  475. ExAllocatePoolWithTag(PagedPool, Size, 'pimW')
  476. #define WmipAllocWithTag(Size, Tag) \
  477. ExAllocatePoolWithTag(PagedPool, Size, Tag)
  478. #define WmipFree(Ptr) \
  479. ExFreePool(Ptr)
  480. #endif
  481. #define WmipAllocNP(Size) \
  482. ExAllocatePoolWithTag(NonPagedPool, Size, 'pimW')
  483. #define WmipAllocNPWithTag(Size, Tag) \
  484. ExAllocatePoolWithTag(NonPagedPool, Size, Tag)
  485. BOOLEAN WmipRealloc(
  486. PVOID *Buffer,
  487. ULONG CurrentSize,
  488. ULONG NewSize,
  489. BOOLEAN FreeOriginalBuffer
  490. );
  491. PBGUIDENTRY WmipFindGEByGuid(
  492. LPGUID Guid,
  493. BOOLEAN MakeTopOfList
  494. );
  495. PBDATASOURCE WmipFindDSByProviderId(
  496. ULONG_PTR ProviderId
  497. );
  498. PBINSTANCESET WmipFindISByGuid(
  499. PBDATASOURCE DataSource,
  500. GUID UNALIGNED *Guid
  501. );
  502. PMOFRESOURCE WmipFindMRByNames(
  503. LPCWSTR ImagePath,
  504. LPCWSTR MofResourceName
  505. );
  506. PBINSTANCESET WmipFindISinGEbyName(
  507. PBGUIDENTRY GuidEntry,
  508. PWCHAR InstanceName,
  509. PULONG InstanceIndex
  510. );
  511. // TODO: Implement this
  512. #define WmipReportEventLog(a,b,c,d,e,f,g)
  513. #endif