Re: [ntdev] Why I cannot open "Display1"

Simply put, NO.

Consider that there are at least 5 different manufacturers of graphics
processors, and each have several different models chips that are diffe=
rent
internally. For example, we have three different formats for how the me=
mory
is laid out internally in the video memory, which are all chosen
individually per operation (of course, if you store a bitmap in format =
1,
then you’d better use format 1 when you manipulate it next time).

Yes, it’s possible to write to the video memory, but HOW do you know wh=
ere
in the video memory the actual image is displayed from? I can for certa=
in
say that the first thing in memory on my board that I’m using at the mo=
ment
isn’t the display… It can really be ANYWHERE in the 32-128MB that mos=
t
graphics cards have these days.

There’s only one case that I can think of immediately where this would
work, and that is when the graphics card is in VGA compatibility mode.
Because in VGA mode, there’s a defined way that the memory is organized=
for
each mode that is defined by the VESA standard.

But of course, no-one with their head screwed on properly will use VGA =
mode
on a modern graphics card, because it’s both slow and removes many of t=
he
fancy features that the modern graphics cards will support.

Forget that idea. It just won’t work reliably.


Mats

xxxxx@lists.osr.com wrote on 11/26/2004 10:49:19 AM:

I want to read read/write video memory in kernel mode – to display s=
ome
text
and graphics.
Can I do it without the user mode program’s assistantence?

>
>
>
>Yes, that’s what Calvin stated, and I think he’s right.
>
>So, can you describe a little bit further of what you’re actually tr=
ying
to
>achieve… For what purpose do you want to read video memory? There =
are
>several ways you can get access to video memory, but it depends a lo=
t on
>what you’re trying to achieve, which method would be best for you.
>
>–
>Mats
>
>> But I cannot access video0.
>> Maybe video0 was exclusive occupied by videoport.
>>
>> >
>> >
>> >
>> >
>> >
>> >You could send IOCTL_VIDEO_MAP_VIDEO_MEMORY to the miniport of th=
e
>display
>> >driver. That should give you a user-accessable virtual address. C=
heck
>the
>> >DDK for further details.
>> >
>> >Beware however that video memory isn’t necessarily straight-forwa=
rd
>> >accessible (as in, the data isn’t necessarily ordered in the way =
you
see
>> >them on the screen), so you may have to mangle the data from the
video
>> >memory to make it recognisable.
>> >
>> >–
>> >Mats
>> >
>> >
>> >-------- Notice --------
>> >The information in this message is confidential and may be legall=
y
>> >privileged. It is intended solely for the addressee. Access to =
this
>> >message by anyone else is unauthorized. If you are not the inten=
ded
>> >recipient, any disclosure, copying or distribution of the message=
, or
>any
>> >action taken by you in reliance on it, is prohibited and may be
>unlawful.
>> >If you have received this message in error, please delete it and
contact
>> >the sender immediately. Thank you.
>> >
>> >
>> >xxxxx@lists.osr.com wrote on 11/26/2004 03:47:54 AM=
:
>> >
>> >> Thank you for your response!
>> >> I want to access video memory througth video0.
>> >> >Because video port driver creates \devcice\videoN with exclusi=
ve
flag
>> >set.
>> >> >
>> >> >What do you want to accomplish by access video DO?
>> >> >
>> >> >-
>> >> >Calvin Guan Software Engineer
>> >> >ATI Technologies Inc. www.ati.com
>> >> >
>> >> >-----Original Message-----
>> >> >From: f [mailto:xxxxx@eyou.com]
>> >> >Sent: November 24, 2004 8:36 PM
>> >> >To: Windows System Software Devs Interest List
>> >> >Subject: [ntdev] Why I cannot open “Display1” ?
>> >> >
>> >> >Hi ,Everyone.
>> >> >I just take a test to open the video device “Display1” and to =
get
a
>> >> >File_Object for accessing the video buffer . Code I used :
>> >> >
>> >> >PFILE_OBJECT VideoTest_OpenDisplayDevice(ULONG DisplayNumber)
>> >> >{
>> >> > WCHAR DeviceNameBuffer[40];
>> >> > UNICODE_STRING DeviceName;
>> >> > NTSTATUS Status;
>> >> > PFILE_OBJECT VideoFileObject;
>> >> > PDEVICE_OBJECT DeviceObject;
>> >> >
>> >> > swprintf(DeviceNameBuffer, L"\Device\Video%d", DisplayNumb=
er);
>> >> > RtlInitUnicodeString(&DeviceName, DeviceNameBuffer);
>> >> >
>> >> > Status=3DIoGetDeviceObjectPointer(
>> >> > &DeviceName,
>> >> > FILE_READ_ATTRIBUTES,//FILE_ALL_ACCESS ,
>> >> > &VideoFileObject,
>> >> > & DeviceObject
>> >> > );
>> >> >
>> >> >
>> >> > if (!NT_SUCCESS(Status))
>> >> > {
>> >> > DbgPrint(“Status=3D0x%x\n”,(ULONG)Status);
>> >> > return(NULL);
>> >> > }
>> >> >
>> >> > return VideoFileObject;
>> >> >}
>> >> >
>> >> >The result is NULL, Status=3D0xc0000022,it means
>“STATUS_ACCESS_DENIED”.
>> >> >Why?
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >–http://www.eyou.com
>> >> >–=CE=C8=B6=A8=BF=C9=BF=BF=B5=C4=B5=E7=D7=D3=D0=C5=CF=E4 =D3=EF=
=D2=F4=D3=CA=BC=FE =D2=C6=B6=AF=CA=E9=C7=A9 =C8=D5=C0=FA=B7=FE=CE=F1
>=CD=F8=C2=E7=B4=E6=B4=A2…=D2=DA=D3=CA=CE=B4=BE=A1
>> >> >
>> >> >–http://vip.eyou.com
>> >> >–=BF=EC=BF=EC=B5=C7=C2=BC=D2=DA=D3=CAVIP=D0=C5=CF=E4 =D7=A2=B2=
=E1=C4=FA=D6=D0=D2=E2=B5=C4=D3=C3=BB=A7=C3=FB
>> >> >
>> >> >
>> >> >
>> >> >—
>> >> >Questions? First check the Kernel Driver FAQ at
>> >> >http://www.osronline.com/article.cfm?id=3D256
>> >> >
>> >> >You are currently subscribed to ntdev as: xxxxx@ati.com
>> >> >To unsubscribe send a blank email to
xxxxx@lists.osr.com
>> >> >
>> >> >—
>> >> >Questions? First check the Kernel Driver FAQ at
>> >> http://www.osronline.com/article.cfm?id=3D256
>> >> >
>> >> >You are currently subscribed to ntdev as: unknown lmsubst tag
>argument:
>> >‘’
>> >> >To unsubscribe send a blank email to
xxxxx@lists.osr.com
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> –http://www.eyou.com
>> >> --=CE=C8=B6=A8=BF=C9=BF=BF=B5=C4=B5=E7=D7=D3=D0=C5=CF=E4 =D3=EF=
=D2=F4=D3=CA=BC=FE =D2=C6=B6=AF=CA=E9=C7=A9 =C8=D5=C0=FA=B7=FE=CE=F1
>=CD=F8=C2=E7=B4=E6=B4=A2…=D2=DA=D3=CA=CE=B4=BE=A1
>> >>
>> >> –http://vip.eyou.com
>> >> --=BF=EC=BF=EC=B5=C7=C2=BC=D2=DA=D3=CAVIP=D0=C5=CF=E4 =D7=A2=B2=
=E1=C4=FA=D6=D0=D2=E2=B5=C4=D3=C3=BB=A7=C3=FB
>> >>
>> >> –http://sms.eyou.com
>> >> --=CE=DE=D3=C7=B6=FE=B6=FE=D7=E5=A1=A2=D7=E3=C7=F2=B4=F3=B8=BB=CE=
=CC…
>.=BE=A1=D4=DA=D2=DA=D3=CA=B6=CC=D0=C5
>> >>
>> >> —
>> >> Questions? First check the Kernel Driver FAQ at http://www.
>> >> osronline.com/article.cfm?id=3D256
>> >>
>> >> You are currently subscribed to ntdev as: xxxxx@3dlabs=
.com
>> >> To unsubscribe send a blank email to
xxxxx@lists.osr.com
>> >
>> >> ForwardSourceID:NT00008016
>> >
>> >
>> >—
>> >Questions? First check the Kernel Driver FAQ at
>> http://www.osronline.com/article.cfm?id=3D256
>> >
>> >You are currently subscribed to ntdev as: unknown lmsubst tag
argument:
>‘’
>> >To unsubscribe send a blank email to xxxxx@lists.osr=
.com
>> >
>>
>>
>>
>>
>>
>> –http://www.eyou.com
>> --=CE=C8=B6=A8=BF=C9=BF=BF=B5=C4=B5=E7=D7=D3=D0=C5=CF=E4 =D3=EF=D2=
=F4=D3=CA=BC=FE =D2=C6=B6=AF=CA=E9=C7=A9 =C8=D5=C0=FA=B7=FE=CE=F1
=CD=F8=C2=E7=B4=E6=B4=A2…=D2=DA=D3=CA=CE=B4=BE=A1
>>
>> –http://vip.eyou.com
>> --=BF=EC=BF=EC=B5=C7=C2=BC=D2=DA=D3=CAVIP=D0=C5=CF=E4 =D7=A2=B2=E1=
=C4=FA=D6=D0=D2=E2=B5=C4=D3=C3=BB=A7=C3=FB
>>
>> –http://sms.eyou.com
>> --=CE=DE=D3=C7=B6=FE=B6=FE=D7=E5=A1=A2=D7=E3=C7=F2=B4=F3=B8=BB=CE=CC=
…=BE=A1=D4=DA=D2=DA=D3=CA=B6=CC=D0=C5
>>
>> —
>> Questions? First check the Kernel Driver FAQ at http://www.
>> osronline.com/article.cfm?id=3D256
>>
>> You are currently subscribed to ntdev as: xxxxx@3dlabs.co=
m
>> To unsubscribe send a blank email to xxxxx@lists.osr.=
com
>
>> ForwardSourceID:NT0000803E
>
>
>—
>Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=3D256
>
>You are currently subscribed to ntdev as: unknown lmsubst tag argume=
nt:
‘’
>To unsubscribe send a blank email to xxxxx@lists.osr.co=
m
>

http://www.eyou.com
–=CE=C8=B6=A8=BF=C9=BF=BF=B5=C4=B5=E7=D7=D3=D0=C5=CF=E4 =D3=EF=D2=F4=
=D3=CA=BC=FE =D2=C6=B6=AF=CA=E9=C7=A9 =C8=D5=C0=FA=B7=FE=CE=F1 =CD=F8=
=C2=E7=B4=E6=B4=A2…=D2=DA=D3=CA=CE=B4=BE=A1

http://vip.eyou.com
–=BF=EC=BF=EC=B5=C7=C2=BC=D2=DA=D3=CAVIP=D0=C5=CF=E4 =D7=A2=B2=E1=C4=
=FA=D6=D0=D2=E2=B5=C4=D3=C3=BB=A7=C3=FB

http://sms.eyou.com
–=CE=DE=D3=C7=B6=FE=B6=FE=D7=E5=A1=A2=D7=E3=C7=F2=B4=F3=B8=BB=CE=CC.=
…=BE=A1=D4=DA=D2=DA=D3=CA=B6=CC=D0=C5


Questions? First check the Kernel Driver FAQ at http://www.
osronline.com/article.cfm?id=3D256

You are currently subscribed to ntdev as: xxxxx@3dlabs.com
To unsubscribe send a blank email to xxxxx@lists.osr.com=

ForwardSourceID:NT0000806A=