please don't apply RPC Merge D_PL1

Greg Turner gmturner007 at ameritech.net
Sun Oct 13 23:14:57 CDT 2002


On Sunday 13 October 2002 06:41 pm, Ove Kaaven wrote:
> The pStubDesc structure should have been initialized (including setting
> that pointer, I think) by the NdrClientInitialize or
> NdrClientInitializeNew (or for DCOM, NdrProxyInitialize, but perhaps
> NdrProxyInitialize should call down to NdrClientInitialize/New anyway)
> functions. My patches didn't implement those functions, since I was mostly
> concerned with DCOM. Is this a real RPC app that works on Windows you're
> working on?

Apparently this isn't how /Oicf works in this case... the MIDL-generated source
looks to me like I am recieving constant structures that should already have
been initialized statically.

To "prove" it here's the the client stub source (abridged and annotated):

======================
/* 
 * GMT: I hope this doesn't matter.... I think it only 
 * affects the wire representation, not yet my concern (soon!)
 */
#if !(TARGET_IS_NT50_OR_LATER)
#error You need a Windows 2000 or later to run this stub because it uses these features:
#error   /robust command line switch.
#error However, your C/C++ compilation flags indicate you intend to run this app on earlier systems.
#error This app will die there with the RPC_X_WRONG_STUB_VERSION error.
#endif

static const RPC_CLIENT_INTERFACE hello___RpcClientInterface =
    {
    sizeof(RPC_CLIENT_INTERFACE),
    {{0x906B0CE0,0xC70B,0x1067,{0xB3,0x17,0x00,0xDD,0x01,0x06,0x62,0xDA}},{1,0}},
    {{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}},
    0,
    0,
    0,
    0,
    0,
    0x00000000
    };


/* 
 * GMT: Interesting, I just noticed that there are two def's for hello_StubDesc;
 * Could this be the one I'm getting instead of the one below?  Doesn't the
 * "extern" mean they will be one and the same?  What a mess...
 */
extern const MIDL_STUB_DESC hello_StubDesc;

void HelloProc( 
    /* [string][in] */ unsigned char *pszString)
{

    NdrClientCall2(
                  ( PMIDL_STUB_DESC  )&hello_StubDesc,
                  (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0],
                  pszString);
    
}

/* 
 * GMT: here is what I thought I was going to get:
 */
static const MIDL_STUB_DESC hello_StubDesc = 
    {
    (void *)& hello___RpcClientInterface,
    MIDL_user_allocate,
    MIDL_user_free,
    &hello_IfHandle,
    0,
    0,
    0,
    0,
    __MIDL_TypeFormatString.Format,
    1, /* -error bounds_check flag */
    0x50002, /* Ndr library version */
    0,
    0x6000169, /* MIDL Version 6.0.361 */
    0,
    0,
    0,  /* notify & notify_flag routine table */
    0x1, /* MIDL flag */
    0, /* cs routines */
    0,   /* proxy/server info */
    0   /* Reserved5 */
    };
======================

Anyhow, if it was calling the functions you mention, it should be crashing with
unimplmented function, since there are no stubs, right?  So, to me, it seems that
it's supposed to be giving me the above static const struct... and yet, as far as I can tell,
it ain't :(

Here's the main source, also abridged:

======================
void __cdecl main(int argc, char **argv)
{
    RPC_STATUS status;
    unsigned char * pszUuid             = NULL;
    unsigned char * pszProtocolSequence = "ncacn_np";
    unsigned char * pszNetworkAddress   = NULL;
    unsigned char * pszEndpoint         = "\\pipe\\hello";
    unsigned char * pszOptions          = NULL;
    unsigned char * pszStringBinding    = NULL;
    unsigned char * pszString           = "hello, world";
    unsigned long ulCode;

    status = RpcStringBindingCompose(pszUuid,
                                     pszProtocolSequence,
                                     pszNetworkAddress,
                                     pszEndpoint,
                                     pszOptions,
                                     &pszStringBinding);
 
    status = RpcBindingFromStringBinding(pszStringBinding,
                                         &hello_IfHandle);
 
    printf("Calling the remote procedure 'HelloProc'\n");

    RpcTryExcept {
        HelloProc(pszString);  // make call with user message
        printf("Calling the remote procedure 'Shutdown'\n");
        Shutdown();  // shut down the server side
    }
    RpcExcept(1) {
        ulCode = RpcExceptionCode();
        printf("Runtime reported exception 0x%lx = %ld\n", ulCode, ulCode);
    }
    RpcEndExcept

    status = RpcStringFree(&pszStringBinding);  // remote calls done; unbind
    status = RpcBindingFree(&hello_IfHandle);  // remote calls done; unbind
    exit(0);
}
======================

Hrmm... well, I'm stumped for tonight, time to play video games.
Thanks for your help.

-- 
gmt

"It has been well said that really up-to-date liberals
do not care what people do, as long as it is compulsory."

-George F. Will




More information about the wine-devel mailing list