Minimal Background Intelligent Transfer Service (bits) implementation

Roy roy at cs.hmc.edu
Wed Sep 19 12:28:55 CDT 2007


Howdy,

Resubmission of bits skeleton with a DLL_WINE_PREATTACH case added to
DllMain.  Thanks for the advice!

Peace,
-Roy

On Wed, Sep 19, 2007 at 09:57:45AM +0200, Michael Stefaniuc wrote:
> Hello Roy,
> 
> Roy wrote:
> > This patch provides a first skeleton version of bits.dll.
> thanks for the patch but could you please add also a DLL_WINE_PREATTACH
> case in DllMain()? That way Wine can prefer to load a native bits DLL
> (if one is available) until the Wine one gets usable. See for example
> the mscoree DLL for an example (dlls/mscoree/mscoree_main.c).
> 
> thanks
> bye
> 	michael
> 
> > From 95f4728e706861f201fb2b399e7ca5db128e71b3 Mon Sep 17 00:00:00 2001
> > From: Roy Shea <roy at cs.ucla.edu>
> > Date: Tue, 18 Sep 2007 14:29:14 -0700
> > Subject: Minimal Background Intelligent Transfer Service (bits) implementation
> > 
> > ---
> >  dlls/bits/Makefile.in |   16 ++++++++++++++++
> >  dlls/bits/bits.spec   |    4 ++++
> >  dlls/bits/bits_main.c |   43 +++++++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 63 insertions(+), 0 deletions(-)
> >  create mode 100644 dlls/bits/Makefile.in
> >  create mode 100644 dlls/bits/bits.spec
> >  create mode 100644 dlls/bits/bits_main.c
> > 
> > diff --git a/dlls/bits/Makefile.in b/dlls/bits/Makefile.in
> > new file mode 100644
> > index 0000000..2c9e293
> > --- /dev/null
> > +++ b/dlls/bits/Makefile.in
> > @@ -0,0 +1,16 @@
> > +TOPSRCDIR = @top_srcdir@
> > +TOPOBJDIR = ../..
> > +SRCDIR    = @srcdir@
> > +VPATH     = @srcdir@
> > +MODULE    = bits.dll
> > +IMPORTS   = kernel32
> > +EXTRALIBS = 
> > +
> > +C_SRCS = \
> > +	bits_main.c
> > +
> > +#RC_SRCS = version.rc
> > +
> > + at MAKE_DLL_RULES@
> > +
> > + at DEPENDENCIES@  # everything below this line is overwritten by make depend
> > diff --git a/dlls/bits/bits.spec b/dlls/bits/bits.spec
> > new file mode 100644
> > index 0000000..c5fc87a
> > --- /dev/null
> > +++ b/dlls/bits/bits.spec
> > @@ -0,0 +1,4 @@
> > +@ stub DllCanUnloadNow
> > +@ stub DllGetClassObject
> > +@ stub DllRegisterServer
> > +@ stub DllUnregisterServer
> > diff --git a/dlls/bits/bits_main.c b/dlls/bits/bits_main.c
> > new file mode 100644
> > index 0000000..37be887
> > --- /dev/null
> > +++ b/dlls/bits/bits_main.c
> > @@ -0,0 +1,43 @@
> > +/*
> > + * Implementation of bits.dll
> > + * Background Intelligent Transfer Service (bits) interface
> > + *
> > + * Copyright 2007 Google (Roy Shea)
> > + *
> > + * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
> > + */
> > +
> > +#include <stdarg.h>
> > +
> > +#include "windef.h"
> > +#include "wine/debug.h"
> > +
> > +WINE_DEFAULT_DEBUG_CHANNEL( bits );
> > +
> > +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
> > +{
> > +    TRACE("(%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
> > +
> > +    switch (fdwReason)
> > +    {
> > +    case DLL_PROCESS_ATTACH:
> > +        DisableThreadLibraryCalls(hinstDLL);
> > +        break;
> > +    case DLL_PROCESS_DETACH:
> > +        break;
> > +    }
> > +    
> > +    return TRUE;
> > +}
> > 
> > 
> > ------------------------------------------------------------------------
> > 
> > 
> 
> 
> -- 
> Michael Stefaniuc               Tel.: +49-711-96437-199
> Sr. Network Engineer            Fax.: +49-711-96437-111
> --------------------------------------------------------------------
> Reg. Adresse: Red Hat GmbH, Hauptst??tter Strasse 58, 70178 Stuttgart
> Handelsregister: Amtsgericht Stuttgart HRB 153243
> Gesch??ftsf??hrer: Brendan Lane, Charlie Peters, Michael Cunningham,
>                  Werner Knoblich
-------------- next part --------------
 dlls/bits/Makefile.in |   16 ++++++++++++++++
 dlls/bits/bits.spec   |    4 ++++
 dlls/bits/bits_main.c |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 66 insertions(+), 0 deletions(-)
 create mode 100644 dlls/bits/Makefile.in
 create mode 100644 dlls/bits/bits.spec
 create mode 100644 dlls/bits/bits_main.c

diff --git a/dlls/bits/Makefile.in b/dlls/bits/Makefile.in
new file mode 100644
index 0000000..2c9e293
--- /dev/null
+++ b/dlls/bits/Makefile.in
@@ -0,0 +1,16 @@
+TOPSRCDIR = @top_srcdir@
+TOPOBJDIR = ../..
+SRCDIR    = @srcdir@
+VPATH     = @srcdir@
+MODULE    = bits.dll
+IMPORTS   = kernel32
+EXTRALIBS = 
+
+C_SRCS = \
+	bits_main.c
+
+#RC_SRCS = version.rc
+
+ at MAKE_DLL_RULES@
+
+ at DEPENDENCIES@  # everything below this line is overwritten by make depend
diff --git a/dlls/bits/bits.spec b/dlls/bits/bits.spec
new file mode 100644
index 0000000..c5fc87a
--- /dev/null
+++ b/dlls/bits/bits.spec
@@ -0,0 +1,4 @@
+@ stub DllCanUnloadNow
+@ stub DllGetClassObject
+@ stub DllRegisterServer
+@ stub DllUnregisterServer
diff --git a/dlls/bits/bits_main.c b/dlls/bits/bits_main.c
new file mode 100644
index 0000000..9e912b3
--- /dev/null
+++ b/dlls/bits/bits_main.c
@@ -0,0 +1,46 @@
+/*
+ * Implementation of bits.dll
+ * Background Intelligent Transfer Service (bits) interface
+ *
+ * Copyright 2007 Google (Roy Shea)
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL( bits );
+
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+{
+    TRACE("(%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
+
+    switch (fdwReason)
+    {
+    case DLL_WINE_PREATTACH:
+        return FALSE;  /* prefer native version */
+    case DLL_PROCESS_ATTACH:
+        DisableThreadLibraryCalls(hinstDLL);
+        break;
+    case DLL_PROCESS_DETACH:
+        break;
+    }
+    
+    return TRUE;
+}


More information about the wine-devel mailing list