ole: Remove a no longer needed smbfs hack.

This commit is contained in:
Alexandre Julliard 2006-01-06 21:19:05 +01:00
parent 860d682c2b
commit 0f81ac3506
1 changed files with 15 additions and 40 deletions

View File

@ -422,49 +422,24 @@ void BIGBLOCKFILE_SetSize(LPBIGBLOCKFILE This, ULARGE_INTEGER newSize)
if (This->fileBased) if (This->fileBased)
{ {
char buf[10]; LARGE_INTEGER newpos;
DWORD w;
/* newpos.QuadPart = newSize.QuadPart;
* close file-mapping object, must be done before call to SetEndFile if (SetFilePointerEx(This->hfile, newpos, NULL, FILE_BEGIN))
*/ {
if( This->hfilemap ) if( This->hfilemap ) CloseHandle(This->hfilemap);
CloseHandle(This->hfilemap);
This->hfilemap = 0;
/* SetEndOfFile(This->hfile);
* 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
*/
/* /*
* set the new end of file * re-create the file mapping object
*/ */
SetFilePointer(This->hfile, newSize.u.LowPart, NULL, FILE_BEGIN); This->hfilemap = CreateFileMappingA(This->hfile,
SetEndOfFile(This->hfile); NULL,
This->flProtect,
/* 0, 0,
* re-create the file mapping object NULL);
*/ }
This->hfilemap = CreateFileMappingA(This->hfile,
NULL,
This->flProtect,
0, 0,
NULL);
} }
else else
{ {