source: trunk/include/odinlx.h@ 21999

Last change on this file since 21999 was 21999, checked in by dmik, 13 years ago

kernel32: Make SEH work in OS/2 context.

See #82 for details.

File size: 3.2 KB
RevLine 
[10383]1/* $Id: odinlx.h,v 1.10 2004-01-12 09:53:28 sandervl Exp $ */
[953]2
3/*
4 *
5 * Interface for running Win32 programs (compiled in OS/2)
6 *
7 * Copyright 1999 Sander van Leeuwen (sandervl@xs4all.nl)
8 *
9 *
10 * Project Odin Software License can be found in LICENSE.TXT
11 *
12 */
13#ifndef _ODINLX_H
14#define _ODINLX_H
15
[21916]16#include <win/peexe.h>
[3991]17#include <versionos2.h>
[953]18
[7797]19#define ORDINAL_REGISTERLXDLL 1238
20#define ORDINAL_UNREGISTERLXDLL 1239
21#define ORDINAL_REGISTERLXEXE 1237
22#define ORDINAL_REGISTERDUMMYEXE 1249
23
[9730]24#ifdef __cplusplus
[5288]25extern "C" {
[9730]26#endif
[5288]27
[953]28typedef ULONG (* WIN32API WIN32DLLENTRY)(ULONG hInstance, ULONG reason, LPVOID reserved);
29typedef int (* WIN32API WINMAIN)(HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpCmdLine, int nShowCmd);
30
31//******************************************************************************
32//Create LX Dll object and send process attach message
33//System dlls set EntryPoint to 0
[3991]34//Parameters:
[5288]35// HINSTANCE hInstance - OS/2 module handle
[3991]36// WIN32DLLENTRY EntryPoint - Win32 dll entrypoint address
37// PVOID pResData - pointer to win32 resource data
38// DWORD MajorImageVersion - major image/os version (for fake win32 header)
39// DWORD MinorImageVersion - minor image/os version (for fake win32 header)
40// DWORD Subsystem - subsystem type (for fake win32 header)
41// (IMAGE_SUBSYSTEM_WINDOWS_CUI/IMAGE_SUBSYSTEM_WINDOWS_GUI/IMAGE_SUBSYSTEM_WINDOWS_NATIVE)
42//
[1420]43//Returns: Odin32 module handle
[953]44//******************************************************************************
[5288]45DWORD WIN32API RegisterLxDll(HINSTANCE hInstance, WIN32DLLENTRY EntryPoint,
46 PVOID pResData,
[21941]47 DWORD MajorImageVersion DEF_VAL(ODINNT_MAJOR_VERSION),
48 DWORD MinorImageVersion DEF_VAL(ODINNT_MINOR_VERSION),
49 DWORD Subsystem DEF_VAL(IMAGE_SUBSYSTEM_WINDOWS_CUI));
[953]50
51//******************************************************************************
52//Destroy LX Dll object
53//******************************************************************************
54BOOL WIN32API UnregisterLxDll(HINSTANCE hInstance);
55
56//******************************************************************************
57//Create LX Exe object and call entrypoint
58//System dlls set EntryPoint to 0
59//******************************************************************************
[978]60BOOL WIN32API RegisterLxExe(WINMAIN EntryPoint, PVOID pResData);
[7797]61
62//******************************************************************************
63//Create Dummy Exe object
64//******************************************************************************
65BOOL WIN32API RegisterDummyExe(LPSTR pszExeName);
[10383]66BOOL WIN32API IsDummyExeLoaded();
[7797]67
[21381]68//******************************************************************************
[21999]69//Makes FS register point to the Win32 thread information block. For Win32
70//binaries, this is set automatically but for OS/2 binaries it must be set by
71//hand when ODIN_FORCE_WIN32_TIB is defined in order for SEH (structured
72//exception handling) to work properly. Must be called before RegisterLxDll()/
73//RegisterLxExe().
[21381]74//******************************************************************************
[21999]75VOID WIN32API ForceWin32TIB();
[21381]76
[21393]77#ifdef __cplusplus
78}
[970]79#endif
[21393]80
81#endif
Note: See TracBrowser for help on using the repository browser.