📄 dllstub.c
字号:
/* $Id: dllstub.c,v 1.1.1.1 2003/06/04 00:27:45 marka Exp $ */SOCKET PASCALaccept(SOCKET a0, struct sockaddr* a1, int* a2){ static SOCKET (PASCAL *fp)(SOCKET a0, struct sockaddr* a1, int* a2);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub accept() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "accept")) == NULL) { FATAL("cannot find entry accept (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0, a1, a2);}int PASCALbind(SOCKET a0, const struct sockaddr* a1, int a2){ static int (PASCAL *fp)(SOCKET a0, const struct sockaddr* a1, int a2);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub bind() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "bind")) == NULL) { FATAL("cannot find entry bind (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0, a1, a2);}int PASCALclosesocket(SOCKET a0){ static int (PASCAL *fp)(SOCKET a0);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub closesocket() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "closesocket")) == NULL) { FATAL("cannot find entry closesocket (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0);}int PASCALconnect(SOCKET a0, const struct sockaddr* a1, int a2){ static int (PASCAL *fp)(SOCKET a0, const struct sockaddr* a1, int a2);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub connect() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "connect")) == NULL) { FATAL("cannot find entry connect (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0, a1, a2);}int PASCALgetpeername(SOCKET a0, struct sockaddr* a1, int* a2){ static int (PASCAL *fp)(SOCKET a0, struct sockaddr* a1, int* a2);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub getpeername() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "getpeername")) == NULL) { FATAL("cannot find entry getpeername (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0, a1, a2);}int PASCALgetsockname(SOCKET a0, struct sockaddr* a1, int* a2){ static int (PASCAL *fp)(SOCKET a0, struct sockaddr* a1, int* a2);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub getsockname() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "getsockname")) == NULL) { FATAL("cannot find entry getsockname (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0, a1, a2);}int PASCALgetsockopt(SOCKET a0, int a1, int a2, char* a3, int* a4){ static int (PASCAL *fp)(SOCKET a0, int a1, int a2, char* a3, int* a4);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub getsockopt() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "getsockopt")) == NULL) { FATAL("cannot find entry getsockopt (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0, a1, a2, a3, a4);}u_long PASCALhtonl(u_long a0){ static u_long (PASCAL *fp)(u_long a0);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub htonl() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "htonl")) == NULL) { FATAL("cannot find entry htonl (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0);}u_short PASCALhtons(u_short a0){ static u_short (PASCAL *fp)(u_short a0);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub htons() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "htons")) == NULL) { FATAL("cannot find entry htons (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0);}unsigned long PASCALinet_addr(const char* a0){ static unsigned long (PASCAL *fp)(const char* a0);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub inet_addr() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "inet_addr")) == NULL) { FATAL("cannot find entry inet_addr (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0);} char * PASCALinet_ntoa(struct in_addr a0){ static char * (PASCAL *fp)(struct in_addr a0);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub inet_ntoa() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "inet_ntoa")) == NULL) { FATAL("cannot find entry inet_ntoa (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0);}int PASCALioctlsocket(SOCKET a0, long a1, u_long * a2){ static int (PASCAL *fp)(SOCKET a0, long a1, u_long * a2);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub ioctlsocket() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "ioctlsocket")) == NULL) { FATAL("cannot find entry ioctlsocket (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0, a1, a2);}int PASCALlisten(SOCKET a0, int a1){ static int (PASCAL *fp)(SOCKET a0, int a1);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub listen() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "listen")) == NULL) { FATAL("cannot find entry listen (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0, a1);}u_long PASCALntohl(u_long a0){ static u_long (PASCAL *fp)(u_long a0);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub ntohl() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "ntohl")) == NULL) { FATAL("cannot find entry ntohl (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0);}u_short PASCALntohs(u_short a0){ static u_short (PASCAL *fp)(u_short a0);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub ntohs() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "ntohs")) == NULL) { FATAL("cannot find entry ntohs (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0);}int PASCALrecv(SOCKET a0, char* a1, int a2, int a3){ static int (PASCAL *fp)(SOCKET a0, char* a1, int a2, int a3);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub recv() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "recv")) == NULL) { FATAL("cannot find entry recv (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0, a1, a2, a3);}int PASCALrecvfrom(SOCKET a0, char* a1, int a2, int a3, struct sockaddr* a4, int* a5){ static int (PASCAL *fp)(SOCKET a0, char* a1, int a2, int a3, struct sockaddr* a4, int* a5);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub recvfrom() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "recvfrom")) == NULL) { FATAL("cannot find entry recvfrom (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0, a1, a2, a3, a4, a5);}int PASCALselect(int a0, fd_set* a1, fd_set* a2, fd_set* a3, const struct timeval* a4){ static int (PASCAL *fp)(int a0, fd_set* a1, fd_set* a2, fd_set* a3, const struct timeval* a4);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub select() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "select")) == NULL) { FATAL("cannot find entry select (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0, a1, a2, a3, a4);}int PASCALsend(SOCKET a0, const char* a1, int a2, int a3){ static int (PASCAL *fp)(SOCKET a0, const char* a1, int a2, int a3);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub send() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "send")) == NULL) { FATAL("cannot find entry send (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0, a1, a2, a3);}int PASCALsendto(SOCKET a0, const char* a1, int a2, int a3, const struct sockaddr* a4, int a5){ static int (PASCAL *fp)(SOCKET a0, const char* a1, int a2, int a3, const struct sockaddr* a4, int a5);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub sendto() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "sendto")) == NULL) { FATAL("cannot find entry sendto (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0, a1, a2, a3, a4, a5);}int PASCALsetsockopt(SOCKET a0, int a1, int a2, const char* a3, int a4){ static int (PASCAL *fp)(SOCKET a0, int a1, int a2, const char* a3, int a4);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub setsockopt() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "setsockopt")) == NULL) { FATAL("cannot find entry setsockopt (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0, a1, a2, a3, a4);}int PASCALshutdown(SOCKET a0, int a1){ static int (PASCAL *fp)(SOCKET a0, int a1);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub shutdown() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "shutdown")) == NULL) { FATAL("cannot find entry shutdown (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0, a1);}SOCKET PASCALsocket(int a0, int a1, int a2){ static SOCKET (PASCAL *fp)(int a0, int a1, int a2);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub socket() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "socket")) == NULL) { FATAL("cannot find entry socket (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0, a1, a2);}int PASCALMigrateWinsockConfiguration(int a0, int a1, int a2){ static int (PASCAL *fp)(int a0, int a1, int a2);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub MigrateWinsockConfiguration() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "MigrateWinsockConfiguration")) == NULL) { FATAL("cannot find entry MigrateWinsockConfiguration (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0, a1, a2);} struct hostent * PASCAL_org_gethostbyaddr(const char* a0, int a1, int a2){ static struct hostent * (PASCAL *fp)(const char* a0, int a1, int a2);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub _org_gethostbyaddr() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "gethostbyaddr")) == NULL) { FATAL("cannot find entry gethostbyaddr (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0, a1, a2);} struct hostent * PASCAL_org_gethostbyname(const char* a0){ static struct hostent * (PASCAL *fp)(const char* a0);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub _org_gethostbyname() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "gethostbyname")) == NULL) { FATAL("cannot find entry gethostbyname (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0);} struct protoent * PASCALgetprotobyname(const char* a0){ static struct protoent * (PASCAL *fp)(const char* a0);#ifdef DEBUG_STUB idnLogPrintf(idn_log_level_trace, "stub getprotobyname() called\n");#endif if (fp == NULL) { void *p; if ((p = GetProcAddress(DLLHANDLE, "getprotobyname")) == NULL) { FATAL("cannot find entry getprotobyname (%d)\n", GetLastError()); abort(); } fp = p; } return (*fp)(a0);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -