Support anon shared mappings using temporary files (wont be deleted

yet).
This commit is contained in:
Marcus Meissner 1998-10-21 16:52:21 +00:00 committed by Alexandre Julliard
parent 7ce0684f69
commit af026d7cd0
1 changed files with 22 additions and 8 deletions

View File

@ -1133,15 +1133,29 @@ HANDLE32 WINAPI CreateFileMapping32A(
if (hFile == INVALID_HANDLE_VALUE32) if (hFile == INVALID_HANDLE_VALUE32)
{ {
FIXME(virtual,"shared anon mapping not correctly supported!\n"); FIXME(virtual,"shared anon mapping (%s, size %d) not correctly supported!\n",debugstr_a(name),size_low);
if (!size_high && !size_low) if (!size_high && !size_low)
{ {
SetLastError( ERROR_INVALID_PARAMETER ); SetLastError( ERROR_INVALID_PARAMETER );
return 0; return 0;
} }
obj = NULL; obj = NULL;
if (name)
{
CHAR buf[260];
GetTempPath32A(260,buf);
GetTempFileName32A(buf,"wine",260,buf);
hFile = CreateFile32A(buf,GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_ALWAYS,0,0);
if (hFile == INVALID_HANDLE_VALUE32)
FIXME(virtual,"could not create temp. file for anon shared mapping: reason was 0x%08lx\n",GetLastError());
else {
SetFilePointer(hFile,size_low,&size_high,FILE_BEGIN);
SetEndOfFile(hFile);
}
}
} }
else /* We have a file */ if (hFile != INVALID_HANDLE_VALUE32) /* We have a file */
{ {
BY_HANDLE_FILE_INFORMATION info; BY_HANDLE_FILE_INFORMATION info;
DWORD access = GENERIC_READ; DWORD access = GENERIC_READ;