__stdcall and name decoration
Messages   Related Types
This message was discovered on microsoft.public.dotnet.languages.vc.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

Eric Twietmeyer
Hello,

I am wondering how it is that all of the windows base dlls, like
kernel32.dll specify that all of their functions are __stdcall and yet the
exported names from the dll are not decorated with the preceeding underscore
and following @ parameter byte count.

When I export a function from my dll with __stdcall specified, the name is
something of the form "_funcname@4". If I export with __cdecl calling
convention I have simply "funcname" in the exported functions list (from
dumpbin).

But all of the Win32 functions specified in WinBase.h, for instance,
LoadLibraryA, are specified WINAPI, which expands to __stdcall. But doing
dumpbin on Kernel32.dll shows that the name is simply "LoadLibraryA" and not
"_LoadLibraryA@4", or whatever.

Am I misunderstanding something? Or is there some special compiler switch
that will not decorate __stdcall names when reported by dumpbin?

I would like to use the __stdcall calling convention but allow users of the
library to call GetProcAddress by passing the undecorated name, as is done
for functions from Kernel32.dll.

Thanks in advance,

-Eric Twietmeyer

Reply to this message...
 
    
Jeff Partch [MVP] (VIP)
"Eric Twietmeyer" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

I think you can do it with a *.def file.
--
Jeff Partch [VC++ MVP]

Reply to this message...
 
 




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com