Various output from midl.exe 6 and midl.exe 7

I am using tyring to convert an MSVC project from VS 2005 to VS 2008. It contains an IDL file that outputs the header and stubs used for RPC. The VS 2005 project is using MIDL.exe version 6.00.0366. VS 2008 project uses MIDL.exe version 7.00.0500.

Here's the problem: MIDL v6 outputs the following prototype to implement in my server-side code:

HRESULT PRC_Function(UINT input);

      

MIDL v7 with the same command line outputs this prototype:

HRESULT RPC_Function(handle_t IDL_handle, UINT input);

      

I don't want to go through and add the handle_t parameter to all of my existing implementations. (Also, I still need implementations to compile with VS 2005 for a while.)

Question: How can I get MIDL.exe v7 to output the same RPC server prototypes as v6?

+1


source to share


2 answers


It looks like I can answer my own question ...

MIDL v6 automatically specifies the auto_handle type for server prototypes. MIDL v7 does not do this, so the solution must use the Server.acl file with the auto_handle setting. This outputs a Server.h file with function prototypes that match between MIDL v6 and v7.



However, it also displays a warning indicating that "auto_handle" has been deprecated. I used implicit_handle (handle_t IDL_handle) instead.

Too bad this site doesn't give me icons to answer my own questions. I also cannot express my own answer as the correct answer.

+1


source


handle_t IDL_handle is for an explicit RPC binding handler. On the server side, you can do cool things with it, like pulling the caller token for impersonation via various RPC functions, but if you don't need to use it, it's quite easy to specify it as an unreferenced parameter (UNREFERENCED_PARAMETER (IDL_handle);). It seems that implicit binding handles are now deprecated.



On the client side, you use the binding handler that you get when you bind to the RPC server for the IDL_handle parameter.

0


source







All Articles