Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTFSD
Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


InbvDisplayString does not work properly.

elDimaselDimas Member Posts: 16

I try to print text on the screen after Windows starts, but an error always occurs.

Some features always disappear, I don't know why, could someone help me?

Google translator

Comments

  • Peter_Viscarola_(OSR)Peter_Viscarola_(OSR) Administrator Posts: 8,317

    I was under the impression that InbvDisplayString stopped working as of Windows 8.

    Peter

    Peter Viscarola
    OSR
    @OSRDrivers

  • elDimaselDimas Member Posts: 16

    @Peter_Viscarola_(OSR) said:
    I was under the impression that InbvDisplayString stopped working as of Windows 8.

    Peter

    So, it doesn't work on the latest versions of Windows? if not, could you recommend something to me to write texts on the screen?

  • Peter_Viscarola_(OSR)Peter_Viscarola_(OSR) Administrator Posts: 8,317

    What are you trying to accomplish?

    Did you see this thread: https://community.osr.com/discussion/292629/execute-native-application-in-windows-10-and-8-1#latest

    Peter

    Peter Viscarola
    OSR
    @OSRDrivers

  • elDimaselDimas Member Posts: 16

    What I'm trying to do and show a message on the screen while loading Windows using the InbvDisplayString function, this function works, but my real problem is that some characters disappear, but I don't know why, for example:

    If I call the function InbvDisplayString ("[email protected]");, it will return me [email protected], what I wanted to know and why some characters disappear and how to solve.

    I looked at the topic you sent me, but unfortunately it didn't solve my problem.

  • elDimaselDimas Member Posts: 16
    edited January 31

    Hello, I just came to leave a clear answer, for those who also have the same question, because I already managed to solve this.

    Instead of using the InbvDisplayString function, you can use ZwDisplayString, it works perfectly well, I'll leave an example below for those who want to test it, REMEMBERING that the driver must be started in SYSTEM_START or BOOT_START:

    UNICODE_STRING us;
        RtlInitUnicodeString(&us, L"Exemple\n");
        ZwDisplayString(&us);
    
  • Peter_Viscarola_(OSR)Peter_Viscarola_(OSR) Administrator Posts: 8,317

    I guess you finally read that thread I pointed you to above, huh? Where he uses NtDisplayString? Where you said it didn’t solve your problem?

    Peter

    Peter Viscarola
    OSR
    @OSRDrivers

  • elDimaselDimas Member Posts: 16

    @Peter_Viscarola_(OSR) said:
    I guess you finally read that thread I pointed you to above, huh? Where he uses NtDisplayString? Where you said it didn’t solve your problem?

    Peter

    No, this link you sent me unfortunately did not solve my problem, NtDisplayString did not work for me.

    ZwDisplayString yes.

  • Peter_Viscarola_(OSR)Peter_Viscarola_(OSR) Administrator Posts: 8,317

    NtDisplayString did not work for me; ZwDisplayString yes.

    Hmmmm... You do understand that they're the same system service, right?

    They only difference between them is one (ZwXXX) explicitly sets previous mode to Kernel Mode, and the other (NtXxxx) leaves the previous mode as is.

    When writing drivers, you're not meant to copy/paste. You're meant to read, consider, understand and use the feature you need. In terms of NtXxxx calls, you need to consciously decide which variant you want to use, based on how you code is invoked.

    Peter

    Peter Viscarola
    OSR
    @OSRDrivers

  • elDimaselDimas Member Posts: 16
    edited February 1

    @Peter_Viscarola_(OSR) said:

    NtDisplayString did not work for me; ZwDisplayString yes.

    Hmmmm... You do understand that they're the same system service, right?

    They only difference between them is one (ZwXXX) explicitly sets previous mode to Kernel Mode, and the other (NtXxxx) leaves the previous mode as is.

    When writing drivers, you're not meant to copy/paste. You're meant to read, consider, understand and use the feature you need. In terms of NtXxxx calls, you need to consciously decide which variant you want to use, based on how you code is invoked.

    Peter

    Thanks for the answer, and I'm sorry for anything..

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Writing WDF Drivers 7 Dec 2020 LIVE ONLINE
Internals & Software Drivers 25 Jan 2021 LIVE ONLINE
Developing Minifilters 8 March 2021 LIVE ONLINE