Microsoft KB Archive/110705

BUG: Problems with Win32s CreateFileMapping PSS ID Number: Q110705 Article last modified on 05-01-1994

1.10 1.10a

WINDOWS

= SYMPTOMS =

The following problems exist with CreateFileMapping under Win32s versions 1.1 and 1.1a:

Symptom 1
Specifying the SEC_COMMIT flag or the SEC_NOCACHE flag causes the CreateFileMapping function to return ERROR_INVALID_PARAMETER.

Symptom 2
No matter what size is specified in CreateFileMapping, the file size under Win32s is always a multiple of 4096.

= CAUSE =

Cause 1
The underlying operating system does not support file-by-file cache/nocache flags as Windows NT does. By default, writes to a file are cached as are any other writes on the system. The problem is that Win32s is not ANDing out these bits before checking for equality with other flags, and therefore this error occurs.

Cause 2
This is a bug in Win32s.

= RESOLUTION =

Resolution 1
Do not specify SEC_COMMIT and SEC_NOCACHE under Win32s (an easy way to do this is to redefine them if Win32s is present).

Resolution 2
None.

= STATUS =

Status 1
The SEC_COMMIT flag should be accepted and the SEC_NOCACHE flag will most likely be ignored in Win32s version 1.2.

Status 2
Microsoft has confirmed this to be a problem in Win32s version 1.1. This problem should be fixed in Win32s version 1.2. We will post new information here in the Microsoft Knowledge Base when it becomes available.

Additional reference words: 1.10 1.10a KBCategory: Prg KBSubcategory: W32s

=
================================================================

Copyright Microsoft Corporation 1994.