midl /error { allocation | stub_data | ref | bounds_check | none | all }
midl /error allocation filename.idl
midl /error none filename.idl
The /error switch selects the amount of error checking to be performed by the generated stub files.
By default, the MIDL compiler generates code that checks for enum and certain memory-access errors. The enum errors that are checked are truncation errors caused by conversion between long enum types (32-bit integers) and short enum types (the network-data representation of enum) and the number of identifiers in an enumeration exceeding 32,767. The memory-access error checking is for pointers that exceed the end of the buffer in marshalling code and for conformant arrrays whose size is less than zero. Use the /error bounds_check flag to check for other invalid array bounds.
When you specify /error allocate, the stubs include code that raises an exception when midl_user_allocate returns 0.
The /error stub_data option prevents client data from crashing the server during unmarshalling; in effect providing a more robust method of handling the unmarshalling operation.
General MIDL Command-line Syntax