Release 980301
Sun Mar 1 10:45:23 1998 Andreas Mohr <100.30936@germany.net>
* [loader/ne_image.c]
Fixed problem with weird DLLs (NE_FFLAGS_SINGLEDATA && DGROUP = 0).
* [msdos/dosmem.c]
Export address for __0000H, too.
* [msdos/dpmi.c]
Changed MemAlloc functions to return less fragmented addresses.
Sat Feb 28 18:50:12 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [scheduler/process.c] [scheduler/sysdeps.c]
Don't use %fs register before threading initialization.
Sat Feb 28 14:04:56 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [configure.in] [include/acconfig.h]
Autoconf macro to check for non-reentrant X libraries.
* [windows/winpos.c]
In SetWindowPos32(), do not cause WM_SIZE messages when the
SWP_NOSIZE flag is specified. This fixes the division-by-zero in
Borland C++ 4.0 "Open Project" menu item.
Sat Feb 28 13:11:26 1998 James Moody <013263m@dragon.acadiau.ca>
* [ole/ole2nls.c]
Changed "English" values from German to English.
* [files/dos_fs.c]
Fixed off-by-one month bug.
Fri Feb 27 22:12:01 1998 Douglas Ridgway <ridgway@winehq.com>
* [windows/win.c]
Fix winelib class menu loading bug.
* [include/module.h] [loader/module.c]
LoadModule32 should be implemented in terms of CreateProcess.
* [programs/view/*]
Metafile viewer sample program.
* [documentation/wine.texinfo] [documentation/Makefile.in]
Improvements and additions, HTML target.
Fri Feb 27 04:27:48 1998 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [*/*]
Switched to the new debug messages interface. For more information
please refer to documentation/debug-msgs. Because the new scheme
introduces a new semantic level, I had to manually do through
about 530 dprintf_xxx! The rest of about 2400 where transformed
via a script. Because of the large number of changes that I had
to do, some may have not come out as nicely as I wanted them. If
this is the case, please let me know. There is a lot of work left
to do: -- a few hundred printf's to be converted -- about 2300
fprintf's to be converted -- about 600 FIXME's to be transformed
The problem is that in the above mentioned cases, a lot of manual
intervention is required because a lot of the information is
missing. There are also a lot of other things to be done to the
interface and so forth. I have now ideas for a at least a month
worth of full time work :) I will proceed with many changes in the
next few releases, so please do not start modifing things because
there will be a hell of a lot of conflicts. If you have ideas that
you want to integrate or you want to work on different things,
please coordinate with me.
Thu Feb 26 13:04:29 1998 David Lee Lambert <lamber45@egr.msu.edu>
* [ole/ole2nls.c] [include/windows.h]
First try at OLE date- and time-formatting functions.
Wed Feb 25 11:20:35 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/*.c]
Changed dos device handling, added 'CON' devicehandling.
* [graphics/ddraw.c]
Bug fixes, some additions.
* [if1632/builtin.c][loader/module.c][library/winestub.c]
Small hack so we don't need a dummy BUILTIN_LoadModule
in winestub.c.
* [ole/*][relay32/ole32.spec][if1632/storage.spec]
storage.dll started. winword loads documents (saving
doesn't work yet, dunno why).
Several ole additions, some cleanups and bugfixes.
IMalloc16 implemented.
* [loader/pe_image.c]
Added some comments, fixed circular dll references,
fixed modref ordering, fixed tls allocation.
* [memory/global.c]
Added validity checks before every GET_ARENA_PTR.
(several functions rely on Global* return values
on invalid handles, like IsTask).
Implemented GlobalUnlockFree16.
* [memory/virtual.c]
Replaced dprintf_virtual by fprintf, so we can
do 'info map' again in the debugger. Increase read
linesize for Linux2.1 cases.
* [misc/cpu.c][misc/registry.c]
Moved cpu registry initialization to misc/cpu.c.
* [multimedia/dsound.c]
Enhanced, replaced GETOSPACE bufferingcheck by SETFRAGMENT.
* [relay32/crtdll.spec][relay32/ntdll.spec]
Replaced some ptr by respective 'str' and 'wstr' arguments
for libc functions.
* [scheduler/thread.c]
Added some sanity checks to stackallocation, tlshandling fixed.
* [tools/build.c]
Fixed cdecl argumenttype order (was reversed).
* [win32/ordinals.c]
Implemented KERNEL_449.
* [windows/dinput.c]
Some fixes, needs much more work. Tomb Raider2 works with keyboard ;)
Tue Feb 24 20:46:37 1998 James Juran <jrj120@psu.edu>
* [windows/win.c]
Fixed USER32 ordinal numbers in documentation.
Sat Feb 21 12:30:38 1998 John Richardson <jrichard@zko.dec.com>
* [files/file.c] [include/k32obj.h] [memory/virtual.c]
[scheduler/critsection.c] [scheduler/event.c] [scheduler/handle.c]
[scheduler/k32obj.c] [scheduler/mutex.c] [scheduler/process.c]
[scheduler/semaphore.c] [scheduler/thread.c]
Added generic k32obj read and write routines for k32objs that
support I/O.
* [documentation/console]
Updated console docs.
* [win32/console.c]
Make console work like a k32obj that supports I/O.
* [include/windows.h]
Make WriteFile and ReadFile take HANDLE32 for handle.
Sun Feb 15 14:07:07 1998 Dimitrie O. Paun <dimi@mail.cs.toronto.edu>
* [controls/menu.c] [misc/ver.c] [multimedia/dsound.c]
[multimedia/joystick.c] [windows/dialog.c]
Modified some dprintf_xxx's to prepare them for a new
dprintf_ scheme. Basically, I changed the dprintf's that
outputed a line with many dprintf calls to do just one
dprintf call.
diff --git a/misc/aspi.c b/misc/aspi.c
index 993cd4a..363c424 100644
--- a/misc/aspi.c
+++ b/misc/aspi.c
@@ -13,7 +13,7 @@
#include "options.h"
#include "heap.h"
#include "debug.h"
-#include "stddebug.h"
+
/* FIXME!
* 1) Residual byte length reporting not handled
@@ -122,16 +122,16 @@
sprintf(idstr, "scsi c%1dt%1dd%1d", prb->SRB_HaId, prb->SRB_Target, prb->SRB_Lun);
if (!PROFILE_GetWineIniString(idstr, "Device", "", device_str, sizeof(device_str))) {
- dprintf_aspi(stddeb, "Trying to open unlisted scsi device %s\n", idstr);
+ dprintf_info(aspi, "Trying to open unlisted scsi device %s\n", idstr);
return -1;
}
- dprintf_aspi(stddeb, "Opening device %s=%s\n", idstr, device_str);
+ dprintf_info(aspi, "Opening device %s=%s\n", idstr, device_str);
fd = open(device_str, O_RDWR);
if (fd == -1) {
int save_error = errno;
- dprintf_aspi(stddeb, "Error opening device errno=%d\n", save_error);
+ dprintf_warn(aspi, "Error opening device errno=%d\n", save_error);
return -1;
}
@@ -156,59 +156,58 @@
int i;
BYTE *cdb;
BYTE *lpBuf;
+ dbg_decl_str(aspi, 512);
lpBuf = PTR_SEG_TO_LIN(prb->SRB_BufPointer);
switch (prb->CDBByte[0]) {
case CMD_INQUIRY:
- dprintf_aspi(stddeb, "{\n");
- dprintf_aspi(stddeb, "\tEVPD: %d\n", prb->CDBByte[1] & 1);
- dprintf_aspi(stddeb, "\tLUN: %d\n", (prb->CDBByte[1] & 0xc) >> 1);
- dprintf_aspi(stddeb, "\tPAGE CODE: %d\n", prb->CDBByte[2]);
- dprintf_aspi(stddeb, "\tALLOCATION LENGTH: %d\n", prb->CDBByte[4]);
- dprintf_aspi(stddeb, "\tCONTROL: %d\n", prb->CDBByte[5]);
- dprintf_aspi(stddeb, "}\n");
+ dprintf_info(aspi, "{\n");
+ dprintf_info(aspi, "\tEVPD: %d\n", prb->CDBByte[1] & 1);
+ dprintf_info(aspi, "\tLUN: %d\n", (prb->CDBByte[1] & 0xc) >> 1);
+ dprintf_info(aspi, "\tPAGE CODE: %d\n", prb->CDBByte[2]);
+ dprintf_info(aspi, "\tALLOCATION LENGTH: %d\n", prb->CDBByte[4]);
+ dprintf_info(aspi, "\tCONTROL: %d\n", prb->CDBByte[5]);
+ dprintf_info(aspi, "}\n");
break;
case CMD_SCAN_SCAN:
- dprintf_aspi(stddeb, "Transfer Length: %d\n", prb->CDBByte[4]);
+ dprintf_info(aspi, "Transfer Length: %d\n", prb->CDBByte[4]);
break;
}
- dprintf_aspi(stddeb, "Host Adapter: %d\n", prb->SRB_HaId);
- dprintf_aspi(stddeb, "Flags: %d\n", prb->SRB_Flags);
+ dprintf_info(aspi, "Host Adapter: %d\n", prb->SRB_HaId);
+ dprintf_info(aspi, "Flags: %d\n", prb->SRB_Flags);
if (TARGET_TO_HOST(prb)) {
- dprintf_aspi(stddeb, "\tData transfer: Target to host. Length checked.\n");
+ dprintf_info(aspi, "\tData transfer: Target to host. Length checked.\n");
}
else if (HOST_TO_TARGET(prb)) {
- dprintf_aspi(stddeb, "\tData transfer: Host to target. Length checked.\n");
+ dprintf_info(aspi, "\tData transfer: Host to target. Length checked.\n");
}
else if (NO_DATA_TRANSFERED(prb)) {
- dprintf_aspi(stddeb, "\tData transfer: none\n");
+ dprintf_info(aspi, "\tData transfer: none\n");
}
else {
- dprintf_aspi(stddeb, "\tTransfer by scsi cmd. Length not checked\n");
+ dprintf_warn(aspi, "\tTransfer by scsi cmd. Length not checked\n");
}
- dprintf_aspi(stddeb, "\tResidual byte length reporting %s\n", prb->SRB_Flags & 0x4 ? "enabled" : "disabled");
- dprintf_aspi(stddeb, "\tLinking %s\n", prb->SRB_Flags & 0x2 ? "enabled" : "disabled");
- dprintf_aspi(stddeb, "\tPosting %s\n", prb->SRB_Flags & 0x1 ? "enabled" : "disabled");
- dprintf_aspi(stddeb, "Target: %d\n", prb->SRB_Target);
- dprintf_aspi(stddeb, "Lun: %d\n", prb->SRB_Lun);
- dprintf_aspi(stddeb, "BufLen: %ld\n", prb->SRB_BufLen);
- dprintf_aspi(stddeb, "SenseLen: %d\n", prb->SRB_SenseLen);
- dprintf_aspi(stddeb, "BufPtr: %lx (%p)\n", prb->SRB_BufPointer, lpBuf);
- dprintf_aspi(stddeb, "LinkPointer %lx\n", prb->SRB_Rsvd1);
- dprintf_aspi(stddeb, "CDB Length: %d\n", prb->SRB_CDBLen);
- dprintf_aspi(stddeb, "POST Proc: %lx\n", (DWORD) prb->SRB_PostProc);
+ dprintf_info(aspi, "\tResidual byte length reporting %s\n", prb->SRB_Flags & 0x4 ? "enabled" : "disabled");
+ dprintf_info(aspi, "\tLinking %s\n", prb->SRB_Flags & 0x2 ? "enabled" : "disabled");
+ dprintf_info(aspi, "\tPosting %s\n", prb->SRB_Flags & 0x1 ? "enabled" : "disabled");
+ dprintf_info(aspi, "Target: %d\n", prb->SRB_Target);
+ dprintf_info(aspi, "Lun: %d\n", prb->SRB_Lun);
+ dprintf_info(aspi, "BufLen: %ld\n", prb->SRB_BufLen);
+ dprintf_info(aspi, "SenseLen: %d\n", prb->SRB_SenseLen);
+ dprintf_info(aspi, "BufPtr: %lx (%p)\n", prb->SRB_BufPointer, lpBuf);
+ dprintf_info(aspi, "LinkPointer %lx\n", prb->SRB_Rsvd1);
+ dprintf_info(aspi, "CDB Length: %d\n", prb->SRB_CDBLen);
+ dprintf_info(aspi, "POST Proc: %lx\n", (DWORD) prb->SRB_PostProc);
cdb = &prb->CDBByte[0];
- dprintf_aspi(stddeb, "CDB buffer[");
cmd = prb->CDBByte[0];
for (i = 0; i < prb->SRB_CDBLen; i++) {
- if (i != 0)
- dprintf_aspi(stddeb, ",");
- dprintf_aspi(stddeb, "%02x", *cdb++);
+ if (i != 0) dsprintf(aspi, ",");
+ dsprintf(aspi, "%02x", *cdb++);
}
- dprintf_aspi(stddeb, "]\n");
+ dprintf_info(aspi, "CDB buffer[%s]\n", dbg_str(aspi));
}
static void
@@ -216,15 +215,14 @@
{
int i;
BYTE *cdb;
+ dbg_decl_str(aspi, 512);
cdb = &prb->CDBByte[0];
- dprintf_aspi(stddeb, "SenseArea[");
for (i = 0; i < prb->SRB_SenseLen; i++) {
- if (i)
- dprintf_aspi(stddeb, ",");
- dprintf_aspi(stddeb, "%02x", *cdb++);
+ if (i) dsprintf(aspi, ",");
+ dsprintf(aspi, "%02x", *cdb++);
}
- dprintf_aspi(stddeb, "]\n");
+ dprintf_info(aspi, "SenseArea[%s]\n", dbg_str(aspi));
}
static void
@@ -236,7 +234,7 @@
switch (prb->CDBByte[0]) {
case CMD_INQUIRY:
- dprintf_aspi(stddeb, "Vendor: %s\n", lpBuf + INQUIRY_VENDOR);
+ dprintf_info(aspi, "Vendor: %s\n", lpBuf + INQUIRY_VENDOR);
break;
case CMD_TEST_UNIT_READY:
PrintSenseArea16(prb);
@@ -314,20 +312,20 @@
if (myerror == ENOMEM) {
fprintf(stderr, "ASPI: Linux generic scsi driver\n You probably need to re-compile your kernel with a larger SG_BIG_BUFF value (sg.h)\n Suggest 130560\n");
}
- dprintf_aspi(stddeb, "errno: = %d\n", myerror);
+ dprintf_warn(aspi, "errno: = %d\n", myerror);
}
goto error_exit;
}
status = read(fd, sg_reply_hdr, out_len);
if (status < 0 || status != out_len) {
- dprintf_aspi(stddeb, "not enough bytes read from scsi device%d\n", status);
+ dprintf_warn(aspi, "not enough bytes read from scsi device%d\n", status);
goto error_exit;
}
if (sg_reply_hdr->result != 0) {
error_code = sg_reply_hdr->result;
- dprintf_aspi(stddeb, "reply header error (%d)\n", sg_reply_hdr->result);
+ dprintf_warn(aspi, "reply header error (%d)\n", sg_reply_hdr->result);
goto error_exit;
}
@@ -351,7 +349,7 @@
/* now do posting */
if (ASPI_POSTING(prb) && prb->SRB_PostProc) {
- dprintf_aspi(stddeb, "ASPI: Post Routine (%lx) called\n", (DWORD) prb->SRB_PostProc);
+ dprintf_info(aspi, "ASPI: Post Routine (%lx) called\n", (DWORD) prb->SRB_PostProc);
Callbacks->CallASPIPostProc(prb->SRB_PostProc, segptr_prb);
}
@@ -363,17 +361,17 @@
error_exit:
if (error_code == EBUSY) {
prb->SRB_Status = SS_ASPI_IS_BUSY;
- dprintf_aspi(stddeb, "ASPI: Device busy\n");
+ dprintf_info(aspi, "ASPI: Device busy\n");
}
else {
- dprintf_aspi(stddeb, "ASPI_GenericHandleScsiCmd failed\n");
+ dprintf_warn(aspi, "ASPI_GenericHandleScsiCmd failed\n");
prb->SRB_Status = SS_ERR;
}
/* I'm not sure exactly error codes work here
* We probably should set prb->SRB_TargStat, SRB_HaStat ?
*/
- dprintf_aspi(stddeb, "ASPI_GenericHandleScsiCmd: error_exit\n");
+ dprintf_warn(aspi, "ASPI_GenericHandleScsiCmd: error_exit\n");
free(sg_reply_hdr);
free(sg_hd);
return prb->SRB_Status;
@@ -387,7 +385,7 @@
WORD WINAPI GetASPISupportInfo16()
{
#ifdef linux
- dprintf_aspi(stddeb, "GETASPISupportInfo\n");
+ dprintf_info(aspi, "GETASPISupportInfo\n");
/* high byte SS_COMP - low byte number of host adapters.
* FIXME!!! The number of host adapters is incorrect.
* I'm not sure how to determine this under linux etc.
@@ -409,19 +407,19 @@
switch (lpSRB->common.SRB_cmd) {
case SC_HA_INQUIRY:
- dprintf_aspi(stddeb, "ASPI: Not implemented SC_HA_INQUIRY\n");
+ dprintf_fixme(aspi, "ASPI: Not implemented SC_HA_INQUIRY\n");
break;
case SC_GET_DEV_TYPE:
- dprintf_aspi(stddeb, "ASPI: Not implemented SC_GET_DEV_TYPE\n");
+ dprintf_fixme(aspi, "ASPI: Not implemented SC_GET_DEV_TYPE\n");
break;
case SC_EXEC_SCSI_CMD:
return ASPI_ExecScsiCmd16(&lpSRB->cmd, segptr_srb);
break;
case SC_RESET_DEV:
- dprintf_aspi(stddeb, "ASPI: Not implemented SC_RESET_DEV\n");
+ dprintf_fixme(aspi, "ASPI: Not implemented SC_RESET_DEV\n");
break;
default:
- dprintf_aspi(stddeb, "ASPI: Unknown command %d\n", lpSRB->common.SRB_cmd);
+ dprintf_warn(aspi, "ASPI: Unknown command %d\n", lpSRB->common.SRB_cmd);
}
return SS_INVALID_SRB;
#else
diff --git a/misc/comm.c b/misc/comm.c
index 73681d9..d418994 100644
--- a/misc/comm.c
+++ b/misc/comm.c
@@ -34,7 +34,6 @@
#include "comm.h"
#include "heap.h"
#include "options.h"
-#include "stddebug.h"
#include "debug.h"
#ifndef TIOCINQ
@@ -84,7 +83,7 @@
COM[x].fd = 0;
strcpy(COM[x].devicename, temp);
}
- dprintf_comm(stddeb,
+ dprintf_info(comm,
"Comm_Init: %s = %s\n", option, COM[x].devicename);
}
@@ -107,7 +106,7 @@
LPT[x].fd = 0;
strcpy(LPT[x].devicename, temp);
}
- dprintf_comm(stddeb,
+ dprintf_info(comm,
"Comm_Init: %s = %s\n", option, LPT[x].devicename);
}
@@ -153,7 +152,7 @@
int WinError(void)
{
- dprintf_comm(stddeb, "WinError: errno = %d\n", errno);
+ dprintf_info(comm, "WinError: errno = %d\n", errno);
switch (errno) {
default:
return CE_IOE;
@@ -170,7 +169,7 @@
int port;
char *ptr, temp[256];
- dprintf_comm(stddeb,
+ dprintf_info(comm,
"BuildCommDCB: (%s), ptr %p\n", device, lpdcb);
commerror = 0;
@@ -208,13 +207,13 @@
lpdcb->BaudRate = COM[port].baudrate;
else
lpdcb->BaudRate = atoi(ptr);
- dprintf_comm(stddeb,"BuildCommDCB: baudrate (%d)\n", lpdcb->BaudRate);
+ dprintf_info(comm,"BuildCommDCB: baudrate (%d)\n", lpdcb->BaudRate);
ptr = strtok(NULL, ", ");
if (islower(*ptr))
*ptr = toupper(*ptr);
- dprintf_comm(stddeb,"BuildCommDCB: parity (%c)\n", *ptr);
+ dprintf_info(comm,"BuildCommDCB: parity (%c)\n", *ptr);
lpdcb->fParity = 1;
switch (*ptr) {
case 'N':
@@ -236,11 +235,11 @@
}
ptr = strtok(NULL, ", ");
- dprintf_comm(stddeb, "BuildCommDCB: charsize (%c)\n", *ptr);
+ dprintf_info(comm, "BuildCommDCB: charsize (%c)\n", *ptr);
lpdcb->ByteSize = *ptr - '0';
ptr = strtok(NULL, ", ");
- dprintf_comm(stddeb, "BuildCommDCB: stopbits (%c)\n", *ptr);
+ dprintf_info(comm, "BuildCommDCB: stopbits (%c)\n", *ptr);
switch (*ptr) {
case '1':
lpdcb->StopBits = ONESTOPBIT;
@@ -274,7 +273,7 @@
int port;
char *ptr,*temp;
- dprintf_comm(stddeb,"BuildCommDCBAndTimeouts32A(%s,%p,%p)\n",device,lpdcb,lptimeouts);
+ dprintf_info(comm,"BuildCommDCBAndTimeouts32A(%s,%p,%p)\n",device,lpdcb,lptimeouts);
commerror = 0;
if (!lstrncmpi32A(device,"COM",3)) {
@@ -401,7 +400,7 @@
LPSTR devidA;
BOOL32 ret;
- dprintf_comm(stddeb,"BuildCommDCBAndTimeouts32W(%p,%p,%p)\n",devid,lpdcb,lptimeouts);
+ dprintf_info(comm,"BuildCommDCBAndTimeouts32W(%p,%p,%p)\n",devid,lpdcb,lptimeouts);
devidA = HEAP_strdupWtoA( GetProcessHeap(), 0, devid );
ret=BuildCommDCBAndTimeouts32A(devidA,lpdcb,lptimeouts);
HeapFree( GetProcessHeap(), 0, devidA );
@@ -423,7 +422,7 @@
{
int port,fd;
- dprintf_comm(stddeb,
+ dprintf_info(comm,
"OpenComm: %s, %d, %d\n", device, cbInQueue, cbOutQueue);
commerror = 0;
@@ -435,7 +434,7 @@
commerror = IE_BADID;
}
- dprintf_comm(stddeb,
+ dprintf_info(comm,
"OpenComm: %s = %s\n", device, COM[port].devicename);
if (!ValidCOMPort(port)) {
@@ -488,7 +487,7 @@
INT16 WINAPI CloseComm(INT16 fd)
{
int port;
- dprintf_comm(stddeb,"CloseComm: fd %d\n", fd);
+ dprintf_info(comm,"CloseComm: fd %d\n", fd);
if ((port = GetCommPort(fd)) !=-1) { /* [LW] */
SEGPTR_FREE(unknown[port]);
COM[port].fd = 0; /* my adaptation of RER's fix */
@@ -513,7 +512,7 @@
{
struct DosDeviceStruct *ptr;
- dprintf_comm(stddeb,"SetCommBreak: fd: %d\n", fd);
+ dprintf_info(comm,"SetCommBreak: fd: %d\n", fd);
if ((ptr = GetDeviceStruct(fd)) == NULL) {
commerror = IE_BADID;
return -1;
@@ -532,7 +531,7 @@
struct DosDeviceStruct *ptr;
- dprintf_comm(stddeb,"SetCommBreak: fd: %d\n", fd);
+ dprintf_info(comm,"SetCommBreak: fd: %d\n", fd);
if ((ptr = GetDeviceStruct(fd)) == NULL) {
commerror = IE_BADID;
return FALSE;
@@ -550,7 +549,7 @@
{
struct DosDeviceStruct *ptr;
- dprintf_comm(stddeb,"ClearCommBreak: fd: %d\n", fd);
+ dprintf_info(comm,"ClearCommBreak: fd: %d\n", fd);
if ((ptr = GetDeviceStruct(fd)) == NULL) {
commerror = IE_BADID;
return -1;
@@ -568,7 +567,7 @@
{
struct DosDeviceStruct *ptr;
- dprintf_comm(stddeb,"ClearCommBreak: fd: %d\n", fd);
+ dprintf_info(comm,"ClearCommBreak: fd: %d\n", fd);
if ((ptr = GetDeviceStruct(fd)) == NULL) {
commerror = IE_BADID;
return FALSE;
@@ -587,7 +586,7 @@
int max;
struct termios port;
- dprintf_comm(stddeb,"EscapeCommFunction fd: %d, function: %d\n", fd, nFunction);
+ dprintf_info(comm,"EscapeCommFunction fd: %d, function: %d\n", fd, nFunction);
if (tcgetattr(fd,&port) == -1) {
commerror=WinError();
return -1;
@@ -663,7 +662,7 @@
struct termios port;
struct DosDeviceStruct *ptr;
- dprintf_comm(stddeb,"EscapeCommFunction fd: %d, function: %d\n", fd, nFunction);
+ dprintf_info(comm,"EscapeCommFunction fd: %d, function: %d\n", fd, nFunction);
if (tcgetattr(fd,&port) == -1) {
commerror=WinError();
return FALSE;
@@ -735,7 +734,7 @@
{
int queue;
- dprintf_comm(stddeb,"FlushComm fd: %d, queue: %d\n", fd, fnQueue);
+ dprintf_info(comm,"FlushComm fd: %d, queue: %d\n", fd, fnQueue);
switch (fnQueue) {
case 0: queue = TCOFLUSH;
break;
@@ -760,7 +759,7 @@
*/
BOOL32 WINAPI PurgeComm( HANDLE32 hFile, DWORD flags)
{
- dprintf_comm(stdnimp, "PurgeComm(%08x %08lx) unimplemented stub\n",
+ dprintf_fixme(comm, "PurgeComm(%08x %08lx) unimplemented stub\n",
hFile, flags);
return 0;
}
@@ -785,15 +784,15 @@
if (rc) fprintf(stderr, "Error !\n");
lpStat->cbInQue = cnt;
- dprintf_comm(stddeb,
- "GetCommError: fd %d, error %d, lpStat %d %d %d\n",
- fd, commerror,
- lpStat->status, lpStat->cbInQue, lpStat->cbOutQue);
+ dprintf_info(comm,
+ "GetCommError: fd %d, error %d, lpStat %d %d %d\n",
+ fd, commerror, lpStat->status, lpStat->cbInQue,
+ lpStat->cbOutQue);
}
else
- dprintf_comm(stddeb,
- "GetCommError: fd %d, error %d, lpStat NULL\n",
- fd, commerror);
+ dprintf_info(comm,
+ "GetCommError: fd %d, error %d, lpStat NULL\n",
+ fd, commerror);
/*
* [RER] I have no idea what the following is trying to accomplish.
@@ -811,8 +810,8 @@
{
int temperror;
- dprintf_comm(stddeb,
- "ClearCommError: fd %d (current error %d)\n", fd, commerror);
+ dprintf_info(comm, "ClearCommError: fd %d (current error %d)\n",
+ fd, commerror);
temperror = commerror;
commerror = 0;
return TRUE;
@@ -827,19 +826,18 @@
int act;
int repid;
unsigned int mstat;
- dprintf_comm(stddeb,"SetCommEventMask:fd %d,mask %d\n",fd,fuEvtMask);
+ dprintf_info(comm,"SetCommEventMask:fd %d,mask %d\n",fd,fuEvtMask);
eventmask |= fuEvtMask;
if ((act = GetCommPort(fd)) == -1) {
- dprintf_comm(stddeb," fd %d not comm port\n",act);
+ dprintf_warn(comm," fd %d not comm port\n",act);
return NULL;}
stol = unknown[act];
stol += msr;
repid = ioctl(fd,TIOCMGET,&mstat);
- dprintf_comm(stddeb,
- " ioctl %d, msr %x at %p %p\n",repid,mstat,stol,unknown[act]);
+ dprintf_info(comm, " ioctl %d, msr %x at %p %p\n",repid,mstat,stol,unknown[act]);
if ((mstat&TIOCM_CAR)) {*stol |= 0x80;}
else {*stol &=0x7f;}
- dprintf_comm(stddeb," modem dcd construct %x\n",*stol);
+ dprintf_info(comm," modem dcd construct %x\n",*stol);
return SEGPTR_GET(unknown[act]);
}
@@ -850,7 +848,7 @@
{
int events = 0;
- dprintf_comm(stddeb,
+ dprintf_info(comm,
"GetCommEventMask: fd %d, mask %d\n", fd, fnEvtClear);
/*
@@ -864,7 +862,7 @@
rc = ioctl(fd, TIOCINQ, &cnt);
if (cnt) events |= EV_RXCHAR;
- dprintf_comm(stddeb,
+ dprintf_info(comm,
"GetCommEventMask: rxchar %ld\n", cnt);
}
@@ -873,7 +871,7 @@
*/
/* TODO */
- dprintf_comm(stddeb,
+ dprintf_info(comm,
"GetCommEventMask: return events %d\n", events);
return events;
@@ -892,7 +890,7 @@
*/
BOOL32 WINAPI SetupComm( HANDLE32 hFile, DWORD insize, DWORD outsize)
{
- dprintf_comm(stdnimp, "SetupComm: insize %ld outsize %ld unimplemented stub\n", insize, outsize);
+ dprintf_fixme(comm, "SetupComm: insize %ld outsize %ld unimplemented stub\n", insize, outsize);
return FALSE;
}
@@ -901,7 +899,7 @@
*/
BOOL32 WINAPI GetCommMask(INT32 fd,LPDWORD evtmask)
{
- dprintf_comm(stddeb,
+ dprintf_info(comm,
"GetCommMask: fd %d, mask %p\n", fd, evtmask);
*evtmask = eventmask;
return TRUE;
@@ -912,7 +910,7 @@
*/
BOOL32 WINAPI SetCommMask(INT32 fd,DWORD evtmask)
{
- dprintf_comm(stddeb,
+ dprintf_info(comm,
"SetCommMask: fd %d, mask %lx\n", fd, evtmask);
eventmask = evtmask;
return TRUE;
@@ -926,7 +924,7 @@
struct termios port;
struct DosDeviceStruct *ptr;
- dprintf_comm(stddeb,
+ dprintf_info(comm,
"SetCommState16: fd %d, ptr %p\n", lpdcb->Id, lpdcb);
if (tcgetattr(lpdcb->Id, &port) == -1) {
commerror = WinError();
@@ -957,7 +955,7 @@
}
if (ptr->baudrate > 0)
lpdcb->BaudRate = ptr->baudrate;
- dprintf_comm(stddeb,"SetCommState: baudrate %d\n",lpdcb->BaudRate);
+ dprintf_info(comm,"SetCommState: baudrate %d\n",lpdcb->BaudRate);
#ifdef CBAUD
port.c_cflag &= ~CBAUD;
switch (lpdcb->BaudRate) {
@@ -1051,7 +1049,7 @@
}
port.c_ispeed = port.c_ospeed;
#endif
- dprintf_comm(stddeb,"SetCommState: bytesize %d\n",lpdcb->ByteSize);
+ dprintf_info(comm,"SetCommState: bytesize %d\n",lpdcb->ByteSize);
port.c_cflag &= ~CSIZE;
switch (lpdcb->ByteSize) {
case 5:
@@ -1071,7 +1069,7 @@
return -1;
}
- dprintf_comm(stddeb,"SetCommState: parity %d\n",lpdcb->Parity);
+ dprintf_info(comm,"SetCommState: parity %d\n",lpdcb->Parity);
port.c_cflag &= ~(PARENB | PARODD);
if (lpdcb->fParity)
switch (lpdcb->Parity) {
@@ -1092,7 +1090,7 @@
}
- dprintf_comm(stddeb,"SetCommState: stopbits %d\n",lpdcb->StopBits);
+ dprintf_info(comm,"SetCommState: stopbits %d\n",lpdcb->StopBits);
switch (lpdcb->StopBits) {
case ONESTOPBIT:
@@ -1139,7 +1137,7 @@
struct termios port;
struct DosDeviceStruct *ptr;
- dprintf_comm(stddeb,"SetCommState32: fd %d, ptr %p\n",fd,lpdcb);
+ dprintf_info(comm,"SetCommState32: fd %d, ptr %p\n",fd,lpdcb);
if (tcgetattr(fd,&port) == -1) {
commerror = WinError();
return FALSE;
@@ -1169,7 +1167,7 @@
}
if (ptr->baudrate > 0)
lpdcb->BaudRate = ptr->baudrate;
- dprintf_comm(stddeb,"SetCommState: baudrate %ld\n",lpdcb->BaudRate);
+ dprintf_info(comm,"SetCommState: baudrate %ld\n",lpdcb->BaudRate);
#ifdef CBAUD
port.c_cflag &= ~CBAUD;
switch (lpdcb->BaudRate) {
@@ -1257,7 +1255,7 @@
}
port.c_ispeed = port.c_ospeed;
#endif
- dprintf_comm(stddeb,"SetCommState: bytesize %d\n",lpdcb->ByteSize);
+ dprintf_info(comm,"SetCommState: bytesize %d\n",lpdcb->ByteSize);
port.c_cflag &= ~CSIZE;
switch (lpdcb->ByteSize) {
case 5:
@@ -1277,7 +1275,7 @@
return FALSE;
}
- dprintf_comm(stddeb,"SetCommState: parity %d\n",lpdcb->Parity);
+ dprintf_info(comm,"SetCommState: parity %d\n",lpdcb->Parity);
port.c_cflag &= ~(PARENB | PARODD);
if (lpdcb->fParity)
switch (lpdcb->Parity) {
@@ -1298,7 +1296,7 @@
}
- dprintf_comm(stddeb,"SetCommState: stopbits %d\n",lpdcb->StopBits);
+ dprintf_info(comm,"SetCommState: stopbits %d\n",lpdcb->StopBits);
switch (lpdcb->StopBits) {
case ONESTOPBIT:
port.c_cflag &= ~CSTOPB;
@@ -1346,7 +1344,7 @@
{
struct termios port;
- dprintf_comm(stddeb,"GetCommState16: fd %d, ptr %p\n", fd, lpdcb);
+ dprintf_info(comm,"GetCommState16: fd %d, ptr %p\n", fd, lpdcb);
if (tcgetattr(fd, &port) == -1) {
commerror = WinError();
return -1;
@@ -1471,7 +1469,7 @@
{
struct termios port;
- dprintf_comm(stddeb,"GetCommState32: fd %d, ptr %p\n", fd, lpdcb);
+ dprintf_info(comm,"GetCommState32: fd %d, ptr %p\n", fd, lpdcb);
if (GetDeviceStruct(fd) == NULL) return FALSE;
if (tcgetattr(fd, &port) == -1) {
commerror = WinError();
@@ -1587,7 +1585,7 @@
{
struct DosDeviceStruct *ptr;
- dprintf_comm(stddeb,
+ dprintf_info(comm,
"TransmitCommChar: fd %d, data %d \n", fd, chTransmit);
if ((ptr = GetDeviceStruct(fd)) == NULL) {
commerror = IE_BADID;
@@ -1615,7 +1613,7 @@
{
struct DosDeviceStruct *ptr;
- dprintf_comm(stddeb,"TransmitCommChar32(%d,'%c')\n",fd,chTransmit);
+ dprintf_info(comm,"TransmitCommChar32(%d,'%c')\n",fd,chTransmit);
if ((ptr = GetDeviceStruct(fd)) == NULL) {
commerror = IE_BADID;
return FALSE;
@@ -1641,7 +1639,7 @@
{
struct DosDeviceStruct *ptr;
- dprintf_comm(stddeb,"UngetCommChar: fd %d (char %d)\n", fd, chUnget);
+ dprintf_info(comm,"UngetCommChar: fd %d (char %d)\n", fd, chUnget);
if ((ptr = GetDeviceStruct(fd)) == NULL) {
commerror = IE_BADID;
return -1;
@@ -1663,10 +1661,10 @@
*/
INT16 WINAPI ReadComm(INT16 fd,LPSTR lpvBuf,INT16 cbRead)
{
- int status, x, length;
+ int status, length;
struct DosDeviceStruct *ptr;
- dprintf_comm(stddeb,
+ dprintf_info(comm,
"ReadComm: fd %d, ptr %p, length %d\n", fd, lpvBuf, cbRead);
if ((ptr = GetDeviceStruct(fd)) == NULL) {
commerror = IE_BADID;
@@ -1698,9 +1696,7 @@
return length;
}
} else {
- for (x=0; x < length+status; x++)
- dprintf_comm(stddeb,"%c",*(lpvBuf+x));
- dprintf_comm(stddeb,"\nthus endeth\n");
+ dprintf_info(comm,"%*s\n", length+status, lpvBuf);
commerror = 0;
return length + status;
}
@@ -1711,10 +1707,10 @@
*/
INT16 WINAPI WriteComm(INT16 fd, LPSTR lpvBuf, INT16 cbWrite)
{
- int x, length;
+ int length;
struct DosDeviceStruct *ptr;
- dprintf_comm(stddeb,"WriteComm: fd %d, ptr %p, length %d\n",
+ dprintf_info(comm,"WriteComm: fd %d, ptr %p, length %d\n",
fd, lpvBuf, cbWrite);
if ((ptr = GetDeviceStruct(fd)) == NULL) {
commerror = IE_BADID;
@@ -1726,9 +1722,7 @@
return -1;
}
- for (x=0; x != cbWrite ; x++)
- dprintf_comm(stddeb,"%c", *(lpvBuf + x) );
- dprintf_comm(stddeb,"\n");
+ dprintf_info(comm,"%*s\n", cbWrite, lpvBuf );
length = write(fd, (void *) lpvBuf, cbWrite);
if (length == -1) {
diff --git a/misc/commdlg.c b/misc/commdlg.c
index f81c7b1..c0f2a12 100644
--- a/misc/commdlg.c
+++ b/misc/commdlg.c
@@ -17,7 +17,6 @@
#include "module.h"
#include "resource.h"
#include "drive.h"
-#include "stddebug.h"
#include "debug.h"
static DWORD CommDlgLastError = 0;
@@ -138,7 +137,7 @@
FreeResource16( hDlgTmpl );
}
- dprintf_commdlg(stddeb,"GetOpenFileName // return lpstrFile='%s' !\n",
+ dprintf_info(commdlg,"GetOpenFileName // return lpstrFile='%s' !\n",
(LPSTR)PTR_SEG_TO_LIN(lpofn->lpstrFile));
return bRet;
}
@@ -232,7 +231,7 @@
FreeResource16( hDlgTmpl );
}
- dprintf_commdlg(stddeb, "GetSaveFileName // return lpstrFile='%s' !\n",
+ dprintf_info(commdlg, "GetSaveFileName // return lpstrFile='%s' !\n",
(LPSTR)PTR_SEG_TO_LIN(lpofn->lpstrFile));
return bRet;
}
@@ -475,7 +474,7 @@
int i, n;
LPOPENFILENAME16 lpofn;
char tmpstr[512];
- LPSTR pstr;
+ LPSTR pstr, old_pstr;
SetWindowLong32A(hWnd, DWL_USER, lParam);
lpofn = (LPOPENFILENAME16)PTR_SEG_TO_LIN(lParam);
if (lpofn->lpstrTitle) SetWindowText16( hWnd, lpofn->lpstrTitle );
@@ -484,15 +483,16 @@
{
pstr = (LPSTR)PTR_SEG_TO_LIN(lpofn->lpstrCustomFilter);
n = 0;
- dprintf_commdlg(stddeb,"lpstrCustomFilter = %p\n", pstr);
+ dprintf_info(commdlg,"lpstrCustomFilter = %p\n", pstr);
while(*pstr)
{
- dprintf_commdlg(stddeb,"lpstrCustomFilter // add str='%s' ",pstr);
+ old_pstr = pstr;
i = SendDlgItemMessage16(hWnd, cmb1, CB_ADDSTRING16, 0,
(LPARAM)lpofn->lpstrCustomFilter + n );
n += strlen(pstr) + 1;
pstr += strlen(pstr) + 1;
- dprintf_commdlg(stddeb,"associated to '%s'\n", pstr);
+ dprintf_info(commdlg,"lpstrCustomFilter // add str='%s' "
+ "associated to '%s'\n", old_pstr, pstr);
SendDlgItemMessage16(hWnd, cmb1, CB_SETITEMDATA16, i, (LPARAM)pstr);
n += strlen(pstr) + 1;
pstr += strlen(pstr) + 1;
@@ -503,12 +503,13 @@
pstr = (LPSTR)PTR_SEG_TO_LIN(lpofn->lpstrFilter);
n = 0;
while(*pstr) {
- dprintf_commdlg(stddeb,"lpstrFilter // add str='%s' ", pstr);
+ old_pstr = pstr;
i = SendDlgItemMessage16(hWnd, cmb1, CB_ADDSTRING16, 0,
(LPARAM)lpofn->lpstrFilter + n );
n += strlen(pstr) + 1;
pstr += strlen(pstr) + 1;
- dprintf_commdlg(stddeb,"associated to '%s'\n", pstr);
+ dprintf_info(commdlg,"lpstrFilter // add str='%s' "
+ "associated to '%s'\n", old_pstr, pstr);
SendDlgItemMessage16(hWnd, cmb1, CB_SETITEMDATA16, i, (LPARAM)pstr);
n += strlen(pstr) + 1;
pstr += strlen(pstr) + 1;
@@ -521,7 +522,7 @@
strncpy(tmpstr, FILEDLG_GetFileType(PTR_SEG_TO_LIN(lpofn->lpstrCustomFilter),
PTR_SEG_TO_LIN(lpofn->lpstrFilter), lpofn->nFilterIndex - 1),511);
tmpstr[511]=0;
- dprintf_commdlg(stddeb,"nFilterIndex = %ld // SetText of edt1 to '%s'\n",
+ dprintf_info(commdlg,"nFilterIndex = %ld // SetText of edt1 to '%s'\n",
lpofn->nFilterIndex, tmpstr);
SetDlgItemText32A( hWnd, edt1, tmpstr );
/* get drive list */
@@ -636,7 +637,7 @@
if (lRet == LB_ERR)
return TRUE;
pstr = (LPSTR)SendDlgItemMessage16(hWnd, cmb1, CB_GETITEMDATA16, lRet, 0);
- dprintf_commdlg(stddeb,"Selected filter : %s\n", pstr);
+ dprintf_info(commdlg,"Selected filter : %s\n", pstr);
SetDlgItemText32A( hWnd, edt1, pstr );
FILEDLG_ScanDir(hWnd, tmpstr);
return TRUE;
@@ -664,7 +665,7 @@
strcpy(tmpstr2, tmpstr);
*tmpstr=0;
}
- dprintf_commdlg(stddeb,"commdlg: %s, %s\n", tmpstr, tmpstr2);
+ dprintf_info(commdlg,"commdlg: %s, %s\n", tmpstr, tmpstr2);
SetDlgItemText32A( hWnd, edt1, tmpstr2 );
FILEDLG_ScanDir(hWnd, tmpstr);
return TRUE;
@@ -677,7 +678,7 @@
lRet = SendDlgItemMessage16(hWnd, cmb1, CB_GETCURSEL16, 0, 0);
if (lRet == LB_ERR) return TRUE;
lpofn->nFilterIndex = lRet + 1;
- dprintf_commdlg(stddeb,"commdlg: lpofn->nFilterIndex=%ld\n", lpofn->nFilterIndex);
+ dprintf_info(commdlg,"commdlg: lpofn->nFilterIndex=%ld\n", lpofn->nFilterIndex);
lstrcpyn32A(tmpstr2,
FILEDLG_GetFileType(PTR_SEG_TO_LIN(lpofn->lpstrCustomFilter),
PTR_SEG_TO_LIN(lpofn->lpstrFilter),
@@ -1127,7 +1128,7 @@
HWND32 hwndDialog;
LPPRINTDLG16 lpPrint = (LPPRINTDLG16)PTR_SEG_TO_LIN(printdlg);
- dprintf_commdlg(stddeb,"PrintDlg(%p) // Flags=%08lX\n", lpPrint, lpPrint->Flags );
+ dprintf_info(commdlg,"PrintDlg(%p) // Flags=%08lX\n", lpPrint, lpPrint->Flags );
if (lpPrint->Flags & PD_RETURNDEFAULT)
/* FIXME: should fill lpPrint->hDevMode and lpPrint->hDevNames here */
@@ -1179,7 +1180,7 @@
switch (wMsg)
{
case WM_INITDIALOG:
- dprintf_commdlg(stddeb,"PrintDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
+ dprintf_info(commdlg,"PrintDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
ShowWindow16(hWnd, SW_SHOWNORMAL);
return (TRUE);
case WM_COMMAND:
@@ -1207,7 +1208,7 @@
switch (wMsg)
{
case WM_INITDIALOG:
- dprintf_commdlg(stddeb,"PrintSetupDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
+ dprintf_info(commdlg,"PrintSetupDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
ShowWindow16(hWnd, SW_SHOWNORMAL);
return (TRUE);
case WM_COMMAND:
@@ -1239,7 +1240,7 @@
short WINAPI GetFileTitle32A(LPCSTR lpFile, LPSTR lpTitle, UINT32 cbBuf)
{
int i, len;
- dprintf_commdlg(stddeb,"GetFileTitle(%p %p %d); \n", lpFile, lpTitle, cbBuf);
+ dprintf_info(commdlg,"GetFileTitle(%p %p %d); \n", lpFile, lpTitle, cbBuf);
if (lpFile == NULL || lpTitle == NULL)
return -1;
len = strlen(lpFile);
@@ -1256,7 +1257,7 @@
i++;
break;
}
- dprintf_commdlg(stddeb,"\n---> '%s' ", &lpFile[i]);
+ dprintf_info(commdlg,"---> '%s' \n", &lpFile[i]);
len = strlen(lpFile+i)+1;
if (cbBuf < len)
@@ -1305,7 +1306,7 @@
LPCVOID template;
HWND32 hwndDialog;
- dprintf_commdlg(stddeb,"ChooseColor\n");
+ dprintf_info(commdlg,"ChooseColor\n");
if (!lpChCol) return FALSE;
if (lpChCol->Flags & CC_ENABLETEMPLATEHANDLE)
@@ -2069,7 +2070,7 @@
POINT16 point;
struct CCPRIVATE * lpp;
- dprintf_commdlg(stddeb,"ColorDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
+ dprintf_info(commdlg,"ColorDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
lpp=calloc(1,sizeof(struct CCPRIVATE));
lpp->lpcc=(LPCHOOSECOLOR)lParam;
if (lpp->lpcc->lStructSize != sizeof(CHOOSECOLOR))
@@ -2138,7 +2139,7 @@
HDC32 hdc;
COLORREF *cr;
struct CCPRIVATE * lpp=(struct CCPRIVATE *)GetWindowLong32A(hDlg, DWL_USER);
- dprintf_commdlg(stddeb,"CC_WMCommand wParam=%x lParam=%lx\n",wParam,lParam);
+ dprintf_info(commdlg,"CC_WMCommand wParam=%x lParam=%lx\n",wParam,lParam);
switch (wParam)
{
case 0x2c2: /* edit notify RGB */
@@ -2400,7 +2401,7 @@
LPCVOID template;
HWND32 hwndDialog;
- dprintf_commdlg(stddeb,"ChooseFont\n");
+ dprintf_info(commdlg,"ChooseFont\n");
if (!lpChFont) return FALSE;
if (lpChFont->Flags & CF_ENABLETEMPLATEHANDLE)
@@ -2482,7 +2483,7 @@
LPCHOOSEFONT lpcf=(LPCHOOSEFONT)GetWindowLong32A(hDlg, DWL_USER);
LOGFONT16 *lplf = (LOGFONT16 *)PTR_SEG_TO_LIN( logfont );
- dprintf_commdlg(stddeb,"FontFamilyEnumProc: font=%s (nFontType=%d)\n",
+ dprintf_info(commdlg,"FontFamilyEnumProc: font=%s (nFontType=%d)\n",
lplf->lfFaceName,nFontType);
if (lpcf->Flags & CF_FIXEDPITCHONLY)
@@ -2601,8 +2602,8 @@
TEXTMETRIC16 *lptm = (TEXTMETRIC16 *)PTR_SEG_TO_LIN(metrics);
int i;
- dprintf_commdlg(stddeb,"FontStyleEnumProc: (nFontType=%d)\n",nFontType);
- dprintf_commdlg(stddeb," %s h=%d w=%d e=%d o=%d wg=%d i=%d u=%d s=%d ch=%d op=%d cp=%d q=%d pf=%xh\n",
+ dprintf_info(commdlg,"FontStyleEnumProc: (nFontType=%d)\n",nFontType);
+ dprintf_info(commdlg," %s h=%d w=%d e=%d o=%d wg=%d i=%d u=%d s=%d ch=%d op=%d cp=%d q=%d pf=%xh\n",
lplf->lfFaceName,lplf->lfHeight,lplf->lfWidth,lplf->lfEscapement,lplf->lfOrientation,
lplf->lfWeight,lplf->lfItalic,lplf->lfUnderline,lplf->lfStrikeOut,lplf->lfCharSet,
lplf->lfOutPrecision,lplf->lfClipPrecision,lplf->lfQuality,lplf->lfPitchAndFamily);
@@ -2638,11 +2639,11 @@
SetWindowLong32A(hDlg, DWL_USER, lParam);
lpcf=(LPCHOOSEFONT)lParam;
lpxx=PTR_SEG_TO_LIN(lpcf->lpLogFont);
- dprintf_commdlg(stddeb,"FormatCharDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
+ dprintf_info(commdlg,"FormatCharDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
if (lpcf->lStructSize != sizeof(CHOOSEFONT))
{
- dprintf_commdlg(stddeb,"WM_INITDIALOG: structure size failure !!!\n");
+ dprintf_err(commdlg,"WM_INITDIALOG: structure size failure !!!\n");
EndDialog32 (hDlg, 0);
return FALSE;
}
@@ -2681,7 +2682,7 @@
{
if (!EnumFontFamilies16(hdc, NULL,FontFamilyEnumProc,
(LPARAM)GetDlgItem32(hDlg,cmb1)))
- dprintf_commdlg(stddeb,"WM_INITDIALOG: EnumFontFamilies returns 0\n");
+ dprintf_info(commdlg,"WM_INITDIALOG: EnumFontFamilies returns 0\n");
if (lpcf->Flags & CF_INITTOLOGFONTSTRUCT)
{
/* look for fitting font name in combobox1 */
@@ -2728,7 +2729,7 @@
}
else
{
- dprintf_commdlg(stddeb,"WM_INITDIALOG: HDC failure !!!\n");
+ dprintf_warn(commdlg,"WM_INITDIALOG: HDC failure !!!\n");
EndDialog32 (hDlg, 0);
return FALSE;
}
@@ -2793,7 +2794,7 @@
buffer = SEGPTR_ALLOC(40);
switch (lpdi->CtlID)
{
- case cmb1: /* dprintf_commdlg(stddeb,"WM_Drawitem cmb1\n"); */
+ case cmb1: /* dprintf_info(commdlg,"WM_Drawitem cmb1\n"); */
SendMessage16(lpdi->hwndItem, CB_GETLBTEXT16, lpdi->itemID,
(LPARAM)SEGPTR_GET(buffer));
GetObject16( hBitmapTT, sizeof(bm), &bm );
@@ -2814,14 +2815,14 @@
#endif
break;
case cmb2:
- case cmb3: /* dprintf_commdlg(stddeb,"WM_DRAWITEN cmb2,cmb3\n"); */
+ case cmb3: /* dprintf_info(commdlg,"WM_DRAWITEN cmb2,cmb3\n"); */
SendMessage16(lpdi->hwndItem, CB_GETLBTEXT16, lpdi->itemID,
(LPARAM)SEGPTR_GET(buffer));
TextOut16(lpdi->hDC, lpdi->rcItem.left,
lpdi->rcItem.top, buffer, lstrlen16(buffer));
break;
- case cmb4: /* dprintf_commdlg(stddeb,"WM_DRAWITEM cmb4 (=COLOR)\n"); */
+ case cmb4: /* dprintf_info(commdlg,"WM_DRAWITEM cmb4 (=COLOR)\n"); */
SendMessage16(lpdi->hwndItem, CB_GETLBTEXT16, lpdi->itemID,
(LPARAM)SEGPTR_GET(buffer));
TextOut16(lpdi->hDC, lpdi->rcItem.left + 25+5,
@@ -2880,7 +2881,7 @@
LPCHOOSEFONT lpcf=(LPCHOOSEFONT)GetWindowLong32A(hDlg, DWL_USER);
LPLOGFONT16 lpxx=PTR_SEG_TO_LIN(lpcf->lpLogFont);
- dprintf_commdlg(stddeb,"FormatCharDlgProc // WM_COMMAND lParam=%08lX\n", lParam);
+ dprintf_info(commdlg,"FormatCharDlgProc // WM_COMMAND lParam=%08lX\n", lParam);
switch (wParam)
{
case cmb1:if (HIWORD(lParam)==CBN_SELCHANGE)
@@ -2897,7 +2898,7 @@
char *str = SEGPTR_ALLOC(256);
SendDlgItemMessage16(hDlg,cmb1,CB_GETLBTEXT16,i,
(LPARAM)SEGPTR_GET(str));
- dprintf_commdlg(stddeb,"WM_COMMAND/cmb1 =>%s\n",str);
+ dprintf_info(commdlg,"WM_COMMAND/cmb1 =>%s\n",str);
EnumFontFamilies16(hdc,str,FontStyleEnumProc,
MAKELONG(GetDlgItem32(hDlg,cmb2),GetDlgItem32(hDlg,cmb3)));
SetCursor16(hcursor);
@@ -2908,7 +2909,7 @@
}
else
{
- dprintf_commdlg(stddeb,"WM_COMMAND: HDC failure !!!\n");
+ dprintf_warn(commdlg,"WM_COMMAND: HDC failure !!!\n");
EndDialog32 (hDlg, 0);
return TRUE;
}
@@ -2919,7 +2920,7 @@
case cmb3:if (HIWORD(lParam)==CBN_SELCHANGE || HIWORD(lParam)== BN_CLICKED )
{
char *str = SEGPTR_ALLOC(256);
- dprintf_commdlg(stddeb,"WM_COMMAND/cmb2,3 =%08lX\n", lParam);
+ dprintf_info(commdlg,"WM_COMMAND/cmb2,3 =%08lX\n", lParam);
i=SendDlgItemMessage16(hDlg,cmb1,CB_GETCURSEL16,0,0);
if (i==CB_ERR)
i=GetDlgItemText32A( hDlg, cmb1, str, 256 );
@@ -3035,7 +3036,7 @@
case WM_COMMAND:
return CFn_WMCommand(hDlg,wParam,lParam);
case WM_CHOOSEFONT_GETLOGFONT:
- dprintf_commdlg(stddeb,
+ dprintf_info(commdlg,
"FormatCharDlgProc // WM_CHOOSEFONT_GETLOGFONT lParam=%08lX\n", lParam);
/* FIXME: current logfont back to caller */
break;
diff --git a/misc/cpu.c b/misc/cpu.c
index 9265986..65e9ac4 100644
--- a/misc/cpu.c
+++ b/misc/cpu.c
@@ -10,6 +10,7 @@
#include <string.h>
#include "windows.h"
#include "winnt.h"
+#include "winreg.h"
static BYTE PF[64] = {0,};
@@ -20,6 +21,8 @@
{
static int cache = 0;
static SYSTEM_INFO cachedsi;
+ HKEY xhkey=0,hkey;
+ char buf[20];
if (cache) {
memcpy(si,&cachedsi,sizeof(*si));
@@ -55,6 +58,8 @@
if (!f)
return;
+ xhkey = 0;
+ RegCreateKey16(HKEY_LOCAL_MACHINE,"\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor",&hkey);
while (fgets(line,200,f)!=NULL) {
char *s,*value;
@@ -88,6 +93,10 @@
break;
}
}
+ /* set the CPU type of the current processor */
+ sprintf(buf,"CPU %ld",cachedsi.dwProcessorType);
+ if (xhkey)
+ RegSetValueEx32A(xhkey,"Identifier",0,REG_SZ,buf,strlen(buf));
continue;
}
/* old 2.0 method */
@@ -112,6 +121,10 @@
break;
}
}
+ /* set the CPU type of the current processor */
+ sprintf(buf,"CPU %ld",cachedsi.dwProcessorType);
+ if (xhkey)
+ RegSetValueEx32A(xhkey,"Identifier",0,REG_SZ,buf,strlen(buf));
continue;
}
if (!lstrncmpi32A(line,"fdiv_bug",strlen("fdiv_bug"))) {
@@ -133,6 +146,12 @@
if (sscanf(value,"%d",&x))
if (x+1>cachedsi.dwNumberOfProcessors)
cachedsi.dwNumberOfProcessors=x+1;
+
+ /* create a new processor subkey */
+ sprintf(buf,"%d",x);
+ if (xhkey)
+ RegCloseKey(xhkey);
+ RegCreateKey16(hkey,buf,&xhkey);
}
if (!lstrncmpi32A(line,"stepping",strlen("stepping"))) {
int x;
@@ -151,11 +170,15 @@
fclose (f);
}
memcpy(si,&cachedsi,sizeof(*si));
- return;
#else /* linux */
/* FIXME: how do we do this on other systems? */
- return;
-#endif /* linux */
+
+ RegCreateKey16(hkey,"0",&xhkey);
+ RegSetValueEx32A(xhkey,"Identifier",0,REG_SZ,"CPU 386",strlen("CPU 386"));
+#endif /* !linux */
+ if (xhkey)
+ RegCloseKey(xhkey);
+ RegCloseKey(hkey);
}
/***********************************************************************
diff --git a/misc/crtdll.c b/misc/crtdll.c
index dac9b30..7ca8fb9 100644
--- a/misc/crtdll.c
+++ b/misc/crtdll.c
@@ -34,7 +34,6 @@
#include <setjmp.h>
#include "win.h"
#include "windows.h"
-#include "stddebug.h"
#include "debug.h"
#include "module.h"
#include "heap.h"
@@ -83,12 +82,12 @@
int xargc,i,afterlastspace;
DWORD version;
- dprintf_crtdll(stddeb,"CRTDLL__GetMainArgs(%p,%p,%p,%ld).\n",
+ dprintf_info(crtdll,"CRTDLL__GetMainArgs(%p,%p,%p,%ld).\n",
argc,argv,environ,flag
);
CRTDLL_acmdln_dll = cmdline = HEAP_strdupA( GetProcessHeap(), 0,
GetCommandLine32A() );
- dprintf_crtdll(stddeb,"CRTDLL__GetMainArgs got \"%s\"\n",
+ dprintf_info(crtdll,"CRTDLL__GetMainArgs got \"%s\"\n",
cmdline);
version = GetVersion32();
@@ -131,7 +130,7 @@
CRTDLL_argv_dll = xargv;
*argv = xargv;
- dprintf_crtdll(stddeb,"CRTDLL__GetMainArgs found %d arguments\n",
+ dprintf_info(crtdll,"CRTDLL__GetMainArgs found %d arguments\n",
CRTDLL_argc_dll);
CRTDLL_environ_dll = *environ = GetEnvironmentStrings32A();
return 0;
@@ -147,7 +146,7 @@
{
_INITTERMFUN *current;
- dprintf_crtdll(stddeb,"_initterm(%p,%p)\n",start,end);
+ dprintf_info(crtdll,"_initterm(%p,%p)\n",start,end);
current=start;
while (current<end) {
if (*current) (*current)();
@@ -174,7 +173,7 @@
default:
file=fdopen(handle,mode);
}
- dprintf_crtdll(stddeb,
+ dprintf_info(crtdll,
"CRTDLL_fdopen open handle %d mode %s got file %p\n",
handle, mode, file);
return (DWORD)file;
@@ -214,7 +213,7 @@
DOS_FULL_NAME full_name;
if (!DOSFS_GetFullName( path, FALSE, &full_name )) {
- dprintf_crtdll(stddeb,"CRTDLL_fopen file %s bad name\n",path);
+ dprintf_warn(crtdll, "CRTDLL_fopen file %s bad name\n",path);
return 0;
}
@@ -235,14 +234,14 @@
else if (strstr(mode,"a+")) flagmode= O_RDWR | O_CREAT | O_APPEND;
else if (strchr(mode,'w')) flagmode = O_RDWR | O_CREAT | O_APPEND;
else if (strchr(mode,'b'))
- dprintf_crtdll(stderr,
+ dprintf_info(crtdll,
"CRTDLL_fopen %s in BINARY mode\n",path);
dos_fildes=FILE_Open(path, flagmode);
unix_fildes=FILE_GetUnixHandle(dos_fildes);
file = fdopen(unix_fildes,mode);
- dprintf_crtdll(stddeb,
+ dprintf_info(crtdll,
"CRTDLL_fopen file %s mode %s got ufh %d dfh %d file %p\n",
path,mode,unix_fildes,dos_fildes,file);
return (DWORD)file;
@@ -263,7 +262,7 @@
known binary extensions must be unchanged */
while ( (i < (nmemb*size)) && (ret==1)) {
ret=fread(temp,1,1,file);
- dprintf_crtdll(stddeb,
+ dprintf_info(crtdll,
"CRTDLL_fread got %c 0x%02x ret %d\n",
(isalpha(*(unsigned char*)temp))? *(unsigned char*)temp:
' ',*(unsigned char*)temp, ret);
@@ -272,18 +271,24 @@
i++;
}
else
- dprintf_crtdll(stddeb, "CRTDLL_fread skipping ^M\n");
+ dprintf_info(crtdll, "CRTDLL_fread skipping ^M\n");
}
- dprintf_crtdll(stddeb,
- "CRTDLL_fread 0x%08x items of size %d from file %p to %p%s\n",
- nmemb,size,file,ptr,(i!=nmemb)?" failed":"");
+ dprintf_info(crtdll,
+ "CRTDLL_fread 0x%08x items of size %d from file %p to %p\n",
+ nmemb,size,file,ptr,);
+ if(i!=nmemb)
+ dprintf_warn(crtdll, " failed!\n");
+
return i;
#else
ret=fread(ptr,size,nmemb,file);
- dprintf_crtdll(stddeb,
- "CRTDLL_fread 0x%08x items of size %d from file %p to %p%s\n",
- nmemb,size,file,ptr,(ret!=nmemb)?" failed":"");
+ dprintf_info(crtdll,
+ "CRTDLL_fread 0x%08x items of size %d from file %p to %p\n",
+ nmemb,size,file,ptr);
+ if(ret!=nmemb)
+ dprintf_warn(crtdll, " failed!\n");
+
return ret;
#endif
}
@@ -296,12 +301,14 @@
long ret;
ret=fseek(stream,offset,whence);
- dprintf_crtdll(stddeb,
- "CRTDLL_fseek file %p to 0x%08lx pos %s%s\n",
+ dprintf_info(crtdll,
+ "CRTDLL_fseek file %p to 0x%08lx pos %s\n",
stream,offset,(whence==SEEK_SET)?"SEEK_SET":
(whence==SEEK_CUR)?"SEEK_CUR":
- (whence==SEEK_END)?"SEEK_END":"UNKNOWN",
- (ret)?"failed":"");
+ (whence==SEEK_END)?"SEEK_END":"UNKNOWN");
+ if(ret)
+ dprintf_warn(crtdll, " failed!\n");
+
return ret;
}
@@ -313,7 +320,7 @@
long ret;
ret=ftell(stream);
- dprintf_crtdll(stddeb,
+ dprintf_info(crtdll,
"CRTDLL_ftell file %p at 0x%08lx\n",
stream,ret);
return ret;
@@ -327,9 +334,12 @@
size_t ret;
ret=fwrite(ptr,size,nmemb,file);
- dprintf_crtdll(stddeb,
- "CRTDLL_fwrite 0x%08x items of size %d from %p to file %p%s\n",
- nmemb,size,ptr,file,(ret!=nmemb)?" failed":"");
+ dprintf_info(crtdll,
+ "CRTDLL_fwrite 0x%08x items of size %d from %p to file %p\n",
+ nmemb,size,ptr,file);
+ if(ret!=nmemb)
+ dprintf_warn(crtdll, " Failed!\n");
+
return ret;
}
@@ -338,7 +348,7 @@
*/
INT32 __cdecl CRTDLL_setbuf(LPVOID file, LPSTR buf)
{
- dprintf_crtdll(stddeb,
+ dprintf_info(crtdll,
"CRTDLL_setbuf(file %p buf %p)\n",
file,buf);
/* this doesn't work:"void value not ignored as it ought to be"
@@ -371,7 +381,7 @@
default:
return (-1);
}
- dprintf_crtdll(stddeb,
+ dprintf_info(crtdll,
"CRTDLL_open_osfhandle(handle %08lx,flags %d) return %d\n",
osfhandle,flags,handle);
return handle;
@@ -445,7 +455,7 @@
*/
BOOL32 __cdecl CRTDLL__isatty(DWORD x)
{
- dprintf_crtdll(stderr,"CRTDLL__isatty(%ld)\n",x);
+ dprintf_info(crtdll,"CRTDLL__isatty(%ld)\n",x);
return TRUE;
}
@@ -462,7 +472,7 @@
len = (UINT32)write(fd,buf,(LONG)count);
else
len = _lwrite32(fd,buf,count);
- dprintf_crtdll(stddeb,"CRTDLL_write %d/%d byte to dfh %d from %p,\n",
+ dprintf_info(crtdll,"CRTDLL_write %d/%d byte to dfh %d from %p,\n",
len,count,fd,buf);
return len;
}
@@ -482,7 +492,7 @@
*/
void __cdecl CRTDLL__cexit(INT32 ret)
{
- dprintf_crtdll(stddeb,"CRTDLL__cexit(%d)\n",ret);
+ dprintf_info(crtdll,"CRTDLL__cexit(%d)\n",ret);
ExitProcess(ret);
}
@@ -492,7 +502,7 @@
*/
void __cdecl CRTDLL_exit(DWORD ret)
{
- dprintf_crtdll(stddeb,"CRTDLL_exit(%ld)\n",ret);
+ dprintf_info(crtdll,"CRTDLL_exit(%ld)\n",ret);
ExitProcess(ret);
}
@@ -502,7 +512,7 @@
*/
INT32 __cdecl CRTDLL__abnormal_termination(void)
{
- dprintf_crtdll(stddeb,"CRTDLL__abnormal_termination\n");
+ dprintf_info(crtdll,"CRTDLL__abnormal_termination\n");
return 0;
}
@@ -515,7 +525,10 @@
int ret;
ret = fflush(stream);
- dprintf_crtdll(stddeb,"CRTDLL_fflush %p returnd %d %s\n",stream,ret,(ret)?"":" failed");
+ dprintf_info(crtdll,"CRTDLL_fflush %p returnd %d\n",stream,ret);
+ if(ret)
+ dprintf_warn(crtdll, " Failed!\n");
+
return ret;
}
@@ -530,7 +543,7 @@
* windows95's ftp.exe.
*/
ret = gets(buf);
- dprintf_crtdll(stddeb,"CRTDLL_gets got %s\n",ret);
+ dprintf_info(crtdll,"CRTDLL_gets got %s\n",ret);
return ret;
}
@@ -558,7 +571,7 @@
*/
INT32 __cdecl CRTDLL_fputc( INT32 c, FILE *stream )
{
- dprintf_crtdll(stddeb,
+ dprintf_info(crtdll,
"CRTDLL_fputc %c to file %p\n",c,stream);
return fputc(c,stream);
}
@@ -569,7 +582,7 @@
*/
INT32 __cdecl CRTDLL_fputs( LPCSTR s, FILE *stream )
{
- dprintf_crtdll(stddeb,
+ dprintf_info(crtdll,
"CRTDLL_fputs %s to file %p\n",s,stream);
return fputs(s,stream);
}
@@ -580,7 +593,7 @@
*/
INT32 __cdecl CRTDLL_puts(LPCSTR s)
{
- dprintf_crtdll(stddeb,
+ dprintf_info(crtdll,
"CRTDLL_fputs %s \n",s);
return puts(s);
}
@@ -591,7 +604,7 @@
*/
INT32 __cdecl CRTDLL_putc(INT32 c, FILE *stream)
{
- dprintf_crtdll(stddeb,
+ dprintf_info(crtdll,
"CRTDLL_putc %c to file %p\n",c,stream);
return fputc(c,stream);
}
@@ -601,7 +614,7 @@
INT32 __cdecl CRTDLL_fgetc( FILE *stream )
{
int ret= fgetc(stream);
- dprintf_crtdll(stddeb,
+ dprintf_info(crtdll,
"CRTDLL_fgetc got %d\n",ret);
return ret;
}
@@ -613,7 +626,7 @@
INT32 __cdecl CRTDLL_getc( FILE *stream )
{
int ret= fgetc(stream);
- dprintf_crtdll(stddeb,
+ dprintf_info(crtdll,
"CRTDLL_getc got %d\n",ret);
return ret;
}
@@ -625,7 +638,7 @@
{
unsigned int ret = (x >> shift)|( x >>((sizeof(x))-shift));
- dprintf_crtdll(stddeb,
+ dprintf_info(crtdll,
"CRTDLL_rotl got 0x%08x rot %d ret 0x%08x\n",
x,shift,ret);
return ret;
@@ -638,7 +651,7 @@
{
unsigned long ret = (x >> shift)|( x >>((sizeof(x))-shift));
- dprintf_crtdll(stddeb,
+ dprintf_info(crtdll,
"CRTDLL_lrotl got 0x%08lx rot %d ret 0x%08lx\n",
x,shift,ret);
return ret;
@@ -663,9 +676,12 @@
*control_M='\n';
*(control_M+1)=0;
}
- dprintf_crtdll(stddeb,
- "CRTDLL_fgets got %s for %d chars from file %p%s\n",
- s,size,stream,(ret)?"":" failed");
+ dprintf_info(crtdll,
+ "CRTDLL_fgets got %s for %d chars from file %p\n",
+ s,size,stream);
+ if(ret)
+ dprintf_warn(crtdll, " Failed!\n");
+
return ret;
}
@@ -720,7 +736,7 @@
*/
unsigned char* __cdecl CRTDLL__mbscpy(unsigned char *x,unsigned char *y)
{
- dprintf_crtdll(stddeb,"CRTDLL_mbscpy %s and %s\n",x,y);
+ dprintf_info(crtdll,"CRTDLL_mbscpy %s and %s\n",x,y);
return strcpy(x,y);
}
@@ -761,14 +777,13 @@
{
unsigned char *y =x;
- dprintf_crtdll(stddeb,
- "CRTDLL_strlwr got %s",x);
+ dprintf_info(crtdll, "CRTDLL_strlwr got %s\n", x);
while (*y) {
if ((*y > 0x40) && (*y< 0x5b))
*y = *y + 0x20;
y++;
}
- dprintf_crtdll(stddeb," returned %s\n",x);
+ dprintf_info(crtdll, " returned %s\n", x);
return x;
}
@@ -795,7 +810,7 @@
}
/* If buffer too short, exit. */
if (i > SYSBUF_LENGTH) {
- dprintf_crtdll(stddeb,"_system buffer to small\n");
+ dprintf_info(crtdll,"_system buffer to small\n");
return 127;
}
@@ -812,7 +827,7 @@
}
*bp++ = '"';
*bp = 0;
- dprintf_crtdll(stddeb,
+ dprintf_info(crtdll,
"_system got \"%s\", executing \"%s\"\n",x,buffer);
return system(buffer);
@@ -866,8 +881,7 @@
*/
VOID __cdecl CRTDLL_longjmp(jmp_buf env, int val)
{
- dprintf_crtdll(stdnimp,"CRTDLL_longjmp semistup, expect crash\n");
- dprintf_crtdll(stddeb, "CRTDLL_longjmp semistup, expect crash\n");
+ dprintf_fixme(crtdll,"CRTDLL_longjmp semistup, expect crash\n");
return longjmp(env, val);
}
@@ -956,8 +970,12 @@
fclose(stream);
ret = _lclose32( dos_handle);
}
- dprintf_crtdll(stddeb,"CRTDLL_fclose(%p) ufh %d dfh %d%s\n",
- stream,unix_handle,dos_handle,(ret)?" failed":"");
+ dprintf_info(crtdll,"CRTDLL_fclose(%p) ufh %d dfh %d\n",
+ stream,unix_handle,dos_handle);
+
+ if(ret)
+ dprintf_warn(crtdll, " Failed!\n");
+
return ret;
}
@@ -970,13 +988,16 @@
DOS_FULL_NAME full_name;
if (!DOSFS_GetFullName( pathname, FALSE, &full_name )) {
- dprintf_crtdll(stddeb,"CRTDLL_unlink file %s bad name\n",pathname);
+ dprintf_warn(crtdll, "CRTDLL_unlink file %s bad name\n",pathname);
return EOF;
}
ret=unlink(full_name.long_name);
- dprintf_crtdll(stddeb,"CRTDLL_unlink(%s unix %s)%s\n",
- pathname,full_name.long_name, (ret)?" failed":"");
+ dprintf_info(crtdll,"CRTDLL_unlink(%s unix %s)\n",
+ pathname,full_name.long_name);
+ if(ret)
+ dprintf_warn(crtdll, " Failed!\n");
+
return ret;
}
@@ -1017,12 +1038,13 @@
if (!DOSFS_GetFullName( filename, TRUE, &full_name ))
{
- dprintf_crtdll(stddeb,"CRTDLL__stat filename %s bad name\n",filename);
+ dprintf_warn(crtdll, "CRTDLL__stat filename %s bad name\n",filename);
return -1;
}
ret=stat(full_name.long_name,&mystat);
- dprintf_crtdll(stddeb,"CRTDLL__stat %s%s\n",
- filename, (ret)?" failed":"");
+ dprintf_info(crtdll,"CRTDLL__stat %s\n", filename);
+ if(ret)
+ dprintf_warn(crtdll, " Failed!\n");
/* FIXME: should check what Windows returns */
@@ -1061,11 +1083,11 @@
if (flags & 0x0200 ) wineflags |= O_TRUNC;
if (flags & 0x0400 ) wineflags |= O_EXCL;
if (flags & 0xf0f4 )
- dprintf_crtdll(stddeb,"CRTDLL_open file unsupported flags 0x%04x\n",flags);
+ dprintf_info(crtdll,"CRTDLL_open file unsupported flags 0x%04x\n",flags);
/* End Fixme */
ret = FILE_Open(path,wineflags);
- dprintf_crtdll(stddeb,"CRTDLL_open file %s mode 0x%04x (lccmode 0x%04x) got dfh %d\n",
+ dprintf_info(crtdll,"CRTDLL_open file %s mode 0x%04x (lccmode 0x%04x) got dfh %d\n",
path,wineflags,flags,ret);
return ret;
}
@@ -1077,7 +1099,10 @@
{
int ret=_lclose32(fd);
- dprintf_crtdll(stddeb,"CRTDLL_close(%d)%s\n",fd,(ret)?" failed":"");
+ dprintf_info(crtdll,"CRTDLL_close(%d)\n",fd);
+ if(ret)
+ dprintf_warn(crtdll, " Failed!\n");
+
return ret;
}
@@ -1089,7 +1114,7 @@
int ret;
ret=feof(stream);
- dprintf_crtdll(stddeb,"CRTDLL_feof(%p) %s\n",stream,(ret)?"true":"false");
+ dprintf_info(crtdll,"CRTDLL_feof(%p) %s\n",stream,(ret)?"true":"false");
return ret;
}
@@ -1335,10 +1360,9 @@
#define O_TEXT 0x4000
#define O_BINARY 0x8000
- dprintf_crtdll(stddeb,
- "CRTDLL._setmode on fhandle %d mode %s, STUB.\n",
- fh,(mode=O_TEXT)?"O_TEXT":
- (mode=O_BINARY)?"O_BINARY":"UNKNOWN");
+ dprintf_fixme(crtdll, "CRTDLL._setmode on fhandle %d mode %s, STUB.\n",
+ fh,(mode=O_TEXT)?"O_TEXT":
+ (mode=O_BINARY)?"O_BINARY":"UNKNOWN");
return -1;
}
@@ -1368,7 +1392,7 @@
else if (!(*mb))
ret =0;
- dprintf_crtdll(stderr,"CRTDLL_mlen %s for max %d bytes ret %d\n",mb,size,ret);
+ dprintf_info(crtdll,"CRTDLL_mlen %s for max %d bytes ret %d\n",mb,size,ret);
return ret;
}
@@ -1395,7 +1419,7 @@
p++;
ret = (p -wcs);
- dprintf_crtdll(stddeb,"CRTDLL_mbstowcs %s for %d chars put %d wchars\n",
+ dprintf_info(crtdll,"CRTDLL_mbstowcs %s for %d chars put %d wchars\n",
mbs,size,ret);
return ret;
}
@@ -1423,7 +1447,7 @@
else
ret = -1;
- dprintf_crtdll(stderr,"CRTDLL_mbtowc %s for %d chars\n",mb,size);
+ dprintf_info(crtdll,"CRTDLL_mbtowc %s for %d chars\n",mb,size);
return ret;
}
@@ -1484,7 +1508,7 @@
}
if (!DOSFS_GetFullName( name, FALSE, &full_name )) return NULL;
lstrcpyn32A(buf,full_name.short_name,size);
- dprintf_crtdll(stderr,"CRTDLL_fullpath got %s\n",buf);
+ dprintf_info(crtdll,"CRTDLL_fullpath got %s\n",buf);
return buf;
}
@@ -1500,7 +1524,7 @@
*/
char * drivechar,*dirchar,*namechar;
- dprintf_crtdll(stddeb,"CRTDLL__splitpath got %s\n",path);
+ dprintf_info(crtdll,"CRTDLL__splitpath got %s\n",path);
drivechar = strchr(path,':');
dirchar = strrchr(path,'/');
@@ -1544,7 +1568,7 @@
}
}
- dprintf_crtdll(stddeb,"CRTDLL__splitpath found %s %s %s %s\n",drive,directory,filename,extension);
+ dprintf_info(crtdll,"CRTDLL__splitpath found %s %s %s %s\n",drive,directory,filename,extension);
}
@@ -1574,7 +1598,7 @@
if (len > size)
{
/* set error to ERANGE */
- dprintf_crtdll(stddeb,"CRTDLL_getcwd buffer to small\n");
+ dprintf_info(crtdll,"CRTDLL_getcwd buffer to small\n");
return NULL;
}
return buf;
@@ -1616,29 +1640,28 @@
DOS_FULL_NAME tempname;
if ((ret = tempnam(dir,prefix))==NULL) {
- dprintf_crtdll(stddeb,
- "CRTDLL_tempnam Unable to get unique filename\n");
+ dprintf_warn(crtdll, "Unable to get unique filename\n");
return NULL;
}
if (!DOSFS_GetFullName(ret,FALSE,&tempname))
{
- dprintf_crtdll(stddeb,
+ dprintf_info(crtdll,
"CRTDLL_tempnam Wrong path?\n");
return NULL;
}
free(ret);
if ((ret = CRTDLL_malloc(strlen(tempname.short_name)+1)) == NULL) {
- dprintf_crtdll(stddeb,
+ dprintf_warn(crtdll,
"CRTDLL_tempnam CRTDL_malloc for shortname failed\n");
return NULL;
}
if ((ret = strcpy(ret,tempname.short_name)) == NULL) {
- dprintf_crtdll(stddeb,
+ dprintf_warn(crtdll,
"CRTDLL_tempnam Malloc for shortname failed\n");
return NULL;
}
- dprintf_crtdll(stddeb,"CRTDLL_tempnam dir %s prefix %s got %s\n",
+ dprintf_info(crtdll,"CRTDLL_tempnam dir %s prefix %s got %s\n",
dir,prefix,ret);
return ret;
@@ -1654,20 +1677,19 @@
char *ret;
if ((ret =tmpnam(s))== NULL) {
- dprintf_crtdll(stddeb,
- "CRTDLL_tmpnam Unable to get unique filename\n");
+ dprintf_warn(crtdll, "Unable to get unique filename\n");
return NULL;
}
if (!DOSFS_GetFullName(ret,FALSE,&CRTDLL_tmpname))
{
- dprintf_crtdll(stddeb,
+ dprintf_info(crtdll,
"CRTDLL_tmpnam Wrong path?\n");
return NULL;
}
strcat(CRTDLL_tmpname.short_name,".");
- dprintf_crtdll(stddeb,"CRTDLL_tmpnam for buf %p got %s\n",
+ dprintf_info(crtdll,"CRTDLL_tmpnam for buf %p got %s\n",
s,CRTDLL_tmpname.short_name);
- dprintf_crtdll(stddeb,"CRTDLL_tmpnam long got %s\n",
+ dprintf_info(crtdll,"CRTDLL_tmpnam long got %s\n",
CRTDLL_tmpname.long_name);
if ( s != NULL)
return strcpy(s,CRTDLL_tmpname.short_name);
@@ -1692,7 +1714,7 @@
*/
VOID __cdecl CRTDLL_signal(int sig, sig_handler_type ptr)
{
- dprintf_crtdll(stddeb,"CRTDLL_signal %d %p: STUB!\n",sig,ptr);
+ dprintf_fixme(crtdll, "CRTDLL_signal %d %p: STUB!\n", sig, ptr);
}
/*********************************************************************
@@ -1706,6 +1728,6 @@
*/
VOID __cdecl CRTDLL__sleep(unsigned long timeout)
{
- dprintf_crtdll(stddeb,"CRTDLL__sleep for %ld milliseconds\n",timeout);
+ dprintf_info(crtdll,"CRTDLL__sleep for %ld milliseconds\n",timeout);
Sleep((timeout)?timeout:1);
}
diff --git a/misc/ddeml.c b/misc/ddeml.c
index b430475..4367c53 100644
--- a/misc/ddeml.c
+++ b/misc/ddeml.c
@@ -9,7 +9,6 @@
#include <stdio.h>
#include "ddeml.h"
-#include "stddebug.h"
#include "debug.h"
diff --git a/misc/debugstr.c b/misc/debugstr.c
index 2ef4649..e720a33 100644
--- a/misc/debugstr.c
+++ b/misc/debugstr.c
@@ -1,6 +1,7 @@
#include "debugstr.h"
#include "xmalloc.h"
#include <stdlib.h>
+#include <stdio.h>
/* ---------------------------------------------------------------------- */
@@ -125,3 +126,18 @@
}
/* ---------------------------------------------------------------------- */
+/* This routine returns a nicely formated name of the resource res
+ If the resource name is a string, it will return '<res-name>'
+ If it is a number, it will return #<4-digit-hex-number> */
+LPSTR
+debugres (const void *res)
+{
+ if (HIWORD((DWORD)res))
+ return debugstr_a((LPCSTR)res);
+ else{
+ char resname[10];
+ sprintf(resname, "#%04x", LOWORD(res));
+ return debugstr_a (resname);
+ }
+}
+
diff --git a/misc/error.c b/misc/error.c
index fc2e124..3a36237 100644
--- a/misc/error.c
+++ b/misc/error.c
@@ -9,14 +9,11 @@
#include <string.h>
#include "windows.h"
-#include "stddebug.h"
#include "debug.h"
-#ifdef DEBUG_RUNTIME
-
#define ErrorString(manifest) { manifest, # manifest }
-const struct {
+static const struct {
int constant;
const char *name;
} ErrorStrings[] = {
@@ -47,9 +44,7 @@
ErrorString(ERR_SELBITMAP)
};
-#define ErrorStringCount (sizeof(ErrorStrings) / sizeof(ErrorStrings[0]))
-
-const struct {
+static const struct {
int constant;
const char *name;
} ParamErrorStrings[] = {
@@ -90,27 +85,25 @@
ErrorString(ERR_BAD_HMETAFILE)
};
+#undef ErrorString
+#define ErrorStringCount (sizeof(ErrorStrings) / sizeof(ErrorStrings[0]))
#define ParamErrorStringCount (sizeof(ParamErrorStrings) / sizeof(ParamErrorStrings[0]))
-#endif /* DEBUG_RUNTIME */
-
/***********************************************************************
* GetErrorString (internal)
*/
-static const char *GetErrorString(UINT16 uErr) {
- static char buffer[80];
+static const char *GetErrorString(UINT16 uErr)
+{
+ static char buffer[80];
+ int i;
-#ifdef DEBUG_RUNTIME
- int i;
+ for (i = 0; i < ErrorStringCount; i++) {
+ if (uErr == ErrorStrings[i].constant)
+ return ErrorStrings[i].name;
+ }
- for (i = 0; i < ErrorStringCount; i++) {
- if (uErr == ErrorStrings[i].constant)
- return ErrorStrings[i].name;
- }
-#endif
-
- sprintf(buffer, "%x", uErr);
- return buffer;
+ sprintf(buffer, "%x", uErr);
+ return buffer;
}
@@ -126,7 +119,6 @@
} else
buffer[0] = '\0';
-#ifdef DEBUG_RUNTIME
{
int i;
@@ -137,7 +129,6 @@
}
}
}
-#endif
sprintf(buffer + strlen(buffer), "%x", uErr);
return buffer;
diff --git a/misc/lstr.c b/misc/lstr.c
index 1e54527..252d081 100644
--- a/misc/lstr.c
+++ b/misc/lstr.c
@@ -31,7 +31,6 @@
#include "ldt.h"
#include "stackframe.h"
#include "module.h"
-#include "stddebug.h"
#include "debug.h"
/* Funny to divide them between user and kernel. */
@@ -518,7 +517,7 @@
DWORD width = dwFlags & FORMAT_MESSAGE_MAX_WIDTH_MASK;
DWORD nolinefeed = 0;
- dprintf_resource(stddeb,
+ dprintf_info(resource,
"FormatMessage32A(0x%lx,%p,%ld,0x%lx,%p,%ld,%p)\n",
dwFlags,lpSource,dwMessageId,dwLanguageId,lpBuffer,nSize,args
);
@@ -535,10 +534,10 @@
INT32 bufsize;
dwMessageId &= 0xFFFF;
- bufsize=LoadMessage32A(0,dwMessageId,dwLanguageId,NULL,100);
+ bufsize=LoadMessage32A((HMODULE32)lpSource,dwMessageId,dwLanguageId,NULL,100);
if (bufsize) {
from = HeapAlloc( GetProcessHeap(), 0, bufsize + 1 );
- LoadMessage32A(0,dwMessageId,dwLanguageId,from,bufsize+1);
+ LoadMessage32A((HMODULE32)lpSource,dwMessageId,dwLanguageId,from,bufsize+1);
}
}
target = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, 100);
@@ -684,7 +683,7 @@
DWORD width = dwFlags & FORMAT_MESSAGE_MAX_WIDTH_MASK;
DWORD nolinefeed = 0;
- dprintf_resource(stddeb,
+ dprintf_info(resource,
"FormatMessage32A(0x%lx,%p,%ld,0x%lx,%p,%ld,%p)\n",
dwFlags,lpSource,dwMessageId,dwLanguageId,lpBuffer,nSize,args
);
@@ -702,11 +701,11 @@
INT32 bufsize;
dwMessageId &= 0xFFFF;
- bufsize=LoadMessage32A(0,dwMessageId,dwLanguageId,NULL,100);
+ bufsize=LoadMessage32A((HMODULE32)lpSource,dwMessageId,dwLanguageId,NULL,100);
if (bufsize)
{
from = HeapAlloc( GetProcessHeap(), 0, bufsize + 1 );
- LoadMessage32A(0,dwMessageId,dwLanguageId,from,bufsize+1);
+ LoadMessage32A((HMODULE32)lpSource,dwMessageId,dwLanguageId,from,bufsize+1);
}
}
target = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, 100 );
diff --git a/misc/lzexpand.c b/misc/lzexpand.c
index 90c2323..f9defeb 100644
--- a/misc/lzexpand.c
+++ b/misc/lzexpand.c
@@ -19,7 +19,6 @@
#include "heap.h"
#include "ldt.h"
#include "lzexpand.h"
-#include "stddebug.h"
#include "debug.h"
@@ -119,7 +118,7 @@
*/
INT16 WINAPI LZStart16(void)
{
- dprintf_file(stddeb,"LZStart16(void)\n");
+ dprintf_info(file,"LZStart16(void)\n");
return 1;
}
@@ -129,7 +128,7 @@
*/
INT32 WINAPI LZStart32(void)
{
- dprintf_file(stddeb,"LZStart32(void)\n");
+ dprintf_info(file,"LZStart32(void)\n");
return 1;
}
@@ -162,7 +161,7 @@
struct lzstate *lzs;
DWORD ret;
- dprintf_file(stddeb,"LZInit(%d)\n",hfSrc);
+ dprintf_info(file,"LZInit(%d)\n",hfSrc);
ret=read_header(hfSrc,&head);
if (ret<=0) {
_llseek32(hfSrc,0,SEEK_SET);
@@ -195,7 +194,7 @@
*/
void WINAPI LZDone(void)
{
- dprintf_file(stddeb,"LZDone()\n");
+ dprintf_info(file,"LZDone()\n");
}
@@ -227,7 +226,7 @@
INT32 fnislowercased,ret,len;
LPSTR s,t;
- dprintf_file(stddeb,"GetExpandedName(%s)\n",in);
+ dprintf_info(file,"GetExpandedName(%s)\n",in);
fd=OpenFile32(in,&ofs,OF_READ);
if (fd==HFILE_ERROR32)
return (INT32)(INT16)LZERROR_BADINHANDLE;
@@ -323,7 +322,7 @@
struct lzstate *lzs;
buf=(LPBYTE)vbuf;
- dprintf_file(stddeb,"LZRead32(%d,%p,%d)\n",fd,buf,toread);
+ dprintf_info(file,"LZRead32(%d,%p,%d)\n",fd,buf,toread);
howmuch=toread;
for (i=0;i<nroflzstates;i++)
if (lzstates[i].lzfd==fd)
@@ -427,7 +426,7 @@
struct lzstate *lzs;
LONG newwanted;
- dprintf_file(stddeb,"LZSeek(%d,%ld,%d)\n",fd,off,type);
+ dprintf_info(file,"LZSeek(%d,%ld,%d)\n",fd,off,type);
for (i=0;i<nroflzstates;i++)
if (lzstates[i].lzfd==fd)
break;
@@ -480,7 +479,7 @@
BYTE buf[BUFLEN];
INT32 WINAPI (*xread)(HFILE32,LPVOID,UINT32);
- dprintf_file(stddeb,"LZCopy(%d,%d)\n",src,dest);
+ dprintf_info(file,"LZCopy(%d,%d)\n",src,dest);
for (i=0;i<nroflzstates;i++)
if (src==lzstates[i].lzfd)
break;
@@ -546,7 +545,7 @@
{
HFILE32 fd,cfd;
- dprintf_file(stddeb,"LZOpenFile(%s,%p,%d)\n",fn,ofs,mode);
+ dprintf_info(file,"LZOpenFile(%s,%p,%d)\n",fn,ofs,mode);
/* 0x70 represents all OF_SHARE_* flags, ignore them for the check */
fd=OpenFile32(fn,ofs,mode);
if (fd==HFILE_ERROR32)
@@ -604,7 +603,7 @@
{
int i;
- dprintf_file(stddeb,"LZClose(%d)\n",fd);
+ dprintf_info(file,"LZClose(%d)\n",fd);
for (i=0;i<nroflzstates;i++)
if (lzstates[i].lzfd==fd)
break;
@@ -627,7 +626,7 @@
*/
LONG WINAPI CopyLZFile16( HFILE16 src, HFILE16 dest )
{
- dprintf_file(stddeb,"CopyLZFile16(%d,%d)\n",src,dest);
+ dprintf_info(file,"CopyLZFile16(%d,%d)\n",src,dest);
return LZCopy32(src,dest);
}
@@ -640,6 +639,6 @@
*/
LONG WINAPI CopyLZFile32( HFILE32 src, HFILE32 dest )
{
- dprintf_file(stddeb,"CopyLZFile32(%d,%d)\n",src,dest);
+ dprintf_info(file,"CopyLZFile32(%d,%d)\n",src,dest);
return LZCopy32(src,dest);
}
diff --git a/misc/main.c b/misc/main.c
index 2ca79c7..2ecb720 100644
--- a/misc/main.c
+++ b/misc/main.c
@@ -29,13 +29,11 @@
#include "process.h"
#include "shell.h"
#include "winbase.h"
-#define DEBUG_DEFINE_VARIABLES
-#include "stddebug.h"
#include "debug.h"
+#include "debugdefs.h"
#include "xmalloc.h"
#include "version.h"
-
const WINE_LANGUAGE_DEF Languages[] =
{
{"En",0x0409}, /* LANG_En */
@@ -46,14 +44,14 @@
{"Fi",0x040B}, /* LANG_Fi */
{"Da",0x0406}, /* LANG_Da */
{"Cz",0x0405}, /* LANG_Cz */
- {"Eo", 0}, /* LANG_Eo */ /* FIXME languageid */
+ {"Eo",0x0425}, /* LANG_Eo */
{"It",0x0410}, /* LANG_It */
{"Ko",0x0412}, /* LANG_Ko */
{"Hu",0x0436}, /* LANG_Hu */
- {"Pl",0x0415}, /* LANG_Pl */
- {"Po",0x0416}, /* LANG_Po */
- {"Sw",0x0417}, /* LANG_Sw */
- {"Ca", 0}, /* LANG_Ca */ /* FIXME languageid */
+ {"Pl",0x0415}, /* LANG_Pl */
+ {"Po",0x0416}, /* LANG_Po */
+ {"Sw",0x0417}, /* LANG_Sw */
+ {"Ca",0x0426}, /* LANG_Ca */
{NULL,0}
};
@@ -206,37 +204,53 @@
* Turns specific debug messages on or off, according to "options".
* Returns TRUE if parsing was successful
*/
-#ifdef DEBUG_RUNTIME
-
BOOL32 ParseDebugOptions(char *options)
{
- int l;
+ int l, cls;
if (strlen(options)<3)
return FALSE;
do
{
- if ((*options!='+')&&(*options!='-'))
- return FALSE;
+ if ((*options!='+')&&(*options!='-')){
+ int j;
+
+ for(j=0; j<DEBUG_CLASS_COUNT; j++)
+ if(!lstrncmpi32A(options, debug_cl_name[j], strlen(debug_cl_name[j])))
+ break;
+ if(j==DEBUG_CLASS_COUNT)
+ return FALSE;
+ options += strlen(debug_cl_name[j]);
+ if ((*options!='+')&&(*options!='-'))
+ return FALSE;
+ cls = j;
+ }
+ else
+ cls = -1; /* all classes */
+
if (strchr(options,','))
l=strchr(options,',')-options;
else
l=strlen(options);
+
if (!lstrncmpi32A(options+1,"all",l-1))
{
- int i;
- for (i=0;i<sizeof(debug_msg_enabled)/sizeof(short);i++)
- debug_msg_enabled[i]=(*options=='+');
+ int i, j;
+ for (i=0; i<DEBUG_CHANNEL_COUNT; i++)
+ for(j=0; j<DEBUG_CLASS_COUNT; j++)
+ if(cls == -1 || cls == j)
+ debug_msg_enabled[i][j]=(*options=='+');
}
else
{
- int i;
- for (i=0;i<sizeof(debug_msg_enabled)/sizeof(short);i++)
- if (debug_msg_name && (!lstrncmpi32A(options+1,debug_msg_name[i],l-1)))
- {
- debug_msg_enabled[i]=(*options=='+');
- break;
- }
- if (i==sizeof(debug_msg_enabled)/sizeof(short))
+ int i, j;
+ for (i=0; i<DEBUG_CHANNEL_COUNT; i++)
+ if (debug_ch_name && (!lstrncmpi32A(options+1,debug_ch_name[i],l-1))){
+ for(j=0; j<DEBUG_CLASS_COUNT; j++)
+ if(cls == -1 || cls == j)
+ debug_msg_enabled[i][j]=(*options=='+');
+ break;
+ }
+ if (i==DEBUG_CHANNEL_COUNT)
return FALSE;
}
options+=l;
@@ -248,8 +262,6 @@
return TRUE;
}
-#endif
-
/***********************************************************************
* MAIN_ParseLanguageOption
*
@@ -370,29 +382,34 @@
Options.managed = TRUE;
if (MAIN_GetResource( db, ".mode", &value))
MAIN_ParseModeOption( (char *)value.addr );
-
-#ifdef DEBUG_RUNTIME
if (MAIN_GetResource( db, ".debugoptions", &value))
ParseDebugOptions((char*)value.addr);
-#endif
if (MAIN_GetResource( db, ".debugmsg", &value))
{
#ifndef DEBUG_RUNTIME
fprintf(stderr,"%s: Option \"-debugmsg\" not implemented.\n" \
- " Recompile with DEBUG_RUNTIME in include/stddebug.h defined.\n",
+ " Recompile with DEBUG_RUNTIME in include/debugtools.h defined.\n",
argv[0]);
exit(1);
#else
if (ParseDebugOptions((char*)value.addr)==FALSE)
{
int i;
- fprintf(stderr,"%s: Syntax: -debugmsg +xxx,... or -debugmsg -xxx,...\n",argv[0]);
- fprintf(stderr,"Example: -debugmsg +all,-heap turn on all messages except heap messages\n");
+ fprintf(stderr,"%s: Syntax: -debugmsg [class]+xxx,... or "
+ "-debugmsg [class]-xxx,...\n",argv[0]);
+ fprintf(stderr,"Example: -debugmsg +all,warn-heap"
+ "turn on all messages except warning heap messages\n");
+
+ fprintf(stderr,"Available message classes:\n");
+ for(i=0;i<DEBUG_CLASS_COUNT;i++)
+ fprintf(stderr, "%-9s", debug_cl_name[i]);
+ fprintf(stderr,"\n\n");
+
fprintf(stderr,"Available message types:\n");
fprintf(stderr,"%-9s ","all");
- for(i=0;i<sizeof(debug_msg_enabled)/sizeof(short);i++)
- if(debug_msg_name[i])
- fprintf(stderr,"%-9s%c",debug_msg_name[i],
+ for(i=0;i<DEBUG_CHANNEL_COUNT;i++)
+ if(debug_ch_name[i])
+ fprintf(stderr,"%-9s%c",debug_ch_name[i],
(((i+2)%8==0)?'\n':' '));
fprintf(stderr,"\n\n");
exit(1);
diff --git a/misc/mpr.c b/misc/mpr.c
index 3679aff..3691e61 100644
--- a/misc/mpr.c
+++ b/misc/mpr.c
@@ -5,7 +5,6 @@
#include <stdio.h>
#include "win.h"
-#include "stddebug.h"
#include "debug.h"
DWORD WINAPI WNetGetCachedPassword(
diff --git a/misc/ntdll.c b/misc/ntdll.c
index 933ae14..f48f370 100644
--- a/misc/ntdll.c
+++ b/misc/ntdll.c
@@ -14,7 +14,6 @@
#include "windows.h"
#include "ntdll.h"
#include "heap.h"
-#include "stddebug.h"
#include "debug.h"
#include "module.h"
#include "heap.h"
diff --git a/misc/registry.c b/misc/registry.c
index 1343fb4..3e47851 100644
--- a/misc/registry.c
+++ b/misc/registry.c
@@ -25,7 +25,6 @@
#include "winerror.h"
#include "file.h"
#include "heap.h"
-#include "stddebug.h"
#include "debug.h"
#include "xmalloc.h"
#include "winreg.h"
@@ -118,10 +117,10 @@
for (i=0;i<nrofopenhandles;i++) {
if (openhandles[i].lpkey==lpkey) {
- dprintf_reg(stddeb,"add_handle:Tried to add %p twice!\n",lpkey);
+ dprintf_warn(reg, "add_handle:Tried to add %p twice!\n",lpkey);
}
if (openhandles[i].hkey==hkey) {
- dprintf_reg(stddeb,"add_handle:Tried to add %lx twice!\n",(LONG)hkey);
+ dprintf_warn(reg, "add_handle:Tried to add %lx twice!\n",(LONG)hkey);
}
}
openhandles=xrealloc( openhandles,
@@ -140,7 +139,7 @@
for (i=0;i<nrofopenhandles;i++)
if (openhandles[i].hkey==hkey)
return openhandles[i].lpkey;
- dprintf_reg(stddeb,"get_handle:Didn't find handle %lx?\n",(LONG)hkey);
+ dprintf_warn(reg, "get_handle:Didn't find handle %lx?\n",(LONG)hkey);
return NULL;
}
@@ -152,7 +151,7 @@
if (openhandles[i].hkey==hkey)
break;
if (i==nrofopenhandles) {
- dprintf_reg(stddeb,"remove_handle:Didn't find handle %08x?\n",hkey);
+ dprintf_warn(reg, "remove_handle:Didn't find handle %08x?\n",hkey);
return;
}
memcpy( openhandles+i,
@@ -200,7 +199,7 @@
case HKEY_CURRENT_CONFIG:
return key_current_config;
default:
- dprintf_reg(stddeb,"lookup_hkey(%lx), special key!\n",
+ dprintf_warn(reg, "lookup_hkey(%lx), special key!\n",
(LONG)hkey
);
return get_handle(hkey);
@@ -289,42 +288,12 @@
void
SHELL_StartupRegistry() {
- HKEY hkey,xhkey=0;
- FILE *F;
- char buf[200],cpubuf[200];
+ HKEY hkey;
+ char buf[200];
- RegCreateKey16(HKEY_DYN_DATA,"\\PerfStats\\StatData",&xhkey);
- RegCloseKey(xhkey);
- xhkey = 0;
- RegCreateKey16(HKEY_LOCAL_MACHINE,"\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor",&hkey);
-#ifdef linux
- F=fopen("/proc/cpuinfo","r");
- if (F) {
- int procnr=-1,x;
- while (NULL!=fgets(buf,200,F)) {
- if (sscanf(buf,"processor\t: %d",&x)) {
- sprintf(buf,"%d",x);
- if (xhkey)
- RegCloseKey(xhkey);
- procnr=x;
- RegCreateKey16(hkey,buf,&xhkey);
- }
- if (sscanf(buf,"cpu\t\t: %s",cpubuf)) {
- sprintf(buf,"CPU %s",cpubuf);
- if (xhkey)
- RegSetValueEx32A(xhkey,"Identifier",0,REG_SZ,buf,strlen(buf));
- }
- }
- fclose(F);
- }
- if (xhkey)
- RegCloseKey(xhkey);
+ RegCreateKey16(HKEY_DYN_DATA,"\\PerfStats\\StatData",&hkey);
RegCloseKey(hkey);
-#else
- /* FIXME */
- RegCreateKey16(hkey,"0",&xhkey);
- RegSetValueEx32A(xhkey,"Identifier",0,REG_SZ,"CPU 386",strlen("CPU 386"));
-#endif
+
RegOpenKey16(HKEY_LOCAL_MACHINE,"\\HARDWARE\\DESCRIPTION\\System",&hkey);
RegSetValueEx32A(hkey,"Identifier",0,REG_SZ,"SystemType WINE",strlen("SystemType WINE"));
RegCloseKey(hkey);
@@ -342,9 +311,9 @@
* SysServices
*/
if (-1!=gethostname(buf,200)) {
- RegCreateKey16(HKEY_LOCAL_MACHINE,"System\\CurrentControlSet\\Control\\ComputerName\\ComputerName",&xhkey);
- RegSetValueEx16(xhkey,"ComputerName",0,REG_SZ,buf,strlen(buf)+1);
- RegCloseKey(xhkey);
+ RegCreateKey16(HKEY_LOCAL_MACHINE,"System\\CurrentControlSet\\Control\\ComputerName\\ComputerName",&hkey);
+ RegSetValueEx16(hkey,"ComputerName",0,REG_SZ,buf,strlen(buf)+1);
+ RegCloseKey(hkey);
}
}
/************************ SAVE Registry Function ****************************/
@@ -562,6 +531,10 @@
_find_or_add_key(LPKEYSTRUCT lpkey,LPWSTR keyname) {
LPKEYSTRUCT lpxkey,*lplpkey;
+ if (keyname[0]==0) {
+ free(keyname);
+ return lpkey;
+ }
lplpkey= &(lpkey->nextsub);
lpxkey = *lplpkey;
while (lpxkey) {
@@ -833,7 +806,7 @@
return 0;
}
if (ver!=REGISTRY_SAVE_VERSION) {
- dprintf_reg(stddeb,__FILE__":_wine_loadsubreg:Old format (%d) registry found, ignoring it. (buf was %s).\n",ver,buf);
+ dprintf_info(reg,__FILE__":_wine_loadsubreg:Old format (%d) registry found, ignoring it. (buf was %s).\n",ver,buf);
free(buf);
return 0;
}
@@ -855,8 +828,8 @@
F=fopen(fn,"rb");
if (F==NULL) {
- dprintf_reg(stddeb,__FILE__":Couldn't open %s for reading: %s\n",
- fn,strerror(errno)
+ dprintf_warn(reg,"Couldn't open %s for reading: %s\n",
+ fn,strerror(errno)
);
return;
}
@@ -885,7 +858,7 @@
valfrom = from->values+j;
name=valfrom->name;
if (name) name=strdupW(name);
- data=(LPBYTE)malloc(valfrom->len);
+ data=(LPBYTE)xmalloc(valfrom->len);
memcpy(data,valfrom->data,valfrom->len);
_find_or_add_value(
@@ -1033,7 +1006,7 @@
{
/* Disk Key Header structure (RGDB part) */
- struct dkh {
+ struct dkh {
unsigned long nextkeyoff;
unsigned short nrLS;
unsigned short nrMS;
@@ -1098,6 +1071,7 @@
return (NULL);
}
+ assert((dkh.keynamelen<2) || curdata[0]);
lpxkey=_find_or_add_key(lpkey,strcvtA2W(curdata, dkh.keynamelen));
curdata += dkh.keynamelen;
@@ -1194,7 +1168,7 @@
OFSTRUCT ofs;
BY_HANDLE_FILE_INFORMATION hfdinfo;
- dprintf_reg(stddeb,"Loading Win95 registry database '%s'\n",fn);
+ dprintf_info(reg,"Loading Win95 registry database '%s'\n",fn);
hfd=OpenFile32(fn,&ofs,OF_READ);
if (hfd==HFILE_ERROR32)
return;
@@ -1214,7 +1188,7 @@
if (4!=_lread32(hfd,magic,4))
return;
if (strcmp(magic,"RGKN")) {
- dprintf_reg(stddeb,"second IFF header not RGKN, but %s\n",magic);
+ dprintf_warn(reg, "second IFF header not RGKN, but %s\n", magic);
return;
}
@@ -1379,7 +1353,7 @@
}
}
} else {
- dprintf_reg(stddeb,"__w31_dumptree:strange: no directory key name, idx=%04x\n", idx);
+ dprintf_info(reg,"__w31_dumptree:strange: no directory key name, idx=%04x\n", idx);
}
__w31_dumptree(dir->child_idx,txt,tab,head,xlpkey,lastmodified,level+1);
idx=dir->sibling_idx;
@@ -1405,12 +1379,12 @@
/* read & dump header */
if (sizeof(head)!=_lread32(hf,&head,sizeof(head))) {
- dprintf_reg(stddeb,"_w31_loadreg:reg.dat is too short.\n");
+ dprintf_err(reg, "_w31_loadreg:reg.dat is too short.\n");
_lclose32(hf);
return;
}
if (memcmp(head.cookie, "SHCC3.10", sizeof(head.cookie))!=0) {
- dprintf_reg(stddeb,"_w31_loadreg:reg.dat has bad signature.\n");
+ dprintf_err(reg, "_w31_loadreg:reg.dat has bad signature.\n");
_lclose32(hf);
return;
}
@@ -1419,7 +1393,7 @@
/* read and dump index table */
tab = xmalloc(len);
if (len!=_lread32(hf,tab,len)) {
- dprintf_reg(stderr,"_w31_loadreg:couldn't read %d bytes.\n",len);
+ dprintf_err(reg,"_w31_loadreg:couldn't read %d bytes.\n",len);
free(tab);
_lclose32(hf);
return;
@@ -1428,14 +1402,14 @@
/* read text */
txt = xmalloc(head.textsize);
if (-1==_llseek32(hf,head.textoff,SEEK_SET)) {
- dprintf_reg(stderr,"_w31_loadreg:couldn't seek to textblock.\n");
+ dprintf_err(reg,"_w31_loadreg:couldn't seek to textblock.\n");
free(tab);
free(txt);
_lclose32(hf);
return;
}
if (head.textsize!=_lread32(hf,txt,head.textsize)) {
- dprintf_reg(stderr,"_w31_loadreg:textblock too short (%d instead of %ld).\n",len,head.textsize);
+ dprintf_err(reg,"_w31_loadreg:textblock too short (%d instead of %ld).\n",len,head.textsize);
free(tab);
free(txt);
_lclose32(hf);
@@ -1443,7 +1417,7 @@
}
if (!GetFileInformationByHandle(hf,&hfinfo)) {
- dprintf_reg(stderr,"_w31_loadreg:GetFileInformationByHandle failed?.\n");
+ dprintf_err(reg,"_w31_loadreg:GetFileInformationByHandle failed?.\n");
free(tab);
free(txt);
_lclose32(hf);
@@ -1555,7 +1529,7 @@
LPKEYSTRUCT lpNextKey,lpxkey;
LPWSTR *wps;
int wpc,i;
- dprintf_reg(stddeb,"RegOpenKeyEx32W(%lx,%s,%ld,%lx,%p)\n",
+ dprintf_info(reg,"RegOpenKeyEx32W(%lx,%s,%ld,%lx,%p)\n",
(LONG)hkey,W2C(lpszSubKey,0),dwReserved,samDesired,retkey
);
@@ -1597,7 +1571,7 @@
LPCWSTR lpszSubKey,
LPHKEY retkey
) {
- dprintf_reg(stddeb,"RegOpenKey32W(%lx,%s,%p)\n",
+ dprintf_info(reg,"RegOpenKey32W(%lx,%s,%p)\n",
(LONG)hkey,W2C(lpszSubKey,0),retkey
);
return RegOpenKeyEx32W(hkey,lpszSubKey,0,KEY_ALL_ACCESS,retkey);
@@ -1615,7 +1589,7 @@
LPWSTR lpszSubKeyW;
DWORD ret;
- dprintf_reg(stddeb,"RegOpenKeyEx32A(%lx,%s,%ld,%lx,%p)\n",
+ dprintf_info(reg,"RegOpenKeyEx32A(%lx,%s,%ld,%lx,%p)\n",
(LONG)hkey,lpszSubKey,dwReserved,samDesired,retkey
);
if (lpszSubKey)
@@ -1634,7 +1608,7 @@
LPCSTR lpszSubKey,
LPHKEY retkey
) {
- dprintf_reg(stddeb,"RegOpenKey32A(%lx,%s,%p)\n",
+ dprintf_info(reg,"RegOpenKey32A(%lx,%s,%p)\n",
(LONG)hkey,lpszSubKey,retkey
);
return RegOpenKeyEx32A(hkey,lpszSubKey,0,KEY_ALL_ACCESS,retkey);
@@ -1646,7 +1620,7 @@
LPCSTR lpszSubKey,
LPHKEY retkey
) {
- dprintf_reg(stddeb,"RegOpenKey16(%lx,%s,%p)\n",
+ dprintf_info(reg,"RegOpenKey16(%lx,%s,%p)\n",
(LONG)hkey,lpszSubKey,retkey
);
return RegOpenKey32A(hkey,lpszSubKey,retkey);
@@ -1682,7 +1656,7 @@
int wpc,i;
/*FIXME: handle security/access/whatever */
- dprintf_reg(stddeb,"RegCreateKeyEx32W(%lx,%s,%ld,%s,%lx,%lx,%p,%p,%p)\n",
+ dprintf_info(reg,"RegCreateKeyEx32W(%lx,%s,%ld,%s,%lx,%lx,%p,%p,%p)\n",
(LONG)hkey,
W2C(lpszSubKey,0),
dwReserved,
@@ -1778,7 +1752,7 @@
) {
DWORD junk,ret;
- dprintf_reg(stddeb,"RegCreateKey32W(%lx,%s,%p)\n",
+ dprintf_info(reg,"RegCreateKey32W(%lx,%s,%p)\n",
(LONG)hkey,W2C(lpszSubKey,0),retkey
);
ret=RegCreateKeyEx32W(
@@ -1810,7 +1784,7 @@
LPWSTR lpszSubKeyW,lpszClassW;
DWORD ret;
- dprintf_reg(stddeb,"RegCreateKeyEx32A(%lx,%s,%ld,%s,%lx,%lx,%p,%p,%p)\n",
+ dprintf_info(reg,"RegCreateKeyEx32A(%lx,%s,%ld,%s,%lx,%lx,%p,%p,%p)\n",
(LONG)hkey,
lpszSubKey,
dwReserved,
@@ -1855,7 +1829,7 @@
) {
DWORD junk;
- dprintf_reg(stddeb,"RegCreateKey32A(%lx,%s,%p)\n",
+ dprintf_info(reg,"RegCreateKey32A(%lx,%s,%p)\n",
(LONG)hkey,lpszSubKey,retkey
);
return RegCreateKeyEx32A(
@@ -1877,7 +1851,7 @@
LPCSTR lpszSubKey,
LPHKEY retkey
) {
- dprintf_reg(stddeb,"RegCreateKey16(%lx,%s,%p)\n",
+ dprintf_info(reg,"RegCreateKey16(%lx,%s,%p)\n",
(LONG)hkey,lpszSubKey,retkey
);
return RegCreateKey32A(hkey,lpszSubKey,retkey);
@@ -1907,7 +1881,7 @@
LPKEYSTRUCT lpkey;
int i;
- dprintf_reg(stddeb,"RegQueryValueEx32W(%x,%s,%p,%p,%p,%ld)\n",
+ dprintf_info(reg,"RegQueryValueEx32W(%x,%s,%p,%p,%p,%ld)\n",
hkey,W2C(lpszValueName,0),lpdwReserved,lpdwType,lpbData,
lpcbData?*lpcbData:0
);
@@ -1969,7 +1943,7 @@
HKEY xhkey;
DWORD ret,lpdwType;
- dprintf_reg(stddeb,"RegQueryValue32W(%x,%s,%p,%ld)\n->",
+ dprintf_info(reg,"RegQueryValue32W(%x,%s,%p,%ld)\n",
hkey,W2C(lpszSubKey,0),lpszData,
lpcbData?*lpcbData:0
);
@@ -2011,7 +1985,7 @@
DWORD *mylen;
DWORD type;
- dprintf_reg(stddeb,"RegQueryValueEx32A(%x,%s,%p,%p,%p,%ld)\n->",
+ dprintf_info(reg,"RegQueryValueEx32A(%x,%s,%p,%p,%p,%ld)\n",
hkey,lpszValueName,lpdwReserved,lpdwType,lpbData,
lpcbData?*lpcbData:0
);
@@ -2096,7 +2070,7 @@
LPBYTE lpbData,
LPDWORD lpcbData
) {
- dprintf_reg(stddeb,"RegQueryValueEx16(%x,%s,%p,%p,%p,%ld)\n",
+ dprintf_info(reg,"RegQueryValueEx16(%x,%s,%p,%p,%p,%ld)\n",
hkey,lpszValueName,lpdwReserved,lpdwType,lpbData,
lpcbData?*lpcbData:0
);
@@ -2120,7 +2094,7 @@
HKEY xhkey;
DWORD ret,lpdwType;
- dprintf_reg(stddeb,"RegQueryValue32A(%x,%s,%p,%ld)\n",
+ dprintf_info(reg,"RegQueryValue32A(%x,%s,%p,%ld)\n",
hkey,lpszSubKey,lpszData,
lpcbData?*lpcbData:0
);
@@ -2154,7 +2128,7 @@
LPSTR lpszData,
LPDWORD lpcbData
) {
- dprintf_reg(stddeb,"RegQueryValue16(%x,%s,%p,%ld)\n",
+ dprintf_info(reg,"RegQueryValue16(%x,%s,%p,%ld)\n",
hkey,lpszSubKey,lpszData,lpcbData?*lpcbData:0
);
/* HACK: the 16bit RegQueryValue doesn't handle selectorblocks
@@ -2186,7 +2160,7 @@
LPKEYSTRUCT lpkey;
int i;
- dprintf_reg(stddeb,"RegSetValueEx32W(%x,%s,%ld,%ld,%p,%ld)\n",
+ dprintf_info(reg,"RegSetValueEx32W(%x,%s,%ld,%ld,%p,%ld)\n",
hkey,W2C(lpszValueName,0),dwReserved,dwType,lpbData,cbData
);
/* we no longer care about the lpbData type here... */
@@ -2243,7 +2217,7 @@
LPWSTR lpszValueNameW;
DWORD ret;
- dprintf_reg(stddeb,"RegSetValueEx32A(%x,%s,%ld,%ld,%p,%ld)\n->",
+ dprintf_info(reg,"RegSetValueEx32A(%x,%s,%ld,%ld,%p,%ld)\n",
hkey,lpszValueName,dwReserved,dwType,lpbData,cbData
);
if ((1<<dwType) & UNICONVMASK) {
@@ -2272,7 +2246,7 @@
LPBYTE lpbData,
DWORD cbData
) {
- dprintf_reg(stddeb,"RegSetValueEx16(%x,%s,%ld,%ld,%p,%ld)\n->",
+ dprintf_info(reg,"RegSetValueEx16(%x,%s,%ld,%ld,%p,%ld)\n",
hkey,lpszValueName,dwReserved,dwType,lpbData,cbData
);
return RegSetValueEx32A(hkey,lpszValueName,dwReserved,dwType,lpbData,cbData);
@@ -2289,7 +2263,7 @@
HKEY xhkey;
DWORD ret;
- dprintf_reg(stddeb,"RegSetValue32W(%x,%s,%ld,%s,%ld)\n->",
+ dprintf_info(reg,"RegSetValue32W(%x,%s,%ld,%s,%ld)\n",
hkey,W2C(lpszSubKey,0),dwType,W2C(lpszData,0),cbData
);
if (lpszSubKey && *lpszSubKey) {
@@ -2303,7 +2277,7 @@
dwType=REG_SZ;
}
if (cbData!=2*lstrlen32W(lpszData)+2) {
- dprintf_reg(stddeb,"RegSetValueX called with len=%ld != strlen(%s)+1=%d!\n",
+ dprintf_info(reg,"RegSetValueX called with len=%ld != strlen(%s)+1=%d!\n",
cbData,W2C(lpszData,0),2*lstrlen32W(lpszData)+2
);
cbData=2*lstrlen32W(lpszData)+2;
@@ -2325,7 +2299,7 @@
DWORD ret;
HKEY xhkey;
- dprintf_reg(stddeb,"RegSetValue32A(%x,%s,%ld,%s,%ld)\n->",
+ dprintf_info(reg,"RegSetValue32A(%x,%s,%ld,%s,%ld)\n",
hkey,lpszSubKey,dwType,lpszData,cbData
);
if (lpszSubKey && *lpszSubKey) {
@@ -2336,7 +2310,7 @@
xhkey=hkey;
if (dwType!=REG_SZ) {
- dprintf_reg(stddeb,"RegSetValueA called with dwType=%ld!\n",dwType);
+ dprintf_info(reg,"RegSetValueA called with dwType=%ld!\n",dwType);
dwType=REG_SZ;
}
if (cbData!=strlen(lpszData)+1)
@@ -2356,7 +2330,7 @@
DWORD cbData
) {
DWORD ret;
- dprintf_reg(stddeb,"RegSetValue16(%x,%s,%ld,%s,%ld)\n->",
+ dprintf_info(reg,"RegSetValue16(%x,%s,%ld,%s,%ld)\n",
hkey,lpszSubKey,dwType,lpszData,cbData
);
ret=RegSetValue32A(hkey,lpszSubKey,dwType,lpszData,cbData);
@@ -2384,7 +2358,7 @@
) {
LPKEYSTRUCT lpkey,lpxkey;
- dprintf_reg(stddeb,"RegEnumKeyEx32W(%x,%ld,%p,%ld,%p,%p,%p,%p)\n",
+ dprintf_info(reg,"RegEnumKeyEx32W(%x,%ld,%p,%ld,%p,%p,%p,%p)\n",
hkey,iSubkey,lpszName,*lpcchName,lpdwReserved,lpszClass,lpcchClass,ft
);
lpkey=lookup_hkey(hkey);
@@ -2420,7 +2394,7 @@
) {
FILETIME ft;
- dprintf_reg(stddeb,"RegEnumKey32W(%x,%ld,%p,%ld)\n->",
+ dprintf_info(reg,"RegEnumKey32W(%x,%ld,%p,%ld)\n",
hkey,iSubkey,lpszName,lpcchName
);
return RegEnumKeyEx32W(hkey,iSubkey,lpszName,&lpcchName,NULL,NULL,NULL,&ft);
@@ -2440,7 +2414,7 @@
LPWSTR lpszNameW,lpszClassW;
- dprintf_reg(stddeb,"RegEnumKeyEx32A(%x,%ld,%p,%ld,%p,%p,%p,%p)\n->",
+ dprintf_info(reg,"RegEnumKeyEx32A(%x,%ld,%p,%ld,%p,%p,%p,%p)\n",
hkey,iSubkey,lpszName,*lpcchName,lpdwReserved,lpszClass,lpcchClass,ft
);
if (lpszName) {
@@ -2491,7 +2465,7 @@
) {
FILETIME ft;
- dprintf_reg(stddeb,"RegEnumKey32A(%x,%ld,%p,%ld)\n->",
+ dprintf_info(reg,"RegEnumKey32A(%x,%ld,%p,%ld)\n",
hkey,iSubkey,lpszName,lpcchName
);
return RegEnumKeyEx32A(
@@ -2513,7 +2487,7 @@
LPSTR lpszName,
DWORD lpcchName
) {
- dprintf_reg(stddeb,"RegEnumKey16(%x,%ld,%p,%ld)\n->",
+ dprintf_info(reg,"RegEnumKey16(%x,%ld,%p,%ld)\n",
hkey,iSubkey,lpszName,lpcchName
);
return RegEnumKey32A(hkey,iSubkey,lpszName,lpcchName);
@@ -2540,7 +2514,7 @@
LPKEYSTRUCT lpkey;
LPKEYVALUE val;
- dprintf_reg(stddeb,"RegEnumValue32W(%x,%ld,%p,%p,%p,%p,%p,%p)\n",
+ dprintf_info(reg,"RegEnumValue32W(%x,%ld,%p,%p,%p,%p,%p,%p)\n",
hkey,iValue,lpszValue,lpcchValue,lpdReserved,lpdwType,lpbData,lpcbData
);
lpkey = lookup_hkey(hkey);
@@ -2587,7 +2561,7 @@
LPBYTE lpbDataW;
DWORD ret,lpcbDataW;
- dprintf_reg(stddeb,"RegEnumValue32A(%x,%ld,%p,%p,%p,%p,%p,%p)\n",
+ dprintf_info(reg,"RegEnumValue32A(%x,%ld,%p,%p,%p,%p,%p,%p)\n",
hkey,iValue,lpszValue,lpcchValue,lpdReserved,lpdwType,lpbData,lpcbData
);
@@ -2640,7 +2614,7 @@
LPBYTE lpbData,
LPDWORD lpcbData
) {
- dprintf_reg(stddeb,"RegEnumValue(%x,%ld,%p,%p,%p,%p,%p,%p)\n",
+ dprintf_info(reg,"RegEnumValue(%x,%ld,%p,%p,%p,%p,%p,%p)\n",
hkey,iValue,lpszValue,lpcchValue,lpdReserved,lpdwType,lpbData,lpcbData
);
return RegEnumValue32A(
@@ -2660,7 +2634,7 @@
*/
/* RegCloseKey [SHELL.3] [KERNEL.220] [ADVAPI32.126] */
DWORD WINAPI RegCloseKey(HKEY hkey) {
- dprintf_reg(stddeb,"RegCloseKey(%x)\n",hkey);
+ dprintf_info(reg,"RegCloseKey(%x)\n",hkey);
remove_handle(hkey);
return ERROR_SUCCESS;
}
@@ -2676,17 +2650,17 @@
LPWSTR *wps;
int wpc,i;
- dprintf_reg(stddeb,"RegDeleteKey32W(%x,%s)\n",
+ dprintf_info(reg,"RegDeleteKey32W(%x,%s)\n",
hkey,W2C(lpszSubKey,0)
);
lpNextKey = lookup_hkey(hkey);
if (!lpNextKey) {
- dprintf_reg (stddeb, " Badkey[1].\n");
+ dprintf_info(reg, " Badkey[1].\n");
return SHELL_ERROR_BADKEY;
}
/* we need to know the previous key in the hier. */
if (!lpszSubKey || !*lpszSubKey) {
- dprintf_reg (stddeb, " Badkey[2].\n");
+ dprintf_info(reg, " Badkey[2].\n");
return SHELL_ERROR_BADKEY;
}
split_keypath(lpszSubKey,&wps,&wpc);
@@ -2695,7 +2669,7 @@
while (i<wpc-1) {
lpxkey=lpNextKey->nextsub;
while (lpxkey) {
- dprintf_reg (stddeb, " Scanning [%s]\n",
+ dprintf_info(reg, " Scanning [%s]\n",
W2C (lpxkey->keyname, 0));
if (!lstrcmpi32W(wps[i],lpxkey->keyname))
break;
@@ -2703,7 +2677,7 @@
}
if (!lpxkey) {
FREE_KEY_PATH;
- dprintf_reg (stddeb, " Not found.\n");
+ dprintf_info(reg, " Not found.\n");
/* not found is success */
return SHELL_ERROR_SUCCESS;
}
@@ -2713,7 +2687,7 @@
lpxkey = lpNextKey->nextsub;
lplpPrevKey = &(lpNextKey->nextsub);
while (lpxkey) {
- dprintf_reg (stddeb, " Scanning [%s]\n",
+ dprintf_info(reg, " Scanning [%s]\n",
W2C (lpxkey->keyname, 0));
if (!lstrcmpi32W(wps[i],lpxkey->keyname))
break;
@@ -2722,13 +2696,12 @@
}
if (!lpxkey) {
FREE_KEY_PATH;
- dprintf_reg (stddeb, " Not found.\n");
+ dprintf_warn(reg , " Not found.\n");
return SHELL_ERROR_BADKEY;
- return SHELL_ERROR_SUCCESS;
}
if (lpxkey->nextsub) {
FREE_KEY_PATH;
- dprintf_reg (stddeb, " Not empty.\n");
+ dprintf_warn(reg , " Not empty.\n");
return SHELL_ERROR_CANTWRITE;
}
*lplpPrevKey = lpxkey->next;
@@ -2739,7 +2712,7 @@
free(lpxkey->values);
free(lpxkey);
FREE_KEY_PATH;
- dprintf_reg (stddeb, " Done.\n");
+ dprintf_info(reg, " Done.\n");
return SHELL_ERROR_SUCCESS;
}
@@ -2748,7 +2721,7 @@
LPWSTR lpszSubKeyW;
DWORD ret;
- dprintf_reg(stddeb,"RegDeleteKey32A(%x,%s)\n",
+ dprintf_info(reg,"RegDeleteKey32A(%x,%s)\n",
hkey,lpszSubKey
);
lpszSubKeyW=HEAP_strdupAtoW(GetProcessHeap(),0,lpszSubKey);
@@ -2759,7 +2732,7 @@
/* RegDeleteKey [SHELL.4] [KERNEL.219] */
DWORD WINAPI RegDeleteKey16(HKEY hkey,LPCSTR lpszSubKey) {
- dprintf_reg(stddeb,"RegDeleteKey16(%x,%s)\n",
+ dprintf_info(reg,"RegDeleteKey16(%x,%s)\n",
hkey,lpszSubKey
);
return RegDeleteKey32A(hkey,lpszSubKey);
@@ -2778,7 +2751,7 @@
LPKEYSTRUCT lpkey;
LPKEYVALUE val;
- dprintf_reg(stddeb,"RegDeleteValue32W(%x,%s)\n",
+ dprintf_info(reg,"RegDeleteValue32W(%x,%s)\n",
hkey,W2C(lpszValue,0)
);
lpkey=lookup_hkey(hkey);
@@ -2819,7 +2792,7 @@
LPWSTR lpszValueW;
DWORD ret;
- dprintf_reg( stddeb, "RegDeleteValue32A(%x,%s)\n", hkey,lpszValue );
+ dprintf_info(reg, "RegDeleteValue32A(%x,%s)\n", hkey,lpszValue );
lpszValueW=HEAP_strdupAtoW(GetProcessHeap(),0,lpszValue);
ret=RegDeleteValue32W(hkey,lpszValueW);
HeapFree(GetProcessHeap(),0,lpszValueW);
@@ -2829,14 +2802,14 @@
/* RegDeleteValue [KERNEL.222] */
DWORD WINAPI RegDeleteValue16(HKEY hkey,LPSTR lpszValue)
{
- dprintf_reg( stddeb,"RegDeleteValue16(%x,%s)\n", hkey,lpszValue );
+ dprintf_info(reg,"RegDeleteValue16(%x,%s)\n", hkey,lpszValue );
return RegDeleteValue32A(hkey,lpszValue);
}
/* RegFlushKey [ADVAPI32.143] [KERNEL.227] */
DWORD WINAPI RegFlushKey(HKEY hkey)
{
- dprintf_reg(stddeb,"RegFlushKey(%x), STUB.\n",hkey);
+ dprintf_fixme(reg, "RegFlushKey(%x), STUB.\n", hkey);
return SHELL_ERROR_SUCCESS;
}
@@ -2861,7 +2834,7 @@
int nrofkeys,maxsubkey,maxclass,maxvalues,maxvname,maxvdata;
int i;
- dprintf_reg(stddeb,"RegQueryInfoKey32W(%x,......)\n",hkey);
+ dprintf_info(reg,"RegQueryInfoKey32W(%x,......)\n",hkey);
lpkey=lookup_hkey(hkey);
if (!lpkey)
return SHELL_ERROR_BADKEY;
@@ -2936,7 +2909,7 @@
LPWSTR lpszClassW;
DWORD ret;
- dprintf_reg(stddeb,"RegQueryInfoKey32A(%x,......)\n",hkey);
+ dprintf_info(reg,"RegQueryInfoKey32A(%x,......)\n",hkey);
if (lpszClass) {
*lpcchClass*= 2;
lpszClassW = (LPWSTR)xmalloc(*lpcchClass);
diff --git a/misc/shell.c b/misc/shell.c
index 7007c23..69f12aa 100644
--- a/misc/shell.c
+++ b/misc/shell.c
@@ -22,7 +22,6 @@
#include "interfaces.h"
#include "sysmetrics.h"
#include "shlobj.h"
-#include "stddebug.h"
#include "debug.h"
#include "debugstr.h"
#include "winreg.h"
@@ -34,6 +33,7 @@
"Martin Ayotte",
"Karl Backstr\366m",
"Peter Bajusz",
+ "Marcel Baur",
"Georg Beyerle",
"Ross Biro",
"Martin Boehme",
@@ -222,7 +222,7 @@
LPSTR lpCurrent;
WORD i;
- dprintf_reg(stddeb,"DragQueryFile(%04x, %i, %p, %u)\n",
+ dprintf_info(reg,"DragQueryFile(%04x, %i, %p, %u)\n",
hDrop,wFile,lpszFile,wLength);
lpDropFileStruct = (LPDROPFILESTRUCT) GlobalLock16(hDrop);
@@ -296,7 +296,7 @@
int i; /* random counter */
char xlpFile[256]; /* result of SearchPath */
- dprintf_exec(stddeb, "SHELL_FindExecutable: %s\n",
+ dprintf_info(exec, "SHELL_FindExecutable: %s\n",
(lpFile != NULL?lpFile:"-") );
lpResult[0]='\0'; /* Start off with an empty return string */
@@ -322,7 +322,7 @@
/* Make local copy & lowercase it for reg & 'programs=' lookup */
lstrcpyn32A( tmpext, extension, 5 );
CharLower32A( tmpext );
- dprintf_exec(stddeb, "SHELL_FindExecutable: %s file\n", tmpext);
+ dprintf_info(exec, "SHELL_FindExecutable: %s file\n", tmpext);
/* Three places to check: */
/* 1. win.ini, [windows], programs (NB no leading '.') */
@@ -348,7 +348,7 @@
strcpy(lpResult, xlpFile);
/* Need to perhaps check that the file has a path
* attached */
- dprintf_exec(stddeb, "SHELL_FindExecutable: found %s\n",
+ dprintf_info(exec, "SHELL_FindExecutable: found %s\n",
lpResult);
return 33;
@@ -366,7 +366,7 @@
&filetypelen ) == SHELL_ERROR_SUCCESS )
{
filetype[filetypelen]='\0';
- dprintf_exec(stddeb, "SHELL_FindExecutable: File type: %s\n",
+ dprintf_info(exec, "SHELL_FindExecutable: File type: %s\n",
filetype);
/* Looking for ...buffer\shell\lpOperation\command */
@@ -420,7 +420,7 @@
}
}
- dprintf_exec(stddeb, "SHELL_FindExecutable: returning %s\n", lpResult);
+ dprintf_info(exec, "SHELL_FindExecutable: returning %s\n", lpResult);
return retval;
}
@@ -435,7 +435,7 @@
char old_dir[1024];
char cmd[256];
- dprintf_exec(stddeb, "ShellExecute(%04x,'%s','%s','%s','%s',%x)\n",
+ dprintf_info(exec, "ShellExecute(%04x,'%s','%s','%s','%s',%x)\n",
hWnd, lpOperation ? lpOperation:"<null>", lpFile ? lpFile:"<null>",
lpParameters ? lpParameters : "<null>",
lpDirectory ? lpDirectory : "<null>", iShowCmd);
@@ -460,7 +460,7 @@
strcat(cmd,lpParameters);
}
- dprintf_exec(stddeb,"ShellExecute:starting %s\n",cmd);
+ dprintf_info(exec,"ShellExecute:starting %s\n",cmd);
retval = WinExec32( cmd, iShowCmd );
}
if (lpDirectory) SetCurrentDirectory32A( old_dir );
@@ -498,7 +498,7 @@
HINSTANCE32 retval=31; /* default - 'No association was found' */
char old_dir[1024];
- dprintf_exec(stddeb, "FindExecutable: File %s, Dir %s\n",
+ dprintf_info(exec, "FindExecutable: File %s, Dir %s\n",
(lpFile != NULL?lpFile:"-"),
(lpDirectory != NULL?lpDirectory:"-"));
@@ -519,7 +519,7 @@
retval = SHELL_FindExecutable( lpFile, "open", lpResult );
- dprintf_exec(stddeb, "FindExecutable: returning %s\n", lpResult);
+ dprintf_info(exec, "FindExecutable: returning %s\n", lpResult);
if (lpDirectory) SetCurrentDirectory32A( old_dir );
return retval;
}
@@ -931,7 +931,7 @@
HFILE32 hFile = OpenFile32( lpszExeFileName, &ofs, OF_READ );
UINT16 iconDirCount = 0,iconCount = 0;
- dprintf_reg(stddeb,"InternalExtractIcon(%04x,file %s,start %d,extract %d\n",
+ dprintf_info(reg,"InternalExtractIcon(%04x,file %s,start %d,extract %d\n",
hInstance, lpszExeFileName, nIconIndex, n);
if( hFile == HFILE_ERROR32 || !n ) return 0;
@@ -966,13 +966,13 @@
{
iconDirCount = pTInfo->count;
pIconDir = ((NE_NAMEINFO*)(pTInfo + 1));
- dprintf_reg(stddeb,"\tfound directory - %i icon families\n", iconDirCount);
+ dprintf_info(reg,"\tfound directory - %i icon families\n", iconDirCount);
}
if( pTInfo->type_id == NE_RSCTYPE_ICON )
{
iconCount = pTInfo->count;
pIconStorage = ((NE_NAMEINFO*)(pTInfo + 1));
- dprintf_reg(stddeb,"\ttotal icons - %i\n", iconCount);
+ dprintf_info(reg,"\ttotal icons - %i\n", iconCount);
}
pTInfo = (NE_TYPEINFO *)((char*)(pTInfo+1)+pTInfo->count*sizeof(NE_NAMEINFO));
}
@@ -1323,7 +1323,7 @@
CharToOem32A(str,str);
- dprintf_reg(stddeb,"DoEnvSubst: accept %s", str);
+ dprintf_info(reg,"DoEnvSubst: accept %s\n", str);
while( *lpstr && lpbstr - lpBuffer < length )
{
@@ -1372,7 +1372,7 @@
else
length = 0;
- dprintf_reg(stddeb," return %s\n", str);
+ dprintf_info(reg," return %s\n", str);
OemToChar32A(str,str);
HeapFree( GetProcessHeap(), 0, lpBuffer);
@@ -1389,7 +1389,7 @@
*/
LRESULT WINAPI ShellHookProc(INT16 code, WPARAM16 wParam, LPARAM lParam)
{
- dprintf_reg(stddeb,"ShellHookProc: %i, %04x, %08x\n", code, wParam,
+ dprintf_info(reg,"ShellHookProc: %i, %04x, %08x\n", code, wParam,
(unsigned)lParam );
if( SHELL_hHook && SHELL_hWnd )
{
@@ -1416,7 +1416,7 @@
*/
BOOL32 WINAPI RegisterShellHook(HWND16 hWnd, UINT16 uAction)
{
- dprintf_reg(stddeb,"RegisterShellHook: %04x [%u]\n", hWnd, uAction );
+ dprintf_info(reg,"RegisterShellHook: %04x [%u]\n", hWnd, uAction );
switch( uAction )
{
@@ -1547,7 +1547,7 @@
void WINAPI Control_RunDLL (HWND32 hwnd, LPCVOID code, LPCSTR cmd, DWORD arg4)
{
- dprintf_exec (stddeb, "Control_RunDLL (%08x, %p, \"%s\", %08lx)\n",
+ dprintf_info(exec, "Control_RunDLL (%08x, %p, \"%s\", %08lx)\n",
hwnd,
code ? code : "(null)",
cmd ? cmd : "(null)",
@@ -1573,8 +1573,8 @@
HRESULT hres = E_OUTOFMEMORY;
- StringFromCLSID((LPCLSID)rclsid,xclsid);
- StringFromCLSID((LPCLSID)iid,xiid);
+ WINE_StringFromCLSID((LPCLSID)rclsid,xclsid);
+ WINE_StringFromCLSID((LPCLSID)iid,xiid);
fprintf(stderr,"SHELL32_DllGetClassObject(%s,%s,%p)\n",xclsid,xiid,ppv);
*ppv = NULL;
@@ -1633,10 +1633,9 @@
* What we are currently doing is not very wrong, since we always use the same
* heap (ProcessHeap).
*/
-DWORD WINAPI SHGetMalloc(LPMALLOC *lpmal) {
+DWORD WINAPI SHGetMalloc(LPMALLOC32 *lpmal) {
fprintf(stderr,"SHGetMalloc()\n");
- *lpmal = IMalloc_Constructor();
- return NOERROR;
+ return CoGetMalloc32(0,lpmal);
}
/*************************************************************************
diff --git a/misc/shellord.c b/misc/shellord.c
index 1d4f857..9eda433 100644
--- a/misc/shellord.c
+++ b/misc/shellord.c
@@ -27,7 +27,6 @@
#include "cursoricon.h"
#include "interfaces.h"
#include "shlobj.h"
-#include "stddebug.h"
#include "debug.h"
#include "winreg.h"
@@ -470,10 +469,10 @@
DWORD pathlen,type,tmodellen;
DWORD hres;
- StringFromCLSID(refiid,xiid);
+ WINE_StringFromCLSID(refiid,xiid);
if (clsid)
- StringFromCLSID(clsid,xclsid);
+ WINE_StringFromCLSID(clsid,xclsid);
else {
if (!aclsid)
return 0x80040154;
@@ -524,7 +523,7 @@
fprintf(stderr,"SHELL32_183(%08lx,%08lx,%08lx(%s),%08lx(%s),%08lx,%p),stub!\n",
(DWORD)hmod,(DWORD)hwnd,id,buf2,x,buf,type,arglist
);
- MessageBox32A(hwnd,buf3,buf,id|0x10000);
+ /*MessageBox32A(hwnd,buf3,buf,id|0x10000);*/
}
diff --git a/misc/spy.c b/misc/spy.c
index 45f368b..9a6b3fb 100644
--- a/misc/spy.c
+++ b/misc/spy.c
@@ -12,7 +12,6 @@
#include "win.h"
#include "module.h"
#include "options.h"
-#include "stddebug.h"
#include "debug.h"
#include "spy.h"
@@ -643,21 +642,21 @@
{
LPCSTR pname;
- if (!debugging_message || SPY_EXCLUDE(msg)) return;
+ if (!debugging_info(message) || SPY_EXCLUDE(msg)) return;
/* each SPY_SENDMESSAGE must be complemented by call to SPY_ExitMessage */
switch(iFlag)
{
case SPY_DISPATCHMESSAGE16:
pname = SPY_GetWndName(hWnd);
- dprintf_message(stddeb,"%*s(%04x) %-16s message [%04x] %s dispatched wp=%04x lp=%08lx\n",
+ dprintf_info(message,"%*s(%04x) %-16s message [%04x] %s dispatched wp=%04x lp=%08lx\n",
SPY_IndentLevel, "", hWnd, pname, msg, SPY_GetMsgName( msg ),
wParam, lParam);
break;
case SPY_DISPATCHMESSAGE32:
pname = SPY_GetWndName(hWnd);
- dprintf_message(stddeb,"%*s(%08x) %-16s message [%04x] %s dispatched wp=%08x lp=%08lx\n",
+ dprintf_info(message,"%*s(%08x) %-16s message [%04x] %s dispatched wp=%08x lp=%08lx\n",
SPY_IndentLevel, "", hWnd, pname, msg, SPY_GetMsgName( msg ),
wParam, lParam);
break;
@@ -675,12 +674,12 @@
pname = SPY_GetWndName(hWnd);
if (iFlag == SPY_SENDMESSAGE16)
- dprintf_message(stddeb,
+ dprintf_info(message,
"%*s(%04x) %-16s message [%04x] %s sent from %s wp=%04x lp=%08lx\n",
SPY_IndentLevel, "", hWnd, pname, msg, SPY_GetMsgName( msg ),
taskName, wParam, lParam );
else
- dprintf_message(stddeb,
+ dprintf_info(message,
"%*s(%08x) %-16s message [%04x] %s sent from %s wp=%08x lp=%08lx\n",
SPY_IndentLevel, "", hWnd, pname, msg, SPY_GetMsgName( msg ),
taskName, wParam, lParam );
@@ -689,14 +688,14 @@
case SPY_DEFWNDPROC16:
if( SPY_ExcludeDWP ) return;
- dprintf_message(stddeb, "%*s(%04x) DefWindowProc16: %s [%04x] wp=%04x lp=%08lx\n",
+ dprintf_info(message, "%*s(%04x) DefWindowProc16: %s [%04x] wp=%04x lp=%08lx\n",
SPY_IndentLevel, "", hWnd, SPY_GetMsgName( msg ),
msg, wParam, lParam );
break;
case SPY_DEFWNDPROC32:
if( SPY_ExcludeDWP ) return;
- dprintf_message(stddeb, "%*s(%08x) DefWindowProc32: %s [%04x] wp=%08x lp=%08lx\n",
+ dprintf_info(message, "%*s(%08x) DefWindowProc32: %s [%04x] wp=%08x lp=%08lx\n",
SPY_IndentLevel, "", hWnd, SPY_GetMsgName( msg ),
msg, wParam, lParam );
break;
@@ -712,7 +711,7 @@
{
LPCSTR pname;
- if (!debugging_message || SPY_EXCLUDE(msg) ||
+ if (!debugging_info(message) || SPY_EXCLUDE(msg) ||
(SPY_ExcludeDWP && (iFlag == SPY_RESULT_DEFWND16 || iFlag == SPY_RESULT_DEFWND32)) )
return;
@@ -721,39 +720,39 @@
switch(iFlag)
{
case SPY_RESULT_DEFWND16:
- dprintf_message(stddeb,"%*s(%04x) DefWindowProc16: %s [%04x] returned %08lx\n",
+ dprintf_info(message,"%*s(%04x) DefWindowProc16: %s [%04x] returned %08lx\n",
SPY_IndentLevel, "", hWnd, SPY_GetMsgName( msg ), msg, lReturn );
break;
case SPY_RESULT_DEFWND32:
- dprintf_message(stddeb,"%*s(%08x) DefWindowProc32: %s [%04x] returned %08lx\n",
+ dprintf_info(message,"%*s(%08x) DefWindowProc32: %s [%04x] returned %08lx\n",
SPY_IndentLevel, "", hWnd, SPY_GetMsgName( msg ), msg, lReturn );
break;
case SPY_RESULT_OK16:
pname = SPY_GetWndName(hWnd);
- dprintf_message(stddeb,"%*s(%04x) %-16s message [%04x] %s returned %08lx\n",
+ dprintf_info(message,"%*s(%04x) %-16s message [%04x] %s returned %08lx\n",
SPY_IndentLevel, "", hWnd, pname, msg,
SPY_GetMsgName( msg ), lReturn );
break;
case SPY_RESULT_OK32:
pname = SPY_GetWndName(hWnd);
- dprintf_message(stddeb,"%*s(%08x) %-16s message [%04x] %s returned %08lx\n",
+ dprintf_info(message,"%*s(%08x) %-16s message [%04x] %s returned %08lx\n",
SPY_IndentLevel, "", hWnd, pname, msg,
SPY_GetMsgName( msg ), lReturn );
break;
case SPY_RESULT_INVALIDHWND16:
pname = SPY_GetWndName(hWnd);
- dprintf_message(stddeb,"%*s(%04x) %-16s message [%04x] %s HAS INVALID HWND\n",
+ dprintf_warn(message, "%*s(%04x) %-16s message [%04x] %s HAS INVALID HWND\n",
SPY_IndentLevel, "", hWnd, pname, msg,
SPY_GetMsgName( msg ) );
break;
case SPY_RESULT_INVALIDHWND32:
pname = SPY_GetWndName(hWnd);
- dprintf_message(stddeb,"%*s(%08x) %-16s message [%04x] %s HAS INVALID HWND\n",
+ dprintf_warn(message, "%*s(%08x) %-16s message [%04x] %s HAS INVALID HWND\n",
SPY_IndentLevel, "", hWnd, pname, msg,
SPY_GetMsgName( msg ) );
break;
@@ -769,12 +768,12 @@
int i;
char buffer[1024];
- if (!debugging_message) return TRUE;
+ if (!debugging_info(message)) return TRUE;
PROFILE_GetWineIniString( "Spy", "Include", "", buffer, sizeof(buffer) );
if (buffer[0] && strcmp( buffer, "INCLUDEALL" ))
{
- dprintf_message( stddeb, "SpyInit: Include=%s\n", buffer );
+ dprintf_info(message, "SpyInit: Include=%s\n", buffer );
for (i = 0; i <= SPY_MAX_MSGNUM; i++)
SPY_Exclude[i] = (MessageTypeNames[i] && !strstr(buffer,MessageTypeNames[i]));
}
@@ -782,7 +781,7 @@
PROFILE_GetWineIniString( "Spy", "Exclude", "", buffer, sizeof(buffer) );
if (buffer[0])
{
- dprintf_message( stddeb, "SpyInit: Exclude=%s\n", buffer );
+ dprintf_info(message, "SpyInit: Exclude=%s\n", buffer );
if (!strcmp( buffer, "EXCLUDEALL" ))
for (i = 0; i <= SPY_MAX_MSGNUM; i++) SPY_Exclude[i] = TRUE;
else
diff --git a/misc/stress.c b/misc/stress.c
index 6b4e2fe..5714552 100644
--- a/misc/stress.c
+++ b/misc/stress.c
@@ -2,22 +2,20 @@
#include <limits.h>
#include "windows.h"
#include "stress.h"
-#include "stddebug.h"
-/* #define DEBUG_STRESS */
-/* #undef DEBUG_STRESS */
#include "debug.h"
int WINAPI AllocDiskSpace(long lLeft, UINT16 uDrive)
{
- dprintf_stress(stdnimp, "stress.dll: AllocDiskSpace %d, %ld\n", uDrive, lLeft);
+ dprintf_fixme(stress, "stress.dll: AllocDiskSpace(%d, %ld) - stub\n",
+ uDrive, lLeft);
return 1;
}
int WINAPI AllocFileHandles(int Left)
{
- dprintf_stress(stddeb, "stress.dll: AllocFileHandles %d\n", Left);
+ dprintf_info(stress, "stress.dll: AllocFileHandles(%d) - stub\n", Left);
if (Left < 0)
return -1;
@@ -27,48 +25,48 @@
BOOL16 WINAPI AllocGDIMem(UINT16 uLeft)
{
- dprintf_stress(stddeb, "stress.dll: AllocGDIMem %d\n", uLeft);
+ dprintf_info(stress, "stress.dll: AllocGDIMem(%d) - stub\n", uLeft);
return 1;
}
BOOL16 WINAPI AllocMem(DWORD dwLeft)
{
- dprintf_stress(stdnimp, "stress.dll: AllocMem %ld\n", dwLeft);
+ dprintf_fixme(stress, "stress.dll: AllocMem(%ld) - stub\n", dwLeft);
return 1;
}
BOOL16 WINAPI AllocUserMem(UINT16 uContig)
{
- dprintf_stress(stddeb, "stress.dll: AllocUserMem %d\n", uContig);
+ dprintf_info(stress, "stress.dll: AllocUserMem %d\n", uContig);
return 1;
}
void WINAPI FreeAllMem(void)
{
- dprintf_stress(stddeb, "stress.dll: FreeAllMem\n");
+ dprintf_info(stress, "stress.dll: FreeAllMem\n");
}
void WINAPI FreeAllGDIMem(void)
{
- dprintf_stress(stddeb, "stress.dll: FreeAllGDIMem\n");
+ dprintf_info(stress, "stress.dll: FreeAllGDIMem\n");
}
void WINAPI FreeAllUserMem(void)
{
- dprintf_stress(stddeb, "stress.dll: FreeAllUserMem\n");
+ dprintf_info(stress, "stress.dll: FreeAllUserMem\n");
}
void WINAPI GetFreeAllUserMem(void)
{
- dprintf_stress(stddeb, "stress.dll: GetFreeAllUserMem\n");
+ dprintf_info(stress, "stress.dll: GetFreeAllUserMem\n");
}
int WINAPI GetFreeFileHandles(void)
{
- dprintf_stress(stddeb, "stress.dll: GetFreeFileHandles\n");
+ dprintf_info(stress, "stress.dll: GetFreeFileHandles\n");
#ifndef OPEN_MAX
return _POSIX_OPEN_MAX;
@@ -79,10 +77,10 @@
void WINAPI UnAllocDiskSpace(UINT16 drive)
{
- dprintf_stress(stddeb, "stress.dll: UnAllocDiskSpace %d\n", drive);
+ dprintf_info(stress, "stress.dll: UnAllocDiskSpace %d\n", drive);
}
void WINAPI UnAllocFileHandles(void)
{
- dprintf_stress(stddeb, "stress.dll: GetFreeAllUserMem\n");
+ dprintf_info(stress, "stress.dll: GetFreeAllUserMem\n");
}
diff --git a/misc/toolhelp.c b/misc/toolhelp.c
index 2e485ae..9ec8c6f 100644
--- a/misc/toolhelp.c
+++ b/misc/toolhelp.c
@@ -12,7 +12,6 @@
#include "windows.h"
#include "win.h"
#include "toolhelp.h"
-#include "stddebug.h"
#include "debug.h"
#include "heap.h"
@@ -36,7 +35,7 @@
{
int i;
- dprintf_toolhelp( stddeb, "NotifyRegister(%x,%lx,%x) called.\n",
+ dprintf_info(toolhelp, "NotifyRegister(%x,%lx,%x) called.\n",
htask, (DWORD)lpfnCallback, wFlags );
if (!htask) htask = GetCurrentTask();
for (i=0;i<nrofnotifys;i++)
@@ -62,7 +61,7 @@
{
int i;
- dprintf_toolhelp( stddeb, "NotifyUnregister(%x) called.\n", htask );
+ dprintf_info(toolhelp, "NotifyUnregister(%x) called.\n", htask );
if (!htask) htask = GetCurrentTask();
for (i=nrofnotifys;i--;)
if (notifys[i].htask==htask)
diff --git a/misc/tweak.c b/misc/tweak.c
index 53d7f42..e39f95a 100644
--- a/misc/tweak.c
+++ b/misc/tweak.c
@@ -210,7 +210,7 @@
PROFILE_GetWineIniInt("Tweak.Colors", "Pen0095.Grn", 0x00),
PROFILE_GetWineIniInt("Tweak.Colors", "Pen0095.Blu", 0x00)));
- dprintf_tweak(stddeb, "TWEAK_VarInit: Using %s look and feel.\n",
+ dprintf_info(tweak, "TWEAK_VarInit: Using %s look and feel.\n",
TWEAK_Win95Look ? "Win95" : "Win3.1");
return 1;
}
diff --git a/misc/ver.c b/misc/ver.c
index c548da7..d58df8a 100644
--- a/misc/ver.c
+++ b/misc/ver.c
@@ -17,7 +17,6 @@
#include "lzexpand.h"
#include "module.h"
#include "neexe.h"
-#include "stddebug.h"
#include "debug.h"
#include "xmalloc.h"
#include "winreg.h"
@@ -33,7 +32,7 @@
* char const * teststring,
* char const * epilogue )
*
- * This function will print via dprintf_ver to stddeb the prologue string,
+ * This function will print via dprintf[_]ver to stddeb the prologue string,
* followed by the address of teststring and the string it contains if
* teststring is non-null or "(null)" otherwise, and then the epilogue
* string followed by a new line.
@@ -46,7 +45,7 @@
* this function should fix the problem.
* 15-Feb-1998 Dimitrie Paun (dimi@cs.toronto.edu)
* Modified it to make it print the message using only one
- * dprintf_ver call.
+ * dprintf[_]ver call.
*
*****************************************************************************/
@@ -55,7 +54,7 @@
char const * teststring,
char const * epilogue )
{
- dprintf_ver(stddeb, "%s %p (\"%s\") %s\n", prologue,
+ dprintf_info(ver, "%s %p (\"%s\") %s\n", prologue,
(void const *) teststring,
teststring ? teststring : "(null)",
epilogue);
@@ -63,7 +62,7 @@
/******************************************************************************
*
- * This function will print via dprintf_ver to stddeb debug info regarding
+ * This function will print via dprintf[_]ver to stddeb debug info regarding
* the file info structure vffi.
* 15-Feb-1998 Dimitrie Paun (dimi@cs.toronto.edu)
* Added this function to clean up the code.
@@ -71,10 +70,9 @@
*****************************************************************************/
static void print_vffi_debug(VS_FIXEDFILEINFO *vffi)
{
- char buff[1024];
- char *p;
+ dbg_decl_str(ver, 1024);
- dprintf_ver(stddeb," structversion=0x%lx.0x%lx, fileversion=0x%lx.0x%lx, productversion=0x%lx.0x%lx, flagmask=0x%lx, flags=%s%s%s%s%s%s\n",
+ dprintf_info(ver," structversion=0x%lx.0x%lx, fileversion=0x%lx.0x%lx, productversion=0x%lx.0x%lx, flagmask=0x%lx, flags=%s%s%s%s%s%s\n",
(vffi->dwStrucVersion>>16),vffi->dwStrucVersion&0xFFFF,
vffi->dwFileVersionMS,vffi->dwFileVersionLS,
vffi->dwProductVersionMS,vffi->dwProductVersionLS,
@@ -87,98 +85,96 @@
(vffi->dwFileFlags & VS_FF_SPECIALBUILD) ? "SPECIALBUILD," : ""
);
- p = buff;
- p+=sprintf(p," OS=0x%lx.0x%lx (",
+ dsprintf(ver," OS=0x%lx.0x%lx ",
(vffi->dwFileOS&0xFFFF0000)>>16,
vffi->dwFileOS&0x0000FFFF
);
switch (vffi->dwFileOS&0xFFFF0000) {
- case VOS_DOS:p+=sprintf(p,"DOS,");break;
- case VOS_OS216:p+=sprintf(p,"OS/2-16,");break;
- case VOS_OS232:p+=sprintf(p,"OS/2-32,");break;
- case VOS_NT:p+=sprintf(p,"NT,");break;
+ case VOS_DOS:dsprintf(ver,"DOS,");break;
+ case VOS_OS216:dsprintf(ver,"OS/2-16,");break;
+ case VOS_OS232:dsprintf(ver,"OS/2-32,");break;
+ case VOS_NT:dsprintf(ver,"NT,");break;
case VOS_UNKNOWN:
default:
- p+=sprintf(p,"UNKNOWN(0x%lx),",vffi->dwFileOS&0xFFFF0000);break;
+ dsprintf(ver,"UNKNOWN(0x%lx),",vffi->dwFileOS&0xFFFF0000);break;
}
switch (vffi->dwFileOS & 0xFFFF) {
- case VOS__BASE:p+=sprintf(p,"BASE");break;
- case VOS__WINDOWS16:p+=sprintf(p,"WIN16");break;
- case VOS__WINDOWS32:p+=sprintf(p,"WIN32");break;
- case VOS__PM16:p+=sprintf(p,"PM16");break;
- case VOS__PM32:p+=sprintf(p,"PM32");break;
- default:p+=sprintf(p,"UNKNOWN(0x%lx)",vffi->dwFileOS&0xFFFF);break;
+ case VOS__BASE:dsprintf(ver,"BASE");break;
+ case VOS__WINDOWS16:dsprintf(ver,"WIN16");break;
+ case VOS__WINDOWS32:dsprintf(ver,"WIN32");break;
+ case VOS__PM16:dsprintf(ver,"PM16");break;
+ case VOS__PM32:dsprintf(ver,"PM32");break;
+ default:dsprintf(ver,"UNKNOWN(0x%lx)",vffi->dwFileOS&0xFFFF);break;
}
- p+=sprintf(p,")");
- dprintf_ver(stddeb, "%s\n", buff);
+ dprintf_info(ver, "(%s)\n", dbg_str(ver));
- p = buff;
+ dbg_reset_str(ver);
switch (vffi->dwFileType) {
default:
case VFT_UNKNOWN:
- p+=sprintf(p,"filetype=Unknown(0x%lx)",vffi->dwFileType);
+ dsprintf(ver,"filetype=Unknown(0x%lx)",vffi->dwFileType);
break;
- case VFT_APP:p+=sprintf(p,"filetype=APP,");break;
- case VFT_DLL:p+=sprintf(p,"filetype=DLL,");break;
+ case VFT_APP:dsprintf(ver,"filetype=APP,");break;
+ case VFT_DLL:dsprintf(ver,"filetype=DLL,");break;
case VFT_DRV:
- p+=sprintf(p,"filetype=DRV,");
+ dsprintf(ver,"filetype=DRV,");
switch(vffi->dwFileSubtype) {
default:
case VFT2_UNKNOWN:
- p+=sprintf(p,"UNKNOWN(0x%lx)",vffi->dwFileSubtype);
+ dsprintf(ver,"UNKNOWN(0x%lx)",vffi->dwFileSubtype);
break;
case VFT2_DRV_PRINTER:
- p+=sprintf(p,"PRINTER");
+ dsprintf(ver,"PRINTER");
break;
case VFT2_DRV_KEYBOARD:
- p+=sprintf(p,"KEYBOARD");
+ dsprintf(ver,"KEYBOARD");
break;
case VFT2_DRV_LANGUAGE:
- p+=sprintf(p,"LANGUAGE");
+ dsprintf(ver,"LANGUAGE");
break;
case VFT2_DRV_DISPLAY:
- p+=sprintf(p,"DISPLAY");
+ dsprintf(ver,"DISPLAY");
break;
case VFT2_DRV_MOUSE:
- p+=sprintf(p,"MOUSE");
+ dsprintf(ver,"MOUSE");
break;
case VFT2_DRV_NETWORK:
- p+=sprintf(p,"NETWORK");
+ dsprintf(ver,"NETWORK");
break;
case VFT2_DRV_SYSTEM:
- p+=sprintf(p,"SYSTEM");
+ dsprintf(ver,"SYSTEM");
break;
case VFT2_DRV_INSTALLABLE:
- p+=sprintf(p,"INSTALLABLE");
+ dsprintf(ver,"INSTALLABLE");
break;
case VFT2_DRV_SOUND:
- p+=sprintf(p,"SOUND");
+ dsprintf(ver,"SOUND");
break;
case VFT2_DRV_COMM:
- p+=sprintf(p,"COMM");
+ dsprintf(ver,"COMM");
break;
case VFT2_DRV_INPUTMETHOD:
- p+=sprintf(p,"INPUTMETHOD");
+ dsprintf(ver,"INPUTMETHOD");
break;
}
break;
case VFT_FONT:
- p+=sprintf(p,"filetype=FONT.");
+ dsprintf(ver,"filetype=FONT.");
switch (vffi->dwFileSubtype) {
default:
- p+=sprintf(p,"UNKNOWN(0x%lx)",vffi->dwFileSubtype);
+ dsprintf(ver,"UNKNOWN(0x%lx)",vffi->dwFileSubtype);
break;
- case VFT2_FONT_RASTER:p+=sprintf(p,"RASTER");break;
- case VFT2_FONT_VECTOR:p+=sprintf(p,"VECTOR");break;
- case VFT2_FONT_TRUETYPE:p+=sprintf(p,"TRUETYPE");break;
+ case VFT2_FONT_RASTER:dsprintf(ver,"RASTER");break;
+ case VFT2_FONT_VECTOR:dsprintf(ver,"VECTOR");break;
+ case VFT2_FONT_TRUETYPE:dsprintf(ver,"TRUETYPE");break;
}
break;
- case VFT_VXD:p+=sprintf(p,"filetype=VXD");break;
- case VFT_STATIC_LIB:p+=sprintf(p,"filetype=STATIC_LIB");break;
+ case VFT_VXD:dsprintf(ver,"filetype=VXD");break;
+ case VFT_STATIC_LIB:dsprintf(ver,"filetype=STATIC_LIB");break;
}
- dprintf_ver(stddeb, "%s\n", buff);
+ dprintf_info(ver, "%s\n", dbg_str(ver));
- dprintf_ver(stddeb, " filedata=0x%lx.0x%lx\n",
+ dprintf_info(ver, " filedata=0x%lx.0x%lx\n",
vffi->dwFileDateMS,vffi->dwFileDateLS);
}
@@ -320,13 +316,13 @@
nehdoffset = LZTELL(lzfd);
LZREAD(&nehd);
if (nehd.resource_tab_offset==nehd.rname_tab_offset) {
- dprintf_ver(stddeb,"no resources in NE dll\n");
+ dprintf_info(ver,"no resources in NE dll\n");
return 0;
}
LZSeek32(lzfd,nehd.resource_tab_offset+nehdoffset,SEEK_SET);
LZREAD(&shiftcount);
- dprintf_ver(stddeb,"shiftcount is %d\n",shiftcount);
- dprintf_ver(stddeb,"reading resource typeinfo dir.\n");
+ dprintf_info(ver,"shiftcount is %d\n",shiftcount);
+ dprintf_info(ver,"reading resource typeinfo dir.\n");
if (!HIWORD(typeid)) typeid = (SEGPTR)(LOWORD(typeid) | 0x8000);
if (!HIWORD(resid)) resid = (SEGPTR)(LOWORD(resid) | 0x8000);
@@ -336,7 +332,7 @@
LZREAD(&ti);
if (!ti.type_id)
return 0;
- dprintf_ver(stddeb," ti.typeid =%04x,count=%d\n",ti.type_id,ti.count);
+ dprintf_info(ver," ti.typeid =%04x,count=%d\n",ti.type_id,ti.count);
skipflag=0;
if (!HIWORD(typeid)) {
@@ -360,7 +356,7 @@
str=xmalloc(len);
if (len!=LZRead32(lzfd,str,len))
return 0;
- dprintf_ver(stddeb,"read %s to compare it with %s\n",
+ dprintf_info(ver,"read %s to compare it with %s\n",
str,(char*)PTR_SEG_TO_LIN(typeid)
);
if (lstrcmpi32A(str,(char*)PTR_SEG_TO_LIN(typeid)))
@@ -378,7 +374,7 @@
int len;
LZREAD(&ni);
- dprintf_ver(stddeb," ni.id=%4x,offset=%d,length=%d\n",
+ dprintf_info(ver," ni.id=%4x,offset=%d,length=%d\n",
ni.id,ni.offset,ni.length
);
skipflag=1;
@@ -401,7 +397,7 @@
str=xmalloc(len);
if (len!=LZRead32(lzfd,str,len))
return 0;
- dprintf_ver(stddeb,"read %s to compare it with %s\n",
+ dprintf_info(ver,"read %s to compare it with %s\n",
str,(char*)PTR_SEG_TO_LIN(typeid)
);
if (!lstrcmpi32A(str,(char*)PTR_SEG_TO_LIN(typeid)))
@@ -420,7 +416,7 @@
free(rdata);
return 0;
}
- dprintf_ver(stddeb,"resource found.\n");
+ dprintf_info(ver,"resource found.\n");
*resdata= (BYTE*)rdata;
*reslen = len;
return 1;
@@ -449,7 +445,7 @@
pehdoffset = LZTELL(lzfd);
LZREAD(&pehd);
resdir = pehd.OptionalHeader.DataDirectory[IMAGE_FILE_RESOURCE_DIRECTORY];
- dprintf_ver(stddeb,"find_pe_resource(.,%p,%p,....)\n",typeid,resid);
+ dprintf_info(ver,"find_pe_resource(.,%p,%p,....)\n",typeid,resid);
if (!resdir.Size) {
fprintf(stderr,"misc/ver.c:find_pe_resource() no resource directory found in PE file.\n");
return 0;
@@ -484,20 +480,20 @@
resourcedir = (LPIMAGE_RESOURCE_DIRECTORY)(image+resdir.VirtualAddress);
xresdir = GetResDirEntryW(resourcedir,typeid,(DWORD)resourcedir,FALSE);
if (!xresdir) {
- dprintf_ver(stddeb,"...no typeid entry found for %p\n",typeid);
+ dprintf_info(ver,"...no typeid entry found for %p\n",typeid);
HeapFree(GetProcessHeap(),0,image);
return 0;
}
xresdir = GetResDirEntryW(xresdir,resid,(DWORD)resourcedir,FALSE);
if (!xresdir) {
- dprintf_ver(stddeb,"...no resid entry found for %p\n",resid);
+ dprintf_info(ver,"...no resid entry found for %p\n",resid);
HeapFree(GetProcessHeap(),0,image);
return 0;
}
xresdir = GetResDirEntryW(xresdir,0,(DWORD)resourcedir,TRUE);
if (!xresdir) {
- dprintf_ver(stddeb,"...no 0 (default language) entry found for %p\n",resid);
+ dprintf_info(ver,"...no 0 (default language) entry found for %p\n",resid);
HeapFree(GetProcessHeap(),0,image);
return 0;
}
@@ -531,7 +527,7 @@
int reslen=0;
int res=0;
- dprintf_ver(stddeb,"GetFileResourceSize(%s,%lx,%lx,%p)\n",
+ dprintf_info(ver,"GetFileResourceSize(%s,%lx,%lx,%p)\n",
filename,(LONG)restype,(LONG)resid,off
);
lzfd=LZOpenFile32A(filename,&ofs,OF_READ);
@@ -568,7 +564,7 @@
int res=0;
int reslen=datalen;
- dprintf_ver(stddeb,"GetFileResource(%s,%lx,%lx,%ld,%ld,%p)\n",
+ dprintf_info(ver,"GetFileResource(%s,%lx,%lx,%ld,%ld,%p)\n",
filename,(LONG)restype,(LONG)resid,off,datalen,data
);
@@ -607,7 +603,7 @@
BYTE buf[144];
VS_FIXEDFILEINFO *vffi;
- dprintf_ver(stddeb,"GetFileVersionInfoSize16(%s,%p)\n",filename,handle);
+ dprintf_info(ver,"GetFileVersionInfoSize16(%s,%p)\n",filename,handle);
len=GetFileResourceSize(filename,VS_FILE_INFO,VS_VERSION_INFO,handle);
if (!len)
return 0;
@@ -633,7 +629,7 @@
if (*(WORD*)buf < len)
len = *(WORD*)buf;
- if(debugging_ver)
+ if(debugging_info(ver))
print_vffi_debug(vffi);
return len;
@@ -642,7 +638,7 @@
/* GetFileVersionInfoSize32A [VERSION.1] */
DWORD WINAPI GetFileVersionInfoSize32A(LPCSTR filename,LPDWORD handle)
{
- dprintf_ver(stddeb,"GetFileVersionInfoSize32A(%s,%p)\n",filename,handle);
+ dprintf_info(ver,"GetFileVersionInfoSize32A(%s,%p)\n",filename,handle);
return GetFileVersionInfoSize16(filename,handle);
}
@@ -659,7 +655,7 @@
DWORD WINAPI GetFileVersionInfo16(LPCSTR filename,DWORD handle,DWORD datasize,
LPVOID data)
{
- dprintf_ver(stddeb,"GetFileVersionInfo16(%s,%ld,%ld,%p)\n->",
+ dprintf_info(ver,"GetFileVersionInfo16(%s,%ld,%ld,%p)\n",
filename,handle,datasize,data
);
return GetFileResource(
@@ -716,27 +712,27 @@
retval = 0;
/* Print out debugging information */
- dprintf_ver(stddeb, "VerFindFile() called with parameters:\n"
+ dprintf_info(ver, "VerFindFile() called with parameters:\n"
"\tflags = %x", flags);
if(flags & VFFF_ISSHAREDFILE)
- dprintf_ver(stddeb, " (VFFF_ISSHAREDFILE)\n");
+ dprintf_info(ver, " (VFFF_ISSHAREDFILE)\n");
else
- dprintf_ver(stddeb, "\n");
+ dprintf_info(ver, "\n");
ver_dstring("\tlpszFilename = ", lpszFilename, "");
ver_dstring("\tlpszWinDir = ", lpszWinDir, "");
ver_dstring("\tlpszAppDir = ", lpszAppDir, "");
- dprintf_ver(stddeb, "\tlpszCurDir = %p\n", lpszCurDir);
+ dprintf_info(ver, "\tlpszCurDir = %p\n", lpszCurDir);
if(lpuCurDirLen)
- dprintf_ver(stddeb, "\tlpuCurDirLen = %p (%u)\n",
+ dprintf_info(ver, "\tlpuCurDirLen = %p (%u)\n",
lpuCurDirLen, *lpuCurDirLen);
else
- dprintf_ver(stddeb, "\tlpuCurDirLen = (null)\n");
+ dprintf_info(ver, "\tlpuCurDirLen = (null)\n");
- dprintf_ver(stddeb, "\tlpszDestDir = %p\n", lpszDestDir);
+ dprintf_info(ver, "\tlpszDestDir = %p\n", lpszDestDir);
if(lpuDestDirLen)
- dprintf_ver(stddeb, "\tlpuDestDirLen = %p (%u)\n",
+ dprintf_info(ver, "\tlpuDestDirLen = %p (%u)\n",
lpuDestDirLen, *lpuDestDirLen);
/* Figure out where the file should go; shared files default to the
@@ -824,21 +820,21 @@
*lpuCurDirLen = curDirSizeReq;
}
- dprintf_ver(stddeb, "VerFindFile() ret = %lu (%s%s%s)\n", retval,
+ dprintf_info(ver, "VerFindFile() ret = %lu (%s%s%s)\n", retval,
(retval & VFF_CURNEDEST) ? "VFF_CURNEDEST " : "",
(retval & VFF_FILEINUSE) ? "VFF_FILEINUSE " : "",
(retval & VFF_BUFFTOOSMALL) ? "VFF_BUFFTOOSMALL " : "");
ver_dstring("\t(Exit) lpszCurDir = ", lpszCurDir, "");
if(lpuCurDirLen)
- dprintf_ver(stddeb, "\t(Exit) lpuCurDirLen = %p (%u)\n",
+ dprintf_info(ver, "\t(Exit) lpuCurDirLen = %p (%u)\n",
lpuCurDirLen, *lpuCurDirLen);
else
- dprintf_ver(stddeb, "\t(Exit) lpuCurDirLen = (null)\n");
+ dprintf_info(ver, "\t(Exit) lpuCurDirLen = (null)\n");
ver_dstring("\t(Exit) lpszDestDir = ", lpszDestDir, "");
if(lpuDestDirLen)
- dprintf_ver(stddeb, "\t(Exit) lpuDestDirLen = %p (%u)\n",
+ dprintf_info(ver, "\t(Exit) lpuDestDirLen = %p (%u)\n",
lpuDestDirLen, *lpuDestDirLen);
return retval;
@@ -1195,13 +1191,13 @@
while (1) {
db=(struct dbA*)block;
- dprintf_ver(stddeb,"db=%p,db->nextoff=%d,db->datalen=%d,db->name=%s\n",
+ dprintf_info(ver,"db=%p,db->nextoff=%d,db->datalen=%d,db->name=%s\n",
db,db->nextoff,db->datalen,db->name
);
if ((!db->nextoff) || (buff_remain<=0)) /* no more entries ? */
return NULL;
- dprintf_ver(stddeb,"comparing with %s\n",db->name);
+ dprintf_info(ver,"comparing with %s\n",db->name);
if (!lstrncmpi32A(db->name,str,substrlen)) {
if (nextslash) {
inc_size=DATA_OFFSET_A(db)+((db->datalen+3)&~3);
@@ -1252,7 +1248,7 @@
} else
vs = HEAP_strdupA(GetProcessHeap(),0,"no data");
- dprintf_ver(stddeb,"db->nextoff=%d,db->name=%s,db->data=\"%s\"\n",
+ dprintf_info(ver,"db->nextoff=%d,db->name=%s,db->data=\"%s\"\n",
db->nextoff,xs,vs
);
HeapFree(GetProcessHeap(),0,vs);
@@ -1288,7 +1284,7 @@
LPSTR s;
BYTE *block=PTR_SEG_TO_LIN(segblock),*b;
- dprintf_ver(stddeb,"VerQueryValue16(%p,%s,%p,%d)\n",
+ dprintf_info(ver,"VerQueryValue16(%p,%s,%p,%d)\n",
block,subblock,buffer,*buflen
);
@@ -1316,10 +1312,10 @@
*buflen = db->datalen;
if (db->btext) {
xs = HEAP_strdupWtoA(GetProcessHeap(),0,(WCHAR*)b);
- dprintf_ver(stderr,"->%s\n",xs);
+ dprintf_info(ver,"->%s\n",xs);
HeapFree(GetProcessHeap(),0,xs);
} else
- dprintf_ver(stderr,"->%p\n",b);
+ dprintf_info(ver,"->%p\n",b);
} else {
struct dbA *db;
b=_find_dataA(block,s,*(WORD*)block);
@@ -1334,9 +1330,9 @@
*buflen = db->datalen;
/* the string is only printable, if it is below \\StringFileInfo*/
if (!lstrncmpi32A("VS_VERSION_INFO\\StringFileInfo\\",s,strlen("VS_VERSION_INFO\\StringFileInfo\\")))
- dprintf_ver(stddeb," -> %s=%s\n",subblock,b);
+ dprintf_info(ver," -> %s=%s\n",subblock,b);
else
- dprintf_ver(stddeb," -> %s=%p\n",subblock,b);
+ dprintf_info(ver," -> %s=%p\n",subblock,b);
}
*buffer = (b-block)+segblock;
free(s);
@@ -1349,7 +1345,7 @@
BYTE *b,*block=(LPBYTE)vblock,**buffer=(LPBYTE*)vbuffer;
LPSTR s;
- dprintf_ver(stddeb,"VerQueryValue32A(%p,%s,%p,%d)\n",
+ dprintf_info(ver,"VerQueryValue32A(%p,%s,%p,%d)\n",
block,subblock,buffer,*buflen
);
@@ -1378,10 +1374,10 @@
b = b+DATA_OFFSET_W(db);
if (db->btext) {
xs = HEAP_strdupWtoA(GetProcessHeap(),0,(WCHAR*)b);
- dprintf_ver(stderr,"->%s\n",xs);
+ dprintf_info(ver,"->%s\n",xs);
HeapFree(GetProcessHeap(),0,xs);
} else
- dprintf_ver(stderr,"->%p\n",b);
+ dprintf_info(ver,"->%p\n",b);
/* This is a leak. */
b = HEAP_strdupWtoA(GetProcessHeap(),0,(WCHAR*)b);
} else {
@@ -1399,9 +1395,9 @@
/* the string is only printable, if it is below \\StringFileInfo*/
if (!lstrncmpi32A("VS_VERSION_INFO\\StringFileInfo\\",s,strlen("VS_VERSION_INFO\\StringFileInfo\\")))
- dprintf_ver(stddeb," -> %s=%s\n",subblock,b);
+ dprintf_info(ver," -> %s=%s\n",subblock,b);
else
- dprintf_ver(stddeb," -> %s=%p\n",subblock,b);
+ dprintf_info(ver," -> %s=%p\n",subblock,b);
}
*buffer = b;
free(s);
diff --git a/misc/version.c b/misc/version.c
index b694a78..971e758 100644
--- a/misc/version.c
+++ b/misc/version.c
@@ -294,6 +294,7 @@
*
* writes a debug string into <windir>\bootlog.txt
*/
-void WINAPI DiagOutput()
+void WINAPI DiagOutput(LPCSTR str)
{
+ fprintf(stderr,"DIAGOUTPUT:%s\n",str);
}
diff --git a/misc/winsock.c b/misc/winsock.c
index 835151d..239c456 100644
--- a/misc/winsock.c
+++ b/misc/winsock.c
@@ -44,7 +44,6 @@
#include "task.h"
#include "message.h"
#include "miscemu.h"
-#include "stddebug.h"
#include "debug.h"
#define DEBUG_SOCKADDR 0
@@ -206,7 +205,7 @@
optlen = sizeof(optval);
getsockopt(s, SOL_SOCKET, SO_ERROR, &optval, &optlen);
- if (optval) dprintf_winsock(stddeb, "\t[%i] error: %d\n", s, optval);
+ if (optval) dprintf_warn(winsock, "\t[%i] error: %d\n", s, optval);
return optval != 0;
}
@@ -249,7 +248,7 @@
if( b32 ) wsfds32->fd_count = j;
else wsfds16->fd_count = j;
- dprintf_winsock(stddeb, "\n");
+ dprintf_info(winsock, "\n");
#undef wsfds32
#undef wsfds16
}
@@ -304,7 +303,7 @@
HTASK16 tid = GetCurrentTask();
LPWSINFO pwsi;
- dprintf_winsock(stddeb, "WSAStartup: verReq=%x\n", wVersionRequested);
+ dprintf_info(winsock, "WSAStartup: verReq=%x\n", wVersionRequested);
if (LOBYTE(wVersionRequested) < 1 || (LOBYTE(wVersionRequested) == 1 &&
HIBYTE(wVersionRequested) < 1)) return WSAVERNOTSUPPORTED;
@@ -359,7 +358,7 @@
memcpy(lpWSAData, &WINSOCK_data, sizeof(WINSOCK_data));
- dprintf_winsock(stddeb, "WSAStartup: succeeded\n");
+ dprintf_info(winsock, "WSAStartup: succeeded\n");
return 0;
}
@@ -411,12 +410,12 @@
WINSOCK_Shutdown(); /* just in case */
if( pwsi->flags & WSI_BLOCKINGCALL )
- dprintf_winsock(stddeb,"\tinside blocking call!\n");
+ dprintf_info(winsock,"\tinside blocking call!\n");
/* FIXME: aop_control() doesn't decrement pwsi->num_async_rq
*
* if( pwsi->num_async_rq )
- * dprintf_winsock(stddeb,"\thave %i outstanding async ops!\n", pwsi->num_async_rq );
+ * dprintf_warn(winsock,"\thave %i outstanding async ops!\n", pwsi->num_async_rq );
*/
for(i = 0, j = 0, n = 0; i < WS_MAX_SOCKETS_PER_PROCESS; i++)
@@ -430,7 +429,7 @@
close(pwsi->sock[i].fd); j++;
}
if( j )
- dprintf_winsock(stddeb,"\tclosed %i sockets, killed %i async selects!\n", j, n);
+ dprintf_info(winsock,"\tclosed %i sockets, killed %i async selects!\n", j, n);
/* delete scratch buffers */
@@ -448,7 +447,7 @@
{
HTASK16 hTask = GetCurrentTask();
- dprintf_winsock(stddeb, "WSACleanup(%04x)\n", hTask );
+ dprintf_info(winsock, "WSACleanup(%04x)\n", hTask );
if( hTask )
{
LPWSINFO pwsi = wsi_find(hTask);
@@ -467,14 +466,11 @@
*/
INT32 WINAPI WSAGetLastError(void)
{
- LPWSINFO pwsi = wsi_find(GetCurrentTask());
- INT16 ret;
+ LPWSINFO pwsi = wsi_find(GetCurrentTask());
+ INT16 ret = (pwsi) ? pwsi->err : WSANOTINITIALISED;
- dprintf_winsock(stddeb, "WSAGetLastError(%08x)", (unsigned)pwsi);
-
- ret = (pwsi) ? pwsi->err : WSANOTINITIALISED;
-
- dprintf_winsock(stddeb, " = %i\n", (int)ret);
+ dprintf_info(winsock, "WSAGetLastError(%08x) = %i\n",
+ (unsigned)pwsi, (int)ret);
return ret;
}
@@ -485,7 +481,7 @@
{
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WSASetLastError(%08x): %d\n", (unsigned)pwsi, (int)iError);
+ dprintf_info(winsock, "WSASetLastError(%08x): %d\n", (unsigned)pwsi, (int)iError);
if( pwsi ) pwsi->err = iError;
}
@@ -526,7 +522,7 @@
ws_socket* pws = (ws_socket*)WS_HANDLE2PTR((SOCKET16)s);
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_ACCEPT(%08x): socket %04x\n",
+ dprintf_info(winsock, "WS_ACCEPT(%08x): socket %04x\n",
(unsigned)pwsi, (UINT16)s );
if( _check_ws(pwsi, pws) )
{
@@ -577,7 +573,7 @@
ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s);
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_BIND(%08x): socket %04x, ptr %8x, length %d\n",
+ dprintf_info(winsock, "WS_BIND(%08x): socket %04x, ptr %8x, length %d\n",
(unsigned)pwsi, s, (int) name, namelen);
#if DEBUG_SOCKADDR
dump_sockaddr(name);
@@ -589,7 +585,7 @@
if ( bind(pws->fd, name, namelen) < 0 )
{
int loc_errno = errno;
- dprintf_winsock(stddeb,"\tfailure - errno = %i\n", errno);
+ dprintf_warn(winsock, "\tfailure - errno = %i\n", errno);
errno = loc_errno;
switch(errno)
{
@@ -620,7 +616,7 @@
ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s);
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_CLOSE(%08x): socket %08x\n", (unsigned)pwsi, s);
+ dprintf_info(winsock, "WS_CLOSE(%08x): socket %08x\n", (unsigned)pwsi, s);
if( _check_ws(pwsi, pws) )
{
@@ -655,7 +651,7 @@
ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s);
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_CONNECT(%08x): socket %04x, ptr %8x, length %d\n",
+ dprintf_info(winsock, "WS_CONNECT(%08x): socket %04x, ptr %8x, length %d\n",
(unsigned)pwsi, s, (int) name, namelen);
#if DEBUG_SOCKADDR
dump_sockaddr(name);
@@ -713,7 +709,7 @@
ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s);
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_GETPEERNAME(%08x): socket: %04x, ptr %8x, ptr %8x\n",
+ dprintf_info(winsock, "WS_GETPEERNAME(%08x): socket: %04x, ptr %8x, ptr %8x\n",
(unsigned)pwsi, s, (int) name, *namelen);
if( _check_ws(pwsi, pws) )
{
@@ -750,7 +746,7 @@
ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s);
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_GETSOCKNAME(%08x): socket: %04x, ptr %8x, ptr %8x\n",
+ dprintf_info(winsock, "WS_GETSOCKNAME(%08x): socket: %04x, ptr %8x, ptr %8x\n",
(unsigned)pwsi, s, (int) name, (int) *namelen);
if( _check_ws(pwsi, pws) )
{
@@ -794,7 +790,7 @@
ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s);
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_GETSOCKOPT(%08x): socket: %04x, opt %d, ptr %8x, ptr %8x\n",
+ dprintf_info(winsock, "WS_GETSOCKOPT(%08x): socket: %04x, opt %d, ptr %8x, ptr %8x\n",
(unsigned)pwsi, s, level, (int) optval, (int) *optlen);
if( _check_ws(pwsi, pws) )
{
@@ -887,7 +883,7 @@
ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s);
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_IOCTL(%08x): socket %04x, cmd %08x, ptr %8x\n",
+ dprintf_info(winsock, "WS_IOCTL(%08x): socket %04x, cmd %08x, ptr %8x\n",
(unsigned)pwsi, s, cmd, (unsigned) argp);
if( _check_ws(pwsi, pws) )
{
@@ -920,7 +916,7 @@
default:
/* Netscape tries hard to use bogus ioctl 0x667e */
- dprintf_winsock(stddeb,"\tunknown WS_IOCTL cmd (%08x)\n", cmd);
+ dprintf_warn(winsock, "\tunknown WS_IOCTL cmd (%08x)\n", cmd);
}
if( ioctl(pws->fd, newcmd, (char*)argp ) == 0 ) return 0;
pwsi->err = (errno == EBADF) ? WSAENOTSOCK : wsaErrno();
@@ -945,7 +941,7 @@
ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s);
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_LISTEN(%08x): socket %04x, backlog %d\n",
+ dprintf_info(winsock, "WS_LISTEN(%08x): socket %04x, backlog %d\n",
(unsigned)pwsi, s, backlog);
if( _check_ws(pwsi, pws) )
{
@@ -983,14 +979,15 @@
ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s);
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_RECV(%08x): socket %04x, buf %8x, len %d, flags %d",
- (unsigned)pwsi, s, (unsigned)buf, len, flags);
+ dprintf_info(winsock, "WS_RECV(%08x): socket %04x, buf %8x, len %d, "
+ "flags %d\n", (unsigned)pwsi, s, (unsigned)buf,
+ len, flags);
if( _check_ws(pwsi, pws) )
{
INT32 length;
if ((length = recv(pws->fd, buf, len, flags)) >= 0)
{
- dprintf_winsock(stddeb, " -> %i bytes\n", length);
+ dprintf_info(winsock, " -> %i bytes\n", length);
if( pws->psop && (pws->flags & (WS_FD_READ | WS_FD_CLOSE)) )
EVENT_AddIO( pws->fd, EVENT_IO_READ ); /* reenabler */
@@ -1000,7 +997,7 @@
pwsi->err = wsaErrno();
}
else if( pwsi ) pwsi->err = WSAENOTSOCK;
- dprintf_winsock(stddeb, " -> ERROR\n");
+ dprintf_warn(winsock, " -> ERROR\n");
return SOCKET_ERROR;
}
@@ -1022,8 +1019,9 @@
ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s);
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_RECVFROM(%08x): socket %04x, ptr %08x, len %d, flags %d",
- (unsigned)pwsi, s, (unsigned)buf, len, flags);
+ dprintf_info(winsock, "WS_RECVFROM(%08x): socket %04x, ptr %08x, "
+ "len %d, flags %d\n", (unsigned)pwsi, s, (unsigned)buf,
+ len, flags);
#if DEBUG_SOCKADDR
if( from ) dump_sockaddr(from);
else fprintf(stderr, "\tfrom = NULL\n");
@@ -1035,7 +1033,7 @@
if ((length = recvfrom(pws->fd, buf, len, flags, from, fromlen32)) >= 0)
{
- dprintf_winsock(stddeb, " -> %i bytes\n", length);
+ dprintf_info(winsock, " -> %i bytes\n", length);
if( pws->psop && (pws->flags & (WS_FD_READ | WS_FD_CLOSE)) )
EVENT_AddIO( pws->fd, EVENT_IO_READ ); /* reenabler */
@@ -1045,7 +1043,7 @@
pwsi->err = wsaErrno();
}
else if( pwsi ) pwsi->err = WSAENOTSOCK;
- dprintf_winsock(stddeb, " -> ERROR\n");
+ dprintf_warn(winsock, " -> ERROR\n");
return SOCKET_ERROR;
}
@@ -1073,7 +1071,7 @@
{
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_SELECT(%08x): read %8x, write %8x, excp %8x\n",
+ dprintf_info(winsock, "WS_SELECT(%08x): read %8x, write %8x, excp %8x\n",
(unsigned) pwsi, (unsigned) ws_readfds, (unsigned) ws_writefds, (unsigned) ws_exceptfds);
if( pwsi )
@@ -1152,7 +1150,7 @@
ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s);
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_SEND(%08x): socket %04x, ptr %08x, length %d, flags %d\n",
+ dprintf_info(winsock, "WS_SEND(%08x): socket %04x, ptr %08x, length %d, flags %d\n",
(unsigned)pwsi, s, (unsigned) buf, len, flags);
if( _check_ws(pwsi, pws) )
{
@@ -1188,7 +1186,7 @@
ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s);
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_SENDTO(%08x): socket %04x, ptr %08x, length %d, flags %d\n",
+ dprintf_info(winsock, "WS_SENDTO(%08x): socket %04x, ptr %08x, length %d, flags %d\n",
(unsigned)pwsi, s, (unsigned) buf, len, flags);
if( _check_ws(pwsi, pws) )
{
@@ -1225,7 +1223,7 @@
ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s);
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_SETSOCKOPT(%08x): socket %04x, lev %d, opt %d, ptr %08x, len %d\n",
+ dprintf_info(winsock, "WS_SETSOCKOPT(%08x): socket %04x, lev %d, opt %d, ptr %08x, len %d\n",
(unsigned)pwsi, s, level, optname, (int) optval, optlen);
if( _check_ws(pwsi, pws) )
{
@@ -1265,7 +1263,7 @@
ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s);
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_SHUTDOWN(%08x): socket %04x, how %i\n",
+ dprintf_info(winsock, "WS_SHUTDOWN(%08x): socket %04x, how %i\n",
(unsigned)pwsi, s, how );
if( _check_ws(pwsi, pws) )
{
@@ -1330,7 +1328,7 @@
{
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_SOCKET(%08x): af=%d type=%d protocol=%d\n",
+ dprintf_info(winsock, "WS_SOCKET(%08x): af=%d type=%d protocol=%d\n",
(unsigned)pwsi, af, type, protocol);
if( pwsi )
@@ -1374,7 +1372,7 @@
{
ws_socket* pnew = wsi_alloc_socket(pwsi, sock);
- dprintf_winsock(stddeb,"\tcreated %i (handle %04x)\n", sock, (UINT16)WS_PTR2HANDLE(pnew));
+ dprintf_info(winsock,"\tcreated %i (handle %04x)\n", sock, (UINT16)WS_PTR2HANDLE(pnew));
if( pnew )
{
@@ -1394,7 +1392,7 @@
} else pwsi->err = wsaErrno();
}
- dprintf_winsock(stddeb, "\t\tfailed!\n");
+ dprintf_warn(winsock, "\t\tfailed!\n");
return INVALID_SOCKET32;
}
@@ -1441,7 +1439,7 @@
SEGPTR WINAPI WINSOCK_gethostbyaddr16(const char *addr, INT16 len, INT16 type)
{
struct WIN_hostent* retval;
- dprintf_winsock(stddeb, "WS_GetHostByAddr16: ptr %08x, len %d, type %d\n",
+ dprintf_info(winsock, "WS_GetHostByAddr16: ptr %08x, len %d, type %d\n",
(unsigned) addr, len, type);
retval = __ws_gethostbyaddr( addr, len, type, WS_DUP_SEGPTR );
return retval ? SEGPTR_GET(retval) : ((SEGPTR)NULL);
@@ -1450,7 +1448,7 @@
struct WIN_hostent* WINAPI WINSOCK_gethostbyaddr32(const char *addr, INT32 len,
INT32 type)
{
- dprintf_winsock(stddeb, "WS_GetHostByAddr32: ptr %08x, len %d, type %d\n",
+ dprintf_info(winsock, "WS_GetHostByAddr32: ptr %08x, len %d, type %d\n",
(unsigned) addr, len, type);
return __ws_gethostbyaddr(addr, len, type, WS_DUP_LINEAR);
}
@@ -1477,14 +1475,14 @@
SEGPTR WINAPI WINSOCK_gethostbyname16(const char *name)
{
struct WIN_hostent* retval;
- dprintf_winsock(stddeb, "WS_GetHostByName16: %s\n", (name)?name:NULL_STRING);
+ dprintf_info(winsock, "WS_GetHostByName16: %s\n", (name)?name:NULL_STRING);
retval = __ws_gethostbyname( name, WS_DUP_SEGPTR );
return (retval)? SEGPTR_GET(retval) : ((SEGPTR)NULL) ;
}
struct WIN_hostent* WINAPI WINSOCK_gethostbyname32(const char* name)
{
- dprintf_winsock(stddeb, "WS_GetHostByName32: %s\n", (name)?name:NULL_STRING);
+ dprintf_info(winsock, "WS_GetHostByName32: %s\n", (name)?name:NULL_STRING);
return __ws_gethostbyname( name, WS_DUP_LINEAR );
}
@@ -1511,14 +1509,14 @@
SEGPTR WINAPI WINSOCK_getprotobyname16(const char *name)
{
struct WIN_protoent* retval;
- dprintf_winsock(stddeb, "WS_GetProtoByName16: %s\n", (name)?name:NULL_STRING);
+ dprintf_info(winsock, "WS_GetProtoByName16: %s\n", (name)?name:NULL_STRING);
retval = __ws_getprotobyname(name, WS_DUP_SEGPTR);
return retval ? SEGPTR_GET(retval) : ((SEGPTR)NULL);
}
struct WIN_protoent* WINAPI WINSOCK_getprotobyname32(const char* name)
{
- dprintf_winsock(stddeb, "WS_GetProtoByName32: %s\n", (name)?name:NULL_STRING);
+ dprintf_info(winsock, "WS_GetProtoByName32: %s\n", (name)?name:NULL_STRING);
return __ws_getprotobyname(name, WS_DUP_LINEAR);
}
@@ -1545,14 +1543,14 @@
SEGPTR WINAPI WINSOCK_getprotobynumber16(INT16 number)
{
struct WIN_protoent* retval;
- dprintf_winsock(stddeb, "WS_GetProtoByNumber16: %i\n", number);
+ dprintf_info(winsock, "WS_GetProtoByNumber16: %i\n", number);
retval = __ws_getprotobynumber(number, WS_DUP_SEGPTR);
return retval ? SEGPTR_GET(retval) : ((SEGPTR)NULL);
}
struct WIN_protoent* WINAPI WINSOCK_getprotobynumber32(INT32 number)
{
- dprintf_winsock(stddeb, "WS_GetProtoByNumber32: %i\n", number);
+ dprintf_info(winsock, "WS_GetProtoByNumber32: %i\n", number);
return __ws_getprotobynumber(number, WS_DUP_LINEAR);
}
@@ -1583,7 +1581,7 @@
SEGPTR WINAPI WINSOCK_getservbyname16(const char *name, const char *proto)
{
struct WIN_servent* retval;
- dprintf_winsock(stddeb, "WS_GetServByName16: '%s', '%s'\n",
+ dprintf_info(winsock, "WS_GetServByName16: '%s', '%s'\n",
(name)?name:NULL_STRING, (proto)?proto:NULL_STRING);
retval = __ws_getservbyname(name, proto, WS_DUP_SEGPTR);
return retval ? SEGPTR_GET(retval) : ((SEGPTR)NULL);
@@ -1591,7 +1589,7 @@
struct WIN_servent* WINAPI WINSOCK_getservbyname32(const char *name, const char *proto)
{
- dprintf_winsock(stddeb, "WS_GetServByName32: '%s', '%s'\n",
+ dprintf_info(winsock, "WS_GetServByName32: '%s', '%s'\n",
(name)?name:NULL_STRING, (proto)?proto:NULL_STRING);
return __ws_getservbyname(name, proto, WS_DUP_LINEAR);
}
@@ -1623,7 +1621,7 @@
SEGPTR WINAPI WINSOCK_getservbyport16(INT16 port, const char *proto)
{
struct WIN_servent* retval;
- dprintf_winsock(stddeb, "WS_GetServByPort16: %i, '%s'\n",
+ dprintf_info(winsock, "WS_GetServByPort16: %i, '%s'\n",
(int)port, (proto)?proto:NULL_STRING);
retval = __ws_getservbyport(port, proto, WS_DUP_SEGPTR);
return retval ? SEGPTR_GET(retval) : ((SEGPTR)NULL);
@@ -1631,7 +1629,7 @@
struct WIN_servent* WINAPI WINSOCK_getservbyport32(INT32 port, const char *proto)
{
- dprintf_winsock(stddeb, "WS_GetServByPort32: %i, '%s'\n",
+ dprintf_info(winsock, "WS_GetServByPort32: %i, '%s'\n",
(int)port, (proto)?proto:NULL_STRING);
return __ws_getservbyport(port, proto, WS_DUP_LINEAR);
}
@@ -1644,7 +1642,7 @@
{
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_GetHostName(%08x): name %s, len %d\n",
+ dprintf_info(winsock, "WS_GetHostName(%08x): name %s, len %d\n",
(unsigned)pwsi, (name)?name:NULL_STRING, namelen);
if( pwsi )
{
@@ -1684,7 +1682,7 @@
{
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_AsyncGetHostByAddr16(%08x): hwnd %04x, msg %04x, addr %08x[%i]\n",
+ dprintf_info(winsock, "WS_AsyncGetHostByAddr16(%08x): hwnd %04x, msg %04x, addr %08x[%i]\n",
(unsigned)pwsi, hWnd, uMsg, (unsigned)addr , len );
if( pwsi )
@@ -1701,7 +1699,7 @@
{
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_AsyncGetHostByAddr32(%08x): hwnd %04x, msg %08x, addr %08x[%i]\n",
+ dprintf_info(winsock, "WS_AsyncGetHostByAddr32(%08x): hwnd %04x, msg %08x, addr %08x[%i]\n",
(unsigned)pwsi, (HWND16)hWnd, uMsg, (unsigned)addr , len );
if( pwsi )
@@ -1719,7 +1717,7 @@
{
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_AsyncGetHostByName16(%08x): hwnd %04x, msg %04x, host %s,
+ dprintf_info(winsock, "WS_AsyncGetHostByName16(%08x): hwnd %04x, msg %04x, host %s,
buffer %i\n", (unsigned)pwsi, hWnd, uMsg, (name)?name:NULL_STRING, (int)buflen );
if( pwsi )
@@ -1735,7 +1733,7 @@
LPSTR sbuf, INT32 buflen)
{
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_AsyncGetHostByName32(%08x): hwnd %04x, msg %08x, host %s,
+ dprintf_info(winsock, "WS_AsyncGetHostByName32(%08x): hwnd %04x, msg %08x, host %s,
buffer %i\n", (unsigned)pwsi, (HWND16)hWnd, uMsg, (name)?name:NULL_STRING, (int)buflen );
if( pwsi )
return __WSAsyncDBQuery(pwsi, hWnd, uMsg, 0, name, 0,
@@ -1752,7 +1750,7 @@
{
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_AsyncGetProtoByName16(%08x): hwnd %04x, msg %08x, protocol %s\n",
+ dprintf_info(winsock, "WS_AsyncGetProtoByName16(%08x): hwnd %04x, msg %08x, protocol %s\n",
(unsigned)pwsi, (HWND16)hWnd, uMsg, (name)?name:NULL_STRING );
if( pwsi )
@@ -1769,7 +1767,7 @@
{
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_AsyncGetProtoByName32(%08x): hwnd %04x, msg %08x, protocol %s\n",
+ dprintf_info(winsock, "WS_AsyncGetProtoByName32(%08x): hwnd %04x, msg %08x, protocol %s\n",
(unsigned)pwsi, (HWND16)hWnd, uMsg, (name)?name:NULL_STRING );
if( pwsi )
@@ -1787,7 +1785,7 @@
{
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_AsyncGetProtoByNumber16(%08x): hwnd %04x, msg %04x, num %i\n",
+ dprintf_info(winsock, "WS_AsyncGetProtoByNumber16(%08x): hwnd %04x, msg %04x, num %i\n",
(unsigned)pwsi, hWnd, uMsg, number );
if( pwsi )
@@ -1804,7 +1802,7 @@
{
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_AsyncGetProtoByNumber32(%08x): hwnd %04x, msg %08x, num %i\n",
+ dprintf_info(winsock, "WS_AsyncGetProtoByNumber32(%08x): hwnd %04x, msg %08x, num %i\n",
(unsigned)pwsi, (HWND16)hWnd, uMsg, number );
if( pwsi )
@@ -1822,7 +1820,7 @@
{
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_AsyncGetServByName16(%08x): hwnd %04x, msg %04x, name %s, proto %s\n",
+ dprintf_info(winsock, "WS_AsyncGetServByName16(%08x): hwnd %04x, msg %04x, name %s, proto %s\n",
(unsigned)pwsi, hWnd, uMsg, (name)?name:NULL_STRING, (proto)?proto:NULL_STRING );
if( pwsi )
@@ -1844,7 +1842,7 @@
{
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_AsyncGetServByName32(%08x): hwnd %04x, msg %08x, name %s, proto %s\n",
+ dprintf_info(winsock, "WS_AsyncGetServByName32(%08x): hwnd %04x, msg %08x, name %s, proto %s\n",
(unsigned)pwsi, (HWND16)hWnd, uMsg, (name)?name:NULL_STRING, (proto)?proto:NULL_STRING );
if( pwsi )
{
@@ -1866,7 +1864,7 @@
{
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_AsyncGetServByPort16(%08x): hwnd %04x, msg %04x, port %i, proto %s\n",
+ dprintf_info(winsock, "WS_AsyncGetServByPort16(%08x): hwnd %04x, msg %04x, port %i, proto %s\n",
(unsigned)pwsi, hWnd, uMsg, port, (proto)?proto:NULL_STRING );
if( pwsi )
@@ -1888,7 +1886,7 @@
{
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_AsyncGetServByPort32(%08x): hwnd %04x, msg %08x, port %i, proto %s\n",
+ dprintf_info(winsock, "WS_AsyncGetServByPort32(%08x): hwnd %04x, msg %08x, port %i, proto %s\n",
(unsigned)pwsi, (HWND16)hWnd, uMsg, port, (proto)?proto:NULL_STRING );
if( pwsi )
@@ -1912,7 +1910,7 @@
LPWSINFO pwsi = wsi_find(GetCurrentTask());
ws_async_op* p_aop = (ws_async_op*)WS_HANDLE2PTR(hAsyncTaskHandle);
- dprintf_winsock(stddeb, "WS_CancelAsyncRequest(%08x): handle %08x\n",
+ dprintf_info(winsock, "WS_CancelAsyncRequest(%08x): handle %08x\n",
(unsigned)pwsi, hAsyncTaskHandle);
if( pwsi )
{
@@ -1952,7 +1950,7 @@
DWORD dwEvent, dwErrBytes;
int num_posted;
- dprintf_winsock(stddeb,"WINSOCK_HandleIO: %i pending descriptors\n", num_pending );
+ dprintf_info(winsock,"WINSOCK_HandleIO: %i pending descriptors\n", num_pending );
for( num_posted = dwEvent = 0 ; psop; psop = psop->next )
{
@@ -1970,7 +1968,7 @@
* Reenabling calls turn them back on.
*/
- dprintf_winsock(stddeb,"\tchecking psop = 0x%08x\n", (unsigned) psop );
+ dprintf_info(winsock,"\tchecking psop = 0x%08x\n", (unsigned) psop );
num_pending--;
@@ -2046,7 +2044,7 @@
if( PostMessage32A( psop->hWnd, psop->uMsg, (WPARAM32)WS_PTR2HANDLE(psop->pws),
(LPARAM)WSAMAKESELECTREPLY( WS_FD_WRITE, 0 ) ) )
{
- dprintf_winsock(stddeb, "\t hwnd %04x - %04x, %08x\n",
+ dprintf_info(winsock, "\t hwnd %04x - %04x, %08x\n",
psop->hWnd, psop->uMsg, (unsigned)MAKELONG(WS_FD_WRITE, 0) );
FD_CLR( fd, &event_set[EVENT_IO_WRITE] );
num_posted++;
@@ -2108,7 +2106,7 @@
if( bPost )
{
- dprintf_winsock(stddeb, "\t hwnd %04x - %04x, %08x\n",
+ dprintf_info(winsock, "\t hwnd %04x - %04x, %08x\n",
psop->hWnd, psop->uMsg, (unsigned)dwEvent );
PostMessage32A( psop->hWnd, psop->uMsg,
(WPARAM32)WS_PTR2HANDLE(psop->pws), (LPARAM)dwEvent );
@@ -2119,7 +2117,7 @@
if( num_pending <= 0 ) break;
}
- dprintf_winsock(stddeb, "\tdone, %i posted events\n", num_posted );
+ dprintf_info(winsock, "\tdone, %i posted events\n", num_posted );
return ( num_posted ) ? TRUE : FALSE;
}
@@ -2128,7 +2126,7 @@
ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s);
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_AsyncSelect(%08x): %04x, hWnd %04x, uMsg %08x, event %08x\n",
+ dprintf_info(winsock, "WS_AsyncSelect(%08x): %04x, hWnd %04x, uMsg %08x, event %08x\n",
(unsigned)pwsi, (SOCKET16)s, (HWND16)hWnd, uMsg, (unsigned)lEvent );
if( _check_ws(pwsi, pws) )
{
@@ -2149,7 +2147,7 @@
if( pws->flags & (WS_FD_CONNECT | WS_FD_WRITE) )
EVENT_DeleteIO( pws->fd, EVENT_IO_WRITE );
- dprintf_winsock(stddeb,"\tremoving psop = 0x%08x\n", (unsigned) psop );
+ dprintf_info(winsock,"\tremoving psop = 0x%08x\n", (unsigned) psop );
WS_FREE( pws->psop );
pws->flags &= ~(WS_FD_RAW | WS_FD_ACCEPT | WS_FD_CONNECT |
@@ -2188,7 +2186,7 @@
/* TODO: handle WS_FD_ACCEPT right away if the socket is readable */
- dprintf_winsock(stddeb,"\tcreating psop = 0x%08x\n", (unsigned)psop );
+ dprintf_info(winsock,"\tcreating psop = 0x%08x\n", (unsigned)psop );
return 0; /* success */
}
@@ -2213,7 +2211,7 @@
{
int i = set->fd_count;
- dprintf_winsock(stddeb, "__WSAFDIsSet16(%d,%8lx(%i))\n", s,(unsigned long)set, i);
+ dprintf_info(winsock, "__WSAFDIsSet16(%d,%8lx(%i))\n", s,(unsigned long)set, i);
while (i--)
if (set->fd_array[i] == s) return 1;
@@ -2227,7 +2225,7 @@
{
int i = set->fd_count;
- dprintf_winsock(stddeb, "__WSAFDIsSet32(%d,%8lx(%i))\n", s,(unsigned long)set, i);
+ dprintf_info(winsock, "__WSAFDIsSet32(%d,%8lx(%i))\n", s,(unsigned long)set, i);
while (i--)
if (set->fd_array[i] == s) return 1;
@@ -2247,7 +2245,7 @@
* Note: It is allowed to call this function without prior WSAStartup().
*/
- dprintf_winsock(stddeb, "WS_IsBlocking()\n");
+ dprintf_info(winsock, "WS_IsBlocking()\n");
return FALSE;
}
@@ -2258,7 +2256,7 @@
{
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_CancelBlockingCall(%08x)\n", (unsigned)pwsi);
+ dprintf_info(winsock, "WS_CancelBlockingCall(%08x)\n", (unsigned)pwsi);
if( pwsi ) return 0;
return SOCKET_ERROR;
@@ -2273,7 +2271,7 @@
FARPROC16 prev;
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_SetBlockingHook16(%08x): hook %08x\n",
+ dprintf_info(winsock, "WS_SetBlockingHook16(%08x): hook %08x\n",
(unsigned)pwsi, (unsigned) lpBlockFunc);
if( pwsi )
{
@@ -2294,7 +2292,7 @@
FARPROC32 prev;
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_SetBlockingHook32(%08x): hook %08x\n",
+ dprintf_info(winsock, "WS_SetBlockingHook32(%08x): hook %08x\n",
(unsigned)pwsi, (unsigned) lpBlockFunc);
if( pwsi ) {
prev = (FARPROC32)pwsi->blocking_hook;
@@ -2313,7 +2311,7 @@
{
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_UnhookBlockingHook16(%08x)\n", (unsigned)pwsi);
+ dprintf_info(winsock, "WS_UnhookBlockingHook16(%08x)\n", (unsigned)pwsi);
if( pwsi ) return (INT16)(pwsi->blocking_hook = 0);
return SOCKET_ERROR;
}
@@ -2326,7 +2324,7 @@
{
LPWSINFO pwsi = wsi_find(GetCurrentTask());
- dprintf_winsock(stddeb, "WS_UnhookBlockingHook32(%08x)\n", (unsigned)pwsi);
+ dprintf_info(winsock, "WS_UnhookBlockingHook32(%08x)\n", (unsigned)pwsi);
if( pwsi )
{
pwsi->blocking_hook = 0;
@@ -2573,10 +2571,10 @@
{
int loc_errno = errno;
#if defined(__FreeBSD__)
- dprintf_winsock(stderr, "winsock: errno %d, (%s).\n",
+ dprintf_err(winsock, "winsock: errno %d, (%s).\n",
errno, strerror(errno));
#else
- dprintf_winsock(stderr, "winsock: errno %d\n", errno);
+ dprintf_err(winsock, "winsock: errno %d\n", errno);
#endif
switch(loc_errno)
@@ -2648,13 +2646,10 @@
int loc_errno = h_errno;
#if defined(__FreeBSD__)
- dprintf_winsock(stderr, "winsock: h_errno %d, (%s).\n",
+ dprintf_err(winsock, "winsock: h_errno %d, (%s).\n",
h_errno, strerror(h_errno));
#else
- dprintf_winsock(stderr, "winsock: h_errno %d.\n", h_errno);
-#ifndef sun
- if( debugging_winsock ) herror("wine: winsock: wsaherrno");
-#endif
+ dprintf_err(winsock, "winsock: h_errno %d.\n", h_errno);
#endif
switch(loc_errno)
diff --git a/misc/winsock_dns.c b/misc/winsock_dns.c
index 4150b9c..029d973 100644
--- a/misc/winsock_dns.c
+++ b/misc/winsock_dns.c
@@ -136,7 +136,7 @@
int num = 0;
ws_async_op* p, *next;
- dprintf_winsock(stddeb,"\tcancelling async DNS requests... ");
+ dprintf_info(winsock," cancelling async DNS requests... \n");
SIGNAL_MaskAsyncEvents( TRUE );
next = __async_op_list;
@@ -153,7 +153,7 @@
}
}
SIGNAL_MaskAsyncEvents( FALSE );
- dprintf_winsock(stddeb,"%i total\n", num );
+ dprintf_info(winsock," -> %i total\n", num );
}
void WINSOCK_link_async_op(ws_async_op* p_aop)
@@ -176,7 +176,7 @@
{
ws_async_op* dead = p;
- dprintf_winsock(stddeb,"\treaping dead aop [%08x]\n", (unsigned)p );
+ dprintf_info(winsock,"\treaping dead aop [%08x]\n", (unsigned)p );
p = p->next;
WINSOCK_unlink_async_op( dead );
@@ -343,7 +343,7 @@
async_ctl.ws_aop->pid = fork();
if( async_ctl.ws_aop->pid )
{
- dprintf_winsock(stddeb, "\tasync_op = %04x (child %i)\n",
+ dprintf_info(winsock, "\tasync_op = %04x (child %i)\n",
handle, async_ctl.ws_aop->pid);
close(async_ctl.ws_aop->fd[1]); /* write endpoint */
@@ -452,7 +452,7 @@
: gethostbyaddr(async_ctl.rq.name,
async_ctl.ilength, async_ctl.type);
- dprintf_winsock(stddeb,"DNS: got hostent for [%s]\n", async_ctl.rq.name );
+ dprintf_info(winsock,"DNS: got hostent for [%s]\n", async_ctl.rq.name );
if( p_he ) /* convert to the Winsock format with internal pointers as offsets */
size = WS_dup_he(pwsi, p_he, WS_DUP_OFFSET |
@@ -476,7 +476,7 @@
? getprotobyname(async_ctl.rq.name)
: getprotobynumber(async_ctl.type);
- dprintf_winsock(stddeb,"DNS: got protoent for [%s]\n", async_ctl.rq.name );
+ dprintf_info(winsock,"DNS: got protoent for [%s]\n", async_ctl.rq.name );
if( p_pe ) /* convert to the Winsock format with internal pointers as offsets */
size = WS_dup_pe(pwsi, p_pe, WS_DUP_OFFSET |
diff --git a/misc/wsprintf.c b/misc/wsprintf.c
index 936afd0..043f5e9 100644
--- a/misc/wsprintf.c
+++ b/misc/wsprintf.c
@@ -11,7 +11,7 @@
#include "ldt.h"
#include "stackframe.h"
#include "debug.h"
-#include "stddebug.h"
+
#define WPRINTF_LEFTALIGN 0x0001 /* Align output on the left ('-' prefix) */
#define WPRINTF_PREFIX_HEX 0x0002 /* Prefix hex with 0x ('#' prefix) */
@@ -396,7 +396,7 @@
maxlen -= len;
}
*p = 0;
- dprintf_string(stddeb,"%s\n",buffer);
+ dprintf_info(string,"%s\n",buffer);
return (maxlen > 1) ? (INT32)(p - buffer) : -1;
}
@@ -477,7 +477,7 @@
*/
INT16 WINAPI wvsprintf16( LPSTR buffer, LPCSTR spec, LPCVOID args )
{
- dprintf_string(stddeb,"wvsprintf16 for %p got ",buffer);
+ dprintf_info(string,"wvsprintf16 for %p got:\n",buffer);
return wvsnprintf16( buffer, 0xffff, spec, args );
}
@@ -487,7 +487,7 @@
*/
INT32 WINAPI wvsprintf32A( LPSTR buffer, LPCSTR spec, va_list args )
{
- dprintf_string(stddeb,"wvsprintf32A for %p got ",buffer);
+ dprintf_info(string,"wvsprintf32A for %p got:\n",buffer);
return wvsnprintf32A( buffer, 0xffffffff, spec, args );
}
@@ -497,7 +497,7 @@
*/
INT32 WINAPI wvsprintf32W( LPWSTR buffer, LPCWSTR spec, va_list args )
{
- dprintf_string(stddeb,"wvsprintf32W for %p got ",buffer);
+ dprintf_info(string,"wvsprintf32W for %p got:\n",buffer);
return wvsnprintf32W( buffer, 0xffffffff, spec, args );
}
@@ -511,7 +511,7 @@
va_list valist;
INT16 res;
- dprintf_string(stddeb,"wsprintf16 for %p got ",buffer);
+ dprintf_info(string,"wsprintf16 for %p got:\n",buffer);
va_start( valist, spec );
/* Note: we call the 32-bit version, because the args are 32-bit */
res = (INT16)wvsnprintf32A( buffer, 0xffffffff, spec, valist );
@@ -529,7 +529,7 @@
VA_START16( valist );
buffer = VA_ARG16( valist, SEGPTR );
spec = VA_ARG16( valist, SEGPTR );
- dprintf_string(stddeb,"WIN16_wsprintf16 got ");
+ dprintf_info(string,"WIN16_wsprintf16 got:\n");
res = wvsnprintf16( (LPSTR)PTR_SEG_TO_LIN(buffer), 0xffff,
(LPCSTR)PTR_SEG_TO_LIN(spec), valist );
VA_END16( valist );
@@ -545,7 +545,7 @@
va_list valist;
INT32 res;
- dprintf_string(stddeb,"wsprintf32A for %p got ",buffer);
+ dprintf_info(string,"wsprintf32A for %p got:\n",buffer);
va_start( valist, spec );
res = wvsnprintf32A( buffer, 0xffffffff, spec, valist );
va_end( valist );
@@ -561,7 +561,7 @@
va_list valist;
INT32 res;
- dprintf_string(stddeb,"wsprintf32W for %p\n",buffer);
+ dprintf_info(string,"wsprintf32W for %p\n",buffer);
va_start( valist, spec );
res = wvsnprintf32W( buffer, 0xffffffff, spec, valist );
va_end( valist );