Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp	(revision 56911)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp	(revision 56912)
@@ -1177,5 +1177,5 @@
             pszPartitions = argv[i];
         }
-#if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)
+#if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) || defined(RT_OS_WINDOWS)
         else if (strcmp(argv[i], "-relative") == 0)
         {
@@ -1244,4 +1244,11 @@
             cbSize = DiskLenInfo.Length.QuadPart;
         }
+        if (   fRelative
+            && !rawdisk.startsWith("\\\\.\\PhysicalDrive", Utf8Str::CaseInsensitive))
+        {
+            RTMsgError("The -relative parameter is invalid for raw disk %s", rawdisk.c_str());
+            vrc = VERR_INVALID_PARAMETER;
+            goto out;
+        }
     }
     else
@@ -1270,5 +1277,5 @@
 #elif defined(RT_OS_LINUX)
     struct stat DevStat;
-    if(!fstat(RTFileToNative(hRawFile), &DevStat))
+    if (!fstat(RTFileToNative(hRawFile), &DevStat))
     {
         if (S_ISBLK(DevStat.st_mode))
@@ -1646,4 +1653,19 @@
                     pszRawName = psz;
                     uStartOffset = 0;
+#elif defined(RT_OS_WINDOWS)
+                    /* Refer to the correct partition and use offset 0. */
+                    char *psz;
+                    RTStrAPrintf(&psz, "\\\\.\\Harddisk%sPartition%u",
+                                 rawdisk.c_str() + 17,
+                                 partitions.aPartitions[i].uIndex);
+                    if (!psz)
+                    {
+                        vrc = VERR_NO_STR_MEMORY;
+                        RTMsgError("Cannot create reference to individual partition %u, rc=%Rrc",
+                                   partitions.aPartitions[i].uIndex, vrc);
+                        goto out;
+                    }
+                    pszRawName = psz;
+                    uStartOffset = 0;
 #else
                     /** @todo not implemented for other hosts. Treat just like
@@ -1698,5 +1720,5 @@
                 if (!RawDescriptor.pPartDescs[i].cbData)
                 {
-                    if(RawDescriptor.uPartitioningType == MBR)
+                    if (RawDescriptor.uPartitioningType == MBR)
                     {
                         RTMsgError("MBR/EPT overlaps with data area");
@@ -1706,5 +1728,5 @@
                     else
                     {
-                        if(RawDescriptor.cPartDescs != i+1)
+                        if (RawDescriptor.cPartDescs != i+1)
                         {
                             RTMsgError("GPT overlaps with data area");
