Francois Gouget : ndis.sys: Convert ndis.sys to a native driver as it should be.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Mar 2 08:51:50 CST 2015


Module: wine
Branch: master
Commit: 119e20a822c69e7b3d5663b4bc16107baa99a6f7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=119e20a822c69e7b3d5663b4bc16107baa99a6f7

Author: Francois Gouget <fgouget at free.fr>
Date:   Sat Feb 28 18:30:59 2015 +0100

ndis.sys: Convert ndis.sys to a native driver as it should be.

---

 dlls/ndis.sys/Makefile.in |  1 +
 dlls/ndis.sys/main.c      | 22 ++++++++++------------
 2 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/dlls/ndis.sys/Makefile.in b/dlls/ndis.sys/Makefile.in
index d469e4e..33b1843 100644
--- a/dlls/ndis.sys/Makefile.in
+++ b/dlls/ndis.sys/Makefile.in
@@ -1,4 +1,5 @@
 MODULE    = ndis.sys
+EXTRADLLFLAGS = -Wb,--subsystem,native
 
 C_SRCS = \
 	main.c
diff --git a/dlls/ndis.sys/main.c b/dlls/ndis.sys/main.c
index 99a0498..820b4af 100644
--- a/dlls/ndis.sys/main.c
+++ b/dlls/ndis.sys/main.c
@@ -18,23 +18,21 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "config.h"
-
 #include <stdarg.h>
 
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
 #include "windef.h"
 #include "winbase.h"
+#include "winternl.h"
+#include "ddk/wdm.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(ndis);
 
-BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
+NTSTATUS WINAPI DriverEntry(DRIVER_OBJECT *driver, UNICODE_STRING *path)
 {
-    switch (reason)
-    {
-        case DLL_WINE_PREATTACH:
-            return FALSE;    /* prefer native version */
-        case DLL_PROCESS_ATTACH:
-            DisableThreadLibraryCalls(instance);
-            break;
-    }
+    TRACE("(%p, %s)\n", driver, debugstr_w(path->Buffer));
 
-    return TRUE;
+    return STATUS_SUCCESS;
 }




More information about the wine-cvs mailing list