Implementing stub version of dbgeng.dll (Debugger Engine API)

Volodymyr M. Shcherbyna volodymyr at shcherbyna.com
Wed Nov 17 14:52:49 CST 2010


---
 dlls/dbgeng/Makefile.in |    7 +++
 dlls/dbgeng/dbgeng.c    |  111
+++++++++++++++++++++++++++++++++++++++++++++++
 dlls/dbgeng/dbgeng.spec |    2 +
 3 files changed, 120 insertions(+), 0 deletions(-)
 create mode 100644 dlls/dbgeng/Makefile.in
 create mode 100644 dlls/dbgeng/dbgeng.c
 create mode 100644 dlls/dbgeng/dbgeng.spec

diff --git a/dlls/dbgeng/Makefile.in b/dlls/dbgeng/Makefile.in
new file mode 100644
index 0000000..07c58ab
--- /dev/null
+++ b/dlls/dbgeng/Makefile.in
@@ -0,0 +1,7 @@
+MODULE    = dbgeng.dll
+IMPORTLIB = dbgebg
+IMPORTS   = kernel
+
+C_SRCS = dbgeng.c
+
+ at MAKE_DLL_RULES@
diff --git a/dlls/dbgeng/dbgeng.c b/dlls/dbgeng/dbgeng.c
new file mode 100644
index 0000000..8461d33
--- /dev/null
+++ b/dlls/dbgeng/dbgeng.c
@@ -0,0 +1,111 @@
+/*
+ * Support for Microsoft Debugging Extension API
+ *
+ * Copyright 2010 WINE Project (http://www.winehq.org/)
+ *
+ * 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 "winternl.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(dbgeng);
+
+/************************************************************
+*                    DebugExtensionInitialize   (DBGENG.@)
+*
+* Initialize dbgeng Engine.
+*
+* PARAMS
+*   Version   [I] Receives the version of the extension. The high 16 bits
contain the major version number, and the low 16 bits contain the minor
version number.
+*   Flags     [I] Set this to zero. (Reserved for future use.)
+*
+* RETURNS
+*   Success: S_OK
+*   Failure: Any other value indicates that the extension DLL was unable to
initialize and the engine will unload it
+*
+* BUGS
+*   Unimplemented
+*/
+HRESULT WINAPI DebugExtensionInitialize(ULONG * Version, ULONG * Flags)
+{
+    FIXME("(%p,%p): stub\n", Version, Flags);
+
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+
+    return E_NOTIMPL;
+}
+
+/************************************************************
+*                    DebugCreate   (DBGENG.@)
+*
+* Creates a new client object and returns an interface pointer to it
+*
+* PARAMS
+*   InterfaceId   [I] Specifies the interface identifier (IID) of the
desired debugger engine client interface.
+*   Interface     [I] Receives an interface pointer for the new client.
+*
+* RETURNS
+*   Success: S_OK
+*   Failure: Any other value
+*
+* BUGS
+*   Unimplemented
+*/
+HRESULT WINAPI DebugCreate(REFIID InterfaceId, PVOID *Interface)
+{
+    FIXME("(%p,%p): stub\n", InterfaceId, Interface);
+
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+
+    return E_NOTIMPL;
+}
+
+/************************************************************
+*                    DllMain   (DBGENG.@)
+*
+* Library Entry Point
+*
+* PARAMS
+*   hInstance   [I] A handle to the DLL module
+*   fdwReason   [I] The reason code that indicates why the DLL entry-point
function is being called
+*   lpvReserved [I] Extended information
+*
+* RETURNS
+*   Success: TRUE (when fdwReason is DLL_PROCESS_ATTACH)
+*   Failure: FALSE (when fdwReason is DLL_PROCESS_ATTACH)
+*
+* BUGS
+*   Unimplemented
+*/
+BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID
lpvReserved)
+{
+    BOOL bRetVal = FALSE;
+
+    TRACE("(%p,%x,%p)\n", hInstance, fdwReason, lpvReserved);
+
+    switch (fdwReason)
+    {
+      case DLL_PROCESS_ATTACH:
+    bRetVal = DisableThreadLibraryCalls(hInstance);
+    break;
+    }
+
+    return bRetVal;
+}
diff --git a/dlls/dbgeng/dbgeng.spec b/dlls/dbgeng/dbgeng.spec
new file mode 100644
index 0000000..d8ba681
--- /dev/null
+++ b/dlls/dbgeng/dbgeng.spec
@@ -0,0 +1,2 @@
+@ stdcall DebugExtensionInitialize(ptr ptr)
+@ stdcall DebugCreate(ptr ptr)
-- 
1.7.2.3

--0016e656b65e73100e0495465f84
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello Everyone, <br><br>This is my first patch in WINE. I hope I did not do=
 any mistakes ...<br><br>I am trying to use several windows utilities under=
 WINE and I&#39;ve noticed that dumpchk.exe (a utility which analyzes crash=
 dumps generated by Windows) does not work under WINE as it requires dbgeng=
.dll (Debugger Engine API) to be implemented. I decided to implement stub v=
ersion of dbgeng.dll, so that maybe me or someone else in the future will c=
ontinue developing it. <br>
<br>Thanks,<br><br>From 1bd3eb1aecfb21a4155b9b59aec2c2790d3f334c Mon Sep 17=
 00:00:00 2001<br>From: Volodymyr M. Shcherbyna &lt;<a href=3D"mailto:volod=
ymyr at shcherbyna.com">volodymyr at shcherbyna.com</a>&gt;<br>Date: Wed, 17 Nov =
2010 21:52:49 +0100<br>
Subject: Implementing stub version of dbgeng.dll (Debugger Engine API)<br>R=
eply-To: wine-devel &lt;<a href=3D"mailto:wine-devel at winehq.org">wine-devel=
@winehq.org</a>&gt;<br><br>---<br>=A0dlls/dbgeng/Makefile.in |=A0=A0=A0 7 +=
++<br>
=A0dlls/dbgeng/dbgeng.c=A0=A0=A0 |=A0 111 +++++++++++++++++++++++++++++++++=
++++++++++++++<br>=A0dlls/dbgeng/dbgeng.spec |=A0=A0=A0 2 +<br>=A03 files c=
hanged, 120 insertions(+), 0 deletions(-)<br>=A0create mode 100644 dlls/dbg=
eng/Makefile.in<br>
=A0create mode 100644 dlls/dbgeng/dbgeng.c<br>=A0create mode 100644 dlls/db=
geng/dbgeng.spec<br><br>diff --git a/dlls/dbgeng/Makefile.in b/dlls/dbgeng/=
Makefile.in<br>new file mode 100644<br>index 0000000..07c58ab<br>--- /dev/n=
ull<br>
+++ b/dlls/dbgeng/Makefile.in<br>@@ -0,0 +1,7 @@<br>+MODULE=A0=A0=A0 =3D db=
geng.dll<br>+IMPORTLIB =3D dbgebg<br>+IMPORTS=A0=A0 =3D kernel<br>+<br>+C_S=
RCS =3D dbgeng.c<br>+<br>+ at MAKE_DLL_RULES@<br>diff --git a/dlls/dbgeng/dbge=
ng.c b/dlls/dbgeng/dbgeng.c<br>
new file mode 100644<br>index 0000000..8461d33<br>--- /dev/null<br>+++ b/dl=
ls/dbgeng/dbgeng.c<br>@@ -0,0 +1,111 @@<br>+/*<br>+ * Support for Microsoft=
 Debugging Extension API<br>+ *<br>+ * Copyright 2010 WINE Project (<a href=
=3D"http://www.winehq.org/">http://www.winehq.org/</a>)<br>
+ *<br>+ * This library is free software; you can redistribute it and/or<br=
>+ * modify it under the terms of the GNU Lesser General Public<br>+ * Lice=
nse as published by the Free Software Foundation; either<br>+ * version 2.1=
 of the License, or (at your option) any later version.<br>
+ *<br>+ * This library is distributed in the hope that it will be useful,<=
br>+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>+ =
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.=A0 See the GNU<br>
+ * Lesser General Public License for more details.<br>+ *<br>+ * You shoul=
d have received a copy of the GNU Lesser General Public<br>+ * License alon=
g with this library; if not, write to the Free Software<br>+ * Foundation, =
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA<br>
+ */<br>+<br>+#include &lt;stdarg.h&gt;<br>+<br>+#include &quot;windef.h&qu=
ot;<br>+#include &quot;winbase.h&quot;<br>+#include &quot;winternl.h&quot;<=
br>+#include &quot;wine/debug.h&quot;<br>+<br>+WINE_DEFAULT_DEBUG_CHANNEL(d=
bgeng);<br>
+<br>+/************************************************************<br>+*=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 DebugExtensionIni=
tialize=A0=A0 (DBGENG.@)<br>+*<br>+* Initialize dbgeng Engine.<br>+*<br>+* =
PARAMS<br>+*=A0=A0 Version=A0=A0 [I] Receives the version of the extension.=
 The high 16 bits contain the major version number, and the low 16 bits con=
tain the minor version number.<br>
+*=A0=A0 Flags=A0=A0=A0=A0 [I] Set this to zero. (Reserved for future use.)=
<br>+*<br>+* RETURNS<br>+*=A0=A0 Success: S_OK<br>+*=A0=A0 Failure: Any oth=
er value indicates that the extension DLL was unable to initialize and the =
engine will unload it<br>
+*<br>+* BUGS<br>+*=A0=A0 Unimplemented<br>+*/<br>+HRESULT WINAPI DebugExte=
nsionInitialize(ULONG * Version, ULONG * Flags)<br>+{<br>+=A0=A0=A0 FIXME(&=
quot;(%p,%p): stub\n&quot;, Version, Flags);<br>+=A0=A0=A0 <br>+=A0=A0=A0 S=
etLastError(ERROR_CALL_NOT_IMPLEMENTED);<br>
+=A0=A0=A0 <br>+=A0=A0=A0 return E_NOTIMPL;<br>+}<br>+<br>+/***************=
*********************************************<br>+*=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 DebugCreate=A0=A0 (DBGENG.@)<br>+*<br>+* =
Creates a new client object and returns an interface pointer to it<br>
+*<br>+* PARAMS<br>+*=A0=A0 InterfaceId=A0=A0 [I] Specifies the interface i=
dentifier (IID) of the desired debugger engine client interface.<br>+*=A0=
=A0 Interface=A0=A0=A0=A0 [I] Receives an interface pointer for the new cli=
ent.<br>+*<br>+* RETURNS<br>
+*=A0=A0 Success: S_OK<br>+*=A0=A0 Failure: Any other value<br>+*<br>+* BUG=
S<br>+*=A0=A0 Unimplemented<br>+*/<br>+HRESULT WINAPI DebugCreate(REFIID In=
terfaceId, PVOID *Interface)<br>+{<br>+=A0=A0=A0 FIXME(&quot;(%p,%p): stub\=
n&quot;, InterfaceId, Interface);<br>
+=A0=A0=A0 <br>+=A0=A0=A0 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);<br>+=A0=
=A0=A0 <br>+=A0=A0=A0 return E_NOTIMPL;<br>+}<br>+<br>+/*******************=
*****************************************<br>+*=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 DllMain=A0=A0 (DBGENG.@)<br>+*<br>
+* Library Entry Point<br>+*<br>+* PARAMS<br>+*=A0=A0 hInstance=A0=A0 [I] A=
 handle to the DLL module<br>+*=A0=A0 fdwReason=A0=A0 [I] The reason code t=
hat indicates why the DLL entry-point function is being called<br>+*=A0=A0 =
lpvReserved [I] Extended information<br>
+*<br>+* RETURNS<br>+*=A0=A0 Success: TRUE (when fdwReason is DLL_PROCESS_A=
TTACH)<br>+*=A0=A0 Failure: FALSE (when fdwReason is DLL_PROCESS_ATTACH)<br=
>+*<br>+* BUGS<br>+*=A0=A0 Unimplemented<br>+*/<br>+BOOL WINAPI DllMain(HIN=
STANCE hInstance, DWORD fdwReason, LPVOID lpvReserved)<br>
+{<br>+=A0=A0=A0 BOOL bRetVal =3D FALSE;<br>+=A0=A0=A0 <br>+=A0=A0=A0 TRACE=
(&quot;(%p,%x,%p)\n&quot;, hInstance, fdwReason, lpvReserved);<br>+=A0=A0=
=A0 <br>+=A0=A0=A0 switch (fdwReason)<br>+=A0=A0=A0 {<br>+=A0=A0=A0=A0=A0 c=
ase DLL_PROCESS_ATTACH:<br>+=A0=A0=A0 bRetVal =3D DisableThreadLibraryCalls=
(hInstance);<br>
+=A0=A0=A0 break;<br>+=A0=A0=A0 }=A0=A0=A0 <br>+=A0=A0=A0 <br>+=A0=A0=A0 re=
turn bRetVal;<br>+}<br>diff --git a/dlls/dbgeng/dbgeng.spec b/dlls/dbgeng/d=
bgeng.spec<br>new file mode 100644<br>index 0000000..d8ba681<br>--- /dev/nu=
ll<br>+++ b/dlls/dbgeng/dbgeng.spec<br>
@@ -0,0 +1,2 @@<br>+@ stdcall DebugExtensionInitialize(ptr ptr)<br>+@ stdca=
ll DebugCreate(ptr ptr)<br>-- <br>1.7.2.3<br><br>

--0016e656b65e73100e0495465f84--



More information about the wine-patches mailing list