我有一个启用了代理存根支持的 ATL 项目,我在哪里可以找到 xdlldata.h 文件中所有方法的实现?

I have an ATL project with proxy-stub support enabled, where can I find the implementation of all the methods in xdlldata.h file?

my generated xdlldta.h file 

#ifdef _MERGE_PROXYSTUB

extern "C" 
{
BOOL WINAPI PrxDllMain(HINSTANCE hInstance, DWORD dwReason, 
    LPVOID lpReserved);
STDAPI PrxDllCanUnloadNow(void);
STDAPI PrxDllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv);
STDAPI PrxDllRegisterServer(void);
STDAPI PrxDllUnregisterServer(void);
}

#endif

这里,我不认为这些方法的实现是我项目的一部分,想具体查看一下

的实现
BOOL WINAPI PrxDllMain(HINSTANCE hInstance, DWORD dwReason, 
    LPVOID lpReserved);

我在哪里可以找到相同的?提前致谢。

您的 xlldata.c 定义 ENTRY_PREFIX:

#define ENTRY_PREFIX    Prx

然后包含dlldata.c,由MIDL编译器生成:

#include "dlldata.c"

生成的dlldata.c文件包含SDKrpcproxy.h:

#include <rpcproxy.h>

rpcproxy.h 反过来看 ENTRY_PREFIX,它实际上什至在其 header.

中有一些简短的语法帮助

这是定义 PrxDllMain 的地方:

/*DllMain saves the DLL module handle for later use by DllRegisterServer */ \
BOOL WINAPI DLLMAIN_ENTRY( \
    HINSTANCE  hinstDLL, \
    DWORD  fdwReason, \
    LPVOID  lpvReserved) \
{ \

DLLMAIN_ENTRY 有:

#define __rpc_macro_expand2(a, b) a##b
#define __rpc_macro_expand(a, b) __rpc_macro_expand2(a,b)
// ...
#define DLLMAIN_ENTRY __rpc_macro_expand(ENTRY_PREFIX, DllMain)