HalDisplayString on Windows 2000

Hi all,

Somebody know how can I display strings on initialize screen of the windows 2000 ?

Thanks in advance,

Heldai


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hello,Heldai!

Just as your title,please dump hal.dll for the details of HalDisplayString

You write this message at 2001-6-29 9:20:00:

Hi all,

Somebody know how can I display strings on initialize screen of the windows 2000 ?

Thanks in advance,

Heldai


You are currently subscribed to ntdev as: xxxxx@sina.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Best regards.
Star
xxxxx@sina.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Thanks Star,

I have used HalDisplayString on NT but in Windows 2000 my messages don’t
appear on screen.

Heldai

----- Original Message -----
From: “Star”
To: “NT Developers Interest List”
Sent: Friday, June 29, 2001 12:00 AM
Subject: [ntdev] Re: HalDisplayString on Windows 2000

> Hello,Heldai!
>
> Just as your title,please dump hal.dll for the details of HalDisplayString
>
>
> You write this message at 2001-6-29 9:20:00:
> >Hi all,
> >
> >Somebody know how can I display strings on initialize screen of the
windows 2000 ?
> >
> >Thanks in advance,
> >
> >Heldai
> >
> >
> >—
> >You are currently subscribed to ntdev as: xxxxx@sina.com
> >To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> Best regards.
> Star
> xxxxx@sina.com
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@scuasecurity.com.br
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You would use NtDisplayString() to write strings to the console:

void OutputString(PWCHAR pwszText)
{
UNICODE_STRING usText;

usText.Buffer = pwszText;
usText.Length = wcslen(pwszText) * sizeof(WCHAR);
usText.MaximumLength = usText.Length + sizeof(WCHAR);
NtDisplayString(&usText);
}

To receive keyboard input you must open and read the keyboard device
directly:

HANDLE g_hKeyboardAsync = NULL;

NTSTATUS CreateKeyboard()
{
UNICODE_STRING ustrFileName;
HANDLE hKeyboard = NULL;
OBJECT_ATTRIBUTES oa;
IO_STATUS_BLOCK iosb;
NTSTATUS status;
PWCHAR pszFileName = L"\Device\KeyboardClass0";

RtlInitUnicodeString( &ustrFileName, pszFileName );

InitializeObjectAttributes (
&oa,
&ustrFileName,
OBJ_CASE_INSENSITIVE,
NULL,
NULL
);

memset( &iosb, 0, sizeof( iosb ) );
status = ZwCreateFile(
&g_hKeyboardAsync,
GENERIC_READ | SYNCHRONIZE | FILE_READ_ATTRIBUTES,
&oa,
&iosb,
0,
FILE_ATTRIBUTE_NORMAL,
0,
FILE_OPEN,
FILE_DIRECTORY_FILE,
NULL,
0
);

return status;
}

Once you have a handle to the keyboard device, NtWaitForSingleObject() on
it and if it returns STATUS_SUCCESS (as opposed to STATUS_PENDING) then
ZwReadFile() the handle to retrieve the make/break code and the scan code
value. You must translate the scan codes to ASCII codes yourself.

For the read, declare an array of type:

CHAR g_KeyBuf[0xf0];

The make/break code will be at g_KeyBuf[4], and the scan code will be at
g_KeyBuf[2]:

PWORD pwScanCode;
PWORD pwMakeBreak;

pwMakeBreak = ( PWORD ) &g_KeyBuf[4];
pwScanCode = ( PWORD ) &g_KeyBuf[2];

Hope this helps.

Rick Howard
Principal Engineer
Ontrack Data International, Inc.
Boulder,CO


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hello,heldai!

It’s OK here.
HalDisplayString(PCHAR) is just a simple wrapper to NTOSKRNL.InbvDisplayString(PCHAR), try the latter again, but I don’t think it would change the result.

You write this message at 2001-6-29 16:31:00:

Thanks Star,

I have used HalDisplayString on NT but in Windows 2000 my messages don’t
appear on screen.

Heldai

----- Original Message -----
From: “Star”
>To: “NT Developers Interest List”
>Sent: Friday, June 29, 2001 12:00 AM
>Subject: [ntdev] Re: HalDisplayString on Windows 2000
>
>
>> Hello,Heldai!
>>
>> Just as your title,please dump hal.dll for the details of HalDisplayString
>>
>>
>> You write this message at 2001-6-29 9:20:00:
>> >Hi all,
>> >
>> >Somebody know how can I display strings on initialize screen of the
>windows 2000 ?
>> >
>> >Thanks in advance,
>> >
>> >Heldai
>> >
>> >
>> >—
>> >You are currently subscribed to ntdev as: xxxxx@sina.com
>> >To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>>
>> Best regards.
>> Star
>> xxxxx@sina.com
>>
>>
>>
>> —
>> You are currently subscribed to ntdev as: xxxxx@scuasecurity.com.br
>> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>>
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@sina.com
>To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Best regards.
Star
xxxxx@sina.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hello,

VOID HalDisplayString(PSZ Buffer)

sprintf(drvMsg,“msg …”);
HalDisplayString(drvMsg);

…works in W2K fine

Michael
You write this message at 2001-6-29 16:31:00:

Thanks Star,

I have used HalDisplayString on NT but in Windows 2000 my messages don’t
appear on screen.

Heldai

----- Original Message -----
From: “Star”
>To: “NT Developers Interest List”
>Sent: Friday, June 29, 2001 12:00 AM
>Subject: [ntdev] Re: HalDisplayString on Windows 2000
>
>
>> Hello,Heldai!
>>
>> Just as your title,please dump hal.dll for the details of
HalDisplayString
>>
>>
>> You write this message at 2001-6-29 9:20:00:
>> >Hi all,
>> >
>> >Somebody know how can I display strings on initialize screen of the
>windows 2000 ?
>> >
>> >Thanks in advance,
>> >
>> >Heldai
>> >
>> >
>> >—
>> >You are currently subscribed to ntdev as: xxxxx@sina.com
>> >To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>>
>> Best regards.
>> Star
>> xxxxx@sina.com
>>
>>
>>
>> —
>> You are currently subscribed to ntdev as: xxxxx@scuasecurity.com.br
>> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>>
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@sina.com
>To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Best regards.
Star
xxxxx@sina.com


You are currently subscribed to ntdev as: xxxxx@t-online.de
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com