/Os switch
The /Os switch specifies the mixed-mode method to marshal stub code passed between client and server.
midl /Os
This switch has no parameters.
There are important issues to consider before deciding on the method for marshaling code. These issues concern size and performance. The MIDL compiler provides two methods for marshaling code: mixed-mode (/Os) and fully-interpreted (/Oi). The fully-interpreted method marshals data completely offline. This reduces the size of the stub code considerably, but it also results in decreased performance.
Use MIDL default mode /Oicf /robust for all purposes other than backward compatibility. This mode is the secure standard mode of MIDL compiler; any other mode should be used only after careful consideration to the security implication, realizing that future extensions will only be implemented for default mode. In mixed mode, the compiler marshals some parameters inline in the generated stubs. While this results in larger stub size, it also may offer increased performance.
MIDL provides full support for multidimensional arrays and multidimensional-sized pointers only in /Oicf mode. In /Os and /Oi modes, the compiler supports simple cases, such as fixed-size arrays. Using multidimensional arrays in /Os or /Oi modes can result in parameters that are not marshaled correctly. Microsoft recommends that you use the /Oicf command line switch when your interface defines parameters that are multidimensional arrays or multidimensional-sized pointers.
To further define the level of gradation in how data is marshaled, this version of RPC provides an [optimize] attribute. This attribute is used as an ACF interface attribute or operation attribute to select the marshaling mode.
midl /Os filename.idl