Microsoft KB Archive/124564

From BetaArchive Wiki
Knowledge Base


MIDL Compiler Wraps the Operation Number After 255

Article ID: 124564

Article Last Modified on 11/1/2006



APPLIES TO

  • Microsoft Windows NT Workstation 3.5
  • Microsoft Windows NT Server 3.5



This article was previously published under Q124564

SYMPTOMS

The RPC MIDL compiler (version 2.00.72) that ships with the Win 32 SDK appears to only keep 8 bits of "Operation number" when it generates the stub code. This creates a problem if you define more than 256 remote procedures. When operation 256 is to be called, operation 0 is really called instead because the call number created by the MIDL compiler wrapped at 255.

WORKAROUND

If you have more than 256 Remote Procedures defined, manually edit the output file and correct the operation number. You can do this by examining the stub code created by the MIDL compiler. The 4th parameter to the NdrClientInitializeNew() wraps around after 255; edit this for each successive procedure in the stub and increment it correctly.

STATUS

Microsoft has confirmed this to be a problem in Windows NT version 3.5. This problem was corrected in Windows NT version 3.51.


Additional query words: prodnt

Keywords: KB124564