Commit 0f81ac35 authored by Alexandre Julliard's avatar Alexandre Julliard

ole: Remove a no longer needed smbfs hack.

parent 860d682c
......@@ -422,39 +422,13 @@ void BIGBLOCKFILE_SetSize(LPBIGBLOCKFILE This, ULARGE_INTEGER newSize)
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);
/*
......@@ -466,6 +440,7 @@ void BIGBLOCKFILE_SetSize(LPBIGBLOCKFILE This, ULARGE_INTEGER newSize)
0, 0,
NULL);
}
}
else
{
GlobalUnlock(This->hbytearray);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment