Release 980315
Sun Mar 15 03:46:50 1998 Dimitrie O. Paun <dimi@mail.cs.toronto.edu>
* [*/*]
Fixed some dprintf_ such that there is one and only one
new line for each dprintf and that new line occurs at the end.
Transformed some fprintfs into proper debug statements.
Removed much redundancy from most of the debug statements. The
redundancy appeared because now the component and function
name is output automatically. Most debug statements also used to
output the name of the function.
All these changes prepared the source to switch completely to
the new debugging interface.
For more info, refer to ./documentation/debug-msg
Sat Mar 14 19:45:23 1997 Andreas Mohr <100.30936@germany.net>
* [misc/shell.c] [if1632/kernel.spec]
Changed parameters of FUNC004() to fix a crash.
Not sure if this fix is correct (doc wanted).
* [windows/user.c] [if1632/user.spec] [include/user.h]
Implemented UserSeeUserDo.
* [msdos/int21.c] [include/msdos.h]
Added "GET LIST OF LISTS" (INT 21/52h).
Sat Mar 14 15:48:02 1998 Douglas Ridgway <ridgway@gmcl.com>
* [include/windows.h] [relay32/gdi32.spec] [objects/enhmetafile.c]
Beginnings of enhanced metafile support.
Fri Mar 13 20:53:09 1998 John Richardson <jrichard@zko.dec.com>
* [win32/console.c]
Restart interrupted console writes.
Fri Mar 13 18:59:24 1998 Matthew Becker <mbecker@glasscity.net>
* [*/*.c]
Updated documentation for API manpages.
* [windows/dce.c]
ReleaseDC16: Fixed cast.
* [include/windows.h] [memory/virtual.c]
VirtualQuery{Ex} should return DWORD instead of BOOL32.
Fri Mar 13 13:03:06 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [README][documentation/status/]
README updated, added lzexpand,version and multimedia
status notes to new documentation/status directory.
* [ole/*.c][if1632/typelib.spec]
Added typelib stubs, several small additions and fixes.
* [loader/pe_image.c]
Fixed a small bug (fixup_imports got passed the wrong hModule in a
remapcase).
* [loader/signal.c][if1632/signal.c][misc/winsock_dns.c]
[loader/module.c]
Fixed some recursive debugger crashes (caused by invalid FS).
* [misc/registry.c]
Two bugs fixed.
Fri Mar 13 04:55:01 1998 David Lee Lambert <lamber45@egr.msu.edu>
* [include/winnt.h] [include/winnls.h]
Moved LANG_xxx flags to winnls.h
* [include/winnls.h]
Added flags for GetDateFormat(); fixed validity of
LOCALE_SYSTEM_DEFAULT.
* [include/windows.h]
Added GetTimeFormat() prototypes.
* [ole/ole2nls.c]
Implemented ASCII date- and time-functions, using an
optimized common core; added stubs for Unicode versions;
started work on a Unicode core.
* [AUTHORS]
Added my name.
Mon Mar 9 20:10:15 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [relay32/comctl32.spec] [include/imagelist.h]
[include/commctrl.h] [misc/imagelist.c] [misc/Makefile.in]
First attempt at implementing ImageLists.
Sun Mar 8 20:19:49 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [files/dos_fs.c] [configure.in]
Try to get FileTimeToLocalFileTime,FileTimeToSystemTime and
SystemTimeToFileTime right.
Use timegm() where available.
* [misc/lstr.c]
Fix an off by one error in FormatMessage and handle the case
when args = NULL (used by programs to get the length of the
string).
* [win32/console.c]
Actual display a per-process Title string, better working
attempt for WriteConsole32W and ReadConsole32W.
Fri Mar 6 20:33:45 1998 Slaven Rezic <eserte@cs.tu-berlin.de>
* [include/config.h.in][configure.in][multimedia/audio.c]
[multimedia/dsound.c]
Added check for FreeBSD sound system.
Sun Mar 1 17:40:10 1998 Jason Schonberg <schon@mti.sgi.com>
* [controls/edit.c] [include/ole.h] [include/shlobj.h]
Removed final commas in enum types.
Mon Feb 23 07:52:18 1998 Luiz Otavio L. Zorzella <zorzella@nr.conexware.com>
* [multimedia/time.c]
Workaround to avoid infinite recursion inside timeGetTime.
* [multimedia/audio.c]
WODM_GETNUMDEVS and WIDM_GETNUMDEVS only return 1 now if the
SOUND_DEV can be opened, or if it's busy.
diff --git a/loader/module.c b/loader/module.c
index 8bc0783..7a8d585 100644
--- a/loader/module.c
+++ b/loader/module.c
@@ -19,6 +19,7 @@
#include "module.h"
#include "neexe.h"
#include "process.h"
+#include "thread.h"
#include "resource.h"
#include "selectors.h"
#include "stackframe.h"
@@ -29,6 +30,8 @@
extern HINSTANCE16 PE_LoadModule( HFILE32 hf, OFSTRUCT *ofs, LOADPARAMS* params );
+extern BOOL32 THREAD_InitDone;
+
static HMODULE16 hFirstModule = 0;
static HMODULE16 hCachedModule = 0; /* Module cached by MODULE_OpenFile */
@@ -269,7 +272,7 @@
static int cachedfd = -1;
hModule = MODULE_HANDLEtoHMODULE16(hModule);
- dprintf_info(module, "MODULE_OpenFile(%04x) cache: mod=%04x fd=%d\n",
+ TRACE(module, "(%04x) cache: mod=%04x fd=%d\n",
hModule, hCachedModule, cachedfd );
if (!(pModule = MODULE_GetPtr( hModule ))) return -1;
if (hCachedModule == hModule) return cachedfd;
@@ -280,7 +283,7 @@
(cachedfd = open( full_name.long_name, O_RDONLY )) == -1)
fprintf( stderr, "MODULE_OpenFile: can't open file '%s' for module %04x\n",
name, hModule );
- dprintf_info(module, "MODULE_OpenFile: opened '%s' -> %d\n",
+ TRACE(module, "opened '%s' -> %d\n",
name, cachedfd );
return cachedfd;
}
@@ -561,7 +564,7 @@
/* Clear internal Wine flags in case they are set in the EXE file */
- pModule->flags &= ~(NE_FFLAGS_BUILTIN | NE_FFLAGS_WIN32);
+ pModule->flags &= ~(NE_FFLAGS_BUILTIN|NE_FFLAGS_WIN32|NE_FFLAGS_IMPLICIT);
/* Read the fast-load area */
@@ -569,7 +572,7 @@
{
fastload_offset=ne_header.fastload_offset<<ne_header.align_shift_count;
fastload_length=ne_header.fastload_length<<ne_header.align_shift_count;
- dprintf_info(module, "Using fast-load area offset=%x len=%d\n",
+ TRACE(module, "Using fast-load area offset=%x len=%d\n",
fastload_offset, fastload_length );
if ((fastload = HeapAlloc( SystemHeap, 0, fastload_length )) != NULL)
{
@@ -756,7 +759,7 @@
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
- dprintf_info(module, "MODULE_GetOrdinal(%04x,'%s')\n",
+ TRACE(module, "(%04x,'%s')\n",
hModule, name );
/* First handle names of the form '#xxxx' */
@@ -779,7 +782,7 @@
{
if (((BYTE)*cpnt == len) && !memcmp( cpnt+1, buffer, len ))
{
- dprintf_info(module, " Found: ordinal=%d\n",
+ TRACE(module, " Found: ordinal=%d\n",
*(WORD *)(cpnt + *cpnt + 1) );
return *(WORD *)(cpnt + *cpnt + 1);
}
@@ -797,7 +800,7 @@
{
if (((BYTE)*cpnt == len) && !memcmp( cpnt+1, buffer, len ))
{
- dprintf_info(module, " Found: ordinal=%d\n",
+ TRACE(module, " Found: ordinal=%d\n",
*(WORD *)(cpnt + *cpnt + 1) );
return *(WORD *)(cpnt + *cpnt + 1);
}
@@ -1044,7 +1047,7 @@
if (ordinal) WEP = MODULE_GetEntryPoint( hModule, ordinal );
if (!WEP)
{
- dprintf_warn(module, "module %04x doesn't have a WEP\n", hModule );
+ WARN(module, "module %04x doesn't have a WEP\n", hModule );
return FALSE;
}
return Callbacks->CallWindowsExitProc( WEP, WEP_FREE_DLL );
@@ -1307,7 +1310,7 @@
NE_MODULE *pModule;
if (!(pModule = MODULE_GetPtr( hModule ))) return FALSE;
- dprintf_info(module, "FreeModule16: %s count %d\n",
+ TRACE(module, "%s count %d\n",
MODULE_GetModuleName(hModule), pModule->count );
return MODULE_FreeModule( hModule, GlobalLock16(GetCurrentTask()) );
@@ -1335,7 +1338,7 @@
{
HMODULE32 hModule;
- dprintf_info(win32, "GetModuleHandleA: %s\n", module ? module : "NULL");
+ TRACE(win32, "%s\n", module ? module : "NULL");
/* Freecell uses the result of GetModuleHandleA(0) as the hInstance in
all calls to e.g. CreateWindowEx. */
if (module == NULL) {
@@ -1364,7 +1367,7 @@
NE_MODULE *pModule;
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
- dprintf_info(module, "GetModuleUsage(%04x): returning %d\n",
+ TRACE(module, "(%04x): returning %d\n",
hModule, pModule->count );
return pModule->count;
}
@@ -1381,7 +1384,7 @@
if (!hModule) hModule = GetCurrentTask();
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
lstrcpyn32A( lpFileName, NE_MODULE_NAME(pModule), nSize );
- dprintf_info(module, "GetModuleFileName16: %s\n", lpFileName );
+ TRACE(module, "%s\n", lpFileName );
return strlen(lpFileName);
}
@@ -1401,7 +1404,7 @@
}
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
lstrcpyn32A( lpFileName, NE_MODULE_NAME(pModule), size );
- dprintf_info(module, "GetModuleFileName32A: %s\n", lpFileName );
+ TRACE(module, "%s\n", lpFileName );
return strlen(lpFileName);
}
@@ -1496,7 +1499,7 @@
*/
BOOL32 WINAPI FreeLibrary32(HINSTANCE32 hLibModule)
{
- dprintf_info(module,"FreeLibrary: hLibModule: %08x\n", hLibModule);
+ TRACE(module,"hLibModule=%08x\n", hLibModule);
return MODULE_FreeModule(hLibModule,
GlobalLock16(GetCurrentTask()) );
}
@@ -1514,7 +1517,7 @@
fprintf( stderr, "LoadLibrary not supported in Winelib\n" );
return 0;
}
- dprintf_info(module, "LoadLibrary: (%08x) %s\n", (int)libname, libname);
+ TRACE(module, "(%08x) %s\n", (int)libname, libname);
handle = MODULE_Load( libname, (LPVOID)-1, 0 );
if (handle == (HINSTANCE16)2) /* file not found */
@@ -1544,7 +1547,7 @@
*/
void WINAPI FreeLibrary16( HINSTANCE16 handle )
{
- dprintf_info(module,"FreeLibrary: %04x\n", handle );
+ TRACE(module,"%04x\n", handle );
FreeModule16( handle );
}
@@ -1683,6 +1686,7 @@
int iconic = (nCmdShow == SW_SHOWMINIMIZED ||
nCmdShow == SW_SHOWMINNOACTIVE);
+ THREAD_InitDone = FALSE; /* we didn't init this process */
/* get unixfilename */
if (strchr(filename, '/') ||
strchr(filename, ':') ||
@@ -1758,16 +1762,16 @@
hModule = MODULE_HANDLEtoHMODULE16(hModule);
if (HIWORD(name)) {
ordinal = MODULE_GetOrdinal( hModule, name );
- dprintf_info(module, "WIN32_GetProcAddress16: %04x '%s'\n",
+ TRACE(module, "%04x '%s'\n",
hModule, name );
} else {
ordinal = LOWORD(name);
- dprintf_info(module, "GetProcAddress: %04x %04x\n",
+ TRACE(module, "%04x %04x\n",
hModule, ordinal );
}
if (!ordinal) return (FARPROC16)0;
ret = MODULE_GetEntryPoint( hModule, ordinal );
- dprintf_info(module,"WIN32_GetProcAddress16: returning %08x\n",(UINT32)ret);
+ TRACE(module,"returning %08x\n",(UINT32)ret);
return ret;
}
@@ -1785,20 +1789,20 @@
if (HIWORD(name) != 0)
{
ordinal = MODULE_GetOrdinal( hModule, (LPSTR)PTR_SEG_TO_LIN(name) );
- dprintf_info(module, "GetProcAddress: %04x '%s'\n",
+ TRACE(module, "%04x '%s'\n",
hModule, (LPSTR)PTR_SEG_TO_LIN(name) );
}
else
{
ordinal = LOWORD(name);
- dprintf_info(module, "GetProcAddress: %04x %04x\n",
+ TRACE(module, "%04x %04x\n",
hModule, ordinal );
}
if (!ordinal) return (FARPROC16)0;
ret = MODULE_GetEntryPoint( hModule, ordinal );
- dprintf_info(module, "GetProcAddress: returning %08x\n", (UINT32)ret );
+ TRACE(module, "returning %08x\n", (UINT32)ret );
return ret;
}
@@ -1811,9 +1815,9 @@
NE_MODULE *pModule;
if (HIWORD(function))
- dprintf_info(win32,"GetProcAddress32(%08lx,%s)\n",(DWORD)hModule,function);
+ TRACE(win32,"(%08lx,%s)\n",(DWORD)hModule,function);
else
- dprintf_info(win32,"GetProcAddress32(%08lx,%p)\n",(DWORD)hModule,function);
+ TRACE(win32,"(%08lx,%p)\n",(DWORD)hModule,function);
if (!(pModule = MODULE_GetPtr( hModule )))
return (FARPROC32)0;
if (!pModule->module32)
diff --git a/loader/ne_image.c b/loader/ne_image.c
index 7b13bab..c47fd4c 100644
--- a/loader/ne_image.c
+++ b/loader/ne_image.c
@@ -54,7 +54,7 @@
if (!pSeg->filepos) return TRUE; /* No file image, just return */
fd = MODULE_OpenFile( pModule->self );
- dprintf_info(module, "Loading segment %d, selector=%04x, flags=%04x\n",
+ TRACE(module, "Loading segment %d, selector=%04x, flags=%04x\n",
segnum, pSeg->selector, pSeg->flags );
lseek( fd, pSeg->filepos << pModule->alignment, SEEK_SET );
if (pSeg->size) size = pSeg->size;
@@ -115,7 +115,7 @@
/*
The following bit of code for "iterated segments" was written without
any documentation on the format of these segments. It seems to work,
- but may be missing something. If you have any doco please either send
+ but may be missing something. If you have any doc please either send
it to me or fix the code yourself. gfm@werple.mira.net.au
*/
char* buff = xmalloc(size);
@@ -142,7 +142,7 @@
read( fd, &count, sizeof(count) );
if (!count) return TRUE;
- dprintf_info(fixup, "Fixups for %*.*s, segment %d, selector %04x\n",
+ TRACE(fixup, "Fixups for %*.*s, segment %d, selector %04x\n",
*((BYTE *)pModule + pModule->name_table),
*((BYTE *)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1,
@@ -152,12 +152,12 @@
if (read( fd, reloc_entries, count * sizeof(struct relocation_entry_s)) !=
count * sizeof(struct relocation_entry_s))
{
- dprintf_warn(fixup, "Unable to read relocation information\n" );
+ WARN(fixup, "Unable to read relocation information\n" );
return FALSE;
}
/*
- * Go through the relocation table on entry at a time.
+ * Go through the relocation table one entry at a time.
*/
rep = reloc_entries;
for (i = 0; i < count; i++, rep++)
@@ -193,10 +193,10 @@
(char *)pTarget + pTarget->name_table + 1,
ordinal );
}
- if (debugging_info(fixup))
+ if (TRACE_ON(fixup))
{
NE_MODULE *pTarget = MODULE_GetPtr( module );
- dprintf_info(fixup, "%d: %*.*s.%d=%04x:%04x\n", i + 1,
+ TRACE(fixup, "%d: %*.*s.%d=%04x:%04x\n", i + 1,
*((BYTE *)pTarget + pTarget->name_table),
*((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1,
@@ -214,17 +214,17 @@
address = MODULE_GetEntryPoint( module, ordinal );
- if (debugging_err(fixup) && !address)
+ if (ERR_ON(fixup) && !address)
{
NE_MODULE *pTarget = MODULE_GetPtr( module );
- dprintf_err(fixup, "Warning: no handler for %.*s.%s, setting to 0:0\n",
+ ERR(fixup, "Warning: no handler for %.*s.%s, setting to 0:0\n",
*((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1, func_name );
}
- if (debugging_info(fixup))
+ if (TRACE_ON(fixup))
{
NE_MODULE *pTarget = MODULE_GetPtr( module );
- dprintf_info(fixup, "%d: %.*s.%s=%04x:%04x\n", i + 1,
+ TRACE(fixup, "%d: %.*s.%s=%04x:%04x\n", i + 1,
*((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1,
func_name, HIWORD(address), LOWORD(address) );
@@ -241,7 +241,7 @@
address = (FARPROC16)PTR_SEG_OFF_TO_SEGPTR( pSegTable[rep->target1-1].selector, rep->target2 );
}
- dprintf_info(fixup,"%d: %04x:%04x\n",
+ TRACE(fixup,"%d: %04x:%04x\n",
i + 1, HIWORD(address), LOWORD(address) );
break;
@@ -254,14 +254,13 @@
* successfully emulate the coprocessor if it doesn't
* exist.
*/
- dprintf_info(fixup,
- "%d: ADDR TYPE %d, TYPE %d, OFFSET %04x, TARGET %04x %04x\n",
- i + 1, rep->address_type, rep->relocation_type,
- rep->offset, rep->target1, rep->target2);
+ TRACE(fixup, "%d: ADDR TYPE %d, TYPE %d, OFFSET %04x, "
+ "TARGET %04x %04x\n", i + 1, rep->address_type,
+ rep->relocation_type, rep->offset, rep->target1, rep->target2);
continue;
default:
- dprintf_warn(fixup, "WARNING: %d: ADDR TYPE %d, "
+ WARN(fixup, "WARNING: %d: ADDR TYPE %d, "
"unknown TYPE %d, OFFSET %04x, TARGET %04x %04x\n",
i + 1, rep->address_type, rep->relocation_type,
rep->offset, rep->target1, rep->target2);
@@ -282,7 +281,7 @@
case NE_RADDR_LOWBYTE:
do {
sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset );
- dprintf_info(fixup," %04x:%04x:%04x BYTE%s\n",
+ TRACE(fixup," %04x:%04x:%04x BYTE%s\n",
pSeg->selector, offset, *sp, additive ? " additive":"");
offset = *sp;
if(additive)
@@ -296,7 +295,7 @@
case NE_RADDR_OFFSET16:
do {
sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset );
- dprintf_info(fixup," %04x:%04x:%04x OFFSET16%s\n",
+ TRACE(fixup," %04x:%04x:%04x OFFSET16%s\n",
pSeg->selector, offset, *sp, additive ? " additive" : "" );
offset = *sp;
*sp = LOWORD(address);
@@ -308,7 +307,7 @@
case NE_RADDR_POINTER32:
do {
sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset );
- dprintf_info(fixup," %04x:%04x:%04x POINTER32%s\n",
+ TRACE(fixup," %04x:%04x:%04x POINTER32%s\n",
pSeg->selector, offset, *sp, additive ? " additive" : "" );
offset = *sp;
*sp = LOWORD(address);
@@ -321,7 +320,7 @@
case NE_RADDR_SELECTOR:
do {
sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset );
- dprintf_info(fixup," %04x:%04x:%04x SELECTOR%s\n",
+ TRACE(fixup," %04x:%04x:%04x SELECTOR%s\n",
pSeg->selector, offset, *sp, additive ? " additive" : "" );
offset = *sp;
*sp = HIWORD(address);
@@ -334,10 +333,10 @@
break;
default:
- dprintf_warn(fixup, "WARNING: %d: unknown ADDR TYPE %d, "
- "TYPE %d, OFFSET %04x, TARGET %04x %04x\n",
- i + 1, rep->address_type, rep->relocation_type,
- rep->offset, rep->target1, rep->target2);
+ WARN(fixup, "WARNING: %d: unknown ADDR TYPE %d, "
+ "TYPE %d, OFFSET %04x, TARGET %04x %04x\n",
+ i + 1, rep->address_type, rep->relocation_type,
+ rep->offset, rep->target1, rep->target2);
free(reloc_entries);
return FALSE;
}
@@ -367,9 +366,9 @@
DWORD oldstack;
WORD saved_dgroup = pSegTable[pModule->dgroup - 1].selector;
- dprintf_info(module, "NE_LoadAllSegments: %.*s is a self-loading module!\n",
- *((BYTE*)pModule + pModule->name_table),
- (char *)pModule + pModule->name_table + 1);
+ TRACE(module, "%.*s is a self-loading module!\n",
+ *((BYTE*)pModule + pModule->name_table),
+ (char *)pModule + pModule->name_table + 1);
if (!NE_LoadSegment( pModule, 1 )) return FALSE;
selfloadheader = (SELFLOADHEADER *)
PTR_SEG_OFF_TO_LIN(pSegTable->selector, 0);
@@ -424,7 +423,7 @@
BYTE *pstr = (BYTE *)pModule + pModule->import_table + *pModRef;
memcpy( buffer, pstr + 1, *pstr );
strcpy( buffer + *pstr, ".dll" );
- dprintf_info(module, "Loading '%s'\n", buffer );
+ TRACE(module, "Loading '%s'\n", buffer );
if (!(*pModRef = MODULE_FindModule( buffer )))
{
/* If the DLL is not loaded yet, load it and store */
@@ -482,7 +481,7 @@
if (pModule->flags & NE_FFLAGS_SINGLEDATA)
dgroup = pSegTable[pModule->dgroup-1].selector;
- dprintf_info(module, "MODULE_FixupPrologs(%04x)\n", pModule->self );
+ TRACE(module, "(%04x)\n", pModule->self );
p = (BYTE *)pModule + pModule->entry_table;
while (*p)
{
@@ -517,7 +516,7 @@
fixup_ptr = (char *)GET_SEL_BASE(pSegTable[sel-1].selector) +
*(WORD *)(p + 1);
}
- dprintf_info(module, "%s Signature: %02x %02x %02x,ff %x\n",
+ TRACE(module, "%s Signature: %02x %02x %02x,ff %x\n",
dbg_str(module), fixup_ptr[0], fixup_ptr[1],
fixup_ptr[2], pModule->flags );
if (*p & 0x0001)
@@ -549,11 +548,11 @@
}
}
} else {
- dprintf_warn(fixup, "Unknown signature\n" );
+ WARN(fixup, "Unknown signature\n" );
}
}
else
- dprintf_info(module,"\n");
+ TRACE(module,"\n");
p += (sel == 0xff) ? 6 : 3;
}
}
@@ -635,7 +634,7 @@
pModule->cs = 0; /* Don't initialize it twice */
- dprintf_info(dll, "Calling LibMain, cs:ip=%04lx:%04x ds=%04lx di=%04x cx=%04x\n",
+ TRACE(dll, "Calling LibMain, cs:ip=%04lx:%04x ds=%04lx di=%04x cx=%04x\n",
CS_reg(&context), IP_reg(&context), DS_reg(&context),
DI_reg(&context), CX_reg(&context) );
Callbacks->CallRegisterShortProc( &context, 0 );
diff --git a/loader/ne_resource.c b/loader/ne_resource.c
index b091411..005f828 100644
--- a/loader/ne_resource.c
+++ b/loader/ne_resource.c
@@ -46,13 +46,13 @@
pNameInfo = (NE_NAMEINFO *)(pTypeInfo + 1);
for (count = pTypeInfo->count; count > 0; count--, pNameInfo++)
{
- dprintf_info(resource, "NameTable entry: type=%04x id=%04x\n",
+ TRACE(resource, "NameTable entry: type=%04x id=%04x\n",
pTypeInfo->type_id, pNameInfo->id );
handle = LoadResource16( pModule->self,
(HRSRC16)((int)pNameInfo - (int)pModule) );
for(p = (WORD*)LockResource16(handle); p && *p; p = (WORD *)((char*)p+*p))
{
- dprintf_info(resource," type=%04x '%s' id=%04x '%s'\n",
+ TRACE(resource," type=%04x '%s' id=%04x '%s'\n",
p[1], (char *)(p+3), p[2],
(char *)(p+3)+strlen((char *)(p+3))+1 );
/* Check for correct type */
@@ -80,7 +80,7 @@
/* If we get here, we've found the entry */
- dprintf_info(resource, " Found!\n" );
+ TRACE(resource, " Found!\n" );
ret = MAKELONG( p[1], p[2] );
break;
}
@@ -112,11 +112,11 @@
BYTE *p = (BYTE*)pModule + pModule->res_table + pTypeInfo->type_id;
if ((*p == len) && !lstrncmpi32A( p+1, str, len ))
{
- dprintf_info(resource, " Found type '%s'\n", str );
+ TRACE(resource, " Found type '%s'\n", str );
return pTypeInfo;
}
}
- dprintf_info(resource, " Skipping type %04x\n", pTypeInfo->type_id );
+ TRACE(resource, " Skipping type %04x\n", pTypeInfo->type_id );
pTypeInfo = NEXT_TYPEINFO(pTypeInfo);
}
}
@@ -127,10 +127,10 @@
{
if (pTypeInfo->type_id == id)
{
- dprintf_info(resource, " Found type %04x\n", id );
+ TRACE(resource, " Found type %04x\n", id );
return pTypeInfo;
}
- dprintf_info(resource, " Skipping type %04x\n", pTypeInfo->type_id );
+ TRACE(resource, " Skipping type %04x\n", pTypeInfo->type_id );
pTypeInfo = NEXT_TYPEINFO(pTypeInfo);
}
}
@@ -188,9 +188,9 @@
WORD sizeShift = *(WORD *)((char *)pModule + pModule->res_table);
NE_NAMEINFO* pNameInfo = (NE_NAMEINFO*)((char*)pModule + hRsrc);
- dprintf_info(resource, "NEResourceHandler: loading, pos=%d, len=%d\n",
- (int)pNameInfo->offset << sizeShift,
- (int)pNameInfo->length << sizeShift );
+ TRACE(resource, "loading, pos=%d, len=%d\n",
+ (int)pNameInfo->offset << sizeShift,
+ (int)pNameInfo->length << sizeShift );
if( hMemObj )
handle = GlobalReAlloc16( hMemObj, pNameInfo->length << sizeShift, 0 );
else
@@ -216,7 +216,7 @@
NE_MODULE *pModule = MODULE_GetPtr( hModule );
NE_TYPEINFO *pTypeInfo = (NE_TYPEINFO *)((char *)pModule + pModule->res_table + 2);
- dprintf_info(resource,"InitResourceHandler[%04x]\n", hModule );
+ TRACE(resource,"InitResourceHandler[%04x]\n", hModule );
while(pTypeInfo->type_id)
{
@@ -279,15 +279,15 @@
hRsrc = NE_FindResourceFromType(pModule, pTypeInfo, resId);
if( hRsrc )
{
- dprintf_info(resource, " Found id %08lx\n", resId );
+ TRACE(resource, " Found id %08lx\n", resId );
return hRsrc;
}
- dprintf_info(resource, " Not found, going on\n" );
+ TRACE(resource, " Not found, going on\n" );
pTypeInfo = NEXT_TYPEINFO(pTypeInfo);
}
} while( pTypeInfo );
- dprintf_warn(resource, "failed!\n");
+ WARN(resource, "failed!\n");
return 0;
}
@@ -388,7 +388,7 @@
&& !(GlobalFlags16(pNameInfo->handle) & GMEM_DISCARDED))
{
pNameInfo->usage++;
- dprintf_info(resource, " Already loaded, new count=%d\n",
+ TRACE(resource, " Already loaded, new count=%d\n",
pNameInfo->usage );
}
else
@@ -459,8 +459,8 @@
pTypeInfo = (NE_TYPEINFO *)pNameInfo;
}
- dprintf_info(resource, "NE_FreeResource[%04x]: no intrinsic resource for %04x\n",
- hModule, handle );
+ TRACE(resource, "[%04x]: no intrinsic resource for %04x\n",
+ hModule, handle );
GlobalFree16( handle ); /* it could have been DirectResAlloc()'ed */
return handle;
}
diff --git a/loader/pe_image.c b/loader/pe_image.c
index 842c7f7..e1923f1 100644
--- a/loader/pe_image.c
+++ b/loader/pe_image.c
@@ -74,20 +74,19 @@
IMAGE_EXPORT_DIRECTORY *pe_exports = (IMAGE_EXPORT_DIRECTORY*)RVA(rva_start);
Module = (char*)RVA(pe_exports->Name);
- dprintf_info(win32,"\n*******EXPORT DATA*******\nModule name is %s, %ld functions, %ld names\n",
- Module,
- pe_exports->NumberOfFunctions,
- pe_exports->NumberOfNames);
+ TRACE(win32,"*******EXPORT DATA*******\n");
+ TRACE(win32,"Module name is %s, %ld functions, %ld names\n",
+ Module, pe_exports->NumberOfFunctions, pe_exports->NumberOfNames);
ordinal=(u_short*) RVA(pe_exports->AddressOfNameOrdinals);
functions=function=(u_long*) RVA(pe_exports->AddressOfFunctions);
name=(u_char**) RVA(pe_exports->AddressOfNames);
- dprintf_info(win32," Ord RVA Addr Name\n" );
+ TRACE(win32," Ord RVA Addr Name\n" );
for (i=0;i<pe_exports->NumberOfFunctions;i++, function++)
{
if (!*function) continue; /* No such function */
- if (debugging_info(win32)){
+ if (TRACE_ON(win32)){
dbg_decl_str(win32, 1024);
dsprintf(win32,"%4ld %08lx %08x",
@@ -98,7 +97,7 @@
dsprintf(win32, " %s", (char*)RVA(name[j]) );
if ((*function >= rva_start) && (*function <= rva_end))
dsprintf(win32, " (forwarded -> %s)", (char *)RVA(*function));
- dprintf_info(win32,"%s\n", dbg_str(win32));
+ TRACE(win32,"%s\n", dbg_str(win32));
}
}
}
@@ -135,9 +134,9 @@
exports = pem->pe_export;
if (HIWORD(funcName))
- dprintf_info(win32,"PE_FindExportedFunction(%s)\n",funcName);
+ TRACE(win32,"(%s)\n",funcName);
else
- dprintf_info(win32,"PE_FindExportedFunction(%d)\n",(int)funcName);
+ TRACE(win32,"(%d)\n",(int)funcName);
if (!exports) {
fprintf(stderr,"Module %08x/MODREF %p doesn't have a exports table.\n",hModule,pem);
return NULL;
@@ -168,7 +167,7 @@
}
} else {
if (LOWORD(funcName)-exports->Base > exports->NumberOfFunctions) {
- dprintf_info(win32," ordinal %d out of range!\n",
+ TRACE(win32," ordinal %d out of range!\n",
LOWORD(funcName));
return NULL;
}
@@ -192,7 +191,7 @@
return NULL;
}
-DWORD fixup_imports (PDB32 *process,PE_MODREF *pem,HMODULE32 hModule)
+DWORD fixup_imports (PDB32 *process,PE_MODREF *pem)
{
IMAGE_IMPORT_DESCRIPTOR *pe_imp;
int fixup_failed = 0;
@@ -206,12 +205,12 @@
modname = "<unknown>";
/* OK, now dump the import list */
- dprintf_info(win32, "\nDumping imports list\n");
+ TRACE(win32, "Dumping imports list\n");
/* first, count the number of imported non-internal modules */
pe_imp = pem->pe_import;
if (!pe_imp)
- fprintf(stderr,"no import directory????\n");
+ ERR(win32, "no import directory????\n");
/* FIXME: should terminate on 0 Characteristics */
for (i = 0; pe_imp->Name; pe_imp++)
@@ -232,14 +231,18 @@
/* don't use MODULE_Load, Win32 creates new task differently */
res = PE_LoadLibraryEx32A( name, process, 0, 0 );
if (res <= (HMODULE32) 32) {
- char *p, buffer[1024];
+ char buffer[1024];
/* Try with prepending the path of the current module */
- GetModuleFileName32A( hModule, buffer, sizeof (buffer));
- if (!(p = strrchr (buffer, '\\')))
- p = buffer;
- strcpy (p + 1, name);
- res = PE_LoadLibraryEx32A( buffer, process, 0, 0 );
+ if (GetModuleFileName32A( pem->module, buffer, sizeof (buffer))) {
+ char *p;
+
+ if (!(p = strrchr (buffer, '\\')))
+ p = buffer;
+ strcpy (p + 1, name);
+ res = PE_LoadLibraryEx32A( buffer, process, 0, 0 );
+ } else
+ ERR(win32,"cannot find the module just loaded!\n");
}
if (res <= (HMODULE32) 32) {
fprintf (stderr, "Module %s not found\n", name);
@@ -285,12 +288,12 @@
Module = (char *) RVA(pe_imp->Name);
hImpModule = MODULE_HANDLEtoHMODULE32( MODULE_FindModule(Module) );
- dprintf_info(win32, "%s\n", Module);
+ TRACE(win32, "%s\n", Module);
/* FIXME: forwarder entries ... */
if (pe_imp->u.OriginalFirstThunk != 0) { /* original MS style */
- dprintf_info(win32, "Microsoft style imports used\n");
+ TRACE(win32, "Microsoft style imports used\n");
import_list =(LPIMAGE_THUNK_DATA) RVA(pe_imp->u.OriginalFirstThunk);
thunk_list = (LPIMAGE_THUNK_DATA) RVA(pe_imp->FirstThunk);
@@ -298,7 +301,7 @@
if (IMAGE_SNAP_BY_ORDINAL(import_list->u1.Ordinal)) {
int ordinal = IMAGE_ORDINAL(import_list->u1.Ordinal);
- dprintf_info(win32, "--- Ordinal %s,%d\n", Module, ordinal);
+ TRACE(win32, "--- Ordinal %s,%d\n", Module, ordinal);
thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction(
process, hImpModule, (LPCSTR)ordinal);
if (!thunk_list->u1.Function) {
@@ -308,7 +311,7 @@
}
} else { /* import by name */
pe_name = (LPIMAGE_IMPORT_BY_NAME)RVA(import_list->u1.AddressOfData);
- dprintf_info(win32, "--- %s %s.%d\n", pe_name->Name, Module, pe_name->Hint);
+ TRACE(win32, "--- %s %s.%d\n", pe_name->Name, Module, pe_name->Hint);
thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction(
process, hImpModule, pe_name->Name);
if (!thunk_list->u1.Function) {
@@ -321,14 +324,14 @@
thunk_list++;
}
} else { /* Borland style */
- dprintf_info(win32, "Borland style imports used\n");
+ TRACE(win32, "Borland style imports used\n");
thunk_list = (LPIMAGE_THUNK_DATA) RVA(pe_imp->FirstThunk);
while (thunk_list->u1.Ordinal) {
if (IMAGE_SNAP_BY_ORDINAL(thunk_list->u1.Ordinal)) {
/* not sure about this branch, but it seems to work */
int ordinal = IMAGE_ORDINAL(thunk_list->u1.Ordinal);
- dprintf_info(win32,"--- Ordinal %s.%d\n",Module,ordinal);
+ TRACE(win32,"--- Ordinal %s.%d\n",Module,ordinal);
thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction(
process, hImpModule, (LPCSTR) ordinal);
if (!thunk_list->u1.Function) {
@@ -338,7 +341,7 @@
}
} else {
pe_name=(LPIMAGE_IMPORT_BY_NAME) RVA(thunk_list->u1.AddressOfData);
- dprintf_info(win32,"--- %s %s.%d\n",
+ TRACE(win32,"--- %s %s.%d\n",
pe_name->Name,Module,pe_name->Hint);
thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction(
process, hImpModule, pe_name->Name );
@@ -362,11 +365,11 @@
int i,vma_size = 0;
IMAGE_SECTION_HEADER *pe_seg = PE_SECTIONS(hModule);
- dprintf_info(win32, "Dump of segment table\n");
- dprintf_info(win32, " Name VSz Vaddr SzRaw Fileadr *Reloc *Lineum #Reloc #Linum Char\n");
+ TRACE(win32, "Dump of segment table\n");
+ TRACE(win32, " Name VSz Vaddr SzRaw Fileadr *Reloc *Lineum #Reloc #Linum Char\n");
for (i = 0; i< PE_HEADER(hModule)->FileHeader.NumberOfSections; i++)
{
- dprintf_info(win32, "%8s: %4.4lx %8.8lx %8.8lx %8.8lx %8.8lx %8.8lx %4.4x %4.4x %8.8lx\n",
+ TRACE(win32, "%8s: %4.4lx %8.8lx %8.8lx %8.8lx %8.8lx %8.8lx %4.4x %4.4x %8.8lx\n",
pe_seg->Name,
pe_seg->Misc.VirtualSize,
pe_seg->VirtualAddress,
@@ -401,14 +404,14 @@
char *page = (char*) RVA(r->VirtualAddress);
int count = (r->SizeOfBlock - 8)/2;
int i;
- dprintf_info(fixup, "%x relocations for page %lx\n",
+ TRACE(fixup, "%x relocations for page %lx\n",
count, r->VirtualAddress);
/* patching in reverse order */
for(i=0;i<count;i++)
{
int offset = r->TypeOffset[i] & 0xFFF;
int type = r->TypeOffset[i] >> 12;
- dprintf_info(fixup,"patching %x type %x\n", offset, type);
+ TRACE(fixup,"patching %x type %x\n", offset, type);
switch(type)
{
case IMAGE_REL_BASED_ABSOLUTE: break;
@@ -545,7 +548,7 @@
load_addr = nt_header->OptionalHeader.ImageBase;
vma_size = calc_vma_size( hModule );
- dprintf_info(win32, "Load addr is %lx\n",load_addr);
+ TRACE(win32, "Load addr is %lx\n",load_addr);
load_addr = (DWORD)VirtualAlloc( (void*)load_addr, vma_size,
MEM_RESERVE | MEM_COMMIT,
PAGE_EXECUTE_READWRITE );
@@ -559,7 +562,7 @@
*/
pem->module = *phModule = (HMODULE32)load_addr;
- dprintf_info(win32, "Load addr is really %lx, range %x\n",
+ TRACE(win32, "Load addr is really %lx, range %x\n",
load_addr, vma_size);
/* Store the NT header at the load addr
@@ -635,10 +638,10 @@
}
if(nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].Size)
- dprintf_fixme(win32,"Exception directory ignored\n");
+ FIXME(win32,"Exception directory ignored\n");
if(nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY].Size)
- dprintf_fixme(win32,"Security directory ignored\n");
+ FIXME(win32,"Security directory ignored\n");
@@ -652,34 +655,34 @@
if(nt_header->OptionalHeader.DataDirectory
[IMAGE_DIRECTORY_ENTRY_COPYRIGHT].Size)
- dprintf_fixme(win32,"Copyright string ignored\n");
+ FIXME(win32,"Copyright string ignored\n");
if(nt_header->OptionalHeader.DataDirectory
[IMAGE_DIRECTORY_ENTRY_GLOBALPTR].Size)
- dprintf_fixme(win32,"Global Pointer (MIPS) ignored\n");
+ FIXME(win32,"Global Pointer (MIPS) ignored\n");
if(nt_header->OptionalHeader.DataDirectory
[IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG].Size)
- dprintf_fixme(win32,"Load Configuration directory ignored\n");
+ FIXME(win32,"Load Configuration directory ignored\n");
if(nt_header->OptionalHeader.DataDirectory
[IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT].Size)
- dprintf_fixme(win32,"Bound Import directory ignored\n");
+ FIXME(win32,"Bound Import directory ignored\n");
if(nt_header->OptionalHeader.DataDirectory
[IMAGE_DIRECTORY_ENTRY_IAT].Size)
- dprintf_fixme(win32,"Import Address Table directory ignored\n");
+ FIXME(win32,"Import Address Table directory ignored\n");
if(nt_header->OptionalHeader.DataDirectory[13].Size)
- dprintf_fixme(win32,"Unknown directory 13 ignored\n");
+ FIXME(win32,"Unknown directory 13 ignored\n");
if(nt_header->OptionalHeader.DataDirectory[14].Size)
- dprintf_fixme(win32,"Unknown directory 14 ignored\n");
+ FIXME(win32,"Unknown directory 14 ignored\n");
if(nt_header->OptionalHeader.DataDirectory[15].Size)
- dprintf_fixme(win32,"Unknown directory 15 ignored\n");
+ FIXME(win32,"Unknown directory 15 ignored\n");
if(pem->pe_reloc) do_relocations(pem);
if(pem->pe_export) dump_exports(pem->module);
if(pem->pe_import) {
- if (fixup_imports(process,pem,hModule)) {
+ if (fixup_imports(process,pem)) {
PE_MODREF **xpem;
/* remove entry from modref chain */
@@ -869,7 +872,7 @@
) {
FARPROC32 entry = (FARPROC32)RVA_PTR( pem->module,
OptionalHeader.AddressOfEntryPoint );
- dprintf_info(relay, "CallTo32(entryproc=%p,module=%08x,type=%ld,res=%p)\n",
+ TRACE(relay, "CallTo32(entryproc=%p,module=%08x,type=%ld,res=%p)\n",
entry, pem->module, type, lpReserved );
entry( pem->module, type, lpReserved );
}
diff --git a/loader/resource.c b/loader/resource.c
index 8d7ad81..3219d78 100644
--- a/loader/resource.c
+++ b/loader/resource.c
@@ -45,7 +45,7 @@
char *ptr = PTR_SEG_TO_LIN( name );
if (ptr[0] == '#')
if (!(name = (SEGPTR)atoi( ptr + 1 ))) {
- dprintf_warn(resource, "Incorrect resource name: %s\n", ptr);
+ WARN(resource, "Incorrect resource name: %s\n", ptr);
return 0;
}
}
@@ -55,12 +55,12 @@
char *ptr = PTR_SEG_TO_LIN( type );
if (ptr[0] == '#')
if (!(type = (SEGPTR)atoi( ptr + 1 ))){
- dprintf_warn(resource, "Incorrect resource type: %s\n", ptr);
+ WARN(resource, "Incorrect resource type: %s\n", ptr);
return 0;
}
}
- dprintf_info(resource, "FindResource16: module=%04x name=%s type=%s\n",
+ TRACE(resource, "module=%04x name=%s type=%s\n",
hModule, debugres(PTR_SEG_TO_LIN(name)),
debugres(PTR_SEG_TO_LIN(type)) );
@@ -125,7 +125,7 @@
if (!hModule) hModule = GetTaskDS();
hModule = MODULE_HANDLEtoHMODULE32( hModule );
- dprintf_info(resource, "FindResource32W: module=%08x "
+ TRACE(resource, "module=%08x "
"type=%s%p name=%s%p\n", hModule,
(HIWORD(type))? "" : "#", type,
(HIWORD(name))? "" : "#", name);
@@ -154,7 +154,7 @@
NE_MODULE *pModule;
hModule = MODULE_HANDLEtoHMODULE16( hModule );
- dprintf_info(resource, "LoadResource16: module=%04x res=%04x\n",
+ TRACE(resource, "module=%04x res=%04x\n",
hModule, hRsrc );
if (!hRsrc) return 0;
if ((pModule = MODULE_GetPtr( hModule )))
@@ -182,7 +182,7 @@
if (!hModule) hModule = GetTaskDS(); /* FIXME: see FindResource32W */
hModule = MODULE_HANDLEtoHMODULE32( hModule );
- dprintf_info(resource, "LoadResource32: module=%04x res=%04x\n",
+ TRACE(resource, "module=%04x res=%04x\n",
hModule, hRsrc );
if (!hRsrc) return 0;
@@ -207,7 +207,7 @@
HMODULE16 hModule;
NE_MODULE *pModule;
- dprintf_info(resource, "LockResource: handle=%04x\n", handle );
+ TRACE(resource, "handle=%04x\n", handle );
if (!handle) return (SEGPTR)0;
hModule = MODULE_HANDLEtoHMODULE16( handle );
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
@@ -227,7 +227,7 @@
HMODULE16 hModule;
NE_MODULE *pModule;
- dprintf_info(resource, "LockResource: handle=%04x\n", handle );
+ TRACE(resource, "handle=%04x\n", handle );
if (!handle) return NULL;
hModule = MODULE_HANDLEtoHMODULE16( handle );
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
@@ -261,7 +261,7 @@
HMODULE16 hModule;
NE_MODULE *pModule;
- dprintf_info(resource, "FreeResource16: handle=%04x\n", handle );
+ TRACE(resource, "handle=%04x\n", handle );
if (!handle) return FALSE;
hModule = MODULE_HANDLEtoHMODULE16( handle );
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
@@ -293,7 +293,7 @@
NE_MODULE *pModule;
hModule = MODULE_HANDLEtoHMODULE16( hModule );
- dprintf_info(resource, "AccessResource16: module=%04x res=%04x\n",
+ TRACE(resource, "module=%04x res=%04x\n",
hModule, hRsrc );
if (!hRsrc) return 0;
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
@@ -316,7 +316,7 @@
INT32 WINAPI AccessResource32( HINSTANCE32 hModule, HRSRC32 hRsrc )
{
hModule = MODULE_HANDLEtoHMODULE32( hModule );
- dprintf_info(resource, "AccessResource: module=%04x res=%04x\n",
+ TRACE(resource, "module=%04x res=%04x\n",
hModule, hRsrc );
if (!hRsrc) return 0;
fprintf(stderr,"AccessResource32: not implemented\n");
@@ -332,7 +332,7 @@
NE_MODULE *pModule;
hModule = MODULE_HANDLEtoHMODULE16( hModule );
- dprintf_info(resource, "SizeofResource16: module=%04x res=%04x\n",
+ TRACE(resource, "module=%04x res=%04x\n",
hModule, hRsrc );
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
if (!__winelib)
@@ -354,7 +354,7 @@
DWORD WINAPI SizeofResource32( HINSTANCE32 hModule, HRSRC32 hRsrc )
{
hModule = MODULE_HANDLEtoHMODULE32( hModule );
- dprintf_info(resource, "SizeofResource32: module=%04x res=%04x\n",
+ TRACE(resource, "module=%04x res=%04x\n",
hModule, hRsrc );
if (!__winelib) return PE_SizeofResource32(hModule,hRsrc);
else
@@ -373,7 +373,7 @@
NE_MODULE *pModule;
hModule = MODULE_HANDLEtoHMODULE16( hModule );
- dprintf_info(resource, "AllocResource: module=%04x res=%04x size=%ld\n",
+ TRACE(resource, "module=%04x res=%04x size=%ld\n",
hModule, hRsrc, size );
if (!hRsrc) return 0;
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
@@ -397,7 +397,7 @@
HGLOBAL16 WINAPI DirectResAlloc( HINSTANCE16 hInstance, WORD wType,
UINT16 wSize )
{
- dprintf_info(resource,"DirectResAlloc(%04x,%04x,%04x)\n",
+ TRACE(resource,"(%04x,%04x,%04x)\n",
hInstance, wType, wSize );
hInstance = MODULE_HANDLEtoHMODULE16(hInstance);
if(!hInstance)return 0;
@@ -416,10 +416,10 @@
HRSRC16 hRsrc;
if (HIWORD(lpTableName))
- dprintf_info(accel, "LoadAccelerators: %04x '%s'\n",
+ TRACE(accel, "%04x '%s'\n",
instance, (char *)PTR_SEG_TO_LIN( lpTableName ) );
else
- dprintf_info(accel, "LoadAccelerators: %04x %04x\n",
+ TRACE(accel, "%04x %04x\n",
instance, LOWORD(lpTableName) );
if (!(hRsrc = FindResource16( instance, lpTableName, RT_ACCELERATOR )))
@@ -441,10 +441,10 @@
HRSRC32 hRsrc;
if (HIWORD(lpTableName))
- dprintf_info(accel, "LoadAccelerators: %04x '%s'\n",
+ TRACE(accel, "%04x '%s'\n",
instance, (char *)( lpTableName ) );
else
- dprintf_info(accel, "LoadAccelerators: %04x %04x\n",
+ TRACE(accel, "%04x %04x\n",
instance, LOWORD(lpTableName) );
if (!(hRsrc = FindResource32W( instance, lpTableName,
@@ -505,7 +505,7 @@
int string_num;
int i;
- dprintf_info(resource,"LoadString: inst=%04x id=%04x buff=%08x len=%d\n",
+ TRACE(resource,"inst=%04x id=%04x buff=%08x len=%d\n",
instance, resource_id, (int) buffer, buflen);
hrsrc = FindResource16( instance, (SEGPTR)((resource_id>>4)+1), RT_STRING );
@@ -518,7 +518,7 @@
for (i = 0; i < string_num; i++)
p += *p + 1;
- dprintf_info(resource, "strlen = %d\n", (int)*p );
+ TRACE(resource, "strlen = %d\n", (int)*p );
i = MIN(buflen - 1, *p);
if (buffer == NULL)
@@ -536,7 +536,7 @@
}
FreeResource16( hmem );
- dprintf_info(resource,"LoadString // '%s' copied !\n", buffer);
+ TRACE(resource,"'%s' copied !\n", buffer);
return i;
}
@@ -554,7 +554,7 @@
if (HIWORD(resource_id)==0xFFFF) /* netscape 3 passes this */
resource_id = (UINT32)(-((INT32)resource_id));
- dprintf_info(resource, "LoadString: instance = %04x, id = %04x, buffer = %08x, "
+ TRACE(resource, "instance = %04x, id = %04x, buffer = %08x, "
"length = %d\n", instance, (int)resource_id, (int) buffer, buflen);
hrsrc = FindResource32W( instance, (LPCWSTR)((resource_id>>4)+1),
@@ -568,7 +568,7 @@
for (i = 0; i < string_num; i++)
p += *p + 1;
- dprintf_info(resource, "strlen = %d\n", (int)*p );
+ TRACE(resource, "strlen = %d\n", (int)*p );
i = MIN(buflen - 1, *p);
if (buffer == NULL)
@@ -587,7 +587,7 @@
#endif
}
#if 0
- dprintf_info(resource,"LoadString // '%s' copied !\n", buffer);
+ TRACE(resource,"'%s' copied !\n", buffer);
#endif
return i;
}
@@ -658,7 +658,7 @@
CHAR str[1];
} *stre;
- dprintf_info(resource, "LoadMessage: instance = %08lx, id = %08lx, buffer = %p, length = %ld\n", (DWORD)instance, (DWORD)id, buffer, (DWORD)buflen);
+ TRACE(resource, "instance = %08lx, id = %08lx, buffer = %p, length = %ld\n", (DWORD)instance, (DWORD)id, buffer, (DWORD)buflen);
/*FIXME: I am not sure about the '1' ... But I've only seen those entries*/
hrsrc = FindResourceEx32W(instance,(LPWSTR)1,(LPCWSTR)RT_MESSAGELIST,lang);
@@ -686,7 +686,7 @@
stre = (struct _stringentry*)(((char*)stre)+slen);
}
slen=stre->len;
- dprintf_info(resource," - strlen=%d\n",slen);
+ TRACE(resource," - strlen=%d\n",slen);
i = MIN(buflen - 1, slen);
if (buffer == NULL)
return slen; /* different to LoadString */
@@ -700,7 +700,7 @@
}
}
if (buffer)
- dprintf_info(resource,"LoadMessage // '%s' copied !\n", buffer);
+ TRACE(resource,"'%s' copied !\n", buffer);
return i;
}
@@ -737,7 +737,7 @@
hModule = GetExePtr( hModule );
- dprintf_info(resource, "SetResourceHandler: module=%04x type=%s\n",
+ TRACE(resource, "module=%04x type=%s\n",
hModule, debugres(PTR_SEG_TO_LIN(s)) );
if ((pModule = MODULE_GetPtr( hModule )))
diff --git a/loader/signal.c b/loader/signal.c
index 0092b22..ef850ad 100644
--- a/loader/signal.c
+++ b/loader/signal.c
@@ -26,6 +26,8 @@
#endif
#include "miscemu.h"
+#include "selectors.h"
+#include "sig_context.h"
#include "winsock.h"
@@ -83,8 +85,9 @@
*
* wait4 terminated child processes
*/
-static void SIGNAL_child(void)
+static HANDLER_DEF(SIGNAL_child)
{
+ HANDLER_INIT();
#ifdef HAVE_WAIT4
wait4( 0, NULL, WNOHANG, NULL);
#elif defined (HAVE_WAITPID)
diff --git a/loader/task.c b/loader/task.c
index ce56b0a..bda4626 100644
--- a/loader/task.c
+++ b/loader/task.c
@@ -176,9 +176,9 @@
/* Display it */
p = (char *) GlobalLock16( handle );
- dprintf_info(task, "Master DOS environment at %p\n", p);
- for (; *p; p += strlen(p) + 1) dprintf_info(task, " %s\n", p);
- dprintf_info(task, "Progname: %s\n", p+3 );
+ TRACE(task, "Master DOS environment at %p\n", p);
+ for (; *p; p += strlen(p) + 1) TRACE(task, " %s\n", p);
+ TRACE(task, "Progname: %s\n", p+3 );
return handle;
}
@@ -347,7 +347,7 @@
InitApp( pTask->hModule );
PE_InitializeDLLs( PROCESS_Current(), DLL_PROCESS_ATTACH, (LPVOID)-1 );
- dprintf_info(relay, "CallTo32(entryproc=%p)\n", entry );
+ TRACE(relay, "(entryproc=%p)\n", entry );
exit_code = entry();
TASK_KillCurrentTask( exit_code );
}
@@ -376,7 +376,7 @@
ECX_reg(&context) = pModule->heap_size;
EDI_reg(&context) = context.SegDs;
- dprintf_info(task, "Starting main program: cs:ip=%04lx:%04x ds=%04lx ss:sp=%04x:%04x\n",
+ TRACE(task, "Starting main program: cs:ip=%04lx:%04x ds=%04lx ss:sp=%04x:%04x\n",
CS_reg(&context), IP_reg(&context), DS_reg(&context),
SELECTOROF(pTask->thdb->cur_stack),
OFFSETOF(pTask->thdb->cur_stack) );
@@ -563,7 +563,7 @@
TASK_LinkTask( hTask );
- dprintf_info(task, "CreateTask: module='%s' cmdline='%s' task=%04x\n",
+ TRACE(task, "module='%s' cmdline='%s' task=%04x\n",
name, cmdLine, hTask );
return hTask;
@@ -621,7 +621,7 @@
TDB* pTask = (TDB*) GlobalLock16( hCurrentTask );
if (!pTask) USER_ExitWindows(); /* No current task yet */
- dprintf_info(task, "Killing task %04x\n", hCurrentTask );
+ TRACE(task, "Killing task %04x\n", hCurrentTask );
/* Delete active sockets */
@@ -643,7 +643,7 @@
if (nTaskCount <= 1)
{
- dprintf_info(task, "\nthis is the last task, exiting\n" );
+ TRACE(task, "this is the last task, exiting\n" );
USER_ExitWindows();
}
@@ -724,7 +724,7 @@
{
pNewTask = (TDB *)GlobalLock16( hTask );
- dprintf_info(task, "\ttask = %04x, events = %i\n", hTask, pNewTask->nEvents);
+ TRACE(task, "\ttask = %04x, events = %i\n", hTask, pNewTask->nEvents);
if (pNewTask->nEvents) break;
hTask = pNewTask->hNext;
@@ -739,11 +739,11 @@
if (hTask == hCurrentTask)
{
- dprintf_info(task, "returning to the current task(%04x)\n", hTask );
+ TRACE(task, "returning to the current task(%04x)\n", hTask );
return; /* Nothing to do */
}
pNewTask = (TDB *)GlobalLock16( hTask );
- dprintf_info(task, "Switching to task %04x (%.8s)\n",
+ TRACE(task, "Switching to task %04x (%.8s)\n",
hTask, pNewTask->module_name );
/* Make the task the last in the linked list (round-robin scheduling) */
@@ -1012,7 +1012,7 @@
thunk = PTR_SEG_TO_LIN( thunkaddr );
lfunc = PTR_SEG_TO_LIN( func );
- dprintf_info(task, "MakeProcInstance(%08lx,%04x): got thunk %08lx\n",
+ TRACE(task, "(%08lx,%04x): got thunk %08lx\n",
(DWORD)func, hInstance, (DWORD)thunkaddr );
if (((lfunc[0]==0x8c) && (lfunc[1]==0xd8)) ||
((lfunc[0]==0x1e) && (lfunc[1]==0x58))
@@ -1036,7 +1036,7 @@
*/
void WINAPI FreeProcInstance16( FARPROC16 func )
{
- dprintf_info(task, "FreeProcInstance(%08lx)\n", (DWORD)func );
+ TRACE(task, "(%08lx)\n", (DWORD)func );
if (!__winelib) TASK_FreeThunk( hCurrentTask, (SEGPTR)func );
}
@@ -1118,7 +1118,7 @@
if (!(pTask = (TDB *)GlobalLock16( hCurrentTask ))) return;
if (!(pData = (INSTANCEDATA *)GlobalLock16( seg ))) return;
- dprintf_info(task, "SwitchStackTo: old=%04x:%04x new=%04x:%04x\n",
+ TRACE(task, "old=%04x:%04x new=%04x:%04x\n",
SELECTOROF( pTask->thdb->cur_stack ),
OFFSETOF( pTask->thdb->cur_stack ), seg, ptr );
@@ -1167,8 +1167,8 @@
fprintf( stderr, "SwitchStackBack: no previous SwitchStackTo\n" );
return;
}
- dprintf_info(task, "SwitchStackBack: restoring stack %04x:%04x\n",
- SELECTOROF(pData->old_ss_sp), OFFSETOF(pData->old_ss_sp) );
+ TRACE(task, "restoring stack %04x:%04x\n",
+ SELECTOROF(pData->old_ss_sp), OFFSETOF(pData->old_ss_sp) );
oldFrame = (STACK16FRAME *)PTR_SEG_TO_LIN( pTask->thdb->cur_stack );
@@ -1181,7 +1181,7 @@
newFrame = (STACK16FRAME *)PTR_SEG_TO_LIN( pTask->thdb->cur_stack );
newFrame->frame32 = oldFrame->frame32;
- if (debugging_info(relay))
+ if (TRACE_ON(relay))
{
newFrame->entry_ip = oldFrame->entry_ip;
newFrame->entry_cs = oldFrame->entry_cs;
@@ -1446,7 +1446,7 @@
TDB *pTask;
INSTANCEDATA *pInstData;
- dprintf_info(toolhelp, "TaskNext(%p): task=%04x\n", lpte, lpte->hNext );
+ TRACE(toolhelp, "(%p): task=%04x\n", lpte, lpte->hNext );
if (!lpte->hNext) return FALSE;
pTask = (TDB *)GlobalLock16( lpte->hNext );
if (!pTask || pTask->magic != TDB_MAGIC) return FALSE;