Questions tagged [stdcall]

Anything related to the `stdcall` calling convention, i.e. one of the common subroutine calling conventions used on systems with x86 architecture.

Anything related to the stdcall calling convention, i.e. one of the common subroutine calling conventions used on systems with x86 architecture.

See Wikipedia on:

150 questions
2
votes
2 answers

Creating a map of __stdcall

I'm trying to create a map of function names and function pointers using __stdcall. Here is how I currently get my function pointers: typedef int (CALLBACK* InitializeDLL)(int,int); InitializeDLL initializeDLL =…
telkins
  • 10,440
  • 8
  • 52
  • 79
2
votes
2 answers

Pattern of component with callback system with stdcall calling convention

This question arised from this one. The problem is: create non visual component which can hold many callbacks commands from system. User can define unlimited number of callbacks in the IDE. Callbacks will be defined in TCollection as…
Peter
  • 269
  • 3
  • 13
1
vote
1 answer

Is preceding a function with CALLBACK or WINAPI or PASCAL (in MFC) is absolutely necessary or only for readability purpose?

In MFC VC++, setTimer function is setted using a CALLBACK procedure. From the link I read that A function that is marked with __stdcall uses the standard calling convention so named because all Win32 API functions (except the few that take…
Muthu Ganapathy Nathan
  • 3,199
  • 16
  • 47
  • 77
1
vote
3 answers

With Mingw created static library link into VS2008 project?

What am I trying to do? ... First, create static library with MinGW's g++ compiler. So, simple example files are ... test.h #ifndef EXAMPLE_H #define EXAMPLE_H #include #ifdef __cplusplus extern "C" { #endif #ifdef…
1
vote
2 answers

mingw32 g++ and stdcall @suffix

I declared some C++ functions prototyped as follows: extern "C" void __stdcall function(); I also have some third-party dll with exported function() - no name decorations at all. I'm unable to build my exe or dll due to undefined reference to…
j.l.
  • 71
  • 1
  • 1
  • 7
1
vote
0 answers

Issues passing a C# callback pointer to a C library

I have built a C# library that accesses a C dll. The C dll accesses an API that taps a communication bus. When a message is received on that bus, it generates an interrupt that runs a function (defined as a __cdecl pointer to a function in the C#…
BampyRocket
  • 96
  • 1
  • 11
1
vote
0 answers

Stack overflow occurs if I call an assembler routine too many times

I pruned everything to the min to show this problem In Compaq Visual Fortran I write Do 1 I =1,N CALL SUBNAM(A,B,100) 1 CONTINUE If "SUBNAM" is any routine written in Fortran , the DO loop count N can be as big as you like. N=100000 is…
Paul
  • 114
  • 3
1
vote
1 answer

Is passing a DLL function argument with "const" an equivalent to pointer?

Data block: PMyDataBlock = ^MyDataBlock; MyDataBlock = record // ............. end; Is a following definition: function MyFunction(const pstSettings: MyDataBlock): HRESULT; stdcall; external 'MyLib.dll' name 'MyFunction'; a full equivalent of…
Paul
  • 25,812
  • 38
  • 124
  • 247
1
vote
0 answers

MessageBox program in x86 assembly

Having a simple MessageBox program like that: NULL EQU 0 ; Constants MB_DEFBUTTON1 EQU 0 MB_DEFBUTTON2 EQU 100h IDNO EQU 7 MB_YESNO EQU 4 extern _MessageBoxA@16 ; Import…
Daros911
  • 435
  • 5
  • 14
1
vote
0 answers

Checking if 2 areas in memory are the same in VBA - Bad Calling convention

I'd like to compare the memory at 2 addresses for equality. I've seen people use this: Private Declare Function RtlCompareMemory Lib "ntdll" ( _ ByRef Source1 As Any, _ ByRef Source2 As Any, _ ByVal Length As Long _ ) As Long However…
Greedo
  • 4,967
  • 2
  • 30
  • 78
1
vote
1 answer

EndScene hook questions

So recently I wanted to add an imgui interface to an example window using DirectX, so I watched on a video I had to hook the EndScene function using DirectX9sdk to be able to add my custom imgui interface. However I have some questions: Where can I…
Alex
  • 840
  • 7
  • 23
1
vote
0 answers

Export go function to C - illegal character

I need some assistance to export a GO dll function to a C program. The C program (which I'm not the author) required to call a function with this name: _RVExtension@12 so, I simply declare my go function like this: //export _RVExtension@12 func…
Alexis 74
  • 11
  • 2
1
vote
1 answer

stdcall and cdecl stack alignment size

I have two questions: Is the stack alignment for the stdcall calling convention always 4 bytes, or is it 4 for a 32 bit machine and 8 for a 64 bit machine? What is the stack alignment size for cdecl? I am using Microsoft Visual Studio 2010.
Jin
  • 11
  • 2
1
vote
0 answers

Compile with _stdcall under UNIX system

I'm making a Native Unity Plugin for a linux game, and I have to define C# callbacks, called by my native plugin coded in C. So the plugin extension is .so since I will compile the game only for linux. I read on the net that I should annotate…
lordjj
  • 29
  • 5
1
vote
1 answer

__stdcall typedef struct

I am writing my first DLL in C++. Using __declspec(dll_export), I am able to read it on Python and C++ using a C wrapper. But I want now to read it on C too, so I have to add now the __stdcall convention. But I don't know how to apply it to a…
Mathieu Gauquelin
  • 601
  • 11
  • 35