ReactOS  0.4.13-dev-961-g238ea69
point.c
Go to the documentation of this file.
1 /*
2  * ReactOS kernel
3  * Copyright (C) 2011-2012 ReactOS Team
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program 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 General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
18  *
19  * COPYRIGHT: See COPYING in the top level directory
20  * PROJECT: ReactOS kernel
21  * FILE: drivers/filesystem/mountmgr/point.c
22  * PURPOSE: Mount Manager - Mount points
23  * PROGRAMMER: Pierre Schweitzer (pierre.schweitzer@reactos.org)
24  */
25 
26 #include "mntmgr.h"
27 
28 #define NDEBUG
29 #include <debug.h>
30 
31 /*
32  * @implemented
33  */
36  IN PUNICODE_STRING SymbolicLinkName,
38 {
40  PLIST_ENTRY DeviceEntry;
41  PMOUNTDEV_UNIQUE_ID UniqueId;
42  PSYMLINK_INFORMATION SymlinkInformation;
43  UNICODE_STRING SymLink, TargetDeviceName;
44  PDEVICE_INFORMATION DeviceInformation = NULL, DeviceInfo;
45 
46  /* Get device name */
47  Status = QueryDeviceInformation(SymbolicLinkName,
48  &TargetDeviceName,
49  NULL, NULL, NULL,
50  NULL, NULL, NULL);
51  if (!NT_SUCCESS(Status))
52  {
53  return Status;
54  }
55 
56  /* First of all, try to find device */
57  for (DeviceEntry = DeviceExtension->DeviceListHead.Flink;
58  DeviceEntry != &(DeviceExtension->DeviceListHead);
59  DeviceEntry = DeviceEntry->Flink)
60  {
61  DeviceInformation = CONTAINING_RECORD(DeviceEntry, DEVICE_INFORMATION, DeviceListEntry);
62 
63  if (RtlCompareUnicodeString(&TargetDeviceName, &(DeviceInformation->DeviceName), TRUE) == 0)
64  {
65  break;
66  }
67  }
68 
69  /* Copy symbolic link name and null terminate it */
70  SymLink.Buffer = AllocatePool(SymbolicLinkName->Length + sizeof(UNICODE_NULL));
71  if (!SymLink.Buffer)
72  {
73  FreePool(TargetDeviceName.Buffer);
75  }
76 
77  RtlCopyMemory(SymLink.Buffer, SymbolicLinkName->Buffer, SymbolicLinkName->Length);
78  SymLink.Buffer[SymbolicLinkName->Length / sizeof(WCHAR)] = UNICODE_NULL;
79  SymLink.Length = SymbolicLinkName->Length;
80  SymLink.MaximumLength = SymbolicLinkName->Length + sizeof(UNICODE_NULL);
81 
82  /* If we didn't find device */
83  if (DeviceEntry == &(DeviceExtension->DeviceListHead))
84  {
85  /* Then, try with unique ID */
86  Status = QueryDeviceInformation(SymbolicLinkName,
87  NULL, &UniqueId,
88  NULL, NULL, NULL,
89  NULL, NULL);
90  if (!NT_SUCCESS(Status))
91  {
92  FreePool(TargetDeviceName.Buffer);
93  FreePool(SymLink.Buffer);
94  return Status;
95  }
96 
97  /* Create a link to the device */
98  Status = GlobalCreateSymbolicLink(&SymLink, &TargetDeviceName);
99  if (!NT_SUCCESS(Status))
100  {
101  FreePool(UniqueId);
102  FreePool(TargetDeviceName.Buffer);
103  FreePool(SymLink.Buffer);
104  return Status;
105  }
106 
107  /* If caller provided driver letter, delete it */
108  if (IsDriveLetter(&SymLink))
109  {
110  DeleteRegistryDriveLetter(UniqueId);
111  }
112 
113  /* Device will be identified with its unique ID */
115  DatabasePath,
116  SymLink.Buffer,
117  REG_BINARY,
118  UniqueId->UniqueId,
119  UniqueId->UniqueIdLength);
120 
121  FreePool(UniqueId);
122  FreePool(TargetDeviceName.Buffer);
123  FreePool(SymLink.Buffer);
124  return Status;
125  }
126 
127  /* If call provided a driver letter whereas device already has one
128  * fail, this is not doable
129  */
130  if (IsDriveLetter(&SymLink) && HasDriveLetter(DeviceInformation))
131  {
132  FreePool(TargetDeviceName.Buffer);
133  FreePool(SymLink.Buffer);
135  }
136 
137  /* Now, create a link */
138  Status = GlobalCreateSymbolicLink(&SymLink, &TargetDeviceName);
139  FreePool(TargetDeviceName.Buffer);
140  if (!NT_SUCCESS(Status))
141  {
142  FreePool(SymLink.Buffer);
143  return Status;
144  }
145 
146  /* Associate Unique ID <-> symbolic name */
147  UniqueId = DeviceInformation->UniqueId;
149  DatabasePath,
150  SymLink.Buffer,
151  REG_BINARY,
152  UniqueId->UniqueId,
153  UniqueId->UniqueIdLength);
154  if (!NT_SUCCESS(Status))
155  {
156  GlobalDeleteSymbolicLink(&SymLink);
157  FreePool(SymLink.Buffer);
158  return Status;
159  }
160 
161  /* Now, prepare to save the link with the device */
162  SymlinkInformation = AllocatePool(sizeof(SYMLINK_INFORMATION));
163  if (!SymlinkInformation)
164  {
166  GlobalDeleteSymbolicLink(&SymLink);
167  FreePool(SymLink.Buffer);
168  return Status;
169  }
170 
171  SymlinkInformation->Name.Length = SymLink.Length;
172  SymlinkInformation->Name.MaximumLength = SymLink.Length + sizeof(UNICODE_NULL);
173  SymlinkInformation->Name.Buffer = AllocatePool(SymlinkInformation->Name.MaximumLength);
174  if (!SymlinkInformation->Name.Buffer)
175  {
177  FreePool(SymlinkInformation);
178  GlobalDeleteSymbolicLink(&SymLink);
179  FreePool(SymLink.Buffer);
180  return Status;
181  }
182 
183  /* Save the link and mark it online */
184  RtlCopyMemory(SymlinkInformation->Name.Buffer, SymLink.Buffer, SymlinkInformation->Name.Length);
185  SymlinkInformation->Name.Buffer[SymlinkInformation->Name.Length / sizeof(WCHAR)] = UNICODE_NULL;
186  SymlinkInformation->Online = TRUE;
187  InsertTailList(&DeviceInformation->SymbolicLinksListHead, &SymlinkInformation->SymbolicLinksListEntry);
188  SendLinkCreated(&(SymlinkInformation->Name));
189 
190  /* If we have a drive letter */
191  if (IsDriveLetter(&SymLink))
192  {
193  /* Then, delete the no drive letter entry */
194  DeleteNoDriveLetterEntry(UniqueId);
195 
196  /* And post online notification if asked */
197  if (!DeviceInformation->SkipNotifications)
198  {
199  PostOnlineNotification(DeviceExtension, &DeviceInformation->SymbolicName);
200  }
201  }
202 
203  /* If that's a volume with automatic drive letter, it's now time to resync databases */
204  if (MOUNTMGR_IS_VOLUME_NAME(&SymLink) && DeviceExtension->AutomaticDriveLetter)
205  {
206  for (DeviceEntry = DeviceExtension->DeviceListHead.Flink;
207  DeviceEntry != &(DeviceExtension->DeviceListHead);
208  DeviceEntry = DeviceEntry->Flink)
209  {
210  DeviceInfo = CONTAINING_RECORD(DeviceEntry, DEVICE_INFORMATION, DeviceListEntry);
211 
212  /* If there's one, ofc! */
213  if (!DeviceInfo->NoDatabase)
214  {
216  }
217  }
218  }
219 
220  /* Notify & quit */
221  FreePool(SymLink.Buffer);
222  MountMgrNotify(DeviceExtension);
223 
224  if (!DeviceInformation->ManuallyRegistered)
225  {
226  MountMgrNotifyNameChange(DeviceExtension, DeviceName, FALSE);
227  }
228 
229  return Status;
230 }
231 
232 /*
233  * @implemented
234  */
235 NTSTATUS
237  IN PIRP Irp,
240 {
242  PIO_STACK_LOCATION Stack;
244  ULONG TotalSize, TotalSymLinks;
245  PMOUNTMGR_MOUNT_POINTS MountPoints;
246  PDEVICE_INFORMATION DeviceInformation;
247  PLIST_ENTRY DeviceEntry, SymlinksEntry;
248  PSYMLINK_INFORMATION SymlinkInformation;
249 
250  /* If we got a symbolic link, query device */
251  if (SymbolicName)
252  {
254  &DeviceName,
255  NULL, NULL,
256  NULL, NULL,
257  NULL, NULL);
258  if (!NT_SUCCESS(Status))
259  {
260  return Status;
261  }
262  }
263 
264  /* Browse all the links to count number of links & size used */
265  TotalSize = 0;
266  TotalSymLinks = 0;
267  for (DeviceEntry = DeviceExtension->DeviceListHead.Flink;
268  DeviceEntry != &(DeviceExtension->DeviceListHead);
269  DeviceEntry = DeviceEntry->Flink)
270  {
271  DeviceInformation = CONTAINING_RECORD(DeviceEntry, DEVICE_INFORMATION, DeviceListEntry);
272 
273  /* If we were given an unique ID, it has to match */
274  if (UniqueId)
275  {
276  if (UniqueId->UniqueIdLength != DeviceInformation->UniqueId->UniqueIdLength)
277  {
278  continue;
279  }
280 
281  if (RtlCompareMemory(UniqueId->UniqueId,
282  DeviceInformation->UniqueId->UniqueId,
283  UniqueId->UniqueIdLength) != UniqueId->UniqueIdLength)
284  {
285  continue;
286  }
287  }
288  /* Or, if we had a symlink, it has to match */
289  else if (SymbolicName)
290  {
291  if (!RtlEqualUnicodeString(&DeviceName, &(DeviceInformation->DeviceName), TRUE))
292  {
293  continue;
294  }
295  }
296 
297  /* Once here, it matched, save device name & unique ID size */
298  TotalSize += DeviceInformation->DeviceName.Length + DeviceInformation->UniqueId->UniqueIdLength;
299 
300  /* And count number of symlinks (and their size) */
301  for (SymlinksEntry = DeviceInformation->SymbolicLinksListHead.Flink;
302  SymlinksEntry != &(DeviceInformation->SymbolicLinksListHead);
303  SymlinksEntry = SymlinksEntry->Flink)
304  {
305  SymlinkInformation = CONTAINING_RECORD(SymlinksEntry, SYMLINK_INFORMATION, SymbolicLinksListEntry);
306 
307  TotalSize += SymlinkInformation->Name.Length;
308  TotalSymLinks++;
309  }
310 
311  /* We had a specific item to find
312  * if we reach that point, we found it, no need to continue
313  */
314  if (UniqueId || SymbolicName)
315  {
316  break;
317  }
318  }
319 
320  /* If we were looking for specific item, ensure we found it */
321  if (UniqueId || SymbolicName)
322  {
323  if (DeviceEntry == &(DeviceExtension->DeviceListHead))
324  {
325  if (SymbolicName)
326  {
327  FreePool(DeviceName.Buffer);
328  }
329 
331  }
332  }
333 
334  /* Now, ensure output buffer can hold everything */
336  MountPoints = (PMOUNTMGR_MOUNT_POINTS)Irp->AssociatedIrp.SystemBuffer;
337 
338  /* Ensure we set output to let user reallocate! */
339  MountPoints->Size = sizeof(MOUNTMGR_MOUNT_POINTS) + TotalSize;
340  MountPoints->NumberOfMountPoints = TotalSymLinks;
341 
342  if (MountPoints->Size > Stack->Parameters.DeviceIoControl.OutputBufferLength)
343  {
344  return STATUS_BUFFER_OVERFLOW;
345  }
346 
347  /* Now, start putting mount points */
348  TotalSymLinks = 0;
349  TotalSize = 0;
350  for (DeviceEntry = DeviceExtension->DeviceListHead.Flink;
351  DeviceEntry != &(DeviceExtension->DeviceListHead);
352  DeviceEntry = DeviceEntry->Flink)
353  {
354  DeviceInformation = CONTAINING_RECORD(DeviceEntry, DEVICE_INFORMATION, DeviceListEntry);
355 
356  /* Find back correct mount point */
357  if (UniqueId)
358  {
359  if (UniqueId->UniqueIdLength != DeviceInformation->UniqueId->UniqueIdLength)
360  {
361  continue;
362  }
363 
364  if (RtlCompareMemory(UniqueId->UniqueId,
365  DeviceInformation->UniqueId->UniqueId,
366  UniqueId->UniqueIdLength) != UniqueId->UniqueIdLength)
367  {
368  continue;
369  }
370  }
371  else if (SymbolicName)
372  {
373  if (!RtlEqualUnicodeString(&DeviceName, &(DeviceInformation->DeviceName), TRUE))
374  {
375  continue;
376  }
377  }
378 
379  /* Now we've got it, but all the data */
380  for (SymlinksEntry = DeviceInformation->SymbolicLinksListHead.Flink;
381  SymlinksEntry != &(DeviceInformation->SymbolicLinksListHead);
382  SymlinksEntry = SymlinksEntry->Flink)
383  {
384  SymlinkInformation = CONTAINING_RECORD(SymlinksEntry, SYMLINK_INFORMATION, SymbolicLinksListEntry);
385 
386 
387  MountPoints->MountPoints[TotalSymLinks].SymbolicLinkNameOffset = sizeof(MOUNTMGR_MOUNT_POINTS) +
388  TotalSize;
389  MountPoints->MountPoints[TotalSymLinks].SymbolicLinkNameLength = SymlinkInformation->Name.Length;
390  MountPoints->MountPoints[TotalSymLinks].UniqueIdOffset = sizeof(MOUNTMGR_MOUNT_POINTS) +
391  SymlinkInformation->Name.Length +
392  TotalSize;
393  MountPoints->MountPoints[TotalSymLinks].UniqueIdLength = DeviceInformation->UniqueId->UniqueIdLength;
394  MountPoints->MountPoints[TotalSymLinks].DeviceNameOffset = sizeof(MOUNTMGR_MOUNT_POINTS) +
395  SymlinkInformation->Name.Length +
396  DeviceInformation->UniqueId->UniqueIdLength +
397  TotalSize;
398  MountPoints->MountPoints[TotalSymLinks].DeviceNameLength = DeviceInformation->DeviceName.Length;
399 
400  RtlCopyMemory((PWSTR)((ULONG_PTR)MountPoints + MountPoints->MountPoints[TotalSymLinks].SymbolicLinkNameOffset),
401  SymlinkInformation->Name.Buffer, SymlinkInformation->Name.Length);
402  RtlCopyMemory((PWSTR)((ULONG_PTR)MountPoints + MountPoints->MountPoints[TotalSymLinks].UniqueIdOffset),
403  DeviceInformation->UniqueId->UniqueId, DeviceInformation->UniqueId->UniqueIdLength);
404  RtlCopyMemory((PWSTR)((ULONG_PTR)MountPoints + MountPoints->MountPoints[TotalSymLinks].DeviceNameOffset),
405  DeviceInformation->DeviceName.Buffer, DeviceInformation->DeviceName.Length);
406 
407  /* Update counters */
408  TotalSymLinks++;
409  TotalSize += SymlinkInformation->Name.Length + DeviceInformation->UniqueId->UniqueIdLength +
410  DeviceInformation->DeviceName.Length;
411  }
412 
413  if (UniqueId || SymbolicName)
414  {
415  break;
416  }
417  }
418 
419  return STATUS_SUCCESS;
420 }
421 
422 /*
423  * @implemented
424  */
425 NTSTATUS
428  IN PIRP Irp)
429 {
432  PIO_STACK_LOCATION Stack;
434  PMOUNTMGR_MOUNT_POINTS MountPoints;
435  PDEVICE_INFORMATION DeviceInformation = NULL;
436  PLIST_ENTRY DeviceEntry, SymlinksEntry;
437  PSYMLINK_INFORMATION SymlinkInformation;
438 
439  /* Find device */
441  NULL, NULL, NULL,
442  NULL, NULL, NULL);
443  if (NT_SUCCESS(Status))
444  {
445  /* Look for the device information */
446  for (DeviceEntry = DeviceExtension->DeviceListHead.Flink;
447  DeviceEntry != &(DeviceExtension->DeviceListHead);
448  DeviceEntry = DeviceEntry->Flink)
449  {
450  DeviceInformation = CONTAINING_RECORD(DeviceEntry, DEVICE_INFORMATION, DeviceListEntry);
451 
452  if (RtlEqualUnicodeString(&DeviceName, &(DeviceInformation->DeviceName), TRUE) == 0)
453  {
454  break;
455  }
456  }
457 
458  FreePool(DeviceName.Buffer);
459 
460  if (DeviceEntry == &(DeviceExtension->DeviceListHead))
461  {
463  }
464 
465  /* Check for the link */
466  for (SymlinksEntry = DeviceInformation->SymbolicLinksListHead.Flink;
467  SymlinksEntry != &(DeviceInformation->SymbolicLinksListHead);
468  SymlinksEntry = DeviceEntry->Flink)
469  {
470  SymlinkInformation = CONTAINING_RECORD(SymlinksEntry, SYMLINK_INFORMATION, SymbolicLinksListEntry);
471 
472  if (RtlEqualUnicodeString(SymbolicName, &SymlinkInformation->Name, TRUE) == 0)
473  {
474  break;
475  }
476  }
477 
478  if (SymlinksEntry == &(DeviceInformation->SymbolicLinksListHead))
479  {
481  }
482  }
483  else
484  {
485  /* Browse all the devices to try to find the one
486  * that has the given link...
487  */
488  for (DeviceEntry = DeviceExtension->DeviceListHead.Flink;
489  DeviceEntry != &(DeviceExtension->DeviceListHead);
490  DeviceEntry = DeviceEntry->Flink)
491  {
492  DeviceInformation = CONTAINING_RECORD(DeviceEntry, DEVICE_INFORMATION, DeviceListEntry);
493 
494  for (SymlinksEntry = DeviceInformation->SymbolicLinksListHead.Flink;
495  SymlinksEntry != &(DeviceInformation->SymbolicLinksListHead);
496  SymlinksEntry = SymlinksEntry->Flink)
497  {
498  SymlinkInformation = CONTAINING_RECORD(SymlinksEntry, SYMLINK_INFORMATION, SymbolicLinksListEntry);
499 
500  if (RtlEqualUnicodeString(SymbolicName, &SymlinkInformation->Name, TRUE) == 0)
501  {
502  break;
503  }
504  }
505 
506  if (SymlinksEntry != &(DeviceInformation->SymbolicLinksListHead))
507  {
508  break;
509  }
510  }
511 
512  /* Even that way we didn't find, give up! */
513  if (DeviceEntry == &(DeviceExtension->DeviceListHead))
514  {
516  }
517  }
518 
519  /* Get output buffer */
521  MountPoints = (PMOUNTMGR_MOUNT_POINTS)Irp->AssociatedIrp.SystemBuffer;
522 
523  /* Compute output length */
524  TotalLength = DeviceInformation->UniqueId->UniqueIdLength +
525  SymlinkInformation->Name.Length + DeviceInformation->DeviceName.Length;
526 
527  /* Give length to allow reallocation */
528  MountPoints->Size = sizeof(MOUNTMGR_MOUNT_POINTS) + TotalLength;
529  MountPoints->NumberOfMountPoints = 1;
530 
531  if (MountPoints->Size > Stack->Parameters.DeviceIoControl.OutputBufferLength)
532  {
533  return STATUS_BUFFER_OVERFLOW;
534  }
535 
536  /* Write out data */
537  MountPoints->MountPoints[0].SymbolicLinkNameOffset = sizeof(MOUNTMGR_MOUNT_POINTS);
538  MountPoints->MountPoints[0].SymbolicLinkNameLength = SymlinkInformation->Name.Length;
539  /* If link is online write it's unique ID, otherwise, forget about it */
540  if (SymlinkInformation->Online)
541  {
542  MountPoints->MountPoints[0].UniqueIdOffset = sizeof(MOUNTMGR_MOUNT_POINTS) +
543  SymlinkInformation->Name.Length;
544  MountPoints->MountPoints[0].UniqueIdLength = DeviceInformation->UniqueId->UniqueIdLength;
545  }
546  else
547  {
548  MountPoints->MountPoints[0].UniqueIdOffset = 0;
549  MountPoints->MountPoints[0].UniqueIdLength = 0;
550  }
551 
552  MountPoints->MountPoints[0].DeviceNameOffset = sizeof(MOUNTMGR_MOUNT_POINTS) +
553  SymlinkInformation->Name.Length +
554  DeviceInformation->UniqueId->UniqueIdLength;
555  MountPoints->MountPoints[0].DeviceNameLength = DeviceInformation->DeviceName.Length;
556 
557  RtlCopyMemory((PWSTR)((ULONG_PTR)MountPoints + MountPoints->MountPoints[0].SymbolicLinkNameOffset),
558  SymlinkInformation->Name.Buffer, SymlinkInformation->Name.Length);
559 
560  if (SymlinkInformation->Online)
561  {
562  RtlCopyMemory((PWSTR)((ULONG_PTR)MountPoints + MountPoints->MountPoints[0].UniqueIdOffset),
563  DeviceInformation->UniqueId->UniqueId, DeviceInformation->UniqueId->UniqueIdLength);
564  }
565 
566  RtlCopyMemory((PWSTR)((ULONG_PTR)MountPoints + MountPoints->MountPoints[0].DeviceNameOffset),
567  DeviceInformation->DeviceName.Buffer, DeviceInformation->DeviceName.Length);
568 
569  return STATUS_SUCCESS;
570 }
VOID DeleteRegistryDriveLetter(IN PMOUNTDEV_UNIQUE_ID UniqueId)
Definition: database.c:2027
#define IN
Definition: typedefs.h:38
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
USHORT MaximumLength
Definition: env_spec_w32.h:370
struct _MOUNTMGR_MOUNT_POINTS * PMOUNTMGR_MOUNT_POINTS
#define REG_BINARY
Definition: nt_native.h:1496
_In_ PIRP Irp
Definition: csq.h:116
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
uint16_t * PWSTR
Definition: typedefs.h:54
NTSTATUS GlobalDeleteSymbolicLink(IN PUNICODE_STRING DosName)
Definition: symlink.c:138
_In_ PNDIS_STRING _In_ PNDIS_STRING SymbolicName
Definition: ndis.h:4676
LONG NTSTATUS
Definition: precomp.h:26
USHORT UniqueIdLength
Definition: imports.h:138
NTSTATUS QueryPointsFromSymbolicLinkName(IN PDEVICE_EXTENSION DeviceExtension, IN PUNICODE_STRING SymbolicName, IN PIRP Irp)
Definition: point.c:426
NTSTATUS MountMgrCreatePointWorker(IN PDEVICE_EXTENSION DeviceExtension, IN PUNICODE_STRING SymbolicLinkName, IN PUNICODE_STRING DeviceName)
Definition: point.c:35
BOOLEAN IsDriveLetter(PUNICODE_STRING SymbolicName)
Definition: symlink.c:924
WCHAR DeviceName[]
Definition: adapter.cpp:21
#define InsertTailList(ListHead, Entry)
_In_ ULONG TotalLength
Definition: usbdlib.h:145
VOID DeleteNoDriveLetterEntry(IN PMOUNTDEV_UNIQUE_ID UniqueId)
Definition: database.c:2079
#define FreePool(P)
Definition: mntmgr.h:154
UNICODE_STRING SymbolicName
Definition: mntmgr.h:48
uint32_t ULONG_PTR
Definition: typedefs.h:63
VOID ReconcileThisDatabaseWithMaster(IN PDEVICE_EXTENSION DeviceExtension, IN PDEVICE_INFORMATION DeviceInformation)
Definition: database.c:1594
#define UNICODE_NULL
#define MOUNTMGR_IS_VOLUME_NAME(s)
Definition: mountmgr.h:61
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
USHORT DeviceNameLength
Definition: imports.h:171
NTSTATUS QueryDeviceInformation(IN PUNICODE_STRING SymbolicName, OUT PUNICODE_STRING DeviceName OPTIONAL, OUT PMOUNTDEV_UNIQUE_ID *UniqueId OPTIONAL, OUT PBOOLEAN Removable OPTIONAL, OUT PBOOLEAN GptDriveLetter OPTIONAL, OUT PBOOLEAN HasGuid OPTIONAL, IN OUT LPGUID StableGuid OPTIONAL, OUT PBOOLEAN Valid OPTIONAL)
Definition: mountmgr.c:204
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
BOOLEAN SkipNotifications
Definition: mntmgr.h:58
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
LIST_ENTRY SymbolicLinksListHead
Definition: mntmgr.h:45
struct _DeviceInfo DeviceInfo
struct _MOUNTMGR_MOUNT_POINTS MOUNTMGR_MOUNT_POINTS
NTSYSAPI NTSTATUS WINAPI RtlWriteRegistryValue(ULONG, PCWSTR, PCWSTR, ULONG, PVOID, ULONG)
ULONG RtlCompareUnicodeString(PUNICODE_STRING s1, PUNICODE_STRING s2, BOOLEAN UpCase)
Definition: string_lib.cpp:31
VOID MountMgrNotify(IN PDEVICE_EXTENSION DeviceExtension)
Definition: notify.c:311
NTSTATUS QueryPointsFromMemory(IN PDEVICE_EXTENSION DeviceExtension, IN PIRP Irp, IN PMOUNTDEV_UNIQUE_ID UniqueId OPTIONAL, IN PUNICODE_STRING SymbolicName OPTIONAL)
Definition: point.c:236
Definition: typedefs.h:117
#define RTL_REGISTRY_ABSOLUTE
Definition: nt_native.h:161
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2647
BOOLEAN ManuallyRegistered
Definition: mntmgr.h:53
#define AllocatePool(Size)
Definition: mntmgr.h:153
PWSTR DatabasePath
Definition: database.c:31
Status
Definition: gdiplustypes.h:24
VOID PostOnlineNotification(IN PDEVICE_EXTENSION DeviceExtension, IN PUNICODE_STRING SymbolicName)
Definition: notify.c:145
MOUNTMGR_MOUNT_POINT MountPoints[1]
Definition: imports.h:177
#define STATUS_OBJECT_NAME_NOT_FOUND
Definition: udferr_usr.h:149
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:61
NTSTATUS GlobalCreateSymbolicLink(IN PUNICODE_STRING DosName, IN PUNICODE_STRING DeviceName)
Definition: symlink.c:111
BOOLEAN HasDriveLetter(IN PDEVICE_INFORMATION DeviceInformation)
Definition: mountmgr.c:87
UNICODE_STRING DeviceName
Definition: mntmgr.h:50
ULONG SymbolicLinkNameOffset
Definition: imports.h:166
unsigned int ULONG
Definition: retypes.h:1
USHORT SymbolicLinkNameLength
Definition: imports.h:167
#define ULONG_PTR
Definition: config.h:101
VOID SendLinkCreated(IN PUNICODE_STRING SymbolicName)
Definition: symlink.c:162
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2771
return STATUS_SUCCESS
Definition: btrfs.c:2777
PMOUNTDEV_UNIQUE_ID UniqueId
Definition: mntmgr.h:49
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
UCHAR UniqueId[1]
Definition: imports.h:139
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465
VOID MountMgrNotifyNameChange(IN PDEVICE_EXTENSION DeviceExtension, IN PUNICODE_STRING DeviceName, IN BOOLEAN ValidateVolume)
Definition: notify.c:350
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68