Re: Winlogon notifications. Please help !!!



As far as I know, you will need to use a .DEF file or `#pragma
comment(linker, "/EXPORT:...")' to alias an exported function to a different
external name than its decorated (C or C++) name. There is no good way that
I know of to do this with just `__declspec(dllexport)'.

--
Ken Johnson (Skywing)
Windows SDK MVP

"Sylvain" <noSpam@xxxxxxxx> wrote in message
news:44c1a216$0$827$ba4acef3@xxxxxxxxxxxxxxxxx
Alun Jones wrote on 22/07/2006 01:40:

That alone did not succeed in removing name decoration. The function
still got '_' put at the front, and "@4" at the end of its name.

such names look like C functions, not C++, so extern "C" wasn't the point.

but still, either I'm missing something or there are some hidden options
somewhere (since it works for me I've never invest that point).

to give on 'bad sample' ('bad' regarding this ng, but it's the first dll
that comes to me), the source:

CK_RV __declspec(dllexport) C_GetFunctionList(CK_FUNCTION_LIST**);
CK_RV __declspec(dllexport) C_Initialize(CK_VOID_PTR);
CK_RV __declspec(dllexport) C_Finalize(CK_VOID_PTR);

results in:

W:\out\debug>dumpbin /exports scpkcs11.dll
Microsoft (R) COFF Binary File Dumper Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

Dump of file scpkcs11.dll

File Type: DLL

Section contains the following exports for scpkcs11.dll
0 characteristics
44B5A6FF time date stamp Thu Jul 13 03:50:55 2006
0.00 version
1 ordinal base
68 number of functions
68 number of names

ordinal hint RVA name
1 0 00002900 C_CancelFunction
2 1 00001785 C_CloseAllSessions
...
24 17 00001096 C_Finalize
...
32 1F 0000278E C_GetFunctionList

and I haven't any .def in my projet.

OOH, when generating a COM library, I indeed use to insert a .def file
because of the same decoration problem ... hidden effect of the project
template ?...

Sylvain.


.



Relevant Pages

  • Re: Winlogon notifications. Please help !!!
    ... to give on 'bad sample' ('bad' regarding this ng, but it's the first dll that comes to me), the source: ... Copyright Microsoft Corp 1992-1998. ... ordinal hint RVA name ... OOH, when generating a COM library, I indeed use to insert a .def file because of the same decoration problem ... ...
    (microsoft.public.platformsdk.security)
  • Re: name decoration issue in DLL
    ... Name decoration depends only ... extern "C" suppresses name mangling, ... one must use DEF file. ... control name decoration for both DLL exported names and current DLL ...
    (microsoft.public.vc.language)
  • Re: DLL: .def file versus __declspec(dllexport)
    ... of just "Func" that I get when exporting with .def file. ... Historically .DEF files precede __declspecspecifier. ... name decoration. ...
    (microsoft.public.vc.language)
  • Re: How to create def file for dll?
    ... I don't know how to create decoration for a function, class, member ... ... "Palo Misik" wrote: ... Does it exists any tool which can generate def file for my project? ... and then select Module Definition File in the C++ items page. ...
    (microsoft.public.vc.language)
  • Re: syntax for function header/prototype and implementation
    ... put a leading underscore in front of a name depends on compiler version/brand. ... `extern "C"' linkage specifier doesn't suppress names decoration. ... If you want to export undecorated name of a function declared with `__stdcall' calling convention, then .DEF file is the only option. ...
    (microsoft.public.vc.language)