ReactOS  0.4.15-dev-5142-g967f5b9
pnp.c
Go to the documentation of this file.
1 /* Copyright (c) Mark Harmstone 2016-17
2  *
3  * This file is part of WinBtrfs.
4  *
5  * WinBtrfs is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public Licence as published by
7  * the Free Software Foundation, either version 3 of the Licence, or
8  * (at your option) any later version.
9  *
10  * WinBtrfs is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public Licence for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public Licence
16  * along with WinBtrfs. If not, see <http://www.gnu.org/licenses/>. */
17 
18 #include "btrfs_drv.h"
19 
21 extern LIST_ENTRY pdo_list;
22 
24  device_extension* Vcb = DeviceObject->DeviceExtension;
26 
27  // We might be going away imminently - do a flush so we're not caught out
28 
29  ExAcquireResourceExclusiveLite(&Vcb->tree_lock, true);
30 
31  if (Vcb->root_fileref && Vcb->root_fileref->fcb && (Vcb->root_fileref->open_count > 0 || has_open_children(Vcb->root_fileref))) {
32  ExReleaseResourceLite(&Vcb->tree_lock);
33  return STATUS_ACCESS_DENIED;
34  }
35 
36  if (Vcb->need_write && !Vcb->readonly) {
37  Status = do_write(Vcb, Irp);
38 
39  free_trees(Vcb);
40 
41  if (!NT_SUCCESS(Status)) {
42  ERR("do_write returned %08lx\n", Status);
43  ExReleaseResourceLite(&Vcb->tree_lock);
44  return Status;
45  }
46  }
47 
48  ExReleaseResourceLite(&Vcb->tree_lock);
49 
50  return STATUS_UNSUCCESSFUL;
51 }
52 
54  device_extension* Vcb = DeviceObject->DeviceExtension;
56 
57  if (DeviceObject->Vpb->Flags & VPB_MOUNTED) {
59  if (!NT_SUCCESS(Status)) {
60  WARN("FsRtlNotifyVolumeEvent returned %08lx\n", Status);
61  }
62 
63  if (Vcb->vde)
64  Vcb->vde->mounted_device = NULL;
65 
66  ExAcquireResourceExclusiveLite(&Vcb->tree_lock, true);
67  Vcb->removing = true;
68  ExReleaseResourceLite(&Vcb->tree_lock);
69 
70  if (Vcb->open_files == 0)
71  uninit(Vcb);
72  }
73 
74  return STATUS_SUCCESS;
75 }
76 
78  device_extension* Vcb = DeviceObject->DeviceExtension;
79 
80  TRACE("(%p, %p)\n", DeviceObject, Irp);
81 
82  UNUSED(Irp);
83 
84  if (DeviceObject->Vpb->Flags & VPB_MOUNTED) {
85  ExAcquireResourceExclusiveLite(&Vcb->tree_lock, true);
86 
87  if (Vcb->vde)
88  Vcb->vde->mounted_device = NULL;
89 
90  Vcb->removing = true;
91 
92  ExReleaseResourceLite(&Vcb->tree_lock);
93 
94  if (Vcb->open_files == 0)
95  uninit(Vcb);
96  }
97 
98  return STATUS_SUCCESS;
99 }
100 
103  PDEVICE_CAPABILITIES dc = IrpSp->Parameters.DeviceCapabilities.Capabilities;
104 
105  dc->UniqueID = true;
106  dc->SilentInstall = true;
107 
108  return STATUS_SUCCESS;
109 }
110 
113  ULONG num_children;
114  LIST_ENTRY* le;
115  ULONG drsize, i;
116  DEVICE_RELATIONS* dr;
117 
119 
120  num_children = 0;
121 
122  le = pdo_list.Flink;
123  while (le != &pdo_list) {
125 
126  if (!pdode->dont_report)
127  num_children++;
128 
129  le = le->Flink;
130  }
131 
132  drsize = offsetof(DEVICE_RELATIONS, Objects[0]) + (num_children * sizeof(PDEVICE_OBJECT));
134 
135  if (!dr) {
136  ERR("out of memory\n");
138  goto end;
139  }
140 
141  dr->Count = num_children;
142 
143  i = 0;
144  le = pdo_list.Flink;
145  while (le != &pdo_list) {
147 
148  if (!pdode->dont_report) {
149  ObReferenceObject(pdode->pdo);
150  dr->Objects[i] = pdode->pdo;
151  i++;
152  }
153 
154  le = le->Flink;
155  }
156 
157  Irp->IoStatus.Information = (ULONG_PTR)dr;
158 
160 
161 end:
163 
164  return Status;
165 }
166 
168  WCHAR* out;
169 
170  static const WCHAR ids[] = L"ROOT\\btrfs\0";
171 
173  if (!out) {
174  ERR("out of memory\n");
176  }
177 
178  RtlCopyMemory(out, ids, sizeof(ids));
179 
180  Irp->IoStatus.Information = (ULONG_PTR)out;
181 
182  return STATUS_SUCCESS;
183 }
184 
186  NTSTATUS Status = Irp->IoStatus.Status;
188  bool handled = false;
189 
190  switch (IrpSp->MinorFunction) {
191  case IRP_MN_START_DEVICE:
196  handled = true;
197  break;
198 
201  handled = true;
202  break;
203 
206  handled = true;
207  break;
208 
210  if (IrpSp->Parameters.QueryDeviceRelations.Type != BusRelations || no_pnp)
211  break;
212 
214  handled = true;
215  break;
216 
217  case IRP_MN_QUERY_ID:
218  if (IrpSp->Parameters.QueryId.IdType != BusQueryHardwareIDs)
219  break;
220 
222  handled = true;
223  break;
224  }
225 
226  if (!NT_SUCCESS(Status) && handled) {
227  Irp->IoStatus.Status = Status;
229 
230  return Status;
231  }
232 
233  Irp->IoStatus.Status = Status;
234 
236  return IoCallDriver(bde->attached_device, Irp);
237 }
238 
240  WCHAR name[100], *noff, *out;
241  int i;
242 
243  static const WCHAR pref[] = L"Btrfs\\";
244 
245  RtlCopyMemory(name, pref, sizeof(pref) - sizeof(WCHAR));
246 
247  noff = &name[(sizeof(pref) / sizeof(WCHAR)) - 1];
248  for (i = 0; i < 16; i++) {
249  *noff = hex_digit(pdode->uuid.uuid[i] >> 4); noff++;
250  *noff = hex_digit(pdode->uuid.uuid[i] & 0xf); noff++;
251 
252  if (i == 3 || i == 5 || i == 7 || i == 9) {
253  *noff = '-';
254  noff++;
255  }
256  }
257  *noff = 0;
258 
260  if (!out) {
261  ERR("out of memory\n");
263  }
264 
265  RtlCopyMemory(out, name, (wcslen(name) + 1) * sizeof(WCHAR));
266 
267  Irp->IoStatus.Information = (ULONG_PTR)out;
268 
269  return STATUS_SUCCESS;
270 }
271 
273  WCHAR* out;
274 
275  static const WCHAR ids[] = L"BtrfsVolume\0";
276 
278  if (!out) {
279  ERR("out of memory\n");
281  }
282 
283  RtlCopyMemory(out, ids, sizeof(ids));
284 
285  Irp->IoStatus.Information = (ULONG_PTR)out;
286 
287  return STATUS_SUCCESS;
288 }
289 
292 
293  switch (IrpSp->Parameters.QueryId.IdType) {
294  case BusQueryDeviceID:
295  TRACE("BusQueryDeviceID\n");
296  return pdo_query_device_id(pdode, Irp);
297 
298  case BusQueryHardwareIDs:
299  TRACE("BusQueryHardwareIDs\n");
300  return pdo_query_hardware_ids(Irp);
301 
302  default:
303  break;
304  }
305 
306  return Irp->IoStatus.Status;
307 }
308 
309 typedef struct {
314 
315 _Function_class_(IO_COMPLETION_ROUTINE)
316 static NTSTATUS __stdcall device_usage_completion(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID conptr) {
317  device_usage_context* context = conptr;
318 
320 
321  context->Status = Irp->IoStatus.Status;
322 
323  KeSetEvent(&context->Event, 0, false);
324 
326 }
327 
330  LIST_ENTRY* le;
331 
332  TRACE("(%p, %p)\n", pdode, Irp);
333 
335 
336  le = pdode->children.Flink;
337 
338  while (le != &pdode->children) {
340 
341  if (vc->devobj) {
342  PIRP Irp2;
343  PIO_STACK_LOCATION IrpSp2;
345 
346  Irp2 = IoAllocateIrp(vc->devobj->StackSize, false);
347  if (!Irp2) {
348  ERR("out of memory\n");
351  }
352 
353  IrpSp2 = IoGetNextIrpStackLocation(Irp2);
354  IrpSp2->MajorFunction = IRP_MJ_PNP;
356  IrpSp2->Parameters.UsageNotification = IrpSp->Parameters.UsageNotification;
357  IrpSp2->FileObject = vc->fileobj;
358 
359  context.iosb.Status = STATUS_SUCCESS;
360  Irp2->UserIosb = &context.iosb;
361 
363  Irp2->UserEvent = &context.Event;
364 
365  IoSetCompletionRoutine(Irp2, device_usage_completion, &context, true, true, true);
366 
367  context.Status = IoCallDriver(vc->devobj, Irp2);
368 
369  if (context.Status == STATUS_PENDING)
371 
372  if (!NT_SUCCESS(context.Status)) {
373  ERR("IoCallDriver returned %08lx\n", context.Status);
375  return context.Status;
376  }
377  }
378 
379  le = le->Flink;
380  }
381 
383 
384  return STATUS_SUCCESS;
385 }
386 
389  PDEVICE_RELATIONS device_relations;
390 
391  if (IrpSp->Parameters.QueryDeviceRelations.Type != TargetDeviceRelation)
392  return Irp->IoStatus.Status;
393 
394  device_relations = ExAllocatePoolWithTag(PagedPool, sizeof(DEVICE_RELATIONS), ALLOC_TAG);
395  if (!device_relations) {
396  ERR("out of memory\n");
398  }
399 
400  device_relations->Count = 1;
401  device_relations->Objects[0] = pdo;
402 
403  ObReferenceObject(pdo);
404 
405  Irp->IoStatus.Information = (ULONG_PTR)device_relations;
406 
407  return STATUS_SUCCESS;
408 }
409 
413 
414  switch (IrpSp->MinorFunction) {
415  case IRP_MN_QUERY_ID:
416  return pdo_query_id(pdode, Irp);
417 
418  case IRP_MN_START_DEVICE:
422  return STATUS_SUCCESS;
423 
425  return STATUS_UNSUCCESSFUL;
426 
428  return pdo_device_usage_notification(pdode, Irp);
429 
431  return pdo_query_device_relations(pdo, Irp);
432  }
433 
434  return Irp->IoStatus.Status;
435 }
436 
439  device_extension* Vcb = DeviceObject->DeviceExtension;
440 
441  if (IrpSp->Parameters.UsageNotification.InPath) {
442  switch (IrpSp->Parameters.UsageNotification.Type) {
446  IoAdjustPagingPathCount(&Vcb->page_file_count, IrpSp->Parameters.UsageNotification.InPath);
447  break;
448 
449  default:
450  break;
451  }
452  }
453 
455  return IoCallDriver(Vcb->Vpb->RealDevice, Irp);
456 }
457 
462  device_extension* Vcb = DeviceObject->DeviceExtension;
464  bool top_level;
465 
467 
468  top_level = is_top_level(Irp);
469 
470  if (Vcb && Vcb->type == VCB_TYPE_BUS) {
471  Status = bus_pnp(DeviceObject->DeviceExtension, Irp);
472  goto exit;
473  } else if (Vcb && Vcb->type == VCB_TYPE_VOLUME) {
474  volume_device_extension* vde = DeviceObject->DeviceExtension;
477  goto exit;
478  } else if (Vcb && Vcb->type == VCB_TYPE_PDO) {
480  goto end;
481  } else if (!Vcb || Vcb->type != VCB_TYPE_FS) {
483  goto end;
484  }
485 
487 
488  switch (IrpSp->MinorFunction) {
491  break;
492 
495  break;
496 
499  break;
500 
503  break;
504 
507  goto exit;
508 
509  default:
510  TRACE("passing minor function 0x%x on\n", IrpSp->MinorFunction);
511 
513  Status = IoCallDriver(Vcb->Vpb->RealDevice, Irp);
514  goto exit;
515  }
516 
517 end:
518  Irp->IoStatus.Status = Status;
519 
521 
522 exit:
523  TRACE("returning %08lx\n", Status);
524 
525  if (top_level)
527 
529 
530  return Status;
531 }
NTSTATUS pnp_query_remove_device(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: pnp.c:23
#define IRP_MN_CANCEL_REMOVE_DEVICE
#define VCB_TYPE_PDO
Definition: btrfs_drv.h:690
#define hex_digit(c)
Definition: btrfs_drv.h:1748
#define FSRTL_VOLUME_DISMOUNT
Definition: ntifs_ex.h:439
ERESOURCE pdo_list_lock
Definition: btrfs.c:103
#define IRP_MN_REMOVE_DEVICE
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define IRP_MN_QUERY_ID
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
static NTSTATUS pdo_query_hardware_ids(PIRP Irp)
Definition: pnp.c:272
#define STATUS_MORE_PROCESSING_REQUIRED
Definition: shellext.h:68
Definition: http.c:7251
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
struct _DEVICE_OBJECT * PDEVICE_OBJECT
PDEVICE_OBJECT Objects[1]
Definition: iotypes.h:2163
NTSTATUS do_write(device_extension *Vcb, PIRP Irp)
Definition: flushthread.c:7877
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
#define WARN(fmt,...)
Definition: debug.h:112
LONG NTSTATUS
Definition: precomp.h:26
static NTSTATUS pdo_device_usage_notification(pdo_device_extension *pdode, PIRP Irp)
Definition: pnp.c:328
#define VCB_TYPE_FS
Definition: btrfs_drv.h:687
void uninit(_In_ device_extension *Vcb)
Definition: btrfs.c:2001
LONG NTAPI KeSetEvent(IN PKEVENT Event, IN KPRIORITY Increment, IN BOOLEAN Wait)
Definition: eventobj.c:159
bool is_top_level(_In_ PIRP Irp)
Definition: btrfs.c:278
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
KEVENT Event
Definition: pnp.c:311
#define VCB_TYPE_BUS
Definition: btrfs_drv.h:691
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
Definition: irp.cpp:498
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:770
PDEVICE_OBJECT pdo
Definition: btrfs_drv.h:890
#define ALLOC_TAG
Definition: btrfs_drv.h:87
static NTSTATUS pnp_remove_device(PDEVICE_OBJECT DeviceObject)
Definition: pnp.c:53
GLuint * ids
Definition: glext.h:5907
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
return STATUS_NOT_IMPLEMENTED
#define L(x)
Definition: ntvdm.h:50
IO_STATUS_BLOCK iosb
Definition: pnp.c:310
_In_ PIRP Irp
Definition: csq.h:116
#define IRP_MN_QUERY_REMOVE_DEVICE
uint32_t no_pnp
Definition: btrfs.c:87
_Function_class_(IO_COMPLETION_ROUTINE)
Definition: pnp.c:315
PVOID DeviceExtension
Definition: env_spec_w32.h:418
#define offsetof(TYPE, MEMBER)
PDEVICE_OBJECT devobj
Definition: btrfs_drv.h:857
_Dispatch_type_(IRP_MJ_PNP)
Definition: pnp.c:458
#define IoCompleteRequest
Definition: irp.c:1240
#define UNUSED(x)
Definition: btrfs_drv.h:82
static NTSTATUS pdo_query_device_relations(PDEVICE_OBJECT pdo, PIRP Irp)
Definition: pnp.c:387
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
static NTSTATUS bus_query_capabilities(PIRP Irp)
Definition: pnp.c:101
Status
Definition: gdiplustypes.h:24
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
#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:185
NTSTATUS NTAPI FsRtlNotifyVolumeEvent(IN PFILE_OBJECT FileObject, IN ULONG EventCode)
Definition: pnp.c:38
#define IoAdjustPagingPathCount(_Count, _Increment)
NTSTATUS Status
Definition: pnp.c:312
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_PENDING
Definition: ntstatus.h:82
#define VCB_TYPE_VOLUME
Definition: btrfs_drv.h:689
#define Vcb
Definition: cdprocs.h:1415
#define IRP_MN_START_DEVICE
static FILE * out
Definition: regtests2xml.c:44
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
#define __stdcall
Definition: typedefs.h:25
ERESOURCE child_lock
Definition: btrfs_drv.h:896
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817
_In_opt_ PVOID _In_ ULONG _In_ PVOID context
Definition: wdfdriver.h:113
GLuint GLuint end
Definition: gl.h:1545
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
static NTSTATUS pdo_query_device_id(pdo_device_extension *pdode, PIRP Irp)
Definition: pnp.c:239
PFILE_OBJECT fileobj
Definition: btrfs_drv.h:858
VOID NTAPI IoSetTopLevelIrp(IN PIRP Irp)
Definition: irp.c:2000
static NTSTATUS bus_query_device_relations(PIRP Irp)
Definition: pnp.c:111
bool has_open_children(file_ref *fileref)
Definition: fileinfo.c:442
Definition: typedefs.h:119
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2695
DRIVER_DISPATCH(nfs41_FsdDispatch)
* PDEVICE_CAPABILITIES
Definition: iotypes.h:965
PDEVICE_OBJECT attached_device
Definition: btrfs_drv.h:880
NTSTATUS NTSTATUS bool bool void free_trees(device_extension *Vcb) __attribute__((nonnull(1)))
static NTSTATUS pdo_pnp(PDEVICE_OBJECT pdo, PIRP Irp)
Definition: pnp.c:410
#define ERR(fmt,...)
Definition: debug.h:110
uint8_t uuid[16]
Definition: btrfs.h:140
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2793
static NTSTATUS pnp_device_usage_notification(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: pnp.c:437
PDEVICE_OBJECT attached_device
Definition: btrfs_drv.h:849
PFILE_OBJECT FileObject
Definition: iotypes.h:3169
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
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: list.h:27
#define NULL
Definition: types.h:112
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
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
BOOLEAN NTAPI ExAcquireResourceSharedLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:885
LIST_ENTRY pdo_list
Definition: btrfs.c:104
Definition: name.c:38
#define ObReferenceObject
Definition: obfuncs.h:204
ULONG ERESOURCE
Definition: env_spec_w32.h:594
unsigned int ULONG
Definition: retypes.h:1
#define IO_NO_INCREMENT
Definition: iotypes.h:598
#define ULONG_PTR
Definition: config.h:101
static const WCHAR dc[]
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
static NTSTATUS pdo_query_id(pdo_device_extension *pdode, PIRP Irp)
Definition: pnp.c:290
PIRP NTAPI IoAllocateIrp(IN CCHAR StackSize, IN BOOLEAN ChargeQuota)
Definition: irp.c:615
#define STATUS_SUCCESS
Definition: shellext.h:65
#define IRP_MN_DEVICE_USAGE_NOTIFICATION
void exit(int exitcode)
Definition: _exit.c:33
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:3128
LIST_ENTRY children
Definition: btrfs_drv.h:897
#define VPB_MOUNTED
Definition: iotypes.h:1807
static NTSTATUS bus_query_hardware_ids(PIRP Irp)
Definition: pnp.c:167
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137
#define IRP_MN_QUERY_CAPABILITIES
NTSTATUS pnp_surprise_removal(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: pnp.c:77