FIX: DCOM95 1.2 or DCOM98 Causes Data Corruption in RPC Calls

ID: Q216889


The information in this article applies to:
  • Microsoft Windows 95
  • Microsoft Windows 98


SYMPTOMS

Under Windows 95 with DCOM95 1.2 update or Windows 98 with DCOM98 update, if you have a pointer to conformant structure as a field of a complex structure, the unmarshaling side receives uninitialized data. If the data structure is an [in] parameter, the server manager routine sees the corruption. If it is an [out] parameter, the client sees the corruption.

The same problem appears if your RPC application is running on Windows NT 4.0 with Service Pack 4 as documented in the following article in the Microsoft Knowledge Base:

Q216766 FIX: Windows NT 4.0 w/ SP4 Causes Data Corruption in RPC Calls
Data Structure:

typedef struct tagConformantStruct 
{
   unsigned long        size;
   [size_is(size)] char data[];
} ConformantStruct;

typedef enum tagColor
{
   Red, Blue, Green
} Color;

typedef union tagMyUnion switch (Color type) u
{
   case Red :  long  longArm;
   case Blue:  short shortArm;
   case Green: char  charArm;
} MyUnion;

typedef struct tagComplexStruct
{
   unsigned long numUnions;
   ConformantStruct* pConfStruct; // PROBLEM! pointer to conformant struct.
   [size_is(numUnions)] MyUnion myUnions[]; // Makes the struct complex.
} ComplexStruct; 


CAUSE

A defect in the rpcrt4.dll shipped with Windows NT 4.0 Service Pack 4, (DCOM95 1.2) and DCOM98 prevents the conformant part of the conformant structure to be marshaled. The unmarshaling side expects the conformant part and unmarshals from a possibly uninitialized part of the RPC buffer. This causes data corruption.


RESOLUTION

A supported fix that corrects this problem is now available from Microsoft, but it has not been fully regression tested and should be applied only to systems experiencing this specific problem. If you are not severely affected by this specific problem, Microsoft recommends that you wait for the next update that contains this fix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information on support costs, please go to the following address on the World Wide Web:

http://www.microsoft.com/support/supportnet/overview/overview.asp

   File name   Version     Date       Time     Size
   --------------------------------------------------------
   RPCRT4.DLL  4.71.3116   03-04-99   7:16a   321,296
 



STATUS

Microsoft has confirmed this to be a problem in DCOM for Microsoft Windows 95, version 1.2, and DCOM98 for Windows 95 and Windows 98 (included with Microsoft Visual Studio 6). The fix described in the resolution section should not be applied to systems which do not have one of these products installed.

Additional query words: conformant complex

Keywords : kbRPC kbWinOS95fix kbWinOS95sp1fix
Version : WINDOWS:95
Platform : WINDOWS
Issue type : kbprb


Last Reviewed: August 27, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.