ReactOS  0.4.15-dev-2993-g14fbe80
wdfwmi.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _WDF_WMI_PROVIDER_CONFIG
 
struct  _WDF_WMI_INSTANCE_CONFIG
 

Macros

#define WDF_EXTERN_C
 
#define WDF_EXTERN_C_START
 
#define WDF_EXTERN_C_END
 

Typedefs

typedef WDF_EXTERN_C_START enum _WDF_WMI_PROVIDER_CONTROL WDF_WMI_PROVIDER_CONTROL
 
typedef enum _WDF_WMI_PROVIDER_FLAGS WDF_WMI_PROVIDER_FLAGS
 
typedef _In_ ULONG OutBufferSize
 
typedef _In_ ULONG _Out_writes_bytes_to_(OutBufferSize, *BufferUsed) PVOID OutBuffer
 
typedef _In_ ULONG _Out_ PULONG BufferUsed
 
typedef EVT_WDF_WMI_INSTANCE_QUERY_INSTANCE * PFN_WDF_WMI_INSTANCE_QUERY_INSTANCE
 
typedef _In_ ULONG InBufferSize
 
typedef _In_ ULONG _In_reads_bytes_(InBufferSize) PVOID InBuffer)
 
typedef EVT_WDF_WMI_INSTANCE_SET_INSTANCE * PFN_WDF_WMI_INSTANCE_SET_INSTANCE
 
typedef _In_ ULONG DataItemId
 
typedef EVT_WDF_WMI_INSTANCE_SET_ITEM * PFN_WDF_WMI_INSTANCE_SET_ITEM
 
typedef _In_ ULONG MethodId
 
typedef _In_ ULONG _In_ ULONG _In_ ULONG _When_(InBufferSize >=OutBufferSize, _Inout_updates_bytes_(InBufferSize)) _When_(InBufferSize< OutBufferSize
 
typedef _In_ ULONG _In_ ULONG _In_ ULONG _Inout_updates_bytes_(OutBufferSize)) PVOID Buffer
 
typedef EVT_WDF_WMI_INSTANCE_EXECUTE_METHOD * PFN_WDF_WMI_INSTANCE_EXECUTE_METHOD
 
typedef _In_ WDF_WMI_PROVIDER_CONTROL Control
 
typedef _In_ WDF_WMI_PROVIDER_CONTROL _In_ BOOLEAN Enable
 
typedef EVT_WDF_WMI_PROVIDER_FUNCTION_CONTROL * PFN_WDF_WMI_PROVIDER_FUNCTION_CONTROL
 
typedef struct _WDF_WMI_PROVIDER_CONFIG WDF_WMI_PROVIDER_CONFIG
 
typedef struct _WDF_WMI_PROVIDER_CONFIGPWDF_WMI_PROVIDER_CONFIG
 
typedef struct _WDF_WMI_INSTANCE_CONFIG WDF_WMI_INSTANCE_CONFIG
 
typedef struct _WDF_WMI_INSTANCE_CONFIGPWDF_WMI_INSTANCE_CONFIG
 
typedef _Must_inspect_result_ _IRQL_requires_max_(DISPATCH_LEVEL) WDFAPI NTSTATUS(STDCALL *PFN_WDFWMIPROVIDERCREATE) (_In_ PWDF_DRIVER_GLOBALS DriverGlobals
 
typedef _Must_inspect_result_ _In_ WDFDEVICE Device
 
typedef _Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_PROVIDER_CONFIG WmiProviderConfig
 
typedef _Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_PROVIDER_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES ProviderAttributes
 
typedef _Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_PROVIDER_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWMIPROVIDER * WmiProvider
 
typedef _In_ WDFWMIPROVIDER _In_ WDF_WMI_PROVIDER_CONTROL ProviderControl
 
typedef _Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG InstanceConfig
 
typedef _Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES InstanceAttributes
 
typedef _Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_opt_ WDFWMIINSTANCE * Instance
 
typedef _Must_inspect_result_ _In_ WDFWMIINSTANCE WmiInstance
 
typedef _Must_inspect_result_ _In_ WDFWMIINSTANCE _In_opt_ ULONG EventDataSize
 
typedef _Must_inspect_result_ _In_ WDFWMIINSTANCE _In_opt_ ULONG _In_reads_bytes_opt_(EventDataSize) PVOID EventData)
 

Enumerations

enum  _WDF_WMI_PROVIDER_CONTROL { WdfWmiControlInvalid = 0, WdfWmiEventControl, WdfWmiInstanceControl }
 
enum  _WDF_WMI_PROVIDER_FLAGS { WdfWmiProviderEventOnly = 0x0001, WdfWmiProviderExpensive = 0x0002, WdfWmiProviderTracing = 0x0004, WdfWmiProviderValidFlags = WdfWmiProviderEventOnly | WdfWmiProviderExpensive | WdfWmiProviderTracing }
 

Functions

typedef _Function_class_ (EVT_WDF_WMI_INSTANCE_QUERY_INSTANCE) _IRQL_requires_same_ _IRQL_requires_max_(PASSIVE_LEVEL) NTSTATUS STDCALL EVT_WDF_WMI_INSTANCE_QUERY_INSTANCE(_In_ WDFWMIINSTANCE WmiInstance
 
typedef _Function_class_ (EVT_WDF_WMI_INSTANCE_SET_INSTANCE) _IRQL_requires_same_ _IRQL_requires_max_(PASSIVE_LEVEL) NTSTATUS STDCALL EVT_WDF_WMI_INSTANCE_SET_INSTANCE(_In_ WDFWMIINSTANCE WmiInstance
 
typedef _Function_class_ (EVT_WDF_WMI_INSTANCE_SET_ITEM) _IRQL_requires_same_ _IRQL_requires_max_(PASSIVE_LEVEL) NTSTATUS STDCALL EVT_WDF_WMI_INSTANCE_SET_ITEM(_In_ WDFWMIINSTANCE WmiInstance
 
typedef _Function_class_ (EVT_WDF_WMI_INSTANCE_EXECUTE_METHOD) _IRQL_requires_same_ _IRQL_requires_max_(PASSIVE_LEVEL) NTSTATUS STDCALL EVT_WDF_WMI_INSTANCE_EXECUTE_METHOD(_In_ WDFWMIINSTANCE WmiInstance
 
typedef _Function_class_ (EVT_WDF_WMI_PROVIDER_FUNCTION_CONTROL) _IRQL_requires_same_ _IRQL_requires_max_(PASSIVE_LEVEL) NTSTATUS STDCALL EVT_WDF_WMI_PROVIDER_FUNCTION_CONTROL(_In_ WDFWMIPROVIDER WmiProvider
 
FORCEINLINE VOID WDF_WMI_PROVIDER_CONFIG_INIT (_Out_ PWDF_WMI_PROVIDER_CONFIG Config, _In_ CONST GUID *Guid)
 
FORCEINLINE VOID WDF_WMI_INSTANCE_CONFIG_INIT_PROVIDER (_Out_ PWDF_WMI_INSTANCE_CONFIG Config, _In_ WDFWMIPROVIDER Provider)
 
FORCEINLINE VOID WDF_WMI_INSTANCE_CONFIG_INIT_PROVIDER_CONFIG (_Out_ PWDF_WMI_INSTANCE_CONFIG Config, _In_ PWDF_WMI_PROVIDER_CONFIG ProviderConfig)
 
FORCEINLINE NTSTATUS WDF_WMI_BUFFER_APPEND_STRING (_Out_writes_bytes_(BufferLength) PVOID Buffer, _In_ ULONG BufferLength, _In_ PCUNICODE_STRING String, _Out_ PULONG RequiredSize)
 
_Must_inspect_result_ _IRQL_requires_max_ (DISPATCH_LEVEL) FORCEINLINE NTSTATUS WdfWmiProviderCreate(_In_ WDFDEVICE Device
 
_Must_inspect_result_ _IRQL_requires_max_ (PASSIVE_LEVEL) FORCEINLINE NTSTATUS WdfWmiInstanceRegister(_In_ WDFWMIINSTANCE WmiInstance)
 
_Must_inspect_result_ _IRQL_requires_max_ (APC_LEVEL) FORCEINLINE NTSTATUS WdfWmiInstanceFireEvent(_In_ WDFWMIINSTANCE WmiInstance
 
_Must_inspect_result_ _In_opt_ ULONG _In_reads_bytes_opt_ (EventDataSize) PVOID EventData)
 

Macro Definition Documentation

◆ WDF_EXTERN_C

#define WDF_EXTERN_C

Definition at line 38 of file wdfwmi.h.

◆ WDF_EXTERN_C_END

#define WDF_EXTERN_C_END

Definition at line 40 of file wdfwmi.h.

◆ WDF_EXTERN_C_START

#define WDF_EXTERN_C_START

Definition at line 39 of file wdfwmi.h.

Typedef Documentation

◆ _In_reads_bytes_

typedef _In_ ULONG _In_ ULONG _In_reads_bytes_(InBufferSize) PVOID InBuffer)

Definition at line 107 of file wdfwmi.h.

◆ _In_reads_bytes_opt_

typedef _Must_inspect_result_ _In_ WDFWMIINSTANCE _In_opt_ ULONG _In_reads_bytes_opt_(EventDataSize) PVOID EventData)

Definition at line 618 of file wdfwmi.h.

◆ _Inout_updates_bytes_

typedef _In_ ULONG _In_ ULONG _In_ ULONG _Inout_updates_bytes_(OutBufferSize)) PVOID Buffer

Definition at line 148 of file wdfwmi.h.

◆ _IRQL_requires_max_

typedef _Must_inspect_result_ _IRQL_requires_max_(APC_LEVEL) WDFAPI NTSTATUS(STDCALL *PFN_WDFWMIINSTANCEFIREEVENT)(_In_ PWDF_DRIVER_GLOBALS DriverGlobals

Definition at line 349 of file wdfwmi.h.

◆ _Out_writes_bytes_to_

_Out_writes_bytes_to_

Definition at line 88 of file wdfwmi.h.

◆ _When_

◆ BufferUsed

◆ Control

Definition at line 166 of file wdfwmi.h.

◆ DataItemId

Definition at line 123 of file wdfwmi.h.

◆ Device

typedef _Must_inspect_result_ _In_ WDFDEVICE Device

Definition at line 356 of file wdfwmi.h.

◆ Enable

Definition at line 166 of file wdfwmi.h.

◆ EventDataSize

◆ InBufferSize

◆ Instance

Initial value:
{
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES InstanceAttributes
Definition: wdfwmi.h:474
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfwmi.h:356
#define WdfFunctions
Definition: wdf.h:66
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_opt_ WDFWMIINSTANCE * Instance
Definition: wdfwmi.h:474
PWDF_DRIVER_GLOBALS WdfDriverGlobals
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG InstanceConfig
Definition: wdfwmi.h:474

Definition at line 474 of file wdfwmi.h.

◆ InstanceAttributes

◆ InstanceConfig

◆ MethodId

typedef _In_ ULONG MethodId

Definition at line 142 of file wdfwmi.h.

◆ OutBufferSize

◆ PFN_WDF_WMI_INSTANCE_EXECUTE_METHOD

typedef EVT_WDF_WMI_INSTANCE_EXECUTE_METHOD* PFN_WDF_WMI_INSTANCE_EXECUTE_METHOD

Definition at line 154 of file wdfwmi.h.

◆ PFN_WDF_WMI_INSTANCE_QUERY_INSTANCE

typedef EVT_WDF_WMI_INSTANCE_QUERY_INSTANCE* PFN_WDF_WMI_INSTANCE_QUERY_INSTANCE

Definition at line 94 of file wdfwmi.h.

◆ PFN_WDF_WMI_INSTANCE_SET_INSTANCE

typedef EVT_WDF_WMI_INSTANCE_SET_INSTANCE* PFN_WDF_WMI_INSTANCE_SET_INSTANCE

Definition at line 111 of file wdfwmi.h.

◆ PFN_WDF_WMI_INSTANCE_SET_ITEM

typedef EVT_WDF_WMI_INSTANCE_SET_ITEM* PFN_WDF_WMI_INSTANCE_SET_ITEM

Definition at line 130 of file wdfwmi.h.

◆ PFN_WDF_WMI_PROVIDER_FUNCTION_CONTROL

typedef EVT_WDF_WMI_PROVIDER_FUNCTION_CONTROL* PFN_WDF_WMI_PROVIDER_FUNCTION_CONTROL

Definition at line 171 of file wdfwmi.h.

◆ ProviderAttributes

◆ ProviderControl

Initial value:
{
_In_ WDFWMIPROVIDER _In_ WDF_WMI_PROVIDER_CONTROL ProviderControl
Definition: wdfwmi.h:419
#define WdfFunctions
Definition: wdf.h:66
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_PROVIDER_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWMIPROVIDER * WmiProvider
Definition: wdfwmi.h:356
PWDF_DRIVER_GLOBALS WdfDriverGlobals

Definition at line 419 of file wdfwmi.h.

◆ PWDF_WMI_INSTANCE_CONFIG

◆ PWDF_WMI_PROVIDER_CONFIG

◆ WDF_WMI_INSTANCE_CONFIG

◆ WDF_WMI_PROVIDER_CONFIG

◆ WDF_WMI_PROVIDER_CONTROL

◆ WDF_WMI_PROVIDER_FLAGS

◆ WmiInstance

Initial value:

Definition at line 514 of file wdfwmi.h.

◆ WmiProvider

_In_ WDFWMIPROVIDER WmiProvider
Initial value:
{
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_PROVIDER_CONFIG WmiProviderConfig
Definition: wdfwmi.h:356
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfwmi.h:356
#define WdfFunctions
Definition: wdf.h:66
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_PROVIDER_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWMIPROVIDER * WmiProvider
Definition: wdfwmi.h:356
PWDF_DRIVER_GLOBALS WdfDriverGlobals
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_PROVIDER_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES ProviderAttributes
Definition: wdfwmi.h:356

Definition at line 356 of file wdfwmi.h.

◆ WmiProviderConfig

Enumeration Type Documentation

◆ _WDF_WMI_PROVIDER_CONTROL

Enumerator
WdfWmiControlInvalid 
WdfWmiEventControl 
WdfWmiInstanceControl 

Definition at line 50 of file wdfwmi.h.

50  {
WDF_EXTERN_C_START enum _WDF_WMI_PROVIDER_CONTROL WDF_WMI_PROVIDER_CONTROL

◆ _WDF_WMI_PROVIDER_FLAGS

Enumerator
WdfWmiProviderEventOnly 
WdfWmiProviderExpensive 
WdfWmiProviderTracing 
WdfWmiProviderValidFlags 

Definition at line 68 of file wdfwmi.h.

Function Documentation

◆ _Function_class_() [1/5]

typedef _Function_class_ ( EVT_WDF_WMI_INSTANCE_QUERY_INSTANCE  )

◆ _Function_class_() [2/5]

typedef _Function_class_ ( EVT_WDF_WMI_INSTANCE_SET_INSTANCE  )

◆ _Function_class_() [3/5]

typedef _Function_class_ ( EVT_WDF_WMI_INSTANCE_SET_ITEM  )

◆ _Function_class_() [4/5]

typedef _Function_class_ ( EVT_WDF_WMI_INSTANCE_EXECUTE_METHOD  )

◆ _Function_class_() [5/5]

typedef _Function_class_ ( EVT_WDF_WMI_PROVIDER_FUNCTION_CONTROL  )

◆ _In_reads_bytes_opt_()

_Must_inspect_result_ _In_opt_ ULONG _In_reads_bytes_opt_ ( EventDataSize  )

Definition at line 631 of file wdfwmi.h.

634 {
635  return ((PFN_WDFWMIINSTANCEFIREEVENT) WdfFunctions[WdfWmiInstanceFireEventTableIndex])(WdfDriverGlobals, WmiInstance, EventDataSize, EventData);
636 }
_Must_inspect_result_ _In_ WDFWMIINSTANCE _In_opt_ ULONG EventDataSize
Definition: wdfwmi.h:615
_Must_inspect_result_ _In_ WDFWMIINSTANCE WmiInstance
Definition: wdfwmi.h:514
#define WdfFunctions
Definition: wdf.h:66
PWDF_DRIVER_GLOBALS WdfDriverGlobals

◆ _IRQL_requires_max_() [1/3]

_Must_inspect_result_ _IRQL_requires_max_ ( DISPATCH_LEVEL  )

Definition at line 397 of file wdfwmi.h.

404 {
405  return ((PFN_WDFWMIPROVIDERGETDEVICE) WdfFunctions[WdfWmiProviderGetDeviceTableIndex])(WdfDriverGlobals, WmiProvider);
406 }
#define WdfFunctions
Definition: wdf.h:66
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_PROVIDER_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWMIPROVIDER * WmiProvider
Definition: wdfwmi.h:356
PWDF_DRIVER_GLOBALS WdfDriverGlobals

◆ _IRQL_requires_max_() [2/3]

_Must_inspect_result_ _IRQL_requires_max_ ( PASSIVE_LEVEL  )

Definition at line 517 of file wdfwmi.h.

524 {
525  return ((PFN_WDFWMIINSTANCEREGISTER) WdfFunctions[WdfWmiInstanceRegisterTableIndex])(WdfDriverGlobals, WmiInstance);
526 }
_Must_inspect_result_ _In_ WDFWMIINSTANCE WmiInstance
Definition: wdfwmi.h:514
#define WdfFunctions
Definition: wdf.h:66
PWDF_DRIVER_GLOBALS WdfDriverGlobals

◆ _IRQL_requires_max_() [3/3]

_Must_inspect_result_ _IRQL_requires_max_ ( APC_LEVEL  )

Definition at line 197 of file cddata.c.

254 {
255  THREAD_CONTEXT ThreadContext = {0};
256  PIRP_CONTEXT IrpContext = NULL;
257  BOOLEAN Wait;
258 
259 #ifdef CD_SANITY
260  PVOID PreviousTopLevel;
261 #endif
262 
264 
265 #if DBG
266 
267  KIRQL SaveIrql = KeGetCurrentIrql();
268 
269 #endif
270 
272 
274 
276 
277 #ifdef CD_SANITY
278  PreviousTopLevel = IoGetTopLevelIrp();
279 #endif
280 
281  //
282  // Loop until this request has been completed or posted.
283  //
284 
285  do {
286 
287  //
288  // Use a try-except to handle the exception cases.
289  //
290 
291  _SEH2_TRY {
292 
293  //
294  // If the IrpContext is NULL then this is the first pass through
295  // this loop.
296  //
297 
298  if (IrpContext == NULL) {
299 
300  //
301  // Decide if this request is waitable an allocate the IrpContext.
302  // If the file object in the stack location is NULL then this
303  // is a mount which is always waitable. Otherwise we look at
304  // the file object flags.
305  //
306 
308 
309  Wait = TRUE;
310 
311  } else {
312 
313  Wait = CanFsdWait( Irp );
314  }
315 
316  IrpContext = CdCreateIrpContext( Irp, Wait );
317 
318  //
319  // Update the thread context information.
320  //
321 
322  CdSetThreadContext( IrpContext, &ThreadContext );
323 
324 #ifdef CD_SANITY
325  NT_ASSERT( !CdTestTopLevel ||
326  SafeNodeType( IrpContext->TopLevel ) == CDFS_NTC_IRP_CONTEXT );
327 #endif
328 
329  //
330  // Otherwise cleanup the IrpContext for the retry.
331  //
332 
333  } else {
334 
335  //
336  // Set the MORE_PROCESSING flag to make sure the IrpContext
337  // isn't inadvertently deleted here. Then cleanup the
338  // IrpContext to perform the retry.
339  //
340 
341  SetFlag( IrpContext->Flags, IRP_CONTEXT_FLAG_MORE_PROCESSING );
342  CdCleanupIrpContext( IrpContext, FALSE );
343  }
344 
345  //
346  // Case on the major irp code.
347  //
348 
349  switch (IrpContext->MajorFunction) {
350 
351  case IRP_MJ_CREATE :
352 
353  Status = CdCommonCreate( IrpContext, Irp );
354  break;
355 
356  case IRP_MJ_CLOSE :
357 
358  Status = CdCommonClose( IrpContext, Irp );
359  break;
360 
361  case IRP_MJ_READ :
362 
363  //
364  // If this is an Mdl complete request, don't go through
365  // common read.
366  //
367 
368  if (FlagOn( IrpContext->MinorFunction, IRP_MN_COMPLETE )) {
369 
370  Status = CdCompleteMdl( IrpContext, Irp );
371 
372  } else {
373 
374  Status = CdCommonRead( IrpContext, Irp );
375  }
376 
377  break;
378 
379  case IRP_MJ_WRITE :
380 
381  Status = CdCommonWrite( IrpContext, Irp );
382  break;
383 
385 
386  Status = CdCommonQueryInfo( IrpContext, Irp );
387  break;
388 
390 
391  Status = CdCommonSetInfo( IrpContext, Irp );
392  break;
393 
395 
396  Status = CdCommonQueryVolInfo( IrpContext, Irp );
397  break;
398 
400 
401  Status = CdCommonDirControl( IrpContext, Irp );
402  break;
403 
405 
406  Status = CdCommonFsControl( IrpContext, Irp );
407  break;
408 
409  case IRP_MJ_DEVICE_CONTROL :
410 
411  Status = CdCommonDevControl( IrpContext, Irp );
412  break;
413 
414  case IRP_MJ_LOCK_CONTROL :
415 
416  Status = CdCommonLockControl( IrpContext, Irp );
417  break;
418 
419  case IRP_MJ_CLEANUP :
420 
421  Status = CdCommonCleanup( IrpContext, Irp );
422  break;
423 
424  case IRP_MJ_PNP :
425 
426  Status = CdCommonPnp( IrpContext, Irp );
427  break;
428 
429  case IRP_MJ_SHUTDOWN :
430 
431  Status = CdCommonShutdown( IrpContext, Irp );
432  break;
433 
434  default :
435 
437  CdCompleteRequest( IrpContext, Irp, Status );
438  }
439 
441 
442  Status = CdProcessException( IrpContext, Irp, _SEH2_GetExceptionCode() );
443  } _SEH2_END;
444 
445  } while (Status == STATUS_CANT_WAIT);
446 
447 #ifdef CD_SANITY
448  NT_ASSERT( !CdTestTopLevel ||
449  (PreviousTopLevel == IoGetTopLevelIrp()) );
450 #endif
451 
453 
454  NT_ASSERT( SaveIrql == KeGetCurrentIrql( ));
455 
456  return Status;
457 }
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
VOID CdSetThreadContext(_Inout_ PIRP_CONTEXT IrpContext, _In_ PTHREAD_CONTEXT ThreadContext)
Definition: cddata.c:981
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
#define IRP_MJ_SHUTDOWN
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define IRP_CONTEXT_FLAG_MORE_PROCESSING
Definition: cdstruc.h:1214
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:167
#define SafeNodeType(Ptr)
Definition: nodetype.h:54
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
LONG NTSTATUS
Definition: precomp.h:26
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
_SEH2_TRY
Definition: create.c:4226
#define IRP_MN_COMPLETE
Definition: iotypes.h:4420
UCHAR KIRQL
Definition: env_spec_w32.h:591
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
#define FALSE
Definition: types.h:117
_In_ PIRP Irp
Definition: csq.h:116
VOID CdCompleteRequest(_Inout_opt_ PIRP_CONTEXT IrpContext, _Inout_opt_ PIRP Irp, _In_ NTSTATUS Status)
Definition: cddata.c:914
#define _SEH2_GetExceptionInformation()
Definition: pseh2_64.h:164
unsigned char BOOLEAN
#define IRP_MJ_QUERY_VOLUME_INFORMATION
Definition: rdpdr.c:50
#define IRP_MJ_DIRECTORY_CONTROL
Definition: rdpdr.c:51
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:547
Status
Definition: gdiplustypes.h:24
#define IRP_MJ_FILE_SYSTEM_CONTROL
PIRP NTAPI IoGetTopLevelIrp(VOID)
Definition: irp.c:1843
#define CanFsdWait(I)
Definition: cdprocs.h:2001
NTSTATUS CdCompleteMdl(_In_ PIRP_CONTEXT IrpContext, _Inout_ PIRP Irp)
Definition: cachesup.c:411
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
NTSTATUS CdCommonDevControl(_Inout_ PIRP_CONTEXT IrpContext, _Inout_ PIRP Irp)
Definition: devctrl.c:46
#define FlagOn(_F, _SF)
Definition: ext2fs.h:179
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2793
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
_SEH2_END
Definition: create.c:4400
LONG CdExceptionFilter(_Inout_ PIRP_CONTEXT IrpContext, _In_ PEXCEPTION_POINTERS ExceptionPointer)
Definition: cddata.c:525
#define ASSERT_OPTIONAL_IRP(I)
Definition: cddata.h:251
#define NULL
Definition: types.h:112
VOID CdCleanupIrpContext(_In_ PIRP_CONTEXT IrpContext, _In_ BOOLEAN Post)
Definition: strucsup.c:1733
NTSTATUS CdCommonLockControl(_Inout_ PIRP_CONTEXT IrpContext, _Inout_ PIRP Irp)
Definition: lockctrl.c:35
#define CDFS_NTC_IRP_CONTEXT
Definition: nodetype.h:34
#define IRP_MJ_LOCK_CONTROL
Definition: rdpdr.c:53
#define IRP_MJ_READ
Definition: rdpdr.c:46
#define IRP_MJ_CLEANUP
#define IRP_MJ_SET_INFORMATION
Definition: rdpdr.c:49
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
#define IRP_MJ_QUERY_INFORMATION
Definition: rdpdr.c:48
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:40
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:165
_Ret_valid_ PIRP_CONTEXT CdCreateIrpContext(_In_ PIRP Irp, _In_ BOOLEAN Wait)
Definition: strucsup.c:1573
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
#define STATUS_CANT_WAIT
Definition: ntstatus.h:452
#define NT_ASSERT
Definition: rtlfuncs.h:3310

◆ WDF_WMI_BUFFER_APPEND_STRING()

FORCEINLINE NTSTATUS WDF_WMI_BUFFER_APPEND_STRING ( _Out_writes_bytes_(BufferLength) PVOID  Buffer,
_In_ ULONG  BufferLength,
_In_ PCUNICODE_STRING  String,
_Out_ PULONG  RequiredSize 
)

Definition at line 299 of file wdfwmi.h.

305 {
306  //
307  // Compute the length of buffer we need to use. Upon error the caller can
308  // use this length to report the required length. On success, the caller
309  // can use this length to know how many bytes were written.
310  //
311  *RequiredSize = String->Length + sizeof(USHORT);
312 
313  //
314  // UNICODE_STRING.Length is the length of the string in bytes, not characters
315  //
316 
317  // First check to see if there is enough space
318  // 1) to store the length of the string
319  // 2) to store the string itself
320  //
321  if (BufferLength < (String->Length + sizeof(USHORT))) {
322  //
323  // Not enough room in the string, report back how big a buffer is
324  // required.
325  //
327  }
328 
329  //
330  // Store the length of the string
331  //
332  *(USHORT *) Buffer = String->Length;
333 
334  //
335  // Copy the string to the buffer
336  //
338  String->Buffer,
339  String->Length);
340 
341  return STATUS_SUCCESS;
342 }
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3767
#define WDF_PTR_ADD_OFFSET(_ptr, _offset)
Definition: wdfcore.h:144
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2430
Definition: bufpool.h:45
unsigned short USHORT
Definition: pedump.c:61
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID _Out_ PULONG RequiredSize
Definition: wdfdevice.h:4431
#define STATUS_SUCCESS
Definition: shellext.h:65

◆ WDF_WMI_INSTANCE_CONFIG_INIT_PROVIDER()

FORCEINLINE VOID WDF_WMI_INSTANCE_CONFIG_INIT_PROVIDER ( _Out_ PWDF_WMI_INSTANCE_CONFIG  Config,
_In_ WDFWMIPROVIDER  Provider 
)

Definition at line 273 of file wdfwmi.h.

277 {
279  Config->Size = sizeof(WDF_WMI_INSTANCE_CONFIG);
280 
281  Config->Provider = Provider;
282 }
struct _WDF_WMI_INSTANCE_CONFIG WDF_WMI_INSTANCE_CONFIG
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
Definition: wdfchildlist.h:474
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262

◆ WDF_WMI_INSTANCE_CONFIG_INIT_PROVIDER_CONFIG()

FORCEINLINE VOID WDF_WMI_INSTANCE_CONFIG_INIT_PROVIDER_CONFIG ( _Out_ PWDF_WMI_INSTANCE_CONFIG  Config,
_In_ PWDF_WMI_PROVIDER_CONFIG  ProviderConfig 
)

Definition at line 286 of file wdfwmi.h.

290 {
292  Config->Size = sizeof(WDF_WMI_INSTANCE_CONFIG);
293 
294  Config->ProviderConfig = ProviderConfig;
295 }
struct _WDF_WMI_INSTANCE_CONFIG WDF_WMI_INSTANCE_CONFIG
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
Definition: wdfchildlist.h:474
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262

◆ WDF_WMI_PROVIDER_CONFIG_INIT()

FORCEINLINE VOID WDF_WMI_PROVIDER_CONFIG_INIT ( _Out_ PWDF_WMI_PROVIDER_CONFIG  Config,
_In_ CONST GUID Guid 
)

Definition at line 205 of file wdfwmi.h.

209 {
211 
212  Config->Size = sizeof(WDF_WMI_PROVIDER_CONFIG);
213  RtlCopyMemory(&Config->Guid, Guid, sizeof(GUID));
214 }
_Must_inspect_result_ _In_ WDFOBJECT _In_ CONST GUID * Guid
Definition: wdfobject.h:760
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
Definition: wdfchildlist.h:474
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
struct _WDF_WMI_PROVIDER_CONFIG WDF_WMI_PROVIDER_CONFIG