I am trying to write LSP for winsock, and according to the MSDN documentation, dll should export one function, namely. WSPStartup (), as defined in Ws2spi.h
When compiling, I get an error message:
error C2375: 'WSPStartup' : redefinition; different linkage
If I add
__declspec(dllexport)
. On the other hand, if I use
__control_entrypoint(DllExport)
It compiles fine, but the function is not actually exported. I checked the use of the dependency viewer. To make sure that other LSP implementations export functions or not, I used the dependency viewer on VMWares vsocklib.dll and mswsock.dll, both dll libraries exported the specified function.
My sample implementation is as follows: -
So what am I doing wrong here? How to create a DLL that exports the WSPStartup () function?
source share