473,321 Members | 1,622 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,321 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 2039
"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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.