ReactOS  0.4.13-dev-551-gf37fb1f
search.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 
20 #ifndef __REACTOS__
21 #include <ntddk.h>
22 #include <ntifs.h>
23 #include <mountmgr.h>
24 #include <windef.h>
25 #endif
26 #include <ntddstor.h>
27 #include <ntdddisk.h>
28 
29 #include <initguid.h>
30 #include <wdmguid.h>
31 
33 extern LIST_ENTRY pdo_list;
37 extern BOOL shutting_down;
38 
40 
42 
44  UNICODE_STRING path, ignoreus;
48  ULONG dispos, retlen, kvfilen, i, j;
49  HANDLE h;
50  BOOL ret = FALSE;
51 
52  path.Length = path.MaximumLength = registry_path.Length + (37 * sizeof(WCHAR));
53 
55  if (!path.Buffer) {
56  ERR("out of memory\n");
57  return FALSE;
58  }
59 
61 
62  i = registry_path.Length / sizeof(WCHAR);
63 
64  path.Buffer[i] = '\\';
65  i++;
66 
67  for (j = 0; j < 16; j++) {
68  path.Buffer[i] = hex_digit((uuid->uuid[j] & 0xF0) >> 4);
69  path.Buffer[i+1] = hex_digit(uuid->uuid[j] & 0xF);
70 
71  i += 2;
72 
73  if (j == 3 || j == 5 || j == 7 || j == 9) {
74  path.Buffer[i] = '-';
75  i++;
76  }
77  }
78 
80 
81  Status = ZwCreateKey(&h, KEY_QUERY_VALUE, &oa, 0, NULL, REG_OPTION_NON_VOLATILE, &dispos);
82 
83  if (!NT_SUCCESS(Status)) {
84  TRACE("ZwCreateKey returned %08x\n", Status);
85  ExFreePool(path.Buffer);
86  return FALSE;
87  }
88 
89  RtlInitUnicodeString(&ignoreus, L"Ignore");
90 
91  kvfilen = (ULONG)offsetof(KEY_VALUE_FULL_INFORMATION, Name[0]) + (255 * sizeof(WCHAR));
92  kvfi = ExAllocatePoolWithTag(PagedPool, kvfilen, ALLOC_TAG);
93  if (!kvfi) {
94  ERR("out of memory\n");
95  ZwClose(h);
96  ExFreePool(path.Buffer);
97  return FALSE;
98  }
99 
100  Status = ZwQueryValueKey(h, &ignoreus, KeyValueFullInformation, kvfi, kvfilen, &retlen);
101  if (NT_SUCCESS(Status)) {
102  if (kvfi->Type == REG_DWORD && kvfi->DataLength >= sizeof(UINT32)) {
103  UINT32* pr = (UINT32*)((UINT8*)kvfi + kvfi->DataOffset);
104 
105  ret = *pr;
106  }
107  }
108 
109  ZwClose(h);
110  ExFreePool(kvfi);
111  ExFreePool(path.Buffer);
112 
113  return ret;
114 }
115 
117  DWORD disk_num, DWORD part_num, UINT64 length) {
119  ULONG toread;
120  UINT8* data = NULL;
122 
123  TRACE("%.*S\n", devpath->Length / sizeof(WCHAR), devpath->Buffer);
124 
125  sector_size = DeviceObject->SectorSize;
126 
127  if (sector_size == 0) {
128  DISK_GEOMETRY geometry;
130 
132  &geometry, sizeof(DISK_GEOMETRY), TRUE, &iosb);
133 
134  if (!NT_SUCCESS(Status)) {
135  ERR("%.*S had a sector size of 0, and IOCTL_DISK_GET_DRIVE_GEOMETRY returned %08x\n",
136  devpath->Length / sizeof(WCHAR), devpath->Buffer, Status);
137  goto deref;
138  }
139 
140  if (iosb.Information < sizeof(DISK_GEOMETRY)) {
141  ERR("%.*S: IOCTL_DISK_GET_DRIVE_GEOMETRY returned %u bytes, expected %u\n",
142  devpath->Length / sizeof(WCHAR), devpath->Buffer, iosb.Information, sizeof(DISK_GEOMETRY));
143  }
144 
145  sector_size = geometry.BytesPerSector;
146 
147  if (sector_size == 0) {
148  ERR("%.*S had a sector size of 0\n", devpath->Length / sizeof(WCHAR), devpath->Buffer);
149  goto deref;
150  }
151  }
152 
153  toread = (ULONG)sector_align(sizeof(superblock), sector_size);
155  if (!data) {
156  ERR("out of memory\n");
157  goto deref;
158  }
159 
161 
162  if (NT_SUCCESS(Status) && ((superblock*)data)->magic == BTRFS_MAGIC) {
164  UINT32 crc32 = ~calc_crc32c(0xffffffff, (UINT8*)&sb->uuid, (ULONG)sizeof(superblock) - sizeof(sb->checksum));
165 
166  if (crc32 != *((UINT32*)sb->checksum))
167  ERR("checksum error on superblock\n");
168  else {
169  TRACE("volume found\n");
170 
171  if (length >= superblock_addrs[1] + toread) {
172  ULONG i = 1;
173 
175  if (!sb2) {
176  ERR("out of memory\n");
177  goto deref;
178  }
179 
180  while (superblock_addrs[i] > 0 && length >= superblock_addrs[i] + toread) {
182 
183  if (NT_SUCCESS(Status) && sb2->magic == BTRFS_MAGIC) {
184  crc32 = ~calc_crc32c(0xffffffff, (UINT8*)&sb2->uuid, (ULONG)sizeof(superblock) - sizeof(sb2->checksum));
185 
186  if (crc32 == *((UINT32*)sb2->checksum) && sb2->generation > sb->generation)
187  RtlCopyMemory(sb, sb2, toread);
188  }
189 
190  i++;
191  }
192 
193  ExFreePool(sb2);
194  }
195 
196  if (!fs_ignored(&sb->uuid)) {
198  add_volume_device(sb, mountmgr, devpath, length, disk_num, part_num);
199  }
200  }
201  }
202 
203 deref:
204  if (data)
205  ExFreePool(data);
206 }
207 
211  ULONG mmpsize;
212  MOUNTMGR_MOUNT_POINTS mmps1, *mmps2;
213 
214  TRACE("removing drive letter\n");
215 
216  mmpsize = sizeof(MOUNTMGR_MOUNT_POINT) + devpath->Length;
217 
218  mmp = ExAllocatePoolWithTag(PagedPool, mmpsize, ALLOC_TAG);
219  if (!mmp) {
220  ERR("out of memory\n");
222  }
223 
224  RtlZeroMemory(mmp, mmpsize);
225 
226  mmp->DeviceNameOffset = sizeof(MOUNTMGR_MOUNT_POINT);
227  mmp->DeviceNameLength = devpath->Length;
228  RtlCopyMemory(&mmp[1], devpath->Buffer, devpath->Length);
229 
230  Status = dev_ioctl(mountmgr, IOCTL_MOUNTMGR_DELETE_POINTS, mmp, mmpsize, &mmps1, sizeof(MOUNTMGR_MOUNT_POINTS), FALSE, NULL);
231 
233  ERR("IOCTL_MOUNTMGR_DELETE_POINTS 1 returned %08x\n", Status);
234  ExFreePool(mmp);
235  return Status;
236  }
237 
238  if (Status != STATUS_BUFFER_OVERFLOW || mmps1.Size == 0) {
239  ExFreePool(mmp);
240  return STATUS_NOT_FOUND;
241  }
242 
244  if (!mmps2) {
245  ERR("out of memory\n");
246  ExFreePool(mmp);
248  }
249 
250  Status = dev_ioctl(mountmgr, IOCTL_MOUNTMGR_DELETE_POINTS, mmp, mmpsize, mmps2, mmps1.Size, FALSE, NULL);
251 
252  if (!NT_SUCCESS(Status))
253  ERR("IOCTL_MOUNTMGR_DELETE_POINTS 2 returned %08x\n", Status);
254 
255  ExFreePool(mmps2);
256  ExFreePool(mmp);
257 
258  return Status;
259 }
260 
262  PFILE_OBJECT FileObject, mountmgrfo;
263  PDEVICE_OBJECT devobj, mountmgr;
266  ULONG dlisize;
270  UNICODE_STRING mmdevpath;
271 
273 
275  if (!NT_SUCCESS(Status)) {
276  ERR("IoGetDeviceObjectPointer returned %08x\n", Status);
277  return;
278  }
279 
281  Status = IoGetDeviceObjectPointer(&mmdevpath, FILE_READ_ATTRIBUTES, &mountmgrfo, &mountmgr);
282  if (!NT_SUCCESS(Status)) {
283  ERR("IoGetDeviceObjectPointer returned %08x\n", Status);
285  return;
286  }
287 
288  dlisize = 0;
289 
290  do {
291  dlisize += 1024;
292 
293  if (dli)
294  ExFreePool(dli);
295 
296  dli = ExAllocatePoolWithTag(PagedPool, dlisize, ALLOC_TAG);
297  if (!dli) {
298  ERR("out of memory\n");
299  goto end;
300  }
301 
303  dli, dlisize, TRUE, &iosb);
304  } while (Status == STATUS_BUFFER_TOO_SMALL);
305 
306  // only consider disk as a potential filesystem if it has no partitions
307  if (NT_SUCCESS(Status) && dli->PartitionCount > 0) {
308  ExFreePool(dli);
309  goto end;
310  }
311 
312  ExFreePool(dli);
313 
315  &gli, sizeof(gli), TRUE, NULL);
316 
317  if (!NT_SUCCESS(Status)) {
318  ERR("error reading length information: %08x\n", Status);
319  goto end;
320  }
321 
323  &sdn, sizeof(STORAGE_DEVICE_NUMBER), TRUE, NULL);
324  if (!NT_SUCCESS(Status)) {
325  TRACE("IOCTL_STORAGE_GET_DEVICE_NUMBER returned %08x\n", Status);
326  sdn.DeviceNumber = 0xffffffff;
327  sdn.PartitionNumber = 0;
328  } else
329  TRACE("DeviceType = %u, DeviceNumber = %u, PartitionNumber = %u\n", sdn.DeviceType, sdn.DeviceNumber, sdn.PartitionNumber);
330 
331  test_vol(mountmgr, devobj, devpath, sdn.DeviceNumber, sdn.PartitionNumber, gli.Length.QuadPart);
332 
333 end:
335  ObDereferenceObject(mountmgrfo);
336 }
337 
339  _In_ volume_child* vc, _In_ BOOL skip_dev) {
341  pdo_device_extension* pdode = vde->pdode;
342  device_extension* Vcb = vde->mounted_device ? vde->mounted_device->DeviceExtension : NULL;
343 
344  if (vc->notification_entry)
345 #ifdef __REACTOS__
346  IoUnregisterPlugPlayNotification(vc->notification_entry);
347 #else
348  IoUnregisterPlugPlayNotificationEx(vc->notification_entry);
349 #endif
350 
351  if (vde->mounted_device && (!Vcb || !Vcb->options.allow_degraded)) {
352  Status = pnp_surprise_removal(vde->mounted_device, NULL);
353  if (!NT_SUCCESS(Status))
354  ERR("pnp_surprise_removal returned %08x\n", Status);
355  }
356 
357  if (!Vcb || !Vcb->options.allow_degraded) {
358  Status = IoSetDeviceInterfaceState(&vde->bus_name, FALSE);
359  if (!NT_SUCCESS(Status))
360  WARN("IoSetDeviceInterfaceState returned %08x\n", Status);
361  }
362 
363  if (pdode->children_loaded > 0) {
364  UNICODE_STRING mmdevpath;
366  PDEVICE_OBJECT mountmgr;
367  LIST_ENTRY* le;
368 
369  if (!Vcb || !Vcb->options.allow_degraded) {
372  if (!NT_SUCCESS(Status))
373  ERR("IoGetDeviceObjectPointer returned %08x\n", Status);
374  else {
375  le = pdode->children.Flink;
376 
377  while (le != &pdode->children) {
379 
380  if (vc2->had_drive_letter) { // re-add entry to mountmgr
381  MOUNTDEV_NAME mdn;
382 
385  ERR("IOCTL_MOUNTDEV_QUERY_DEVICE_NAME returned %08x\n", Status);
386  else {
387  MOUNTDEV_NAME* mdn2;
388  ULONG mdnsize = (ULONG)offsetof(MOUNTDEV_NAME, Name[0]) + mdn.NameLength;
389 
390  mdn2 = ExAllocatePoolWithTag(PagedPool, mdnsize, ALLOC_TAG);
391  if (!mdn2)
392  ERR("out of memory\n");
393  else {
394  Status = dev_ioctl(vc2->devobj, IOCTL_MOUNTDEV_QUERY_DEVICE_NAME, NULL, 0, mdn2, mdnsize, TRUE, NULL);
395  if (!NT_SUCCESS(Status))
396  ERR("IOCTL_MOUNTDEV_QUERY_DEVICE_NAME returned %08x\n", Status);
397  else {
399 
400  name.Buffer = mdn2->Name;
401  name.Length = name.MaximumLength = mdn2->NameLength;
402 
403  Status = mountmgr_add_drive_letter(mountmgr, &name);
404  if (!NT_SUCCESS(Status))
405  WARN("mountmgr_add_drive_letter returned %08x\n", Status);
406  }
407 
408  ExFreePool(mdn2);
409  }
410  }
411  }
412 
413  le = le->Flink;
414  }
415 
417  }
418  } else if (!skip_dev) {
420 
421  le = Vcb->devices.Flink;
422  while (le != &Vcb->devices) {
424 
425  if (dev->devobj == vc->devobj) {
426  dev->devobj = NULL; // mark as missing
427  break;
428  }
429 
430  le = le->Flink;
431  }
432 
433  ExReleaseResourceLite(&Vcb->tree_lock);
434  }
435 
436  if (vde->device->Characteristics & FILE_REMOVABLE_MEDIA) {
437  vde->device->Characteristics &= ~FILE_REMOVABLE_MEDIA;
438 
439  le = pdode->children.Flink;
440  while (le != &pdode->children) {
442 
443  if (vc2 != vc && vc2->devobj->Characteristics & FILE_REMOVABLE_MEDIA) {
444  vde->device->Characteristics |= FILE_REMOVABLE_MEDIA;
445  break;
446  }
447 
448  le = le->Flink;
449  }
450  }
451  }
452 
453  ObDereferenceObject(vc->fileobj);
454  ExFreePool(vc->pnp_name.Buffer);
455  RemoveEntryList(&vc->list_entry);
456  ExFreePool(vc);
457 
458  pdode->children_loaded--;
459 
460  if (pdode->children_loaded == 0) { // remove volume device
461  BOOL remove = FALSE;
462 
463  RemoveEntryList(&pdode->list_entry);
464 
465  vde->removing = TRUE;
466 
467  Status = IoSetDeviceInterfaceState(&vde->bus_name, FALSE);
468  if (!NT_SUCCESS(Status))
469  WARN("IoSetDeviceInterfaceState returned %08x\n", Status);
470 
471  if (vde->pdo->AttachedDevice)
472  IoDetachDevice(vde->pdo);
473 
474  if (vde->open_count == 0)
475  remove = TRUE;
476 
478 
479  if (!no_pnp) {
481 
483  }
484 
485  if (remove) {
486  if (vde->name.Buffer)
487  ExFreePool(vde->name.Buffer);
488 
489  if (Vcb)
490  Vcb->vde = NULL;
491 
493 
494  IoDeleteDevice(vde->device);
495  }
496  } else
498 }
499 
502  PFILE_OBJECT FileObject, mountmgrfo;
503  UNICODE_STRING mmdevpath;
504  PDEVICE_OBJECT devobj, mountmgr;
507 
508  TRACE("%.*S\n", devpath->Length / sizeof(WCHAR), devpath->Buffer);
509 
511  if (!NT_SUCCESS(Status)) {
512  ERR("IoGetDeviceObjectPointer returned %08x\n", Status);
513  return;
514  }
515 
516  // make sure we're not processing devices we've created ourselves
517 
518  if (devobj->DriverObject == DriverObject)
519  goto end;
520 
521  Status = dev_ioctl(devobj, IOCTL_DISK_GET_LENGTH_INFO, NULL, 0, &gli, sizeof(gli), TRUE, NULL);
522  if (!NT_SUCCESS(Status)) {
523  ERR("IOCTL_DISK_GET_LENGTH_INFO returned %08x\n", Status);
524  goto end;
525  }
526 
528  &sdn, sizeof(STORAGE_DEVICE_NUMBER), TRUE, NULL);
529  if (!NT_SUCCESS(Status)) {
530  TRACE("IOCTL_STORAGE_GET_DEVICE_NUMBER returned %08x\n", Status);
531  sdn.DeviceNumber = 0xffffffff;
532  sdn.PartitionNumber = 0;
533  } else
534  TRACE("DeviceType = %u, DeviceNumber = %u, PartitionNumber = %u\n", sdn.DeviceType, sdn.DeviceNumber, sdn.PartitionNumber);
535 
536  // If we've just added a partition to a whole-disk filesystem, unmount it
537  if (sdn.DeviceNumber != 0xffffffff && sdn.PartitionNumber != 0) {
538  LIST_ENTRY* le;
539 
541 
542  le = pdo_list.Flink;
543  while (le != &pdo_list) {
545  LIST_ENTRY* le2;
546  BOOL changed = FALSE;
547 
548  if (pdode->vde) {
550 
551  le2 = pdode->children.Flink;
552  while (le2 != &pdode->children) {
554  LIST_ENTRY* le3 = le2->Flink;
555 
556  if (vc->disk_num == sdn.DeviceNumber && vc->part_num == 0) {
557  TRACE("removing device\n");
558 
559  remove_volume_child(pdode->vde, vc, FALSE);
560  changed = TRUE;
561 
562  break;
563  }
564 
565  le2 = le3;
566  }
567 
568  if (!changed)
570  else
571  break;
572  }
573 
574  le = le->Flink;
575  }
576 
578  }
579 
581  Status = IoGetDeviceObjectPointer(&mmdevpath, FILE_READ_ATTRIBUTES, &mountmgrfo, &mountmgr);
582  if (!NT_SUCCESS(Status)) {
583  ERR("IoGetDeviceObjectPointer returned %08x\n", Status);
584  goto end;
585  }
586 
587  test_vol(mountmgr, devobj, devpath, sdn.DeviceNumber, sdn.PartitionNumber, gli.Length.QuadPart);
588 
589  ObDereferenceObject(mountmgrfo);
590 
591 end:
593 }
594 
596  LIST_ENTRY* le;
597  UNICODE_STRING devpath2;
598 
599  TRACE("%.*S\n", devpath->Length / sizeof(WCHAR), devpath->Buffer);
600 
602 
603  devpath2 = *devpath;
604 
605  if (devpath->Length > 4 * sizeof(WCHAR) && devpath->Buffer[0] == '\\' && (devpath->Buffer[1] == '\\' || devpath->Buffer[1] == '?') &&
606  devpath->Buffer[2] == '?' && devpath->Buffer[3] == '\\') {
607  devpath2.Buffer = &devpath2.Buffer[3];
608  devpath2.Length -= 3 * sizeof(WCHAR);
609  devpath2.MaximumLength -= 3 * sizeof(WCHAR);
610  }
611 
613 
614  le = pdo_list.Flink;
615  while (le != &pdo_list) {
617  LIST_ENTRY* le2;
618  BOOL changed = FALSE;
619 
620  if (pdode->vde) {
622 
623  le2 = pdode->children.Flink;
624  while (le2 != &pdode->children) {
626  LIST_ENTRY* le3 = le2->Flink;
627 
628  if (vc->pnp_name.Length == devpath2.Length && RtlCompareMemory(vc->pnp_name.Buffer, devpath2.Buffer, devpath2.Length) == devpath2.Length) {
629  TRACE("removing device\n");
630 
631  remove_volume_child(pdode->vde, vc, FALSE);
632  changed = TRUE;
633 
634  break;
635  }
636 
637  le2 = le3;
638  }
639 
640  if (!changed)
642  else
643  break;
644  }
645 
646  le = le->Flink;
647  }
648 
650 }
651 
652 typedef struct {
658 
659 _Function_class_(IO_WORKITEM_ROUTINE)
660 #ifdef __REACTOS__
661 static void NTAPI do_pnp_callback(PDEVICE_OBJECT DeviceObject, PVOID con) {
662 #else
663 static void do_pnp_callback(PDEVICE_OBJECT DeviceObject, PVOID con) {
664 #endif
666 
668 
669  context->func(context->DriverObject, &context->name);
670 
671  if (context->name.Buffer)
672  ExFreePool(context->name.Buffer);
673 
674  IoFreeWorkItem(context->work_item);
675 }
676 
678  PIO_WORKITEM work_item;
680 
681  work_item = IoAllocateWorkItem(master_devobj);
682 
684 
685  if (!context) {
686  ERR("out of memory\n");
687  IoFreeWorkItem(work_item);
688  return;
689  }
690 
691  context->DriverObject = DriverObject;
692 
693  if (name->Length > 0) {
694  context->name.Buffer = ExAllocatePoolWithTag(PagedPool, name->Length, ALLOC_TAG);
695  if (!context->name.Buffer) {
696  ERR("out of memory\n");
698  IoFreeWorkItem(work_item);
699  return;
700  }
701 
702  RtlCopyMemory(context->name.Buffer, name->Buffer, name->Length);
703  context->name.Length = context->name.MaximumLength = name->Length;
704  } else {
705  context->name.Length = context->name.MaximumLength = 0;
706  context->name.Buffer = NULL;
707  }
708 
709  context->func = func;
710  context->work_item = work_item;
711 
712  IoQueueWorkItem(work_item, do_pnp_callback, DelayedWorkQueue, context);
713 }
714 
715 _Function_class_(DRIVER_NOTIFICATION_CALLBACK_ROUTINE)
716 #ifdef __REACTOS__
717 NTSTATUS NTAPI volume_notification(PVOID NotificationStructure, PVOID Context) {
718 #else
719 NTSTATUS volume_notification(PVOID NotificationStructure, PVOID Context) {
720 #endif
723 
724  if (RtlCompareMemory(&dicn->Event, &GUID_DEVICE_INTERFACE_ARRIVAL, sizeof(GUID)) == sizeof(GUID))
726  else if (RtlCompareMemory(&dicn->Event, &GUID_DEVICE_INTERFACE_REMOVAL, sizeof(GUID)) == sizeof(GUID))
728 
729  return STATUS_SUCCESS;
730 }
731 
732 _Function_class_(DRIVER_NOTIFICATION_CALLBACK_ROUTINE)
733 #ifdef __REACTOS__
735 #else
736 NTSTATUS pnp_notification(PVOID NotificationStructure, PVOID Context) {
737 #endif
740 
741  if (RtlCompareMemory(&dicn->Event, &GUID_DEVICE_INTERFACE_ARRIVAL, sizeof(GUID)) == sizeof(GUID))
743  else if (RtlCompareMemory(&dicn->Event, &GUID_DEVICE_INTERFACE_REMOVAL, sizeof(GUID)) == sizeof(GUID))
745 
746  return STATUS_SUCCESS;
747 }
748 
751  LIST_ENTRY* le;
752  BOOL done = FALSE;
753 
755 
756  le = pdo_list.Flink;
757  while (le != &pdo_list) {
759  LIST_ENTRY* le2;
760 
762 
763  le2 = pdode->children.Flink;
764 
765  while (le2 != &pdode->children) {
767 
768  if (vc->devobj) {
769  MOUNTDEV_NAME mdn;
770 
773  ERR("IOCTL_MOUNTDEV_QUERY_DEVICE_NAME returned %08x\n", Status);
774  else {
775  MOUNTDEV_NAME* mdn2;
776  ULONG mdnsize = (ULONG)offsetof(MOUNTDEV_NAME, Name[0]) + mdn.NameLength;
777 
778  mdn2 = ExAllocatePoolWithTag(NonPagedPool, mdnsize, ALLOC_TAG);
779  if (!mdn2)
780  ERR("out of memory\n");
781  else {
783  if (!NT_SUCCESS(Status))
784  ERR("IOCTL_MOUNTDEV_QUERY_DEVICE_NAME returned %08x\n", Status);
785  else {
786  if (mdn2->NameLength == device_name->Length && RtlCompareMemory(mdn2->Name, device_name->Buffer, device_name->Length) == device_name->Length) {
788  if (!NT_SUCCESS(Status))
789  ERR("remove_drive_letter returned %08x\n", Status);
790  else
791  vc->had_drive_letter = TRUE;
792 
793  done = TRUE;
794  break;
795  }
796  }
797 
798  ExFreePool(mdn2);
799  }
800  }
801  }
802 
803  le2 = le2->Flink;
804  }
805 
807 
808  if (done)
809  break;
810 
811  le = le->Flink;
812  }
813 
815 }
816 
818  ULONG i;
819 
820  static const WCHAR pref[] = L"\\DosDevices\\";
821 
822  for (i = 0; i < mmps->NumberOfMountPoints; i++) {
823  UNICODE_STRING symlink, device_name;
824 
825  if (mmps->MountPoints[i].SymbolicLinkNameOffset != 0) {
826  symlink.Buffer = (WCHAR*)(((UINT8*)mmps) + mmps->MountPoints[i].SymbolicLinkNameOffset);
827  symlink.Length = symlink.MaximumLength = mmps->MountPoints[i].SymbolicLinkNameLength;
828  } else {
829  symlink.Buffer = NULL;
830  symlink.Length = symlink.MaximumLength = 0;
831  }
832 
833  if (mmps->MountPoints[i].DeviceNameOffset != 0) {
834  device_name.Buffer = (WCHAR*)(((UINT8*)mmps) + mmps->MountPoints[i].DeviceNameOffset);
835  device_name.Length = device_name.MaximumLength = mmps->MountPoints[i].DeviceNameLength;
836  } else {
837  device_name.Buffer = NULL;
838  device_name.Length = device_name.MaximumLength = 0;
839  }
840 
841  if (symlink.Length > sizeof(pref) - sizeof(WCHAR) &&
842  RtlCompareMemory(symlink.Buffer, pref, sizeof(pref) - sizeof(WCHAR)) == sizeof(pref) - sizeof(WCHAR))
844  }
845 }
846 
847 _Function_class_(KSTART_ROUTINE)
848 #ifdef __REACTOS__
849 void NTAPI mountmgr_thread(_In_ void* context) {
850 #else
851 void mountmgr_thread(_In_ void* context) {
852 #endif
853  UNICODE_STRING mmdevpath;
856  PDEVICE_OBJECT mountmgr;
858 
859  UNUSED(context);
860 
863  if (!NT_SUCCESS(Status)) {
864  ERR("IoGetDeviceObjectPointer returned %08x\n", Status);
865  return;
866  }
867 
868  mcni.EpicNumber = 0;
869 
870  while (TRUE) {
871  PIRP Irp;
875 
877 
880 
881  if (!Irp) {
882  ERR("out of memory\n");
883  break;
884  }
885 
886  Status = IoCallDriver(mountmgr, Irp);
887 
888  if (Status == STATUS_PENDING) {
890  Status = iosb.Status;
891  }
892 
893  if (shutting_down)
894  break;
895 
896  if (!NT_SUCCESS(Status)) {
897  ERR("IOCTL_MOUNTMGR_CHANGE_NOTIFY returned %08x\n", Status);
898  break;
899  }
900 
901  TRACE("mountmgr changed\n");
902 
903  RtlZeroMemory(&mmp, sizeof(MOUNTMGR_MOUNT_POINT));
904 
906  FALSE, NULL);
907 
909  ERR("IOCTL_MOUNTMGR_QUERY_POINTS 1 returned %08x\n", Status);
910  else if (mmps.Size > 0) {
911  MOUNTMGR_MOUNT_POINTS* mmps2;
912 
914  if (!mmps2) {
915  ERR("out of memory\n");
916  break;
917  }
918 
919  Status = dev_ioctl(mountmgr, IOCTL_MOUNTMGR_QUERY_POINTS, &mmp, sizeof(MOUNTMGR_MOUNT_POINTS), mmps2, mmps.Size,
920  FALSE, NULL);
921  if (!NT_SUCCESS(Status))
922  ERR("IOCTL_MOUNTMGR_QUERY_POINTS returned %08x\n", Status);
923  else
924  mountmgr_updated(mountmgr, mmps2);
925 
926  ExFreePool(mmps2);
927  }
928  }
929 
931 
933 
935 }
DEVICE_TYPE DeviceType
Definition: ntddstor.h:232
GLenum func
Definition: glext.h:6028
_In_ PVOID NotificationStructure
Definition: iofuncs.h:1203
NTSTATUS NTAPI IoUnregisterPlugPlayNotification(IN PVOID NotificationEntry)
Definition: pnpnotify.c:372
#define hex_digit(c)
Definition: btrfs_drv.h:1716
static PIO_STATUS_BLOCK iosb
Definition: file.c:98
UNICODE_STRING pnp_name
Definition: btrfs_drv.h:839
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
const GUID GUID_DEVICE_INTERFACE_ARRIVAL
Definition: deviface.c:14
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
_Function_class_(IO_WORKITEM_ROUTINE)
Definition: search.c:659
PDRIVER_OBJECT DriverObject
Definition: search.c:653
USHORT MaximumLength
Definition: env_spec_w32.h:370
Definition: http.c:6587
_In_ PIRP Irp
Definition: csq.h:116
superblock * sb
Definition: btrfs.c:3952
GLsizei const GLchar ** path
Definition: glext.h:7234
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
struct _MOUNTMGR_MOUNT_POINT MOUNTMGR_MOUNT_POINT
unsigned char * PUCHAR
Definition: retypes.h:3
#define WARN(fmt,...)
Definition: debug.h:111
void(* pnp_callback)(PDRIVER_OBJECT DriverObject, PUNICODE_STRING devpath)
Definition: search.c:39
LONG NTSTATUS
Definition: precomp.h:26
static const WCHAR device_name[]
Definition: btrfs.c:55
UINT32 no_pnp
Definition: btrfs.c:83
#define DO_VERIFY_VOLUME
Definition: env_spec_w32.h:393
LIST_ENTRY pdo_list
Definition: btrfs.c:94
u32_t magic(void)
NTSTATUS NTAPI ExDeleteResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1456
VOID NTAPI IoDetachDevice(IN PDEVICE_OBJECT TargetDevice)
Definition: device.c:1295
NTSTATUS NTAPI IoGetDeviceObjectPointer(IN PUNICODE_STRING ObjectName, IN ACCESS_MASK DesiredAccess, OUT PFILE_OBJECT *FileObject, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1434
UINT32 crc32
Definition: btrfs.c:3953
ULONG BytesPerSector
Definition: ntdddisk.h:376
VOID NTAPI ObDereferenceObject(IN PVOID Object)
Definition: obref.c:375
GLuint GLuint end
Definition: gl.h:1545
ULONG part_num
Definition: btrfs_drv.h:845
static void test_vol(PDEVICE_OBJECT mountmgr, PDEVICE_OBJECT DeviceObject, PUNICODE_STRING devpath, DWORD disk_num, DWORD part_num, UINT64 length)
Definition: search.c:116
PIO_WORKITEM NTAPI IoAllocateWorkItem(IN PDEVICE_OBJECT DeviceObject)
Definition: iowork.c:75
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
VOID NTAPI IoFreeWorkItem(IN PIO_WORKITEM IoWorkItem)
Definition: iowork.c:64
static uint32_t calc_crc32c(uint32_t seed, uint8_t *msg, ULONG msglen)
Definition: recv.cpp:134
#define MOUNTMGR_DEVICE_NAME
Definition: imports.h:76
NTSTATUS mountmgr_add_drive_letter(PDEVICE_OBJECT mountmgr, PUNICODE_STRING devpath)
Definition: volume.c:900
static void mountmgr_updated(PDEVICE_OBJECT mountmgr, MOUNTMGR_MOUNT_POINTS *mmps)
Definition: search.c:817
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:64
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
BOOL had_drive_letter
Definition: btrfs_drv.h:842
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:770
#define ALLOC_TAG
Definition: btrfs_drv.h:86
#define IOCTL_MOUNTDEV_QUERY_DEVICE_NAME
Definition: imports.h:93
#define IOCTL_MOUNTMGR_QUERY_POINTS
Definition: mountmgr.h:30
NTSTATUS dev_ioctl(_In_ PDEVICE_OBJECT DeviceObject, _In_ ULONG ControlCode, _In_reads_bytes_opt_(InputBufferSize) PVOID InputBuffer, _In_ ULONG InputBufferSize, _Out_writes_bytes_opt_(OutputBufferSize) PVOID OutputBuffer, _In_ ULONG OutputBufferSize, _In_ BOOLEAN Override, _Out_opt_ IO_STATUS_BLOCK *iosb)
Definition: btrfs.c:2652
NTSTATUS pnp_surprise_removal(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: pnp.c:255
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
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
KEVENT mountmgr_thread_event
Definition: btrfs.c:98
unsigned int UINT32
BOOL shutting_down
Definition: btrfs.c:99
unsigned int BOOL
Definition: ntddk_ex.h:94
Definition: devices.h:37
ERESOURCE pdo_list_lock
Definition: btrfs.c:93
#define FILE_REMOVABLE_MEDIA
Definition: nt_native.h:807
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
#define offsetof(TYPE, MEMBER)
void disk_arrival(PDRIVER_OBJECT DriverObject, PUNICODE_STRING devpath)
Definition: search.c:261
PDEVICE_OBJECT devobj
Definition: btrfs_drv.h:837
PDEVICE_OBJECT master_devobj
Definition: btrfs.c:61
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
#define IOCTL_STORAGE_GET_DEVICE_NUMBER
Definition: ntddstor.h:132
#define UNUSED(x)
Definition: btrfs_drv.h:81
NTSTATUS NTAPI IoSetDeviceInterfaceState(IN PUNICODE_STRING SymbolicLinkName, IN BOOLEAN Enable)
Definition: deviface.c:1311
_Requires_exclusive_lock_held_(Vcb->tree_lock) static NTSTATUS add_root(_Inout_ device_extension *Vcb
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
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
#define IOCTL_DISK_GET_LENGTH_INFO
Definition: imports.h:192
USHORT DeviceNameLength
Definition: imports.h:171
#define IOCTL_MOUNTMGR_CHANGE_NOTIFY
Definition: mountmgr.h:42
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
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
static BOOL fs_ignored(BTRFS_UUID *uuid)
Definition: search.c:43
#define STATUS_NOT_FOUND
Definition: shellext.h:67
HANDLE mountmgr_thread_handle
Definition: btrfs.c:96
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR Name[1]
Definition: imports.h:144
static const UINT64 superblock_addrs[]
Definition: btrfs.h:12
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_PENDING
Definition: ntstatus.h:82
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
NTSTATUS remove_drive_letter(PDEVICE_OBJECT mountmgr, PUNICODE_STRING devpath)
Definition: search.c:208
#define Vcb
Definition: cdprocs.h:1425
LIST_ENTRY list_entry
Definition: btrfs_drv.h:876
unsigned long DWORD
Definition: ntddk_ex.h:95
void remove_volume_child(_Inout_ _Requires_exclusive_lock_held_(_Curr_->child_lock) _Releases_exclusive_lock_(_Curr_->child_lock) _In_ volume_device_extension *vde, _In_ volume_child *vc, _In_ BOOL skip_dev)
Definition: search.c:338
#define _Inout_
Definition: no_sal2.h:244
ERESOURCE child_lock
Definition: btrfs_drv.h:873
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817
* PFILE_OBJECT
Definition: iotypes.h:1954
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
ULONG disk_num
Definition: btrfs_drv.h:844
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#define FILE_READ_ATTRIBUTES
Definition: nt_native.h:647
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
int ret
void volume_removal(PDRIVER_OBJECT DriverObject, PUNICODE_STRING devpath)
Definition: search.c:595
static const WCHAR L[]
Definition: oid.c:1250
void add_volume_device(superblock *sb, PDEVICE_OBJECT mountmgr, PUNICODE_STRING devpath, UINT64 length, ULONG disk_num, ULONG part_num)
Definition: volume.c:1023
Definition: typedefs.h:117
#define _Releases_exclusive_lock_(a)
Definition: btrfs_drv.h:185
pnp_callback func
Definition: search.c:655
UINT8 checksum[32]
Definition: btrfs.h:206
LARGE_INTEGER Length
Definition: winioctl.h:423
__u8 sector_size[2]
Definition: mkdosfs.c:361
static void mountmgr_process_drive(PDEVICE_OBJECT mountmgr, PUNICODE_STRING device_name)
Definition: search.c:749
Status
Definition: gdiplustypes.h:24
MOUNTMGR_MOUNT_POINT MountPoints[1]
Definition: imports.h:177
#define ERR(fmt,...)
Definition: debug.h:109
VOID NTAPI IoQueueWorkItem(IN PIO_WORKITEM IoWorkItem, IN PIO_WORKITEM_ROUTINE WorkerRoutine, IN WORK_QUEUE_TYPE QueueType, IN PVOID Context)
Definition: iowork.c:40
#define _In_
Definition: no_sal2.h:204
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1250
VOID NTAPI IoInvalidateDeviceRelations(IN PDEVICE_OBJECT DeviceObject, IN DEVICE_RELATION_TYPE Type)
Definition: pnpmgr.c:5090
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:61
#define IOCTL_DISK_GET_DRIVE_LAYOUT_EX
Definition: ntddk_ex.h:207
PIO_WORKITEM work_item
Definition: search.c:656
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
BTRFS_UUID uuid
Definition: btrfs.h:207
const GUID GUID_DEVICE_INTERFACE_REMOVAL
Definition: deviface.c:15
static void enqueue_pnp_callback(PDRIVER_OBJECT DriverObject, PUNICODE_STRING name, pnp_callback func)
Definition: search.c:677
UINT64 generation
Definition: btrfs.h:211
NTSTATUS NTAPI PsTerminateSystemThread(IN NTSTATUS ExitStatus)
Definition: kill.c:1144
Definition: services.c:325
UNICODE_STRING registry_path
Definition: btrfs.c:85
Definition: list.h:27
NTSTATUS NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1218
USHORT NameLength
Definition: imports.h:143
BOOLEAN NTAPI ExAcquireResourceSharedLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:885
PIRP NTAPI IoBuildDeviceIoControlRequest(IN ULONG IoControlCode, IN PDEVICE_OBJECT DeviceObject, IN PVOID InputBuffer, IN ULONG InputBufferLength, IN PVOID OutputBuffer, IN ULONG OutputBufferLength, IN BOOLEAN InternalDeviceIoControl, IN PKEVENT Event, IN PIO_STATUS_BLOCK IoStatusBlock)
Definition: irp.c:881
NTSTATUS sync_read_phys(_In_ PDEVICE_OBJECT DeviceObject, _In_ UINT64 StartingOffset, _In_ ULONG Length, _Out_writes_bytes_(Length) PUCHAR Buffer, _In_ BOOL override)
Definition: btrfs.c:2484
volume_device_extension * vde
Definition: btrfs_drv.h:867
static ACCESS_MASK const OBJECT_ATTRIBUTES ULONG const UNICODE_STRING ULONG PULONG dispos
Definition: reg.c:130
Definition: name.c:36
ULONG SymbolicLinkNameOffset
Definition: imports.h:166
ULONG ERESOURCE
Definition: env_spec_w32.h:594
Definition: msctf.idl:510
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
unsigned long long UINT64
VOID NTAPI KeClearEvent(IN PKEVENT Event)
Definition: eventobj.c:22
LIST_ENTRY children
Definition: btrfs_drv.h:874
int remove
Definition: msacm.c:1353
return STATUS_SUCCESS
Definition: btrfs.c:2777
UNICODE_STRING name
Definition: search.c:654
unsigned char UINT8
#define REG_DWORD
Definition: sdbapi.c:596
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
PDEVICE_OBJECT buspdo
Definition: btrfs_drv.h:828
static uint64_t __inline sector_align(uint64_t n, uint64_t a)
struct _DRIVER_OBJECT * PDRIVER_OBJECT
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define IOCTL_DISK_GET_DRIVE_GEOMETRY
Definition: cdrw_usr.h:169
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465
#define IOCTL_MOUNTMGR_DELETE_POINTS
Definition: imports.h:124
void volume_arrival(PDRIVER_OBJECT DriverObject, PUNICODE_STRING devpath)
Definition: search.c:500
LONGLONG QuadPart
Definition: typedefs.h:112
#define BTRFS_MAGIC
Definition: btrfs.h:42
GLuint const GLchar * name
Definition: glext.h:6031