The information in this article applies to:
SYMPTOMSCreating more than one file mapping object using the same file handle in a process may cause the corresponding named file on the disk to be inaccessible. Even though an application closes the file handle as well as the file mapping handles, the file on the disk cannot be deleted or renamed or replaced thereafter. When this problem occurs, Windows must be restarted to get access to this file on the disk. STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. MORE INFORMATIONThe CreateFileMapping() Win32 API takes a handle to a file from which a file mapping object is created. An application can create a file mapping object backed by a named file in the file system using a valid file handle. If the application creates more than one file mapping object using the same file handle, the corresponding file on the disk will be inaccessible thereafter. The following code reproduces this problem:
This problem occurs only if an application creates another file mapping object using the same file handle and the second file mapping object is created before closing the existing file mapping handle.An application can either work around this by closing the existing file mapping handle before creating another file mapping object or specify a different file handle for each file mapping object. However, if a different file handle is required, the file on the disk needs to be opened for shared access. Additional query words:
Keywords : kbAPI kbKernBase kbMemory kbSDKPlatform kbSDKWin32 |
Last Reviewed: October 15, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |