Boris,
I'd like to know how did you install your mirror driver to test it.
I developed one, very simple. I'd like to test the load/unload and to
see if the OS recognize it as a mirror driver.
I am asking it because I try to follow the DDK documantation, and the
sample that came with it and the sample didn't work.
So, I am looking for a way to install the driver, like RDPDD, What are
the steps that I must know to install it correct and to the system see
the driver and can be enumarated in EnumDisplayDevices, etc etc..
Any help would be great.
About your problem, I had to implement some time ago a DirectShow
application that uses the Screen Capture filter. In my tests I could
capture DirectX Surfaces, It was not fast updated, but Its worked.
Maybe you can found some information in MSDN about details in Screen
Capture implementation/limitations..
Regards and sorry about my english.
cox
Hello Cox! First off, your English is just fine (it's not my first language
either).
Second - thanks a lot for the DirectDraw filter idea. This is not the first
time people mention filters, so it looks like I'll need to learn yet another
API - DirectDraw, that is.
Third - about installing the driver. First off, note that there are two
separate tasks: Installing it and starting it.
To install it, I wrote an .inf file. I started with an example from MSDN,
and added a few pieces of my own. To start it, I used EnumDisplayDevices to
obtain its DeviceName, and then called ChangeDisplaySettingsEx() to actually
start the driver.
Here's the .inf file that I wrote.
Note: I removed some unnecessary pieces from the .inf file, and renamed some
strings (my version of .inf file also installs and registers a user-mode dll
and a com server, and adds a menu shortcut - you didn't need any of that).
But in doing that, I could've messed up, so I'm not 100% that this file will
work - make sure to doublecheck everything.
After writing the file, I put it into the same directory with the binaries,
and then used "Add hardware / Display Adapter" from Hardware manager.
Hope this helps!
Boris
;***********************************************************************
; MyMirrorDriver.inf
;
; Installation inf for MyMirrorDriver 2 driver
;
;
; Copyright (c) 2005 MyClientCompany, Inc.
;
;***********************************************************************
[Version]
Signature="$CHICAGO$"
Provider=%MyClientCompany%
ClassGUID={4D36E968-E325-11CE-BFC1-08002BE10318}
Class=Display
DriverVer=2/16/2005,1.1
[DestinationDirs]
DefaultDestDir = 11
MyMirrorDriver.Miniport = 12 ; drivers
MyMirrorDriver.Display = 11 ; system32
;
; Driver information
;
;
; Manufacturer section (list model sections)
;
[Manufacturer]
%MyClientCompany% = MyClientCompany.Mfg
;
; Models section (list install sections)
;
[MyClientCompany.Mfg]
%MyClientCompany.DeviceDesc0% = MyMirrorDriver, MyMirrorDriver
;
; General installation section
;
[MyMirrorDriver]
CopyFiles=MyMirrorDriver.Miniport, MyMirrorDriver.Display
;
; File sections
;
[MyMirrorDriver.Miniport]
MyMirrorDriver.sys
[MyMirrorDriver.Display]
MyMirrorDriver.dll
;
; Service Installation
;
[MyMirrorDriver.Services]
AddService = MyMirrorDriver, 0x00000002, MyMirrorDriver_Service_Inst,
MyMirrorDriver_EventLog_Inst
[MyMirrorDriver_Service_Inst]
DisplayName = %MyMirrorDriver.SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 1 ; SERVICE_SYSTEM_START
ErrorControl = 0 ; SERVICE_ERROR_IGNORE
LoadOrderGroup = Video
ServiceBinary = %12%\MyMirrorDriver.sys
[MyMirrorDriver_EventLog_Inst]
AddReg = MyMirrorDriver_EventLog_AddReg
[MyMirrorDriver_EventLog_AddReg]
HKR,,EventMessageFile,0x00020000,"%SystemRoot%\System32\IoLogMsg.dll;%SystemRoot%\System32\drivers\MyMirrorDriver.sys"
HKR,,TypesSupported,0x00010001,7
;
; Software Installation
;
[MyMirrorDriver.SoftwareSettings]
AddReg = MyMirrorDriver_SoftwareDeviceSettings
;
; Driver parameters go here
;
[MyMirrorDriver_SoftwareDeviceSettings]
HKR,, MirrorDriver, %REG_DWORD%, 1
HKR,, InstalledDisplayDrivers, %REG_MULTI_SZ%, MyMirrorDriver
HKR,, VgaCompatible, %REG_DWORD%, 0
HKR,, Attach.ToDesktop, %REG_DWORD%, 1
;-----------------------------------------------------------------------
; Display driver startup configuration data
;-----------------------------------------------------------------------
;
HKR,, MyDriverParameter, %REG_DWORD%, 0
[MyMirrorDriver.GeneralConfigData]
MaximumNumberOfDevices = 1
KeepExistingDriverEnabled = 1
;
;-----------------------------------------------------------------------
; Source file information
;-----------------------------------------------------------------------
[SourceDisksNames]
1 = %DiskId%,,,""
[SourceDisksFiles]
MyMirrorDriver.sys = 1
MyMirrorDriver.dll = 1
[Strings]
;
; Non-Localizable Strings
;
REG_SZ = 0x00000000
REG_MULTI_SZ = 0x00010000
REG_EXPAND_SZ = 0x00020000
REG_BINARY = 0x00000001
REG_DWORD = 0x00010001
serviceroot = System\CurrentControlSet\Services
RunKey = "Software\Microsoft\Windows\CurrentVersion\Run"
;
; Localizable Strings
;
DiskId="MyMirrorDriver Software Installation Disk"
MyClientCompany = "My Client Company, Inc."
MyClientCompany.DeviceDesc0 = "My display capture driver"
MyMirrorDriver.SvcDesc="MyMirrorDriver"