mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Corrected a number of bugs, including the keyboard one
svn path=/trunk/; revision=115
This commit is contained in:
parent
8587170853
commit
4bc75819a3
9 changed files with 40 additions and 32 deletions
|
@ -11,7 +11,7 @@ void debug_printf(char* fmt, ...)
|
|||
|
||||
va_start(args,fmt);
|
||||
vsprintf(buffer,fmt,args);
|
||||
OutputDebugString(buffer);
|
||||
OutputDebugStringA(buffer);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
|
@ -36,18 +36,18 @@ void main()
|
|||
0,
|
||||
NULL);
|
||||
|
||||
NtDisplayString("#1\n");
|
||||
|
||||
debug_printf("C:\\");
|
||||
NtDisplayString("#2\n");
|
||||
for(;;)
|
||||
{
|
||||
ReadFile(FileHandle,
|
||||
&KeyEvent,
|
||||
sizeof(KeyEvent),
|
||||
sizeof(KEY_EVENT_RECORD),
|
||||
&Result,
|
||||
NULL);
|
||||
NtDisplayString("#3\n");
|
||||
if (KeyEvent[0].bKeyDown)
|
||||
{
|
||||
debug_printf("%c",KeyEvent[0].AsciiChar);
|
||||
NtDisplayString("#4\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -226,4 +226,3 @@ wcsspn Rtlwcsspn 8
|
|||
wcsstr Rtlwcsstr 8
|
||||
wcstok Rtlwcstok 8
|
||||
wstrlen Rtlwstrlen 4
|
||||
|
||||
|
|
|
@ -71,6 +71,8 @@ HANDLE STDCALL CreateFileA(LPCSTR lpFileName,
|
|||
WCHAR FileNameW[MAX_PATH];
|
||||
ULONG i = 0;
|
||||
|
||||
OutputDebugStringA("CreateFileA\n");
|
||||
|
||||
while ((*lpFileName)!=0 && i < MAX_PATH)
|
||||
{
|
||||
FileNameW[i] = *lpFileName;
|
||||
|
@ -103,12 +105,14 @@ HANDLE STDCALL CreateFileW(LPCWSTR lpFileName,
|
|||
WCHAR *FilePart;
|
||||
UINT Len = 0;
|
||||
|
||||
OutputDebugStringA("CreateFileW\n");
|
||||
|
||||
if (!(dwFlagsAndAttributes & FILE_FLAG_OVERLAPPED))
|
||||
{
|
||||
Flags |= FILE_SYNCHRONOUS_IO_ALERT;
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
|
||||
if ( ( ( dwCreationDisposition & OPEN_EXISTING ) == OPEN_EXISTING ) ||
|
||||
( ( dwCreationDisposition & TRUNCATE_EXISTING ) == TRUNCATE_EXISTING ) )
|
||||
|
@ -135,6 +139,11 @@ HANDLE STDCALL CreateFileW(LPCWSTR lpFileName,
|
|||
|
||||
FileNameString.Buffer = (WCHAR *)PathNameW;
|
||||
FileNameString.MaximumLength = FileNameString.Length;
|
||||
#endif
|
||||
|
||||
FileNameString.Buffer = lpFileName;
|
||||
FileNameString.Length =
|
||||
FileNameString.MaximumLength = lstrlenW(lpFileName) * sizeof(WCHAR);
|
||||
|
||||
ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES);
|
||||
ObjectAttributes.RootDirectory = NULL;
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
VOID STDCALL OutputDebugStringA(LPCSTR lpOutputString)
|
||||
{
|
||||
NtDisplayString(lpOutputString);
|
||||
#if 0
|
||||
WCHAR DebugStringW[161];
|
||||
int i,j;
|
||||
i = 0;
|
||||
|
@ -22,6 +24,7 @@ VOID STDCALL OutputDebugStringA(LPCSTR lpOutputString)
|
|||
}
|
||||
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
VOID
|
||||
|
|
|
@ -138,6 +138,7 @@ NTSTATUS STDCALL NtDisplayString(IN PUNICODE_STRING DisplayString)
|
|||
{
|
||||
// DbgPrint("DisplayString %x\n",DisplayString);
|
||||
DbgPrint("%s",DisplayString);
|
||||
// DbgPrint("Returning from NtDisplayString()\n");
|
||||
return(STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
|
|
|
@ -13,10 +13,14 @@ _interrupt_handler2e:
|
|||
push es
|
||||
push esi
|
||||
push edi
|
||||
push ebp
|
||||
push ebx
|
||||
|
||||
mov bx,KERNEL_DS
|
||||
mov es,bx
|
||||
|
||||
mov ebp,esp
|
||||
|
||||
mov esi,edx
|
||||
mov ecx,[es:__SystemServiceTable+eax*8]
|
||||
sub esp,ecx
|
||||
|
@ -28,6 +32,10 @@ _interrupt_handler2e:
|
|||
mov eax,[__SystemServiceTable+4+eax*8]
|
||||
call eax
|
||||
|
||||
mov esp,ebp
|
||||
|
||||
pop ebx
|
||||
pop ebp
|
||||
pop edi
|
||||
pop esi
|
||||
pop es
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include <internal/string.h>
|
||||
#include <wstring.h>
|
||||
|
||||
#define NDEBUG
|
||||
//#define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
|
||||
/* FUNCTIONS *************************************************************/
|
||||
|
|
|
@ -115,23 +115,8 @@ NTSTATUS ZwReadFile(HANDLE FileHandle,
|
|||
if (Status == STATUS_PENDING && (FileObject->Flags & FO_SYNCHRONOUS_IO))
|
||||
{
|
||||
KeWaitForSingleObject(&Event,Executive,KernelMode,FALSE,NULL);
|
||||
Status = Irp->IoStatus.Status;
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
if (FileObject->DeviceObject->Flags&DO_BUFFERED_IO)
|
||||
{
|
||||
memcpy(Buffer,Irp->AssociatedIrp.SystemBuffer,Length);
|
||||
return(IoStatusBlock->Status);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (NT_SUCCESS(Status))
|
||||
{
|
||||
if (FileObject->DeviceObject->Flags&DO_BUFFERED_IO)
|
||||
{
|
||||
memcpy(Buffer,Irp->AssociatedIrp.SystemBuffer,Length);
|
||||
}
|
||||
}
|
||||
|
||||
return(Status);
|
||||
}
|
||||
|
||||
|
|
|
@ -52,10 +52,12 @@ void KeDrainDpcQueue(void)
|
|||
{
|
||||
PLIST_ENTRY current_entry;
|
||||
PKDPC current;
|
||||
|
||||
KIRQL oldlvl;
|
||||
|
||||
KeAcquireSpinLockAtDpcLevel(&DpcQueueLock);
|
||||
KeRaiseIrql(HIGH_LEVEL,&oldlvl);
|
||||
current_entry = RemoveHeadList(&DpcQueueHead);
|
||||
KeLowerIrql(oldlvl);
|
||||
current = CONTAINING_RECORD(current_entry,KDPC,DpcListEntry);
|
||||
while (current_entry!=(&DpcQueueHead))
|
||||
{
|
||||
|
@ -64,11 +66,12 @@ void KeDrainDpcQueue(void)
|
|||
current->SystemArgument1,
|
||||
current->SystemArgument2);
|
||||
current->Lock=FALSE;
|
||||
KeRaiseIrql(HIGH_LEVEL,&oldlvl);
|
||||
current_entry = RemoveHeadList(&DpcQueueHead);
|
||||
KeLowerIrql(oldlvl);
|
||||
current = CONTAINING_RECORD(¤t_entry,KDPC,DpcListEntry);
|
||||
}
|
||||
KeReleaseSpinLockFromDpcLevel(&DpcQueueLock);
|
||||
// DPRINT("Finished KeDrainDpcQueue()\n",0);
|
||||
}
|
||||
|
||||
BOOLEAN KeRemoveQueueDpc(PKDPC Dpc)
|
||||
|
|
Loading…
Reference in a new issue