Commit d3fb25cd authored by Alexandre Julliard's avatar Alexandre Julliard

Moved a few definitions used in only one source file out of module.h.

parent 8fb98a41
......@@ -225,7 +225,7 @@ NE_MODULE *NE_GetPtr( HMODULE16 hModule )
/**********************************************************************
* NE_RegisterModule
*/
void NE_RegisterModule( NE_MODULE *pModule )
static void NE_RegisterModule( NE_MODULE *pModule )
{
pModule->next = hFirstModule;
hFirstModule = pModule->self;
......@@ -390,7 +390,7 @@ void NE_WalkModules(void)
*
* Fill in 'resloader' fields in the resource table.
*/
void NE_InitResourceHandler( NE_MODULE *pModule )
static void NE_InitResourceHandler( NE_MODULE *pModule )
{
static FARPROC16 proc;
......@@ -1577,7 +1577,7 @@ static BOOL16 NE_FreeModule( HMODULE16 hModule, BOOL call_wep )
/* Free the referenced modules */
pModRef = (HMODULE16*)NE_MODULE_TABLE( pModule );
pModRef = (HMODULE16*)((char *)pModule + pModule->modref_table);
for (i = 0; i < pModule->modref_count; i++, pModRef++)
{
NE_FreeModule( *pModRef, call_wep );
......
......@@ -79,6 +79,22 @@ struct relocation_entry_s
#define NE_RELTYPE_OSFIXUP 3
#define NE_RELFLAG_ADDITIVE 4
/* Self-loading modules contain this structure in their first segment */
typedef struct
{
WORD version; /* Must be "A0" (0x3041) */
WORD reserved;
FARPROC16 BootApp; /* startup procedure */
FARPROC16 LoadAppSeg; /* procedure to load a segment */
FARPROC16 reserved2;
FARPROC16 MyAlloc; /* memory allocation procedure,
* wine must write this field */
FARPROC16 EntryAddrProc;
FARPROC16 ExitProc; /* exit procedure */
WORD reserved3[4];
FARPROC16 SetOwner; /* Set Owner procedure, exported by wine */
} SELFLOADHEADER;
#define SEL(x) ((x)|1)
static void NE_FixupSegmentPrologs(NE_MODULE *pModule, WORD segnum);
......@@ -108,7 +124,7 @@ static const char *NE_GetRelocAddrName( BYTE addr_type, int additive )
BOOL NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
{
SEGTABLEENTRY *pSegTable, *pSeg;
WORD *pModuleTable;
HMODULE16 *pModuleTable;
WORD count, i, offset, next_offset;
HMODULE16 module;
FARPROC16 address = 0;
......@@ -139,7 +155,7 @@ BOOL NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
if (!pSeg->filepos) return TRUE; /* No file image, just return */
pModuleTable = NE_MODULE_TABLE( pModule );
pModuleTable = (HMODULE16 *)((char *)pModule + pModule->modref_table);
hf = NE_OpenFile( pModule );
TRACE_(module)("Loading segment %d, hSeg=%04x, flags=%04x\n",
......@@ -861,7 +877,7 @@ static void free_init_list( struct ne_init_list *list )
static void fill_init_list( struct ne_init_list *list, HMODULE16 hModule )
{
NE_MODULE *pModule;
WORD *pModRef;
HMODULE16 *pModRef;
int i;
if (!(pModule = NE_GetPtr( hModule ))) return;
......@@ -881,10 +897,9 @@ static void fill_init_list( struct ne_init_list *list, HMODULE16 hModule )
pModule->misc_flags |= 0x80;
/* Recursively attach all DLLs this one depends on */
pModRef = NE_MODULE_TABLE( pModule );
pModRef = (HMODULE16 *)((char *)pModule + pModule->modref_table);
for ( i = 0; i < pModule->modref_count; i++ )
if ( pModRef[i] )
fill_init_list( list, (HMODULE16)pModRef[i] );
if ( pModRef[i] ) fill_init_list( list, pModRef[i] );
/* Add current module */
add_to_init_list( list, pModule );
......
......@@ -34,7 +34,6 @@
#include "thread.h"
#include "drive.h"
#include "file.h"
#include "heap.h"
#include "module.h"
#include "options.h"
#include "kernel_private.h"
......@@ -46,6 +45,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(process);
WINE_DECLARE_DEBUG_CHANNEL(server);
WINE_DECLARE_DEBUG_CHANNEL(relay);
typedef struct
{
LPSTR lpEnvAddress;
LPSTR lpCmdLine;
LPSTR lpCmdShow;
DWORD dwReserved;
} LOADPARMS32;
static UINT process_error_mode;
static HANDLE main_exe_file;
......@@ -1746,7 +1753,7 @@ UINT WINAPI WinExec( LPCSTR lpCmdLine, UINT nCmdShow )
*/
HINSTANCE WINAPI LoadModule( LPCSTR name, LPVOID paramBlock )
{
LOADPARAMS *params = (LOADPARAMS *)paramBlock;
LOADPARMS32 *params = paramBlock;
PROCESS_INFORMATION info;
STARTUPINFOA startup;
HINSTANCE hInstance;
......@@ -1775,7 +1782,7 @@ HINSTANCE WINAPI LoadModule( LPCSTR name, LPVOID paramBlock )
if (params->lpCmdShow)
{
startup.dwFlags = STARTF_USESHOWWINDOW;
startup.wShowWindow = params->lpCmdShow[1];
startup.wShowWindow = ((WORD *)params->lpCmdShow)[1];
}
if (CreateProcessA( filename, cmdline, NULL, NULL, FALSE, 0,
......
......@@ -98,44 +98,11 @@ typedef struct
/* of segment in memory */
} SEGTABLEENTRY;
/* Self-loading modules contain this structure in their first segment */
#include <pshpack1.h>
typedef struct
{
WORD version; /* Must be "A0" (0x3041) */
WORD reserved;
FARPROC16 BootApp; /* startup procedure */
FARPROC16 LoadAppSeg; /* procedure to load a segment */
FARPROC16 reserved2;
FARPROC16 MyAlloc; /* memory allocation procedure,
* wine must write this field */
FARPROC16 EntryAddrProc;
FARPROC16 ExitProc; /* exit procedure */
WORD reserved3[4];
FARPROC16 SetOwner; /* Set Owner procedure, exported by wine */
} SELFLOADHEADER;
typedef struct
{
LPSTR lpEnvAddress;
LPSTR lpCmdLine;
UINT16 *lpCmdShow;
DWORD dwReserved;
} LOADPARAMS;
#include <poppack.h>
/* Resource types */
#define NE_SEG_TABLE(pModule) \
((SEGTABLEENTRY *)((char *)(pModule) + (pModule)->seg_table))
#define NE_MODULE_TABLE(pModule) \
((WORD *)((char *)(pModule) + (pModule)->modref_table))
#define NE_MODULE_NAME(pModule) \
(((OFSTRUCT *)((char*)(pModule) + (pModule)->fileinfo))->szPathName)
......@@ -164,15 +131,9 @@ enum binary_type
/* module.c */
extern NTSTATUS MODULE_DllThreadAttach( LPVOID lpReserved );
extern enum binary_type MODULE_GetBinaryType( HANDLE hfile );
extern FARPROC16 WINAPI WIN32_GetProcAddress16( HMODULE hmodule, LPCSTR name );
extern void MODULE_WalkModref( DWORD id );
/* loader/ne/module.c */
extern NE_MODULE *NE_GetPtr( HMODULE16 hModule );
extern void NE_DumpModule( HMODULE16 hModule );
extern void NE_WalkModules(void);
extern void NE_InitResourceHandler( NE_MODULE *pModule );
extern void NE_RegisterModule( NE_MODULE *pModule );
extern WORD NE_GetOrdinal( HMODULE16 hModule, const char *name );
extern FARPROC16 WINAPI NE_GetEntryPoint( HMODULE16 hModule, WORD ordinal );
extern FARPROC16 NE_GetEntryPointEx( HMODULE16 hModule, WORD ordinal, BOOL16 snoop );
......@@ -193,10 +154,6 @@ extern void NE_InitializeDLLs( HMODULE16 hModule );
extern void NE_DllProcessAttach( HMODULE16 hModule );
extern void NE_CallUserSignalProc( HMODULE16 hModule, UINT16 code );
/* loader/pe_resource.c */
extern HRSRC PE_FindResourceW(HMODULE,LPCWSTR,LPCWSTR);
extern HRSRC PE_FindResourceExW(HMODULE,LPCWSTR,LPCWSTR,WORD);
/* loader/loadorder.c */
extern void MODULE_GetLoadOrderW( enum loadorder_type plo[], const WCHAR *app_name,
const WCHAR *path, BOOL win32 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment