Microsoft KB Archive/94609

= BUG: Write Incorrectly Fills Out the OLETARGETDEVICE Structure =

Article ID: 94609

Article Last Modified on 3/3/2005

-

APPLIES TO


 * Microsoft OLE 1.0

-



This article was previously published under Q94609



SYMPTOMS
In an OLE server application's SetTargetDevice method, the Device Name string located at the otdDeviceNameOffset position of the otdData buffer contained in the OLETARGETDEVICE structure is invalid.



CAUSE
Windows Write does not properly NULL-terminate the Device Name string.



RESOLUTION
The OLETARGETDEVICE structure contains information about a target device. It is declared in OLE.H as: typedef struct _OLETARGETDEVICE { UINT otdDeviceNameOffset; UINT otdDriverNameOffset; UINT otdPortNameOffset; UINT otdExtDevmodeOffset; UINT otdExtDevmodeSize; UINT otdEnvironmentOffset; UINT otdEnvironmentSize; BYTE otdData[1]; } The otdData byte array contains a DEVMODE structure, which begins at offset otdExtDevmodeOffset. The Device Name string can be extracted from the dmDeviceName member of that DEVMODE structure.



STATUS
Microsoft has confirmed this to be a problem in Windows Write shipped with Microsoft Windows version 3.1. We are researching this problem and will post new information here as it becomes available.

Additional query words: 1.00 buglist1.00

Keywords: KB94609

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.