The information in this article applies to:
SYMPTOMS
When CreateFile() is passed a filename string that contains an OEM
character, the name of the file created is not as expected. In particular,
a file created with CreateFile() cannot be opened with OpenFile() when
OpenFile() is passed the same filename string.
CAUSECreateFile() is implemented with calls to MS-DOS. MS-DOS converts the given file names to upper-case letters. OpenFile() is implemented with a thunk to the 16-bit Windows OpenFile(). OpenFile() converts the file name to upper-case before calling MS-DOS. The conversion that the 16-bit OpenFile() is doing is different from the conversion performed by MS-DOS for the OEM characters. The result is that different filenames are created for the same string passed to CreateFile() and OpenFile() if the name contains OEM characters. RESOLUTIONTo make the file name created by CreateFile() consistent with the file name created by OpenFile(), call AnsiUpper() on the file name string before calling CreateFile(). STATUSThis behavior is by design and will not be changed in Win32s, because it may break existing Win32-based applications. MORE INFORMATION
The 16-bit OpenFile() will fail to find an existing file if the file
contains OEM characters but not an explicit full path. This also occurs
with the 32-bit OpenFile(), because it is thunked to the 16-bit OpenFile().
Additional query words: 1.20
Keywords : kbWin32s |
Last Reviewed: January 14, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |