PRB: OpenFile API returns ERROR_BUFFER_OVERFLOW Error
Article ID: 137233
Article Last Modified on 3/5/1999
APPLIES TO
- Microsoft Win32 Software Development Kit (SDK) 4.0
This article was previously published under Q137233
SYMPTOMS
If the OpenFile API is passed a path that is longer than MAXPATHNAME,
OpenFile returns ERROR_BUFFER_OVERFLOW.
One of the parameters to OpenFile is a pointer to the pathname to open.
Another parameter is a pointer to an OFSTRUCT structure that will receive
information. OFSTRUCT contains a fixed size buffer, szPathName that holds
MAXPATHNAME bytes. A path longer than that is not valid.
RESOLUTION
Consider using CreateFile instead of OpenFile.
STATUS
This behavior is by design.
Additional query words: 4.00 Windows 95 win95fest
Keywords: KB137233