Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6347149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:09:20+00:00 2026-05-24T21:09:20+00:00

When a program needs to communicate using Microsoft RPC developers typically write a IDL

  • 0

When a program needs to communicate using Microsoft RPC developers typically write a IDL definition for all methods, for example:

error_status_t rpcMyInterfaceGetFile( [in] const GUID fileId, [out] BYTE_PIPE filePipe );

which is compiled by MIDL compiler and produces a wrapper function:

/* [fault_status][comm_status] */ error_status_t rpcMyInterfacerGetFile( 
/* [in] */ handle_t IDL_handle,
/* [in] */ const GUID fileId,
/* [out] */ BYTE_PIPE filePipe)
{
    CLIENT_CALL_RETURN _RetVal;
    _RetVal = NdrClientCall2(
              ( PMIDL_STUB_DESC  )&IMyInterfaceRpc_StubDesc,
              (PFORMAT_STRING) &MyInterfaceRpc__MIDL_ProcFormatString.Format[SomeNumberHere],
              ( unsigned char * )&IDL_handle);
    return ( error_status_t  )_RetVal.Simple;
}

Here the call is forwarded to NdrClientCall2() RPC runtime function that is declared to have ... as the third parameter and does actual job. MyInterfaceRpc__MIDL_ProcFormatString is just a sequence of hardcoded bytes generated by MIDL, so the second parameter is a start of a subsection in that array declared in the same .c file as the wrapper function and having static storage duration.

How do the parameters (fileId and filePipe) get passed into NdrClientCall2()? I don’t see them being passed. How do they happen to get from the wrapper to NdrClientCall2()?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T21:09:21+00:00Added an answer on May 24, 2026 at 9:09 pm

    Well, not quite sure but reading between the lines in the MSDN doc (which says that the last argument is Pointer to the client-side calling stack) it sounds like the NdrClientCall2 function can take the STUB_DESC structure, figure out what the argument types and sizes are, extract them from the stack, do the work of calling the remote interface and then write the results back into the proper locations on the stack (for OUT parameters).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to write a program that will communicate with other .NET programs ...
Our application needs to communicate with another program through a COM interface. The interface
The program needs to take in a simple string from the user and display
My program needs to know when a user ejects cd disc. Is there some
My program needs to do 2 things. Extract stuff from a webpage. Do stuff
My program needs to make use of void* in order to transport data or
My program needs to listen incoming socket connections (lets agree on port 8765), but
My C++ program needs a block of uninitialized memory and a void* pointer to
I have a bunch of PDF files and my Perl program needs to do
I am working on a small application in VB.NET. The program needs administrator privilege

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.