Commit 69c0bbea authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

Some small bugfixes, added more PE relocation types (for WinCE mostly),

some console prototypes, -dll is useful for winelib too, regtest compile fixed.
parent f8db63bb
......@@ -266,7 +266,7 @@ GetTokenInformation( HANDLE32 token, DWORD tokeninfoclass, LPVOID tokeninfo,
{
FIXME(advapi,"(%08x,%ld,%p,%ld,%p): stub\n",
token,tokeninfoclass,tokeninfo,tokeninfolength,retlen);
return TRUE;
return FALSE;
}
/******************************************************************************
......
......@@ -136,17 +136,15 @@ Disassembling programs:
The best, freely available, disassembler for Win16 programs is
Windows Codeback, archivename wcbxxx.zip, which usually can be found
in the Cica-Mirror subdirectory on the WINE ftpsites. (See ANNOUNCE).
Disassembling win32 programs is possible using the Windows Disassembler 32,
which can be found at http://www.winsite.com/ and mirrors by searching for
w32dsm87.zip. This file used to be available under the name w32dasm.zip.
The shareware version does not allow saving of disassembly listings.
[It also has a bug, it disassembles the dll and immediately after that
crashes, leaving a very large file caled 'winsys' in the directory of the
disassembled file. This file contains nothing of value (just the disassembly)
and can be safely deleted.]
Disassembling win32 programs is possible using the Windows Disassembler 32,
archivename something like w32dsm87.zip (or similar) on ftp.winsite.com
and mirrors. The shareware version does not allow saving of disassembly
listings.
You can also use the newer (and in the full version better) Interactive
Disassembler (IDA) from the ftp sites mentioned at the end of the document.
Understanding disassembled code is just a question of exercise.
Understanding disassembled code is mostly a question of exercise.
Most code out there uses standard C function entries (for it is usually
written in C). Win16 function entries usually look like that:
......
......@@ -406,13 +406,157 @@ typedef struct _IMAGE_DEBUG_DIRECTORY {
#define IMAGE_DEBUG_TYPE_OMAP_TO_SRC 7
#define IMAGE_DEBUG_TYPE_OMAP_FROM_SRC 8
/* generic relocation types */
#define IMAGE_REL_BASED_ABSOLUTE 0
#define IMAGE_REL_BASED_HIGH 1
#define IMAGE_REL_BASED_LOW 2
#define IMAGE_REL_BASED_HIGHLOW 3
#define IMAGE_REL_BASED_HIGHADJ 4
#define IMAGE_REL_BASED_MIPS_JMPADDR 5
#define IMAGE_REL_BASED_SECTION 6
#define IMAGE_REL_BASED_REL32 7
#define IMAGE_REL_BASED_MIPS_JMPADDR16 9
#define IMAGE_REL_BASED_IA64_IMM64 9 /* yes, 9 too */
#define IMAGE_REL_BASED_DIR64 10
#define IMAGE_REL_BASED_HIGH3ADJ 11
/* I386 relocation types */
#define IMAGE_REL_I386_ABSOLUTE 0
#define IMAGE_REL_I386_DIR16 1
#define IMAGE_REL_I386_REL16 2
#define IMAGE_REL_I386_DIR32 6
#define IMAGE_REL_I386_DIR32NB 7
#define IMAGE_REL_I386_SEG12 9
#define IMAGE_REL_I386_SECTION 10
#define IMAGE_REL_I386_SECREL 11
#define IMAGE_REL_I386_REL32 20
/* MIPS relocation types */
#define IMAGE_REL_MIPS_ABSOLUTE 0x0000
#define IMAGE_REL_MIPS_REFHALF 0x0001
#define IMAGE_REL_MIPS_REFWORD 0x0002
#define IMAGE_REL_MIPS_JMPADDR 0x0003
#define IMAGE_REL_MIPS_REFHI 0x0004
#define IMAGE_REL_MIPS_REFLO 0x0005
#define IMAGE_REL_MIPS_GPREL 0x0006
#define IMAGE_REL_MIPS_LITERAL 0x0007
#define IMAGE_REL_MIPS_SECTION 0x000A
#define IMAGE_REL_MIPS_SECREL 0x000B
#define IMAGE_REL_MIPS_SECRELLO 0x000C
#define IMAGE_REL_MIPS_SECRELHI 0x000D
#define IMAGE_REL_MIPS_JMPADDR16 0x0010
#define IMAGE_REL_MIPS_REFWORDNB 0x0022
#define IMAGE_REL_MIPS_PAIR 0x0025
/* ALPHA relocation types */
#define IMAGE_REL_ALPHA_ABSOLUTE 0x0000
#define IMAGE_REL_ALPHA_REFLONG 0x0001
#define IMAGE_REL_ALPHA_REFQUAD 0x0002
#define IMAGE_REL_ALPHA_GPREL32 0x0003
#define IMAGE_REL_ALPHA_LITERAL 0x0004
#define IMAGE_REL_ALPHA_LITUSE 0x0005
#define IMAGE_REL_ALPHA_GPDISP 0x0006
#define IMAGE_REL_ALPHA_BRADDR 0x0007
#define IMAGE_REL_ALPHA_HINT 0x0008
#define IMAGE_REL_ALPHA_INLINE_REFLONG 0x0009
#define IMAGE_REL_ALPHA_REFHI 0x000A
#define IMAGE_REL_ALPHA_REFLO 0x000B
#define IMAGE_REL_ALPHA_PAIR 0x000C
#define IMAGE_REL_ALPHA_MATCH 0x000D
#define IMAGE_REL_ALPHA_SECTION 0x000E
#define IMAGE_REL_ALPHA_SECREL 0x000F
#define IMAGE_REL_ALPHA_REFLONGNB 0x0010
#define IMAGE_REL_ALPHA_SECRELLO 0x0011
#define IMAGE_REL_ALPHA_SECRELHI 0x0012
#define IMAGE_REL_ALPHA_REFQ3 0x0013
#define IMAGE_REL_ALPHA_REFQ2 0x0014
#define IMAGE_REL_ALPHA_REFQ1 0x0015
#define IMAGE_REL_ALPHA_GPRELLO 0x0016
#define IMAGE_REL_ALPHA_GPRELHI 0x0017
/* PowerPC relocation types */
#define IMAGE_REL_PPC_ABSOLUTE 0x0000
#define IMAGE_REL_PPC_ADDR64 0x0001
#define IMAGE_REL_PPC_ADDR32 0x0002
#define IMAGE_REL_PPC_ADDR24 0x0003
#define IMAGE_REL_PPC_ADDR16 0x0004
#define IMAGE_REL_PPC_ADDR14 0x0005
#define IMAGE_REL_PPC_REL24 0x0006
#define IMAGE_REL_PPC_REL14 0x0007
#define IMAGE_REL_PPC_TOCREL16 0x0008
#define IMAGE_REL_PPC_TOCREL14 0x0009
#define IMAGE_REL_PPC_ADDR32NB 0x000A
#define IMAGE_REL_PPC_SECREL 0x000B
#define IMAGE_REL_PPC_SECTION 0x000C
#define IMAGE_REL_PPC_IFGLUE 0x000D
#define IMAGE_REL_PPC_IMGLUE 0x000E
#define IMAGE_REL_PPC_SECREL16 0x000F
#define IMAGE_REL_PPC_REFHI 0x0010
#define IMAGE_REL_PPC_REFLO 0x0011
#define IMAGE_REL_PPC_PAIR 0x0012
#define IMAGE_REL_PPC_SECRELLO 0x0013
#define IMAGE_REL_PPC_SECRELHI 0x0014
#define IMAGE_REL_PPC_GPREL 0x0015
#define IMAGE_REL_PPC_TYPEMASK 0x00FF
/* modifier bits */
#define IMAGE_REL_PPC_NEG 0x0100
#define IMAGE_REL_PPC_BRTAKEN 0x0200
#define IMAGE_REL_PPC_BRNTAKEN 0x0400
#define IMAGE_REL_PPC_TOCDEFN 0x0800
/* SH3 ? relocation type */
#define IMAGE_REL_SH3_ABSOLUTE 0x0000
#define IMAGE_REL_SH3_DIRECT16 0x0001
#define IMAGE_REL_SH3_DIRECT32 0x0002
#define IMAGE_REL_SH3_DIRECT8 0x0003
#define IMAGE_REL_SH3_DIRECT8_WORD 0x0004
#define IMAGE_REL_SH3_DIRECT8_LONG 0x0005
#define IMAGE_REL_SH3_DIRECT4 0x0006
#define IMAGE_REL_SH3_DIRECT4_WORD 0x0007
#define IMAGE_REL_SH3_DIRECT4_LONG 0x0008
#define IMAGE_REL_SH3_PCREL8_WORD 0x0009
#define IMAGE_REL_SH3_PCREL8_LONG 0x000A
#define IMAGE_REL_SH3_PCREL12_WORD 0x000B
#define IMAGE_REL_SH3_STARTOF_SECTION 0x000C
#define IMAGE_REL_SH3_SIZEOF_SECTION 0x000D
#define IMAGE_REL_SH3_SECTION 0x000E
#define IMAGE_REL_SH3_SECREL 0x000F
#define IMAGE_REL_SH3_DIRECT32_NB 0x0010
/* ARM (Archimedes?) relocation types */
#define IMAGE_REL_ARM_ABSOLUTE 0x0000
#define IMAGE_REL_ARM_ADDR32 0x0001
#define IMAGE_REL_ARM_ADDR32NB 0x0002
#define IMAGE_REL_ARM_BRANCH24 0x0003
#define IMAGE_REL_ARM_BRANCH11 0x0004
#define IMAGE_REL_ARM_SECTION 0x000E
#define IMAGE_REL_ARM_SECREL 0x000F
/* IA64 relocation types */
#define IMAGE_REL_IA64_ABSOLUTE 0x0000
#define IMAGE_REL_IA64_IMM14 0x0001
#define IMAGE_REL_IA64_IMM22 0x0002
#define IMAGE_REL_IA64_IMM64 0x0003
#define IMAGE_REL_IA64_DIR32 0x0004
#define IMAGE_REL_IA64_DIR64 0x0005
#define IMAGE_REL_IA64_PCREL21B 0x0006
#define IMAGE_REL_IA64_PCREL21M 0x0007
#define IMAGE_REL_IA64_PCREL21F 0x0008
#define IMAGE_REL_IA64_GPREL22 0x0009
#define IMAGE_REL_IA64_LTOFF22 0x000A
#define IMAGE_REL_IA64_SECTION 0x000B
#define IMAGE_REL_IA64_SECREL22 0x000C
#define IMAGE_REL_IA64_SECREL64I 0x000D
#define IMAGE_REL_IA64_SECREL32 0x000E
#define IMAGE_REL_IA64_LTOFF64 0x000F
#define IMAGE_REL_IA64_DIR32NB 0x0010
#define IMAGE_REL_IA64_RESERVED_11 0x0011
#define IMAGE_REL_IA64_RESERVED_12 0x0012
#define IMAGE_REL_IA64_RESERVED_13 0x0013
#define IMAGE_REL_IA64_RESERVED_14 0x0014
#define IMAGE_REL_IA64_RESERVED_15 0x0015
#define IMAGE_REL_IA64_RESERVED_16 0x0016
#define IMAGE_REL_IA64_ADDEND 0x001F
/*
* This is the structure that appears at the very start of a .DBG file.
......
......@@ -142,6 +142,30 @@ typedef struct tagINPUT_RECORD
BOOL32 WINAPI WriteConsoleOutput32A( HANDLE32 hConsoleOutput, LPCHAR_INFO lpBuffer, COORD dwBufferSize, COORD dwBufferCoord, LPSMALL_RECT lpWriteRegion);
BOOL32 WINAPI WriteConsoleOutput32W( HANDLE32 hConsoleOutput, LPCHAR_INFO lpBuffer, COORD dwBufferSize, COORD dwBufferCoord, LPSMALL_RECT lpWriteRegion);
#define WriteConsoleOutput WINELIB_NAME_AW(WriteConsoleOutput)
BOOL32 WINAPI WriteConsoleInput32A( HANDLE32 handle, INPUT_RECORD *buffer,
DWORD count, LPDWORD written );
BOOL32 WINAPI WriteConsoleInput32W( HANDLE32 handle, INPUT_RECORD *buffer,
DWORD count, LPDWORD written );
#define WriteConsoleInput WINELIB_NAME_AW(WriteConsoleInput)
BOOL32 WINAPI PeekConsoleInput32A( HANDLE32 handle, LPINPUT_RECORD buffer,
DWORD count, LPDWORD read );
BOOL32 WINAPI PeekConsoleInput32W( HANDLE32 handle, LPINPUT_RECORD buffer,
DWORD count, LPDWORD read );
#define PeekConsoleInput WINELIB_NAME_AW(PeekConsoleInput)
BOOL32 WINAPI ReadConsole32A( HANDLE32 hConsoleInput, LPVOID lpBuffer,
DWORD nNumberOfCharsToRead,
LPDWORD lpNumberOfCharsRead, LPVOID lpReserved);
BOOL32 WINAPI ReadConsole32W( HANDLE32 hConsoleInput, LPVOID lpBuffer,
DWORD nNumberOfCharsToRead,
LPDWORD lpNumberOfCharsRead, LPVOID lpReserved);
#define ReadConsole WINELIB_NAME_AW(ReadConsole)
BOOL32 WINAPI ReadConsoleInput32A(HANDLE32 hConsoleInput,
LPINPUT_RECORD lpBuffer, DWORD nLength,
LPDWORD lpNumberOfEventsRead);
BOOL32 WINAPI ReadConsoleInput32W(HANDLE32 hConsoleInput,
LPINPUT_RECORD lpBuffer, DWORD nLength,
LPDWORD lpNumberOfEventsRead);
#define ReadConsoleInput WINELIB_NAME_AW(ReadConsoleInput)
#ifdef __WINE__
extern HANDLE32 CONSOLE_OpenHandle( BOOL32 output, DWORD access, LPSECURITY_ATTRIBUTES sa );
......
......@@ -271,3 +271,5 @@ type win32
0267 stub LsaICLookupSids
0268 stub SystemFunction031
0269 stub I_ScSetServiceBitsA
0270 stub EnumServiceGroupA
0271 stub EnumServiceGroupW
......@@ -225,29 +225,16 @@ void X11DRV_MAIN_ParseOptions(int *argc, char *argv[])
}
if (X11DRV_MAIN_GetResource( db, ".dll", &value))
{
/* Hack: store option value in Options to be retrieved */
/* later on inside the emulator code. */
if (!__winelib)
{
if (Options.dllFlags)
{
/* don't overwrite previous value. Should we
* automatically add the ',' between multiple DLLs ?
*/
MSG("Only one -dll flag is allowed. Use ',' between multiple DLLs\n");
}
else
{
Options.dllFlags = xstrdup((char *)value.addr);
}
}
else
{
MSG("-dll not supported in Winelib\n" );
exit(1);
}
}
{
if (Options.dllFlags)
{
/* don't overwrite previous value. Should we
* automatically add the ',' between multiple DLLs ?
*/
MSG("Only one -dll flag is allowed. Use ',' between multiple DLLs\n");
}
else Options.dllFlags = xstrdup((char *)value.addr);
}
if (X11DRV_MAIN_GetResource( db, ".winver", &value))
VERSION_ParseWinVersion( (char*)value.addr );
......
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