PEXT2_FCB Fcb;
ULONG StartIndex = 0;
- DPRINT("Ext2OpenFile(DeviceExt %x, FileObject %x, FileName %w)\n",
+ DPRINT("Ext2OpenFile(DeviceExt %x, FileObject %x, FileName %S)\n",
DeviceExt,FileObject,FileName);
Fcb = ExAllocatePool(NonPagedPool, sizeof(EXT2_FCB));
unsigned int inode;
PCCB Ccb = NULL;
- DPRINT("MinixDirLookup(DeviceExt %x, dir %x, Name %w)\n",DeviceExt,dir,
+ DPRINT("MinixDirLookup(DeviceExt %x, dir %x, Name %S)\n",DeviceExt,dir,
Name);
for (i=0;i<(dir->i_size/MINIX_DIR_ENTRY_SIZE);i++)
DeviceName = FileObject->FileName.Buffer;
- DbgPrint("MinixOpen(DeviceObject %x, DeviceName %w, result %x)\n",
+ DbgPrint("MinixOpen(DeviceObject %x, DeviceName %S, result %x)\n",
DeviceObject,DeviceName,result);
DPRINT("DeviceName %x\n",DeviceName);
{
MinixReadInode(DeviceObject,DeviceExt,current_ino,¤t_dir);
- DPRINT("current %w next %x\n",current,next);
+ DPRINT("current %S next %x\n",current,next);
*next = '\\';
current = next+1;
MINIX_DEVICE_EXTENSION* DeviceExt;
DPRINT("MinixCreate(DeviceObject %x, Irp %x)\n",DeviceObject,Irp);
- DPRINT("Opening file %x %w\n",FileObject->FileName.Buffer,
+ DPRINT("Opening file %x %S\n",FileObject->FileName.Buffer,
FileObject->FileName.Buffer);
DPRINT("FileObject->FileName.Buffer %x\n",
FileObject->FileName.Buffer);
struct minix_inode current_dir;
unsigned int current_ino;
- DbgPrint("MinixOpen(DeviceObject %x, DeviceName %w, result %x)\n",
+ DbgPrint("MinixOpen(DeviceObject %x, DeviceName %S, result %x)\n",
DeviceObject,DeviceName,result);
DPRINT("DeviceName %x\n",DeviceName);
{
MinixReadInode(DeviceObject,DeviceExt,current_ino,¤t_dir);
- DPRINT("current %w next %x\n",current,next);
+ DPRINT("current %S next %x\n",current,next);
*next = '\\';
current = next+1;
MINIX_DEVICE_EXTENSION* DeviceExt;
DPRINT("MinixCreate(DeviceObject %x, Irp %x)\n",DeviceObject,Irp);
- DPRINT("Opening file %x %w\n",FileObject->FileName.Buffer,
+ DPRINT("Opening file %x %S\n",FileObject->FileName.Buffer,
FileObject->FileName.Buffer);
DPRINT("FileObject->FileName.Buffer %x\n",
FileObject->FileName.Buffer);
-/* $Id: create.c,v 1.1 1999/12/11 21:14:48 dwelch Exp $
+/* $Id: create.c,v 1.2 2000/01/12 19:05:32 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
ULONG NextCluster;
WCHAR TempStr[2];
- DPRINT("FindFile(Parent %x, FileToFind '%w')\n",Parent,FileToFind);
+ DPRINT("FindFile(Parent %x, FileToFind '%S')\n",Parent,FileToFind);
if (wcslen(FileToFind)==0)
{
DPRINT("Parent->entry.FirstCluster %d\n",Parent->entry.FirstCluster);
}
- DPRINT("FindFile '%w'\n", FileToFind);
+ DPRINT("FindFile '%S'\n", FileToFind);
if (Parent == NULL||Parent->entry.FirstCluster==1)
{
CHECKPOINT;
}
if (GetEntryName((PVOID)block,&i,name,&j,DeviceExt,&StartingSector))
{
- DPRINT("Comparing '%w' '%w'\n",name,FileToFind);
+ DPRINT("Comparing '%S' '%S'\n",name,FileToFind);
if (wstrcmpjoki(name,FileToFind))
{
/* In the case of a long filename, the firstcluster is stored in
PLIST_ENTRY current_entry;
KIRQL oldIrql;
- DPRINT("FsdOpenFile(%08lx, %08lx, %w)\n",
+ DPRINT("FsdOpenFile(%08lx, %08lx, %S)\n",
DeviceExt,
FileObject,
FileName);
/* FIXME : treat relative name */
if(FileObject->RelatedFileObject)
{
- DbgPrint("try related for %w\n",FileName);
+ DbgPrint("try related for %S\n",FileName);
pRelFileObject=FileObject->RelatedFileObject;
pRelCcb=pRelFileObject->FsContext2;
assert(pRelCcb);
Fcb = CONTAINING_RECORD(current_entry, VFATFCB, FcbListEntry);
DPRINT("Scanning %x\n", Fcb);
- DPRINT("Scanning %w\n", Fcb->PathName);
+ DPRINT("Scanning %S\n", Fcb->PathName);
if (DeviceExt==Fcb->pDevExt
&& wstrcmpi(FileName,Fcb->PathName))
{
*next=0;
}
- DPRINT("current '%w'\n",current);
+ DPRINT("current '%S'\n",current);
Status = FindFile(DeviceExt,Fcb,ParentFcb,current,NULL,NULL);
if (Status != STATUS_SUCCESS)
{
Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress);
else
Buffer = Irp->UserBuffer;
- DPRINT("Buffer=%x tofind=%w\n",Buffer,pSearchPattern->Buffer);
+ DPRINT("Buffer=%x tofind=%S\n",Buffer,pSearchPattern->Buffer);
if (pSearchPattern==NULL)
{
star[0]='*';
OldEntry=pCcb->StartEntry;
if(OldSector)pCcb->StartEntry++;
RC=FindFile(DeviceExt,&tmpFcb,pFcb,pCharPattern,&pCcb->StartSector,&pCcb->StartEntry);
-DPRINT("Found %w,RC=%x, sector %x entry %x\n",tmpFcb.ObjectName,RC
+DPRINT("Found %S,RC=%x, sector %x entry %x\n",tmpFcb.ObjectName,RC
,pCcb->StartSector,pCcb->StartEntry);
if (NT_SUCCESS(RC))
{
if(FileName[0]==0 && DirName[0]==0)
return STATUS_SUCCESS;//root : nothing to do ?
memset(&FileObject,0,sizeof(FILE_OBJECT));
-DPRINT("open directory %w for update of entry %w\n",DirName,FileName);
+DPRINT("open directory %S for update of entry %S\n",DirName,FileName);
status=FsdOpenFile(DeviceExt,&FileObject,DirName);
pDirCcb=(PVFATCCB)FileObject.FsContext2;
assert(pDirCcb);
KIRQL oldIrql;
PathFileName=pFileObject->FileName.Buffer;
- DPRINT("addEntry: Pathname=%w\n",PathFileName);
+ DPRINT("addEntry: Pathname=%S\n",PathFileName);
//find last \ in PathFileName
posCar=-1;
for(i=0;PathFileName[i];i++)
UNICODE_STRING ErrorText;
DbgGetErrorText(ErrorCode, &ErrorText, 0xf);
- DbgPrint("%W\n", &ErrorText);
+ DbgPrint("%wZ\n", &ErrorText);
RtlFreeUnicodeString(&ErrorText);
}
PFILE_OBJECT FileObject = (PFILE_OBJECT)ObjectBody;
NTSTATUS Status;
- DPRINT("IopCreateFile(ObjectBody %x, Parent %x, RemainingPath %w)\n",
+ DPRINT("IopCreateFile(ObjectBody %x, Parent %x, RemainingPath %S)\n",
ObjectBody,Parent,RemainingPath);
if (DeviceObject == NULL)
}
RtlInitUnicodeString(&(FileObject->FileName),wcsdup(RemainingPath));
}
- DPRINT("FileObject->FileName.Buffer %w\n",FileObject->FileName.Buffer);
+ DPRINT("FileObject->FileName.Buffer %S\n",FileObject->FileName.Buffer);
FileObject->DeviceObject = DeviceObject;
DPRINT("FileObject %x DeviceObject %x\n", FileObject, DeviceObject);
FileObject->Vpb = DeviceObject->Vpb;
PIO_STACK_LOCATION StackLoc;
DPRINT("NtCreateFile(FileHandle %x, DesiredAccess %x, "
- "ObjectAttributes %x ObjectAttributes->ObjectName->Buffer %w)\n",
+ "ObjectAttributes %x ObjectAttributes->ObjectName->Buffer %S)\n",
FileHandle,DesiredAccess,ObjectAttributes,
ObjectAttributes->ObjectName->Buffer);
-/* $Id: device.c,v 1.13 1999/11/24 11:51:50 dwelch Exp $
+/* $Id: device.c,v 1.14 2000/01/12 19:02:40 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
POBJECT_ATTRIBUTES ObjectAttributes)
{
- DPRINT("IopCreateDevice(ObjectBody %x, Parent %x, RemainingPath %w)\n",
+ DPRINT("IopCreateDevice(ObjectBody %x, Parent %x, RemainingPath %S)\n",
ObjectBody, Parent, RemainingPath);
if (RemainingPath != NULL && wcschr(RemainingPath+1, '\\') != NULL)
if (DeviceName != NULL)
{
- DPRINT("IoCreateDevice(DriverObject %x, DeviceName %w)\n",DriverObject,
+ DPRINT("IoCreateDevice(DriverObject %x, DeviceName %S)\n",DriverObject,
DeviceName->Buffer);
}
else
-/* $Id: symlink.c,v 1.9 1999/08/29 06:59:08 ea Exp $
+/* $Id: symlink.c,v 1.10 2000/01/12 19:02:40 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
assert_irql(PASSIVE_LEVEL);
DPRINT(
- "IoCreateSymbolicLink(SymbolicLinkName %w, DeviceName %w)\n",
+ "IoCreateSymbolicLink(SymbolicLinkName %S, DeviceName %S)\n",
SymbolicLinkName->Buffer,
DeviceName->Buffer
);
DeviceName
);
- DPRINT("DeviceName %w\n", SymbolicLink->TargetName.Buffer);
+ DPRINT("DeviceName %S\n", SymbolicLink->TargetName.Buffer);
InitializeObjectAttributes(
& (SymbolicLink->Target),
if (address >= current->Base &&
address < (current->Base + current->Length))
{
- DbgPrint("<%w: %x>", current->Name,
+ DbgPrint("<%S: %x>", current->Name,
address - current->Base);
return;
}
NULL
);
DPRINT(
- "Opening image file %w\n",
+ "Opening image file %S\n",
FileObjectAttributes.ObjectName->Buffer
);
Status = ZwOpenFile(
Status = LdrLoadImage(ProcessHandle, &ProcessName);
if (!NT_SUCCESS(Status))
{
- DbgPrint("Failed to load %W\n",&ProcessName);
+ DbgPrint("Failed to load %wZ\n",&ProcessName);
}
return Status;
}
-/* $Id: loader.c,v 1.41 1999/12/22 14:48:24 dwelch Exp $
+/* $Id: loader.c,v 1.42 2000/01/12 19:03:27 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
0,
NULL,
NULL);
- DPRINT("Create dir: %W\n", &ModuleName);
+ DPRINT("Create dir: %wZ\n", &ModuleName);
Status = ZwCreateDirectoryObject(&DirHandle, 0, &ObjectAttributes);
assert(NT_SUCCESS(Status));
wcscat(NameBuffer, L"ntoskrnl.exe");
ModuleName.Length = ModuleName.MaximumLength = wcslen(NameBuffer);
ModuleName.Buffer = NameBuffer;
- DPRINT("Kernel's Module name is: %W\n", &ModuleName);
+ DPRINT("Kernel's Module name is: %wZ\n", &ModuleName);
/* Initialize ObjectAttributes for ModuleObject */
InitializeObjectAttributes(&ObjectAttributes,
NTSTATUS Status;
UNICODE_STRING DriverName;
- DbgPrint("Loading %w\n",RelativeDriverName);
+ DbgPrint("Loading %S\n",RelativeDriverName);
LdrGetSystemDirectory(TmpFileName, (MAX_PATH * sizeof(WCHAR)));
wcscat(TmpFileName, L"\\drivers\\");
PWSTR RemainingPath,
POBJECT_ATTRIBUTES ObjectAttributes)
{
- DPRINT("LdrCreateModule(ObjectBody %x, Parent %x, RemainingPath %w)\n",
+ DPRINT("LdrCreateModule(ObjectBody %x, Parent %x, RemainingPath %S)\n",
ObjectBody,
Parent,
RemainingPath);
return ModuleObject;
}
- DPRINT("Loading Module %W...\n", Filename);
+ DPRINT("Loading Module %wZ...\n", Filename);
/* Open the Module */
InitializeObjectAttributes(&ObjectAttributes,
CHECKPOINT;
if (!NT_SUCCESS(Status))
{
- DbgPrint("Could not open module file: %W\n", Filename);
+ DbgPrint("Could not open module file: %wZ\n", Filename);
return 0;
}
CHECKPOINT;
CHECKPOINT;
if (NT_SUCCESS(Status) && (RemainingPath == NULL || *RemainingPath == 0))
{
- DPRINT("Module %W at %p\n", Filename, ModuleObject);
+ DPRINT("Module %wZ at %p\n", Filename, ModuleObject);
return ModuleObject;
}
NameBuffer[Idx + Idx2] = 0;
ModuleName.Length = ModuleName.MaximumLength = wcslen(NameBuffer);
ModuleName.Buffer = NameBuffer;
- DPRINT("Import module: %W\n", &ModuleName);
+ DPRINT("Import module: %wZ\n", &ModuleName);
LibraryModuleObject = LdrLoadModule(&ModuleName);
if (LibraryModuleObject == 0)
{
- DbgPrint("Unknown import module: %W\n", &ModuleName);
+ DbgPrint("Unknown import module: %wZ\n", &ModuleName);
}
/* Get the import address list */
ImportAddressList = (PVOID *) ((DWORD)DriverBase +
}
ModuleName.Length = ModuleName.MaximumLength = wcslen(NameBuffer);
ModuleName.Buffer = NameBuffer;
- DbgPrint("Module name is: %W\n", &ModuleName);
+ DbgPrint("Module name is: %wZ\n", &ModuleName);
/* Initialize ObjectAttributes for ModuleObject */
InitializeObjectAttributes(&ObjectAttributes,
-/* $Id: section.c,v 1.21 1999/12/30 01:51:39 dwelch Exp $
+/* $Id: section.c,v 1.22 2000/01/12 19:03:42 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
{
NTSTATUS Status;
- DPRINT("MmpCreateDevice(ObjectBody %x, Parent %x, RemainingPath %w)\n",
+ DPRINT("MmpCreateDevice(ObjectBody %x, Parent %x, RemainingPath %S)\n",
ObjectBody, Parent, RemainingPath);
if (RemainingPath == NULL)
POBJECT_ATTRIBUTES ObjectAttributes)
{
- DPRINT("NtpCreateDevice(ObjectBody %x, Parent %x, RemainingPath %w)\n",
+ DPRINT("NtpCreateDevice(ObjectBody %x, Parent %x, RemainingPath %S)\n",
ObjectBody, Parent, RemainingPath);
if (RemainingPath != NULL && wcschr(RemainingPath+1, '\\') != NULL)
POBJECT_ATTRIBUTES ObjectAttributes)
{
- DPRINT("NtpCreateSemaphore(ObjectBody %x, Parent %x, RemainingPath %w)\n",
+ DPRINT("NtpCreateSemaphore(ObjectBody %x, Parent %x, RemainingPath %S)\n",
ObjectBody, Parent, RemainingPath);
if (RemainingPath != NULL && wcschr(RemainingPath+1, '\\') != NULL)
-/* $Id: port.c,v 1.15 1999/12/30 01:51:40 dwelch Exp $
+/* $Id: port.c,v 1.16 2000/01/12 19:04:01 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
KIRQL oldIrql;
DPRINT("PortName %x\n", PortName);
- DPRINT("NtConnectPort(PortName %w)\n", PortName->Buffer);
+ DPRINT("NtConnectPort(PortName %S)\n", PortName->Buffer);
/*
* Copy in user parameters
-; $Id: ntoskrnl.def,v 1.38 2000/01/10 22:46:37 ea Exp $
+; $Id: ntoskrnl.def,v 1.39 2000/01/12 19:01:56 ekohl Exp $
;
; reactos/ntoskrnl/ntoskrnl.def
;
_itoa
;_local_unwind2
;_purecall
-;_snprintf
+_snprintf
;_snwprintf
_stricmp
_strlwr
_strrev
_strset
_strupr
-;_vsnprintf
+_vsnprintf
_wcsicmp
_wcslwr
_wcsnicmp
-; $Id: ntoskrnl.edf,v 1.25 2000/01/10 22:46:37 ea Exp $
+; $Id: ntoskrnl.edf,v 1.26 2000/01/12 19:01:56 ekohl Exp $
;
; reactos/ntoskrnl/ntoskrnl.def
;
_itoa
;_local_unwind2
;_purecall
-;_snprintf
+_snprintf
;_snwprintf
_stricmp
_strlwr
_strrev
_strset
_strupr
-;_vsnprintf
+_vsnprintf
_wcsicmp
_wcslwr
_wcsnicmp
-/* $Id: dirobj.c,v 1.6 1999/11/27 03:31:08 ekohl Exp $
+/* $Id: dirobj.c,v 1.7 2000/01/12 19:04:22 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
Entry
);
DPRINT(
- "Scanning %w\n",
+ "Scanning %S\n",
current->Name.Buffer
);
PLIST_ENTRY current = DirectoryObject->head.Flink;
POBJECT_HEADER current_obj;
- DPRINT("ObDirLookup(dir %x, name %w)\n",DirectoryObject, Name);
+ DPRINT("ObDirLookup(dir %x, name %S)\n",DirectoryObject, Name);
if (Name[0]==0)
{
while (current!=(&(DirectoryObject->head)))
{
current_obj = CONTAINING_RECORD(current,OBJECT_HEADER,Entry);
- DPRINT("Scanning %w %w\n",current_obj->Name.Buffer, Name);
+ DPRINT("Scanning %S %S\n",current_obj->Name.Buffer, Name);
if (Attributes & OBJ_CASE_INSENSITIVE)
{
if (_wcsicmp(current_obj->Name.Buffer, Name)==0)
PWSTR end;
PVOID FoundObject;
- DPRINT("ObpParseDirectory(Object %x, Path %x, *Path %w)\n",
+ DPRINT("ObpParseDirectory(Object %x, Path %x, *Path %S)\n",
Object,Path,*Path);
if ((*Path) == NULL)
{
PDIRECTORY_OBJECT DirectoryObject = (PDIRECTORY_OBJECT)ObjectBody;
- DPRINT("ObpCreateDirectory(ObjectBody %x, Parent %x, RemainingPath %w)\n",
+ DPRINT("ObpCreateDirectory(ObjectBody %x, Parent %x, RemainingPath %S)\n",
ObjectBody, Parent, RemainingPath);
if (RemainingPath != NULL && wcschr(RemainingPath+1, '\\') != NULL)
while (TRUE)
{
- DPRINT("current %w\n",current);
+ DPRINT("current %S\n",current);
CurrentHeader = BODY_TO_HEADER(CurrentObject);
if (CurrentHeader->ObjectType->Parse == NULL)
{
if (ObjectAttributes != NULL &&
ObjectAttributes->ObjectName != NULL)
{
- DPRINT("ObjectAttributes->ObjectName->Buffer %w\n",
+ DPRINT("ObjectAttributes->ObjectName->Buffer %S\n",
ObjectAttributes->ObjectName->Buffer);
}
if (ObjectType != NULL && ObjectHeader->ObjectType != ObjectType)
{
- DPRINT("Failed %x (type was %x %w) should %x\n",
+ DPRINT("Failed %x (type was %x %S) should %x\n",
ObjectHeader,
ObjectHeader->ObjectType,
ObjectHeader->ObjectType->TypeName.Buffer,
* Appropiated for the reactos kernel, March 1998 -- David Welch
*/
+#include <ddk/ntddk.h>
#include <stdarg.h>
-
-#include <internal/debug.h>
#include <string.h>
-#include <internal/string.h>
#include <ctype.h>
-#include <ddk/ntddk.h>
-
-unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base)
-{
- unsigned long result = 0,value;
-
- if (!base) {
- base = 10;
- if (*cp == '0') {
- base = 8;
- cp++;
- if ((*cp == 'x') && isxdigit(cp[1])) {
- cp++;
- base = 16;
- }
- }
- }
- while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp)
- ? toupper(*cp) : *cp)-'A'+10) < base) {
- result = result*base + value;
- cp++;
- }
- if (endp)
- *endp = (char *)cp;
- return result;
-}
+#define NDEBUG
+#include <internal/debug.h>
-/* we use this so that we can do without the ctype library */
-#define is_digit(c) ((c) >= '0' && (c) <= '9')
static int skip_atoi(const char **s)
{
int i=0;
- while (is_digit(**s))
+ while (isdigit(**s))
i = i*10 + *((*s)++) - '0';
return i;
}
n = ((unsigned long) n) / (unsigned) base; \
__res; })
-static char * number(char * str, long num, int base, int size, int precision
- ,int type)
+static char *
+number (char * str, long num, int base, int size, int precision, int type)
{
char c,sign,tmp[66];
const char *digits="0123456789abcdefghijklmnopqrstuvwxyz";
type &= ~ZEROPAD;
if (base < 2 || base > 36)
return 0;
+
c = (type & ZEROPAD) ? '0' : ' ';
sign = 0;
+
if (type & SIGN) {
if (num < 0) {
sign = '-';
size--;
}
}
+
if (type & SPECIAL) {
if (base == 16)
size -= 2;
else if (base == 8)
size--;
}
+
i = 0;
if (num == 0)
tmp[i++]='0';
*str++ = '0';
*str++ = digits[33];
}
- }
+ }
if (!(type & LEFT))
while (size-- > 0)
*str++ = c;
return str;
}
-int vsprintf(char *buf, const char *fmt, va_list args)
+int _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args)
{
int len;
unsigned long num;
int i, base;
char * str;
const char *s;
- const short int *sw;
- PUNICODE_STRING pus;
+ const short int* sw;
int flags; /* flags to number() */
int precision; /* min. # of digits for integers; max
number of chars for from string */
int qualifier; /* 'h', 'l', or 'L' for integer fields */
-
+
for (str=buf ; *fmt ; ++fmt) {
if (*fmt != '%') {
*str++ = *fmt;
continue;
}
-
+
/* process flags */
flags = 0;
repeat:
case ' ': flags |= SPACE; goto repeat;
case '#': flags |= SPECIAL; goto repeat;
case '0': flags |= ZEROPAD; goto repeat;
- }
-
+ }
+
/* get field width */
field_width = -1;
- if (is_digit(*fmt))
+ if (isdigit(*fmt))
field_width = skip_atoi(&fmt);
else if (*fmt == '*') {
++fmt;
/* get the precision */
precision = -1;
if (*fmt == '.') {
- ++fmt;
- if (is_digit(*fmt))
+ ++fmt;
+ if (isdigit(*fmt))
precision = skip_atoi(&fmt);
else if (*fmt == '*') {
++fmt;
/* get the conversion qualifier */
qualifier = -1;
- if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L') {
+ if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || *fmt == 'w' ||
+ (*fmt == 'I' && *(fmt+1) == '6' && *(fmt+2) == '4')) {
qualifier = *fmt;
++fmt;
}
if (!(flags & LEFT))
while (--field_width > 0)
*str++ = ' ';
- *str++ = (unsigned char) va_arg(args, int);
+ if (qualifier == 'l' || qualifier == 'w')
+ *str++ = (unsigned char) va_arg(args, wchar_t);
+ else
+ *str++ = (unsigned char) va_arg(args, int);
+ while (--field_width > 0)
+ *str++ = ' ';
+ continue;
+
+ case 'C':
+ if (!(flags & LEFT))
+ while (--field_width > 0)
+ *str++ = ' ';
+ if (qualifier == 'h')
+ *str++ = (unsigned char) va_arg(args, int);
+ else
+ *str++ = (unsigned char) va_arg(args, wchar_t);
while (--field_width > 0)
*str++ = ' ';
continue;
- case 'w':
- sw = va_arg(args,short int *);
-// DPRINT("L %x\n",sw);
- if (sw==NULL)
- {
-// CHECKPOINT;
- s = "<NULL>";
- while ((*s)!=0)
- {
- *str++ = *s++;
- }
-// CHECKPOINT;
-// DbgPrint("str %x\n",str);
- }
- else
- {
- while ((*sw)!=0)
- {
- *str++ = (char)(*sw++);
- }
- }
-// CHECKPOINT;
- continue;
-
- case 'W':
- pus = va_arg(args, PUNICODE_STRING);
- if (pus == NULL)
- {
- s = "<NULL>";
- while ((*s) != 0)
- {
- *str++ = *s++;
- }
- }
- else
- {
- for (i = 0; pus->Buffer[i] && i < pus->Length; i++)
- {
- *str++ = (char)(pus->Buffer[i]);
- }
- }
- continue;
-
case 's':
s = va_arg(args, char *);
if (!s)
*str++ = ' ';
continue;
+/*
+ case 'w':
+ sw = va_arg(args,short int *);
+// DPRINT("L %x\n",sw);
+ if (sw==NULL) {
+// CHECKPOINT;
+ s = "<NULL>";
+ while ((*s)!=0)
+ *str++ = *s++;
+// CHECKPOINT;
+// DbgPrint("str %x\n",str);
+ } else {
+ while ((*sw)!=0)
+ *str++ = (char)(*sw++);
+ }
+// CHECKPOINT;
+ continue;
+*/
+
+ case 'S':
+ sw = va_arg(args,short int *);
+ if (sw==NULL) {
+ s = "<NULL>";
+ while ((*s)!=0)
+ *str++ = *s++;
+ } else {
+ while ((*sw)!=0)
+ *str++ = (char)(*sw++);
+ }
+ continue;
+
+/*
+ case 'W':
+ pus = va_arg(args, PUNICODE_STRING);
+ if (pus == NULL) {
+ s = "<NULL>";
+ while ((*s) != 0)
+ *str++ = *s++;
+ } else {
+ for (i = 0; pus->Buffer[i] && i < pus->Length; i++)
+ *str++ = (char)(pus->Buffer[i]);
+ }
+ continue;
+*/
+
+ case 'Z':
+ if (qualifier == 'w') {
+ PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING);
+ if (pus == NULL) {
+ s = "<NULL>";
+ while ((*s) != 0)
+ *str++ = *s++;
+ } else {
+ for (i = 0; pus->Buffer[i] && i < pus->Length; i++)
+ *str++ = (char)(pus->Buffer[i]);
+ }
+ } else {
+ PANSI_STRING pus = va_arg(args, PANSI_STRING);
+ if (pus == NULL) {
+ s = "<NULL>";
+ while ((*s) != 0)
+ *str++ = *s++;
+ } else {
+ for (i = 0; pus->Buffer[i] && i < pus->Length; i++)
+ *str++ = pus->Buffer[i];
+ }
+ }
+ continue;
+
case 'p':
if (field_width == -1) {
- field_width = 2*sizeof(void *);
+ field_width = 2 * sizeof(void *);
flags |= ZEROPAD;
}
str = number(str,
field_width, precision, flags);
continue;
-
case 'n':
if (qualifier == 'l') {
long * ip = va_arg(args, long *);
case 'o':
base = 8;
break;
-
- case 'b':
- base = 2;
- break;
-
+
+ case 'b':
+ base = 2;
+ break;
+
case 'X':
flags |= LARGE;
case 'x':
--fmt;
continue;
}
- if (qualifier == 'l') {
+ if (qualifier == 'l')
num = va_arg(args, unsigned long);
- } else if (qualifier == 'h') {
- if (flags & SIGN) {
+ else if (qualifier == 'h')
+ if (flags & SIGN)
num = va_arg(args, short);
- } else {
+ else
num = va_arg(args, unsigned short);
- }
- } else if (flags & SIGN) {
+ else if (flags & SIGN)
num = va_arg(args, int);
- } else {
+ else
num = va_arg(args, unsigned int);
- }
str = number(str, num, base, field_width, precision, flags);
}
*str = '\0';
int i;
va_start(args, fmt);
- i=vsprintf(buf,fmt,args);
+ i=_vsnprintf(buf,INT_MAX,fmt,args);
+ va_end(args);
+ return i;
+}
+
+int _snprintf(char * buf, size_t cnt, const char *fmt, ...)
+{
+ va_list args;
+ int i;
+
+ va_start(args, fmt);
+ i=_vsnprintf(buf,cnt,fmt,args);
va_end(args);
return i;
}
+int vsprintf(char *buf, const char *fmt, va_list args)
+{
+ return _vsnprintf(buf,INT_MAX,fmt,args);
+}
+
+/* EOF */
wchar_t* wcscpy(wchar_t* str1, const wchar_t* str2)
{
wchar_t* s = str1;
- DPRINT("wcscpy(str1 %w, str2 %w)\n",str1,str2);
+ DPRINT("wcscpy(str1 %S, str2 %S)\n",str1,str2);
while ((*str2)!=0)
{
*s = *str2;