ReactOS 0.4.15-dev-5666-gc548b97
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_ (PASSIVE_LEVEL) FORCEINLINE NTSTATUS WdfWmiInstanceRegister(_In_ WDFWMIINSTANCE WmiInstance)
 Queries information details about a security descriptor.
 
_Must_inspect_result_ _IRQL_requires_max_ (APC_LEVEL) FORCEINLINE NTSTATUS WdfWmiInstanceFireEvent(_In_ WDFWMIINSTANCE WmiInstance
 

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 168 of file wdfwmi.h.

◆ EventDataSize

◆ InBufferSize

◆ Instance

Initial value:
{
#define WdfFunctions
Definition: wdf.h:66
PWDF_DRIVER_GLOBALS WdfDriverGlobals
@ WdfWmiInstanceCreateTableIndex
Definition: wdffuncenum.h:398
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfwmi.h:356
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES InstanceAttributes
Definition: wdfwmi.h:478
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_opt_ WDFWMIINSTANCE * Instance
Definition: wdfwmi.h:481
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG InstanceConfig
Definition: wdfwmi.h:476

Definition at line 480 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:
{
@ WdfWmiProviderIsEnabledTableIndex
Definition: wdffuncenum.h:396
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_PROVIDER_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWMIPROVIDER * WmiProvider
Definition: wdfwmi.h:363
_In_ WDFWMIPROVIDER _In_ WDF_WMI_PROVIDER_CONTROL ProviderControl
Definition: wdfwmi.h:422

Definition at line 421 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 513 of file wdfwmi.h.

◆ WmiProvider

_In_ WDFWMIPROVIDER WmiProvider
Initial value:
{
@ WdfWmiProviderCreateTableIndex
Definition: wdffuncenum.h:394
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_PROVIDER_CONFIG WmiProviderConfig
Definition: wdfwmi.h:358
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_PROVIDER_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES ProviderAttributes
Definition: wdfwmi.h:360

Definition at line 362 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 {
@ WdfWmiControlInvalid
Definition: wdfwmi.h:51
@ WdfWmiEventControl
Definition: wdfwmi.h:52
@ WdfWmiInstanceControl
Definition: wdfwmi.h:53
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.

68 {
71 WdfWmiProviderTracing = 0x0004,
@ WdfWmiProviderValidFlags
Definition: wdfwmi.h:72
@ WdfWmiProviderExpensive
Definition: wdfwmi.h:70
@ WdfWmiProviderTracing
Definition: wdfwmi.h:71
@ WdfWmiProviderEventOnly
Definition: wdfwmi.h:69
enum _WDF_WMI_PROVIDER_FLAGS WDF_WMI_PROVIDER_FLAGS

Function Documentation

◆ _Function_class_() [1/5]

typedef _Function_class_ ( EVT_WDF_WMI_INSTANCE_EXECUTE_METHOD  )

◆ _Function_class_() [2/5]

typedef _Function_class_ ( EVT_WDF_WMI_INSTANCE_QUERY_INSTANCE  )

◆ _Function_class_() [3/5]

typedef _Function_class_ ( EVT_WDF_WMI_INSTANCE_SET_INSTANCE  )

◆ _Function_class_() [4/5]

typedef _Function_class_ ( EVT_WDF_WMI_INSTANCE_SET_ITEM  )

◆ _Function_class_() [5/5]

typedef _Function_class_ ( EVT_WDF_WMI_PROVIDER_FUNCTION_CONTROL  )

◆ _IRQL_requires_max_() [1/2]

_Must_inspect_result_ _IRQL_requires_max_ ( APC_LEVEL  )

Definition at line 37 of file cddata.c.

254{
255 THREAD_CONTEXT ThreadContext = {0};
256 PIRP_CONTEXT IrpContext = NULL;
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
410
411 Status = CdCommonDevControl( IrpContext, Irp );
412 break;
413
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}
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
VOID CdCompleteRequest(_Inout_opt_ PIRP_CONTEXT IrpContext, _Inout_opt_ PIRP Irp, _In_ NTSTATUS Status)
Definition: cddata.c:914
LONG CdExceptionFilter(_Inout_ PIRP_CONTEXT IrpContext, _In_ PEXCEPTION_POINTERS ExceptionPointer)
Definition: cddata.c:525
VOID CdSetThreadContext(_Inout_ PIRP_CONTEXT IrpContext, _In_ PTHREAD_CONTEXT ThreadContext)
Definition: cddata.c:981
#define ASSERT_OPTIONAL_IRP(I)
Definition: cddata.h:251
NTSTATUS CdCompleteMdl(_In_ PIRP_CONTEXT IrpContext, _Inout_ PIRP Irp)
Definition: cachesup.c:411
VOID CdCleanupIrpContext(_In_ PIRP_CONTEXT IrpContext, _In_ BOOLEAN Post)
Definition: strucsup.c:1733
#define CanFsdWait(I)
Definition: cdprocs.h:2001
NTSTATUS CdCommonLockControl(_Inout_ PIRP_CONTEXT IrpContext, _Inout_ PIRP Irp)
Definition: lockctrl.c:35
NTSTATUS CdCommonDevControl(_Inout_ PIRP_CONTEXT IrpContext, _Inout_ PIRP Irp)
Definition: devctrl.c:46
_Ret_valid_ PIRP_CONTEXT CdCreateIrpContext(_In_ PIRP Irp, _In_ BOOLEAN Wait)
Definition: strucsup.c:1573
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
#define IRP_CONTEXT_FLAG_MORE_PROCESSING
Definition: cdstruc.h:1214
_In_ PIRP Irp
Definition: csq.h:116
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CDFS_NTC_IRP_CONTEXT
Definition: nodetype.h:34
#define SafeNodeType(Ptr)
Definition: nodetype.h:54
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
#define FlagOn(_F, _SF)
Definition: ext2fs.h:179
#define _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
Status
Definition: gdiplustypes.h:25
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
PIRP NTAPI IoGetTopLevelIrp(VOID)
Definition: irp.c:1843
#define STATUS_CANT_WAIT
Definition: ntstatus.h:452
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:159
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:34
#define _SEH2_GetExceptionInformation()
Definition: pseh2_64.h:158
#define IRP_MJ_DIRECTORY_CONTROL
Definition: rdpdr.c:51
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
#define IRP_MJ_READ
Definition: rdpdr.c:46
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
#define IRP_MJ_QUERY_VOLUME_INFORMATION
Definition: rdpdr.c:50
#define IRP_MJ_LOCK_CONTROL
Definition: rdpdr.c:53
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
#define IRP_MJ_SET_INFORMATION
Definition: rdpdr.c:49
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
#define IRP_MJ_QUERY_INFORMATION
Definition: rdpdr.c:48
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:170
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2793
#define IRP_MN_COMPLETE
Definition: iotypes.h:4420
#define IRP_MJ_FILE_SYSTEM_CONTROL
#define IRP_MJ_SHUTDOWN
#define IRP_MJ_CLEANUP
#define NT_ASSERT
Definition: rtlfuncs.h:3310

◆ _IRQL_requires_max_() [2/2]

_Must_inspect_result_ _IRQL_requires_max_ ( PASSIVE_LEVEL  )

Queries information details about a security descriptor.

Computes the quota size of a security descriptor.

Assigns a security descriptor for a new object.

An extended function that assigns a security descriptor for a new object.

Frees a security descriptor.

An extended function that sets new information data to a security descriptor.

Modifies some information data about a security descriptor.

Parameters
[in]SecurityInformationSecurity information details to be queried from a security descriptor.
[out]SecurityDescriptorThe returned security descriptor with security information data.
[in,out]LengthThe returned length of a security descriptor.
[in,out]ObjectsSecurityDescriptorThe returned object security descriptor.
Returns
Returns STATUS_SUCCESS if the operations have been completed successfully and that the specific information about the security descriptor has been queried. STATUS_BUFFER_TOO_SMALL is returned if the buffer size is too small to contain the queried info about the security descriptor.
Parameters
[in]ObjectIf specified, the function will use this arbitrary object that points to an object security descriptor.
[in]SecurityInformationSecurity information details to be set.
[in]SecurityDescriptorA security descriptor where its info is to be changed.
[in,out]ObjectsSecurityDescriptorThe returned pointer to security descriptor objects.
[in]PoolTypePool type for the new security descriptor to allocate.
[in]GenericMappingThe generic mapping of access rights masks.
Returns
See SeSetSecurityDescriptorInfoEx.
Parameters
[in]ObjectIf specified, the function will use this arbitrary object that points to an object security descriptor.
[in]SecurityInformationSecurity information details to be set.
[in]SecurityDescriptorA security descriptor where its info is to be changed.
[in,out]ObjectsSecurityDescriptorThe returned pointer to security descriptor objects.
[in]AutoInheritFlagsFlags bitmask inheritation, influencing how the security descriptor can be inherited and if it can be in the first place.
[in]PoolTypePool type for the new security descriptor to allocate.
[in]GenericMappingThe generic mapping of access rights masks.
Returns
Returns STATUS_SUCCESS if the operations have been completed without problems and that new info has been set to the security descriptor. STATUS_NO_SECURITY_ON_OBJECT is returned if the object does not have a security descriptor. STATUS_INSUFFICIENT_RESOURCES is returned if memory pool allocation for the new security descriptor with new info set has failed.
Parameters
[in]SecurityDescriptorA security descriptor to be freed from memory.
Returns
Returns STATUS_SUCCESS.
Parameters
[in]_ParentDescriptorA security descriptor of the parent object that is being created.
[in]_ExplicitDescriptorAn explicit security descriptor that is applied to a new object.
[out]NewDescriptorThe new allocated security descriptor.
[in]ObjectTypeThe type of the new object.
[in]IsDirectoryObjectSet this to TRUE if the newly created object is a directory object, otherwise set this to FALSE.
[in]AutoInheritFlagsAutomatic inheritance flags that influence how access control entries within ACLs from security descriptors are inherited.
[in]SubjectContextSecurity subject context of the new object.
[in]GenericMappingGeneric mapping of access mask rights.
[in]PoolTypeThis parameter is unused.
Returns
Returns STATUS_SUCCESS if the operations have been completed successfully and that the security descriptor has been assigned to the new object. STATUS_NO_TOKEN is returned if the caller hasn't supplied a valid argument to a security subject context. STATUS_INVALID_OWNER is returned if the caller hasn't supplied a parent descriptor that belongs to the main user (owner). STATUS_INVALID_PRIMARY_GROUP is returned by the same reason as with the previous NTSTATUS code. The two NTSTATUS codes are returned if the calling thread stated that the owner and/or group is defaulted to the parent descriptor (SEF_DEFAULT_OWNER_FROM_PARENT and/or SEF_DEFAULT_GROUP_FROM_PARENT respectively). STATUS_INSUFFICIENT_RESOURCES is returned if memory pool allocation for the descriptor buffer has failed. A failure NTSTATUS is returned otherwise.
Parameters
[in]ParentDescriptorA security descriptor of the parent object that is being created.
[in]ExplicitDescriptorAn explicit security descriptor that is applied to a new object.
[out]NewDescriptorThe new allocated security descriptor.
[in]IsDirectoryObjectSet this to TRUE if the newly created object is a directory object, otherwise set this to FALSE.
[in]SubjectContextSecurity subject context of the new object.
[in]GenericMappingGeneric mapping of access mask rights.
[in]PoolTypeThis parameter is unused.
Returns
See SeAssignSecurityEx.
Parameters
[in]SecurityDescriptorA security descriptor.
[out]QuotaInfoSizeThe returned quota size of the given security descriptor to the caller. The function may return 0 to this parameter if the descriptor doesn't have a group or a discretionary access control list (DACL) even.
Returns
Returns STATUS_SUCCESS if the quota size of a security descriptor has been computed successfully. STATUS_UNKNOWN_REVISION is returned if the security descriptor has an invalid revision.

Definition at line 517 of file wdfwmi.h.

524{
525 return ((PFN_WDFWMIINSTANCEREGISTER) WdfFunctions[WdfWmiInstanceRegisterTableIndex])(WdfDriverGlobals, WmiInstance);
526}
@ WdfWmiInstanceRegisterTableIndex
Definition: wdffuncenum.h:399
_Must_inspect_result_ _In_ WDFWMIINSTANCE WmiInstance
Definition: wdfwmi.h:514

◆ 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}
Definition: bufpool.h:45
unsigned short USHORT
Definition: pedump.c:61
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define WDF_PTR_ADD_OFFSET(_ptr, _offset)
Definition: wdfcore.h:144
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID _Out_ PULONG RequiredSize
Definition: wdfdevice.h:4439
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3771
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433

◆ 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}
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
Definition: wdfchildlist.h:476
struct _WDF_WMI_INSTANCE_CONFIG WDF_WMI_INSTANCE_CONFIG

◆ 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}

◆ 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:762
struct _WDF_WMI_PROVIDER_CONFIG WDF_WMI_PROVIDER_CONFIG