Home

Resume

Blog

Teikitu


/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
/*  »Project«   Teikitu Gaming System (TgS) (∂)
    »File«      TgS (WIN) Common - Base - LoadDLL.h
    »Author«    Andrew Aye (EMail: mailto:andrew.aye@gmail.com, Web: http://www.andrewaye.com)
    »Version«   4.51 / »GUID« A9981407-3EC9-42AF-8B6F-8BE6DD919615                                                                                                        */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
/*  Copyright: © 2002-2017, Andrew Aye.  All Rights Reserved.
    This software is free for non-commercial use.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
    following conditions are met:
    Redistribution of source code must retain this copyright notice, this list of conditions and the following disclaimers.
    Redistribution in binary form must reproduce this copyright notice, this list of conditions and the following disclaimers in the documentation and other materials
    provided with the distribution.
    The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
    The intellectual property rights of the algorithms used reside with Andrew Aye.
    You may not use this software, in whole or in part, in support of any commercial product without the express written consent of the author.
    There is no warranty or other guarantee of fitness of this software for any purpose. It is provided solely "as is".                                                   */
/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
#if !defined(TGS_WIN_COMMON_BASE_LOADDLL_H)
#define TGS_WIN_COMMON_BASE_LOADDLL_H
#pragma once


/* == Common ============================================================================================================================================================ */

/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */
/*  Public Types                                                                                                                                                          */
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */

typedef struct HINSTANCE__                                          *TgMS_HINSTANCE;
typedef TgMS_HINSTANCE                                              TgMS_HMODULE;
typedef struct HWND__                                               *TgMS_HWND;
typedef TgSINT64                                                    (__stdcall *TgMS_FARPROC)( TgVOID );
typedef struct HDC__                                                *TgMS_HDC;
typedef struct HMONITOR__                                           *TgMS_HMONITOR;
typedef struct _SECURITY_ATTRIBUTES                                 *TgMS_LPSECURITY_ATTRIBUTES;
typedef struct _RTL_CRITICAL_SECTION                                *TgMS_LPCRITICAL_SECTION;
typedef struct _CREATEFILE2_EXTENDED_PARAMETERS                     *TgMS_LPCREATEFILE2_EXTENDED_PARAMETERS;
typedef struct COPYFILE2_EXTENDED_PARAMETERS                        *TgMS_LPCOPYFILE2_EXTENDED_PARAMETERS;
typedef struct _OVERLAPPED                                          *TgMS_LPOVERLAPPED;
typedef struct _SYSTEM_INFO                                         *TgMS_LPSYSTEM_INFO;


typedef long                                                        HRESULT;

#if !defined(TgCOMPILE_PLATFORM_UWP)
typedef TgBOOL (__stdcall* TgMS_MONITORENUMPROC)( TgMS_HMONITOR, TgMS_HDC, P_TgVOID, TgSINT64 );
#endif


/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */
/*  Public Data                                                                                                                                                           */
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */

TgEXTN TgMS_HINSTANCE                       g_hInstance;
TgEXTN TgMS_HWND                            g_hWnd;

/*  API Set: api-ms-win-core-synch-l1-2-0 */
TgEXTN P_TgVOID                             (__stdcall *g_pfnCreateEventEx)( TgMS_LPSECURITY_ATTRIBUTES, CP_TgCHAR, DWORD, DWORD);
TgEXTN TgBOOL                               (__stdcall *g_pfnSetEvent)( P_TgVOID );
TgEXTN TgBOOL                               (__stdcall *g_pfnResetEvent)( P_TgVOID );
TgEXTN P_TgVOID                             (__stdcall *g_pfnCreateSemaphoreEx)( TgMS_LPSECURITY_ATTRIBUTES, LONG, LONG, CP_TgCHAR, DWORD, DWORD );
TgEXTN TgSINT32                             (__stdcall *g_pfnReleaseSemaphore)( P_TgVOID, LONG, LPLONG );
TgEXTN P_TgVOID                             (__stdcall *g_pfnCreateMutexEx)( TgMS_LPSECURITY_ATTRIBUTES, CP_TgCHAR, DWORD, DWORD );
TgEXTN TgSINT32                             (__stdcall *g_pfnReleaseMutex)( P_TgVOID );
TgEXTN TgBOOL                               (__stdcall *g_pfnInitializeCriticalSectionEx)( TgMS_LPCRITICAL_SECTION, DWORD, DWORD );
TgEXTN TgVOID                               (__stdcall *g_pfnEnterCriticalSection)( TgMS_LPCRITICAL_SECTION );
TgEXTN TgVOID                               (__stdcall *g_pfnLeaveCriticalSection)( TgMS_LPCRITICAL_SECTION );
TgEXTN TgSINT32                             (__stdcall *g_pfnTryEnterCriticalSection)( TgMS_LPCRITICAL_SECTION );
TgEXTN TgVOID                               (__stdcall *g_pfnDeleteCriticalSection)( TgMS_LPCRITICAL_SECTION );
TgEXTN DWORD                                (__stdcall *g_pfnWaitForSingleObjectEx)( P_TgVOID, DWORD, TgBOOL );
TgEXTN TgVOID                               (__stdcall *g_pfnSleep)( DWORD );

 /*  API Set: api-ms-win-core-processthreads-l1-1-2 */
TgEXTN P_TgVOID                             (__stdcall *g_pfnGetCurrentProcess)( TgVOID );
TgEXTN DWORD                                (__stdcall *g_pfnGetCurrentProcessId)( TgVOID );
TgEXTN P_TgVOID                             (__stdcall *g_pfnCreateThread)( TgMS_LPSECURITY_ATTRIBUTES, TgSIZE, LPTHREAD_START_ROUTINE, P_TgVOID, DWORD, P_TgUINT32 );
TgEXTN P_TgVOID                             (__stdcall *g_pfnGetCurrentThread)( TgVOID ); /* Returns a pseudo-handle */
TgEXTN DWORD                                (__stdcall *g_pfnGetCurrentThreadId)( TgVOID );
TgEXTN DWORD                                (__stdcall *g_pfnGetThreadId)( P_TgVOID );
TgEXTN TgVOID                               (__stdcall *g_pfnExitThread)( DWORD );
TgEXTN TgBOOL                               (__stdcall *g_pfnTerminateThread)( P_TgVOID, DWORD );
TgEXTN TgBOOL                               (__stdcall *g_pfnSetThreadPriority)( P_TgVOID, TgSINT32 );
TgEXTN TgSINT32                             (__stdcall *g_pfnSwitchToThread)( TgVOID );
TgEXTN TgSINT32                             (__stdcall *g_pfnIsProcessorFeaturePresent)( DWORD );

 /*  API Set: api-ms-win-core-handle-l1-1-0 */
TgEXTN TgSINT32                             (__stdcall *g_pfnCloseHandle)( P_TgVOID );
TgEXTN TgSINT32                             (__stdcall *g_pfnDuplicateHandle)( P_TgVOID, P_TgVOID, P_TgVOID, PP_TgVOID, DWORD, BOOL, DWORD );

 /*  API Set: api-ms-win-core-errorhandling-l1-1-1 */
TgEXTN TgVOID                               (__stdcall *g_pfnRaiseException)( DWORD, DWORD, DWORD, CP_TgUINT64 );
TgEXTN DWORD                                (__stdcall *g_pfnGetLastError)( TgVOID );

 /*  API Set: api-ms-win-core-debug-l1-1-1 */
TgEXTN TgVOID                               (__stdcall *g_pfnOutputDebugString)( CP_TgCHAR );
TgEXTN TgBOOL                               (__stdcall *g_pfnIsDebuggerPresent)( TgVOID );

 /*  API Set: api-ms-win-core-com-l1-1-1 */
TgEXTN HRESULT                              (__stdcall *g_pfnCoInitializeEx)( P_TgVOID, DWORD );
TgEXTN TgVOID                               (__stdcall *g_pfnCoUninitialize)( TgVOID );

 /*  API Set: api-ms-win-core-sysinfo-l1-2-1 */
TgEXTN TgVOID                               (__stdcall *g_pfnGetSystemInfo)( TgMS_LPSYSTEM_INFO );
TgEXTN TgUINT64                             (__stdcall *g_pfnGetTickCount64)( TgVOID );
#if !defined(TgCOMPILE_PLATFORM_UWP)
TgEXTN TgBOOL                               (__stdcall *g_pfnGetComputerNameEx)( TgSINT32, P_TgCHAR, P_TgUINT32 );
TgEXTN TgUINT32                             (__stdcall *g_pfnGetSystemDirectory)( P_TgCHAR, TgUINT32 );
TgEXTN TgUINT32                             (__stdcall *g_pfnGetWindowsDirectory)( P_TgCHAR, TgUINT32 );
TgEXTN TgBOOL                               (__stdcall *g_pfnGlobalMemoryStatusEx)( P_TgVOID );
/*# !defined(TgCOMPILE_PLATFORM_UWP) */
#endif

 /*  API Set: api-ms-win-core-processenvironment-l1-2-0 */
TgEXTN DWORD                                (__stdcall *g_pfnGetCurrentDirectory)( DWORD, P_TgCHAR );
TgEXTN P_TgCHAR                             (__stdcall *g_pfnGetCommandLine)( TgVOID );

 /*  API Set: api-ms-win-core-profile-l1-1-0 */
TgEXTN TgBOOL                               (__stdcall *g_pfnQueryPerformanceFrequency)( PLARGE_INTEGER );
TgEXTN TgBOOL                               (__stdcall *g_pfnQueryPerformanceCounter)( PLARGE_INTEGER );

 /*  API Set: api-ms-win-core-file-l1-2-1 */
TgEXTN TgBOOL                               (__stdcall *g_pfnGetFileAttributesEx)( CP_TgCHAR, TgSINT32, P_TgVOID );
TgEXTN P_TgVOID                             (__stdcall *g_pfnCreateFile2)( CP_TgWIDECHAR, DWORD, DWORD, DWORD, TgMS_LPCREATEFILE2_EXTENDED_PARAMETERS );
TgEXTN TgBOOL                               (__stdcall *g_pfnSetFilePointerEx)( P_TgVOID, LARGE_INTEGER, PLARGE_INTEGER, DWORD );
TgEXTN TgBOOL                               (__stdcall *g_pfnReadFile)( P_TgVOID, P_TgVOID, DWORD, LPDWORD, TgMS_LPOVERLAPPED );
TgEXTN TgBOOL                               (__stdcall *g_pfnWriteFile)( P_TgVOID, CP_TgVOID, DWORD, LPDWORD, TgMS_LPOVERLAPPED );
TgEXTN TgBOOL                               (__stdcall *g_pfnFlushFileBuffers)( P_TgVOID );
TgEXTN TgBOOL                               (__stdcall *g_pfnCreateDirectory)( CP_TgCHAR, TgMS_LPSECURITY_ATTRIBUTES );
TgEXTN TgBOOL                               (__stdcall *g_pfnRemoveDirectory)( CP_TgCHAR );
TgEXTN DWORD                                (__stdcall *g_pfnGetTempPath)( DWORD, P_TgCHAR );
TgEXTN P_TgVOID                             (__stdcall *g_pfnFindFirstFile)( CP_TgCHAR, P_TgVOID );
TgEXTN TgBOOL                               (__stdcall *g_pfnFindNextFile)( P_TgVOID, P_TgVOID );
TgEXTN TgBOOL                               (__stdcall *g_pfnFindClose)( P_TgVOID );
#if !defined(TgCOMPILE_PLATFORM_UWP)
TgEXTN P_TgVOID                             (__stdcall *g_pfnCreateFile)( CP_TgCHAR, DWORD, DWORD, P_TgVOID, DWORD, DWORD, P_TgVOID );
TgEXTN TgBOOL                               (__stdcall *g_pfnDeleteFile)( CP_TgCHAR );
/*# !defined(TgCOMPILE_PLATFORM_UWP) */
#endif

 /*  API Set: api-ms-win-core-file-l2-1-1 */
TgEXTN LONG                                 (__stdcall *g_pfnCopyFile2)( CP_TgWIDECHAR, CP_TgWIDECHAR, TgMS_LPCOPYFILE2_EXTENDED_PARAMETERS );
TgEXTN TgBOOL                               (__stdcall *g_pfnGetFileInformationByHandleEx )( P_TgVOID, TgSINT32, P_TgVOID, DWORD );
TgEXTN TgBOOL                               (__stdcall *g_pfnMoveFileEx)( CP_TgCHAR, CP_TgCHAR, DWORD );

 /*  API Set: api-ms-win-core-libraryloader-l1-2-0 */
TgEXTN DWORD                                (__stdcall *g_pfnGetModuleFileName)( TgMS_HMODULE, P_TgCHAR, DWORD );

 /*  API Set: api-ms-win-core-localization-l1-2-1 */
TgEXTN DWORD                                (__stdcall *g_pfnFormatMessage)( DWORD, CP_TgVOID, DWORD, DWORD, P_TgCHAR, DWORD, va_list* );
#if !defined(TgCOMPILE_PLATFORM_UWP)
TgEXTN TgSINT32                             (__stdcall *g_pfnGetLocaleInfo)( DWORD, DWORD, P_TgCHAR, TgSINT32 );
TgEXTN TgUINT32                             (__stdcall *g_pfnGetACP)( TgVOID );
/*# !defined(TgCOMPILE_PLATFORM_UWP) */
#endif

 /*  API Set: api-ms-win-core-heap-l1-2-0 */
TgEXTN P_TgVOID                             (__stdcall *g_pfnGetProcessHeap)( TgVOID );
TgEXTN TgBOOL                               (__stdcall *g_pfnHeapFree)( P_TgVOID, DWORD, P_TgVOID );

 /*  API Set: api-ms-win-core-memory-l1-1-2 */
TgEXTN TgSINT32                             (__stdcall *g_pfnVirtualFree)( P_TgVOID, TgUINT64, DWORD );

#if defined(TgCOMPILE_PLATFORM_UWP)
 /*  API Set: api-ms-win-core-memory-l1-1-3 */
TgEXTN P_TgVOID                             (__stdcall *g_pfnVirtualAllocFromApp)(P_TgVOID, TgUINT64, DWORD, DWORD);
/*# !defined(TgCOMPILE_PLATFORM_UWP) */
#endif

#if !defined(TgCOMPILE_PLATFORM_UWP)
 /*  API Set: api-ms-win-core-realtime-l1-1-0 */
TgEXTN TgBOOL                               (__stdcall *g_pfnQueryProcessCycleTime)( P_TgVOID, P_TgUINT64 );
TgEXTN TgBOOL                               (__stdcall *g_pfnQueryThreadCycleTime)( P_TgVOID, P_TgUINT64 );
/*# !defined(TgCOMPILE_PLATFORM_UWP) */
#endif

#if !defined(TgCOMPILE_PLATFORM_UWP)
 /*  kernel32 */
TgEXTN P_TgVOID                             (__stdcall *g_pfnVirtualAlloc)( P_TgVOID, TgUINT64, DWORD, DWORD );
TgEXTN TgBOOL                               (__stdcall *g_pfnCopyFile)( CP_TgCHAR, CP_TgCHAR, TgBOOL );
TgEXTN TgBOOL                               (__stdcall *g_pfnVerifyVersionInfo)( P_TgVOID, DWORD, TgUINT64 );
TgEXTN P_TgVOID                             (__stdcall *g_pfnCreateToolhelp32Snapshot)( DWORD, DWORD );
TgEXTN TgBOOL                               (__stdcall *g_pfnThread32First)( P_TgVOID, P_TgVOID );
TgEXTN TgBOOL                               (__stdcall *g_pfnThread32Next)( P_TgVOID, P_TgVOID );
TgEXTN P_TgVOID                             (__stdcall *g_pfnLocalFree)( P_TgVOID );

 /* user32 */
TgEXTN TgSINT32                             (__stdcall *g_pfnGetSystemMetrics)( TgSINT32 );
TgEXTN TgSINT32                             (__stdcall *g_pfnSystemParametersInfo)( TgUINT32, TgUINT32, P_TgVOID, TgUINT32 );
TgEXTN TgBOOL                               (__stdcall *g_pfnGetMonitorInfo)( TgMS_HMONITOR, P_TgVOID );
TgEXTN TgMS_HMONITOR                        (__stdcall *g_pfnMonitorFromRect)( CP_TgVOID, DWORD );
TgEXTN TgBOOL                               (__stdcall *g_pfnEnumDisplayMonitors)( TgMS_HDC, CP_TgVOID, TgMS_MONITORENUMPROC, TgSINT64 );

 /* Advapi32 */
TgEXTN TgBOOL                               (__stdcall *g_pfnGetUserName)( P_TgCHAR, P_TgUINT32 );
TgEXTN TgBOOL                               (__stdcall *g_pfnGetCurrentHwProfile)( P_TgVOID );

 /* Psapi */
TgEXTN TgBOOL                               (__stdcall *g_pfnEnumProcessModulesEx)( P_TgVOID, TgMS_HINSTANCE*, DWORD, P_TgUINT32, DWORD );
TgEXTN DWORD                                (__stdcall *g_pfnGetModuleFileNameEx)( P_TgVOID, P_TgVOID, P_TgCHAR, DWORD );

 /*  NTDLL */
TgEXTN TgSINT32                             (__stdcall *g_pfnNtDelayExecution)( TgBOOL, P_TgVOID );
/*# !defined(TgCOMPILE_PLATFORM_UWP) */
#endif


/* ====================================================================================================================================================================== */
#endif