openssl-capitulation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi there,

I don't have or use any windows installation or compilers, but as a wine 
user and openssl developer I was curious anyway about how well win32 
versions of openssl programs and libraries would function under wine. It 
turns out that the PRNG polling touches on some system monitoring 
functions for additional sources of entropy, and these were generating 
some exceptions.

So this just adds two stub functions that cause openssl to work (the error 
values returned from these two stub functions prevent the oodles of other 
functions from being used). This should help not only openssl programs 
(and scripts that use them), but also any win32 programs that depend on 
openssl DLLs.

Changelog (NetStatisticsGet):
- Add a stub for NetStatisticsGet

Changelog (Heap32ListFirst):
- Add a stub for Heap32ListFirst

Cheers,
Geoff

PS: the types added with NetStatisticsGet are not used, but will be needed 
if the stub is later implemented. The structure definitions in both 
patches were taken from msdn's online API reference - so don't commit if 
this is a violation of any legal fineprint.

PS2: I could have added stubs for the other Heap32<foo> functions too, but 
after doing the first one (and learning a little about the ntdll/kernel 
build) everything worked. Should I send stubs for the rest too?

-- 
Geoff Thorpe
geoff@geoffthorpe.net
http://www.geoffthorpe.net/

Index: dlls/netapi32/Makefile.in
===================================================================
RCS file: /home/wine/wine/dlls/netapi32/Makefile.in,v
retrieving revision 1.9
diff -u -r1.9 Makefile.in
--- dlls/netapi32/Makefile.in	16 Jun 2003 01:23:20 -0000	1.9
+++ dlls/netapi32/Makefile.in	10 Sep 2003 00:49:55 -0000
@@ -14,7 +14,8 @@
 	apibuf.c \
 	browsr.c \
 	netapi32.c \
-	wksta.c
+	wksta.c \
+	stats.c
 
 SUBDIRS = tests
 
Index: dlls/netapi32/netapi32.spec
===================================================================
RCS file: /home/wine/wine/dlls/netapi32/netapi32.spec,v
retrieving revision 1.12
diff -u -r1.12 netapi32.spec
--- dlls/netapi32/netapi32.spec	19 May 2003 23:06:35 -0000	1.12
+++ dlls/netapi32/netapi32.spec	10 Sep 2003 00:49:56 -0000
@@ -178,7 +178,7 @@
 @ stub NetShareEnumSticky
 @ stub NetShareGetInfo
 @ stub NetShareSetInfo
-@ stub NetStatisticsGet
+@ stdcall NetStatisticsGet(wstr wstr long long ptr)
 @ stub NetUseAdd
 @ stub NetUseDel
 @ stub NetUseEnum
Index: include/lm.h
===================================================================
RCS file: /home/wine/wine/include/lm.h,v
retrieving revision 1.2
diff -u -r1.2 lm.h
--- include/lm.h	23 Sep 2002 20:36:51 -0000	1.2
+++ include/lm.h	10 Sep 2003 00:49:56 -0000
@@ -27,5 +27,6 @@
 #include <lmaccess.h>
 #include <lmwksta.h>
 #include <lmapibuf.h>
+#include <lmstats.h>
 
 #endif
--- /dev/null	1969-12-31 19:00:00.000000000 -0500
+++ dlls/netapi32/stats.c	2003-09-09 20:42:18.000000000 -0400
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2003 Geoff Thorpe
+ *
+ * netapi32 statistics functions (placeholders for now)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <stdarg.h>
+#include <stdlib.h>
+#include "windef.h"
+#include "winbase.h"
+#include "nb30.h"
+#include "lmerr.h"
+#include "lmstats.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(netapi32);
+
+/************************************************************
+ *                NetStatisticsGet  (NETAPI32.@)
+ */
+NET_API_STATUS WINAPI NetStatisticsGet(LPWSTR *server, LPWSTR *service,
+                                       DWORD level, DWORD options,
+                                       LPBYTE *bufptr)
+{
+    TRACE("(%p, %p, %ld, %ld, %p)\n", server, service, level, options, bufptr);
+    return NERR_InternalError;
+}
--- /dev/null	1969-12-31 19:00:00.000000000 -0500
+++ include/lmstats.h	2003-09-09 20:20:40.000000000 -0400
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2003 Geoff Thorpe
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __WINE_LMSTATS_H
+#define __WINE_LMSTATS_H
+
+#include <lmcons.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct _STAT_WORKSTATION_0 {
+    LARGE_INTEGER StatisticsStartTime;
+    LARGE_INTEGER BytesReceived;
+    LARGE_INTEGER SmbsReceived;
+    LARGE_INTEGER PagingReadBytesRequested;
+    LARGE_INTEGER NonPagingReadBytesRequested;
+    LARGE_INTEGER CacheReadBytesRequested;
+    LARGE_INTEGER NetworkReadBytesRequested;
+    LARGE_INTEGER BytesTransmitted;
+    LARGE_INTEGER SmbsTransmitted;
+    LARGE_INTEGER PagingWriteBytesRequested;
+    LARGE_INTEGER NonPagingWriteBytesRequested;
+    LARGE_INTEGER CacheWriteBytesRequested;
+    LARGE_INTEGER NetworkWriteBytesRequested;
+    DWORD InitiallyFailedOperations;
+    DWORD FailedCompletionOperations;
+    DWORD ReadOperations;
+    DWORD RandomReadOperations;
+    DWORD ReadSmbs;
+    DWORD LargeReadSmbs;
+    DWORD SmallReadSmbs;
+    DWORD WriteOperations;
+    DWORD RandomWriteOperations;
+    DWORD WriteSmbs;
+    DWORD LargeWriteSmbs;
+    DWORD SmallWriteSmbs;
+    DWORD RawReadsDenied;
+    DWORD RawWritesDenied;
+    DWORD NetworkErrors;
+    DWORD Sessions;
+    DWORD FailedSessions;
+    DWORD Reconnects;
+    DWORD CoreConnects;
+    DWORD Lanman20Connects;
+    DWORD Lanman21Connects;
+    DWORD LanmanNtConnects;
+    DWORD ServerDisconnects;
+    DWORD HungSessions;
+    DWORD UseCount;
+    DWORD FailedUseCount;
+    DWORD CurrentCommands;
+} STAT_WORKSTATION_0, *PSTAT_WORKSTATION_0, *LPSTAT_WORKSTATION_0;
+
+typedef struct _STAT_SERVER_0 {
+    DWORD sts0_start;
+    DWORD sts0_fopens;
+    DWORD sts0_devopens;
+    DWORD sts0_jobsqueued;
+    DWORD sts0_sopens;
+    DWORD sts0_stimedout;
+    DWORD sts0_serrorout;
+    DWORD sts0_pwerrors;
+    DWORD sts0_permerrors;
+    DWORD sts0_syserrors;
+    DWORD sts0_bytessent_low;
+    DWORD sts0_bytessent_high;
+    DWORD sts0_bytesrcvd_low;
+    DWORD sts0_bytesrcvd_high;
+    DWORD sts0_avresponse;
+    DWORD sts0_reqbufneed;
+    DWORD sts0_bigbufneed;
+} STAT_SERVER_0, *PSTAT_SERVER_0, *LPSTAT_SERVER_0;
+
+NET_API_STATUS WINAPI NetStatisticsGet(LPWSTR *server, LPWSTR *service, DWORD level,
+                                       DWORD options, LPBYTE *bufptr);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
Index: dlls/kernel/kernel32.spec
===================================================================
RCS file: /home/wine/wine/dlls/kernel/kernel32.spec,v
retrieving revision 1.105
diff -u -r1.105 kernel32.spec
--- dlls/kernel/kernel32.spec	23 Aug 2003 23:30:51 -0000	1.105
+++ dlls/kernel/kernel32.spec	10 Sep 2003 01:32:58 -0000
@@ -541,7 +541,7 @@
 @ stdcall GlobalUnlock(long)
 @ stdcall GlobalWire(long)
 @ stub Heap32First
-@ stub Heap32ListFirst
+@ stdcall Heap32ListFirst(long ptr)
 @ stub Heap32ListNext
 @ stub Heap32Next
 @ stdcall HeapAlloc(long long long) ntdll.RtlAllocateHeap
Index: dlls/kernel/toolhelp.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/toolhelp.c,v
retrieving revision 1.21
diff -u -r1.21 toolhelp.c
--- dlls/kernel/toolhelp.c	5 Sep 2003 23:08:36 -0000	1.21
+++ dlls/kernel/toolhelp.c	10 Sep 2003 01:32:58 -0000
@@ -423,3 +423,13 @@
     FIXME(": stub\n");
     return 0;
 }
+
+/************************************************************************
+ *              Heap32ListFirst (KERNEL.@)
+ *
+ */
+BOOL WINAPI Heap32ListFirst(HANDLE hSnapshot, LPHEAPLIST32 lphl)
+{
+    FIXME(": stub\n");
+    return FALSE;
+}
Index: include/tlhelp32.h
===================================================================
RCS file: /home/wine/wine/include/tlhelp32.h,v
retrieving revision 1.9
diff -u -r1.9 tlhelp32.h
--- include/tlhelp32.h	4 Oct 2002 00:27:10 -0000	1.9
+++ include/tlhelp32.h	10 Sep 2003 01:32:59 -0000
@@ -146,6 +146,15 @@
 #define LPMODULEENTRY32 LPMODULEENTRY32W
 #endif
 
+typedef struct tagHEAPLIST32 {
+    SIZE_T dwSize;
+    DWORD th32ProcessID;
+    ULONG_PTR th32HeapID;
+    DWORD dwFlags;
+} HEAPLIST32, *PHEAPLIST32, *LPHEAPLIST32;
+
+BOOL WINAPI Heap32ListFirst(HANDLE,LPHEAPLIST32);
+
 #ifdef __cplusplus
 } /* extern "C" */
 #endif

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux