Add source for the injector hooks and add custom builds for ifs_hook

This commit is contained in:
Will Toohey 2023-08-28 18:12:16 +10:00
parent 3f27f27396
commit ad22477e19
13 changed files with 1078 additions and 16 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
*.dll
build32/
build64/
dist/

View File

@ -19,14 +19,23 @@ The DLLs go next to the other game DLLs. Pick the right DLL for your game - if
folder.
For most games, you do not need to modify your gamestart.bat - the hook is
loaded automatically by copying D3d9.dll to the install directory. This
*doesn't* work for Jubeat though, you need to use `-k ifs_hook.dll` in your
commandline.
loaded automatically by copying `D3d9.dll` to the install directory. For
**Jubeat** and **GFDM** (_not_ Gitadora), you'll need to use `opengl32.dll`
instead. If neither of these work and the game is very new, try `dxgi.dll`. For
**Bombergirl**, it has a special DLL loader that likes to break things. You will
need to use `dxgi_for_bombergirl.dll` (renamed to `dxgi.dll`) **AND** copy
`dxgi.dll` from `C:\Windows\System32` (renamed to `_dxgi.dll`).
For more control (or if playing Jubeat) -
Load ifs_hook.dll using your launcher/injector of choice (eg: `-k ifs_hook.dll`)
If you don't really care, you can copy all the injector DLLs into the game
folder, it won't break anything.
For more control, load ifs_hook.dll using your launcher/injector of choice
(eg: add `-k ifs_hook.dll` to the commandline)
# Flags
If you can't work out to enable a flag, the release .zip contains DLLs that have
certain useful combos pre-enabled. They can be found in the `special_builds`
folder.
```
--layered-disable Disable layeredfs
--layered-verbose Print *tons* of info. Useful to find why your mods aren't

View File

@ -2,10 +2,23 @@
set -euxo pipefail
rm -rf dist/
# x86
meson setup --cross-file cross-i686-w64-mingw32.txt build32
meson compile -C build32
# without `--tags runtime`, the .a files are also installed
meson install -C build32 --destdir ../dist/32bit --tags runtime
# x86_64
meson setup --cross-file cross-x86_64-w64-mingw32.txt build64
meson compile -C build64
meson install -C build64 --destdir ../dist/64bit --tags runtime
# docs
cp -R data_mods dist/
# while we wait for mesonbuild issue #4019 / PR #11954 to be solved, need to
# rename the special builds ourselves
shopt -s globstar
for i in dist/**/special_builds/**/*.dll; do
mv "$i" "$(echo "$i" | sed 's/ifs_hook.*.dll$/ifs_hook.dll/')"
done

View File

@ -1,3 +1,3 @@
#!/usr/bin/env bash
rm -rf build32 build64
rm -rf build32 build64 dist

View File

@ -39,7 +39,6 @@ third_party = static_library('3rd_party',
layeredfs_lib = static_library('layeredfs',
sources: [
'src/avs.cpp',
'src/config.cpp',
'src/dllmain.cpp',
'src/hook.cpp',
'src/log.cpp',
@ -54,14 +53,83 @@ layeredfs_lib = static_library('layeredfs',
cpp_args: '-DVER_STRING="' + meson.project_version() + '"',
)
shared_library('ifs_hook',
sources: 'src/dllmain.cpp',
link_with: layeredfs_lib,
name_prefix: '',
# has to be bare source so each special version gets a different copy
layeredfs_cfg_dep = declare_dependency(
sources: 'src/config.cpp'
)
executable('playpen',
sources: 'src/playpen.cpp',
build_by_default: false,
link_with: layeredfs_lib
link_with: layeredfs_lib,
dependencies: layeredfs_cfg_dep,
)
# "normal" hook
shared_library('ifs_hook',
link_with: layeredfs_lib,
dependencies: layeredfs_cfg_dep,
name_prefix: '',
install_dir: '/',
install: true,
)
# pre-configured DLLs if you don't know how to (or can't) add cmdline args
special_cfgs = [
['always_verbose', ['-DCFG_VERBOSE']],
['always_logs_to_file', ['-DCFG_LOGFILE']],
['always_verbose_and_logs_to_file', ['-DCFG_VERBOSE','-DCFG_LOGFILE']],
# useful because it flushes the logfile
['always_devmode_and_logs_to_file', ['-DCFG_DEVMODE', '-DCFG_LOGFILE']],
# "Why isn't it working???"
['always_devmode_verbose_and_logs_to_file', ['-DCFG_DEVMODE', '-DCFG_VERBOSE', '-DCFG_LOGFILE']],
]
foreach cfg : special_cfgs
folder_name = cfg[0]
defines = cfg[1]
shared_library('ifs_hook_' + folder_name,
link_with: layeredfs_lib,
dependencies: layeredfs_cfg_dep,
cpp_args: defines,
name_prefix: '',
install_dir: '/special_builds' / folder_name,
install: true,
)
endforeach
injector_cfgs = [
['d3d9', '-DUSE_D3D9'],
['dxgi', '-DUSE_DXGI'],
['dxgi_for_bombergirl', ['-DUSE_DXGI', '-DBOMBERGIRL_BULLSHIT']],
['opengl32', '-DUSE_OGL'],
]
foreach cfg : injector_cfgs
dll_name = cfg[0]
define = cfg[1]
def_file = 'src_injector' / dll_name + '.def'
if dll_name == 'dxgi_for_bombergirl'
if host_machine.cpu_family() == 'x86'
continue
endif
def_file = 'src_injector/dxgi.def'
endif
shared_library(dll_name,
sources: 'src_injector/dllmain.cpp',
vs_module_defs: def_file,
cpp_args: define,
link_args: [
# don't auto-export everything
'-Wl,--exclude-all-symbols',
# fix stdcall mangling even with `extern "C"`
'-Wl,--enable-stdcall-fixup'
],
name_prefix: '',
install_dir: '/automatic_injector_dlls',
install: true,
)
endforeach

View File

@ -43,12 +43,27 @@ const char* parse_list(const char* prefix, const char* arg, std::unordered_set<s
}
void load_config(void) {
config.disable = false;
config.allowlist.clear();
config.blocklist.clear();
#ifdef CFG_VERBOSE
config.verbose_logs = true;
#else
config.verbose_logs = false;
#endif
#ifdef CFG_DEVMODE
config.developer_mode = true;
#else
config.developer_mode = false;
config.disable = false;
#endif
#ifdef CFG_LOGFILE
config.logfile = DEFAULT_LOGFILE;
#else
config.logfile = NULL;
#endif
int i;

View File

@ -12,6 +12,8 @@ typedef struct {
std::unordered_set<std::string> blocklist;
} config_t;
#define DEFAULT_LOGFILE "ifs_hook.log"
extern config_t config;
void load_config(void);

View File

@ -26,7 +26,7 @@ static void log_to_file(char level, const char* fmt, va_list args) {
if (!logfile) {
// default to ifs_hook.log because we need *something* in the case
// of a fatal error
const char *path = config.logfile ? config.logfile : "ifs_hook.log";
const char *path = config.logfile ? config.logfile : DEFAULT_LOGFILE;
logfile = fopen(path, "w");
}
tried_to_open = true;

24
src_injector/d3d9.def Normal file
View File

@ -0,0 +1,24 @@
EXPORTS
__ord16 @16,NONAME
__ord17 @17,NONAME
__ord18 @18,NONAME
__ord19 @19,NONAME
Direct3DCreate9On12 @20
Direct3DCreate9On12Ex @21
__ord22 @22,NONAME
__ord23 @23,NONAME
Direct3DShaderValidatorCreate9 @24
PSGPError @25
PSGPSampleTexture @26
D3DPERF_BeginEvent @27
D3DPERF_EndEvent @28
D3DPERF_GetStatus @29
D3DPERF_QueryRepeatFrame @30
D3DPERF_SetMarker @31
D3DPERF_SetOptions @32
D3DPERF_SetRegion @33
DebugSetLevel @34
DebugSetMute @35
Direct3D9EnableMaximizedWindowedModeShim @36
Direct3DCreate9 @37
Direct3DCreate9Ex @38

172
src_injector/dllmain.cpp Normal file
View File

@ -0,0 +1,172 @@
#include <stdio.h>
// because GCC's exports aren't as powerful as MSVC's pragma(comment), we need
// to name our functions identically to the real ones, which actually collides
// with the real ones if we include <windows.h>. So instead, include these
// lesser-used actual imports
#include <libloaderapi.h>
#include <sysinfoapi.h>
#define DLL_TO_HOOK "ifs_hook.dll"
//#define DO_LOG
// it rewrites the path loader and needs "_dxgi.dll" copied out of system32
// since the loader doesn't deal with full paths properly
//#define BOMBERGIRL_BULLSHIT
// leave a bunch of room in the string so aspiring modders can just hex edit the filename
#define HELP "\0Hello hex editor - The DLL name + this message have 256 bytes allocated for them. You can change the DLL name if you want!"
const char DLL_TO_LOAD[256] = DLL_TO_HOOK HELP;
#if defined(USE_D3D9) // Anything that uses D3d9.dll, which is most games
#define DLL_NAME L"d3d9.dll"
#define FOREACH_D3D_FUNC(X) \
X("16,NONAME", __ord16) \
X("17,NONAME", __ord17) \
X("18,NONAME", __ord18) \
X("19,NONAME", __ord19) \
X("20", Direct3DCreate9On12) \
X("21", Direct3DCreate9On12Ex) \
X("22,NONAME", __ord22) \
X("23,NONAME", __ord23) \
X("24", Direct3DShaderValidatorCreate9) \
X("25", PSGPError) \
X("26", PSGPSampleTexture) \
X("27", D3DPERF_BeginEvent) \
X("28", D3DPERF_EndEvent) \
X("29", D3DPERF_GetStatus) \
X("30", D3DPERF_QueryRepeatFrame) \
X("31", D3DPERF_SetMarker) \
X("32", D3DPERF_SetOptions) \
X("33", D3DPERF_SetRegion) \
X("34", DebugSetLevel) \
X("35", DebugSetMute) \
X("36", Direct3D9EnableMaximizedWindowedModeShim) \
X("37", Direct3DCreate9) \
X("38", Direct3DCreate9Ex) \
#elif defined(USE_DXGI) // Anything newer will include dxgi transitively, so D3d10/11/12 are all covered
#define DLL_NAME L"dxgi.dll"
#define FOREACH_D3D_FUNC(X) \
X("1", ApplyCompatResolutionQuirking) \
X("2", CompatString) \
X("3", CompatValue) \
X("4", DXGIDumpJournal) \
X("5", PIXBeginCapture) \
X("6", PIXEndCapture) \
X("7", PIXGetCaptureState) \
X("8", SetAppCompatStringPointer) \
X("9", UpdateHMDEmulationStatus) \
X("10", CreateDXGIFactory) \
X("11", CreateDXGIFactory1) \
X("12", CreateDXGIFactory2) \
X("13", DXGID3D10CreateDevice) \
X("14", DXGID3D10CreateLayeredDevice) \
X("15", DXGID3D10GetLayeredDeviceSize) \
X("16", DXGID3D10RegisterLayers) \
X("17", DXGIDeclareAdapterRemovalSupport) \
X("18", DXGIGetDebugInterface1) \
X("19", DXGIReportAdapterConfiguration) \
#elif defined(USE_OGL) // OpenGL used by jubeat, older gfdm
#define DLL_NAME L"opengl32.dll"
// this one has tons of defs so put it in a separate file
#include "opengl_defs.h"
#else
#error choose a valid DLL to hook
#endif
// Notes on register preservation and safety etc
// cdecl/stdcall both push args on stack, on x64 also uses registers.
//
// On x86, with at least 1 arg in the wrapped function, the compiler
// correctly generates stack preservation code.
//
// Note! If the wrapped function is cdecl instead of stdcall, it'll
// need arg propagation. Having it be stdcall makes it a jmp.
//
// On x64, things are more complex because stdcall isn't used.
// 0-arg functions are fine, but because args are placed in registers
// (RCX, RDX, R8, R9) and only then overflowed into stack, they need anti-clobber
// code.
//
// Thus, by making the wrapped function have 4 args and stdcall, we
// generate correct register preservation for both x86 and x64 targets.
// If the function isn't stdcall or cdecl, you're out of luck, but I've
// never seen a DLL do that so it Should Totes Be Fine Yo (TM).
#define DECLARE_ORIGINAL(ordinal, name) void (WINAPI *real_ ## name)(void* a, void* b, void* c, void* d);
FOREACH_D3D_FUNC(DECLARE_ORIGINAL);
#ifdef DO_LOG
FILE* log;
#define LOG(...) if (log) fprintf(log, __VA_ARGS__); fflush(log);
#else
#define LOG(...)
#endif
void __cdecl onetime_setup(const char *fn_name) {
static bool setup_complete = false;
LOG("%s\n", fn_name);
if (setup_complete)
return;
#ifdef BOMBERGIRL_BULLSHIT
HMODULE orig = LoadLibraryW(L"_" DLL_NAME);
#else
wchar_t path[MAX_PATH];
if (GetSystemDirectoryW(path, sizeof(path)) == 0) {
LOG("Couldn't GetSystemDirectoryW, enjoy your crash\n");
return;
}
wcscat_s(path, MAX_PATH, L"\\" DLL_NAME);
HMODULE orig = LoadLibraryW(path);
#endif
#ifdef DO_LOG
fopen_s(&log, "d3d_hook.log", "w");
#endif
if (!orig) {
LOG("Couldn't load original dll, enjoy your crash\n");
}
#define LOAD_ORIGINAL(ordinal, name) real_ ## name = (decltype(real_ ## name))GetProcAddress(orig, #name);
FOREACH_D3D_FUNC(LOAD_ORIGINAL);
// off we go
LoadLibraryA(DLL_TO_LOAD);
setup_complete = true;
LOG("Hook loaded!\n");
}
#define REPLICATE_FUNC(ordinal, name) \
extern "C" void __stdcall name(void* a, void* b, void* c, void* d) { \
/* Using this avoids name mangling for stdcall functions (which happens even with extern "C"!) */ \
/* It also removes the need for a .def file */ \
/* ...but only for MSVC. GCC's asm(".section .drectve") and -export directive does not work on ordinals, nor on mangled names */ \
/*__pragma(comment(linker, "/EXPORT:" __FUNCTION__ "=" __FUNCDNAME__ ",@" ordinal))*/ \
onetime_setup(__FUNCTION__); \
return real_ ## name(a,b,c,d); \
}
FOREACH_D3D_FUNC(REPLICATE_FUNC);
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}

20
src_injector/dxgi.def Normal file
View File

@ -0,0 +1,20 @@
EXPORTS
ApplyCompatResolutionQuirking @1
CompatString @2
CompatValue @3
DXGIDumpJournal @4
PIXBeginCapture @5
PIXEndCapture @6
PIXGetCaptureState @7
SetAppCompatStringPointer @8
UpdateHMDEmulationStatus @9
CreateDXGIFactory @10
CreateDXGIFactory1 @11
CreateDXGIFactory2 @12
DXGID3D10CreateDevice @13
DXGID3D10CreateLayeredDevice @14
DXGID3D10GetLayeredDeviceSize @15
DXGID3D10RegisterLayers @16
DXGIDeclareAdapterRemovalSupport @17
DXGIGetDebugInterface1 @18
DXGIReportAdapterConfiguration @19

369
src_injector/opengl32.def Normal file
View File

@ -0,0 +1,369 @@
EXPORTS
GlmfBeginGlsBlock @1
GlmfCloseMetaFile @2
GlmfEndGlsBlock @3
GlmfEndPlayback @4
GlmfInitPlayback @5
GlmfPlayGlsRecord @6
glAccum @7
glAlphaFunc @8
glAreTexturesResident @9
glArrayElement @10
glBegin @11
glBindTexture @12
glBitmap @13
glBlendFunc @14
glCallList @15
glCallLists @16
glClear @17
glClearAccum @18
glClearColor @19
glClearDepth @20
glClearIndex @21
glClearStencil @22
glClipPlane @23
glColor3b @24
glColor3bv @25
glColor3d @26
glColor3dv @27
glColor3f @28
glColor3fv @29
glColor3i @30
glColor3iv @31
glColor3s @32
glColor3sv @33
glColor3ub @34
glColor3ubv @35
glColor3ui @36
glColor3uiv @37
glColor3us @38
glColor3usv @39
glColor4b @40
glColor4bv @41
glColor4d @42
glColor4dv @43
glColor4f @44
glColor4fv @45
glColor4i @46
glColor4iv @47
glColor4s @48
glColor4sv @49
glColor4ub @50
glColor4ubv @51
glColor4ui @52
glColor4uiv @53
glColor4us @54
glColor4usv @55
glColorMask @56
glColorMaterial @57
glColorPointer @58
glCopyPixels @59
glCopyTexImage1D @60
glCopyTexImage2D @61
glCopyTexSubImage1D @62
glCopyTexSubImage2D @63
glCullFace @64
glDebugEntry @65
glDeleteLists @66
glDeleteTextures @67
glDepthFunc @68
glDepthMask @69
glDepthRange @70
glDisable @71
glDisableClientState @72
glDrawArrays @73
glDrawBuffer @74
glDrawElements @75
glDrawPixels @76
glEdgeFlag @77
glEdgeFlagPointer @78
glEdgeFlagv @79
glEnable @80
glEnableClientState @81
glEnd @82
glEndList @83
glEvalCoord1d @84
glEvalCoord1dv @85
glEvalCoord1f @86
glEvalCoord1fv @87
glEvalCoord2d @88
glEvalCoord2dv @89
glEvalCoord2f @90
glEvalCoord2fv @91
glEvalMesh1 @92
glEvalMesh2 @93
glEvalPoint1 @94
glEvalPoint2 @95
glFeedbackBuffer @96
glFinish @97
glFlush @98
glFogf @99
glFogfv @100
glFogi @101
glFogiv @102
glFrontFace @103
glFrustum @104
glGenLists @105
glGenTextures @106
glGetBooleanv @107
glGetClipPlane @108
glGetDoublev @109
glGetError @110
glGetFloatv @111
glGetIntegerv @112
glGetLightfv @113
glGetLightiv @114
glGetMapdv @115
glGetMapfv @116
glGetMapiv @117
glGetMaterialfv @118
glGetMaterialiv @119
glGetPixelMapfv @120
glGetPixelMapuiv @121
glGetPixelMapusv @122
glGetPointerv @123
glGetPolygonStipple @124
glGetString @125
glGetTexEnvfv @126
glGetTexEnviv @127
glGetTexGendv @128
glGetTexGenfv @129
glGetTexGeniv @130
glGetTexImage @131
glGetTexLevelParameterfv @132
glGetTexLevelParameteriv @133
glGetTexParameterfv @134
glGetTexParameteriv @135
glHint @136
glIndexMask @137
glIndexPointer @138
glIndexd @139
glIndexdv @140
glIndexf @141
glIndexfv @142
glIndexi @143
glIndexiv @144
glIndexs @145
glIndexsv @146
glIndexub @147
glIndexubv @148
glInitNames @149
glInterleavedArrays @150
glIsEnabled @151
glIsList @152
glIsTexture @153
glLightModelf @154
glLightModelfv @155
glLightModeli @156
glLightModeliv @157
glLightf @158
glLightfv @159
glLighti @160
glLightiv @161
glLineStipple @162
glLineWidth @163
glListBase @164
glLoadIdentity @165
glLoadMatrixd @166
glLoadMatrixf @167
glLoadName @168
glLogicOp @169
glMap1d @170
glMap1f @171
glMap2d @172
glMap2f @173
glMapGrid1d @174
glMapGrid1f @175
glMapGrid2d @176
glMapGrid2f @177
glMaterialf @178
glMaterialfv @179
glMateriali @180
glMaterialiv @181
glMatrixMode @182
glMultMatrixd @183
glMultMatrixf @184
glNewList @185
glNormal3b @186
glNormal3bv @187
glNormal3d @188
glNormal3dv @189
glNormal3f @190
glNormal3fv @191
glNormal3i @192
glNormal3iv @193
glNormal3s @194
glNormal3sv @195
glNormalPointer @196
glOrtho @197
glPassThrough @198
glPixelMapfv @199
glPixelMapuiv @200
glPixelMapusv @201
glPixelStoref @202
glPixelStorei @203
glPixelTransferf @204
glPixelTransferi @205
glPixelZoom @206
glPointSize @207
glPolygonMode @208
glPolygonOffset @209
glPolygonStipple @210
glPopAttrib @211
glPopClientAttrib @212
glPopMatrix @213
glPopName @214
glPrioritizeTextures @215
glPushAttrib @216
glPushClientAttrib @217
glPushMatrix @218
glPushName @219
glRasterPos2d @220
glRasterPos2dv @221
glRasterPos2f @222
glRasterPos2fv @223
glRasterPos2i @224
glRasterPos2iv @225
glRasterPos2s @226
glRasterPos2sv @227
glRasterPos3d @228
glRasterPos3dv @229
glRasterPos3f @230
glRasterPos3fv @231
glRasterPos3i @232
glRasterPos3iv @233
glRasterPos3s @234
glRasterPos3sv @235
glRasterPos4d @236
glRasterPos4dv @237
glRasterPos4f @238
glRasterPos4fv @239
glRasterPos4i @240
glRasterPos4iv @241
glRasterPos4s @242
glRasterPos4sv @243
glReadBuffer @244
glReadPixels @245
glRectd @246
glRectdv @247
glRectf @248
glRectfv @249
glRecti @250
glRectiv @251
glRects @252
glRectsv @253
glRenderMode @254
glRotated @255
glRotatef @256
glScaled @257
glScalef @258
glScissor @259
glSelectBuffer @260
glShadeModel @261
glStencilFunc @262
glStencilMask @263
glStencilOp @264
glTexCoord1d @265
glTexCoord1dv @266
glTexCoord1f @267
glTexCoord1fv @268
glTexCoord1i @269
glTexCoord1iv @270
glTexCoord1s @271
glTexCoord1sv @272
glTexCoord2d @273
glTexCoord2dv @274
glTexCoord2f @275
glTexCoord2fv @276
glTexCoord2i @277
glTexCoord2iv @278
glTexCoord2s @279
glTexCoord2sv @280
glTexCoord3d @281
glTexCoord3dv @282
glTexCoord3f @283
glTexCoord3fv @284
glTexCoord3i @285
glTexCoord3iv @286
glTexCoord3s @287
glTexCoord3sv @288
glTexCoord4d @289
glTexCoord4dv @290
glTexCoord4f @291
glTexCoord4fv @292
glTexCoord4i @293
glTexCoord4iv @294
glTexCoord4s @295
glTexCoord4sv @296
glTexCoordPointer @297
glTexEnvf @298
glTexEnvfv @299
glTexEnvi @300
glTexEnviv @301
glTexGend @302
glTexGendv @303
glTexGenf @304
glTexGenfv @305
glTexGeni @306
glTexGeniv @307
glTexImage1D @308
glTexImage2D @309
glTexParameterf @310
glTexParameterfv @311
glTexParameteri @312
glTexParameteriv @313
glTexSubImage1D @314
glTexSubImage2D @315
glTranslated @316
glTranslatef @317
glVertex2d @318
glVertex2dv @319
glVertex2f @320
glVertex2fv @321
glVertex2i @322
glVertex2iv @323
glVertex2s @324
glVertex2sv @325
glVertex3d @326
glVertex3dv @327
glVertex3f @328
glVertex3fv @329
glVertex3i @330
glVertex3iv @331
glVertex3s @332
glVertex3sv @333
glVertex4d @334
glVertex4dv @335
glVertex4f @336
glVertex4fv @337
glVertex4i @338
glVertex4iv @339
glVertex4s @340
glVertex4sv @341
glVertexPointer @342
glViewport @343
wglChoosePixelFormat @344
wglCopyContext @345
wglCreateContext @346
wglCreateLayerContext @347
wglDeleteContext @348
wglDescribeLayerPlane @349
wglDescribePixelFormat @350
wglGetCurrentContext @351
wglGetCurrentDC @352
wglGetDefaultProcAddress @353
wglGetLayerPaletteEntries @354
wglGetPixelFormat @355
wglGetProcAddress @356
wglMakeCurrent @357
wglRealizeLayerPalette @358
wglSetLayerPaletteEntries @359
wglSetPixelFormat @360
wglShareLists @361
wglSwapBuffers @362
wglSwapLayerBuffers @363
wglSwapMultipleBuffers @364
wglUseFontBitmapsA @365
wglUseFontBitmapsW @366
wglUseFontOutlinesA @367
wglUseFontOutlinesW @368

369
src_injector/opengl_defs.h Normal file
View File

@ -0,0 +1,369 @@
#define FOREACH_D3D_FUNC(X) \
X("1", GlmfBeginGlsBlock) \
X("2", GlmfCloseMetaFile) \
X("3", GlmfEndGlsBlock) \
X("4", GlmfEndPlayback) \
X("5", GlmfInitPlayback) \
X("6", GlmfPlayGlsRecord) \
X("7", glAccum) \
X("8", glAlphaFunc) \
X("9", glAreTexturesResident) \
X("10", glArrayElement) \
X("11", glBegin) \
X("12", glBindTexture) \
X("13", glBitmap) \
X("14", glBlendFunc) \
X("15", glCallList) \
X("16", glCallLists) \
X("17", glClear) \
X("18", glClearAccum) \
X("19", glClearColor) \
X("20", glClearDepth) \
X("21", glClearIndex) \
X("22", glClearStencil) \
X("23", glClipPlane) \
X("24", glColor3b) \
X("25", glColor3bv) \
X("26", glColor3d) \
X("27", glColor3dv) \
X("28", glColor3f) \
X("29", glColor3fv) \
X("30", glColor3i) \
X("31", glColor3iv) \
X("32", glColor3s) \
X("33", glColor3sv) \
X("34", glColor3ub) \
X("35", glColor3ubv) \
X("36", glColor3ui) \
X("37", glColor3uiv) \
X("38", glColor3us) \
X("39", glColor3usv) \
X("40", glColor4b) \
X("41", glColor4bv) \
X("42", glColor4d) \
X("43", glColor4dv) \
X("44", glColor4f) \
X("45", glColor4fv) \
X("46", glColor4i) \
X("47", glColor4iv) \
X("48", glColor4s) \
X("49", glColor4sv) \
X("50", glColor4ub) \
X("51", glColor4ubv) \
X("52", glColor4ui) \
X("53", glColor4uiv) \
X("54", glColor4us) \
X("55", glColor4usv) \
X("56", glColorMask) \
X("57", glColorMaterial) \
X("58", glColorPointer) \
X("59", glCopyPixels) \
X("60", glCopyTexImage1D) \
X("61", glCopyTexImage2D) \
X("62", glCopyTexSubImage1D) \
X("63", glCopyTexSubImage2D) \
X("64", glCullFace) \
X("65", glDebugEntry) \
X("66", glDeleteLists) \
X("67", glDeleteTextures) \
X("68", glDepthFunc) \
X("69", glDepthMask) \
X("70", glDepthRange) \
X("71", glDisable) \
X("72", glDisableClientState) \
X("73", glDrawArrays) \
X("74", glDrawBuffer) \
X("75", glDrawElements) \
X("76", glDrawPixels) \
X("77", glEdgeFlag) \
X("78", glEdgeFlagPointer) \
X("79", glEdgeFlagv) \
X("80", glEnable) \
X("81", glEnableClientState) \
X("82", glEnd) \
X("83", glEndList) \
X("84", glEvalCoord1d) \
X("85", glEvalCoord1dv) \
X("86", glEvalCoord1f) \
X("87", glEvalCoord1fv) \
X("88", glEvalCoord2d) \
X("89", glEvalCoord2dv) \
X("90", glEvalCoord2f) \
X("91", glEvalCoord2fv) \
X("92", glEvalMesh1) \
X("93", glEvalMesh2) \
X("94", glEvalPoint1) \
X("95", glEvalPoint2) \
X("96", glFeedbackBuffer) \
X("97", glFinish) \
X("98", glFlush) \
X("99", glFogf) \
X("100", glFogfv) \
X("101", glFogi) \
X("102", glFogiv) \
X("103", glFrontFace) \
X("104", glFrustum) \
X("105", glGenLists) \
X("106", glGenTextures) \
X("107", glGetBooleanv) \
X("108", glGetClipPlane) \
X("109", glGetDoublev) \
X("110", glGetError) \
X("111", glGetFloatv) \
X("112", glGetIntegerv) \
X("113", glGetLightfv) \
X("114", glGetLightiv) \
X("115", glGetMapdv) \
X("116", glGetMapfv) \
X("117", glGetMapiv) \
X("118", glGetMaterialfv) \
X("119", glGetMaterialiv) \
X("120", glGetPixelMapfv) \
X("121", glGetPixelMapuiv) \
X("122", glGetPixelMapusv) \
X("123", glGetPointerv) \
X("124", glGetPolygonStipple) \
X("125", glGetString) \
X("126", glGetTexEnvfv) \
X("127", glGetTexEnviv) \
X("128", glGetTexGendv) \
X("129", glGetTexGenfv) \
X("130", glGetTexGeniv) \
X("131", glGetTexImage) \
X("132", glGetTexLevelParameterfv) \
X("133", glGetTexLevelParameteriv) \
X("134", glGetTexParameterfv) \
X("135", glGetTexParameteriv) \
X("136", glHint) \
X("137", glIndexMask) \
X("138", glIndexPointer) \
X("139", glIndexd) \
X("140", glIndexdv) \
X("141", glIndexf) \
X("142", glIndexfv) \
X("143", glIndexi) \
X("144", glIndexiv) \
X("145", glIndexs) \
X("146", glIndexsv) \
X("147", glIndexub) \
X("148", glIndexubv) \
X("149", glInitNames) \
X("150", glInterleavedArrays) \
X("151", glIsEnabled) \
X("152", glIsList) \
X("153", glIsTexture) \
X("154", glLightModelf) \
X("155", glLightModelfv) \
X("156", glLightModeli) \
X("157", glLightModeliv) \
X("158", glLightf) \
X("159", glLightfv) \
X("160", glLighti) \
X("161", glLightiv) \
X("162", glLineStipple) \
X("163", glLineWidth) \
X("164", glListBase) \
X("165", glLoadIdentity) \
X("166", glLoadMatrixd) \
X("167", glLoadMatrixf) \
X("168", glLoadName) \
X("169", glLogicOp) \
X("170", glMap1d) \
X("171", glMap1f) \
X("172", glMap2d) \
X("173", glMap2f) \
X("174", glMapGrid1d) \
X("175", glMapGrid1f) \
X("176", glMapGrid2d) \
X("177", glMapGrid2f) \
X("178", glMaterialf) \
X("179", glMaterialfv) \
X("180", glMateriali) \
X("181", glMaterialiv) \
X("182", glMatrixMode) \
X("183", glMultMatrixd) \
X("184", glMultMatrixf) \
X("185", glNewList) \
X("186", glNormal3b) \
X("187", glNormal3bv) \
X("188", glNormal3d) \
X("189", glNormal3dv) \
X("190", glNormal3f) \
X("191", glNormal3fv) \
X("192", glNormal3i) \
X("193", glNormal3iv) \
X("194", glNormal3s) \
X("195", glNormal3sv) \
X("196", glNormalPointer) \
X("197", glOrtho) \
X("198", glPassThrough) \
X("199", glPixelMapfv) \
X("200", glPixelMapuiv) \
X("201", glPixelMapusv) \
X("202", glPixelStoref) \
X("203", glPixelStorei) \
X("204", glPixelTransferf) \
X("205", glPixelTransferi) \
X("206", glPixelZoom) \
X("207", glPointSize) \
X("208", glPolygonMode) \
X("209", glPolygonOffset) \
X("210", glPolygonStipple) \
X("211", glPopAttrib) \
X("212", glPopClientAttrib) \
X("213", glPopMatrix) \
X("214", glPopName) \
X("215", glPrioritizeTextures) \
X("216", glPushAttrib) \
X("217", glPushClientAttrib) \
X("218", glPushMatrix) \
X("219", glPushName) \
X("220", glRasterPos2d) \
X("221", glRasterPos2dv) \
X("222", glRasterPos2f) \
X("223", glRasterPos2fv) \
X("224", glRasterPos2i) \
X("225", glRasterPos2iv) \
X("226", glRasterPos2s) \
X("227", glRasterPos2sv) \
X("228", glRasterPos3d) \
X("229", glRasterPos3dv) \
X("230", glRasterPos3f) \
X("231", glRasterPos3fv) \
X("232", glRasterPos3i) \
X("233", glRasterPos3iv) \
X("234", glRasterPos3s) \
X("235", glRasterPos3sv) \
X("236", glRasterPos4d) \
X("237", glRasterPos4dv) \
X("238", glRasterPos4f) \
X("239", glRasterPos4fv) \
X("240", glRasterPos4i) \
X("241", glRasterPos4iv) \
X("242", glRasterPos4s) \
X("243", glRasterPos4sv) \
X("244", glReadBuffer) \
X("245", glReadPixels) \
X("246", glRectd) \
X("247", glRectdv) \
X("248", glRectf) \
X("249", glRectfv) \
X("250", glRecti) \
X("251", glRectiv) \
X("252", glRects) \
X("253", glRectsv) \
X("254", glRenderMode) \
X("255", glRotated) \
X("256", glRotatef) \
X("257", glScaled) \
X("258", glScalef) \
X("259", glScissor) \
X("260", glSelectBuffer) \
X("261", glShadeModel) \
X("262", glStencilFunc) \
X("263", glStencilMask) \
X("264", glStencilOp) \
X("265", glTexCoord1d) \
X("266", glTexCoord1dv) \
X("267", glTexCoord1f) \
X("268", glTexCoord1fv) \
X("269", glTexCoord1i) \
X("270", glTexCoord1iv) \
X("271", glTexCoord1s) \
X("272", glTexCoord1sv) \
X("273", glTexCoord2d) \
X("274", glTexCoord2dv) \
X("275", glTexCoord2f) \
X("276", glTexCoord2fv) \
X("277", glTexCoord2i) \
X("278", glTexCoord2iv) \
X("279", glTexCoord2s) \
X("280", glTexCoord2sv) \
X("281", glTexCoord3d) \
X("282", glTexCoord3dv) \
X("283", glTexCoord3f) \
X("284", glTexCoord3fv) \
X("285", glTexCoord3i) \
X("286", glTexCoord3iv) \
X("287", glTexCoord3s) \
X("288", glTexCoord3sv) \
X("289", glTexCoord4d) \
X("290", glTexCoord4dv) \
X("291", glTexCoord4f) \
X("292", glTexCoord4fv) \
X("293", glTexCoord4i) \
X("294", glTexCoord4iv) \
X("295", glTexCoord4s) \
X("296", glTexCoord4sv) \
X("297", glTexCoordPointer) \
X("298", glTexEnvf) \
X("299", glTexEnvfv) \
X("300", glTexEnvi) \
X("301", glTexEnviv) \
X("302", glTexGend) \
X("303", glTexGendv) \
X("304", glTexGenf) \
X("305", glTexGenfv) \
X("306", glTexGeni) \
X("307", glTexGeniv) \
X("308", glTexImage1D) \
X("309", glTexImage2D) \
X("310", glTexParameterf) \
X("311", glTexParameterfv) \
X("312", glTexParameteri) \
X("313", glTexParameteriv) \
X("314", glTexSubImage1D) \
X("315", glTexSubImage2D) \
X("316", glTranslated) \
X("317", glTranslatef) \
X("318", glVertex2d) \
X("319", glVertex2dv) \
X("320", glVertex2f) \
X("321", glVertex2fv) \
X("322", glVertex2i) \
X("323", glVertex2iv) \
X("324", glVertex2s) \
X("325", glVertex2sv) \
X("326", glVertex3d) \
X("327", glVertex3dv) \
X("328", glVertex3f) \
X("329", glVertex3fv) \
X("330", glVertex3i) \
X("331", glVertex3iv) \
X("332", glVertex3s) \
X("333", glVertex3sv) \
X("334", glVertex4d) \
X("335", glVertex4dv) \
X("336", glVertex4f) \
X("337", glVertex4fv) \
X("338", glVertex4i) \
X("339", glVertex4iv) \
X("340", glVertex4s) \
X("341", glVertex4sv) \
X("342", glVertexPointer) \
X("343", glViewport) \
X("344", wglChoosePixelFormat) \
X("345", wglCopyContext) \
X("346", wglCreateContext) \
X("347", wglCreateLayerContext) \
X("348", wglDeleteContext) \
X("349", wglDescribeLayerPlane) \
X("350", wglDescribePixelFormat) \
X("351", wglGetCurrentContext) \
X("352", wglGetCurrentDC) \
X("353", wglGetDefaultProcAddress) \
X("354", wglGetLayerPaletteEntries) \
X("355", wglGetPixelFormat) \
X("356", wglGetProcAddress) \
X("357", wglMakeCurrent) \
X("358", wglRealizeLayerPalette) \
X("359", wglSetLayerPaletteEntries) \
X("360", wglSetPixelFormat) \
X("361", wglShareLists) \
X("362", wglSwapBuffers) \
X("363", wglSwapLayerBuffers) \
X("364", wglSwapMultipleBuffers) \
X("365", wglUseFontBitmapsA) \
X("366", wglUseFontBitmapsW) \
X("367", wglUseFontOutlinesA) \
X("368", wglUseFontOutlinesW)