BUG: Write Incorrectly Fills Out the OLETARGETDEVICE Structure

Last reviewed: February 17, 1995
Article ID: Q94609
The information in this article applies to:
  • Microsoft OLE version 1.0

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 reference words: 1.00 buglist1.00
KBCategory: kbole kbbuglist
KBSubcategory: LeOneSvr


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 17, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.