ReactOS  0.4.14-dev-376-gaedba84
pnp.c File Reference
#include "btrfs_drv.h"
Include dependency graph for pnp.c:

Go to the source code of this file.

Classes

struct  pnp_stripe
 
struct  pnp_context
 
struct  device_usage_context
 

Functions

 _Function_class_ (IO_COMPLETION_ROUTINE)
 
static NTSTATUS send_disks_pnp_message (device_extension *Vcb, UCHAR minor)
 
static NTSTATUS pnp_cancel_remove_device (PDEVICE_OBJECT DeviceObject)
 
NTSTATUS pnp_query_remove_device (PDEVICE_OBJECT DeviceObject, PIRP Irp)
 
static NTSTATUS pnp_remove_device (PDEVICE_OBJECT DeviceObject)
 
NTSTATUS pnp_surprise_removal (PDEVICE_OBJECT DeviceObject, PIRP Irp)
 
static NTSTATUS bus_query_capabilities (PIRP Irp)
 
static NTSTATUS bus_query_device_relations (PIRP Irp)
 
static NTSTATUS bus_query_hardware_ids (PIRP Irp)
 
static NTSTATUS bus_pnp (bus_device_extension *bde, PIRP Irp)
 
static NTSTATUS pdo_query_device_id (pdo_device_extension *pdode, PIRP Irp)
 
static NTSTATUS pdo_query_hardware_ids (PIRP Irp)
 
static NTSTATUS pdo_query_id (pdo_device_extension *pdode, PIRP Irp)
 
static NTSTATUS pdo_device_usage_notification (pdo_device_extension *pdode, PIRP Irp)
 
static NTSTATUS pdo_query_device_relations (PDEVICE_OBJECT pdo, PIRP Irp)
 
static NTSTATUS pdo_pnp (PDEVICE_OBJECT pdo, PIRP Irp)
 
static NTSTATUS pnp_device_usage_notification (PDEVICE_OBJECT DeviceObject, PIRP Irp)
 
 _Dispatch_type_ (IRP_MJ_PNP)
 

Variables

ERESOURCE pdo_list_lock
 
LIST_ENTRY pdo_list
 

Function Documentation

◆ _Dispatch_type_()

_Dispatch_type_ ( IRP_MJ_PNP  )

Definition at line 620 of file pnp.c.

622  {
626  bool top_level;
627 
629 
630  top_level = is_top_level(Irp);
631 
632  if (Vcb && Vcb->type == VCB_TYPE_BUS) {
634  goto exit;
635  } else if (Vcb && Vcb->type == VCB_TYPE_VOLUME) {
639  goto exit;
640  } else if (Vcb && Vcb->type == VCB_TYPE_PDO) {
642  goto end;
643  } else if (!Vcb || Vcb->type != VCB_TYPE_FS) {
645  goto end;
646  }
647 
649 
650  switch (IrpSp->MinorFunction) {
653  break;
654 
657  break;
658 
661  break;
662 
665  break;
666 
669  goto exit;
670 
671  default:
672  TRACE("passing minor function 0x%x on\n", IrpSp->MinorFunction);
673 
675  Status = IoCallDriver(Vcb->Vpb->RealDevice, Irp);
676  goto exit;
677  }
678 
679 end:
680  Irp->IoStatus.Status = Status;
681 
683 
684 exit:
685  TRACE("returning %08x\n", Status);
686 
687  if (top_level)
689 
691 
692  return Status;
693 }
NTSTATUS pnp_query_remove_device(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: pnp.c:181
#define IRP_MN_CANCEL_REMOVE_DEVICE
#define VCB_TYPE_PDO
Definition: btrfs_drv.h:667
#define IRP_MN_REMOVE_DEVICE
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
_In_ PIRP Irp
Definition: csq.h:116
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
#define VCB_TYPE_FS
Definition: btrfs_drv.h:664
GLuint GLuint end
Definition: gl.h:1545
bool is_top_level(_In_ PIRP Irp)
Definition: btrfs.c:276
#define VCB_TYPE_BUS
Definition: btrfs_drv.h:668
static NTSTATUS pnp_remove_device(PDEVICE_OBJECT DeviceObject)
Definition: pnp.c:221
#define IRP_MN_QUERY_REMOVE_DEVICE
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
#define IoCompleteRequest
Definition: irp.c:1240
#define IRP_MN_SURPRISE_REMOVAL
Definition: ntifs_ex.h:408
#define TRACE(s)
Definition: solgame.cpp:4
static NTSTATUS bus_pnp(bus_device_extension *bde, PIRP Irp)
Definition: pnp.c:360
#define VCB_TYPE_VOLUME
Definition: btrfs_drv.h:666
#define Vcb
Definition: cdprocs.h:1425
VOID NTAPI IoSetTopLevelIrp(IN PIRP Irp)
Definition: irp.c:2000
static NTSTATUS pnp_cancel_remove_device(PDEVICE_OBJECT DeviceObject)
Definition: pnp.c:155
PDEVICE_OBJECT attached_device
Definition: btrfs_drv.h:855
Status
Definition: gdiplustypes.h:24
static NTSTATUS pdo_pnp(PDEVICE_OBJECT pdo, PIRP Irp)
Definition: pnp.c:572
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
static NTSTATUS pnp_device_usage_notification(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: pnp.c:599
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4157
NTSTATUS NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1218
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
#define IO_NO_INCREMENT
Definition: iotypes.h:566
#define IRP_MN_DEVICE_USAGE_NOTIFICATION
void exit(int exitcode)
Definition: _exit.c:33
NTSTATUS pnp_surprise_removal(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: pnp.c:254

◆ _Function_class_()

_Function_class_ ( IO_COMPLETION_ROUTINE  )

Definition at line 40 of file pnp.c.

41  {
42  pnp_stripe* stripe = conptr;
43  pnp_context* context = (pnp_context*)stripe->context;
44 
46 
47  stripe->Status = Irp->IoStatus.Status;
48 
50 
51  if (context->left == 0)
52  KeSetEvent(&context->Event, 0, false);
53 
55 }
#define STATUS_MORE_PROCESSING_REQUIRED
Definition: shellext.h:68
Definition: http.c:6587
_In_ PIRP Irp
Definition: csq.h:116
Definition: write.c:111
LONG NTAPI KeSetEvent(IN PKEVENT Event, IN KPRIORITY Increment, IN BOOLEAN Wait)
Definition: eventobj.c:159
#define UNUSED(x)
Definition: btrfs_drv.h:86
Definition: pnp.c:22
#define InterlockedDecrement
Definition: armddk.h:52
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560

◆ bus_pnp()

static NTSTATUS bus_pnp ( bus_device_extension bde,
PIRP  Irp 
)
static

Definition at line 360 of file pnp.c.

360  {
361  NTSTATUS Status = Irp->IoStatus.Status;
363  bool handled = false;
364 
365  switch (IrpSp->MinorFunction) {
368  handled = true;
369  break;
370 
372  if (IrpSp->Parameters.QueryDeviceRelations.Type != BusRelations || no_pnp)
373  break;
374 
376  handled = true;
377  break;
378 
379  case IRP_MN_QUERY_ID:
380  if (IrpSp->Parameters.QueryId.IdType != BusQueryHardwareIDs)
381  break;
382 
384  handled = true;
385  break;
386  }
387 
388  if (!NT_SUCCESS(Status) && handled) {
389  Irp->IoStatus.Status = Status;
391 
392  return Status;
393  }
394 
395  Irp->IoStatus.Status = Status;
396 
398  return IoCallDriver(bde->attached_device, Irp);
399 }
#define IRP_MN_QUERY_ID
_In_ PIRP Irp
Definition: csq.h:116
LONG NTSTATUS
Definition: precomp.h:26
uint32_t no_pnp
Definition: btrfs.c:90
#define IoCompleteRequest
Definition: irp.c:1240
static NTSTATUS bus_query_capabilities(PIRP Irp)
Definition: pnp.c:276
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
static NTSTATUS bus_query_device_relations(PIRP Irp)
Definition: pnp.c:286
Status
Definition: gdiplustypes.h:24
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
PDEVICE_OBJECT attached_device
Definition: btrfs_drv.h:825
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4157
NTSTATUS NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1218
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
#define IO_NO_INCREMENT
Definition: iotypes.h:566
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2772
static NTSTATUS bus_query_hardware_ids(PIRP Irp)
Definition: pnp.c:342
#define IRP_MN_QUERY_CAPABILITIES

Referenced by _Dispatch_type_().

◆ bus_query_capabilities()

static NTSTATUS bus_query_capabilities ( PIRP  Irp)
static

Definition at line 276 of file pnp.c.

276  {
278  PDEVICE_CAPABILITIES dc = IrpSp->Parameters.DeviceCapabilities.Capabilities;
279 
280  dc->UniqueID = true;
281  dc->SilentInstall = true;
282 
283  return STATUS_SUCCESS;
284 }
_In_ PIRP Irp
Definition: csq.h:116
HDC dc
Definition: cylfrac.c:34
* PDEVICE_CAPABILITIES
Definition: iotypes.h:928
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4157
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2772
return STATUS_SUCCESS
Definition: btrfs.c:2938

Referenced by bus_pnp().

◆ bus_query_device_relations()

static NTSTATUS bus_query_device_relations ( PIRP  Irp)
static

Definition at line 286 of file pnp.c.

286  {
288  ULONG num_children;
289  LIST_ENTRY* le;
290  ULONG drsize, i;
291  DEVICE_RELATIONS* dr;
292 
294 
295  num_children = 0;
296 
297  le = pdo_list.Flink;
298  while (le != &pdo_list) {
300 
301  if (!pdode->dont_report)
302  num_children++;
303 
304  le = le->Flink;
305  }
306 
307  drsize = offsetof(DEVICE_RELATIONS, Objects[0]) + (num_children * sizeof(PDEVICE_OBJECT));
309 
310  if (!dr) {
311  ERR("out of memory\n");
313  goto end;
314  }
315 
316  dr->Count = num_children;
317 
318  i = 0;
319  le = pdo_list.Flink;
320  while (le != &pdo_list) {
322 
323  if (!pdode->dont_report) {
324  ObReferenceObject(pdode->pdo);
325  dr->Objects[i] = pdode->pdo;
326  i++;
327  }
328 
329  le = le->Flink;
330  }
331 
332  Irp->IoStatus.Information = (ULONG_PTR)dr;
333 
335 
336 end:
338 
339  return Status;
340 }
ERESOURCE pdo_list_lock
Definition: btrfs.c:106
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_In_ PIRP Irp
Definition: csq.h:116
struct _DEVICE_OBJECT * PDEVICE_OBJECT
PDEVICE_OBJECT Objects[1]
Definition: iotypes.h:2055
LONG NTSTATUS
Definition: precomp.h:26
GLuint GLuint end
Definition: gl.h:1545
PDEVICE_OBJECT pdo
Definition: btrfs_drv.h:865
#define ALLOC_TAG
Definition: btrfs_drv.h:91
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define offsetof(TYPE, MEMBER)
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
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
Definition: typedefs.h:117
Status
Definition: gdiplustypes.h:24
#define ERR(fmt,...)
Definition: debug.h:109
Definition: list.h:27
BOOLEAN NTAPI ExAcquireResourceSharedLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:885
LIST_ENTRY pdo_list
Definition: btrfs.c:107
#define ObReferenceObject
Definition: obfuncs.h:204
unsigned int ULONG
Definition: retypes.h:1
#define ULONG_PTR
Definition: config.h:101
return STATUS_SUCCESS
Definition: btrfs.c:2938

Referenced by bus_pnp().

◆ bus_query_hardware_ids()

static NTSTATUS bus_query_hardware_ids ( PIRP  Irp)
static

Definition at line 342 of file pnp.c.

342  {
343  WCHAR* out;
344 
345  static const WCHAR ids[] = L"ROOT\\btrfs\0";
346 
348  if (!out) {
349  ERR("out of memory\n");
351  }
352 
353  RtlCopyMemory(out, ids, sizeof(ids));
354 
355  Irp->IoStatus.Information = (ULONG_PTR)out;
356 
357  return STATUS_SUCCESS;
358 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_In_ PIRP Irp
Definition: csq.h:116
#define ALLOC_TAG
Definition: btrfs_drv.h:91
GLuint * ids
Definition: glext.h:5907
__wchar_t WCHAR
Definition: xmlstorage.h:180
static FILE * out
Definition: regtests2xml.c:44
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
static const WCHAR L[]
Definition: oid.c:1250
#define ERR(fmt,...)
Definition: debug.h:109
#define ULONG_PTR
Definition: config.h:101
return STATUS_SUCCESS
Definition: btrfs.c:2938

Referenced by bus_pnp().

◆ pdo_device_usage_notification()

static NTSTATUS pdo_device_usage_notification ( pdo_device_extension pdode,
PIRP  Irp 
)
static

Definition at line 490 of file pnp.c.

490  {
492  LIST_ENTRY* le;
493 
494  TRACE("(%p, %p)\n", pdode, Irp);
495 
497 
498  le = pdode->children.Flink;
499 
500  while (le != &pdode->children) {
502 
503  if (vc->devobj) {
504  PIRP Irp2;
505  PIO_STACK_LOCATION IrpSp2;
507 
508  Irp2 = IoAllocateIrp(vc->devobj->StackSize, false);
509  if (!Irp2) {
510  ERR("out of memory\n");
513  }
514 
515  IrpSp2 = IoGetNextIrpStackLocation(Irp2);
516  IrpSp2->MajorFunction = IRP_MJ_PNP;
518  IrpSp2->Parameters.UsageNotification = IrpSp->Parameters.UsageNotification;
519  IrpSp2->FileObject = vc->fileobj;
520 
521  context.iosb.Status = STATUS_SUCCESS;
522  Irp2->UserIosb = &context.iosb;
523 
525  Irp2->UserEvent = &context.Event;
526 
527  IoSetCompletionRoutine(Irp2, device_usage_completion, &context, true, true, true);
528 
529  context.Status = IoCallDriver(vc->devobj, Irp2);
530 
531  if (context.Status == STATUS_PENDING)
533 
534  if (!NT_SUCCESS(context.Status)) {
535  ERR("IoCallDriver returned %08x\n", context.Status);
537  return context.Status;
538  }
539  }
540 
541  le = le->Flink;
542  }
543 
545 
546  return STATUS_SUCCESS;
547 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
Definition: http.c:6587
_In_ PIRP Irp
Definition: csq.h:116
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
NTSTATUS NTAPI KeWaitForSingleObject(IN PVOID Object, IN KWAIT_REASON WaitReason, IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Timeout OPTIONAL)
Definition: wait.c:416
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
Definition: irp.cpp:515
smooth NULL
Definition: ftsmooth.c:416
PDEVICE_OBJECT devobj
Definition: btrfs_drv.h:833
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
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
#define TRACE(s)
Definition: solgame.cpp:4
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_PENDING
Definition: ntstatus.h:82
ERESOURCE child_lock
Definition: btrfs_drv.h:871
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817
PFILE_OBJECT fileobj
Definition: btrfs_drv.h:834
Definition: typedefs.h:117
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2647
#define ERR(fmt,...)
Definition: debug.h:109
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
PFILE_OBJECT FileObject
Definition: iotypes.h:2813
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4157
Definition: list.h:27
NTSTATUS NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1218
BOOLEAN NTAPI ExAcquireResourceSharedLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:885
PIRP NTAPI IoAllocateIrp(IN CCHAR StackSize, IN BOOLEAN ChargeQuota)
Definition: irp.c:615
#define IRP_MN_DEVICE_USAGE_NOTIFICATION
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2772
LIST_ENTRY children
Definition: btrfs_drv.h:872
return STATUS_SUCCESS
Definition: btrfs.c:2938

Referenced by pdo_pnp().

◆ pdo_pnp()

static NTSTATUS pdo_pnp ( PDEVICE_OBJECT  pdo,
PIRP  Irp 
)
static

Definition at line 572 of file pnp.c.

572  {
575 
576  switch (IrpSp->MinorFunction) {
577  case IRP_MN_QUERY_ID:
578  return pdo_query_id(pdode, Irp);
579 
580  case IRP_MN_START_DEVICE:
584  return STATUS_SUCCESS;
585 
587  return STATUS_UNSUCCESSFUL;
588 
590  return pdo_device_usage_notification(pdode, Irp);
591 
593  return pdo_query_device_relations(pdo, Irp);
594  }
595 
596  return Irp->IoStatus.Status;
597 }
#define IRP_MN_CANCEL_REMOVE_DEVICE
#define IRP_MN_REMOVE_DEVICE
#define IRP_MN_QUERY_ID
_In_ PIRP Irp
Definition: csq.h:116
static NTSTATUS pdo_device_usage_notification(pdo_device_extension *pdode, PIRP Irp)
Definition: pnp.c:490
#define IRP_MN_QUERY_REMOVE_DEVICE
PVOID DeviceExtension
Definition: env_spec_w32.h:418
static NTSTATUS pdo_query_device_relations(PDEVICE_OBJECT pdo, PIRP Irp)
Definition: pnp.c:549
#define IRP_MN_SURPRISE_REMOVAL
Definition: ntifs_ex.h:408
#define IRP_MN_START_DEVICE
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4157
#define IRP_MN_QUERY_DEVICE_RELATIONS
static NTSTATUS pdo_query_id(pdo_device_extension *pdode, PIRP Irp)
Definition: pnp.c:452
#define IRP_MN_DEVICE_USAGE_NOTIFICATION
return STATUS_SUCCESS
Definition: btrfs.c:2938

Referenced by _Dispatch_type_().

◆ pdo_query_device_id()

static NTSTATUS pdo_query_device_id ( pdo_device_extension pdode,
PIRP  Irp 
)
static

Definition at line 401 of file pnp.c.

401  {
402  WCHAR name[100], *noff, *out;
403  int i;
404 
405  static const WCHAR pref[] = L"Btrfs\\";
406 
407  RtlCopyMemory(name, pref, sizeof(pref) - sizeof(WCHAR));
408 
409  noff = &name[(sizeof(pref) / sizeof(WCHAR)) - 1];
410  for (i = 0; i < 16; i++) {
411  *noff = hex_digit(pdode->uuid.uuid[i] >> 4); noff++;
412  *noff = hex_digit(pdode->uuid.uuid[i] & 0xf); noff++;
413 
414  if (i == 3 || i == 5 || i == 7 || i == 9) {
415  *noff = '-';
416  noff++;
417  }
418  }
419  *noff = 0;
420 
422  if (!out) {
423  ERR("out of memory\n");
425  }
426 
427  RtlCopyMemory(out, name, (wcslen(name) + 1) * sizeof(WCHAR));
428 
429  Irp->IoStatus.Information = (ULONG_PTR)out;
430 
431  return STATUS_SUCCESS;
432 }
#define hex_digit(c)
Definition: btrfs_drv.h:1725
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_In_ PIRP Irp
Definition: csq.h:116
#define ALLOC_TAG
Definition: btrfs_drv.h:91
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
__wchar_t WCHAR
Definition: xmlstorage.h:180
static FILE * out
Definition: regtests2xml.c:44
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
static const WCHAR L[]
Definition: oid.c:1250
#define ERR(fmt,...)
Definition: debug.h:109
uint8_t uuid[16]
Definition: btrfs.h:124
Definition: name.c:36
#define ULONG_PTR
Definition: config.h:101
return STATUS_SUCCESS
Definition: btrfs.c:2938
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by pdo_query_id().

◆ pdo_query_device_relations()

static NTSTATUS pdo_query_device_relations ( PDEVICE_OBJECT  pdo,
PIRP  Irp 
)
static

Definition at line 549 of file pnp.c.

549  {
551  PDEVICE_RELATIONS device_relations;
552 
553  if (IrpSp->Parameters.QueryDeviceRelations.Type != TargetDeviceRelation)
554  return Irp->IoStatus.Status;
555 
556  device_relations = ExAllocatePoolWithTag(PagedPool, sizeof(DEVICE_RELATIONS), ALLOC_TAG);
557  if (!device_relations) {
558  ERR("out of memory\n");
560  }
561 
562  device_relations->Count = 1;
563  device_relations->Objects[0] = pdo;
564 
565  ObReferenceObject(pdo);
566 
567  Irp->IoStatus.Information = (ULONG_PTR)device_relations;
568 
569  return STATUS_SUCCESS;
570 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_In_ PIRP Irp
Definition: csq.h:116
PDEVICE_OBJECT Objects[1]
Definition: iotypes.h:2055
#define ALLOC_TAG
Definition: btrfs_drv.h:91
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define ERR(fmt,...)
Definition: debug.h:109
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4157
#define ObReferenceObject
Definition: obfuncs.h:204
#define ULONG_PTR
Definition: config.h:101
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2772
return STATUS_SUCCESS
Definition: btrfs.c:2938

Referenced by pdo_pnp().

◆ pdo_query_hardware_ids()

static NTSTATUS pdo_query_hardware_ids ( PIRP  Irp)
static

Definition at line 434 of file pnp.c.

434  {
435  WCHAR* out;
436 
437  static const WCHAR ids[] = L"BtrfsVolume\0";
438 
440  if (!out) {
441  ERR("out of memory\n");
443  }
444 
445  RtlCopyMemory(out, ids, sizeof(ids));
446 
447  Irp->IoStatus.Information = (ULONG_PTR)out;
448 
449  return STATUS_SUCCESS;
450 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_In_ PIRP Irp
Definition: csq.h:116
#define ALLOC_TAG
Definition: btrfs_drv.h:91
GLuint * ids
Definition: glext.h:5907
__wchar_t WCHAR
Definition: xmlstorage.h:180
static FILE * out
Definition: regtests2xml.c:44
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
static const WCHAR L[]
Definition: oid.c:1250
#define ERR(fmt,...)
Definition: debug.h:109
#define ULONG_PTR
Definition: config.h:101
return STATUS_SUCCESS
Definition: btrfs.c:2938

Referenced by pdo_query_id().

◆ pdo_query_id()

static NTSTATUS pdo_query_id ( pdo_device_extension pdode,
PIRP  Irp 
)
static

Definition at line 452 of file pnp.c.

452  {
454 
455  switch (IrpSp->Parameters.QueryId.IdType) {
456  case BusQueryDeviceID:
457  TRACE("BusQueryDeviceID\n");
458  return pdo_query_device_id(pdode, Irp);
459 
460  case BusQueryHardwareIDs:
461  TRACE("BusQueryHardwareIDs\n");
462  return pdo_query_hardware_ids(Irp);
463 
464  default:
465  break;
466  }
467 
468  return Irp->IoStatus.Status;
469 }
static NTSTATUS pdo_query_hardware_ids(PIRP Irp)
Definition: pnp.c:434
_In_ PIRP Irp
Definition: csq.h:116
#define TRACE(s)
Definition: solgame.cpp:4
static NTSTATUS pdo_query_device_id(pdo_device_extension *pdode, PIRP Irp)
Definition: pnp.c:401
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4157
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2772

Referenced by pdo_pnp().

◆ pnp_cancel_remove_device()

static NTSTATUS pnp_cancel_remove_device ( PDEVICE_OBJECT  DeviceObject)
static

Definition at line 155 of file pnp.c.

155  {
158 
159  ExAcquireResourceSharedLite(&Vcb->tree_lock, true);
160 
161  ExAcquireResourceExclusiveLite(&Vcb->fileref_lock, true);
162 
163  if (Vcb->root_fileref && Vcb->root_fileref->fcb && (Vcb->root_fileref->open_count > 0 || has_open_children(Vcb->root_fileref))) {
165  goto end;
166  }
167 
169  if (!NT_SUCCESS(Status)) {
170  WARN("send_disks_pnp_message returned %08x\n", Status);
171  goto end;
172  }
173 
174 end:
175  ExReleaseResourceLite(&Vcb->fileref_lock);
176  ExReleaseResourceLite(&Vcb->tree_lock);
177 
178  return STATUS_SUCCESS;
179 }
#define IRP_MN_CANCEL_REMOVE_DEVICE
#define WARN(fmt,...)
Definition: debug.h:111
LONG NTSTATUS
Definition: precomp.h:26
GLuint GLuint end
Definition: gl.h:1545
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:770
PVOID DeviceExtension
Definition: env_spec_w32.h:418
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define Vcb
Definition: cdprocs.h:1425
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817
bool has_open_children(file_ref *fileref)
Definition: fileinfo.c:442
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
static NTSTATUS send_disks_pnp_message(device_extension *Vcb, UCHAR minor)
Definition: pnp.c:57
BOOLEAN NTAPI ExAcquireResourceSharedLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:885
return STATUS_SUCCESS
Definition: btrfs.c:2938

Referenced by _Dispatch_type_().

◆ pnp_device_usage_notification()

static NTSTATUS pnp_device_usage_notification ( PDEVICE_OBJECT  DeviceObject,
PIRP  Irp 
)
static

Definition at line 599 of file pnp.c.

599  {
602 
603  if (IrpSp->Parameters.UsageNotification.InPath) {
604  switch (IrpSp->Parameters.UsageNotification.Type) {
608  IoAdjustPagingPathCount(&Vcb->page_file_count, IrpSp->Parameters.UsageNotification.InPath);
609  break;
610 
611  default:
612  break;
613  }
614  }
615 
617  return IoCallDriver(Vcb->Vpb->RealDevice, Irp);
618 }
_In_ PIRP Irp
Definition: csq.h:116
PVOID DeviceExtension
Definition: env_spec_w32.h:418
#define IoAdjustPagingPathCount(_Count, _Increment)
#define Vcb
Definition: cdprocs.h:1425
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4157
NTSTATUS NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1218
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2772

Referenced by _Dispatch_type_().

◆ pnp_query_remove_device()

NTSTATUS pnp_query_remove_device ( PDEVICE_OBJECT  DeviceObject,
PIRP  Irp 
)

Definition at line 181 of file pnp.c.

181  {
184 
185  ExAcquireResourceExclusiveLite(&Vcb->tree_lock, true);
186 
187  if (Vcb->root_fileref && Vcb->root_fileref->fcb && (Vcb->root_fileref->open_count > 0 || has_open_children(Vcb->root_fileref))) {
188  ExReleaseResourceLite(&Vcb->tree_lock);
189  return STATUS_ACCESS_DENIED;
190  }
191 
193  if (!NT_SUCCESS(Status)) {
194  WARN("send_disks_pnp_message returned %08x\n", Status);
195  ExReleaseResourceLite(&Vcb->tree_lock);
196  return Status;
197  }
198 
199  Vcb->removing = true;
200 
201  if (Vcb->need_write && !Vcb->readonly) {
202  Status = do_write(Vcb, Irp);
203 
204  free_trees(Vcb);
205 
206  if (!NT_SUCCESS(Status)) {
207  ERR("do_write returned %08x\n", Status);
208  ExReleaseResourceLite(&Vcb->tree_lock);
209  return Status;
210  }
211  }
212 
213  ExReleaseResourceLite(&Vcb->tree_lock);
214 
215  if (Vcb->open_files == 0)
216  uninit(Vcb);
217 
218  return STATUS_SUCCESS;
219 }
_In_ PIRP Irp
Definition: csq.h:116
NTSTATUS do_write(device_extension *Vcb, PIRP Irp)
Definition: flushthread.c:7667
#define WARN(fmt,...)
Definition: debug.h:111
LONG NTSTATUS
Definition: precomp.h:26
void uninit(_In_ device_extension *Vcb)
Definition: btrfs.c:1918
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:770
#define IRP_MN_QUERY_REMOVE_DEVICE
PVOID DeviceExtension
Definition: env_spec_w32.h:418
void free_trees(device_extension *Vcb)
Definition: treefuncs.c:793
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define Vcb
Definition: cdprocs.h:1425
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817
bool has_open_children(file_ref *fileref)
Definition: fileinfo.c:442
Status
Definition: gdiplustypes.h:24
#define ERR(fmt,...)
Definition: debug.h:109
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
static NTSTATUS send_disks_pnp_message(device_extension *Vcb, UCHAR minor)
Definition: pnp.c:57
return STATUS_SUCCESS
Definition: btrfs.c:2938

Referenced by _Dispatch_type_(), and _Function_class_().

◆ pnp_remove_device()

static NTSTATUS pnp_remove_device ( PDEVICE_OBJECT  DeviceObject)
static

Definition at line 221 of file pnp.c.

221  {
224 
225  ExAcquireResourceSharedLite(&Vcb->tree_lock, true);
226 
228 
229  if (!NT_SUCCESS(Status))
230  WARN("send_disks_pnp_message returned %08x\n", Status);
231 
232  ExReleaseResourceLite(&Vcb->tree_lock);
233 
234  if (DeviceObject->Vpb->Flags & VPB_MOUNTED) {
236  if (!NT_SUCCESS(Status)) {
237  WARN("FsRtlNotifyVolumeEvent returned %08x\n", Status);
238  }
239 
240  if (Vcb->vde)
241  Vcb->vde->mounted_device = NULL;
242 
243  ExAcquireResourceExclusiveLite(&Vcb->tree_lock, true);
244  Vcb->removing = true;
245  ExReleaseResourceLite(&Vcb->tree_lock);
246 
247  if (Vcb->open_files == 0)
248  uninit(Vcb);
249  }
250 
251  return STATUS_SUCCESS;
252 }
#define FSRTL_VOLUME_DISMOUNT
Definition: ntifs_ex.h:439
#define IRP_MN_REMOVE_DEVICE
#define WARN(fmt,...)
Definition: debug.h:111
LONG NTSTATUS
Definition: precomp.h:26
void uninit(_In_ device_extension *Vcb)
Definition: btrfs.c:1918
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:770
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
NTSTATUS NTAPI FsRtlNotifyVolumeEvent(IN PFILE_OBJECT FileObject, IN ULONG EventCode)
Definition: pnp.c:38
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define Vcb
Definition: cdprocs.h:1425
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
static NTSTATUS send_disks_pnp_message(device_extension *Vcb, UCHAR minor)
Definition: pnp.c:57
BOOLEAN NTAPI ExAcquireResourceSharedLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:885
return STATUS_SUCCESS
Definition: btrfs.c:2938
#define VPB_MOUNTED
Definition: iotypes.h:1764

Referenced by _Dispatch_type_().

◆ pnp_surprise_removal()

NTSTATUS pnp_surprise_removal ( PDEVICE_OBJECT  DeviceObject,
PIRP  Irp 
)

Definition at line 254 of file pnp.c.

254  {
256 
257  TRACE("(%p, %p)\n", DeviceObject, Irp);
258 
259  if (DeviceObject->Vpb->Flags & VPB_MOUNTED) {
260  ExAcquireResourceExclusiveLite(&Vcb->tree_lock, true);
261 
262  if (Vcb->vde)
263  Vcb->vde->mounted_device = NULL;
264 
265  Vcb->removing = true;
266 
267  ExReleaseResourceLite(&Vcb->tree_lock);
268 
269  if (Vcb->open_files == 0)
270  uninit(Vcb);
271  }
272 
273  return STATUS_SUCCESS;
274 }
_In_ PIRP Irp
Definition: csq.h:116
void uninit(_In_ device_extension *Vcb)
Definition: btrfs.c:1918
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:770
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define Vcb
Definition: cdprocs.h:1425
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
return STATUS_SUCCESS
Definition: btrfs.c:2938
#define VPB_MOUNTED
Definition: iotypes.h:1764

Referenced by _Dispatch_type_(), and remove_volume_child().

◆ send_disks_pnp_message()

static NTSTATUS send_disks_pnp_message ( device_extension Vcb,
UCHAR  minor 
)
static

Definition at line 57 of file pnp.c.

57  {
59  ULONG num_devices, i;
61  LIST_ENTRY* le;
62 
65 
66  num_devices = (ULONG)min(0xffffffff, Vcb->superblock.num_devices);
67 
68  context.stripes = ExAllocatePoolWithTag(NonPagedPool, sizeof(pnp_stripe) * num_devices, ALLOC_TAG);
69  if (!context.stripes) {
70  ERR("out of memory\n");
72  }
73 
74  RtlZeroMemory(context.stripes, sizeof(pnp_stripe) * num_devices);
75 
76  i = 0;
77  le = Vcb->devices.Flink;
78 
79  while (le != &Vcb->devices) {
82 
83  if (dev->devobj) {
84  context.stripes[i].context = (struct pnp_context*)&context;
85 
86  context.stripes[i].Irp = IoAllocateIrp(dev->devobj->StackSize, false);
87 
88  if (!context.stripes[i].Irp) {
89  uint64_t j;
90 
91  ERR("IoAllocateIrp failed\n");
92 
93  for (j = 0; j < i; j++) {
94  if (context.stripes[j].dev->devobj) {
95  IoFreeIrp(context.stripes[j].Irp);
96  }
97  }
98  ExFreePool(context.stripes);
99 
101  }
102 
103  IrpSp = IoGetNextIrpStackLocation(context.stripes[i].Irp);
106  IrpSp->FileObject = dev->fileobj;
107 
108  context.stripes[i].Irp->UserIosb = &context.stripes[i].iosb;
109 
110  IoSetCompletionRoutine(context.stripes[i].Irp, pnp_completion, &context.stripes[i], true, true, true);
111 
112  context.stripes[i].Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
113  context.stripes[i].dev = dev;
114 
115  context.left++;
116  }
117 
118  le = le->Flink;
119  }
120 
121  if (context.left == 0) {
123  goto end;
124  }
125 
126  for (i = 0; i < num_devices; i++) {
127  if (context.stripes[i].Irp) {
128  IoCallDriver(context.stripes[i].dev->devobj, context.stripes[i].Irp);
129  }
130  }
131 
133 
135 
136  for (i = 0; i < num_devices; i++) {
137  if (context.stripes[i].Irp) {
138  if (context.stripes[i].Status != STATUS_SUCCESS)
139  Status = context.stripes[i].Status;
140  }
141  }
142 
143 end:
144  for (i = 0; i < num_devices; i++) {
145  if (context.stripes[i].Irp) {
146  IoFreeIrp(context.stripes[i].Irp);
147  }
148  }
149 
150  ExFreePool(context.stripes);
151 
152  return Status;
153 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
Definition: http.c:6587
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
LONG NTSTATUS
Definition: precomp.h:26
GLuint GLuint end
Definition: gl.h:1545
NTSTATUS NTAPI KeWaitForSingleObject(IN PVOID Object, IN KWAIT_REASON WaitReason, IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Timeout OPTIONAL)
Definition: wait.c:416
static int dev
Definition: mkdosfs.c:536
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
Definition: irp.cpp:515
#define ALLOC_TAG
Definition: btrfs_drv.h:91
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
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
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
Definition: pnp.c:22
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
#define Vcb
Definition: cdprocs.h:1425
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
Definition: typedefs.h:117
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2647
Status
Definition: gdiplustypes.h:24
#define ERR(fmt,...)
Definition: debug.h:109
PFILE_OBJECT FileObject
Definition: iotypes.h:2813
UINT64 uint64_t
Definition: types.h:77
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4157
#define min(a, b)
Definition: monoChain.cc:55
Definition: list.h:27
NTSTATUS NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1218
VOID NTAPI IoFreeIrp(IN PIRP Irp)
Definition: irp.c:1666
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
unsigned int ULONG
Definition: retypes.h:1
#define minor(rdev)
Definition: propsheet.cpp:917
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
PIRP NTAPI IoAllocateIrp(IN CCHAR StackSize, IN BOOLEAN ChargeQuota)
Definition: irp.c:615
return STATUS_SUCCESS
Definition: btrfs.c:2938
#define ExFreePool(addr)
Definition: env_spec_w32.h:352

Referenced by pnp_cancel_remove_device(), pnp_query_remove_device(), and pnp_remove_device().

Variable Documentation

◆ pdo_list

LIST_ENTRY pdo_list

Definition at line 107 of file btrfs.c.

Referenced by bus_query_device_relations().

◆ pdo_list_lock

ERESOURCE pdo_list_lock

Definition at line 106 of file btrfs.c.

Referenced by bus_query_device_relations().