Alexandre Julliard : ole: Remove a no longer needed smbfs hack.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Jan 6 14:49:32 CST 2006


Module: wine
Branch: refs/heads/master
Commit: 0f81ac350647c0122b6c7c17ac1adbee70415793
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=0f81ac350647c0122b6c7c17ac1adbee70415793

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Jan  6 21:19:05 2006 +0100

ole: Remove a no longer needed smbfs hack.

---

 dlls/ole32/stg_bigblockfile.c |   55 +++++++++++------------------------------
 1 files changed, 15 insertions(+), 40 deletions(-)

diff --git a/dlls/ole32/stg_bigblockfile.c b/dlls/ole32/stg_bigblockfile.c
index 57123c9..13536f5 100644
--- a/dlls/ole32/stg_bigblockfile.c
+++ b/dlls/ole32/stg_bigblockfile.c
@@ -422,49 +422,24 @@ void BIGBLOCKFILE_SetSize(LPBIGBLOCKFILE
 
   if (This->fileBased)
   {
-    char buf[10];
-    DWORD w;
+    LARGE_INTEGER newpos;
 
-    /*
-     * close file-mapping object, must be done before call to SetEndFile
-     */
-    if( This->hfilemap )
-      CloseHandle(This->hfilemap);
-    This->hfilemap = 0;
-
-    /*
-     * BEGIN HACK
-     * This fixes a bug when saving through smbfs.
-     * smbmount a Windows shared directory, save a structured storage file
-     * to that dir: crash.
-     *
-     * The problem is that the SetFilePointer-SetEndOfFile combo below
-     * doesn't always succeed. The file is not grown. It seems like the
-     * operation is cached. By doing the WriteFile, the file is actually
-     * grown on disk.
-     * This hack is only needed when saving to smbfs.
-     */
-    memset(buf, '0', 10);
-    SetFilePointer(This->hfile, newSize.u.LowPart, NULL, FILE_BEGIN);
-    WriteFile(This->hfile, buf, 10, &w, NULL);
-    /*
-     * END HACK
-     */
+    newpos.QuadPart = newSize.QuadPart;
+    if (SetFilePointerEx(This->hfile, newpos, NULL, FILE_BEGIN))
+    {
+        if( This->hfilemap ) CloseHandle(This->hfilemap);
 
-    /*
-     * set the new end of file
-     */
-    SetFilePointer(This->hfile, newSize.u.LowPart, NULL, FILE_BEGIN);
-    SetEndOfFile(This->hfile);
+        SetEndOfFile(This->hfile);
 
-    /*
-     * re-create the file mapping object
-     */
-    This->hfilemap = CreateFileMappingA(This->hfile,
-                                        NULL,
-                                        This->flProtect,
-                                        0, 0,
-                                        NULL);
+        /*
+         * re-create the file mapping object
+         */
+        This->hfilemap = CreateFileMappingA(This->hfile,
+                                            NULL,
+                                            This->flProtect,
+                                            0, 0,
+                                            NULL);
+    }
   }
   else
   {




More information about the wine-cvs mailing list