<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[DLL und Name Dekoration]]></title><description><![CDATA[<p>Hi,</p>
<p>ich hab eine Dll geschrieben, die sich prima statisch binden läßt. Gerade habe ich aber festgestellt, das dynamische Binden nicht klappt, weil die exportierten Namen dekoriert werden. Beispiel:</p>
<pre><code class="language-cpp">#define  WIN32_LEAN_AND_MEAN
#include &lt;windows.h&gt;

bool	g_done;
int		g_count;

BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved )
{
	switch (ul_reason_for_call)
	{
	case DLL_PROCESS_ATTACH:
	case DLL_THREAD_ATTACH:
	case DLL_THREAD_DETACH:
	case DLL_PROCESS_DETACH:
		break;
	}
    return TRUE;
}

extern &quot;C&quot; __declspec(dllexport) int __stdcall anyStart(const char* name)
{
	g_done = false;
	g_count = 0;

	return g_count;
}

int extern &quot;C&quot; __declspec(dllexport) __stdcall anyDo(int value)
{
	if (g_done)
		g_count += value;

	return g_count;
}

extern &quot;C&quot; __declspec(dllexport) void __stdcall anyStop(void)
{
	g_done = true;
}
</code></pre>
<p>Ergebnis aus dumpbin:</p>
<blockquote>
<p>ordinal hint RVA name</p>
<p>1 0 00001070 _anyDo@4 = _anyDo@4<br />
2 1 00001060 _anyStart@4 = _anyStart@4<br />
3 2 00001090 _anyStop@0 = _anyStop@0</p>
</blockquote>
<p>Wie bekomme ich diese häßliche Dekoration weg?<br />
Irgendwie muss das gehen, denn die Win32-Dlls haben das nicht.</p>
<p>Danke,<br />
don_basto.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/156737/dll-und-name-dekoration</link><generator>RSS for Node</generator><lastBuildDate>Thu, 23 Jul 2026 01:24:14 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/156737.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 19 Aug 2006 16:40:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to DLL und Name Dekoration on Sat, 19 Aug 2006 16:40:21 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ich hab eine Dll geschrieben, die sich prima statisch binden läßt. Gerade habe ich aber festgestellt, das dynamische Binden nicht klappt, weil die exportierten Namen dekoriert werden. Beispiel:</p>
<pre><code class="language-cpp">#define  WIN32_LEAN_AND_MEAN
#include &lt;windows.h&gt;

bool	g_done;
int		g_count;

BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved )
{
	switch (ul_reason_for_call)
	{
	case DLL_PROCESS_ATTACH:
	case DLL_THREAD_ATTACH:
	case DLL_THREAD_DETACH:
	case DLL_PROCESS_DETACH:
		break;
	}
    return TRUE;
}

extern &quot;C&quot; __declspec(dllexport) int __stdcall anyStart(const char* name)
{
	g_done = false;
	g_count = 0;

	return g_count;
}

int extern &quot;C&quot; __declspec(dllexport) __stdcall anyDo(int value)
{
	if (g_done)
		g_count += value;

	return g_count;
}

extern &quot;C&quot; __declspec(dllexport) void __stdcall anyStop(void)
{
	g_done = true;
}
</code></pre>
<p>Ergebnis aus dumpbin:</p>
<blockquote>
<p>ordinal hint RVA name</p>
<p>1 0 00001070 _anyDo@4 = _anyDo@4<br />
2 1 00001060 _anyStart@4 = _anyStart@4<br />
3 2 00001090 _anyStop@0 = _anyStop@0</p>
</blockquote>
<p>Wie bekomme ich diese häßliche Dekoration weg?<br />
Irgendwie muss das gehen, denn die Win32-Dlls haben das nicht.</p>
<p>Danke,<br />
don_basto.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1120395</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1120395</guid><dc:creator><![CDATA[don_basto]]></dc:creator><pubDate>Sat, 19 Aug 2006 16:40:21 GMT</pubDate></item><item><title><![CDATA[Reply to DLL und Name Dekoration on Sat, 19 Aug 2006 17:15:31 GMT]]></title><description><![CDATA[<p>Hab gerade mal den Weg über die DEF-Datei ausprobiert:</p>
<blockquote>
<p>EXPORTS<br />
anyStart=_anyStart@4<br />
anyDo=_anyDo@4<br />
anyStop=_anyStop@0</p>
</blockquote>
<p>Dann ergibt kommt dabei raus:</p>
<blockquote>
<p>ordinal hint RVA name</p>
<p>1 0 00001020 _anyDo@4 = _anyDo@4<br />
2 1 00001010 _anyStart@4 = _anyStart@4<br />
3 2 00001040 _anyStop@0 = _anyStop@0<br />
4 3 00001020 anyDo = _anyDo@4<br />
5 4 00001010 anyStart = _anyStart@4<br />
6 5 00001040 anyStop = _anyStop@0</p>
</blockquote>
<p>Das ist erstmal eine Lösung, aber nicht schön, da man bei Schnittstellenänderungen nicht vergessen darf, dass zu aktualisieren. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /><br />
Aber warum stehen noch die dekorierten Namen, die auf sich selbst zeigen?<br />
Falls jemand einen besseren Weg kennt, bitte posten.</p>
<p>Grüße,<br />
don_basto.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1120418</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1120418</guid><dc:creator><![CDATA[don_basto]]></dc:creator><pubDate>Sat, 19 Aug 2006 17:15:31 GMT</pubDate></item><item><title><![CDATA[Reply to DLL und Name Dekoration on Sat, 19 Aug 2006 20:20:29 GMT]]></title><description><![CDATA[<p>So:</p>
<pre><code class="language-cpp">EXPORTS 
anyStart
anyDo 
anyStop
</code></pre>
<p>muss die DEF-Datei aussehen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1120604</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1120604</guid><dc:creator><![CDATA[[[global:former_user]]]]></dc:creator><pubDate>Sat, 19 Aug 2006 20:20:29 GMT</pubDate></item><item><title><![CDATA[Reply to DLL und Name Dekoration on Sun, 20 Aug 2006 08:23:24 GMT]]></title><description><![CDATA[<p>Danke, so siehts gleich viel besser aus. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1120716</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1120716</guid><dc:creator><![CDATA[don_basto]]></dc:creator><pubDate>Sun, 20 Aug 2006 08:23:24 GMT</pubDate></item><item><title><![CDATA[Reply to DLL und Name Dekoration on Sun, 20 Aug 2006 11:11:53 GMT]]></title><description><![CDATA[<p>Noch zwei Frage zu den Def-Dateien. In der MSDN wird als Vorteil der DEFs die Zuordnung der Exportordinalzahlen hervorgehoben. Ich habe als Anwender von Dlls noch nie etwas mit diesen Zahlen zu tun gehabt.<br />
(1) Was soll der Vorteil von der Kontrolle der Exportordinalzahlen sein, bzw. inwiefern hat das für den Anwender einer Dll eine Bedeutung?</p>
<p>Ausserdem hab ich in der MSDN eine DATA-Attribut für die EXPORTS-Anweisung gefunden.<br />
(2)Wie importiert man als Anwender solche Daten?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1120808</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1120808</guid><dc:creator><![CDATA[don_basto]]></dc:creator><pubDate>Sun, 20 Aug 2006 11:11:53 GMT</pubDate></item></channel></rss>