Why I cannot open "Display1"

But I cannot access video0.
Maybe video0 was exclusive occupied by videoport.

You could send IOCTL_VIDEO_MAP_VIDEO_MEMORY to the miniport of the display
driver. That should give you a user-accessable virtual address. Check the
DDK for further details.

Beware however that video memory isn’t necessarily straight-forward
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 legally
privileged. It is intended solely for the addressee. Access to this
message by anyone else is unauthorized. If you are not the intended
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 exclusive 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", DisplayNumber);
> > RtlInitUnicodeString(&DeviceName, DeviceNameBuffer);
> >
> > Status=IoGetDeviceObjectPointer(
> > &DeviceName,
> > FILE_READ_ATTRIBUTES,//FILE_ALL_ACCESS ,
> > &VideoFileObject,
> > & DeviceObject
> > );
> >
> >
> > if (!NT_SUCCESS(Status))
> > {
> > DbgPrint(“Status=0x%x\n”,(ULONG)Status);
> > return(NULL);
> > }
> >
> > return VideoFileObject;
> >}
> >
> >The result is NULL, Status=0xc0000022,it means “STATUS_ACCESS_DENIED”.
> >Why?
> >
> >
> >
> >
> >
> >–http://www.eyou.com
> >–Îȶ¨¿É¿¿µÄµç×ÓÐÅÏä ÓïÒôÓʼþ Òƶ¯ÊéÇ© ÈÕÀú·þÎñ ÍøÂç´æ´¢…ÒÚÓÊδ¾¡
> >
> >–http://vip.eyou.com
> >–¿ì¿ìµÇ¼ÒÚÓÊVIPÐÅÏä ×¢²áÄúÖÐÒâµÄÓû§Ãû
> >
> >
> >
> >—
> >Questions? First check the Kernel Driver FAQ at
> >http://www.osronline.com/article.cfm?id=256
> >
> >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=256
> >
> >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
> --Îȶ¨¿É¿¿µÄµç×ÓÐÅÏä ÓïÒôÓʼþ Òƶ¯ÊéÇ© ÈÕÀú·þÎñ ÍøÂç´æ´¢…ÒÚÓÊδ¾¡
>
> –http://vip.eyou.com
> --¿ì¿ìµÇ¼ÒÚÓÊVIPÐÅÏä ×¢²áÄúÖÐÒâµÄÓû§Ãû
>
> –http://sms.eyou.com
> --ÎÞÓǶþ¶þ×å¡¢×ãÇò´ó¸»ÎÌ…¾¡ÔÚÒÚÓʶÌÐÅ
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.
> osronline.com/article.cfm?id=256
>
> 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=256

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
–Îȶ¨¿É¿¿µÄµç×ÓÐÅÏä ÓïÒôÓʼþ Òƶ¯ÊéÇ© ÈÕÀú·þÎñ ÍøÂç´æ´¢…ÒÚÓÊδ¾¡

http://vip.eyou.com
–¿ì¿ìµÇ¼ÒÚÓÊVIPÐÅÏä ×¢²áÄúÖÐÒâµÄÓû§Ãû

http://sms.eyou.com
–ÎÞÓǶþ¶þ×å¡¢×ãÇò´ó¸»ÎÌ…¾¡ÔÚÒÚÓʶÌÐÅ

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 tryin=
g 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 lot o=
n
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 the
display
>driver. That should give you a user-accessable virtual address. Chec=
k
the
>DDK for further details.
>
>Beware however that video memory isn’t necessarily straight-forward
>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 vid=
eo
>memory to make it recognisable.
>
>–
>Mats
>
>
>-------- Notice --------
>The information in this message is confidential and may be legally
>privileged. It is intended solely for the addressee. Access to thi=
s
>message by anyone else is unauthorized. If you are not the intended=

>recipient, any disclosure, copying or distribution of the message, o=
r
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 con=
tact
>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 exclusive =
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", DisplayNumber)=
;
>> > 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.co=
m
>> 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 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:NT0000803E=

It’s owned by win32k/GDI, not video port itself.

GDI calls IoGetDeviceObjectPointer which resulted in an IRP_MJ_CREATE being
sent to the video device object in early GDI initialization or each time a
video miniport is enabled.

Kernel mode Display Driver, as oppose to miniport, can access video device
by means of sending IOCTLs through GDI exported function, namely,
EngDeviceIoControl. It’s just a simple wrapper of
IoBuildDeviceIoControlRequest/IoCallDriver/KeWaitForSingleObject. The first
parameter of the function is actually the pointer to the video device
object. GDI passes the pointer to the display driver each time a desktop
(PDEV) is enabled.

You can’t directly access video miniport port from user mode by
CreateFile/DeviceIoControl.

As Mats said in the other post, what you want to do just simply won’t work
as you expected even you managed to get access to the miniport.

Calvin Guan Software Engineer
ATI Technologies Inc. www.ati.com

-----Original Message-----
From: f [mailto:xxxxx@eyou.com]
Sent: November 26, 2004 4:40 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Why I cannot open “Display1”

But I cannot access video0.
Maybe video0 was exclusive occupied by videoport.

You could send IOCTL_VIDEO_MAP_VIDEO_MEMORY to the miniport of the display
driver. That should give you a user-accessable virtual address. Check the
DDK for further details.

Beware however that video memory isn’t necessarily straight-forward
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 legally
privileged. It is intended solely for the addressee. Access to this
message by anyone else is unauthorized. If you are not the intended
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 exclusive 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", DisplayNumber);
> > RtlInitUnicodeString(&DeviceName, DeviceNameBuffer);
> >
> > Status=IoGetDeviceObjectPointer(
> > &DeviceName,
> > FILE_READ_ATTRIBUTES,//FILE_ALL_ACCESS ,
> > &VideoFileObject,
> > & DeviceObject
> > );
> >
> >
> > if (!NT_SUCCESS(Status))
> > {
> > DbgPrint(“Status=0x%x\n”,(ULONG)Status);
> > return(NULL);
> > }
> >
> > return VideoFileObject;
> >}
> >
> >The result is NULL, Status=0xc0000022,it means “STATUS_ACCESS_DENIED”.
> >Why?
> >
> >
> >
> >
> >
> >–http://www.eyou.com
> >–Îȶ¨¿É¿¿µÄµç×ÓÐÅÏä ÓïÒôÓʼþ Òƶ¯ÊéÇ© ÈÕÀú·þÎñ ÍøÂç´æ´¢…ÒÚÓÊδ¾¡
> >
> >–http://vip.eyou.com
> >–¿ì¿ìµÇ¼ÒÚÓÊVIPÐÅÏä ×¢²áÄúÖÐÒâµÄÓû§Ãû
> >
> >
> >
> >—
> >Questions? First check the Kernel Driver FAQ at
> >http://www.osronline.com/article.cfm?id=256
> >
> >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=256
> >
> >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
> --Îȶ¨¿É¿¿µÄµç×ÓÐÅÏä ÓïÒôÓʼþ Òƶ¯ÊéÇ© ÈÕÀú·þÎñ ÍøÂç´æ´¢…ÒÚÓÊδ¾¡
>
> –http://vip.eyou.com
> --¿ì¿ìµÇ¼ÒÚÓÊVIPÐÅÏä ×¢²áÄúÖÐÒâµÄÓû§Ãû
>
> –http://sms.eyou.com
> --ÎÞÓǶþ¶þ×å¡¢×ãÇò´ó¸»ÎÌ…¾¡ÔÚÒÚÓʶÌÐÅ
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.
> osronline.com/article.cfm?id=256
>
> 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=256

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
–Îȶ¨¿É¿¿µÄµç×ÓÐÅÏä ÓïÒôÓʼþ Òƶ¯ÊéÇ© ÈÕÀú·þÎñ ÍøÂç´æ´¢…ÒÚÓÊδ¾¡

http://vip.eyou.com
–¿ì¿ìµÇ¼ÒÚÓÊVIPÐÅÏä ×¢²áÄúÖÐÒâµÄÓû§Ãû

http://sms.eyou.com
–ÎÞÓǶþ¶þ×å¡¢×ãÇò´ó¸»ÎÌ…¾¡ÔÚÒÚÓʶÌÐÅ


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

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