ReactOS 0.4.16-dev-927-g467dec4
getproc.cpp File Reference
#include <corecrt_internal.h>
#include <process.h>
Include dependency graph for getproc.cpp:

Go to the source code of this file.

Macros

#define _CRT_ENABLE_OBSOLETE_LOADLIBRARY_FUNCTIONS
 

Typedefs

typedef int(__cdeclproc_address_type) ()
 

Functions

DECLSPEC_GUARD_SUPPRESS proc_address_type __cdecl _getdllprocaddr (intptr_t const module_handle_value, char *const procedure_name, intptr_t const ordinal)
 

Macro Definition Documentation

◆ _CRT_ENABLE_OBSOLETE_LOADLIBRARY_FUNCTIONS

#define _CRT_ENABLE_OBSOLETE_LOADLIBRARY_FUNCTIONS

Definition at line 14 of file getproc.cpp.

Typedef Documentation

◆ proc_address_type

typedef int(__cdecl * proc_address_type) ()

Definition at line 37 of file getproc.cpp.

Function Documentation

◆ _getdllprocaddr()

DECLSPEC_GUARD_SUPPRESS proc_address_type __cdecl _getdllprocaddr ( intptr_t const  module_handle_value,
char *const  procedure_name,
intptr_t const  ordinal 
)

Definition at line 41 of file getproc.cpp.

46{
47 HMODULE const module_handle = reinterpret_cast<HMODULE>(module_handle_value);
48 if (procedure_name == nullptr)
49 {
50 if (ordinal <= 65535)
51 {
52 char* const ordinal_as_string = reinterpret_cast<char*>(ordinal);
53 return reinterpret_cast<proc_address_type>(
54 GetProcAddress(module_handle, ordinal_as_string));
55 }
56 }
57 else
58 {
59 if (ordinal == static_cast<intptr_t>(-1))
60 {
61 return reinterpret_cast<proc_address_type>(
62 GetProcAddress(module_handle, procedure_name));
63 }
64 }
65
66 return nullptr;
67}
#define GetProcAddress(x, y)
Definition: compat.h:753
int(__cdecl * proc_address_type)()
Definition: getproc.cpp:37
int intptr_t
Definition: vcruntime.h:134