summaryrefslogtreecommitdiffstats
path: root/src/lib/crypto/win_glue.c
diff options
context:
space:
mode:
authorKeith Vetter <keithv@fusion.com>1995-03-03 02:20:21 +0000
committerKeith Vetter <keithv@fusion.com>1995-03-03 02:20:21 +0000
commit02a6367ca07d1d098a67121716cf02dfa0d7a0e2 (patch)
treef1d3fffae86d5d463a64f058aa8d8c4c74bc2722 /src/lib/crypto/win_glue.c
parente61bc5292e6690d3e2e188016274758264351286 (diff)
downloadkrb5-02a6367ca07d1d098a67121716cf02dfa0d7a0e2.tar.gz
krb5-02a6367ca07d1d098a67121716cf02dfa0d7a0e2.tar.xz
krb5-02a6367ca07d1d098a67121716cf02dfa0d7a0e2.zip
Added the files and changes needed to create a dll out of libcrypto
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5068 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/crypto/win_glue.c')
-rw-r--r--src/lib/crypto/win_glue.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/lib/crypto/win_glue.c b/src/lib/crypto/win_glue.c
new file mode 100644
index 000000000..0680f80c3
--- /dev/null
+++ b/src/lib/crypto/win_glue.c
@@ -0,0 +1,53 @@
+#define NEED_SOCKETS
+#include <k5-int.h>
+
+/*
+ * WinSock support.
+ *
+ * Do the WinSock initialization call, keeping all the hair here.
+ *
+ * This routine is called by SOCKET_INITIALIZE in include/c-windows.h.
+ * The code is pretty much copied from winsock.txt from winsock-1.1,
+ * available from:
+ * ftp://sunsite.unc.edu/pub/micro/pc-stuff/ms-windows/winsock/winsock-1.1
+ */
+int
+win_socket_initialize()
+{
+ WORD wVersionRequested;
+ WSADATA wsaData;
+ int err;
+
+ wVersionRequested = 0x0101; /* We need version 1.1 */
+
+ err = WSAStartup (wVersionRequested, &wsaData);
+ if (err != 0)
+ return err; /* Library couldn't initialize */
+
+ if (wVersionRequested != wsaData.wVersion) {
+ /* DLL couldn't support our version of the spec */
+ WSACleanup ();
+ return -104; /* FIXME -- better error? */
+ }
+
+ return 0;
+}
+
+BOOL CALLBACK
+LibMain(hInst, wDataSeg, cbHeap, CmdLine)
+ HINSTANCE hInst;
+ WORD wDataSeg;
+ WORD cbHeap;
+ LPSTR CmdLine;
+{
+ win_socket_initialize ();
+ return 1;
+}
+
+
+int CALLBACK __export
+WEP(nParam)
+ int nParam;
+{
+ return 1;
+}