home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.os.development      Operating system development chatter      4,255 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 2,827 of 4,255   
   Alexei A. Frounze to muta...@gmail.com   
   Re: DLL   
   29 Aug 21 14:58:10   
   
   From: alexfrunews@gmail.com   
      
   On Saturday, August 28, 2021 at 10:20:22 PM UTC-7, muta...@gmail.com wrote:   
   > My next problem is that my functions appear to have an   
   > underscore in front of them (from kernel32.map):   
   >   
   > 0001:00000040 _WriteFile@20 10001040 f kernel32.obj   
   >   
   > What will Microsoft be doing to suppress that?   
   >   
   > Here is how each function I define looks like:   
   >   
   > #define WINAPI __declspec(dllexport) __stdcall   
   >   
   > I'm guessing that Microsoft has done something special   
   > to avoid namespace pollution. Any idea what?   
      
   I think this is the normal name decoration per the __stdcall calling   
   convention:   
   https://docs.microsoft.com/en-us/cpp/cpp/stdcall?view=msvc-160   
      
   There's nothing wrong with it.   
      
   The default C/C++ convention is __cdecl:   
   https://docs.microsoft.com/en-us/cpp/cpp/cdecl?view=msvc-160   
      
   Which prepends an underscore, except when exporting, if I'm reading it right.   
      
   The @size suffix is what makes __stdcall and __cdecl coexist without clashing.   
      
   Seems like either you should use __cdecl or you're missing proper function   
   declarations (with the calling convention/dllimport modifiers) on the   
   importing side.   
      
   Alex   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca