The
I as I am trying to write a LSP to Winsock and MSDN documentation dll to export a single function, namely, Is considered to be. WSPStartup () as defined in Ws2spi.h
compile when I get an error:
error C2375: 'WSPStartup': definition; Various linkage If I
__ Diclespisi (dllexport) give him instructions to go. On the other hand, if I __ Niyntrn_ntrypoint (DLE would export) using If it compiles fine, but the function is not actually exported goes. I checked using dependency viewer. - Make sure to make the other LSP implementation functions exported or not, I used VMWares vsocklib.dll and dependence on mswsock.dll audience, both DLLs that function export
My sample implementation is as follows.
// dllmain.cpp: defines the entry point for the DLL application. # Include "stdafx.h" # Include & lt; Ws2spi.h & gt; BOOL APIENTRY DllMain (HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {switch (ul_reason_for_call) {case DLL_PROCESS_ATTACH: case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: break; } Return TRUE; } __DescriptPEC (DLEXPort) __Cache Return Int WSPAPI WSPStartup (__in WORD wVerionRequested, __in LPWSPDATA LPWSPDATA, __In LPWSAPRTOOLXFOOPPROOTOKININFO, __IN WSPUPCALLTABLE subclotable, __out LPWSPPOCOCLAPLPPrococable) {Return 0; } So am I doing wrong here? DLL which is the WSPStartup () function ?? How to export
After the
the function prototype is given Ws2spi.h In the file, the compiler would add a type of additional specifier to the definition function, causing the compiler to 'define' the error. Apart from this, it is not possible to export it directly through Dixspace (Dilexport), which declares function as a stdclin as WSPAPI specification because it will make a decorated name.
To reduce all these problems, I have exported this method by def file -
I believe that your DLL will export an unspecified WSPStartup () function The only proper method of obtaining is
No comments:
Post a Comment