Index: trunk/src/VBox/Additions/WINNT/SharedFolders/driver/file.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/SharedFolders/driver/file.cpp	(revision 78325)
+++ trunk/src/VBox/Additions/WINNT/SharedFolders/driver/file.cpp	(revision 78326)
@@ -302,5 +302,5 @@
     ByteCount = ctx.cbData;
 
-    Status = VBoxErrorToNTStatus(vrc);
+    Status = vbsfNtVBoxStatusToNt(vrc);
 
     if (Status != STATUS_SUCCESS)
@@ -418,5 +418,5 @@
     ByteCount = ctx.cbData;
 
-    Status = VBoxErrorToNTStatus(vrc);
+    Status = vbsfNtVBoxStatusToNt(vrc);
 
     if (Status != STATUS_SUCCESS)
@@ -516,5 +516,5 @@
                        LowIoContext->ParamsFor.Locks.ByteOffset, LowIoContext->ParamsFor.Locks.Length, fu32Lock);
 
-    Status = VBoxErrorToNTStatus(vrc);
+    Status = vbsfNtVBoxStatusToNt(vrc);
 
     Log(("VBOXSF: MRxLocks: Returned 0x%08X\n", Status));
@@ -547,5 +547,5 @@
     vrc = VbglR0SfFlush(&g_SfClient, &pNetRootExtension->map, pVBoxFobx->hFile);
 
-    Status = VBoxErrorToNTStatus(vrc);
+    Status = vbsfNtVBoxStatusToNt(vrc);
 
     Log(("VBOXSF: MRxFlush: Returned 0x%08X\n", Status));
@@ -553,5 +553,5 @@
 }
 
-NTSTATUS vbsfSetEndOfFile(IN OUT struct _RX_CONTEXT * RxContext,
+NTSTATUS vbsfNtSetEndOfFile(IN OUT struct _RX_CONTEXT * RxContext,
                           IN OUT PLARGE_INTEGER pNewFileSize,
                           OUT PLARGE_INTEGER pNewAllocationSize)
@@ -569,5 +569,5 @@
     int vrc;
 
-    Log(("VBOXSF: vbsfSetEndOfFile: New size = %RX64 (%p), pNewAllocationSize = %p\n",
+    Log(("VBOXSF: vbsfNtSetEndOfFile: New size = %RX64 (%p), pNewAllocationSize = %p\n",
          pNewFileSize->QuadPart, pNewFileSize, pNewAllocationSize));
 
@@ -575,5 +575,5 @@
 
     cbBuffer = sizeof(SHFLFSOBJINFO);
-    pObjInfo = (SHFLFSOBJINFO *)vbsfAllocNonPagedMem(cbBuffer);
+    pObjInfo = (SHFLFSOBJINFO *)vbsfNtAllocNonPagedMem(cbBuffer);
     if (!pObjInfo)
     {
@@ -588,10 +588,10 @@
                          SHFL_INFO_SET | SHFL_INFO_SIZE, &cbBuffer, (PSHFLDIRINFO)pObjInfo);
 
-    Log(("VBOXSF: vbsfSetEndOfFile: VbglR0SfFsInfo returned %Rrc\n", vrc));
-
-    Status = VBoxErrorToNTStatus(vrc);
+    Log(("VBOXSF: vbsfNtSetEndOfFile: VbglR0SfFsInfo returned %Rrc\n", vrc));
+
+    Status = vbsfNtVBoxStatusToNt(vrc);
     if (Status == STATUS_SUCCESS)
     {
-        Log(("VBOXSF: vbsfSetEndOfFile: VbglR0SfFsInfo new allocation size = %RX64\n",
+        Log(("VBOXSF: vbsfNtSetEndOfFile: VbglR0SfFsInfo new allocation size = %RX64\n",
              pObjInfo->cbAllocated));
 
@@ -601,7 +601,7 @@
 
     if (pObjInfo)
-        vbsfFreeNonPagedMem(pObjInfo);
-
-    Log(("VBOXSF: vbsfSetEndOfFile: Returned 0x%08X\n", Status));
+        vbsfNtFreeNonPagedMem(pObjInfo);
+
+    Log(("VBOXSF: vbsfNtSetEndOfFile: Returned 0x%08X\n", Status));
     return Status;
 }
@@ -618,5 +618,5 @@
     RT_NOREF(RxContext);
 
-    /* Note: On Windows hosts vbsfSetEndOfFile returns ACCESS_DENIED if the file has been
+    /* Note: On Windows hosts vbsfNtSetEndOfFile returns ACCESS_DENIED if the file has been
      *       opened in APPEND mode. Writes to a file will extend it anyway, therefore it is
      *       better to not call the host at all and tell the caller that the file was extended.
Index: trunk/src/VBox/Additions/WINNT/SharedFolders/driver/info.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/SharedFolders/driver/info.cpp	(revision 78325)
+++ trunk/src/VBox/Additions/WINNT/SharedFolders/driver/info.cpp	(revision 78326)
@@ -95,5 +95,5 @@
          cbHGCMBuffer));
 
-    pHGCMBuffer = (uint8_t *)vbsfAllocNonPagedMem(cbHGCMBuffer);
+    pHGCMBuffer = (uint8_t *)vbsfNtAllocNonPagedMem(cbHGCMBuffer);
     if (!pHGCMBuffer)
     {
@@ -134,5 +134,5 @@
         Log(("VBOXSF: MrxQueryDirectory: ParsedPathSize = %d\n", ParsedPathSize));
 
-        ParsedPath = (PSHFLSTRING)vbsfAllocNonPagedMem(ParsedPathSize);
+        ParsedPath = (PSHFLSTRING)vbsfNtAllocNonPagedMem(ParsedPathSize);
         if (!ParsedPath)
         {
@@ -226,5 +226,5 @@
 
         default:
-            Status = VBoxErrorToNTStatus(vrc);
+            Status = vbsfNtVBoxStatusToNt(vrc);
             Log(("VBOXSF: MrxQueryDirectory: Error %Rrc from CallDirInfo (cFiles=%d)!\n",
                  vrc, cFiles));
@@ -510,8 +510,8 @@
 end:
     if (pHGCMBuffer)
-        vbsfFreeNonPagedMem(pHGCMBuffer);
+        vbsfNtFreeNonPagedMem(pHGCMBuffer);
 
     if (ParsedPath)
-        vbsfFreeNonPagedMem(ParsedPath);
+        vbsfNtFreeNonPagedMem(ParsedPath);
 
     Log(("VBOXSF: MrxQueryDirectory: Returned 0x%08X\n",
@@ -596,5 +596,5 @@
             /* Query serial number. */
             cbHGCMBuffer = sizeof(SHFLVOLINFO);
-            pHGCMBuffer = (uint8_t *)vbsfAllocNonPagedMem(cbHGCMBuffer);
+            pHGCMBuffer = (uint8_t *)vbsfNtAllocNonPagedMem(cbHGCMBuffer);
             if (!pHGCMBuffer)
             {
@@ -608,6 +608,6 @@
             if (vrc != VINF_SUCCESS)
             {
-                Status = VBoxErrorToNTStatus(vrc);
-                vbsfFreeNonPagedMem(pHGCMBuffer);
+                Status = vbsfNtVBoxStatusToNt(vrc);
+                vbsfNtFreeNonPagedMem(pHGCMBuffer);
                 break;
             }
@@ -615,5 +615,5 @@
             pShflVolInfo = (PSHFLVOLINFO)pHGCMBuffer;
             pInfo->VolumeSerialNumber = pShflVolInfo->ulSerial;
-            vbsfFreeNonPagedMem(pHGCMBuffer);
+            vbsfNtFreeNonPagedMem(pHGCMBuffer);
 
             pInfo->VolumeCreationTime.QuadPart = 0;
@@ -769,5 +769,5 @@
 
             cbHGCMBuffer = sizeof(SHFLVOLINFO);
-            pHGCMBuffer = (uint8_t *)vbsfAllocNonPagedMem(cbHGCMBuffer);
+            pHGCMBuffer = (uint8_t *)vbsfNtAllocNonPagedMem(cbHGCMBuffer);
             if (!pHGCMBuffer)
             {
@@ -781,6 +781,6 @@
             if (vrc != VINF_SUCCESS)
             {
-                Status = VBoxErrorToNTStatus(vrc);
-                vbsfFreeNonPagedMem(pHGCMBuffer);
+                Status = vbsfNtVBoxStatusToNt(vrc);
+                vbsfNtFreeNonPagedMem(pHGCMBuffer);
                 break;
             }
@@ -814,5 +814,5 @@
             }
 
-            vbsfFreeNonPagedMem(pHGCMBuffer);
+            vbsfNtFreeNonPagedMem(pHGCMBuffer);
 
             Status = STATUS_SUCCESS;
@@ -1089,5 +1089,5 @@
                 else
                 {
-                    Status = VBoxErrorToNTStatus(vrc);
+                    Status = vbsfNtVBoxStatusToNt(vrc);
                     VbglR0PhysHeapFree(pReq);
                     break;
@@ -1372,5 +1372,5 @@
 
             cbBuffer = sizeof(SHFLFSOBJINFO);
-            pHGCMBuffer = (uint8_t *)vbsfAllocNonPagedMem(cbBuffer);
+            pHGCMBuffer = (uint8_t *)vbsfNtAllocNonPagedMem(cbBuffer);
             AssertReturn(pHGCMBuffer, STATUS_INSUFFICIENT_RESOURCES);
             RtlZeroMemory(pHGCMBuffer, cbBuffer);
@@ -1418,5 +1418,5 @@
             else
             {
-                Status = VBoxErrorToNTStatus(vrc);
+                Status = vbsfNtVBoxStatusToNt(vrc);
                 goto end;
             }
@@ -1432,5 +1432,5 @@
 
             if (pInfo->DeleteFile && capFcb->OpenCount == 1)
-                Status = vbsfRemove(RxContext);
+                Status = vbsfNtRemove(RxContext);
             else
                 Status = STATUS_SUCCESS;
@@ -1469,5 +1469,5 @@
                 /* Treat the request as a EndOfFile update. */
                 LARGE_INTEGER NewAllocationSize;
-                Status = vbsfSetEndOfFile(RxContext, &pInfo->AllocationSize, &NewAllocationSize);
+                Status = vbsfNtSetEndOfFile(RxContext, &pInfo->AllocationSize, &NewAllocationSize);
             }
 
@@ -1483,5 +1483,5 @@
                  pInfo->EndOfFile.QuadPart, capFcb->Header.FileSize.QuadPart));
 
-            Status = vbsfSetEndOfFile(RxContext, &pInfo->EndOfFile, &NewAllocationSize);
+            Status = vbsfNtSetEndOfFile(RxContext, &pInfo->EndOfFile, &NewAllocationSize);
 
             Log(("VBOXSF: MrxSetFileInfo: FileEndOfFileInformation: AllocSize = 0x%RX64, Status 0x%08X\n",
@@ -1511,5 +1511,5 @@
 #endif
 
-            Status = vbsfRename(RxContext, FileRenameInformation, pInfoBuffer, RxContext->Info.Length);
+            Status = vbsfNtRename(RxContext, FileRenameInformation, pInfoBuffer, RxContext->Info.Length);
             break;
         }
@@ -1524,5 +1524,5 @@
 end:
     if (pHGCMBuffer)
-        vbsfFreeNonPagedMem(pHGCMBuffer);
+        vbsfNtFreeNonPagedMem(pHGCMBuffer);
 
     Log(("VBOXSF: MrxSetFileInfo: Returned 0x%08X\n", Status));
Index: trunk/src/VBox/Additions/WINNT/SharedFolders/driver/net.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/SharedFolders/driver/net.cpp	(revision 78325)
+++ trunk/src/VBox/Additions/WINNT/SharedFolders/driver/net.cpp	(revision 78326)
@@ -201,5 +201,5 @@
                  RootNameLength, RootNameLength / sizeof(WCHAR), pRootName));
 
-            Status = vbsfShflStringFromUnicodeAlloc(&ParsedPath, pRootName, (uint16_t)RootNameLength);
+            Status = vbsfNtShflStringFromUnicodeAlloc(&ParsedPath, pRootName, (uint16_t)RootNameLength);
             if (Status != STATUS_SUCCESS)
             {
@@ -208,5 +208,5 @@
 
             vrc = VbglR0SfMapFolder(&g_SfClient, ParsedPath, &pNetRootExtension->map);
-            vbsfFreeNonPagedMem(ParsedPath);
+            vbsfNtFreeNonPagedMem(ParsedPath);
             if (RT_SUCCESS(vrc))
             {
Index: trunk/src/VBox/Additions/WINNT/SharedFolders/driver/path.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/SharedFolders/driver/path.cpp	(revision 78325)
+++ trunk/src/VBox/Additions/WINNT/SharedFolders/driver/path.cpp	(revision 78326)
@@ -141,5 +141,5 @@
 
     /* Initialize create parameters. */
-    pCreateParms = (SHFLCREATEPARMS *)vbsfAllocNonPagedMem(sizeof(SHFLCREATEPARMS));
+    pCreateParms = (SHFLCREATEPARMS *)vbsfNtAllocNonPagedMem(sizeof(SHFLCREATEPARMS));
     if (!pCreateParms)
     {
@@ -265,5 +265,5 @@
         if (!bf.SlashHack)
         {
-            Status = vbsfShflStringFromUnicodeAlloc(&ParsedPath, RemainingName->Buffer, RemainingName->Length);
+            Status = vbsfNtShflStringFromUnicodeAlloc(&ParsedPath, RemainingName->Buffer, RemainingName->Length);
             if (Status != STATUS_SUCCESS)
                 goto failure;
@@ -272,5 +272,5 @@
         {
             /* Add back the slash we had to hide from RDBSS. */
-            Status = vbsfShflStringFromUnicodeAlloc(&ParsedPath, NULL, RemainingName->Length + sizeof(RTUTF16));
+            Status = vbsfNtShflStringFromUnicodeAlloc(&ParsedPath, NULL, RemainingName->Length + sizeof(RTUTF16));
             if (Status != STATUS_SUCCESS)
                 goto failure;
@@ -288,5 +288,5 @@
         vrc = VbglR0SfCreate(&g_SfClient, &pNetRootExtension->map, ParsedPath, pCreateParms);
 
-        vbsfFreeNonPagedMem(ParsedPath);
+        vbsfNtFreeNonPagedMem(ParsedPath);
     }
 
@@ -321,5 +321,5 @@
             {
                 *pulCreateAction = FILE_DOES_NOT_EXIST;
-                Status = VBoxErrorToNTStatus(vrc);
+                Status = vbsfNtVBoxStatusToNt(vrc);
                 goto failure;
             }
@@ -436,5 +436,5 @@
     *pInfo = pCreateParms->Info;
 
-    vbsfFreeNonPagedMem(pCreateParms);
+    vbsfNtFreeNonPagedMem(pCreateParms);
 
     return Status;
@@ -452,5 +452,5 @@
 
     if (pCreateParms)
-        vbsfFreeNonPagedMem(pCreateParms);
+        vbsfNtFreeNonPagedMem(pCreateParms);
 
     return Status;
@@ -689,5 +689,5 @@
 
     cbBuffer = sizeof(SHFLFSOBJINFO);
-    pHGCMBuffer = (uint8_t *)vbsfAllocNonPagedMem(cbBuffer);
+    pHGCMBuffer = (uint8_t *)vbsfNtAllocNonPagedMem(cbBuffer);
     if (!pHGCMBuffer)
     {
@@ -714,8 +714,8 @@
 
     if (vrc != VINF_SUCCESS)
-        Status = VBoxErrorToNTStatus(vrc);
+        Status = vbsfNtVBoxStatusToNt(vrc);
 
     if (pHGCMBuffer)
-        vbsfFreeNonPagedMem(pHGCMBuffer);
+        vbsfNtFreeNonPagedMem(pHGCMBuffer);
 
     Log(("VBOXSF: vbsfSetFileInfo: Returned 0x%08X\n", Status));
@@ -761,5 +761,5 @@
 
     if (vrc != VINF_SUCCESS)
-        Status = VBoxErrorToNTStatus(vrc);
+        Status = vbsfNtVBoxStatusToNt(vrc);
 
     Log(("VBOXSF: vbsfCloseFileHandle: Returned 0x%08X\n", Status));
@@ -811,5 +811,5 @@
         /* Remove file or directory if delete action is pending. */
         if (capFcb->OpenCount == 0)
-            Status = vbsfRemove(RxContext);
+            Status = vbsfNtRemove(RxContext);
     }
 
@@ -817,5 +817,5 @@
 }
 
-NTSTATUS vbsfRemove(IN PRX_CONTEXT RxContext)
+NTSTATUS vbsfNtRemove(IN PRX_CONTEXT RxContext)
 {
     NTSTATUS Status = STATUS_SUCCESS;
@@ -832,5 +832,5 @@
     PSHFLSTRING ParsedPath = NULL;
 
-    Log(("VBOXSF: vbsfRemove: Delete %.*ls. open count = %d\n",
+    Log(("VBOXSF: vbsfNtRemove: Delete %.*ls. open count = %d\n",
          RemainingName->Length / sizeof(WCHAR), RemainingName->Buffer, capFcb->OpenCount));
 
@@ -839,6 +839,6 @@
         vbsfCloseFileHandle(pNetRootExtension, pVBoxFobx);
 
-    Log(("VBOXSF: vbsfRemove: RemainingName->Length %d\n", RemainingName->Length));
-    Status = vbsfShflStringFromUnicodeAlloc(&ParsedPath, RemainingName->Buffer, RemainingName->Length);
+    Log(("VBOXSF: vbsfNtRemove: RemainingName->Length %d\n", RemainingName->Length));
+    Status = vbsfNtShflStringFromUnicodeAlloc(&ParsedPath, RemainingName->Buffer, RemainingName->Length);
     if (Status != STATUS_SUCCESS)
         return Status;
@@ -850,18 +850,18 @@
 
     if (ParsedPath)
-        vbsfFreeNonPagedMem(ParsedPath);
+        vbsfNtFreeNonPagedMem(ParsedPath);
 
     if (vrc == VINF_SUCCESS)
         SetFlag(capFobx->pSrvOpen->Flags, SRVOPEN_FLAG_FILE_DELETED);
 
-    Status = VBoxErrorToNTStatus(vrc);
+    Status = vbsfNtVBoxStatusToNt(vrc);
     if (vrc != VINF_SUCCESS)
-        Log(("VBOXSF: vbsfRemove: VbglR0SfRemove failed with %Rrc\n", vrc));
-
-    Log(("VBOXSF: vbsfRemove: Returned 0x%08X\n", Status));
+        Log(("VBOXSF: vbsfNtRemove: VbglR0SfRemove failed with %Rrc\n", vrc));
+
+    Log(("VBOXSF: vbsfNtRemove: Returned 0x%08X\n", Status));
     return Status;
 }
 
-NTSTATUS vbsfRename(IN PRX_CONTEXT RxContext,
+NTSTATUS vbsfNtRename(IN PRX_CONTEXT RxContext,
                     IN FILE_INFORMATION_CLASS FileInformationClass,
                     IN PVOID pBuffer,
@@ -888,5 +888,5 @@
     Assert(FileInformationClass == FileRenameInformation);
 
-    Log(("VBOXSF: vbsfRename: FileName = %.*ls\n",
+    Log(("VBOXSF: vbsfNtRename: FileName = %.*ls\n",
          RenameInformation->FileNameLength / sizeof(WCHAR), &RenameInformation->FileName[0]));
 
@@ -898,21 +898,21 @@
     SetFlag(pSrvOpen->Flags, SRVOPEN_FLAG_FILE_RENAMED);
 
-    Log(("VBOXSF: vbsfRename: RenameInformation->FileNameLength = %d\n", RenameInformation->FileNameLength));
-    Status = vbsfShflStringFromUnicodeAlloc(&DestPath, RenameInformation->FileName, (uint16_t)RenameInformation->FileNameLength);
+    Log(("VBOXSF: vbsfNtRename: RenameInformation->FileNameLength = %d\n", RenameInformation->FileNameLength));
+    Status = vbsfNtShflStringFromUnicodeAlloc(&DestPath, RenameInformation->FileName, (uint16_t)RenameInformation->FileNameLength);
     if (Status != STATUS_SUCCESS)
         return Status;
 
-    Log(("VBOXSF: vbsfRename: Destination path = %.*ls\n",
+    Log(("VBOXSF: vbsfNtRename: Destination path = %.*ls\n",
          DestPath->u16Length / sizeof(WCHAR), &DestPath->String.ucs2[0]));
 
-    Log(("VBOXSF: vbsfRename: RemainingName->Length = %d\n", RemainingName->Length));
-    Status = vbsfShflStringFromUnicodeAlloc(&SrcPath, RemainingName->Buffer, RemainingName->Length);
+    Log(("VBOXSF: vbsfNtRename: RemainingName->Length = %d\n", RemainingName->Length));
+    Status = vbsfNtShflStringFromUnicodeAlloc(&SrcPath, RemainingName->Buffer, RemainingName->Length);
     if (Status != STATUS_SUCCESS)
     {
-        vbsfFreeNonPagedMem(DestPath);
+        vbsfNtFreeNonPagedMem(DestPath);
         return Status;
     }
 
-    Log(("VBOXSF: vbsfRename: Source path = %.*ls\n",
+    Log(("VBOXSF: vbsfNtRename: Source path = %.*ls\n",
          SrcPath->u16Length / sizeof(WCHAR), &SrcPath->String.ucs2[0]));
 
@@ -922,15 +922,15 @@
         flags |= SHFL_RENAME_REPLACE_IF_EXISTS;
 
-    Log(("VBOXSF: vbsfRename: Calling VbglR0SfRename\n"));
+    Log(("VBOXSF: vbsfNtRename: Calling VbglR0SfRename\n"));
     vrc = VbglR0SfRename(&g_SfClient, &pNetRootExtension->map, SrcPath, DestPath, flags);
 
-    vbsfFreeNonPagedMem(SrcPath);
-    vbsfFreeNonPagedMem(DestPath);
-
-    Status = VBoxErrorToNTStatus(vrc);
+    vbsfNtFreeNonPagedMem(SrcPath);
+    vbsfNtFreeNonPagedMem(DestPath);
+
+    Status = vbsfNtVBoxStatusToNt(vrc);
     if (vrc != VINF_SUCCESS)
-        Log(("VBOXSF: vbsfRename: VbglR0SfRename failed with %Rrc\n", vrc));
-
-    Log(("VBOXSF: vbsfRename: Returned 0x%08X\n", Status));
+        Log(("VBOXSF: vbsfNtRename: VbglR0SfRename failed with %Rrc\n", vrc));
+
+    Log(("VBOXSF: vbsfNtRename: Returned 0x%08X\n", Status));
     return Status;
 }
Index: trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsf.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsf.cpp	(revision 78325)
+++ trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsf.cpp	(revision 78326)
@@ -76,5 +76,5 @@
     PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp);
     Log(("VBOXSF: MRxFsdDispatch: major %d, minor %d: %s\n",
-         IrpSp->MajorFunction, IrpSp->MinorFunction, MajorFunctionString(IrpSp->MajorFunction, IrpSp->MinorFunction)));
+         IrpSp->MajorFunction, IrpSp->MinorFunction, vbsfNtMajorFunctionName(IrpSp->MajorFunction, IrpSp->MinorFunction)));
 #endif
 
@@ -752,5 +752,5 @@
                 {
                     Log(("VBOXSF: MRxDevFcbXXXControlFile: IOCTL_MRX_VBOX_ADDCONN\n"));
-                    Status = vbsfCreateConnection(RxContext, &RxContext->PostRequest);
+                    Status = vbsfNtCreateConnection(RxContext, &RxContext->PostRequest);
                     break;
                 }
@@ -759,5 +759,5 @@
                 {
                     Log(("VBOXSF: MRxDevFcbXXXControlFile: IOCTL_MRX_VBOX_DELCONN\n"));
-                    Status = vbsfDeleteConnection(RxContext, &RxContext->PostRequest);
+                    Status = vbsfNtDeleteConnection(RxContext, &RxContext->PostRequest);
                     break;
                 }
@@ -851,5 +851,5 @@
                     else
                     {
-                        Status = VBoxErrorToNTStatus(vrc);
+                        Status = vbsfNtVBoxStatusToNt(vrc);
                         Log(("VBOXSF: MRxDevFcbXXXControlFile: IOCTL_MRX_VBOX_GETGLOBALLIST failed: 0x%08X\n",
                              Status));
@@ -969,5 +969,5 @@
 
                     /* Allocate empty string where the host can store cbRemoteName bytes. */
-                    Status = vbsfShflStringFromUnicodeAlloc(&pString, NULL, (uint16_t)cbRemoteName);
+                    Status = vbsfNtShflStringFromUnicodeAlloc(&pString, NULL, (uint16_t)cbRemoteName);
                     if (Status != STATUS_SUCCESS)
                         break;
@@ -999,5 +999,5 @@
                     }
 
-                    vbsfFreeNonPagedMem(pString);
+                    vbsfNtFreeNonPagedMem(pString);
 
                     break;
@@ -1272,5 +1272,5 @@
 }
 
-NTSTATUS vbsfCreateConnection(IN PRX_CONTEXT RxContext, OUT PBOOLEAN PostToFsp)
+NTSTATUS vbsfNtCreateConnection(IN PRX_CONTEXT RxContext, OUT PBOOLEAN PostToFsp)
 {
     NTSTATUS Status = STATUS_SUCCESS;
@@ -1287,9 +1287,9 @@
     BOOLEAN fMutexAcquired = FALSE;
 
-    Log(("VBOXSF: vbsfCreateConnection\n"));
+    Log(("VBOXSF: vbsfNtCreateConnection\n"));
 
     if (!BooleanFlagOn(RxContext->Flags, RX_CONTEXT_FLAG_WAIT))
     {
-        Log(("VBOXSF: vbsfCreateConnection: post to file system process\n"));
+        Log(("VBOXSF: vbsfNtCreateConnection: post to file system process\n"));
         *PostToFsp = TRUE;
         return STATUS_PENDING;
@@ -1306,5 +1306,5 @@
     if (cbConnectName == 0 || !pwcConnectName)
     {
-        Log(("VBOXSF: vbsfCreateConnection: Connection name / length is invalid!\n"));
+        Log(("VBOXSF: vbsfNtCreateConnection: Connection name / length is invalid!\n"));
         return STATUS_INVALID_PARAMETER;
     }
@@ -1312,5 +1312,5 @@
     __try
     {
-        Log(("VBOXSF: vbsfCreateConnection: Name = %.*ls, Len = %d\n",
+        Log(("VBOXSF: vbsfNtCreateConnection: Name = %.*ls, Len = %d\n",
              cbConnectName / sizeof(WCHAR), pwcConnectName, cbConnectName));
 
@@ -1347,5 +1347,5 @@
                     if (idx >= RTL_NUMBER_OF(pDeviceExtension->cLocalConnections))
                     {
-                        Log(("VBOXSF: vbsfCreateConnection: Index 0x%x is invalid!\n",
+                        Log(("VBOXSF: vbsfNtCreateConnection: Index 0x%x is invalid!\n",
                              idx));
                         Status = STATUS_BAD_NETWORK_NAME;
@@ -1358,13 +1358,13 @@
                         if (pDeviceExtension->wszLocalConnectionName[idx] != NULL)
                         {
-                            Log(("VBOXSF: vbsfCreateConnection: LocalConnectionName at index %d is NOT empty!\n",
+                            Log(("VBOXSF: vbsfNtCreateConnection: LocalConnectionName at index %d is NOT empty!\n",
                                  idx));
                         }
 
-                        pDeviceExtension->wszLocalConnectionName[idx] = (PUNICODE_STRING)vbsfAllocNonPagedMem(sizeof(UNICODE_STRING) + cbConnectName);
+                        pDeviceExtension->wszLocalConnectionName[idx] = (PUNICODE_STRING)vbsfNtAllocNonPagedMem(sizeof(UNICODE_STRING) + cbConnectName);
 
                         if (!pDeviceExtension->wszLocalConnectionName[idx])
                         {
-                            Log(("VBOXSF: vbsfCreateConnection: LocalConnectionName at index %d NOT allocated!\n",
+                            Log(("VBOXSF: vbsfNtCreateConnection: LocalConnectionName at index %d NOT allocated!\n",
                                  idx));
                             Status = STATUS_INSUFFICIENT_RESOURCES;
@@ -1379,5 +1379,5 @@
                             RtlCopyMemory(&pRemoteName->Buffer[0], pwc+2, pRemoteName->Length);
 
-                            Log(("VBOXSF: vbsfCreateConnection: RemoteName %.*ls, Len = %d\n",
+                            Log(("VBOXSF: vbsfNtCreateConnection: RemoteName %.*ls, Len = %d\n",
                                  pRemoteName->Length / sizeof(WCHAR), pRemoteName->Buffer, pRemoteName->Length));
 
@@ -1392,5 +1392,5 @@
             else
             {
-                Log(("VBOXSF: vbsfCreateConnection: bad format\n"));
+                Log(("VBOXSF: vbsfNtCreateConnection: bad format\n"));
                 Status = STATUS_BAD_NETWORK_NAME;
             }
@@ -1398,5 +1398,5 @@
         else
         {
-            Log(("VBOXSF: vbsfCreateConnection: connection was not found\n"));
+            Log(("VBOXSF: vbsfNtCreateConnection: connection was not found\n"));
             Status = STATUS_BAD_NETWORK_NAME;
         }
@@ -1416,5 +1416,5 @@
 }
 
-NTSTATUS vbsfDeleteConnection(IN PRX_CONTEXT RxContext, OUT PBOOLEAN PostToFsp)
+NTSTATUS vbsfNtDeleteConnection(IN PRX_CONTEXT RxContext, OUT PBOOLEAN PostToFsp)
 {
     NTSTATUS Status;
@@ -1428,9 +1428,9 @@
     BOOLEAN fMutexAcquired = FALSE;
 
-    Log(("VBOXSF: vbsfDeleteConnection\n"));
+    Log(("VBOXSF: vbsfNtDeleteConnection\n"));
 
     if (!BooleanFlagOn(RxContext->Flags, RX_CONTEXT_FLAG_WAIT))
     {
-        Log(("VBOXSF: vbsfDeleteConnection: post to file system process\n"));
+        Log(("VBOXSF: vbsfNtDeleteConnection: post to file system process\n"));
         *PostToFsp = TRUE;
         return STATUS_PENDING;
@@ -1447,5 +1447,5 @@
     __try
     {
-        Log(("VBOXSF: vbsfDeleteConnection: pwcConnectName = %.*ls\n",
+        Log(("VBOXSF: vbsfNtDeleteConnection: pwcConnectName = %.*ls\n",
              cbConnectName / sizeof(WCHAR), pwcConnectName));
 
@@ -1460,5 +1460,5 @@
             Status = ObReferenceObjectByHandle(Handle, 0L, NULL, KernelMode, (PVOID *)&pFileObject, NULL);
 
-            Log(("VBOXSF: vbsfDeleteConnection: ObReferenceObjectByHandle Status 0x%08X\n",
+            Log(("VBOXSF: vbsfNtDeleteConnection: ObReferenceObjectByHandle Status 0x%08X\n",
                  Status));
 
@@ -1466,5 +1466,5 @@
             {
                 PFOBX Fobx = (PFOBX)pFileObject->FsContext2;
-                Log(("VBOXSF: vbsfDeleteConnection: Fobx %p\n", Fobx));
+                Log(("VBOXSF: vbsfNtDeleteConnection: Fobx %p\n", Fobx));
 
                 if (Fobx && NodeType(Fobx) == RDBSS_NTC_V_NETROOT)
@@ -1480,5 +1480,5 @@
                 else
                 {
-                    Log(("VBOXSF: vbsfDeleteConnection: wrong FsContext2\n"));
+                    Log(("VBOXSF: vbsfNtDeleteConnection: wrong FsContext2\n"));
                     Status = STATUS_INVALID_DEVICE_REQUEST;
                 }
@@ -1515,5 +1515,5 @@
                         if (idx >= RTL_NUMBER_OF(pDeviceExtension->cLocalConnections))
                         {
-                            Log(("VBOXSF: vbsfDeleteConnection: Index 0x%x is invalid!\n",
+                            Log(("VBOXSF: vbsfNtDeleteConnection: Index 0x%x is invalid!\n",
                                  idx));
                             Status = STATUS_BAD_NETWORK_NAME;
@@ -1529,5 +1529,5 @@
                             if (pDeviceExtension->wszLocalConnectionName[idx])
                             {
-                                vbsfFreeNonPagedMem(pDeviceExtension->wszLocalConnectionName[idx]);
+                                vbsfNtFreeNonPagedMem(pDeviceExtension->wszLocalConnectionName[idx]);
                                 pDeviceExtension->wszLocalConnectionName[idx] = NULL;
                             }
@@ -1536,5 +1536,5 @@
                             fMutexAcquired = FALSE;
 
-                            Log(("VBOXSF: vbsfDeleteConnection: deleted index 0x%x\n",
+                            Log(("VBOXSF: vbsfNtDeleteConnection: deleted index 0x%x\n",
                                  idx));
                         }
@@ -1543,5 +1543,5 @@
                 else
                 {
-                    Log(("VBOXSF: vbsfCreateConnection: bad format\n"));
+                    Log(("VBOXSF: vbsfNtCreateConnection: bad format\n"));
                     Status = STATUS_BAD_NETWORK_NAME;
                 }
@@ -1560,5 +1560,5 @@
     }
 
-    Log(("VBOXSF: vbsfDeleteConnection: Status 0x%08X\n", Status));
+    Log(("VBOXSF: vbsfNtDeleteConnection: Status 0x%08X\n", Status));
     return Status;
 }
Index: trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsf.h
===================================================================
--- trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsf.h	(revision 78325)
+++ trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsf.h	(revision 78326)
@@ -213,17 +213,17 @@
  * @{
  */
-NTSTATUS vbsfDeleteConnection(IN PRX_CONTEXT RxContext,
-                              OUT PBOOLEAN PostToFsp);
-NTSTATUS vbsfCreateConnection(IN PRX_CONTEXT RxContext,
-                              OUT PBOOLEAN PostToFsp);
-
-NTSTATUS vbsfSetEndOfFile(IN OUT struct _RX_CONTEXT * RxContext,
-                          IN OUT PLARGE_INTEGER pNewFileSize,
-                          OUT PLARGE_INTEGER pNewAllocationSize);
-NTSTATUS vbsfRename(IN PRX_CONTEXT RxContext,
-                    IN FILE_INFORMATION_CLASS FileInformationClass,
-                    IN PVOID pBuffer,
-                    IN ULONG BufferLength);
-NTSTATUS vbsfRemove(IN PRX_CONTEXT RxContext);
+NTSTATUS vbsfNtDeleteConnection(IN PRX_CONTEXT RxContext,
+                                OUT PBOOLEAN PostToFsp);
+NTSTATUS vbsfNtCreateConnection(IN PRX_CONTEXT RxContext,
+                                OUT PBOOLEAN PostToFsp);
+
+NTSTATUS vbsfNtSetEndOfFile(IN OUT struct _RX_CONTEXT * RxContext,
+                            IN OUT PLARGE_INTEGER pNewFileSize,
+                            OUT PLARGE_INTEGER pNewAllocationSize);
+NTSTATUS vbsfNtRename(IN PRX_CONTEXT RxContext,
+                      IN FILE_INFORMATION_CLASS FileInformationClass,
+                      IN PVOID pBuffer,
+                      IN ULONG BufferLength);
+NTSTATUS vbsfNtRemove(IN PRX_CONTEXT RxContext);
 
 void     vbsfNtCopyInfoToLegacy(PMRX_VBOX_FOBX pVBoxFobx, PCSHFLFSOBJINFO pInfo);
@@ -231,16 +231,14 @@
 
 
-NTSTATUS vbsfHlpCreateDriveLetter(WCHAR Letter, UNICODE_STRING *pDeviceName);
-NTSTATUS vbsfHlpDeleteDriveLetter(WCHAR Letter);
-NTSTATUS VBoxErrorToNTStatus(int vrc);
-
-PVOID    vbsfAllocNonPagedMem(ULONG ulSize);
-void     vbsfFreeNonPagedMem(PVOID lpMem);
+NTSTATUS vbsfNtVBoxStatusToNt(int vrc);
+
+PVOID    vbsfNtAllocNonPagedMem(ULONG ulSize);
+void     vbsfNtFreeNonPagedMem(PVOID lpMem);
 
 #if defined(DEBUG) || defined(LOG_ENABLED)
-PCHAR MajorFunctionString(UCHAR MajorFunction, LONG MinorFunction);
+const char *vbsfNtMajorFunctionName(UCHAR MajorFunction, LONG MinorFunction);
 #endif
 
-NTSTATUS vbsfShflStringFromUnicodeAlloc(PSHFLSTRING *ppShflString, const WCHAR *pwc, uint16_t cb);
+NTSTATUS vbsfNtShflStringFromUnicodeAlloc(PSHFLSTRING *ppShflString, const WCHAR *pwc, uint16_t cb);
 
 /**
Index: trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsfhlp.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsfhlp.cpp	(revision 78325)
+++ trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsfhlp.cpp	(revision 78326)
@@ -28,29 +28,7 @@
 *********************************************************************************************************************************/
 #ifdef DEBUG
-static int s_iAllocRefCount = 0;
+static int volatile g_cAllocations = 0;
 #endif
 
-
-NTSTATUS vbsfHlpCreateDriveLetter(WCHAR Letter, UNICODE_STRING *pDeviceName)
-{
-    UNICODE_STRING driveName;
-    RtlInitUnicodeString(&driveName,L"\\??\\_:" );
-
-    /* Replace '_' with actual drive letter */
-    driveName.Buffer[driveName.Length/sizeof(WCHAR) - 2] = Letter;
-
-    return IoCreateSymbolicLink(&driveName, pDeviceName);
-}
-
-NTSTATUS vbsfHlpDeleteDriveLetter(WCHAR Letter)
-{
-    UNICODE_STRING driveName;
-    RtlInitUnicodeString(&driveName,L"\\??\\_:" );
-
-    /* Replace '_' with actual drive letter */
-    driveName.Buffer[driveName.Length/sizeof(WCHAR) - 2] = Letter;
-
-    return IoDeleteSymbolicLink(&driveName);
-}
 
 /**
@@ -61,5 +39,5 @@
  *
  */
-NTSTATUS VBoxErrorToNTStatus(int vrc)
+NTSTATUS vbsfNtVBoxStatusToNt(int vrc)
 {
     NTSTATUS Status;
@@ -147,5 +125,4 @@
 
         default:
-            /** @todo error handling */
             Status = STATUS_INVALID_PARAMETER;
             Log(("Unexpected vbox error %Rrc\n",
@@ -156,79 +133,97 @@
 }
 
-PVOID vbsfAllocNonPagedMem(ULONG ulSize)
-{
-    PVOID pMemory = NULL;
-
+/**
+ * Wrapper around ExAllocatePoolWithTag.
+ */
+PVOID vbsfNtAllocNonPagedMem(ULONG cbMemory)
+{
+    /* Tag is reversed (a.k.a "SHFL") to display correctly in debuggers, so search for "SHFL" */
+    PVOID pMemory = ExAllocatePoolWithTag(NonPagedPool, cbMemory, 'LFHS');
+    if (NULL != pMemory)
+    {
+        RtlZeroMemory(pMemory, cbMemory);
 #ifdef DEBUG
-    s_iAllocRefCount = s_iAllocRefCount + 1;
-    Log(("vbsfAllocNonPagedMem: RefCnt after incrementing: %d\n", s_iAllocRefCount));
+        int const cAllocations = g_cAllocations += 1;
+        Log(("vbsfNtAllocNonPagedMem: Allocated %u bytes of memory at %p (g_iAllocRefCount=%d)\n", cbMemory, pMemory, cAllocations));
 #endif
-
-    /* Tag is reversed (a.k.a "SHFL") to display correctly in debuggers, so search for "SHFL" */
-    pMemory = ExAllocatePoolWithTag(NonPagedPool, ulSize, 'LFHS');
-
-    if (NULL != pMemory)
-    {
-        RtlZeroMemory(pMemory, ulSize);
+    }
 #ifdef DEBUG
-        Log(("vbsfAllocNonPagedMem: Allocated %d bytes of memory at %p.\n", ulSize, pMemory));
+    else
+        Log(("vbsfNtAllocNonPagedMem: ERROR: Could not allocate %u bytes of memory!\n", cbMemory));
 #endif
+    return pMemory;
+}
+
+/**
+ * Wrapper around ExFreePoolWithTag.
+ */
+void vbsfNtFreeNonPagedMem(PVOID pvMemory)
+{
+#ifdef DEBUG
+    int cAllocations = g_cAllocations -= 1;
+    Log(("vbsfNtFreeNonPagedMem: %p (g_cAllocations=%d)\n", pvMemory, cAllocations));
+#endif
+    AssertPtr(pvMemory);
+
+    /* Tagged allocations must be freed using the same tag as used when allocating the memory. */
+    ExFreePoolWithTag(pvMemory, 'LFHS');
+}
+
+/** Allocate and initialize a SHFLSTRING from a UNICODE string.
+ *
+ *  @param ppShflString Where to store the pointer to the allocated SHFLSTRING structure.
+ *                      The structure must be deallocated with vbsfNtFreeNonPagedMem.
+ *  @param pwc          The UNICODE string. If NULL then SHFL is only allocated.
+ *  @param cb           Size of the UNICODE string in bytes without the trailing nul.
+ *
+ *  @return Status code.
+ */
+NTSTATUS vbsfNtShflStringFromUnicodeAlloc(PSHFLSTRING *ppShflString, const WCHAR *pwc, uint16_t cb)
+{
+    NTSTATUS    Status;
+
+    /* Calculate length required for the SHFL structure: header + chars + nul. */
+    ULONG const cbShflString = SHFLSTRING_HEADER_SIZE + cb + sizeof(WCHAR);
+    PSHFLSTRING pShflString  = (PSHFLSTRING)vbsfNtAllocNonPagedMem(cbShflString);
+    if (pShflString)
+    {
+        if (ShflStringInitBuffer(pShflString, cbShflString))
+        {
+            if (pwc)
+            {
+                RtlCopyMemory(pShflString->String.ucs2, pwc, cb);
+                pShflString->String.ucs2[cb / sizeof(WCHAR)] = 0;
+                pShflString->u16Length = cb; /* without terminating null */
+                AssertMsg(pShflString->u16Length + sizeof(WCHAR) == pShflString->u16Size,
+                          ("u16Length %d, u16Size %d\n", pShflString->u16Length, pShflString->u16Size));
+            }
+            else
+            {
+                /** @todo r=bird: vbsfNtAllocNonPagedMem already zero'ed it...   */
+                RtlZeroMemory(pShflString->String.ucs2, cb + sizeof(WCHAR));
+                pShflString->u16Length = 0; /* without terminating null */
+                AssertMsg(pShflString->u16Size >= sizeof(WCHAR),
+                          ("u16Size %d\n", pShflString->u16Size));
+            }
+
+            *ppShflString = pShflString;
+            Status = STATUS_SUCCESS;
+        }
+        else
+        {
+            vbsfNtFreeNonPagedMem(pShflString);
+            Status = STATUS_INSUFFICIENT_RESOURCES;
+        }
     }
     else
-    {
-#ifdef DEBUG
-        Log(("vbsfAllocNonPagedMem: ERROR: Could not allocate %d bytes of memory!\n", ulSize));
-#endif
-    }
-
-    return pMemory;
-}
-
-void vbsfFreeNonPagedMem(PVOID lpMem)
-{
-#ifdef DEBUG
-    s_iAllocRefCount = s_iAllocRefCount - 1;
-    Log(("vbsfFreeNonPagedMem: RefCnt after decrementing: %d\n", s_iAllocRefCount));
-#endif
-
-    Assert(lpMem);
-
-    /* MSDN: The ExFreePoolWithTag routine issues a bug check if the specified value for Tag does not match the tag value passed
-     to the routine that originally allocated the memory block. Otherwise, the behavior of this routine is identical to ExFreePool. */
-    ExFreePoolWithTag(lpMem, 'LFHS');
-    lpMem = NULL;
-}
-
-#if 0 //def DEBUG
-/**
- * Callback for RTLogFormatV which writes to the backdoor.
- * See PFNLOGOUTPUT() for details.
- */
-static DECLCALLBACK(size_t) rtLogBackdoorOutput(void *pv, const char *pachChars, size_t cbChars)
-{
-    RTLogWriteUser(pachChars, cbChars);
-    return cbChars;
-}
-
-int RTLogBackdoorPrintf1(const char *pszFormat, ...)
-{
-    va_list args;
-
-    LARGE_INTEGER time;
-
-    KeQueryTickCount(&time);
-
-    RTLogBackdoorPrintf("T=%RX64 ", time.QuadPart);
-    va_start(args, pszFormat);
-    RTLogFormatV(rtLogBackdoorOutput, NULL, pszFormat, args);
-    va_end(args);
-
-    return 0;
-}
-#endif
+        Status = STATUS_INSUFFICIENT_RESOURCES;
+
+    return Status;
+}
 
 #if defined(DEBUG) || defined(LOG_ENABLED)
 
-static PCHAR PnPMinorFunctionString(LONG MinorFunction)
+/** Debug routine for translating a minor PNP function to a string.  */
+static const char *vbsfNtMinorPnpFunctionName(LONG MinorFunction)
 {
     switch (MinorFunction)
@@ -285,67 +280,40 @@
 }
 
-PCHAR MajorFunctionString(UCHAR MajorFunction, LONG MinorFunction)
+/** Debug routine for translating a major+minor IPR function to a string.  */
+const char *vbsfNtMajorFunctionName(UCHAR MajorFunction, LONG MinorFunction)
 {
     switch (MajorFunction)
     {
-        case IRP_MJ_CREATE:
-            return "IRP_MJ_CREATE";
-        case IRP_MJ_CREATE_NAMED_PIPE:
-            return "IRP_MJ_CREATE_NAMED_PIPE";
-        case IRP_MJ_CLOSE:
-            return "IRP_MJ_CLOSE";
-        case IRP_MJ_READ:
-            return "IRP_MJ_READ";
-        case IRP_MJ_WRITE:
-            return "IRP_MJ_WRITE";
-        case IRP_MJ_QUERY_INFORMATION:
-            return "IRP_MJ_QUERY_INFORMATION";
-        case IRP_MJ_SET_INFORMATION:
-            return "IRP_MJ_SET_INFORMATION";
-        case IRP_MJ_QUERY_EA:
-            return "IRP_MJ_QUERY_EA";
-        case IRP_MJ_SET_EA:
-            return "IRP_MJ_SET_EA";
-        case IRP_MJ_FLUSH_BUFFERS:
-            return "IRP_MJ_FLUSH_BUFFERS";
-        case IRP_MJ_QUERY_VOLUME_INFORMATION:
-            return "IRP_MJ_QUERY_VOLUME_INFORMATION";
-        case IRP_MJ_SET_VOLUME_INFORMATION:
-            return "IRP_MJ_SET_VOLUME_INFORMATION";
-        case IRP_MJ_DIRECTORY_CONTROL:
-            return "IRP_MJ_DIRECTORY_CONTROL";
-        case IRP_MJ_FILE_SYSTEM_CONTROL:
-            return "IRP_MJ_FILE_SYSTEM_CONTROL";
-        case IRP_MJ_DEVICE_CONTROL:
-            return "IRP_MJ_DEVICE_CONTROL";
-        case IRP_MJ_INTERNAL_DEVICE_CONTROL:
-            return "IRP_MJ_INTERNAL_DEVICE_CONTROL";
-        case IRP_MJ_SHUTDOWN:
-            return "IRP_MJ_SHUTDOWN";
-        case IRP_MJ_LOCK_CONTROL:
-            return "IRP_MJ_LOCK_CONTROL";
-        case IRP_MJ_CLEANUP:
-            return "IRP_MJ_CLEANUP";
-        case IRP_MJ_CREATE_MAILSLOT:
-            return "IRP_MJ_CREATE_MAILSLOT";
-        case IRP_MJ_QUERY_SECURITY:
-            return "IRP_MJ_QUERY_SECURITY";
-        case IRP_MJ_SET_SECURITY:
-            return "IRP_MJ_SET_SECURITY";
-        case IRP_MJ_POWER:
-            return "IRP_MJ_POWER";
-        case IRP_MJ_SYSTEM_CONTROL:
-            return "IRP_MJ_SYSTEM_CONTROL";
-        case IRP_MJ_DEVICE_CHANGE:
-            return "IRP_MJ_DEVICE_CHANGE";
-        case IRP_MJ_QUERY_QUOTA:
-            return "IRP_MJ_QUERY_QUOTA";
-        case IRP_MJ_SET_QUOTA:
-            return "IRP_MJ_SET_QUOTA";
+        RT_CASE_RET_STR(IRP_MJ_CREATE);
+        RT_CASE_RET_STR(IRP_MJ_CREATE_NAMED_PIPE);
+        RT_CASE_RET_STR(IRP_MJ_CLOSE);
+        RT_CASE_RET_STR(IRP_MJ_READ);
+        RT_CASE_RET_STR(IRP_MJ_WRITE);
+        RT_CASE_RET_STR(IRP_MJ_QUERY_INFORMATION);
+        RT_CASE_RET_STR(IRP_MJ_SET_INFORMATION);
+        RT_CASE_RET_STR(IRP_MJ_QUERY_EA);
+        RT_CASE_RET_STR(IRP_MJ_SET_EA);
+        RT_CASE_RET_STR(IRP_MJ_FLUSH_BUFFERS);
+        RT_CASE_RET_STR(IRP_MJ_QUERY_VOLUME_INFORMATION);
+        RT_CASE_RET_STR(IRP_MJ_SET_VOLUME_INFORMATION);
+        RT_CASE_RET_STR(IRP_MJ_DIRECTORY_CONTROL);
+        RT_CASE_RET_STR(IRP_MJ_FILE_SYSTEM_CONTROL);
+        RT_CASE_RET_STR(IRP_MJ_DEVICE_CONTROL);
+        RT_CASE_RET_STR(IRP_MJ_INTERNAL_DEVICE_CONTROL);
+        RT_CASE_RET_STR(IRP_MJ_SHUTDOWN);
+        RT_CASE_RET_STR(IRP_MJ_LOCK_CONTROL);
+        RT_CASE_RET_STR(IRP_MJ_CLEANUP);
+        RT_CASE_RET_STR(IRP_MJ_CREATE_MAILSLOT);
+        RT_CASE_RET_STR(IRP_MJ_QUERY_SECURITY);
+        RT_CASE_RET_STR(IRP_MJ_SET_SECURITY);
+        RT_CASE_RET_STR(IRP_MJ_POWER);
+        RT_CASE_RET_STR(IRP_MJ_SYSTEM_CONTROL);
+        RT_CASE_RET_STR(IRP_MJ_DEVICE_CHANGE);
+        RT_CASE_RET_STR(IRP_MJ_QUERY_QUOTA);
+        RT_CASE_RET_STR(IRP_MJ_SET_QUOTA);
         case IRP_MJ_PNP:
-            return PnPMinorFunctionString(MinorFunction);
-
+            return vbsfNtMinorPnpFunctionName(MinorFunction);
         default:
-            return "unknown_pnp_irp";
+            return "IRP_MJ_UNKNOWN";
     }
 }
@@ -353,57 +321,2 @@
 #endif /* DEBUG || LOG_ENABLED */
 
-/** Allocate and initialize a SHFLSTRING from a UNICODE string.
- *
- *  @param ppShflString Where to store the pointer to the allocated SHFLSTRING structure.
- *                      The structure must be deallocated with vbsfFreeNonPagedMem.
- *  @param pwc          The UNICODE string. If NULL then SHFL is only allocated.
- *  @param cb           Size of the UNICODE string in bytes without the trailing nul.
- *
- *  @return Status code.
- */
-NTSTATUS vbsfShflStringFromUnicodeAlloc(PSHFLSTRING *ppShflString, const WCHAR *pwc, uint16_t cb)
-{
-    NTSTATUS Status = STATUS_SUCCESS;
-
-    PSHFLSTRING pShflString;
-    ULONG cbShflString;
-
-    /* Calculate length required for the SHFL structure: header + chars + nul. */
-    cbShflString = SHFLSTRING_HEADER_SIZE + cb + sizeof(WCHAR);
-    pShflString = (PSHFLSTRING)vbsfAllocNonPagedMem(cbShflString);
-    if (pShflString)
-    {
-        if (ShflStringInitBuffer(pShflString, cbShflString))
-        {
-            if (pwc)
-            {
-                RtlCopyMemory(pShflString->String.ucs2, pwc, cb);
-                pShflString->String.ucs2[cb / sizeof(WCHAR)] = 0;
-                pShflString->u16Length = cb; /* without terminating null */
-                AssertMsg(pShflString->u16Length + sizeof(WCHAR) == pShflString->u16Size,
-                          ("u16Length %d, u16Size %d\n", pShflString->u16Length, pShflString->u16Size));
-            }
-            else
-            {
-                /** @todo r=bird: vbsfAllocNonPagedMem already zero'ed it...   */
-                RtlZeroMemory(pShflString->String.ucs2, cb + sizeof(WCHAR));
-                pShflString->u16Length = 0; /* without terminating null */
-                AssertMsg(pShflString->u16Size >= sizeof(WCHAR),
-                          ("u16Size %d\n", pShflString->u16Size));
-            }
-
-            *ppShflString = pShflString;
-        }
-        else
-        {
-            vbsfFreeNonPagedMem(pShflString);
-            Status = STATUS_INSUFFICIENT_RESOURCES;
-        }
-    }
-    else
-    {
-        Status = STATUS_INSUFFICIENT_RESOURCES;
-    }
-
-    return Status;
-}
