Microsoft KB Archive/201372

{|
 * width="100%"|

BUG: Access Violation in BuildCommDCB

 * }

Q201372

-

The information in this article applies to:


 * Microsoft Win32 Application Programming Interface (API), used with:
 * Microsoft Windows 95
 * Microsoft Windows 98

-

SYMPTOMS
An access violation occurs during a call to BuildCommDCB.

CAUSE
In Windows 95 and 98, BuildCommDCB makes temporary changes to the DCB string passed in. As a result, the string passed into this API is pointed to a read only section of memory, and an access violation occurs.

RESOLUTION
To work around this problem, copy the string to a temporary memory buffer that has read and write access before calling BuildCommDCB.

STATUS
Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION
This happens most frequently when a fixed string is passed into this API. Starting with Microsoft Visual C++ version 6.0, all hard coded fixed strings are stored as read only when a binary is loaded into memory. Prior to version 6.0, fixed strings were loaded into a read/write section of memory.

Additional query words: kbDSupport

Keywords : kbAPI kbCommBand kbKernBase kbGrpDSKernBase

Issue type : kbbug

Technology : kbAudDeveloper kbWin32sSearch kbWin32API