Index: /trunk/doc/manual/en_US/SDKRef.xml
===================================================================
--- /trunk/doc/manual/en_US/SDKRef.xml	(revision 55667)
+++ /trunk/doc/manual/en_US/SDKRef.xml	(revision 55668)
@@ -4138,4 +4138,7 @@
                 <listitem><para>The unimplemented sharingMode string parameter was replaced by the enum
                   <xref linkend="FileSharingMode" xreflabel="FileSharingMode"/> (fileOpenEx only).</para></listitem>
+                <listitem><para>Added a flags parameter taking a list of <xref linkend="FileOpenExFlags"
+                  xreflabel="FileOpenExFlags"/> values (fileOpenEx only).</para></listitem>
+                <listitem><para>Removed the offset parameter (fileOpenEx only).</para></listitem>
               </itemizedlist></para>
             </listitem>
@@ -4146,5 +4149,6 @@
             <listitem>
               <para>Renamed the FileSeekType enum used by <xref linkend="IFile__seek" xreflabel="IGuestFile::seek"/>
-                to <xref linkend="FileSeekOrigin" xreflabel="FileSeekOrigin"/> and added the missing End value.</para>
+                to <xref linkend="FileSeekOrigin" xreflabel="FileSeekOrigin"/> and added the missing End value
+                and renaming the Set to Begin.</para>
             </listitem>
             <listitem>
Index: /trunk/src/VBox/Main/idl/VirtualBox.xidl
===================================================================
--- /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 55667)
+++ /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 55668)
@@ -9981,5 +9981,5 @@
   <enum
     name="FileSeekOrigin"
-    uuid="939ba94f-497a-4119-ebd3-d193e176c98e"
+    uuid="ad32f789-4279-4530-979c-f16892e1c263"
     >
     <desc>
@@ -9987,6 +9987,6 @@
     </desc>
 
-    <const name="Set"                   value="0">
-      <desc>Seek from the start of the file.</desc>
+    <const name="Begin"                 value="0">
+      <desc>Seek from the beginning of the file.</desc>
     </const>
     <const name="Current"               value="1">
@@ -10559,4 +10559,16 @@
 
   <enum
+    name="FileOpenExFlags"
+    uuid="9d62017b-ddd3-4e5a-a08e-14d1c23bbac1"
+    >
+    <desc>
+      Open flags for <link to="IGuestSession::fileOpenEx"/>.
+    </desc>
+    <const name="None"        value="0">
+      <desc>No flag set.</desc>
+    </const>
+  </enum>
+
+  <enum
     name="FileStatus"
     uuid="8c86468b-b97b-4080-8914-e29f5b0abd2c"
@@ -10968,5 +10980,5 @@
   <interface
     name="IGuestSession" extends="$unknown"
-    uuid="91306653-4e3a-88cb-a809-85ae64ceb4fd"
+    uuid="3cbf62cf-c9cd-48c6-9623-d1dbe54ca557"
     wsmap="managed"
     >
@@ -11682,8 +11694,6 @@
         </desc>
       </param>
-<!-- r=bird: Use case for the 'offset' parameter, please? I see no possible rational, especially with readAt/writeAt/seek handy.
-             Or is this an alternative way of doing "append" accessMode?  Anyway, it's pretty harmless... -->
-      <param name="offset" type="long long" dir="in">
-        <desc>The initial read/write offset (in bytes).</desc>
+      <param name="flags" type="FileOpenExFlags" dir="in" safearray="yes">
+        <desc>Zero or more <link to="FileOpenExFlags"/> values. </desc>
       </param>
       <param name="file" type="IGuestFile" dir="return">
Index: /trunk/src/VBox/Main/include/GuestCtrlImplPrivate.h
===================================================================
--- /trunk/src/VBox/Main/include/GuestCtrlImplPrivate.h	(revision 55667)
+++ /trunk/src/VBox/Main/include/GuestCtrlImplPrivate.h	(revision 55668)
@@ -610,6 +610,6 @@
     /** Octal creation mode. */
     uint32_t                mCreationMode;
-    /** The initial offset on open. */
-    uint64_t                mInitialOffset;
+    /** Extended open flags (currently none defined). */
+    uint32_t                mfOpenEx;
 };
 
Index: /trunk/src/VBox/Main/include/GuestSessionImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/GuestSessionImpl.h	(revision 55667)
+++ /trunk/src/VBox/Main/include/GuestSessionImpl.h	(revision 55668)
@@ -353,5 +353,5 @@
                        FileSharingMode_T aSharingMode,
                        ULONG aCreationMode,
-                       LONG64 aOffset,
+                       const std::vector<FileOpenExFlags_T> &aFlags,
                        ComPtr<IGuestFile> &aFile);
     HRESULT fileQuerySize(const com::Utf8Str &aPath,
Index: /trunk/src/VBox/Main/src-client/GuestFileImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/GuestFileImpl.cpp	(revision 55667)
+++ /trunk/src/VBox/Main/src-client/GuestFileImpl.cpp	(revision 55668)
@@ -475,14 +475,7 @@
                 pSvcCbData->mpaParms[idx++].getUInt32(&dataCb.u.open.uHandle);
 
-                {
-                    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
-                    AssertMsg(mData.mID == VBOX_GUESTCTRL_CONTEXTID_GET_OBJECT(pCbCtx->uContextID),
-                              ("File ID %RU32 does not match context ID %RU32\n", mData.mID,
-                              VBOX_GUESTCTRL_CONTEXTID_GET_OBJECT(pCbCtx->uContextID)));
-
-                    /* Set the initial offset. On the guest the whole opening operation
-                     * would fail if an initial seek isn't possible. */
-                    mData.mOffCurrent = mData.mOpenInfo.mInitialOffset;
-                }
+                AssertMsg(mData.mID == VBOX_GUESTCTRL_CONTEXTID_GET_OBJECT(pCbCtx->uContextID),
+                          ("File ID %RU32 does not match context ID %RU32\n", mData.mID,
+                           VBOX_GUESTCTRL_CONTEXTID_GET_OBJECT(pCbCtx->uContextID)));
 
                 /* Set the process status. */
@@ -654,8 +647,8 @@
     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    LogFlowThisFunc(("strFile=%s, enmAccessMode=%d (%s) enmOpenAction=%d (%s) uCreationMode=%RU32, uOffset=%RU64\n",
+    LogFlowThisFunc(("strFile=%s, enmAccessMode=%d (%s) enmOpenAction=%d (%s) uCreationMode=%RU32, mfOpenEx=%RU32\n",
                      mData.mOpenInfo.mFileName.c_str(), mData.mOpenInfo.mAccessMode, mData.mOpenInfo.mpszAccessMode,
                      mData.mOpenInfo.mOpenAction, mData.mOpenInfo.mpszOpenAction, mData.mOpenInfo.mCreationMode,
-                     mData.mOpenInfo.mInitialOffset));
+                     mData.mOpenInfo.mfOpenEx));
     int vrc;
 
@@ -686,5 +679,6 @@
     paParms[i++].setString(""); /** @todo sharing mode. */
     paParms[i++].setUInt32(mData.mOpenInfo.mCreationMode);
-    paParms[i++].setUInt64(mData.mOpenInfo.mInitialOffset);
+    paParms[i++].setUInt64(0 /* initial offset */);
+    /** @todo Next protocol version: add flags, replace strings, remove initial offset. */
 
     alock.release(); /* Drop write lock before sending. */
@@ -1300,5 +1294,5 @@
     switch (aWhence)
     {
-        case FileSeekOrigin_Set:
+        case FileSeekOrigin_Begin:
             eSeekType = GUEST_FILE_SEEKTYPE_BEGIN;
             break;
Index: /trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp	(revision 55667)
+++ /trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp	(revision 55668)
@@ -1232,7 +1232,7 @@
                                      ComObjPtr<GuestFile> &pFile, int *pGuestRc)
 {
-    LogFlowThisFunc(("strFile=%s, enmAccessMode=%d (%s) enmOpenAction=%d (%s) uCreationMode=%RU32, uOffset=%RU64\n",
+    LogFlowThisFunc(("strFile=%s, enmAccessMode=%d (%s) enmOpenAction=%d (%s) uCreationMode=%RU32 mfOpenEx=%RU32\n",
                      openInfo.mFileName.c_str(), openInfo.mAccessMode, openInfo.mpszAccessMode,
-                     openInfo.mOpenAction, openInfo.mpszOpenAction, openInfo.mCreationMode, openInfo.mInitialOffset));
+                     openInfo.mOpenAction, openInfo.mpszOpenAction, openInfo.mCreationMode, openInfo.mfOpenEx));
 
     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
@@ -2978,9 +2978,11 @@
 {
     LogFlowThisFuncEnter();
-    return fileOpenEx(aPath, aAccessMode, aOpenAction, FileSharingMode_All, aCreationMode, 0 /* aOffset */, aFile);
+    const std::vector<FileOpenExFlags_T> EmptyFlags;
+    return fileOpenEx(aPath, aAccessMode, aOpenAction, FileSharingMode_All, aCreationMode, EmptyFlags, aFile);
 }
 
 HRESULT GuestSession::fileOpenEx(const com::Utf8Str &aPath, FileAccessMode_T aAccessMode, FileOpenAction_T aOpenAction,
-                                 FileSharingMode_T aSharingMode, ULONG aCreationMode, LONG64 aOffset, ComPtr<IGuestFile> &aFile)
+                                 FileSharingMode_T aSharingMode, ULONG aCreationMode,
+                                 const std::vector<FileOpenExFlags_T> &aFlags, ComPtr<IGuestFile> &aFile)
 {
     LogFlowThisFuncEnter();
@@ -2996,5 +2998,4 @@
     openInfo.mFileName = aPath;
     openInfo.mCreationMode = aCreationMode;
-    openInfo.mInitialOffset = aOffset;
 
     /* convert + validate aAccessMode to the old format. */
@@ -3045,4 +3046,12 @@
             return setError(E_INVALIDARG, tr("Unknown FileOpenAction value %u (%#x)"), aAccessMode, aAccessMode);
     }
+
+    /* Combine and validate flags. */
+    uint32_t fOpenEx = 0;
+    for (size_t i = 0; i < aFlags.size(); i++)
+        fOpenEx = aFlags[i];
+    if (fOpenEx)
+        return setError(E_INVALIDARG, tr("Unsupported FileOpenExFlags values in aFlags (%#x)"), fOpenEx);
+    openInfo.mfOpenEx = fOpenEx;
 
     ComObjPtr <GuestFile> pFile;
Index: /trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
===================================================================
--- /trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py	(revision 55667)
+++ /trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py	(revision 55668)
@@ -2720,8 +2720,9 @@
                 break;
             try:
-                if curTest.cbOffset > 0:
+                if curTest.cbOffset > 0: # The offset parameter is gone.
                     if self.oTstDrv.fpApiVer >= 5.0:
                         curFile = curGuestSession.fileOpenEx(curTest.sFile, curTest.getAccessMode(), curTest.getOpenAction(),
-                                                             curTest.getSharingMode(), curTest.lCreationMode, curTest.cbOffset);
+                                                             curTest.getSharingMode(), curTest.lCreationMode, []);
+                        curFile.seek(curTest.cbOffset, vboxcon.FileSeekOrigin_Begin);
                     else:
                         curFile = curGuestSession.fileOpenEx(curTest.sFile, curTest.sOpenMode, curTest.sDisposition, \
@@ -2833,8 +2834,9 @@
                 break;
             try:
-                if curTest.cbOffset > 0:
+                if curTest.cbOffset > 0: # The offset parameter is gone.
                     if self.oTstDrv.fpApiVer >= 5.0:
                         curFile = curGuestSession.fileOpenEx(curTest.sFile, curTest.getAccessMode(), curTest.getOpenAction(),
-                                                             curTest.getSharingMode(), curTest.cbOffset);
+                                                             curTest.getSharingMode(), []);
+                        curFile.seek(curTest.cbOffset, vboxcon.FileSeekOrigin_Begin);
                     else:
                         curFile = curGuestSession.fileOpenEx(curTest.sFile, curTest.sOpenMode, curTest.sDisposition, \
