473,395 Members | 1,763 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

__stdcall and name decoration

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
Nov 17 '05 #1
1 2043
"Eric Twietmeyer" <no***@nowhere.com> wrote in message
news:xs********************@comcast.com...
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.


I think you can do it with a *.def file.
--
Jeff Partch [VC++ MVP]
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: middletree | last post by:
How do I request the actual page name that I'm on? This is going to go into an include file, and depending on which page I'm on, I'd like to do different things. I'm looking for "pagename.asp"
3
by: Christian Roth | last post by:
What I want: <p style="text-decoration: line-through"> Stricken <span style="text-decoration: none">not stricken</span> </p> , where "Stricken " should be the only thing that is lined...
2
by: Ed | last post by:
Suppose I want a function a pointer to which is going to be passed to another function to use __stdcall conventions. That is, I want the call to cbFunc() in tryCB3() to be compiled for __stdcall...
8
by: Bern | last post by:
hi all, what is the rule for decorating a symbol in c++?
1
by: Eric Twietmeyer | last post by:
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...
5
by: kwijibo28 | last post by:
Hi all, I was wondering if there is a standard definition for the calling convention like __cdecl and __stdcall. I've search the c++ standard document and there is no mention of __cdecl or...
2
by: GloStix | last post by:
For some reason, FF likes to put a black underline on all my buttons. No matter what I do, it has the line I've tried displaying as block and cursor, anything.. Also I've been trying to get it so...
54
by: Bartc | last post by:
I'm mixing C and ASM, and for calling ASM from C, I just happened to use the __stdcall convention (using C convention is not practical for other reasons). But, __stdcall seems to assume that...
1
by: vineetbindal | last post by:
Hi All, I am new to silverlight and i am following a tutorial. In order to connect to database in silverlight application i need to add a referance to a service. which gives me an error that the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.