Sync with trunk head (part 1 or 2)

svn path=/branches/header-work/; revision=46667
This commit is contained in:
Amine Khaldi 2010-04-02 10:03:25 +00:00
commit e06395dacf
270 changed files with 13855 additions and 2029 deletions

View file

@ -45,6 +45,7 @@
<linkerflag>--unique=.eh_frame</linkerflag>
<linkerflag>-static</linkerflag>
<linkerflag>-fno-leading-underscore</linkerflag>
<linkerflag>-shared</linkerflag>
<linkerflag>--exclude-all-symbols</linkerflag>
</group>

View file

@ -9,9 +9,12 @@
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
#ifndef _TIMEZONE_DEFINED /* also in sys/time.h */
#define _TIMEZONE_DEFINED
struct timezone {
int tz_minuteswest; /* minutes W of Greenwich */
int tz_dsttime; /* type of dst correction */
int tz_minuteswest;
int tz_dsttime;
};
int gettimeofday(struct timeval *tv, struct timezone *tz);
extern int __cdecl gettimeofday (struct timeval *p, struct timezone *z);
#endif

View file

@ -4,19 +4,9 @@
<include base="ftp">.</include>
<define name="lint" />
<!-- FIXME: workarounds until we have a proper oldnames library -->
<define name="chdir">_chdir</define>
<define name="getcwd">_getcwd</define>
<define name="mktemp">_mktemp</define>
<define name="unlink">_unlink</define>
<define name="close">_close</define>
<define name="fileno">_fileno</define>
<define name="read">_read</define>
<define name="write">_write</define>
<define name="lseek">_lseek</define>
<library>ws2_32</library>
<library>iphlpapi</library>
<library>oldnames</library>
<file>cmds.c</file>
<file>cmdtab.c</file>
<file>domacro.c</file>

View file

@ -4,16 +4,11 @@
<include base="dhcp">.</include>
<include base="dhcp">include</include>
<!-- FIXME: workarounds until we have a proper oldnames library -->
<define name="tzset">_tzset</define>
<define name="close">_close</define>
<define name="read">_read</define>
<define name="write">_write</define>
<library>ntdll</library>
<library>ws2_32</library>
<library>iphlpapi</library>
<library>advapi32</library>
<library>oldnames</library>
<file>adapter.c</file>
<file>alloc.c</file>
<file>api.c</file>

View file

@ -1,6 +1,5 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<installfile installbase="system32/drivers/etc">quotes</installfile>
<module name="tcpsvcs" type="win32cui" installbase="system32" installname="tcpsvcs.exe" unicode="yes">
<include base="arp">.</include>
<library>ws2_32</library>

View file

@ -64,7 +64,7 @@
<file>explorer.rc</file>
<linkerflag>--enable-stdcall-fixup</linkerflag>
</module>
<installfile>explorer-cfg-template.xml</installfile>
<installfile installbase=".">explorer-cfg-template.xml</installfile>
<directory name="notifyhook">
<xi:include href="notifyhook/notifyhook.rbuild" />
</directory>

View file

@ -24,6 +24,7 @@
<property name="BASEADDRESS_PSTOREC" value="0x513d0000" />
<property name="BASEADDRESS_LPK" value="0x516c0000" />
<property name="BASEADDRESS_MSGSM32ACM" value="0x56db0000" />
<property name="BASEADDRESS_MSDVBNP" value="0x58280000" />
<property name="BASEADDRESS_MSG711ACM" value="0x584f0000" />
<property name="BASEADDRESS_IMAADP32ACM" value="0x585e0000" />
<property name="BASEADDRESS_BDAPLGIN" value="0x58600000" />
@ -32,6 +33,7 @@
<property name="BASEADDRESS_MMSYS" value="0x588a0000" />
<property name="BASEADDRESS_JOY" value="0x589b0000" />
<property name="BASEADDRESS_QMGR" value="0x59620000" />
<property name="BASEADDRESS_MSVIDCTL" value="0x59660000" />
<property name="BASEADDRESS_UXTHEME" value="0x5ad70000" />
<property name="BASEADDRESS_VDMDBG" value="0x5b0d0000" />
<property name="BASEADDRESS_UNTFS" value="0x5b340000" />

View file

@ -1,19 +0,0 @@
[Version]
Signature = "$ReactOS$"
[AddReg]
; Enable _one_ driver per section by removing the leading semicolon.
;
; Display driver section
;
; VBE SVGA driver
HKLM,"SYSTEM\CurrentControlSet\Services\VBE","Start",0x00010001,0x00000001
HKLM,"SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\VBE\Device0","DefaultSettings.VRefresh",0x00010001,1
HKLM,"SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\VBE\Device0","DefaultSettings.BitsPerPel",0x00010001,16
HKLM,"SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\VBE\Device0","DefaultSettings.XResolution",0x00010001,800
HKLM,"SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\VBE\Device0","DefaultSettings.YResolution",0x00010001,600
; VGA miniport driver
HKLM,"SYSTEM\CurrentControlSet\Services\Vga","Start",0x00010001,0x00000001

View file

@ -0,0 +1,818 @@
; Main ReactOS package
.Set DiskLabelTemplate="ReactOS" ; Label of disk
.Set CabinetNameTemplate="reactos.cab" ; reactos.cab
.Set InfFileName="reactos.inf" ; reactos.inf
;.Set Cabinet=on
;.Set Compress=on
.InfBegin
[Version]
Signature = "$ReactOS$"
[Directories]
1 = system32
2 = system32\drivers
3 = Fonts
4 =
5 = system32\drivers\etc
6 = inf
7 = bin
8 = media
.InfEnd
; Contents of disk
.InfBegin
[SourceFiles]
.InfEnd
; Base files
base\applications\cacls\cacls.exe 1
base\applications\calc\calc.exe 1
base\applications\charmap\charmap.exe 1
base\applications\cmdutils\dbgprint\dbgprint.exe 1
base\applications\cmdutils\doskey\doskey.exe 1
base\applications\cmdutils\find\find.exe 1
base\applications\cmdutils\hostname\hostname.exe 1
base\applications\cmdutils\lodctr\lodctr.exe 1
base\applications\cmdutils\more\more.exe 1
base\applications\cmdutils\reg\reg.exe 1
base\applications\cmdutils\xcopy\xcopy.exe 1
base\applications\control\control.exe 1
base\applications\dxdiag\dxdiag.exe 1
base\applications\fontview\fontview.exe 1
base\applications\mscutils\devmgmt\devmgmt.exe 1
base\applications\mscutils\eventvwr\eventvwr.exe 1
base\applications\games\solitaire\sol.exe 1
base\applications\games\spider\spider.exe 1
base\applications\games\winemine\winemine.exe 1
base\applications\hh\hh.exe 4
base\applications\kbswitch\kbswitch.exe 1
base\applications\kbswitch\kbsdll\kbsdll.dll 1
base\applications\logoff\logoff.exe 1
base\applications\magnify\magnify.exe 1
base\applications\mplay32\mplay32.exe 1
base\applications\msconfig\msconfig.exe 1
base\applications\mstsc\mstsc.exe 1
base\applications\network\arp\arp.exe 1
base\applications\network\dwnl\dwnl.exe 1
base\applications\network\route\route.exe 1
base\applications\network\finger\finger.exe 1
base\applications\network\ftp\ftp.exe 1
base\applications\network\ipconfig\ipconfig.exe 1
base\applications\network\netstat\netstat.exe 1
base\applications\network\nslookup\nslookup.exe 1
base\applications\network\ping\ping.exe 1
base\applications\network\telnet\telnet.exe 1
base\applications\network\tracert\tracert.exe 1
base\applications\network\whois\whois.exe 1
base\applications\notepad\notepad.exe 1
base\applications\paint\paint.exe 1
base\applications\rapps\rapps.exe 1
base\applications\regedit\regedit.exe 4
base\applications\regedit\clb\clb.dll 1
base\applications\regedt32\regedt32.exe 1
base\applications\sc\sc.exe 1
base\applications\screensavers\3dtext\3dtext.scr 1
base\applications\screensavers\logon\logon.scr 1
base\applications\mscutils\servman\servman.exe 1
base\applications\shutdown\shutdown.exe 1
base\applications\sndrec32\sndrec32.exe 1
base\applications\sndvol32\sndvol32.exe 1
base\applications\taskmgr\taskmgr.exe 1
base\applications\winhlp32\winhlp32.exe 4
base\applications\winver\winver.exe 1
base\applications\wordpad\wordpad.exe 1
base\applications\write\write.exe 1
base\services\audiosrv\audiosrv.exe 1
base\services\dhcp\dhcp.exe 1
base\services\eventlog\eventlog.exe 1
base\services\rpcss\rpcss.exe 1
base\services\spoolsv\spoolsv.exe 1
base\services\tcpsvcs\tcpsvcs.exe 1
base\services\telnetd\telnetd.exe 1
base\services\tcpsvcs\quotes 5
base\services\umpnpmgr\umpnpmgr.exe 1
base\services\wlansvc\wlansvc.exe 1
base\services\svchost\svchost.exe 1
base\setup\setup\setup.exe 1
base\setup\vmwinst\vmwinst.exe 1
base\shell\cmd\cmd.exe 1
base\shell\explorer\explorer.exe 4
base\shell\explorer\explorer-cfg-template.xml 4
base\shell\explorer\notifyhook\notifyhook.dll 1
base\shell\explorer-new\explorer_new.exe 4 optional
base\system\autochk\autochk.exe 1
base\system\bootok\bootok.exe 1
base\system\format\format.exe 1
base\system\lsass\lsass.exe 1
base\system\msiexec\msiexec.exe 1
base\system\regsvr32\regsvr32.exe 1
base\system\rundll32\rundll32.exe 1
base\system\runonce\runonce.exe 1
base\system\services\services.exe 1
base\system\userinit\userinit.exe 1
base\system\winlogon\winlogon.exe 1
base\system\expand\expand.exe 1
base\system\smss\smss.exe 1
; Dynamic Link Libraries
dll\3rdparty\mesa32\mesa32.dll 1
dll\3rdparty\libjpeg\libjpeg.dll 1
dll\3rdparty\libxslt\libxslt.dll 1
dll\3rdparty\dxtn\dxtn.dll 1 optional
dll\cpl\access\access.cpl 1
dll\cpl\appwiz\appwiz.cpl 1
dll\cpl\console\console.dll 1
dll\cpl\desk\desk.cpl 1
dll\cpl\hdwwiz\hdwwiz.cpl 1
dll\cpl\input\input.dll 1
dll\cpl\intl\intl.cpl 1
dll\cpl\joy\joy.cpl 1
;dll\cpl\liccpa\liccpa.cpl 1
dll\cpl\main\main.cpl 1
dll\cpl\mmsys\mmsys.cpl 1
dll\cpl\ncpa\ncpa.cpl 1
;dll\cpl\odbccp32\odbccp32.cpl 1
dll\cpl\powercfg\powercfg.cpl 1
dll\cpl\sysdm\sysdm.cpl 1
;dll\cpl\telephon\telephon.cpl 1
dll\cpl\timedate\timedate.cpl 1
;dll\cpl\usrmgr\usrmgr.cpl 1
dll\directx\amstream\amstream.dll 1
dll\directx\bdaplgin\bdaplgin.ax 1
dll\directx\dinput\dinput.dll 1
dll\directx\dinput8\dinput8.dll 1
dll\directx\dmusic\dmusic.dll 1
dll\directx\dplay\dplay.dll 1
dll\directx\dplayx\dplayx.dll 1
dll\directx\dsound\dsound.dll 1
dll\directx\dxdiagn\dxdiagn.dll 1
dll\directx\wine\ddraw\ddraw.dll 1
dll\directx\d3d8thk\d3d8thk.dll 1
dll\directx\devenum\devenum.dll 1
dll\directx\ksproxy\ksproxy.ax 1
dll\directx\ksuser\ksuser.dll 1
dll\directx\msdmo\msdmo.dll 1
dll\directx\msdvbnp\msdvbnp.ax 1
dll\directx\msvidctl\msvidctl.dll 1
dll\directx\quartz\quartz.dll 1
dll\directx\qedit\qedit.dll 1
dll\directx\wine\d3d8\d3d8.dll 1
dll\directx\wine\wined3d\wined3d.dll 1
dll\directx\wine\d3d9\d3d9.dll 1
dll\keyboard\kbda1\kbda1.dll 1
dll\keyboard\kbda2\kbda2.dll 1
dll\keyboard\kbda3\kbda3.dll 1
dll\keyboard\kbdal\kbdal.dll 1
dll\keyboard\kbdarme\kbdarme.dll 1
dll\keyboard\kbdarmw\kbdarmw.dll 1
dll\keyboard\kbdaze\kbdaze.dll 1
dll\keyboard\kbdazel\kbdazel.dll 1
dll\keyboard\kbdbgm\kbdbgm.dll 1
dll\keyboard\kbdbgt\kbdbgt.dll 1
dll\keyboard\kbdblr\kbdblr.dll 1
dll\keyboard\kbdbr\kbdbr.dll 1
dll\keyboard\kbdbga\kbdbga.dll 1
dll\keyboard\kbdbe\kbdbe.dll 1
dll\keyboard\kbdbur\kbdbur.dll 1
dll\keyboard\kbdcan\kbdcan.dll 1
dll\keyboard\kbdcr\kbdcr.dll 1
dll\keyboard\kbdcz\kbdcz.dll 1
dll\keyboard\kbdcz1\kbdcz1.dll 1
dll\keyboard\kbdda\kbdda.dll 1
dll\keyboard\kbddv\kbddv.dll 1
dll\keyboard\kbdes\kbdes.dll 1
dll\keyboard\kbdest\kbdest.dll 1
dll\keyboard\kbdfc\kbdfc.dll 1
dll\keyboard\kbdfi\kbdfi.dll 1
dll\keyboard\kbdfr\kbdfr.dll 1
dll\keyboard\kbdgeo\kbdgeo.dll 1
dll\keyboard\kbdgerg\kbdgerg.dll 1
dll\keyboard\kbdgneo\kbdgneo.dll 1
dll\keyboard\kbdgrist\kbdgrist.dll 1
dll\keyboard\kbdgr\kbdgr.dll 1
dll\keyboard\kbdhe\kbdhe.dll 1
dll\keyboard\kbdheb\kbdheb.dll 1
dll\keyboard\kbdhu\kbdhu.dll 1
dll\keyboard\kbdic\kbdic.dll 1
dll\keyboard\kbdinasa\kbdinasa.dll 1
dll\keyboard\kbdinben\kbdinben.dll 1
dll\keyboard\kbdindev\kbdindev.dll 1
dll\keyboard\kbdinguj\kbdinguj.dll 1
dll\keyboard\kbdinmal\kbdinmal.dll 1
dll\keyboard\kbdir\kbdir.dll 1
dll\keyboard\kbdit\kbdit.dll 1
dll\keyboard\kbdja\kbdja.dll 1
dll\keyboard\kbdkaz\kbdkaz.dll 1
dll\keyboard\kbdla\kbdla.dll 1
dll\keyboard\kbdlt1\kbdlt1.dll 1
dll\keyboard\kbdlv\kbdlv.dll 1
dll\keyboard\kbdmac\kbdmac.dll 1
dll\keyboard\kbdne\kbdne.dll 1
dll\keyboard\kbdno\kbdno.dll 1
dll\keyboard\kbdpl1\kbdpl1.dll 1
dll\keyboard\kbdpo\kbdpo.dll 1
dll\keyboard\kbdro\kbdro.dll 1
dll\keyboard\kbdru\kbdru.dll 1
dll\keyboard\kbdru1\kbdru1.dll 1
dll\keyboard\kbdsg\kbdsg.dll 1
dll\keyboard\kbdsk\kbdsk.dll 1
dll\keyboard\kbdsk1\kbdsk1.dll 1
dll\keyboard\kbdsw\kbdsw.dll 1
dll\keyboard\kbdtat\kbdtat.dll 1
dll\keyboard\kbdth0\kbdth0.dll 1
dll\keyboard\kbdth1\kbdth1.dll 1
dll\keyboard\kbdth2\kbdth2.dll 1
dll\keyboard\kbdth3\kbdth3.dll 1
dll\keyboard\kbdtuf\kbdtuf.dll 1
dll\keyboard\kbdtuq\kbdtuq.dll 1
dll\keyboard\kbduk\kbduk.dll 1
dll\keyboard\kbdur\kbdur.dll 1
dll\keyboard\kbdurs\kbdurs.dll 1
dll\keyboard\kbdus\kbdus.dll 1
dll\keyboard\kbdusa\kbdusa.dll 1
dll\keyboard\kbdusl\kbdusl.dll 1
dll\keyboard\kbdusr\kbdusr.dll 1
dll\keyboard\kbdusx\kbdusx.dll 1
dll\keyboard\kbduzb\kbduzb.dll 1
dll\keyboard\kbdvntc\kbdvntc.dll 1
dll\keyboard\kbdycc\kbdycc.dll 1
dll\keyboard\kbdycl\kbdycl.dll 1
dll\keyboard\kbdko\kbdko.dll 1
dll\ntdll\ntdll.dll 1
dll\win32\acledit\acledit.dll 1
dll\win32\aclui\aclui.dll 1
dll\win32\activeds\activeds.dll 1
dll\win32\advapi32\advapi32.dll 1
dll\win32\advpack\advpack.dll 1
dll\win32\actxprxy\actxprxy.dll 1
dll\win32\atl\atl.dll 1
dll\win32\authz\authz.dll 1
dll\win32\avicap32\avicap32.dll 1
dll\win32\avifil32\avifil32.dll 1
dll\win32\batt\batt.dll 1
dll\win32\bcrypt\bcrypt.dll 1
dll\win32\beepmidi\beepmidi.dll 1
dll\win32\browseui\browseui.dll 1
dll\win32\cabinet\cabinet.dll 1
dll\win32\cards\cards.dll 1
dll\win32\cfgmgr32\cfgmgr32.dll 1
dll\win32\clusapi\clusapi.dll 1
dll\win32\comcat\comcat.dll 1
dll\win32\comctl32\comctl32.dll 1
dll\win32\comdlg32\comdlg32.dll 1
dll\win32\compstui\compstui.dll 1
dll\win32\credui\credui.dll 1
dll\win32\crtdll\crtdll.dll 1
dll\win32\crypt32\crypt32.dll 1
dll\win32\cryptdlg\cryptdlg.dll 1
dll\win32\cryptdll\cryptdll.dll 1
dll\win32\cryptnet\cryptnet.dll 1
dll\win32\cryptui\cryptui.dll 1
dll\win32\dbghelp\dbghelp.dll 1
dll\win32\dciman32\dciman32.dll 1
dll\win32\dwmapi\dwmapi.dll 1
dll\win32\devmgr\devmgr.dll 1
dll\win32\dhcpcsvc\dhcpcsvc.dll 1
dll\win32\dnsapi\dnsapi.dll 1
dll\win32\faultrep\faultrep.dll 1
dll\win32\fmifs\fmifs.dll 1
dll\win32\fusion\fusion.dll 1
dll\win32\gdi32\gdi32.dll 1
dll\win32\gdiplus\gdiplus.dll 1
dll\win32\getuname\getuname.dll 1
dll\win32\glu32\glu32.dll 1
dll\win32\hhctrl.ocx\hhctrl.ocx 1
dll\win32\hid\hid.dll 1
dll\win32\hlink\hlink.dll 1
dll\win32\hnetcfg\hnetcfg.dll 1
dll\win32\httpapi\httpapi.dll 1
dll\win32\iccvid\iccvid.dll 1
dll\win32\icmp\icmp.dll 1
dll\win32\imaadp32.acm\imaadp32.acm 1
dll\win32\imagehlp\imagehlp.dll 1
dll\win32\imm32\imm32.dll 1
dll\win32\inetcomm\inetcomm.dll 1
dll\win32\inetmib1\inetmib1.dll 1
dll\win32\initpki\initpki.dll 1
dll\win32\inseng\inseng.dll 1
dll\win32\iphlpapi\iphlpapi.dll 1
dll\win32\itircl\itircl.dll 1
dll\win32\itss\itss.dll 1
dll\win32\jscript\jscript.dll 1
dll\win32\kernel32\kernel32.dll 1
dll\win32\loadperf\loadperf.dll 1
dll\win32\localspl\localspl.dll 1
dll\win32\localui\localui.dll 1
dll\win32\lsasrv\lsasrv.dll 1
dll\win32\lz32\lz32.dll 1
dll\win32\mapi32\mapi32.dll 1
dll\win32\mciavi32\mciavi32.dll 1
dll\win32\mcicda\mcicda.dll 1
dll\win32\mciqtz32\mciqtz32.dll 1
dll\win32\mciseq\mciseq.dll 1
dll\win32\mciwave\mciwave.dll 1
dll\win32\mlang\mlang.dll 1
dll\win32\mmdrv\mmdrv.dll 1
dll\win32\modemui\modemui.dll 1
dll\win32\mpr\mpr.dll 1
dll\win32\mprapi\mprapi.dll 1
dll\win32\msacm32\msacm32.dll 1
dll\win32\msacm32\msacm32.drv\msacm32.drv 1
dll\win32\msadp32.acm\msadp32.acm 1
dll\win32\msafd\msafd.dll 1
dll\win32\mscat32\mscat32.dll 1
dll\win32\mscms\mscms.dll 1
dll\win32\mscoree\mscoree.dll 1
dll\win32\msctf\msctf.dll 1
dll\win32\msftedit\msftedit.dll 1
dll\win32\msg711.acm\msg711.acm 1
dll\win32\msgina\msgina.dll 1
dll\win32\msgsm32.acm\msgsm32.acm 1
dll\win32\mshtml\mshtml.dll 1
dll\win32\mshtml.tlb\mshtml.tlb 1
dll\win32\msi\msi.dll 1
dll\win32\msimg32\msimg32.dll 1
dll\win32\msimtf\msimtf.dll 1
dll\win32\msisip\msisip.dll 1
dll\win32\msisys.ocx\msisys.ocx 1
dll\win32\msnet32\msnet32.dll 1
dll\win32\msrle32\msrle32.dll 1
dll\win32\mssign32\mssign32.dll 1
dll\win32\mssip32\mssip32.dll 1
dll\win32\mstask\mstask.dll 1
dll\win32\msvcrt\msvcrt.dll 1
dll\win32\msvcrt20\msvcrt20.dll 1
dll\win32\msvcrt40\msvcrt40.dll 1
dll\win32\msvfw32\msvfw32.dll 1
dll\win32\msvidc32\msvidc32.dll 1
dll\win32\mswsock\mswsock.dll 1
dll\win32\msxml3\msxml3.dll 1
dll\win32\nddeapi\nddeapi.dll 1
dll\win32\netapi32\netapi32.dll 1
dll\win32\netcfgx\netcfgx.dll 1
dll\win32\netid\netid.dll 1
dll\win32\netshell\netshell.dll 1
dll\win32\newdev\newdev.dll 1
dll\win32\ntdsapi\ntdsapi.dll 1
dll\win32\ntlanman\ntlanman.dll 1
dll\win32\ntmarta\ntmarta.dll 1
dll\win32\ntprint\ntprint.dll 1
dll\win32\objsel\objsel.dll 1
dll\win32\odbc32\odbc32.dll 1
dll\win32\odbccp32\odbccp32.dll 1
dll\win32\ole32\ole32.dll 1
dll\win32\oleacc\oleacc.dll 1
dll\win32\oleaut32\oleaut32.dll 1
dll\win32\olecli32\olecli32.dll 1
dll\win32\oledlg\oledlg.dll 1
dll\win32\olepro32\olepro32.dll 1
dll\win32\olesvr32\olesvr32.dll 1
dll\win32\olethk32\olethk32.dll 1
dll\win32\opengl32\opengl32.dll 1
dll\win32\pdh\pdh.dll 1
dll\win32\pidgen\pidgen.dll 1
dll\win32\powrprof\powrprof.dll 1
dll\win32\printui\printui.dll 1
dll\win32\psapi\psapi.dll 1
dll\win32\pstorec\pstorec.dll 1
dll\win32\qmgr\qmgr.dll 1
dll\win32\qmgrprxy\qmgrprxy.dll 1
dll\win32\query\query.dll 1
dll\win32\rasadhlp\rasadhlp.dll 1
dll\win32\rasapi32\rasapi32.dll 1
dll\win32\rasdlg\rasdlg.dll 1
dll\win32\resutils\resutils.dll 1
dll\win32\rasman\rasman.dll 1
dll\win32\riched20\riched20.dll 1
dll\win32\riched32\riched32.dll 1
dll\win32\rpcrt4\rpcrt4.dll 1
dll\win32\rsabase\rsabase.dll 1
dll\win32\rsaenh\rsaenh.dll 1
dll\win32\samlib\samlib.dll 1
dll\win32\samsrv\samsrv.dll 1
dll\win32\sccbase\sccbase.dll 1
dll\win32\schannel\schannel.dll 1
dll\win32\secur32\secur32.dll 1
dll\win32\security\security.dll 1
dll\win32\sensapi\sensapi.dll 1
dll\win32\serialui\serialui.dll 1
dll\win32\setupapi\setupapi.dll 1
dll\win32\sfc\sfc.dll 1
dll\win32\sfc_os\sfc_os.dll 1
dll\win32\shdoclc\shdoclc.dll 1
dll\win32\shdocvw\shdocvw.dll 1
dll\win32\shell32\shell32.dll 1
dll\win32\shfolder\shfolder.dll 1
dll\win32\shimgvw\shimgvw.dll 1
dll\win32\shlwapi\shlwapi.dll 1
dll\win32\slbcsp\slbcsp.dll 1
dll\win32\smdll\smdll.dll 1
dll\win32\snmpapi\snmpapi.dll 1
dll\win32\softpub\softpub.dll 1
dll\win32\spoolss\spoolss.dll 1
dll\win32\srclient\srclient.dll 1
dll\win32\stdole2.tlb\stdole2.tlb 1
dll\win32\stdole32.tlb\stdole32.tlb 1
dll\win32\sti\sti.dll 1
dll\win32\sxs\sxs.dll 1
dll\win32\syssetup\syssetup.dll 1
dll\win32\t2embed\t2embed.dll 1
dll\win32\tapi32\tapi32.dll 1
dll\win32\tapiui\tapiui.dll 1
dll\win32\traffic\traffic.dll 1
dll\win32\twain_32\twain_32.dll 1
dll\win32\uext2\uext2.dll 1
dll\win32\ufat\ufat.dll 1
dll\win32\ufatx\ufatx.dll 1 optional
dll\win32\untfs\untfs.dll 1
dll\win32\updspapi\updspapi.dll 1
dll\win32\url\url.dll 1
dll\win32\urlmon\urlmon.dll 1
dll\win32\user32\user32.dll 1
dll\win32\userenv\userenv.dll 1
dll\win32\usp10\usp10.dll 1
dll\win32\uxtheme\uxtheme.dll 1
dll\win32\vdmdbg\vdmdbg.dll 1
dll\win32\version\version.dll 1
dll\win32\windowscodecs\windowscodecs.dll 1
dll\win32\winemp3.acm\winemp3.acm 1
dll\win32\winfax\winfax.dll 1
dll\win32\winhttp\winhttp.dll 1
dll\win32\wininet\wininet.dll 1
dll\win32\winmm\winmm.dll 1
dll\win32\winspool\winspool.drv 1
dll\win32\winsta\winsta.dll 1
dll\win32\wlanapi\wlanapi.dll 1
dll\win32\wintrust\wintrust.dll 1
dll\win32\wldap32\wldap32.dll 1
dll\win32\wmi\wmi.dll 1
dll\win32\ws2_32\ws2_32.dll 1
dll\win32\ws2help\ws2help.dll 1
dll\win32\wshirda\wshirda.dll 1
dll\win32\wshtcpip\wshtcpip.dll 1
dll\win32\wsock32\wsock32.dll 1
dll\win32\wtsapi32\wtsapi32.dll 1
dll\win32\wuapi\wuapi.dll 1
dll\win32\xinput1_1\xinput1_1.dll 1
dll\win32\xinput1_2\xinput1_2.dll 1
dll\win32\xinput1_3\xinput1_3.dll 1
dll\win32\xinput9_1_0\xinput9_1_0.dll 1
dll\win32\xmllite\xmllite.dll 1
dll\win32\winmm\midimap\midimap.dll 1
dll\win32\wdmaud.drv\wdmaud.drv 1
; Shell Extensions
dll\shellext\deskadp\deskadp.dll 1
dll\shellext\deskmon\deskmon.dll 1
; Drivers
drivers\base\bootvid\bootvid.dll 1
drivers\base\beep\beep.sys 2
drivers\base\null\null.sys 2
drivers\base\nmidebug\nmidebug.sys 2
drivers\battery\battc\battc.sys 2
drivers\bus\isapnp\isapnp.sys 2
drivers\bus\acpi\cmbatt\cmbatt.sys 2
drivers\bus\acpi\compbatt\compbatt.sys 2
drivers\directx\dxapi\dxapi.sys 2
drivers\directx\dxg\dxg.sys 2
drivers\directx\dxgthk\dxgthk.sys 2
drivers\filesystems\fs_rec\fs_rec.sys 2
drivers\filesystems\msfs\msfs.sys 2
drivers\filesystems\mup\mup.sys 2
drivers\filesystems\npfs\npfs.sys 2
drivers\input\mouclass\mouclass.sys 2
drivers\input\sermouse\sermouse.sys 2
drivers\ksfilter\ks\ks.sys 2
drivers\multimedia\bdasup\bdasup.sys 2
drivers\network\afd\afd.sys 2
drivers\network\ndis\ndis.sys 2
drivers\network\tcpip\tcpip.sys 2
drivers\network\tdi\tdi.sys 2
drivers\network\dd\ne2000\ne2000.sys 2
drivers\network\dd\pcnet\pcnet.sys 2
drivers\serial\serenum\serenum.sys 2
drivers\serial\serial\serial.sys 2
drivers\storage\ide\pciide\pciide.sys 2
drivers\storage\ide\pciidex\pciidex.sys 2
;drivers\usb\miniport\usbohci\usbohci.sys 2
;drivers\usb\miniport\usbuhci\usbuhci.sys 2
;drivers\usb\usbhub\usbhub.sys 2
;drivers\usb\usbport\usbport.sys 2
drivers\usb\nt4compat\usbdriver\usbdriver.sys 2
drivers\video\displays\vga\vgaddi.dll 1
drivers\video\displays\framebuf\framebuf.dll 1
drivers\video\miniport\vga\vgamp.sys 2
drivers\video\miniport\vbe\vbemp.sys 2
drivers\video\videoprt\videoprt.sys 2
drivers\video\font\ftfd\ftfd.dll 1
drivers\wdm\audio\filters\kmixer\kmixer.sys 2
drivers\wdm\audio\sysaudio\sysaudio.sys 2
drivers\wdm\audio\legacy\wdmaud\wdmaud.sys 2
drivers\wdm\audio\backpln\portcls\portcls.sys 2
drivers\wdm\audio\drm\drmk\drmk.sys 2
drivers\wmi\wmilib.sys 2
; Media
media\fonts\DejaVuSans.ttf 3
media\fonts\DejaVuSans-Bold.ttf 3
media\fonts\DejaVuSans-BoldOblique.ttf 3
media\fonts\DejaVuSansMono.ttf 3
media\fonts\DejaVuSansMono-Bold.ttf 3
media\fonts\DejaVuSansMono-BoldOblique.ttf 3
media\fonts\DejaVuSansMono-Oblique.ttf 3
media\fonts\DejaVuSans-Oblique.ttf 3
media\fonts\DejaVuSerif.ttf 3
media\fonts\DejaVuSerif-Bold.ttf 3
media\fonts\DejaVuSerif-BoldItalic.ttf 3
media\fonts\DejaVuSerif-Italic.ttf 3
media\fonts\FreeMono.ttf 3
media\fonts\FreeMonoBold.ttf 3
media\fonts\FreeMonoBoldOblique.ttf 3
media\fonts\FreeMonoOblique.ttf 3
media\fonts\LiberationMono-Bold.ttf 3
media\fonts\LiberationMono-BoldItalic.ttf 3
media\fonts\LiberationMono-Italic.ttf 3
media\fonts\LiberationMono-Regular.ttf 3
media\fonts\LiberationSans-Bold.ttf 3
media\fonts\LiberationSans-BoldItalic.ttf 3
media\fonts\LiberationSans-Italic.ttf 3
media\fonts\LiberationSans-Regular.ttf 3
media\fonts\LiberationSerif-Bold.ttf 3
media\fonts\LiberationSerif-BoldItalic.ttf 3
media\fonts\LiberationSerif-Italic.ttf 3
media\fonts\LiberationSerif-Regular.ttf 3
media\fonts\Marlett.ttf 3
media\fonts\symbol.ttf 3
media\fonts\tahoma.ttf 3
media\fonts\tahomabd.ttf 3
media\nls\c_037.nls 1
media\nls\c_424.nls 1
media\nls\c_500.nls 1
media\nls\c_737.nls 1
media\nls\c_775.nls 1
media\nls\c_850.nls 1
media\nls\c_852.nls 1
media\nls\c_855.nls 1
media\nls\c_856.nls 1
media\nls\c_857.nls 1
media\nls\c_860.nls 1
media\nls\c_861.nls 1
media\nls\c_862.nls 1
media\nls\c_863.nls 1
media\nls\c_864.nls 1
media\nls\c_865.nls 1
media\nls\c_866.nls 1
media\nls\c_869.nls 1
media\nls\c_874.nls 1
media\nls\c_875.nls 1
media\nls\c_878.nls 1
media\nls\c_932.nls 1
media\nls\c_936.nls 1
media\nls\c_949.nls 1
media\nls\c_950.nls 1
media\nls\c_1006.nls 1
media\nls\c_1026.nls 1
media\nls\c_1250.nls 1
media\nls\c_1251.nls 1
media\nls\c_1253.nls 1
media\nls\c_1254.nls 1
media\nls\c_1255.nls 1
media\nls\c_1256.nls 1
media\nls\c_1257.nls 1
media\nls\c_1258.nls 1
media\nls\c_10000.nls 1
media\nls\c_10006.nls 1
media\nls\c_10007.nls 1
media\nls\c_10029.nls 1
media\nls\c_10079.nls 1
media\nls\c_10081.nls 1
media\nls\c_20866.nls 1
media\nls\c_21866.nls 1
media\nls\c_28591.nls 1
media\nls\c_28592.nls 1
media\nls\c_28593.nls 1
media\nls\c_28594.nls 1
media\nls\c_28595.nls 1
media\nls\c_28596.nls 1
media\nls\c_28597.nls 1
media\nls\c_28598.nls 1
media\nls\c_28599.nls 1
media\nls\c_28600.nls 1
media\nls\c_28603.nls 1
media\nls\c_28604.nls 1
media\nls\c_28605.nls 1
media\nls\c_28606.nls 1
media\drivers\etc\services 5
media\inf\audio.inf 6
media\inf\acpi.inf 6
media\inf\battery.inf 6
media\inf\cdrom.inf 6
media\inf\cpu.inf 6
media\inf\display.inf 6
media\inf\font.inf 6
media\inf\fdc.inf 6
media\inf\hdc.inf 6
media\inf\intl.inf 6
media\inf\layout.inf 6
media\inf\machine.inf 6
media\inf\msmouse.inf 6
media\inf\keyboard.inf 6
media\inf\ks.inf 6
media\inf\NET_NIC.inf 6
media\inf\netamd.inf 6
media\inf\netisa.inf 6
media\inf\netrtpnt.inf 6
media\inf\nettcpip.inf 6
media\inf\ports.inf 6
media\inf\scsi.inf 6
media\inf\syssetup.inf 6
media\inf\usbport.inf 6
media\inf\usb.inf 6
media\inf\usbstor.inf 6
media\inf\xboxdisp.inf 6
; Media Files
media\sounds\ReactOS_LogOn.wav 8
; Ini Files
boot\bootdata\system.ini 4
; Regression Testing
boot\bootdata\bootcdregtest\regtest.cmd 7 optional
; Subsystems
subsystems\win32\csrss\csrss.exe 1
subsystems\win32\csrss\win32csr\win32csr.dll 1
subsystems\win32\csrss\csrsrv\csrsrv.dll 1
subsystems\ntvdm\ntvdm.exe 1
subsystems\win32\win32k\win32k.sys 1
; Optional/proprietary files
modules\optional\DroidSansFallback.ttf 3 optional
modules\optional\NOTICE_for_Droid_Font.txt 4 optional
modules\optional\netkvm2k.inf 6 optional
modules\optional\netkvm2k.cat 6 optional
modules\optional\netkvm.sys 2 optional
modules\optional\alcxwdm.inf 6 optional
modules\optional\alcxwdm.sys 2 optional
modules\optional\mfc42.dll 1 optional
modules\optional\mfc42u.dll 1 optional
modules\optional\mfc71.dll 1 optional
modules\optional\mfc71u.dll 1 optional
modules\optional\msvbvm50.dll 1 optional
modules\optional\msvbvm60.dll 1 optional
modules\optional\msvcirt.dll 1 optional
modules\optional\msvcp71.dll 1 optional
modules\optional\msvcr71.dll 1 optional
modules\optional\vmx_fb.dll 1 optional
modules\optional\vmx_mode.dll 1 optional
modules\optional\vmx_svga.inf 6 optional
modules\optional\vmx_svga.sys 2 optional
modules\optional\wine_gecko-1.0.0-x86.cab 4 optional
; Rosapps
modules\rosapps\applications\screensavers\cylfrac\cylfrac.scr 1 optional
modules\rosapps\applications\screensavers\matrix\matrix.scr 1 optional
modules\rosapps\applications\screensavers\blankscr\scrnsave.scr 1 optional
modules\rosapps\applications\screensavers\starfield\starfield.scr 1 optional
modules\rosapps\applications\screensavers\mazescr\mazescr.scr 1 optional
modules\rosapps\applications\screensavers\butterflies\butterflies.scr 1 optional
modules\rosapps\applications\cmdutils\comp\comp.exe 1 optional
modules\rosapps\applications\cmdutils\mode\mode.exe 1 optional
modules\rosapps\applications\cmdutils\sort\sort.exe 1 optional
modules\rosapps\applications\cmdutils\tee\tee.exe 1 optional
modules\rosapps\applications\cmdutils\touch\touch.exe 1 optional
modules\rosapps\applications\cmdutils\uptime\uptime.exe 1 optional
modules\rosapps\applications\cmdutils\y\y.exe 1 optional
modules\rosapps\applications\devutils\gdb2\gdb2.exe 1 optional
modules\rosapps\applications\devutils\gdihv\gdihv.exe 1 optional
modules\rosapps\applications\devutils\genguid\genguid.exe 1 optional
modules\rosapps\applications\sysutils\gettype\gettype.exe 1 optional
modules\rosapps\applications\net\ncftp\ncftp.exe 1 optional
modules\rosapps\applications\net\netreg\netreg.exe 1 optional
modules\rosapps\applications\net\niclist\niclist.exe 1 optional
modules\rosapps\applications\net\roshttpd\roshttpd.exe 1 optional
modules\rosapps\applications\notevil\notevil.exe 1 optional
modules\rosapps\applications\sysutils\chkdsk\chkdsk.exe 1 optional
modules\rosapps\applications\sysutils\systeminfo\systeminfo.exe 1 optional
modules\rosapps\applications\sysutils\chklib\chklib.exe 1 optional
modules\rosapps\applications\sysutils\ctm\ctm.exe 1 optional
modules\rosapps\applications\sysutils\kill\kill.exe 1 optional
modules\rosapps\applications\sysutils\lsdd\lsdd.exe 1 optional
modules\rosapps\applications\sysutils\man\man.exe 1 optional
modules\rosapps\applications\sysutils\pedump\pedump.exe 1 optional
modules\rosapps\applications\sysutils\regexpl\regexpl.exe 1 optional
modules\rosapps\applications\sysutils\tcat\tcat.exe 1 optional
modules\rosapps\applications\sysutils\tlist\tlist.exe 1 optional
modules\rosapps\applications\sysutils\screenshot\screenshot.exe 1 optional
modules\rosapps\applications\sysutils\utils\binpatch\binpatch.exe 1 optional
modules\rosapps\applications\sysutils\utils\cat\cat.exe 1 optional
modules\rosapps\applications\sysutils\utils\driver\load\load.exe 1 optional
modules\rosapps\applications\sysutils\utils\driver\unload\unload.exe 1 optional
modules\rosapps\applications\sysutils\utils\infinst\infinst.exe 1 optional
modules\rosapps\applications\sysutils\utils\nts2w32err\nts2w32err.exe 1 optional
modules\rosapps\applications\sysutils\utils\objdir\objdir.exe 1 optional
modules\rosapps\applications\sysutils\utils\partinfo\partinfo.exe 1 optional
modules\rosapps\applications\sysutils\utils\ps\ps.exe 1 optional
modules\rosapps\applications\sysutils\utils\rosperf\rosperf.exe 1 optional
modules\rosapps\applications\sysutils\utils\stats\stats.exe 1 optional
modules\rosapps\applications\sysutils\utils\tickcount\tickcount.exe 1 optional
modules\rosapps\applications\winfile\winfile.exe 1 optional
modules\rosapps\demos\maze\maze.exe 1 optional
modules\rosapps\drivers\green\green.sys 2 optional
; Rostests
modules\rostests\rosautotest\rosautotest.exe 1 optional
modules\rostests\tests\pseh2\pseh2_test.exe 7 optional
modules\rostests\winetests\advapi32\advapi32_winetest.exe 7 optional
modules\rostests\winetests\advpack\advpack_winetest.exe 7 optional
modules\rostests\winetests\browseui\browseui_winetest.exe 7 optional
modules\rostests\winetests\cabinet\cabinet_winetest.exe 7 optional
modules\rostests\winetests\comcat\comcat_winetest.exe 7 optional
modules\rostests\winetests\comctl32\comctl32_winetest.exe 7 optional
modules\rostests\winetests\comdlg32\comdlg32_winetest.exe 7 optional
modules\rostests\winetests\crypt32\crypt32_winetest.exe 7 optional
modules\rostests\winetests\cryptnet\cryptnet_winetest.exe 7 optional
modules\rostests\winetests\dsound\dsound_winetest.exe 7 optional
modules\rostests\winetests\gdi32\gdi32_winetest.exe 7 optional
modules\rostests\winetests\gdiplus\gdiplus_winetest.exe 7 optional
modules\rostests\winetests\hlink\hlink_winetest.exe 7 optional
modules\rostests\winetests\icmp\icmp_winetest.exe 7 optional
modules\rostests\winetests\iphlpapi\iphlpapi_winetest.exe 7 optional
modules\rostests\winetests\jscript\jscript_winetest.exe 7 optional
modules\rostests\winetests\kernel32\kernel32_winetest.exe 7 optional
modules\rostests\winetests\lz32\lz32_winetest.exe 7 optional
modules\rostests\winetests\mapi32\mapi32_winetest.exe 7 optional
modules\rostests\winetests\mlang\mlang_winetest.exe 7 optional
modules\rostests\winetests\mshtml\mshtml_winetest.exe 7 optional
modules\rostests\winetests\msi\msi_winetest.exe 7 optional
modules\rostests\winetests\mstask\mstask_winetest.exe 7 optional
modules\rostests\winetests\msvcrt\msvcrt_winetest.exe 7 optional
modules\rostests\winetests\msxml3\msxml3_winetest.exe 7 optional
modules\rostests\winetests\netapi32\netapi32_winetest.exe 7 optional
modules\rostests\winetests\ntdll\ntdll_winetest.exe 7 optional
modules\rostests\winetests\odbccp32\odbccp32_winetest.exe 7 optional
modules\rostests\winetests\ole32\ole32_winetest.exe 7 optional
modules\rostests\winetests\oleaut32\oleaut32_winetest.exe 7 optional
modules\rostests\winetests\powrprof\powrprof_winetest.exe 7 optional
modules\rostests\winetests\psapi\psapi_winetest.exe 7 optional
modules\rostests\winetests\riched20\riched20_winetest.exe 7 optional
modules\rostests\winetests\rpcrt4\rpcrt4_winetest.exe 7 optional
modules\rostests\winetests\rsabase\rsabase_winetest.exe 7 optional
modules\rostests\winetests\rsaenh\rsaenh_winetest.exe 7 optional
modules\rostests\winetests\schannel\schannel_winetest.exe 7 optional
modules\rostests\winetests\secur32\secur32_winetest.exe 7 optional
modules\rostests\winetests\setupapi\setupapi_winetest.exe 7 optional
modules\rostests\winetests\shdocvw\shdocvw_winetest.exe 7 optional
modules\rostests\winetests\shell32\shell32_winetest.exe 7 optional
modules\rostests\winetests\shlwapi\shlwapi_winetest.exe 7 optional
modules\rostests\winetests\urlmon\urlmon_winetest.exe 7 optional
modules\rostests\winetests\user32\user32_winetest.exe 7 optional
modules\rostests\winetests\usp10\usp10_winetest.exe 7 optional
modules\rostests\winetests\uxtheme\uxtheme_winetest.exe 7 optional
modules\rostests\winetests\version\version_winetest.exe 7 optional
modules\rostests\winetests\winhttp\winhttp_winetest.exe 7 optional
modules\rostests\winetests\wininet\wininet_winetest.exe 7 optional
modules\rostests\winetests\winmm\winmm_winetest.exe 7 optional
modules\rostests\winetests\wintrust\wintrust_winetest.exe 7 optional
modules\rostests\winetests\wlanapi\wlanapi_winetest.exe 7 optional
modules\rostests\winetests\ws2_32\ws2_32_winetest.exe 7 optional
modules\rostests\winetests\xmllite\xmllite_winetest.exe 7 optional
modules\wallpaper\Angelus_02_ROSWP.bmp 4 optional

View file

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE directory SYSTEM "../../../tools/rbuild/project.dtd">
<module name="freeldr_arch" type="objectlibrary">
<module name="freeldr_arch" type="objectlibrary" crt="static">
<include base="freeldr_base">include</include>
<include base="freeldr_base">cache</include>
<include base="ntoskrnl">include</include>

View file

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="freeldr_base" type="objectlibrary">
<module name="freeldr_base" type="objectlibrary" crt="static">
<include base="freeldr_base">include</include>
<include base="freeldr_base">cache</include>
<include base="cmlib">.</include>

View file

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="freeldr_main" type="objectlibrary">
<module name="freeldr_main" type="objectlibrary" crt="static">
<include base="freeldr_main">include</include>
<include base="ntoskrnl">include</include>
<define name="_NTHAL_" />

View file

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="setupldr_main" type="objectlibrary">
<module name="setupldr_main" type="objectlibrary" crt="static">
<include base="setupldr_main">include</include>
<include base="ntoskrnl">include</include>
<define name="_NTHAL_" />

View file

@ -232,7 +232,7 @@ WinLdrLoadDeviceDriver(PLOADER_PARAMETER_BLOCK LoaderBlock,
PVOID DriverBase;
// Separate the path to file name and directory path
snprintf(DriverPath, sizeof(DriverPath), "%wZ", FilePath);
_snprintf(DriverPath, sizeof(DriverPath), "%wZ", FilePath);
DriverNamePos = strrchr(DriverPath, '\\');
if (DriverNamePos != NULL)
{
@ -261,7 +261,7 @@ WinLdrLoadDeviceDriver(PLOADER_PARAMETER_BLOCK LoaderBlock,
}
// It's not loaded, we have to load it
snprintf(FullPath, sizeof(FullPath), "%s%wZ", BootPath, FilePath);
_snprintf(FullPath, sizeof(FullPath), "%s%wZ", BootPath, FilePath);
Status = WinLdrLoadImage(FullPath, LoaderBootDriver, &DriverBase);
if (!Status)
return FALSE;

View file

@ -65,7 +65,7 @@
enable this (except they/you purchased a license from the patent owner).
This settings is disabled (0) by default.
-->
<property name="NSWPAT" value="0" />
<property name="NSWPAT" value="1" />
<!--
Whether to compile with the KD protocol. This will disable support for KDBG

View file

@ -96,7 +96,16 @@ LRESULT CALLBACK RosImageProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam
// build new bitmap
GetObject(pImgInfo->hBitmap, sizeof(BITMAP), &bitmap);
dc = CreateCompatibleDC(GetDC(NULL));
if (dc == NULL)
{
break;
}
sdc = CreateCompatibleDC(dc);
if (sdc == NULL)
{
DeleteDC(dc);
break;
}
ncm.cbSize = sizeof(NONCLIENTMETRICS);
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0);

View file

@ -46,9 +46,9 @@ BEGIN
EDITTEXT IDC_USER_GENERAL_FULL_NAME,77,43,168,13,ES_AUTOHSCROLL
LTEXT "Beschreibung:", -1, 7, 64, 63, 8
EDITTEXT IDC_USER_GENERAL_DESCRIPTION,77,61,168,13,ES_AUTOHSCROLL
AUTOCHECKBOX "Benutzer muss das Passwort bei der ersten Anmeldung ändern",IDC_USER_GENERAL_FORCE_CHANGE,7,82,210,10
AUTOCHECKBOX "Benutzer kann das Passwort nicht ändern",IDC_USER_GENERAL_CANNOT_CHANGE,7,95,210,10
AUTOCHECKBOX "Passwort läuft nie ab",IDC_USER_GENERAL_NEVER_EXPIRES,7,108,210,10
AUTOCHECKBOX "Benutzer muss das Passwort bei der ersten Anmeldung ändern",IDC_USER_GENERAL_FORCE_CHANGE,7,82,230,10
AUTOCHECKBOX "Benutzer kann das Passwort nicht ändern",IDC_USER_GENERAL_CANNOT_CHANGE,7,95,210,10
AUTOCHECKBOX "Passwort läuft nie ab",IDC_USER_GENERAL_NEVER_EXPIRES,7,108,210,10
AUTOCHECKBOX "Konto ist deativiert",IDC_USER_GENERAL_DISABLED,7,121,210,10
AUTOCHECKBOX "Konto ist gesperrt",IDC_USER_GENERAL_LOCKED,7,134,210,10
END
@ -106,7 +106,7 @@ END
IDD_CHANGE_PASSWORD DIALOGEX DISCARDABLE 0, 0, 267, 74
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | DS_SHELLFONT
CAPTION "Passwort ändern"
CAPTION "Passwort ändern"
FONT 8, "MS Shell Dlg"
BEGIN
EDITTEXT IDC_EDIT_PASSWORD1,107,7,153,14,ES_AUTOHSCROLL | ES_PASSWORD
@ -126,16 +126,16 @@ BEGIN
EDITTEXT IDC_USER_NEW_NAME,107,7,153,14,ES_AUTOHSCROLL
RTEXT "Benutzername:", -1,7,10,96,8
EDITTEXT IDC_USER_NEW_FULL_NAME,107,25,153,14,ES_AUTOHSCROLL
RTEXT "Vollständiger Name:", -1,7,28,96,8
RTEXT "Vollständiger Name:", -1,7,28,96,8
EDITTEXT IDC_USER_NEW_DESCRIPTION,107,43,153,14,ES_AUTOHSCROLL
RTEXT "Beschreibung:", -1,7,46,96,8
EDITTEXT IDC_USER_NEW_PASSWORD1,107,67,153,14,ES_AUTOHSCROLL | ES_PASSWORD
RTEXT "Passwort:", -1,7,70,96,8
EDITTEXT IDC_USER_NEW_PASSWORD2,107,85,153,14,ES_AUTOHSCROLL | ES_PASSWORD
RTEXT "Passwort wiederholen:", -1,7,88,96,8
AUTOCHECKBOX "Benutzer muss das Passwort bei der ersten Anmeldung ändern",IDC_USER_NEW_FORCE_CHANGE,7,109,200,10
AUTOCHECKBOX "Benutzer kann das Passwort nicht ändern",IDC_USER_NEW_CANNOT_CHANGE,7,123,200,10,WS_DISABLED
AUTOCHECKBOX "Passwort läuft nie ab",IDC_USER_NEW_NEVER_EXPIRES,7,137,200,10,WS_DISABLED
AUTOCHECKBOX "Benutzer muss das Passwort bei der ersten Anmeldung ändern",IDC_USER_NEW_FORCE_CHANGE,7,109,230,10
AUTOCHECKBOX "Benutzer kann das Passwort nicht ändern",IDC_USER_NEW_CANNOT_CHANGE,7,123,200,10,WS_DISABLED
AUTOCHECKBOX "Passwort läuft nie ab",IDC_USER_NEW_NEVER_EXPIRES,7,137,200,10,WS_DISABLED
AUTOCHECKBOX "Konto ist deaktiviert",IDC_USER_NEW_DISABLED,7,151,200,10
DEFPUSHBUTTON "OK",IDOK,156,179,50,14,WS_DISABLED
PUSHBUTTON "Abbrechen",IDCANCEL,210,179,50,14
@ -179,9 +179,9 @@ BEGIN
END
POPUP ""
BEGIN
MENUITEM "Mitglied hinzufügen", IDM_GROUP_ADD_MEMBER, GRAYED
MENUITEM "Mitglied hinzufügen", IDM_GROUP_ADD_MEMBER, GRAYED
MENUITEM SEPARATOR
MENUITEM "Löschen", IDM_GROUP_DELETE
MENUITEM "Löschen", IDM_GROUP_DELETE
MENUITEM "Umbenennen", IDM_GROUP_RENAME
MENUITEM SEPARATOR
MENUITEM "Eigenschaften", IDM_GROUP_PROPERTIES
@ -197,9 +197,9 @@ BEGIN
END
POPUP ""
BEGIN
MENUITEM "Passwort ändern", IDM_USER_CHANGE_PASSWORD
MENUITEM "Passwort ändern", IDM_USER_CHANGE_PASSWORD
MENUITEM SEPARATOR
MENUITEM "Löschen", IDM_USER_DELETE
MENUITEM "Löschen", IDM_USER_DELETE
MENUITEM "Umbenennen", IDM_USER_RENAME
MENUITEM SEPARATOR
MENUITEM "Eigenschaften", IDM_USER_PROPERTIES

View file

@ -52,7 +52,27 @@ HRESULT
WINAPI
DllUnregisterServer(void)
{
return S_OK;
ULONG Index = 0;
LPOLESTR pStr;
HRESULT hr = S_OK;
HKEY hClass;
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"CLSID", 0, KEY_SET_VALUE, &hClass) != ERROR_SUCCESS)
return E_FAIL;
do
{
hr = StringFromCLSID(*InterfaceTable[Index].riid, &pStr);
if (FAILED(hr))
break;
RegDeleteKeyW(hClass, pStr);
CoTaskMemFree(pStr);
Index++;
}while(InterfaceTable[Index].lpfnCI != 0);
RegCloseKey(hClass);
return hr;
}
extern "C"
@ -61,7 +81,39 @@ HRESULT
WINAPI
DllRegisterServer(void)
{
return S_OK;
ULONG Index = 0;
LPOLESTR pStr;
HRESULT hr = S_OK;
HKEY hClass, hKey, hSubKey;
static LPCWSTR ModuleName = L"bdaplgin.ax";
static LPCWSTR ThreadingModel = L"Both";
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"CLSID", 0, KEY_WRITE, &hClass) != ERROR_SUCCESS)
return E_FAIL;
do
{
hr = StringFromCLSID(*InterfaceTable[Index].riid, &pStr);
if (FAILED(hr))
break;
if (RegCreateKeyExW(hClass, pStr, 0, 0, 0, KEY_WRITE, NULL, &hKey, 0) == ERROR_SUCCESS)
{
if (RegCreateKeyExW(hKey, L"InprocServer32", 0, 0, 0, KEY_WRITE, NULL, &hSubKey, 0) == ERROR_SUCCESS)
{
RegSetValueExW(hSubKey, 0, 0, REG_SZ, (const BYTE*)ModuleName, (wcslen(ModuleName) + 1) * sizeof(WCHAR));
RegSetValueExW(hSubKey, L"ThreadingModel", 0, REG_SZ, (const BYTE*)ThreadingModel, (wcslen(ThreadingModel) + 1) * sizeof(WCHAR));
RegCloseKey(hSubKey);
}
RegCloseKey(hKey);
}
CoTaskMemFree(pStr);
Index++;
}while(InterfaceTable[Index].lpfnCI != 0);
RegCloseKey(hClass);
return hr;
}
KSDDKAPI

View file

@ -3,6 +3,7 @@
<group>
<module name="bdaplgin" type="win32dll" baseaddress="${BASEADDRESS_BDAPLGIN}" installbase="system32" installname="bdaplgin.ax">
<importlibrary definition="bdaplgin.spec" />
<autoregister infsection="OleControlDlls" type="DllRegisterServer" />
<include base="bdaplgin">.</include>
<library>ntdll</library>
<library>kernel32</library>

View file

@ -34,12 +34,12 @@ public:
return m_Ref;
}
CControlNode(HANDLE hFile, ULONG NodeType, ULONG PinId) : m_Ref(0), m_hFile(hFile), m_NodeType(NodeType), m_PinId(PinId){};
CControlNode(IKsPropertySet * pProperty, ULONG NodeType, ULONG PinId) : m_Ref(0), m_pKsProperty(pProperty), m_NodeType(NodeType), m_PinId(PinId){};
virtual ~CControlNode(){};
protected:
LONG m_Ref;
HANDLE m_hFile;
IKsPropertySet * m_pKsProperty;
ULONG m_NodeType;
ULONG m_PinId;
};
@ -60,19 +60,19 @@ CControlNode::QueryInterface(
}
else if(IsEqualGUID(refiid, IID_IBDA_FrequencyFilter))
{
return CBDAFrequencyFilter_fnConstructor(m_hFile, m_NodeType, refiid, Output);
return CBDAFrequencyFilter_fnConstructor(m_pKsProperty, m_NodeType, refiid, Output);
}
else if(IsEqualGUID(refiid, IID_IBDA_SignalStatistics))
{
return CBDASignalStatistics_fnConstructor(m_hFile, m_NodeType, refiid, Output);
return CBDASignalStatistics_fnConstructor(m_pKsProperty, m_NodeType, refiid, Output);
}
else if(IsEqualGUID(refiid, IID_IBDA_LNBInfo))
{
return CBDALNBInfo_fnConstructor(m_hFile, m_NodeType, refiid, Output);
return CBDALNBInfo_fnConstructor(m_pKsProperty, m_NodeType, refiid, Output);
}
else if(IsEqualGUID(refiid, IID_IBDA_DigitalDemodulator))
{
return CBDADigitalDemodulator_fnConstructor(m_hFile, m_NodeType, refiid, Output);
return CBDADigitalDemodulator_fnConstructor(m_pKsProperty, m_NodeType, refiid, Output);
}
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[MAX_PATH];
@ -99,8 +99,7 @@ CControlNode_fnConstructor(
WCHAR Buffer[100];
HRESULT hr;
IPin * pPin = NULL;
IKsObject * pObject = NULL;
HANDLE hFile = INVALID_HANDLE_VALUE;
IKsPropertySet * pProperty;
// store pin id
swprintf(Buffer, L"%u", PinId);
@ -117,26 +116,21 @@ CControlNode_fnConstructor(
return hr;
}
// query IKsObject interface
hr = pPin->QueryInterface(IID_IKsObject, (void**)&pObject);
// query for IKsPropertySet interface
hr = pPin->QueryInterface(IID_IKsPropertySet, (void**)&pProperty);
if (FAILED(hr))
return hr;
#ifdef BDAPLGIN_TRACE
swprintf(Buffer, L"CControlNode_fnConstructor get IID_IKsObject status %lx\n", hr);
OutputDebugStringW(Buffer);
#endif
if (SUCCEEDED(hr))
{
// get pin handle
hFile = pObject->KsGetObjectHandle();
// release IKsObject interface
pObject->Release();
}
// release IPin interface
pPin->Release();
// construct device control
CControlNode * handler = new CControlNode(hFile, NodeType, PinId);
CControlNode * handler = new CControlNode(pProperty, NodeType, PinId);
#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CControlNode_fnConstructor\n");

View file

@ -472,8 +472,8 @@ CBDADeviceControl::GetControlNode(ULONG ulInputPinId, ULONG ulOutputPinId, ULONG
hr = KsSynchronousDeviceControl(m_Handle, IOCTL_KS_PROPERTY, (PVOID)&Property, sizeof(KSP_BDA_NODE_PIN) + sizeof(ULONG), &PinId, sizeof(ULONG), &BytesReturned);
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDADeviceControl::GetControlNode: hr %lx, BytesReturned %lu PinId %lu\n", hr, BytesReturned, PinId);
WCHAR Buffer[200];
swprintf(Buffer, L"CBDADeviceControl::GetControlNode: hr %lx, BytesReturned %lu PinId %lu ulInputPinId %lu ulOutputPinId %lu ulNodeType %lu\n", hr, BytesReturned, PinId, ulInputPinId, ulOutputPinId, ulNodeType);
OutputDebugStringW(Buffer);
#endif

View file

@ -50,12 +50,12 @@ public:
HRESULT STDMETHODCALLTYPE put_SpectralInversion(SpectralInversion *pSpectralInversion);
HRESULT STDMETHODCALLTYPE get_SpectralInversion(SpectralInversion *pSpectralInversion);
CBDADigitalDemodulator(HANDLE hFile, ULONG NodeId) : m_Ref(0), m_hFile(hFile), m_NodeId(NodeId){};
CBDADigitalDemodulator(IKsPropertySet * pProperty, ULONG NodeId) : m_Ref(0), m_pProperty(pProperty), m_NodeId(NodeId){};
~CBDADigitalDemodulator(){};
protected:
LONG m_Ref;
HANDLE m_hFile;
IKsPropertySet * m_pProperty;
ULONG m_NodeId;
};
@ -88,6 +88,7 @@ CBDADigitalDemodulator::QueryInterface(
swprintf(Buffer, L"CBDADigitalDemodulator::QueryInterface: NoInterface for %s", lpstr);
OutputDebugStringW(Buffer);
CoTaskMemFree(lpstr);
DebugBreak();
#endif
return E_NOINTERFACE;
@ -100,20 +101,17 @@ CBDADigitalDemodulator::put_ModulationType(ModulationType *pModulationType)
KSP_NODE Node;
HRESULT hr;
ULONG BytesReturned;
// setup request
Node.Property.Set = KSPROPSETID_BdaDigitalDemodulator;
Node.Property.Id = KSPROPERTY_BDA_MODULATION_TYPE;
Node.Property.Flags = KSPROPERTY_TYPE_TOPOLOGY | KSPROPERTY_TYPE_SET;
Node.NodeId = m_NodeId;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), pModulationType, sizeof(ModulationType), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaDigitalDemodulator, KSPROPERTY_BDA_MODULATION_TYPE, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), pModulationType, sizeof(ModulationType));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDADigitalDemodulator::put_ModulationType: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
swprintf(Buffer, L"CBDADigitalDemodulator::put_ModulationType: pModulationType %lu hr %lx\n", *pModulationType, hr);
OutputDebugStringW(Buffer);
#endif
@ -133,20 +131,18 @@ CBDADigitalDemodulator::put_InnerFECMethod(FECMethod *pFECMethod)
{
KSP_NODE Node;
HRESULT hr;
ULONG BytesReturned;
// setup request
Node.Property.Set = KSPROPSETID_BdaDigitalDemodulator;
Node.Property.Id = KSPROPERTY_BDA_INNER_FEC_TYPE;
Node.Property.Flags = KSPROPERTY_TYPE_TOPOLOGY | KSPROPERTY_TYPE_SET;
Node.NodeId = m_NodeId;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), pFECMethod, sizeof(FECMethod), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaDigitalDemodulator, KSPROPERTY_BDA_INNER_FEC_TYPE, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), pFECMethod, sizeof(FECMethod));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDADigitalDemodulator::put_InnerFECMethod: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
swprintf(Buffer, L"CBDADigitalDemodulator::put_InnerFECMethod: pFECMethod %lu hr %lx\n", *pFECMethod, hr);
OutputDebugStringW(Buffer);
#endif
@ -167,20 +163,16 @@ CBDADigitalDemodulator::put_InnerFECRate(BinaryConvolutionCodeRate *pFECRate)
KSP_NODE Node;
HRESULT hr;
ULONG BytesReturned;
// setup request
Node.Property.Set = KSPROPSETID_BdaDigitalDemodulator;
Node.Property.Id = KSPROPERTY_BDA_INNER_FEC_RATE;
Node.Property.Flags = KSPROPERTY_TYPE_TOPOLOGY | KSPROPERTY_TYPE_SET;
Node.NodeId = m_NodeId;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), pFECRate, sizeof(BinaryConvolutionCodeRate), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaDigitalDemodulator, KSPROPERTY_BDA_INNER_FEC_RATE, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), pFECRate, sizeof(BinaryConvolutionCodeRate));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDADigitalDemodulator::put_InnerFECRate: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
swprintf(Buffer, L"CBDADigitalDemodulator::put_InnerFECRate: pFECRate %lu hr %lx\n", *pFECRate, hr);
OutputDebugStringW(Buffer);
#endif
@ -200,20 +192,17 @@ CBDADigitalDemodulator::put_OuterFECMethod(FECMethod *pFECMethod)
{
KSP_NODE Node;
HRESULT hr;
ULONG BytesReturned;
// setup request
Node.Property.Set = KSPROPSETID_BdaDigitalDemodulator;
Node.Property.Id = KSPROPERTY_BDA_OUTER_FEC_TYPE;
Node.Property.Flags = KSPROPERTY_TYPE_TOPOLOGY | KSPROPERTY_TYPE_SET;
Node.NodeId = m_NodeId;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), pFECMethod, sizeof(FECMethod), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaDigitalDemodulator, KSPROPERTY_BDA_OUTER_FEC_TYPE, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), pFECMethod, sizeof(FECMethod));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDADigitalDemodulator::put_OuterFECMethod: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
swprintf(Buffer, L"CBDADigitalDemodulator::put_OuterFECMethod: pFECMethod %lu hr %lx\n", *pFECMethod, hr);
OutputDebugStringW(Buffer);
#endif
@ -234,20 +223,16 @@ CBDADigitalDemodulator::put_OuterFECRate(BinaryConvolutionCodeRate *pFECRate)
KSP_NODE Node;
HRESULT hr;
ULONG BytesReturned;
// setup request
Node.Property.Set = KSPROPSETID_BdaDigitalDemodulator;
Node.Property.Id = KSPROPERTY_BDA_OUTER_FEC_RATE;
Node.Property.Flags = KSPROPERTY_TYPE_TOPOLOGY | KSPROPERTY_TYPE_SET;
Node.NodeId = m_NodeId;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), pFECRate, sizeof(BinaryConvolutionCodeRate), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaDigitalDemodulator, KSPROPERTY_BDA_OUTER_FEC_RATE, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), pFECRate, sizeof(BinaryConvolutionCodeRate));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDADigitalDemodulator::put_OuterFECRate: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
swprintf(Buffer, L"CBDADigitalDemodulator::put_OuterFECRate: pFECRate %lu hr %lx\n", *pFECRate, hr);
OutputDebugStringW(Buffer);
#endif
@ -267,20 +252,17 @@ CBDADigitalDemodulator::put_SymbolRate(ULONG *pSymbolRate)
{
KSP_NODE Node;
HRESULT hr;
ULONG BytesReturned;
// setup request
Node.Property.Set = KSPROPSETID_BdaDigitalDemodulator;
Node.Property.Id = KSPROPERTY_BDA_SYMBOL_RATE;
Node.Property.Flags = KSPROPERTY_TYPE_TOPOLOGY | KSPROPERTY_TYPE_SET;
Node.NodeId = m_NodeId;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), pSymbolRate, sizeof(ULONG), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaDigitalDemodulator, KSPROPERTY_BDA_SYMBOL_RATE, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), pSymbolRate, sizeof(ULONG));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDADigitalDemodulator::put_SymbolRate: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
swprintf(Buffer, L"CBDADigitalDemodulator::put_SymbolRate: pSymbolRate %lu hr %lx\n", *pSymbolRate, hr);
OutputDebugStringW(Buffer);
#endif
@ -300,20 +282,17 @@ CBDADigitalDemodulator::put_SpectralInversion(SpectralInversion *pSpectralInvers
{
KSP_NODE Node;
HRESULT hr;
ULONG BytesReturned;
// setup request
Node.Property.Set = KSPROPSETID_BdaDigitalDemodulator;
Node.Property.Id = KSPROPERTY_BDA_SPECTRAL_INVERSION;
Node.Property.Flags = KSPROPERTY_TYPE_TOPOLOGY | KSPROPERTY_TYPE_SET;
Node.NodeId = m_NodeId;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), pSpectralInversion, sizeof(SpectralInversion), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaDigitalDemodulator, KSPROPERTY_BDA_SPECTRAL_INVERSION, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), pSpectralInversion, sizeof(SpectralInversion));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDADigitalDemodulator::put_SpectralInversion: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
swprintf(Buffer, L"CBDADigitalDemodulator::put_SpectralInversion: pSpectralInversion %lu hr %lx\n", *pSpectralInversion, hr);
OutputDebugStringW(Buffer);
#endif
@ -331,13 +310,13 @@ CBDADigitalDemodulator::get_SpectralInversion(SpectralInversion *pSpectralInvers
HRESULT
WINAPI
CBDADigitalDemodulator_fnConstructor(
HANDLE hFile,
IKsPropertySet * pProperty,
ULONG NodeId,
REFIID riid,
LPVOID * ppv)
{
// construct device control
CBDADigitalDemodulator * handler = new CBDADigitalDemodulator(hFile, NodeId);
CBDADigitalDemodulator * handler = new CBDADigitalDemodulator(pProperty, NodeId);
#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CBDADigitalDemodulator_fnConstructor\n");

View file

@ -48,12 +48,12 @@ public:
HRESULT STDMETHODCALLTYPE put_FrequencyMultiplier(ULONG ulMultiplier);
HRESULT STDMETHODCALLTYPE get_FrequencyMultiplier(ULONG *pulMultiplier);
CBDAFrequencyFilter(HANDLE hFile, ULONG NodeId) : m_Ref(0), m_hFile(hFile), m_NodeId(NodeId){};
CBDAFrequencyFilter(IKsPropertySet * pProperty, ULONG NodeId) : m_Ref(0), m_pProperty(pProperty), m_NodeId(NodeId){};
virtual ~CBDAFrequencyFilter(){};
protected:
LONG m_Ref;
HANDLE m_hFile;
IKsPropertySet * m_pProperty;
ULONG m_NodeId;
};
@ -86,6 +86,7 @@ CBDAFrequencyFilter::QueryInterface(
swprintf(Buffer, L"CControlNode::QueryInterface: NoInterface for %s", lpstr);
OutputDebugStringW(Buffer);
CoTaskMemFree(lpstr);
DebugBreak();
#endif
return E_NOINTERFACE;
@ -112,20 +113,16 @@ CBDAFrequencyFilter::put_Frequency(ULONG ulFrequency)
KSP_NODE Node;
HRESULT hr;
ULONG BytesReturned;
// setup request
Node.Property.Set = KSPROPSETID_BdaFrequencyFilter;
Node.Property.Id = KSPROPERTY_BDA_RF_TUNER_FREQUENCY;
Node.Property.Flags = KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_TOPOLOGY;
Node.NodeId = m_NodeId;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &ulFrequency, sizeof(ULONG), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaFrequencyFilter, KSPROPERTY_BDA_RF_TUNER_FREQUENCY, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &ulFrequency, sizeof(ULONG));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDAFrequencyFilter::put_Frequency: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
swprintf(Buffer, L"CBDAFrequencyFilter::put_Frequency: m_NodeId %lu ulFrequency %lu hr %lx\n", m_NodeId, ulFrequency, hr);
OutputDebugStringW(Buffer);
#endif
@ -145,20 +142,17 @@ CBDAFrequencyFilter::put_Polarity(Polarisation Polarity)
{
KSP_NODE Node;
HRESULT hr;
ULONG BytesReturned;
// setup request
Node.Property.Set = KSPROPSETID_BdaFrequencyFilter;
Node.Property.Id = KSPROPERTY_BDA_RF_TUNER_POLARITY;
Node.Property.Flags = KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_TOPOLOGY;
Node.NodeId = m_NodeId;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &Polarity, sizeof(Polarisation), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaFrequencyFilter, KSPROPERTY_BDA_RF_TUNER_POLARITY, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &Polarity, sizeof(Polarisation));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDAFrequencyFilter::put_Polarity: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
swprintf(Buffer, L"CBDAFrequencyFilter::put_Polarity: m_NodeId %lu Polarity %lu hr %lx\n", m_NodeId, Polarity, hr);
OutputDebugStringW(Buffer);
#endif
@ -178,20 +172,17 @@ CBDAFrequencyFilter::put_Range(ULONG ulRange)
{
KSP_NODE Node;
HRESULT hr;
ULONG BytesReturned;
// setup request
Node.Property.Set = KSPROPSETID_BdaFrequencyFilter;
Node.Property.Id = KSPROPERTY_BDA_RF_TUNER_RANGE;
Node.Property.Flags = KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_TOPOLOGY;
Node.NodeId = m_NodeId;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &ulRange, sizeof(ULONG), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaFrequencyFilter, KSPROPERTY_BDA_RF_TUNER_RANGE, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &ulRange, sizeof(ULONG));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDAFrequencyFilter::put_Polarity: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
swprintf(Buffer, L"CBDAFrequencyFilter::put_Range: m_NodeId %lu ulRange %lu hr %lx\n", m_NodeId, ulRange, hr);
OutputDebugStringW(Buffer);
#endif
@ -211,20 +202,17 @@ CBDAFrequencyFilter::put_Bandwidth(ULONG ulBandwidth)
{
KSP_NODE Node;
HRESULT hr;
ULONG BytesReturned;
// setup request
Node.Property.Set = KSPROPSETID_BdaFrequencyFilter;
Node.Property.Id = KSPROPERTY_BDA_RF_TUNER_BANDWIDTH;
Node.Property.Flags = KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_TOPOLOGY;
Node.NodeId = m_NodeId;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &ulBandwidth, sizeof(ULONG), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaFrequencyFilter, KSPROPERTY_BDA_RF_TUNER_BANDWIDTH, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &ulBandwidth, sizeof(ULONG));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDAFrequencyFilter::put_Bandwidth: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
swprintf(Buffer, L"CBDAFrequencyFilter::put_Bandwidth: m_NodeId %lu ulBandwidth %lu hr %lx\n", m_NodeId, ulBandwidth, hr);
OutputDebugStringW(Buffer);
#endif
@ -243,20 +231,17 @@ CBDAFrequencyFilter::put_FrequencyMultiplier(ULONG ulMultiplier)
{
KSP_NODE Node;
HRESULT hr;
ULONG BytesReturned;
// setup request
Node.Property.Set = KSPROPSETID_BdaFrequencyFilter;
Node.Property.Id = KSPROPERTY_BDA_RF_TUNER_FREQUENCY_MULTIPLIER;
Node.Property.Flags = KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_TOPOLOGY;
Node.NodeId = m_NodeId;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &ulMultiplier, sizeof(ULONG), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaFrequencyFilter, KSPROPERTY_BDA_RF_TUNER_FREQUENCY_MULTIPLIER, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &ulMultiplier, sizeof(ULONG));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDAFrequencyFilter::put_FrequencyMultiplier: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
swprintf(Buffer, L"CBDAFrequencyFilter::put_FrequencyMultiplier: m_NodeId %lu ulMultiplier %lu hr %lx\n", m_NodeId, ulMultiplier, hr);
OutputDebugStringW(Buffer);
#endif
@ -273,13 +258,13 @@ CBDAFrequencyFilter::get_FrequencyMultiplier(ULONG *pulMultiplier)
HRESULT
WINAPI
CBDAFrequencyFilter_fnConstructor(
HANDLE hFile,
IKsPropertySet* pProperty,
ULONG NodeId,
REFIID riid,
LPVOID * ppv)
{
// construct device control
CBDAFrequencyFilter * handler = new CBDAFrequencyFilter(hFile, NodeId);
CBDAFrequencyFilter * handler = new CBDAFrequencyFilter(pProperty, NodeId);
#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CBDAFrequencyFilter_fnConstructor\n");

View file

@ -43,12 +43,12 @@ public:
HRESULT STDMETHODCALLTYPE put_HighLowSwitchFrequency(ULONG ulSwitchFrequency);
HRESULT STDMETHODCALLTYPE get_HighLowSwitchFrequency(ULONG *pulSwitchFrequency);
CBDALNBInfo(HANDLE hFile, ULONG NodeId) : m_Ref(0), m_hFile(hFile), m_NodeId(NodeId){};
CBDALNBInfo(IKsPropertySet *pProperty, ULONG NodeId) : m_Ref(0), m_pProperty(pProperty), m_NodeId(NodeId){};
~CBDALNBInfo(){};
protected:
LONG m_Ref;
HANDLE m_hFile;
IKsPropertySet * m_pProperty;
ULONG m_NodeId;
};
@ -92,20 +92,17 @@ CBDALNBInfo::put_LocalOscilatorFrequencyLowBand(ULONG ulLOFLow)
{
KSP_NODE Node;
HRESULT hr;
ULONG BytesReturned;
// setup request
Node.Property.Set = KSPROPSETID_BdaLNBInfo;
Node.Property.Id = KSPROPERTY_BDA_LNB_LOF_LOW_BAND;
Node.Property.Flags = KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_TOPOLOGY;
Node.NodeId = m_NodeId;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &ulLOFLow, sizeof(ULONG), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaLNBInfo, KSPROPERTY_BDA_LNB_LOF_LOW_BAND, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &ulLOFLow, sizeof(LONG));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDALNBInfo::put_LocalOscilatorFrequencyLowBand: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
swprintf(Buffer, L"CBDALNBInfo::put_LocalOscilatorFrequencyLowBand: m_NodeId %lu ulLOFLow %lu hr %lx\n", m_NodeId, ulLOFLow, hr);
OutputDebugStringW(Buffer);
#endif
@ -125,20 +122,17 @@ CBDALNBInfo::put_LocalOscilatorFrequencyHighBand(ULONG ulLOFHigh)
{
KSP_NODE Node;
HRESULT hr;
ULONG BytesReturned;
// setup request
Node.Property.Set = KSPROPSETID_BdaLNBInfo;
Node.Property.Id = KSPROPERTY_BDA_LNB_LOF_HIGH_BAND;
Node.Property.Flags = KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_TOPOLOGY;
Node.NodeId = m_NodeId;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &ulLOFHigh, sizeof(ULONG), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaLNBInfo, KSPROPERTY_BDA_LNB_LOF_HIGH_BAND, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &ulLOFHigh, sizeof(ULONG));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDALNBInfo::put_LocalOscilatorFrequencyHighBand: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
swprintf(Buffer, L"CBDALNBInfo::put_LocalOscilatorFrequencyHighBand: m_NodeId %lu ulLOFHigh %lu hr %lx\n", m_NodeId, ulLOFHigh, hr);
OutputDebugStringW(Buffer);
#endif
@ -158,20 +152,17 @@ CBDALNBInfo::put_HighLowSwitchFrequency(ULONG ulSwitchFrequency)
{
KSP_NODE Node;
HRESULT hr;
ULONG BytesReturned;
// setup request
Node.Property.Set = KSPROPSETID_BdaLNBInfo;
Node.Property.Id = KSPROPERTY_BDA_LNB_SWITCH_FREQUENCY;
Node.Property.Flags = KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_TOPOLOGY;
Node.NodeId = m_NodeId;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &ulSwitchFrequency, sizeof(ULONG), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaLNBInfo, KSPROPERTY_BDA_LNB_SWITCH_FREQUENCY, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &ulSwitchFrequency, sizeof(ULONG));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDALNBInfo::put_HighLowSwitchFrequency: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
swprintf(Buffer, L"CBDALNBInfo::put_HighLowSwitchFrequency: m_NodeId %lu ulSwitchFrequency %lu hr %lx\n", m_NodeId, ulSwitchFrequency, hr);
OutputDebugStringW(Buffer);
#endif
@ -188,13 +179,13 @@ CBDALNBInfo::get_HighLowSwitchFrequency(ULONG *pulSwitchFrequency)
HRESULT
WINAPI
CBDALNBInfo_fnConstructor(
HANDLE hFile,
IKsPropertySet *pProperty,
ULONG NodeId,
REFIID riid,
LPVOID * ppv)
{
// construct device control
CBDALNBInfo * handler = new CBDALNBInfo(hFile, NodeId);
CBDALNBInfo * handler = new CBDALNBInfo(pProperty, NodeId);
#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CBDALNBInfo_fnConstructor\n");

View file

@ -76,7 +76,7 @@ CBDAPinControl::QueryInterface(
reinterpret_cast<IBDA_PinControl*>(*Output)->AddRef();
return NOERROR;
}
DebugBreak();
return E_NOINTERFACE;
}
//-------------------------------------------------------------------
@ -252,6 +252,9 @@ CBDAPinControl_fnConstructor(
if (!pUnkOuter)
return E_POINTER;
OutputDebugStringW(L"CBDAPinControl_fnConstructor\n");
//DebugBreak();
// query for IKsObject interface
hr = pUnkOuter->QueryInterface(IID_IKsObject, (void**)&pObject);
@ -353,6 +356,13 @@ CBDAPinControl_fnConstructor(
hr = E_UNEXPECTED;
}
}
else
{
WCHAR Buffer[100];
swprintf(Buffer, L"CBDAPinControl_fnConstructor failed to register filter with %lx\n", hr);
OutputDebugStringW(Buffer);
DebugBreak();
}
}
}
}

View file

@ -1,7 +1,7 @@
#ifndef PRECOMP_H__
#define PRECOMP_H__
//#define BDAPLGIN_TRACE
#define BDAPLGIN_TRACE
#define BUILDING_KS
#define _KSDDK_
#include <dshow.h>
@ -67,7 +67,7 @@ CControlNode_fnConstructor(
HRESULT
WINAPI
CBDAFrequencyFilter_fnConstructor(
HANDLE hFile,
IKsPropertySet * pProperty,
ULONG NodeId,
REFIID riid,
LPVOID * ppv);
@ -77,7 +77,7 @@ CBDAFrequencyFilter_fnConstructor(
HRESULT
WINAPI
CBDASignalStatistics_fnConstructor(
HANDLE hFile,
IKsPropertySet * pProperty,
ULONG NodeId,
REFIID riid,
LPVOID * ppv);
@ -87,7 +87,7 @@ CBDASignalStatistics_fnConstructor(
HRESULT
WINAPI
CBDALNBInfo_fnConstructor(
HANDLE hFile,
IKsPropertySet * pProperty,
ULONG NodeId,
REFIID riid,
LPVOID * ppv);
@ -96,7 +96,7 @@ CBDALNBInfo_fnConstructor(
HRESULT
WINAPI
CBDADigitalDemodulator_fnConstructor(
HANDLE hFile,
IKsPropertySet * pProperty,
ULONG NodeId,
REFIID riid,
LPVOID * ppv);

View file

@ -47,12 +47,12 @@ public:
HRESULT STDMETHODCALLTYPE put_SampleTime(LONG lmsSampleTime);
HRESULT STDMETHODCALLTYPE get_SampleTime(LONG *plmsSampleTime);
CBDASignalStatistics(HANDLE hFile, ULONG NodeId) : m_Ref(0), m_hFile(hFile), m_NodeId(NodeId){};
CBDASignalStatistics(IKsPropertySet * pProperty, ULONG NodeId) : m_Ref(0), m_pProperty(pProperty), m_NodeId(NodeId){};
~CBDASignalStatistics(){};
protected:
LONG m_Ref;
HANDLE m_hFile;
IKsPropertySet * m_pProperty;
ULONG m_NodeId;
};
@ -77,7 +77,6 @@ CBDASignalStatistics::QueryInterface(
reinterpret_cast<IBDA_SignalStatistics*>(*Output)->AddRef();
return NOERROR;
}
return E_NOINTERFACE;
}
@ -97,13 +96,13 @@ CBDASignalStatistics::get_SignalStrength(LONG *plDbStrength)
ULONG BytesReturned;
// setup request
Node.Property.Set = KSPROPSETID_BdaSignalStats;
Node.Property.Id = KSPROPERTY_BDA_SIGNAL_STRENGTH;
Node.Property.Flags = KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_TOPOLOGY;
Node.NodeId = (ULONG)-1;
Node.Reserved = 0;
assert(m_pProperty);
hr = m_pProperty->Get(KSPROPSETID_BdaSignalStats, KSPROPERTY_BDA_SIGNAL_STRENGTH, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), plDbStrength, sizeof(LONG), &BytesReturned);
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), plDbStrength, sizeof(LONG), &BytesReturned);
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
@ -130,13 +129,11 @@ CBDASignalStatistics::get_SignalQuality(LONG *plPercentQuality)
ULONG BytesReturned;
// setup request
Node.Property.Set = KSPROPSETID_BdaSignalStats;
Node.Property.Id = KSPROPERTY_BDA_SIGNAL_QUALITY;
Node.Property.Flags = KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_TOPOLOGY;
Node.NodeId = (ULONG)-1;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), plPercentQuality, sizeof(LONG), &BytesReturned);
hr = m_pProperty->Get(KSPROPSETID_BdaSignalStats, KSPROPERTY_BDA_SIGNAL_QUALITY, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), plPercentQuality, sizeof(LONG), &BytesReturned);
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
@ -164,13 +161,12 @@ CBDASignalStatistics::get_SignalPresent(BOOLEAN *pfPresent)
ULONG BytesReturned;
// setup request
Node.Property.Set = KSPROPSETID_BdaSignalStats;
Node.Property.Id = KSPROPERTY_BDA_SIGNAL_PRESENT;
Node.Property.Flags = KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_TOPOLOGY;
Node.NodeId = (ULONG)-1;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &Present, sizeof(ULONG), &BytesReturned);
hr = m_pProperty->Get(KSPROPSETID_BdaSignalStats, KSPROPERTY_BDA_SIGNAL_PRESENT, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &Present, sizeof(ULONG), &BytesReturned);
// store result
*pfPresent = Present;
@ -200,13 +196,12 @@ CBDASignalStatistics::get_SignalLocked(BOOLEAN *pfLocked)
ULONG BytesReturned;
// setup request
Node.Property.Set = KSPROPSETID_BdaSignalStats;
Node.Property.Id = KSPROPERTY_BDA_SIGNAL_LOCKED;
Node.Property.Flags = KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_TOPOLOGY;
Node.NodeId = (ULONG)-1;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &Locked, sizeof(ULONG), &BytesReturned);
hr = m_pProperty->Get(KSPROPSETID_BdaSignalStats, KSPROPERTY_BDA_SIGNAL_LOCKED, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &Locked, sizeof(ULONG), &BytesReturned);
*pfLocked = Locked;
#ifdef BDAPLGIN_TRACE
@ -224,20 +219,17 @@ CBDASignalStatistics::put_SampleTime(LONG lmsSampleTime)
{
KSP_NODE Node;
HRESULT hr;
ULONG BytesReturned;
// setup request
Node.Property.Set = KSPROPSETID_BdaSignalStats;
Node.Property.Id = KSPROPERTY_BDA_SAMPLE_TIME;
Node.Property.Flags = KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_TOPOLOGY;
Node.NodeId = (ULONG)-1;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &lmsSampleTime, sizeof(LONG), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaSignalStats, KSPROPERTY_BDA_SAMPLE_TIME, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &lmsSampleTime, sizeof(LONG));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDASignalStatistics::put_SampleTime: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
swprintf(Buffer, L"CBDASignalStatistics::put_SampleTime: m_NodeId %lu hr %lx\n", m_NodeId, hr);
OutputDebugStringW(Buffer);
#endif
@ -253,13 +245,11 @@ CBDASignalStatistics::get_SampleTime(LONG *plmsSampleTime)
ULONG BytesReturned;
// setup request
Node.Property.Set = KSPROPSETID_BdaSignalStats;
Node.Property.Id = KSPROPERTY_BDA_SAMPLE_TIME;
Node.Property.Flags = KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_TOPOLOGY;
Node.NodeId = (ULONG)-1;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), plmsSampleTime, sizeof(LONG), &BytesReturned);
hr = m_pProperty->Get(KSPROPSETID_BdaSignalStats, KSPROPERTY_BDA_SAMPLE_TIME, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), plmsSampleTime, sizeof(LONG), &BytesReturned);
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
@ -273,13 +263,13 @@ CBDASignalStatistics::get_SampleTime(LONG *plmsSampleTime)
HRESULT
WINAPI
CBDASignalStatistics_fnConstructor(
HANDLE hFile,
IKsPropertySet * pProperty,
ULONG NodeId,
REFIID riid,
LPVOID * ppv)
{
// construct device control
CBDASignalStatistics * handler = new CBDASignalStatistics(hFile, NodeId);
CBDASignalStatistics * handler = new CBDASignalStatistics(pProperty, NodeId);
#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CBDASignalStatistics_fnConstructor\n");

View file

@ -48,6 +48,7 @@
#include "wine/debug.h"
#include "mmddk.h"
#include <regstr.h>
WINE_DEFAULT_DEBUG_CHANNEL(devenum);
@ -124,6 +125,7 @@ HRESULT WINAPI DEVENUM_ICreateDevEnum_CreateClassEnumerator(
WCHAR wszRegKey[MAX_PATH];
HKEY hkey;
HKEY hbasekey;
BOOL bInterface = FALSE;
CreateDevEnumImpl *This = (CreateDevEnumImpl *)iface;
TRACE("(%p)->(%s, %p, %lx)\n\tDeviceClass:\t%s\n", This, debugstr_guid(clsidDeviceClass), ppEnumMoniker, dwFlags, debugstr_guid(clsidDeviceClass));
@ -174,12 +176,23 @@ HRESULT WINAPI DEVENUM_ICreateDevEnum_CreateClassEnumerator(
}
else
{
FIXME("Category %s not found\n", debugstr_guid(clsidDeviceClass));
return S_FALSE;
wcscpy(wszRegKey, REGSTR_PATH_DEVICE_CLASSES);
wcscat(wszRegKey, L"\\");
if (!StringFromGUID2(clsidDeviceClass, wszRegKey + wcslen(wszRegKey), MAX_PATH - CLSID_STR_LEN))
return E_OUTOFMEMORY;
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, wszRegKey, 0, KEY_READ, &hkey) != ERROR_SUCCESS)
{
FIXME("Category %s not found\n", debugstr_guid(clsidDeviceClass));
return S_FALSE;
}
bInterface = TRUE;
}
}
return DEVENUM_IEnumMoniker_Construct(hkey, ppEnumMoniker);
return DEVENUM_IEnumMoniker_Construct(hkey, ppEnumMoniker, bInterface);
}
/**********************************************************************

View file

@ -71,6 +71,7 @@ typedef struct
LONG ref;
DWORD index;
HKEY hkey;
BOOL bInterface;
} EnumMonikerImpl;
typedef struct
@ -79,10 +80,11 @@ typedef struct
LONG ref;
HKEY hkey;
BOOL bInterface;
} MediaCatMoniker;
MediaCatMoniker * DEVENUM_IMediaCatMoniker_Construct(void);
HRESULT DEVENUM_IEnumMoniker_Construct(HKEY hkey, IEnumMoniker ** ppEnumMoniker);
HRESULT DEVENUM_IEnumMoniker_Construct(HKEY hkey, IEnumMoniker ** ppEnumMoniker, BOOL bInterface);
HRESULT WINAPI DEVENUM_ICreateDevEnum_CreateClassEnumerator(
ICreateDevEnum * iface,
REFCLSID clsidDeviceClass,

View file

@ -42,6 +42,7 @@ typedef struct
IPropertyBagVtbl *lpVtbl;
LONG ref;
HKEY hkey;
BOOL bInterface;
} RegPropBagImpl;
@ -108,13 +109,31 @@ static HRESULT WINAPI DEVENUM_IPropertyBag_Read(
RegPropBagImpl *This = (RegPropBagImpl *)iface;
HRESULT res = S_OK;
LONG reswin32;
WCHAR buffer[MAX_PATH];
HKEY hkey;
LPCOLESTR pszName;
TRACE("(%p)->(%s, %p, %p)\n", This, debugstr_w(pszPropName), pVar, pErrorLog);
if (!pszPropName || !pVar)
return E_POINTER;
reswin32 = RegQueryValueExW(This->hkey, pszPropName, NULL, NULL, NULL, &received);
hkey = This->hkey;
pszName = pszPropName;
if (This->bInterface)
{
buffer[0] = 0;
received = sizeof(buffer)/sizeof(WCHAR);
reswin32 = RegEnumKeyEx(This->hkey, 0, buffer, &received, NULL, NULL, NULL, NULL);
reswin32 = RegOpenKeyExW(This->hkey, buffer, 0, KEY_READ, &hkey);
if (!wcsicmp(pszPropName, L"DevicePath"))
pszName = L"SymbolicLink";
}
reswin32 = RegQueryValueExW(hkey, pszName, NULL, NULL, NULL, &received);
res = HRESULT_FROM_WIN32(reswin32);
if (SUCCEEDED(res))
@ -122,7 +141,7 @@ static HRESULT WINAPI DEVENUM_IPropertyBag_Read(
pData = HeapAlloc(GetProcessHeap(), 0, received);
/* work around a GCC bug that occurs here unless we use the reswin32 variable as well */
reswin32 = RegQueryValueExW(This->hkey, pszPropName, NULL, &type, pData, &received);
reswin32 = RegQueryValueExW(hkey, pszName, NULL, &type, pData, &received);
res = HRESULT_FROM_WIN32(reswin32);
}
@ -201,6 +220,9 @@ static HRESULT WINAPI DEVENUM_IPropertyBag_Read(
if (pData)
HeapFree(GetProcessHeap(), 0, pData);
if (This->bInterface)
RegCloseKey(hkey);
TRACE("<- %lx\n", res);
return res;
}
@ -270,7 +292,7 @@ static IPropertyBagVtbl IPropertyBag_Vtbl =
DEVENUM_IPropertyBag_Write
};
static HRESULT DEVENUM_IPropertyBag_Construct(HANDLE hkey, IPropertyBag **ppBag)
static HRESULT DEVENUM_IPropertyBag_Construct(HANDLE hkey, IPropertyBag **ppBag, BOOL bInterface)
{
RegPropBagImpl * rpb = CoTaskMemAlloc(sizeof(RegPropBagImpl));
if (!rpb)
@ -278,6 +300,8 @@ static HRESULT DEVENUM_IPropertyBag_Construct(HANDLE hkey, IPropertyBag **ppBag)
rpb->lpVtbl = &IPropertyBag_Vtbl;
rpb->ref = 1;
rpb->hkey = hkey;
rpb->bInterface = bInterface;
*ppBag = (IPropertyBag*)rpb;
DEVENUM_LockModule();
return S_OK;
@ -393,6 +417,7 @@ static HRESULT WINAPI DEVENUM_IMediaCatMoniker_BindToObject(
{
IUnknown * pObj = NULL;
IPropertyBag * pProp = NULL;
IPersistPropertyBag * pBag;
CLSID clsID;
VARIANT var;
HRESULT res = E_FAIL;
@ -430,6 +455,15 @@ static HRESULT WINAPI DEVENUM_IMediaCatMoniker_BindToObject(
if (pObj!=NULL)
{
if (This->bInterface)
{
res = IUnknown_QueryInterface(pObj, &IID_IPersistPropertyBag, (void**)&pBag);
if (SUCCEEDED(res))
{
res = IPersistPropertyBag_Load(pBag, pProp, NULL); /* FIXME */
IPersistPropertyBag_Release(pBag);
}
}
/* get the requested interface from the loaded class */
res= IUnknown_QueryInterface(pObj,riidResult,ppvResult);
}
@ -463,7 +497,7 @@ static HRESULT WINAPI DEVENUM_IMediaCatMoniker_BindToStorage(
{
HANDLE hkey;
DuplicateHandle(GetCurrentProcess(), This->hkey, GetCurrentProcess(), &hkey, 0, 0, DUPLICATE_SAME_ACCESS);
return DEVENUM_IPropertyBag_Construct(hkey, (IPropertyBag**)ppvObj);
return DEVENUM_IPropertyBag_Construct(hkey, (IPropertyBag**)ppvObj, This->bInterface);
}
return MK_E_NOSTORAGE;
@ -679,6 +713,7 @@ MediaCatMoniker * DEVENUM_IMediaCatMoniker_Construct()
pMoniker->lpVtbl = &IMoniker_Vtbl;
pMoniker->ref = 0;
pMoniker->hkey = NULL;
pMoniker->bInterface = FALSE;
DEVENUM_IMediaCatMoniker_AddRef((LPMONIKER)pMoniker);
@ -764,6 +799,7 @@ static HRESULT WINAPI DEVENUM_IEnumMoniker_Next(LPENUMMONIKER iface, ULONG celt,
if (!pMoniker)
return E_OUTOFMEMORY;
pMoniker->bInterface = This->bInterface;
if (RegOpenKeyW(This->hkey, buffer, &pMoniker->hkey) != ERROR_SUCCESS)
{
DEVENUM_IMediaCatMoniker_Release((LPMONIKER)pMoniker);
@ -829,7 +865,7 @@ static IEnumMonikerVtbl IEnumMoniker_Vtbl =
DEVENUM_IEnumMoniker_Clone
};
HRESULT DEVENUM_IEnumMoniker_Construct(HKEY hkey, IEnumMoniker ** ppEnumMoniker)
HRESULT DEVENUM_IEnumMoniker_Construct(HKEY hkey, IEnumMoniker ** ppEnumMoniker, BOOL bInterface)
{
EnumMonikerImpl * pEnumMoniker = CoTaskMemAlloc(sizeof(EnumMonikerImpl));
if (!pEnumMoniker)
@ -839,6 +875,7 @@ HRESULT DEVENUM_IEnumMoniker_Construct(HKEY hkey, IEnumMoniker ** ppEnumMoniker)
pEnumMoniker->ref = 1;
pEnumMoniker->index = 0;
pEnumMoniker->hkey = hkey;
pEnumMoniker->bInterface = bInterface;
*ppEnumMoniker = (IEnumMoniker *)pEnumMoniker;

View file

@ -43,6 +43,12 @@
<directory name="msdmo">
<xi:include href="msdmo/msdmo.rbuild" />
</directory>
<directory name="msdvbnp">
<xi:include href="msdvbnp/msdvbnp.rbuild" />
</directory>
<directory name="msvidctl">
<xi:include href="msvidctl/msvidctl.rbuild" />
</directory>
<directory name="qedit">
<xi:include href="qedit/qedit.rbuild" />
</directory>

View file

@ -64,6 +64,14 @@ CEnumPins::QueryInterface(
return NOERROR;
}
WCHAR Buffer[100];
LPOLESTR lpstr;
StringFromCLSID(refiid, &lpstr);
swprintf(Buffer, L"CEnumPins::QueryInterface: NoInterface for %s\n", lpstr);
OutputDebugStringW(Buffer);
CoTaskMemFree(lpstr);
DebugBreak();
return E_NOINTERFACE;
}

View file

@ -1629,6 +1629,7 @@ CInputPin::CreatePinHandle(
{
#ifdef KSPROXY_TRACE
OutputDebugStringW(L"CInputPin::CreatePinHandle GetSupportedSets failed\n");
DebugBreak();
#endif
return hr;
}
@ -1639,6 +1640,7 @@ CInputPin::CreatePinHandle(
{
#ifdef KSPROXY_TRACE
OutputDebugStringW(L"CInputPin::CreatePinHandle LoadProxyPlugins failed\n");
DebugBreak();
#endif
return hr;
}
@ -1683,6 +1685,8 @@ CInputPin::GetSupportedSets(
Length = NumProperty + NumMethods + NumEvents;
assert(Length);
// allocate guid buffer
pGuid = (LPGUID)CoTaskMemAlloc(Length);
if (!pGuid)
@ -1695,6 +1699,12 @@ CInputPin::GetSupportedSets(
NumMethods /= sizeof(GUID);
NumEvents /= sizeof(GUID);
#ifdef KSPROXY_TRACE
WCHAR Buffer[200];
swprintf(Buffer, L"CInputPin::GetSupportedSets NumProperty %lu NumMethods %lu NumEvents %lu\n", NumProperty, NumMethods, NumEvents);
OutputDebugStringW(Buffer);
#endif
// get all properties
hr = KsSynchronousDeviceControl(m_hPin, IOCTL_KS_PROPERTY, (PVOID)&Property, sizeof(KSPROPERTY), (PVOID)pGuid, Length, &BytesReturned);
if (FAILED(hr))
@ -1705,7 +1715,7 @@ CInputPin::GetSupportedSets(
Length -= BytesReturned;
// get all methods
if (Length)
if (Length && NumMethods)
{
hr = KsSynchronousDeviceControl(m_hPin, IOCTL_KS_METHOD, (PVOID)&Property, sizeof(KSPROPERTY), (PVOID)&pGuid[NumProperty], Length, &BytesReturned);
if (FAILED(hr))
@ -1717,7 +1727,7 @@ CInputPin::GetSupportedSets(
}
// get all events
if (Length)
if (Length && NumEvents)
{
hr = KsSynchronousDeviceControl(m_hPin, IOCTL_KS_ENABLE_EVENT, (PVOID)&Property, sizeof(KSPROPERTY), (PVOID)&pGuid[NumProperty+NumMethods], Length, &BytesReturned);
if (FAILED(hr))
@ -1728,12 +1738,6 @@ CInputPin::GetSupportedSets(
Length -= BytesReturned;
}
#ifdef KSPROXY_TRACE
WCHAR Buffer[200];
swprintf(Buffer, L"NumProperty %lu NumMethods %lu NumEvents %lu\n", NumProperty, NumMethods, NumEvents);
OutputDebugStringW(Buffer);
#endif
*pOutGuid = pGuid;
*NumGuids = NumProperty+NumEvents+NumMethods;
return S_OK;
@ -1779,6 +1783,7 @@ CInputPin::LoadProxyPlugins(
{
// store plugin
m_Plugins.push_back(pUnknown);
DebugBreak();
}
// close key
RegCloseKey(hSubKey);

View file

@ -343,7 +343,27 @@ HRESULT
WINAPI
DllUnregisterServer(void)
{
return S_OK;
ULONG Index = 0;
LPOLESTR pStr;
HRESULT hr = S_OK;
HKEY hClass;
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"CLSID", 0, KEY_SET_VALUE, &hClass) != ERROR_SUCCESS)
return E_FAIL;
do
{
hr = StringFromCLSID(*InterfaceTable[Index].riid, &pStr);
if (FAILED(hr))
break;
RegDeleteKeyW(hClass, pStr);
CoTaskMemFree(pStr);
Index++;
}while(InterfaceTable[Index].lpfnCI != 0);
RegCloseKey(hClass);
return hr;
}
extern "C"
@ -352,7 +372,39 @@ HRESULT
WINAPI
DllRegisterServer(void)
{
return S_OK;
ULONG Index = 0;
LPOLESTR pStr;
HRESULT hr = S_OK;
HKEY hClass, hKey, hSubKey;
static LPCWSTR ModuleName = L"ksproxy.ax";
static LPCWSTR ThreadingModel = L"Both";
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"CLSID", 0, KEY_WRITE, &hClass) != ERROR_SUCCESS)
return E_FAIL;
do
{
hr = StringFromCLSID(*InterfaceTable[Index].riid, &pStr);
if (FAILED(hr))
break;
if (RegCreateKeyExW(hClass, pStr, 0, 0, 0, KEY_WRITE, NULL, &hKey, 0) == ERROR_SUCCESS)
{
if (RegCreateKeyExW(hKey, L"InprocServer32", 0, 0, 0, KEY_WRITE, NULL, &hSubKey, 0) == ERROR_SUCCESS)
{
RegSetValueExW(hSubKey, 0, 0, REG_SZ, (const BYTE*)ModuleName, (wcslen(ModuleName) + 1) * sizeof(WCHAR));
RegSetValueExW(hSubKey, L"ThreadingModel", 0, REG_SZ, (const BYTE*)ThreadingModel, (wcslen(ThreadingModel) + 1) * sizeof(WCHAR));
RegCloseKey(hSubKey);
}
RegCloseKey(hKey);
}
CoTaskMemFree(pStr);
Index++;
}while(InterfaceTable[Index].lpfnCI != 0);
RegCloseKey(hClass);
return hr;
}
KSDDKAPI

View file

@ -3,6 +3,7 @@
<group>
<module name="ksproxy" type="win32dll" entrypoint="0" baseaddress="${BASEADDRESS_KSPROXY}" installbase="system32" installname="ksproxy.ax">
<importlibrary definition="ksproxy.spec" />
<autoregister infsection="OleControlDlls" type="DllRegisterServer" />
<include base="ksproxy">.</include>
<library>ntdll</library>
<library>kernel32</library>

View file

@ -1985,8 +1985,12 @@ COutputPin::CreatePin(
hr = CreatePinHandle(Medium, Interface, pmt);
if (FAILED(hr))
{
m_InterfaceHandler->Release();
m_InterfaceHandler = InterfaceHandler;
#ifdef KSPROXY_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"COutputPin::CreatePinHandle failed with %lx\n", hr);
OutputDebugStringW(Buffer);
#endif
return hr;
}
if (!m_InterfaceHandler)
@ -2181,6 +2185,7 @@ COutputPin::CreatePinHandle(
{
#ifdef KSPROXY_TRACE
OutputDebugStringW(L"CInputPin::CreatePinHandle GetSupportedSets failed\n");
DebugBreak();
#endif
return hr;
}
@ -2191,6 +2196,7 @@ COutputPin::CreatePinHandle(
{
#ifdef KSPROXY_TRACE
OutputDebugStringW(L"CInputPin::CreatePinHandle LoadProxyPlugins failed\n");
DebugBreak();
#endif
return hr;
}
@ -2234,6 +2240,8 @@ COutputPin::GetSupportedSets(
Length = NumProperty + NumMethods + NumEvents;
assert(Length);
// allocate guid buffer
pGuid = (LPGUID)CoTaskMemAlloc(Length);
if (!pGuid)
@ -2256,7 +2264,7 @@ COutputPin::GetSupportedSets(
Length -= BytesReturned;
// get all methods
if (Length)
if (Length && NumMethods)
{
hr = KsSynchronousDeviceControl(m_hPin, IOCTL_KS_METHOD, (PVOID)&Property, sizeof(KSPROPERTY), (PVOID)&pGuid[NumProperty], Length, &BytesReturned);
if (FAILED(hr))
@ -2268,7 +2276,7 @@ COutputPin::GetSupportedSets(
}
// get all events
if (Length)
if (Length && NumEvents)
{
hr = KsSynchronousDeviceControl(m_hPin, IOCTL_KS_ENABLE_EVENT, (PVOID)&Property, sizeof(KSPROPERTY), (PVOID)&pGuid[NumProperty+NumMethods], Length, &BytesReturned);
if (FAILED(hr))
@ -2330,6 +2338,7 @@ COutputPin::LoadProxyPlugins(
{
// store plugin
m_Plugins.push_back(pUnknown);
DebugBreak();
}
// close key
RegCloseKey(hSubKey);

View file

@ -0,0 +1,169 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS BDA Proxy
* FILE: dll/directx/msdvbnp/ethernetfilter.cpp
* PURPOSE: IBDA_EthernetFilter interface
*
* PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
*/
#include "precomp.h"
class CEthernetFilter : public IBDA_EthernetFilter
{
public:
STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface);
STDMETHODIMP_(ULONG) AddRef();
STDMETHODIMP_(ULONG) Release();
//IBDA_EthernetFilter
HRESULT STDMETHODCALLTYPE GetMulticastListSize(ULONG *pulcbAddresses);
HRESULT STDMETHODCALLTYPE PutMulticastList(ULONG ulcbAddresses, BYTE * pAddressList);
HRESULT STDMETHODCALLTYPE GetMulticastList(ULONG *pulcbAddresses, BYTE *pAddressList);
HRESULT STDMETHODCALLTYPE PutMulticastMode(ULONG ulModeMask);
HRESULT STDMETHODCALLTYPE GetMulticastMode(ULONG *pulModeMask);
CEthernetFilter(IBDA_NetworkProvider * pNetworkProvider);
virtual ~CEthernetFilter();
protected:
IBDA_NetworkProvider * m_pNetworkProvider;
ULONG m_ulcbAddresses;
BYTE * m_pAddressList;
ULONG m_ulModeMask;
};
CEthernetFilter::CEthernetFilter(
IBDA_NetworkProvider * pNetworkProvider) : m_pNetworkProvider(pNetworkProvider),
m_ulcbAddresses(0),
m_pAddressList(0),
m_ulModeMask(0)
{
}
CEthernetFilter::~CEthernetFilter()
{
if (m_pAddressList)
CoTaskMemFree(m_pAddressList);
}
HRESULT
STDMETHODCALLTYPE
CEthernetFilter::QueryInterface(
REFIID InterfaceId,
PVOID* Interface)
{
assert(m_pNetworkProvider);
return m_pNetworkProvider->QueryInterface(InterfaceId, Interface);
}
ULONG
STDMETHODCALLTYPE
CEthernetFilter::AddRef()
{
assert(m_pNetworkProvider);
return m_pNetworkProvider->AddRef();
}
ULONG
STDMETHODCALLTYPE
CEthernetFilter::Release()
{
assert(m_pNetworkProvider);
return m_pNetworkProvider->Release();
}
//-------------------------------------------------------------------
//IBDA_EthernetFilter
//
HRESULT
STDMETHODCALLTYPE
CEthernetFilter::PutMulticastList(
ULONG ulcbAddresses,
BYTE * pAddressList)
{
if (!ulcbAddresses || !pAddressList)
return E_POINTER;
if (m_pAddressList)
CoTaskMemFree(m_pAddressList);
m_pAddressList = (BYTE*)CoTaskMemAlloc(ulcbAddresses);
if (!m_pAddressList)
return E_OUTOFMEMORY;
CopyMemory(m_pAddressList, pAddressList, ulcbAddresses);
m_ulcbAddresses = ulcbAddresses;
return NOERROR;
}
HRESULT
STDMETHODCALLTYPE
CEthernetFilter::GetMulticastList(
ULONG *pulcbAddresses,
BYTE *pAddressList)
{
if (!pulcbAddresses || !pAddressList)
return E_POINTER;
if (*pulcbAddresses < m_ulcbAddresses)
return E_OUTOFMEMORY;
CopyMemory(pAddressList, m_pAddressList, m_ulcbAddresses);
*pulcbAddresses = m_ulcbAddresses;
return NOERROR;
}
HRESULT
STDMETHODCALLTYPE
CEthernetFilter::GetMulticastListSize(
ULONG *pulcbAddresses)
{
if (!pulcbAddresses)
return E_POINTER;
*pulcbAddresses = m_ulcbAddresses;
return NOERROR;
}
HRESULT
STDMETHODCALLTYPE
CEthernetFilter::PutMulticastMode(
ULONG ulModeMask)
{
m_ulModeMask = ulModeMask;
return NOERROR;
}
HRESULT
STDMETHODCALLTYPE
CEthernetFilter::GetMulticastMode(
ULONG *pulModeMask)
{
*pulModeMask = m_ulModeMask;
return NOERROR;
}
HRESULT
WINAPI
CEthernetFilter_fnConstructor(
IBDA_NetworkProvider * pNetworkProvider,
REFIID riid,
LPVOID * ppv)
{
CEthernetFilter * filter = new CEthernetFilter(pNetworkProvider);
if (!filter)
return E_OUTOFMEMORY;
if (FAILED(filter->QueryInterface(riid, ppv)))
{
/* not supported */
delete filter;
return E_NOINTERFACE;
}
return NOERROR;
}

View file

@ -0,0 +1,170 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS BDA Proxy
* FILE: dll/directx/msdvbnp/ipv4.cpp
* PURPOSE: IBDA_IPV4Filter interface
*
* PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
*/
#include "precomp.h"
class CIPV4Filter : public IBDA_IPV4Filter
{
public:
STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface);
STDMETHODIMP_(ULONG) AddRef();
STDMETHODIMP_(ULONG) Release();
//IBDA_IPV4Filter
HRESULT STDMETHODCALLTYPE GetMulticastListSize(ULONG *pulcbAddresses);
HRESULT STDMETHODCALLTYPE PutMulticastList(ULONG ulcbAddresses, BYTE * pAddressList);
HRESULT STDMETHODCALLTYPE GetMulticastList(ULONG *pulcbAddresses, BYTE *pAddressList);
HRESULT STDMETHODCALLTYPE PutMulticastMode(ULONG ulModeMask);
HRESULT STDMETHODCALLTYPE GetMulticastMode(ULONG *pulModeMask);
CIPV4Filter(IBDA_NetworkProvider * pNetworkProvider);
virtual ~CIPV4Filter();
protected:
IBDA_NetworkProvider * m_pNetworkProvider;
ULONG m_ulcbAddresses;
BYTE * m_pAddressList;
ULONG m_ulModeMask;
};
CIPV4Filter::CIPV4Filter(
IBDA_NetworkProvider * pNetworkProvider) : m_pNetworkProvider(pNetworkProvider),
m_ulcbAddresses(0),
m_pAddressList(0),
m_ulModeMask(0)
{
}
CIPV4Filter::~CIPV4Filter()
{
if (m_pAddressList)
CoTaskMemFree(m_pAddressList);
}
HRESULT
STDMETHODCALLTYPE
CIPV4Filter::QueryInterface(
REFIID InterfaceId,
PVOID* Interface)
{
assert(m_pNetworkProvider);
return m_pNetworkProvider->QueryInterface(InterfaceId, Interface);
}
ULONG
STDMETHODCALLTYPE
CIPV4Filter::AddRef()
{
assert(m_pNetworkProvider);
return m_pNetworkProvider->AddRef();
}
ULONG
STDMETHODCALLTYPE
CIPV4Filter::Release()
{
assert(m_pNetworkProvider);
return m_pNetworkProvider->Release();
}
//-------------------------------------------------------------------
//IBDA_IPV4Filter
//
HRESULT
STDMETHODCALLTYPE
CIPV4Filter::GetMulticastListSize(
ULONG *pulcbAddresses)
{
if (!pulcbAddresses)
return E_POINTER;
*pulcbAddresses = 0;
return NOERROR;
}
HRESULT
STDMETHODCALLTYPE
CIPV4Filter::PutMulticastList(
ULONG ulcbAddresses,
BYTE * pAddressList)
{
if (!ulcbAddresses || !pAddressList)
return E_POINTER;
if (m_pAddressList)
CoTaskMemFree(m_pAddressList);
m_pAddressList = (BYTE*)CoTaskMemAlloc(ulcbAddresses);
if (!m_pAddressList)
return E_OUTOFMEMORY;
CopyMemory(m_pAddressList, pAddressList, ulcbAddresses);
m_ulcbAddresses = ulcbAddresses;
return NOERROR;
}
HRESULT
STDMETHODCALLTYPE
CIPV4Filter::GetMulticastList(
ULONG *pulcbAddresses,
BYTE *pAddressList)
{
if (!pulcbAddresses || !pAddressList)
return E_POINTER;
if (*pulcbAddresses < m_ulcbAddresses)
return E_OUTOFMEMORY;
CopyMemory(pAddressList, m_pAddressList, m_ulcbAddresses);
*pulcbAddresses = m_ulcbAddresses;
return NOERROR;
}
HRESULT
STDMETHODCALLTYPE
CIPV4Filter::PutMulticastMode(
ULONG ulModeMask)
{
m_ulModeMask = ulModeMask;
return NOERROR;
}
HRESULT
STDMETHODCALLTYPE
CIPV4Filter::GetMulticastMode(
ULONG *pulModeMask)
{
*pulModeMask = m_ulModeMask;
return NOERROR;
}
HRESULT
WINAPI
CIPV4Filter_fnConstructor(
IBDA_NetworkProvider * pNetworkProvider,
REFIID riid,
LPVOID * ppv)
{
CIPV4Filter * filter = new CIPV4Filter(pNetworkProvider);
if (!filter)
return E_OUTOFMEMORY;
if (FAILED(filter->QueryInterface(riid, ppv)))
{
/* not supported */
delete filter;
return E_NOINTERFACE;
}
return NOERROR;
}

View file

@ -0,0 +1,167 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS BDA Proxy
* FILE: dll/directx/msdvbnp/ipv6.cpp
* PURPOSE: IBDA_IPV6Filter interface
*
* PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
*/
#include "precomp.h"
class CIPV6Filter : public IBDA_IPV6Filter
{
public:
STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface);
STDMETHODIMP_(ULONG) AddRef();
STDMETHODIMP_(ULONG) Release();
//IBDA_IPV6Filter
HRESULT STDMETHODCALLTYPE GetMulticastListSize(ULONG *pulcbAddresses);
HRESULT STDMETHODCALLTYPE PutMulticastList(ULONG ulcbAddresses, BYTE * pAddressList);
HRESULT STDMETHODCALLTYPE GetMulticastList(ULONG *pulcbAddresses, BYTE *pAddressList);
HRESULT STDMETHODCALLTYPE PutMulticastMode(ULONG ulModeMask);
HRESULT STDMETHODCALLTYPE GetMulticastMode(ULONG *pulModeMask);
CIPV6Filter(IBDA_NetworkProvider * pNetworkProvider);
virtual ~CIPV6Filter();
protected:
IBDA_NetworkProvider * m_pNetworkProvider;
ULONG m_ulcbAddresses;
BYTE * m_pAddressList;
ULONG m_ulModeMask;
};
CIPV6Filter::CIPV6Filter(
IBDA_NetworkProvider * pNetworkProvider) : m_pNetworkProvider(pNetworkProvider),
m_ulcbAddresses(0),
m_pAddressList(0),
m_ulModeMask(0)
{
}
CIPV6Filter::~CIPV6Filter()
{
if (m_pAddressList)
CoTaskMemFree(m_pAddressList);
}
HRESULT
STDMETHODCALLTYPE
CIPV6Filter::QueryInterface(
REFIID InterfaceId,
PVOID* Interface)
{
assert(m_pNetworkProvider);
return m_pNetworkProvider->QueryInterface(InterfaceId, Interface);
}
ULONG
STDMETHODCALLTYPE
CIPV6Filter::AddRef()
{
assert(m_pNetworkProvider);
return m_pNetworkProvider->AddRef();
}
ULONG
STDMETHODCALLTYPE
CIPV6Filter::Release()
{
assert(m_pNetworkProvider);
return m_pNetworkProvider->Release();
}
//-------------------------------------------------------------------
//IBDA_IPV6Filter
//
HRESULT
STDMETHODCALLTYPE
CIPV6Filter::GetMulticastListSize(
ULONG *pulcbAddresses)
{
if (!pulcbAddresses)
return E_POINTER;
*pulcbAddresses = 0;
return NOERROR;
}
HRESULT
STDMETHODCALLTYPE
CIPV6Filter::GetMulticastList(
ULONG *pulcbAddresses,
BYTE *pAddressList)
{
if (!pulcbAddresses || !pAddressList)
return E_POINTER;
if (*pulcbAddresses < m_ulcbAddresses)
return E_OUTOFMEMORY;
CopyMemory(pAddressList, m_pAddressList, m_ulcbAddresses);
*pulcbAddresses = m_ulcbAddresses;
return NOERROR;
}
HRESULT
STDMETHODCALLTYPE
CIPV6Filter::PutMulticastList(
ULONG ulcbAddresses,
BYTE * pAddressList)
{
if (!ulcbAddresses || !pAddressList)
return E_POINTER;
if (m_pAddressList)
CoTaskMemFree(m_pAddressList);
m_pAddressList = (BYTE*)CoTaskMemAlloc(ulcbAddresses);
if (!m_pAddressList)
return E_OUTOFMEMORY;
CopyMemory(m_pAddressList, pAddressList, ulcbAddresses);
m_ulcbAddresses = ulcbAddresses;
return NOERROR;
}
HRESULT
STDMETHODCALLTYPE
CIPV6Filter::PutMulticastMode(
ULONG ulModeMask)
{
m_ulModeMask = ulModeMask;
return NOERROR;
}
HRESULT
STDMETHODCALLTYPE
CIPV6Filter::GetMulticastMode(
ULONG *pulModeMask)
{
*pulModeMask = m_ulModeMask;
return NOERROR;
}
HRESULT
WINAPI
CIPV6Filter_fnConstructor(
IBDA_NetworkProvider * pNetworkProvider,
REFIID riid,
LPVOID * ppv)
{
CIPV6Filter * filter = new CIPV6Filter(pNetworkProvider);
if (!filter)
return E_OUTOFMEMORY;
if (FAILED(filter->QueryInterface(riid, ppv)))
{
/* not supported */
delete filter;
return E_NOINTERFACE;
}
return NOERROR;
}

View file

@ -9,8 +9,6 @@
#include "precomp.h"
const GUID CLSID_DVBTNetworkProvider = {0x216c62df, 0x6d7f, 0x4e9a, {0x85, 0x71, 0x5, 0xf1, 0x4e, 0xdb, 0x76, 0x6a}};
static INTERFACE_TABLE InterfaceTable[] =
{
{&CLSID_DVBTNetworkProvider, CNetworkProvider_fnConstructor},
@ -50,7 +48,27 @@ HRESULT
WINAPI
DllUnregisterServer(void)
{
return S_OK;
ULONG Index = 0;
LPOLESTR pStr;
HRESULT hr = S_OK;
HKEY hClass;
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"CLSID", 0, KEY_SET_VALUE, &hClass) != ERROR_SUCCESS)
return E_FAIL;
do
{
hr = StringFromCLSID(*InterfaceTable[Index].riid, &pStr);
if (FAILED(hr))
break;
RegDeleteKeyW(hClass, pStr);
CoTaskMemFree(pStr);
Index++;
}while(InterfaceTable[Index].lpfnCI != 0);
RegCloseKey(hClass);
return hr;
}
extern "C"
@ -59,7 +77,39 @@ HRESULT
WINAPI
DllRegisterServer(void)
{
return S_OK;
ULONG Index = 0;
LPOLESTR pStr;
HRESULT hr = S_OK;
HKEY hClass, hKey, hSubKey;
static LPCWSTR ModuleName = L"msdvbnp.ax";
static LPCWSTR ThreadingModel = L"Both";
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"CLSID", 0, KEY_WRITE, &hClass) != ERROR_SUCCESS)
return E_FAIL;
do
{
hr = StringFromCLSID(*InterfaceTable[Index].riid, &pStr);
if (FAILED(hr))
break;
if (RegCreateKeyExW(hClass, pStr, 0, 0, 0, KEY_WRITE, NULL, &hKey, 0) == ERROR_SUCCESS)
{
if (RegCreateKeyExW(hKey, L"InprocServer32", 0, 0, 0, KEY_WRITE, NULL, &hSubKey, 0) == ERROR_SUCCESS)
{
RegSetValueExW(hSubKey, 0, 0, REG_SZ, (const BYTE*)ModuleName, (wcslen(ModuleName) + 1) * sizeof(WCHAR));
RegSetValueExW(hSubKey, L"ThreadingModel", 0, REG_SZ, (const BYTE*)ThreadingModel, (wcslen(ThreadingModel) + 1) * sizeof(WCHAR));
RegCloseKey(hSubKey);
}
RegCloseKey(hKey);
}
CoTaskMemFree(pStr);
Index++;
}while(InterfaceTable[Index].lpfnCI != 0);
RegCloseKey(hClass);
return hr;
}
KSDDKAPI
@ -72,7 +122,7 @@ DllGetClassObject(
{
UINT i;
HRESULT hres = E_OUTOFMEMORY;
IClassFactory * pcf = NULL;
IClassFactory * pcf = NULL;
if (!ppv)
return E_INVALIDARG;
@ -88,7 +138,7 @@ DllGetClassObject(
}
}
if (!pcf)
if (!pcf)
{
return CLASS_E_CLASSNOTAVAILABLE;
}

View file

@ -3,6 +3,7 @@
<group>
<module name="msdvbnp" type="win32dll" baseaddress="${BASEADDRESS_MSDVBNP}" installbase="system32" installname="msdvbnp.ax">
<importlibrary definition="msdvbnp.spec" />
<autoregister infsection="OleControlDlls" type="DllRegisterServer" />
<include base="msdvbnp">.</include>
<library>ntdll</library>
<library>kernel32</library>
@ -22,8 +23,11 @@
<file>classfactory.cpp</file>
<file>enum_mediatypes.cpp</file>
<file>enumpins.cpp</file>
<file>ethernetfilter.cpp</file>
<file>msdvbnp.cpp</file>
<file>msdvbnp.rc</file>
<file>ipv4.cpp</file>
<file>ipv6.cpp</file>
<file>networkprovider.cpp</file>
<file>pin.cpp</file>
<file>scanningtuner.cpp</file>

View file

@ -8,11 +8,15 @@
*/
#include "precomp.h"
#define DEVICE_FILTER_MASK (0x80000000)
class CNetworkProvider : public IBaseFilter,
public IAMovieSetup,
public IBDA_NetworkProvider
{
public:
typedef std::vector<IUnknown*>DeviceFilterStack;
STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface);
STDMETHODIMP_(ULONG) AddRef()
@ -58,7 +62,7 @@ public:
HRESULT STDMETHODCALLTYPE RegisterDeviceFilter(IUnknown *pUnkFilterControl, ULONG *ppvRegisitrationContext);
HRESULT STDMETHODCALLTYPE UnRegisterDeviceFilter(ULONG pvRegistrationContext);
CNetworkProvider() : m_Ref(0), m_pGraph(0), m_ReferenceClock(0), m_FilterState(State_Stopped) {m_Pins[0] = 0;};
CNetworkProvider(LPCGUID ClassID);
virtual ~CNetworkProvider(){};
protected:
@ -67,6 +71,12 @@ protected:
IReferenceClock * m_ReferenceClock;
FILTER_STATE m_FilterState;
IPin * m_Pins[1];
GUID m_ClassID;
DeviceFilterStack m_DeviceFilters;
IScanningTuner * m_Tuner;
IBDA_IPV6Filter * m_IPV6Filter;
IBDA_IPV4Filter * m_IPV4Filter;
IBDA_EthernetFilter * m_EthernetFilter;
};
HRESULT
@ -75,6 +85,9 @@ CNetworkProvider::QueryInterface(
IN REFIID refiid,
OUT PVOID* Output)
{
ULONG Index;
HRESULT hr;
*Output = NULL;
if (IsEqualGUID(refiid, IID_IUnknown))
@ -94,7 +107,92 @@ CNetworkProvider::QueryInterface(
IsEqualGUID(refiid, IID_IScanningTuner))
{
// construct scanning tuner
return CScanningTunner_fnConstructor(NULL, refiid, Output);
if (!m_Tuner)
{
HRESULT hr = CScanningTunner_fnConstructor(m_DeviceFilters, refiid, (void**)&m_Tuner);
if (FAILED(hr))
return hr;
}
m_Tuner->AddRef();
*Output = (IUnknown*)m_Tuner;
return NOERROR;
}
if (IsEqualGUID(refiid, IID_IBDA_IPV6Filter))
{
// construct scanning tuner
if (!m_IPV6Filter)
{
HRESULT hr = CIPV6Filter_fnConstructor((IBDA_NetworkProvider*)this, refiid, (void**)&m_IPV6Filter);
if (FAILED(hr))
return hr;
}
m_IPV6Filter->AddRef();
*Output = (IUnknown*)m_IPV6Filter;
return NOERROR;
}
if (IsEqualGUID(refiid, IID_IBDA_IPV4Filter))
{
// construct scanning tuner
if (!m_IPV4Filter)
{
HRESULT hr = CIPV4Filter_fnConstructor((IBDA_NetworkProvider*)this, refiid, (void**)&m_IPV4Filter);
if (FAILED(hr))
return hr;
}
m_IPV4Filter->AddRef();
*Output = (IUnknown*)m_IPV4Filter;
return NOERROR;
}
if (IsEqualGUID(refiid, IID_IBDA_EthernetFilter))
{
// construct scanning tuner
if (!m_EthernetFilter)
{
HRESULT hr = CIPV4Filter_fnConstructor((IBDA_NetworkProvider*)this, refiid, (void**)&m_EthernetFilter);
if (FAILED(hr))
return hr;
}
m_EthernetFilter->AddRef();
*Output = (IUnknown*)m_EthernetFilter;
return NOERROR;
}
if (IsEqualGUID(refiid, IID_IBDA_NetworkProvider))
{
*Output = (IBDA_NetworkProvider*)(this);
reinterpret_cast<IBDA_NetworkProvider*>(*Output)->AddRef();
return NOERROR;
}
for(Index = 0; Index < m_DeviceFilters.size(); Index++)
{
// get device filter
IUnknown *pFilter = m_DeviceFilters[Index];
if (!pFilter)
continue;
// query for requested interface
hr = pFilter->QueryInterface(refiid, Output);
if (SUCCEEDED(hr))
{
#ifdef MSDVBNP_TRACE
WCHAR Buffer[MAX_PATH];
LPOLESTR lpstr;
StringFromCLSID(refiid, &lpstr);
swprintf(Buffer, L"CNetworkProvider::QueryInterface: DeviceFilter %lu supports %s !!!\n", Index, lpstr);
OutputDebugStringW(Buffer);
CoTaskMemFree(lpstr);
#endif
return hr;
}
}
WCHAR Buffer[MAX_PATH];
@ -104,10 +202,24 @@ CNetworkProvider::QueryInterface(
OutputDebugStringW(Buffer);
CoTaskMemFree(lpstr);
return E_NOINTERFACE;
}
CNetworkProvider::CNetworkProvider(LPCGUID ClassID) : m_Ref(0),
m_pGraph(0),
m_ReferenceClock(0),
m_FilterState(State_Stopped),
m_DeviceFilters(),
m_Tuner(0),
m_IPV6Filter(0),
m_IPV4Filter(0),
m_EthernetFilter(0)
{
m_Pins[0] = 0;
CopyMemory(&m_ClassID, ClassID, sizeof(GUID));
};
//-------------------------------------------------------------------
// IBaseFilter interface
//
@ -117,24 +229,29 @@ STDMETHODCALLTYPE
CNetworkProvider::GetClassID(
CLSID *pClassID)
{
OutputDebugStringW(L"CNetworkProvider::GetClassID : NotImplemented\n");
return E_NOTIMPL;
OutputDebugStringW(L"CNetworkProvider::GetClassID\n");
CopyMemory(&pClassID, &m_ClassID, sizeof(GUID));
return S_OK;
}
HRESULT
STDMETHODCALLTYPE
CNetworkProvider::Stop()
{
OutputDebugStringW(L"CNetworkProvider::Stop : NotImplemented\n");
return E_NOTIMPL;
OutputDebugStringW(L"CNetworkProvider::Stop\n");
m_FilterState = State_Stopped;
return S_OK;
}
HRESULT
STDMETHODCALLTYPE
CNetworkProvider::Pause()
{
OutputDebugStringW(L"CNetworkProvider::Pause : NotImplemented\n");
return E_NOTIMPL;
OutputDebugStringW(L"CNetworkProvider::Pause\n");
m_FilterState = State_Paused;
return S_OK;
}
HRESULT
@ -142,8 +259,10 @@ STDMETHODCALLTYPE
CNetworkProvider::Run(
REFERENCE_TIME tStart)
{
OutputDebugStringW(L"CNetworkProvider::Run : NotImplemented\n");
return E_NOTIMPL;
OutputDebugStringW(L"CNetworkProvider::Run\n");
m_FilterState = State_Running;
return S_OK;
}
HRESULT
@ -166,7 +285,6 @@ CNetworkProvider::SetSyncSource(
pClock->AddRef();
}
if (m_ReferenceClock)
{
m_ReferenceClock->Release();
@ -227,6 +345,9 @@ CNetworkProvider::QueryFilterInfo(
pInfo->achName[0] = L'\0';
pInfo->pGraph = m_pGraph;
if (m_pGraph)
m_pGraph->AddRef();
return S_OK;
}
@ -257,7 +378,6 @@ STDMETHODCALLTYPE
CNetworkProvider::QueryVendorInfo(
LPWSTR *pVendorInfo)
{
OutputDebugStringW(L"CNetworkProvider::QueryVendorInfo : NotImplemented\n");
return E_NOTIMPL;
}
@ -336,16 +456,95 @@ CNetworkProvider::RegisterDeviceFilter(
IUnknown *pUnkFilterControl,
ULONG *ppvRegisitrationContext)
{
OutputDebugStringW(L"CNetworkProvider::RegisterDeviceFilter : NotImplemented\n");
return E_NOTIMPL;
HRESULT hr;
IBDA_DeviceControl * pDeviceControl = NULL;
IBDA_Topology *pTopology = NULL;
OutputDebugStringW(L"CNetworkProvider::RegisterDeviceFilter\n");
if (!pUnkFilterControl || !ppvRegisitrationContext)
{
//invalid argument
return E_POINTER;
}
// the filter must support IBDA_DeviceControl and IBDA_Topology
hr = pUnkFilterControl->QueryInterface(IID_IBDA_DeviceControl, (void**)&pDeviceControl);
if (FAILED(hr))
{
OutputDebugStringW(L"CNetworkProvider::RegisterDeviceFilter Filter does not support IBDA_DeviceControl\n");
return hr;
}
hr = pUnkFilterControl->QueryInterface(IID_IBDA_Topology, (void**)&pTopology);
if (FAILED(hr))
{
pDeviceControl->Release();
OutputDebugStringW(L"CNetworkProvider::RegisterDeviceFilter Filter does not support IID_IBDA_Topology\n");
return hr;
}
//TODO
// analyize device filter
// increment reference
pUnkFilterControl->AddRef();
// release IBDA_DeviceControl interface
pDeviceControl->Release();
// release IBDA_Topology interface
pTopology->Release();
// store registration ctx
*ppvRegisitrationContext = (m_DeviceFilters.size() | DEVICE_FILTER_MASK);
// store filter
m_DeviceFilters.push_back(pUnkFilterControl);
OutputDebugStringW(L"CNetworkProvider::RegisterDeviceFilter complete\n");
return S_OK;
}
HRESULT
STDMETHODCALLTYPE
CNetworkProvider::UnRegisterDeviceFilter(ULONG pvRegistrationContext)
{
OutputDebugStringW(L"CNetworkProvider::UnRegisterDeviceFilter : NotImplemented\n");
return E_NOTIMPL;
ULONG Index;
IUnknown * pUnknown;
OutputDebugStringW(L"CNetworkProvider::UnRegisterDeviceFilter\n");
if (!(pvRegistrationContext & DEVICE_FILTER_MASK))
{
// invalid argument
return E_INVALIDARG;
}
// get real index
Index = pvRegistrationContext & ~DEVICE_FILTER_MASK;
if (Index >= m_DeviceFilters.size())
{
// invalid argument
return E_INVALIDARG;
}
pUnknown = m_DeviceFilters[Index];
if (!pUnknown)
{
// filter was already de-registered
return E_INVALIDARG;
}
// remove from vector
m_DeviceFilters[Index] = NULL;
// release extra reference
pUnknown->Release();
return NOERROR;
}
HRESULT
@ -355,7 +554,7 @@ CNetworkProvider_fnConstructor(
REFIID riid,
LPVOID * ppv)
{
CNetworkProvider * handler = new CNetworkProvider();
CNetworkProvider * handler = new CNetworkProvider(&CLSID_DVBTNetworkProvider);
#ifdef MSDVBNP_TRACE
WCHAR Buffer[MAX_PATH];

View file

@ -8,8 +8,10 @@
*/
#include "precomp.h"
#ifndef _MSC_VER
const GUID KSDATAFORMAT_TYPE_BDA_ANTENNA = {0x71985f41, 0x1ca1, 0x11d3, {0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0}};
const GUID GUID_NULL = {0x00000000L, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}};
#endif
class CPin : public IPin
{
@ -49,7 +51,7 @@ public:
HRESULT STDMETHODCALLTYPE EndFlush();
HRESULT STDMETHODCALLTYPE NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
CPin(IBaseFilter * ParentFilter) : m_Ref(0), m_ParentFilter(ParentFilter){};
CPin(IBaseFilter * ParentFilter);
virtual ~CPin(){};
static LPCWSTR PIN_ID;
@ -57,11 +59,31 @@ public:
protected:
LONG m_Ref;
IBaseFilter * m_ParentFilter;
AM_MEDIA_TYPE m_MediaType;
IPin * m_Pin;
};
LPCWSTR CPin::PIN_ID = L"Antenna Out";
CPin::CPin(
IBaseFilter * ParentFilter) : m_Ref(0),
m_ParentFilter(ParentFilter),
m_Pin(0)
{
m_MediaType.majortype = KSDATAFORMAT_TYPE_BDA_ANTENNA;
m_MediaType.subtype = MEDIASUBTYPE_None;
m_MediaType.formattype = FORMAT_None;
m_MediaType.bFixedSizeSamples = true;
m_MediaType.bTemporalCompression = false;
m_MediaType.lSampleSize = sizeof(CHAR);
m_MediaType.pUnk = NULL;
m_MediaType.cbFormat = 0;
m_MediaType.pbFormat = NULL;
}
HRESULT
STDMETHODCALLTYPE
CPin::QueryInterface(
@ -98,36 +120,97 @@ HRESULT
STDMETHODCALLTYPE
CPin::Connect(IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
{
HRESULT hr;
OutputDebugStringW(L"CPin::Connect called\n");
return E_NOTIMPL;
if (pmt)
{
hr = pReceivePin->QueryAccept(pmt);
if (FAILED(hr))
{
OutputDebugStringW(L"CPin::Connect QueryAccept failed\n");
return hr;
}
}
else
{
// query accept
hr = pReceivePin->QueryAccept(&m_MediaType);
if (FAILED(hr))
{
OutputDebugStringW(L"CPin::Connect QueryAccept pmt default failed\n");
return hr;
}
pmt = &m_MediaType;
}
// receive connection;
hr = pReceivePin->ReceiveConnection((IPin*)this, pmt);
if (SUCCEEDED(hr))
{
// increment reference count
pReceivePin->AddRef();
m_Pin = pReceivePin;
OutputDebugStringW(L"CPin::Connect success\n");
}
return hr;
}
HRESULT
STDMETHODCALLTYPE
CPin::ReceiveConnection(IPin *pConnector, const AM_MEDIA_TYPE *pmt)
{
OutputDebugStringW(L"CPin::ReceiveConnection called\n");
return E_NOTIMPL;
return E_UNEXPECTED;
}
HRESULT
STDMETHODCALLTYPE
CPin::Disconnect( void)
{
OutputDebugStringW(L"CPin::Disconnect called\n");
return E_NOTIMPL;
#ifdef MSDVBNP_TRACE
OutputDebugStringW(L"CPin::Disconnect\n");
#endif
if (!m_Pin)
{
// pin was not connected
return S_FALSE;
}
m_Pin->Release();
m_Pin = NULL;
return S_OK;
}
HRESULT
STDMETHODCALLTYPE
CPin::ConnectedTo(IPin **pPin)
{
OutputDebugStringW(L"CPin::ConnectedTo called\n");
#ifdef MSDVBNP_TRACE
OutputDebugStringW(L"CPin::ConnectedTo\n");
#endif
if (!pPin)
return E_POINTER;
if (m_Pin)
{
// increment reference count
m_Pin->AddRef();
*pPin = m_Pin;
return S_OK;
}
*pPin = NULL;
return VFW_E_NOT_CONNECTED;
}
HRESULT
STDMETHODCALLTYPE
CPin::ConnectionMediaType(AM_MEDIA_TYPE *pmt)
{
OutputDebugStringW(L"CPin::ConnectionMediaType called\n");
OutputDebugStringW(L"CPin::ConnectionMediaType NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
@ -168,7 +251,7 @@ HRESULT
STDMETHODCALLTYPE
CPin::QueryAccept(const AM_MEDIA_TYPE *pmt)
{
OutputDebugStringW(L"CPin::QueryAccept called\n");
OutputDebugStringW(L"CPin::QueryAccept NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
@ -198,35 +281,35 @@ HRESULT
STDMETHODCALLTYPE
CPin::QueryInternalConnections(IPin **apPin, ULONG *nPin)
{
OutputDebugStringW(L"CPin::QueryInternalConnections called\n");
OutputDebugStringW(L"CPin::QueryInternalConnections NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CPin::EndOfStream( void)
{
OutputDebugStringW(L"CPin::EndOfStream called\n");
OutputDebugStringW(L"CPin::EndOfStream NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CPin::BeginFlush( void)
{
OutputDebugStringW(L"CPin::BeginFlush called\n");
OutputDebugStringW(L"CPin::BeginFlush NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CPin::EndFlush( void)
{
OutputDebugStringW(L"CPin::EndFlush called\n");
OutputDebugStringW(L"CPin::EndFlush NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CPin::NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
{
OutputDebugStringW(L"CPin::NewSegment called\n");
OutputDebugStringW(L"CPin::NewSegment NotImplemented\n");
return E_NOTIMPL;
}

View file

@ -9,15 +9,18 @@
#include <ks.h>
#define __STREAMS__
#include <ksproxy.h>
#include <ksmedia.h>
#include <stdio.h>
#include <wchar.h>
#include <tchar.h>
#include <uuids.h>
#include <bdatypes.h>
#include <bdaiface.h>
#include <bdatif.h>
#include <bdamedia.h>
#include <tuner.h>
#include <assert.h>
#include <vector>
typedef HRESULT (CALLBACK *LPFNCREATEINSTANCE)(IUnknown* pUnkOuter, REFIID riid, LPVOID* ppvObject);
@ -46,7 +49,7 @@ CNetworkProvider_fnConstructor(
HRESULT
WINAPI
CScanningTunner_fnConstructor(
IUnknown *pUnknown,
std::vector<IUnknown*> & m_DeviceFilter,
REFIID riid,
LPVOID * ppv);
@ -79,4 +82,32 @@ CEnumMediaTypes_fnConstructor(
REFIID riid,
LPVOID * ppv);
/* ethernetfilter.cpp */
HRESULT
WINAPI
CEthernetFilter_fnConstructor(
IBDA_NetworkProvider * pNetworkProvider,
REFIID riid,
LPVOID * ppv);
/* ipv6.cpp */
HRESULT
WINAPI
CIPV6Filter_fnConstructor(
IBDA_NetworkProvider * pNetworkProvider,
REFIID riid,
LPVOID * ppv);
/* ipv4.cpp */
HRESULT
WINAPI
CIPV4Filter_fnConstructor(
IBDA_NetworkProvider * pNetworkProvider,
REFIID riid,
LPVOID * ppv);
#ifndef _MSC_VER
extern const GUID CLSID_DVBTNetworkProvider;
#endif
#endif

View file

@ -48,12 +48,19 @@ public:
HRESULT STDMETHODCALLTYPE ScanDown(long MillisecondsPause);
HRESULT STDMETHODCALLTYPE AutoProgram();
CScanningTunner() : m_Ref(0), m_TuningSpace(0){};
virtual ~CScanningTunner(){};
CScanningTunner(std::vector<IUnknown*> & DeviceFilters) : m_Ref(0), m_TuningSpace(0), m_DeviceFilters(DeviceFilters){};
virtual ~CScanningTunner() {};
HRESULT STDMETHODCALLTYPE StartChanges();
HRESULT STDMETHODCALLTYPE CommitChanges();
HRESULT STDMETHODCALLTYPE CheckChanges();
HRESULT STDMETHODCALLTYPE SetLnbInfo(IBDA_LNBInfo * pLnbInfo, ULONG ulLOFLow, ULONG ulLOFHigh, ULONG ulSwitchFrequency);
HRESULT STDMETHODCALLTYPE SetDigitalDemodulator(IBDA_DigitalDemodulator * pDigitalDemo, ModulationType ModType, FECMethod InnerFEC, BinaryConvolutionCodeRate InnerFECRate, FECMethod OuterFEC, BinaryConvolutionCodeRate OuterFECRate, ULONG SymbolRate);
HRESULT SetFrequency(IBDA_FrequencyFilter * pFrequency, ULONG FrequencyMultiplier, ULONG Frequency, Polarisation Polarity, ULONG Range, ULONG Bandwidth);
HRESULT STDMETHODCALLTYPE performDVBTTune(IDVBTuneRequest * pDVBTRequest, IDVBTLocator *pDVBTLocator);
protected:
LONG m_Ref;
ITuningSpace * m_TuningSpace;
std::vector<IUnknown*> & m_DeviceFilters;
};
HRESULT
@ -140,8 +147,48 @@ STDMETHODCALLTYPE
CScanningTunner::put_TuneRequest(
ITuneRequest *TuneRequest)
{
OutputDebugStringW(L"CScanningTunner::put_TuneRequest : NotImplemented\n");
return E_NOTIMPL;
IDVBTuneRequest * pDVBTRequest;
ILocator *pLocator;
IDVBTLocator *pDVBTLocator;
HRESULT hr;
OutputDebugStringW(L"CScanningTunner::put_TuneRequest\n");
// query for IDVBTuneRequest interface
hr = TuneRequest->QueryInterface(IID_IDVBTuneRequest, (void**)&pDVBTRequest);
// sanity check
assert(hr == NOERROR);
// get the IDVBTLocator
hr = pDVBTRequest->get_Locator((ILocator**)&pLocator);
// sanity check
assert(hr == NOERROR);
assert(pLocator);
hr = pLocator->QueryInterface(IID_ILocator, (void**)&pDVBTLocator);
// sanity check
assert(hr == NOERROR);
StartChanges();
CommitChanges();
StartChanges();
hr = performDVBTTune(pDVBTRequest, pDVBTLocator);
pDVBTLocator->Release();
pDVBTRequest->Release();
CheckChanges();
CommitChanges();
StartChanges();
return NOERROR;
}
HRESULT
@ -233,20 +280,431 @@ CScanningTunner::AutoProgram()
return E_NOTIMPL;
}
//-------------------------------------------------------------------
HRESULT
STDMETHODCALLTYPE
CScanningTunner::performDVBTTune(
IDVBTuneRequest * pDVBTRequest,
IDVBTLocator *pDVBTLocator)
{
HRESULT hr = S_OK;
ULONG Index;
IBDA_Topology *pTopo;
IUnknown *pNode;
IBDA_FrequencyFilter * pFrequency;
IBDA_LNBInfo * pLnbInfo;
IBDA_DigitalDemodulator *pDigitalDemo;
LONG BandWidth;
LONG Frequency;
LONG SymbolRate;
FECMethod InnerFEC, OuterFEC;
BinaryConvolutionCodeRate InnerFECRate, OuterFECRate;
ModulationType Modulation;
pDVBTLocator->get_Bandwidth(&BandWidth);
pDVBTLocator->get_CarrierFrequency(&Frequency);
pDVBTLocator->get_InnerFEC(&InnerFEC);
pDVBTLocator->get_InnerFECRate(&InnerFECRate);
pDVBTLocator->get_Modulation(&Modulation);
pDVBTLocator->get_OuterFEC(&OuterFEC);
pDVBTLocator->get_OuterFECRate(&OuterFECRate);
pDVBTLocator->get_SymbolRate(&SymbolRate);
WCHAR Buffer[1000];
swprintf(Buffer, L"BandWidth %lu Frequency %lu Rate %lu InnerFEC %ld OuterFEC %ld InnerFECRate %ld OuterFECRate %ld Modulation %lu\n",
BandWidth, Frequency, SymbolRate, InnerFEC, OuterFEC, InnerFECRate, OuterFECRate, Modulation);
OutputDebugStringW(Buffer);
for(Index = 0; Index < m_DeviceFilters.size(); Index++)
{
// get device filter
IUnknown * pFilter = m_DeviceFilters[Index];
if (!pFilter)
continue;
hr = pFilter->QueryInterface(IID_IBDA_Topology, (void**)&pTopo);
// sanity check
assert(hr == NOERROR);
pNode = NULL;
hr = pTopo->GetControlNode(0, 1, 0, &pNode); //HACK
WCHAR Buffer[100];
swprintf(Buffer, L"CScanningTunner::performDVBTTune GetControlNode %lx\n", hr);
OutputDebugStringW(Buffer);
if (FAILED(hr))
continue;
// sanity check
assert(hr == NOERROR);
assert(pNode);
hr = pNode->QueryInterface(IID_IBDA_FrequencyFilter, (void**)&pFrequency);
swprintf(Buffer, L"CScanningTunner::performDVBTTune IID_IBDA_FrequencyFilter hr %lx\n", hr);
OutputDebugStringW(Buffer);
// sanity check
assert(hr == NOERROR);
hr = SetFrequency(pFrequency, 1000 /* FIXME */, Frequency, BDA_POLARISATION_NOT_DEFINED /* FIXME */, BDA_RANGE_NOT_SET /* FIXME */, BandWidth);
swprintf(Buffer, L"CScanningTunner::performDVBTTune SetFrequency hr %lx\n", hr);
OutputDebugStringW(Buffer);
//sanity check
assert(hr == NOERROR);
// release interface
pFrequency->Release();
hr = pNode->QueryInterface(IID_IBDA_LNBInfo, (void**)&pLnbInfo);
swprintf(Buffer, L"CScanningTunner::performDVBTTune IID_IBDA_LNBInfo hr %lx\n", hr);
OutputDebugStringW(Buffer);
// sanity check
assert(hr == NOERROR);
hr = SetLnbInfo(pLnbInfo, ULONG_MAX /* FIXME */, ULONG_MAX /* FIXME*/, ULONG_MAX /*FIXME*/);
swprintf(Buffer, L"CScanningTunner::performDVBTTune SetLnbInfo hr %lx\n", hr);
OutputDebugStringW(Buffer);
// sanity check
assert(hr == NOERROR);
// release interface
pLnbInfo->Release();
hr = pNode->QueryInterface(IID_IBDA_DigitalDemodulator, (void**)&pDigitalDemo);
swprintf(Buffer, L"CScanningTunner::performDVBTTune IID_IBDA_DigitalDemodulator hr %lx\n", hr);
OutputDebugStringW(Buffer);
// sanity check
assert(hr == NOERROR);
hr = SetDigitalDemodulator(pDigitalDemo, Modulation, InnerFEC, InnerFECRate, OuterFEC, OuterFECRate, SymbolRate);
swprintf(Buffer, L"CScanningTunner::performDVBTTune SetDigitalDemodulator hr %lx\n", hr);
OutputDebugStringW(Buffer);
// sanity check
assert(hr == NOERROR);
// release interface
pDigitalDemo->Release();
// release control node
pNode->Release();
// release IBDA_Topology;
pTopo->Release();
}
return hr;
}
HRESULT
STDMETHODCALLTYPE
CScanningTunner::CheckChanges()
{
ULONG Index;
HRESULT hResult = NOERROR;
IBDA_DeviceControl * pDeviceControl;
for(Index = 0; Index < m_DeviceFilters.size(); Index++)
{
// get filter
IUnknown * pFilter = m_DeviceFilters[Index];
if (!pFilter)
continue;
// query for IBDA_DeviceControl interface
hResult = pFilter->QueryInterface(IID_IBDA_DeviceControl, (void**)&pDeviceControl);
// sanity check
assert(hResult == NOERROR);
//start changes
hResult = pDeviceControl->CheckChanges();
// fix for unimplemented
if (hResult == E_NOTIMPL)
hResult = NOERROR;
// release interface
pDeviceControl->Release();
if (FAILED(hResult))
{
//shouldnt happen
break;
}
}
// done
return hResult;
}
HRESULT
STDMETHODCALLTYPE
CScanningTunner::CommitChanges()
{
ULONG Index;
HRESULT hResult = NOERROR;
IBDA_DeviceControl * pDeviceControl;
for(Index = 0; Index < m_DeviceFilters.size(); Index++)
{
// get filter
IUnknown * pFilter = m_DeviceFilters[Index];
if (!pFilter)
continue;
// query for IBDA_DeviceControl interface
HRESULT hr = pFilter->QueryInterface(IID_IBDA_DeviceControl, (void**)&pDeviceControl);
// sanity check
assert(hr == NOERROR);
//start changes
hr = pDeviceControl->CommitChanges();
// fix for unimplemented
if (hr == E_NOTIMPL)
hr = NOERROR;
if (FAILED(hr))
{
pDeviceControl->StartChanges();
pDeviceControl->CommitChanges();
hResult = E_UNEXPECTED;
}
// release interface
pDeviceControl->Release();
}
//done
return hResult;
}
HRESULT
STDMETHODCALLTYPE
CScanningTunner::StartChanges()
{
ULONG Index;
IBDA_DeviceControl * pDeviceControl;
for(Index = 0; Index < m_DeviceFilters.size(); Index++)
{
// get filter
IUnknown * pFilter = m_DeviceFilters[Index];
if (!pFilter)
continue;
// query for IBDA_DeviceControl interface
HRESULT hr = pFilter->QueryInterface(IID_IBDA_DeviceControl, (void**)&pDeviceControl);
// sanity check
assert(hr == NOERROR);
//start changes
hr = pDeviceControl->StartChanges();
// release interface
pDeviceControl->Release();
// fix for unimplemented
if (hr == E_NOTIMPL)
hr = NOERROR;
if (FAILED(hr))
return hr;
}
// now commit the changes
for(Index = 0; Index < m_DeviceFilters.size(); Index++)
{
// get filter
IUnknown * pFilter = m_DeviceFilters[Index];
if (!pFilter)
continue;
// query for IBDA_DeviceControl interface
HRESULT hr = pFilter->QueryInterface(IID_IBDA_DeviceControl, (void**)&pDeviceControl);
// sanity check
assert(hr == NOERROR);
hr = pDeviceControl->CommitChanges();
// release interface
pDeviceControl->Release();
}
// done
return NOERROR;
}
HRESULT
STDMETHODCALLTYPE
CScanningTunner::SetLnbInfo(
IBDA_LNBInfo * pLnbInfo,
ULONG ulLOFLow,
ULONG ulLOFHigh,
ULONG ulSwitchFrequency)
{
HRESULT hr;
hr = pLnbInfo->put_LocalOscilatorFrequencyLowBand(ulLOFLow);
if (hr == MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_FOUND) || hr == MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_SET_NOT_FOUND))
hr = NOERROR;
if (FAILED(hr))
return hr;
hr = pLnbInfo->put_LocalOscilatorFrequencyHighBand(ulLOFHigh);
if (hr == MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_FOUND) || hr == MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_SET_NOT_FOUND))
hr = NOERROR;
if (FAILED(hr))
return hr;
hr = pLnbInfo->put_HighLowSwitchFrequency(ulSwitchFrequency);
if (hr == MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_FOUND) || hr == MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_SET_NOT_FOUND))
hr = NOERROR;
return hr;
}
HRESULT
CScanningTunner::SetFrequency(
IBDA_FrequencyFilter * pFrequency,
ULONG FrequencyMultiplier,
ULONG Frequency,
Polarisation Polarity,
ULONG Range,
ULONG Bandwidth)
{
HRESULT hr;
hr = pFrequency->put_FrequencyMultiplier(FrequencyMultiplier);
if (FAILED(hr))
return hr;
hr = pFrequency->put_Frequency(Frequency);
if (FAILED(hr))
return hr;
hr = pFrequency->put_Polarity(Polarity);
if (hr == MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_FOUND))
hr = NOERROR;
if (FAILED(hr))
return hr;
hr = pFrequency->put_Range(Range);
if (hr == MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_FOUND))
hr = NOERROR;
if (FAILED(hr))
return hr;
hr = pFrequency->put_Bandwidth(Bandwidth);
return hr;
}
HRESULT
STDMETHODCALLTYPE
CScanningTunner::SetDigitalDemodulator(
IBDA_DigitalDemodulator * pDigitalDemo,
ModulationType ModType,
FECMethod InnerFEC,
BinaryConvolutionCodeRate InnerFECRate,
FECMethod OuterFEC,
BinaryConvolutionCodeRate OuterFECRate,
ULONG SymbolRate)
{
HRESULT hr;
hr = pDigitalDemo->put_ModulationType(&ModType);
if (hr == MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_FOUND) || hr == MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_SET_NOT_FOUND))
hr = NOERROR;
if (FAILED(hr))
return hr;
hr = pDigitalDemo->put_InnerFECMethod(&InnerFEC);
if (hr == MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_FOUND) || hr == MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_SET_NOT_FOUND))
hr = NOERROR;
if (FAILED(hr))
return hr;
hr = pDigitalDemo->put_InnerFECRate(&InnerFECRate);
if (hr == MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_FOUND) || hr == MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_SET_NOT_FOUND))
hr = NOERROR;
if (FAILED(hr))
return hr;
hr = pDigitalDemo->put_OuterFECMethod(&OuterFEC);
if (hr == MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_FOUND) || hr == MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_SET_NOT_FOUND))
hr = NOERROR;
if (FAILED(hr))
return hr;
hr = pDigitalDemo->put_OuterFECRate(&OuterFECRate);
if (hr == MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_FOUND) || hr == MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_SET_NOT_FOUND))
hr = NOERROR;
if (FAILED(hr))
return hr;
hr = pDigitalDemo->put_SymbolRate(&SymbolRate);
if (hr == MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_FOUND) || hr == MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_SET_NOT_FOUND))
hr = NOERROR;
if (FAILED(hr))
return hr;
SpectralInversion Inversion = BDA_SPECTRAL_INVERSION_NOT_DEFINED;
hr = pDigitalDemo->put_SpectralInversion(&Inversion);
if (hr == MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_FOUND) || hr == MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_SET_NOT_FOUND))
hr = NOERROR;
return hr;
}
HRESULT
WINAPI
CScanningTunner_fnConstructor(
IUnknown *pUnknown,
std::vector<IUnknown*> & DeviceFilter,
REFIID riid,
LPVOID * ppv)
{
CScanningTunner * handler = new CScanningTunner();
CScanningTunner * handler = new CScanningTunner(DeviceFilter);
#ifdef MSDVBNP_TRACE
WCHAR Buffer[MAX_PATH];
LPOLESTR lpstr;
StringFromCLSID(riid, &lpstr);
swprintf(Buffer, L"CScanningTunner_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown);
swprintf(Buffer, L"CScanningTunner_fnConstructor riid %s\n", lpstr);
OutputDebugStringW(Buffer);
#endif

View file

@ -48,7 +48,27 @@ HRESULT
WINAPI
DllUnregisterServer(void)
{
return S_OK;
ULONG Index = 0;
LPOLESTR pStr;
HRESULT hr = S_OK;
HKEY hClass;
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"CLSID", 0, KEY_SET_VALUE, &hClass) != ERROR_SUCCESS)
return E_FAIL;
do
{
hr = StringFromCLSID(*InterfaceTable[Index].riid, &pStr);
if (FAILED(hr))
break;
RegDeleteKeyW(hClass, pStr);
CoTaskMemFree(pStr);
Index++;
}while(InterfaceTable[Index].lpfnCI != 0);
RegCloseKey(hClass);
return hr;
}
extern "C"
@ -57,7 +77,39 @@ HRESULT
WINAPI
DllRegisterServer(void)
{
return S_OK;
ULONG Index = 0;
LPOLESTR pStr;
HRESULT hr = S_OK;
HKEY hClass, hKey, hSubKey;
static LPCWSTR ModuleName = L"msvidctl.ax";
static LPCWSTR ThreadingModel = L"Both";
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"CLSID", 0, KEY_WRITE, &hClass) != ERROR_SUCCESS)
return E_FAIL;
do
{
hr = StringFromCLSID(*InterfaceTable[Index].riid, &pStr);
if (FAILED(hr))
break;
if (RegCreateKeyExW(hClass, pStr, 0, 0, 0, KEY_WRITE, NULL, &hKey, 0) == ERROR_SUCCESS)
{
if (RegCreateKeyExW(hKey, L"InprocServer32", 0, 0, 0, KEY_WRITE, NULL, &hSubKey, 0) == ERROR_SUCCESS)
{
RegSetValueExW(hSubKey, 0, 0, REG_SZ, (const BYTE*)ModuleName, (wcslen(ModuleName) + 1) * sizeof(WCHAR));
RegSetValueExW(hSubKey, L"ThreadingModel", 0, REG_SZ, (const BYTE*)ThreadingModel, (wcslen(ThreadingModel) + 1) * sizeof(WCHAR));
RegCloseKey(hSubKey);
}
RegCloseKey(hKey);
}
CoTaskMemFree(pStr);
Index++;
}while(InterfaceTable[Index].lpfnCI != 0);
RegCloseKey(hClass);
return hr;
}
KSDDKAPI

View file

@ -3,6 +3,7 @@
<group>
<module name="msvidctl" type="win32dll" baseaddress="${BASEADDRESS_MSVIDCTL}" installbase="system32" installname="msvidctl.dll">
<importlibrary definition="msvidctl.spec" />
<autoregister infsection="OleControlDlls" type="DllRegisterServer" />
<include base="msvidctl">.</include>
<library>ntdll</library>
<library>kernel32</library>

View file

@ -12,6 +12,7 @@
<include base="ReactOS">include/reactos/subsys</include>
<define name="__NTDLL__" />
<define name="_NTOSKRNL_" />
<define name="CRTDLL" />
<library>rtl</library>
<library>ntdllsys</library>
<library>libcntpr</library>

View file

@ -5,6 +5,7 @@
<define name="USE_MSVCRT_PREFIX" />
<define name="_MSVCRT_LIB_" />
<define name="_MSVCRT_" />
<define name="CRTDLL" />
<define name="_CTYPE_DISABLE_MACROS" />
<define name="_NO_INLINING" />

View file

@ -673,7 +673,7 @@ GetRelAbs(
/*
* @implemented
*/
DWORD
INT
WINAPI
SetRelAbs(
HDC hdc,

View file

@ -1671,7 +1671,7 @@ RemoveFontResourceExW(LPCWSTR lpFileName,
/*
* @implemented
*/
DWORD
LONG
WINAPI
GdiGetCharDimensions(HDC hdc, LPTEXTMETRICW lptm, LONG *height)
{

View file

@ -759,13 +759,22 @@
@ stdcall ResetWriteWatch(ptr long)
@ stdcall RestoreLastError(long) ntdll.RtlRestoreLastWin32Error
@ stdcall ResumeThread(long)
@ stdcall -arch=x86_64 RtlAddFunctionTable(ptr long double)
@ stdcall RtlCaptureContext(ptr) ntdll.RtlCaptureContext
@ stdcall RtlCaptureStackBackTrace(long long ptr ptr) ntdll.RtlCaptureStackBackTrace
@ stdcall -arch=x86_64 RtlCompareMemory(ptr ptr ptr)
@ stdcall -arch=x86_64 RtlCopyMemory(ptr ptr ptr)
@ stdcall -arch=x86_64 RtlDeleteFunctionTable(ptr)
@ stdcall RtlFillMemory(ptr long long) ntdll.RtlFillMemory
@ stdcall -arch=x86_64 RtlInstallFunctionTableCallback(double double long ptr ptr ptr)
@ stdcall -arch=x86_64 RtlLookupFunctionEntry(ptr ptr ptr) ntdll.RtlLookupFunctionEntry
@ stdcall RtlMoveMemory(ptr ptr long) ntdll.RtlMoveMemory
@ stdcall -arch=x86_64 RtlPcToFileHeader(ptr ptr) ntdll.RtlPcToFileHeader
@ stdcall -arch=x86_64 RtlRaiseException(ptr) ntdll.RtlRaiseException
@ stdcall -arch=x86_64 RtlRestoreContext(ptr ptr) ntdll.RtlRestoreContext
@ stdcall RtlUnwind(ptr ptr ptr long) ntdll.RtlUnwind
@ stdcall RtlVirtualUnwind(ptr ptr ptr long) ntdll.RtlVirtualUnwind
@ stdcall RtlLookupFunctionEntry(ptr ptr ptr) ntdll.RtlLookupFunctionEntry
@ stdcall -arch=x86_64 RtlUnwindEx(ptr ptr ptr ptr ptr ptr) ntdll.RtlUnwindEx
@ stdcall -arch=x86_64 RtlVirtualUnwind(ptr ptr ptr long) ntdll.RtlVirtualUnwind
@ stdcall RtlZeroMemory(ptr long) ntdll.RtlZeroMemory
@ stdcall ScrollConsoleScreenBufferA(long ptr ptr ptr ptr)
@ stdcall ScrollConsoleScreenBufferW(long ptr ptr ptr ptr)

View file

@ -158,9 +158,9 @@ EXPORTS
__p__winminor @153
__p__winver @154
__p__wpgmptr @155
; __pctype_func @156
__pctype_func @156
__pioinfo @157 DATA
; __pwctype_func @158
__pwctype_func @158
__pxcptinfoptrs @159
__set_app_type @160
__setlc_active @161 DATA
@ -583,7 +583,7 @@ EXPORTS
_wcsupr @576
_wctime @577
; _wctime64 @578
; _wctype @579
_wctype @579
_wenviron @580 DATA
_wexecl @581
_wexecle @582

View file

@ -8,6 +8,7 @@
<define name="_MT" />
<define name="_CTYPE_DISABLE_MACROS" />
<define name="_NO_INLINING" />
<define name="CRTDLL" />
<linkerflag linkerset="ld">-enable-stdcall-fixup</linkerflag>
<!-- __MINGW_IMPORT needs to be defined differently because it's defined

View file

@ -6,6 +6,7 @@
<include base="msvcrt20">.</include>
<include base="ReactOS">include/reactos/wine</include>
<define name="__WINESRC__" />
<define name="CRTDLL" />
<file>msvcrt20.c</file>
<library>wine</library>
<library>msvcrt</library>

View file

@ -6,6 +6,7 @@
<include base="msvcrt40">.</include>
<include base="ReactOS">include/reactos/wine</include>
<define name="__WINESRC__" />
<define name="CRTDLL" />
<file>msvcrt40.c</file>
<library>wine</library>
</module>

View file

@ -3662,7 +3662,7 @@ HKEY WINAPI SetupDiOpenClassRegKeyExW(
if (!(l = RegOpenKeyExW(HKLM,
lpKeyName,
0,
0,
samDesired,
&hClassesKey)))
{
if (MachineName != NULL)
@ -3699,8 +3699,209 @@ BOOL WINAPI SetupDiOpenDeviceInterfaceW(
DWORD OpenFlags,
PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData)
{
FIXME("%p %s %08x %p\n",
struct DeviceInfoSet * list;
PCWSTR pEnd;
DWORD dwLength, dwError, dwIndex, dwKeyName, dwSubIndex;
CLSID ClassId;
WCHAR Buffer[MAX_PATH + 1];
WCHAR SymBuffer[MAX_PATH + 1];
WCHAR InstancePath[MAX_PATH + 1];
HKEY hKey, hDevKey, hSymKey;
struct DeviceInfo * deviceInfo;
struct DeviceInterface *deviceInterface;
BOOL Ret;
PLIST_ENTRY ItemList;
PLIST_ENTRY InterfaceListEntry;
TRACE("%p %s %08x %p\n",
DeviceInfoSet, debugstr_w(DevicePath), OpenFlags, DeviceInterfaceData);
if (DeviceInterfaceData && DeviceInterfaceData->cbSize != sizeof(SP_DEVICE_INTERFACE_DATA))
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
{
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
list = (struct DeviceInfoSet * )DeviceInfoSet;
dwLength = wcslen(DevicePath);
if (dwLength < 39)
{
/* path must be at least a guid length + L'\0' */
SetLastError(ERROR_BAD_PATHNAME);
return FALSE;
}
if (DevicePath[0] != L'\\' ||
DevicePath[1] != L'\\' ||
(DevicePath[2] != L'?' && DevicePath[2] != L'.') ||
DevicePath[3] != L'\\')
{
/* invalid formatted path */
SetLastError(ERROR_BAD_PATHNAME);
return FALSE;
}
/* check for reference strings */
pEnd = wcschr(&DevicePath[4], L'\\');
if (!pEnd)
{
/* no reference string */
pEnd = DevicePath + dwLength;
}
/* copy guid */
wcscpy(Buffer, pEnd - 37);
Buffer[36] = L'\0';
dwError = UuidFromStringW(Buffer, &ClassId);
if (dwError != NOERROR)
{
/* invalid formatted path */
SetLastError(ERROR_BAD_PATHNAME);
return FALSE;
}
hKey = SetupDiOpenClassRegKeyExW(&ClassId, KEY_READ, DIOCR_INTERFACE, list->MachineName, NULL);
if (hKey == INVALID_HANDLE_VALUE)
{
/* invalid device class */
return FALSE;
}
ItemList = list->ListHead.Flink;
while (ItemList != &list->ListHead)
{
deviceInfo = CONTAINING_RECORD(ItemList, struct DeviceInfo, ListEntry);
InterfaceListEntry = deviceInfo->InterfaceListHead.Flink;
while (InterfaceListEntry != &deviceInfo->InterfaceListHead)
{
deviceInterface = CONTAINING_RECORD(InterfaceListEntry, struct DeviceInterface, ListEntry);
if (!IsEqualIID(&deviceInterface->InterfaceClassGuid, &ClassId))
{
InterfaceListEntry = InterfaceListEntry->Flink;
continue;
}
if (!wcsicmp(deviceInterface->SymbolicLink, DevicePath))
{
if (DeviceInterfaceData)
{
DeviceInterfaceData->Reserved = (ULONG_PTR)deviceInterface;
DeviceInterfaceData->Flags = deviceInterface->Flags;
CopyMemory(&DeviceInterfaceData->InterfaceClassGuid, &ClassId, sizeof(GUID));
}
return TRUE;
}
}
}
dwIndex = 0;
do
{
Buffer[0] = 0;
dwKeyName = sizeof(Buffer) / sizeof(WCHAR);
dwError = RegEnumKeyExW(hKey, dwIndex, Buffer, &dwKeyName, NULL, NULL, NULL, NULL);
if (dwError != ERROR_SUCCESS)
break;
if (RegOpenKeyExW(hKey, Buffer, 0, KEY_READ, &hDevKey) != ERROR_SUCCESS)
break;
dwSubIndex = 0;
InstancePath[0] = 0;
dwKeyName = sizeof(InstancePath);
dwError = RegQueryValueExW(hDevKey, L"DeviceInstance", NULL, NULL, (LPBYTE)InstancePath, &dwKeyName);
while(TRUE)
{
Buffer[0] = 0;
dwKeyName = sizeof(Buffer) / sizeof(WCHAR);
dwError = RegEnumKeyExW(hDevKey, dwSubIndex, Buffer, &dwKeyName, NULL, NULL, NULL, NULL);
if (dwError != ERROR_SUCCESS)
break;
dwError = RegOpenKeyExW(hDevKey, Buffer, 0, KEY_READ, &hSymKey);
if (dwError != ERROR_SUCCESS)
break;
/* query for symbolic link */
dwKeyName = sizeof(SymBuffer);
SymBuffer[0] = L'\0';
dwError = RegQueryValueExW(hSymKey, L"SymbolicLink", NULL, NULL, (LPBYTE)SymBuffer, &dwKeyName);
if (dwError != ERROR_SUCCESS)
{
RegCloseKey(hSymKey);
break;
}
if (!wcsicmp(SymBuffer, DevicePath))
{
Ret = CreateDeviceInfo(list, InstancePath, &ClassId, &deviceInfo);
RegCloseKey(hSymKey);
RegCloseKey(hDevKey);
RegCloseKey(hKey);
if (Ret)
{
deviceInterface = HeapAlloc(GetProcessHeap(), 0, sizeof(struct DeviceInterface) + (wcslen(SymBuffer) + 1) * sizeof(WCHAR));
if (deviceInterface)
{
CopyMemory(&deviceInterface->InterfaceClassGuid, &ClassId, sizeof(GUID));
deviceInterface->DeviceInfo = deviceInfo;
deviceInterface->Flags = SPINT_ACTIVE; //FIXME
wcscpy(deviceInterface->SymbolicLink, SymBuffer);
InsertTailList(&deviceInfo->InterfaceListHead, &deviceInterface->ListEntry);
InsertTailList(&list->ListHead, &deviceInfo->ListEntry);
if (DeviceInterfaceData)
{
DeviceInterfaceData->Reserved = (ULONG_PTR)deviceInterface;
DeviceInterfaceData->Flags = deviceInterface->Flags;
CopyMemory(&DeviceInterfaceData->InterfaceClassGuid, &ClassId, sizeof(GUID));
}
else
{
Ret = FALSE;
SetLastError(ERROR_INVALID_USER_BUFFER);
}
}
}
else
{
HeapFree(GetProcessHeap(), 0, deviceInfo);
Ret = FALSE;
}
return Ret;
}
RegCloseKey(hSymKey);
dwSubIndex++;
}
RegCloseKey(hDevKey);
dwIndex++;
}while(TRUE);
RegCloseKey(hKey);
return FALSE;
}

View file

@ -1196,64 +1196,44 @@ VOID FASTCALL
ScrollTrackScrollBar(HWND Wnd, INT SBType, POINT Pt)
{
MSG Msg;
RECT WindowRect;
UINT XOffset, YOffset;
POINT TopLeft;
UINT XOffset = 0, YOffset = 0;
if (SB_CTL != SBType)
{
GetWindowRect(Wnd, &WindowRect);
Pt.x -= WindowRect.left;
Pt.y -= WindowRect.top;
TopLeft.x = WindowRect.left;
TopLeft.y = WindowRect.top;
ScreenToClient(Wnd, &TopLeft);
XOffset = - TopLeft.x;
YOffset = - TopLeft.y;
}
else
{
XOffset = 0;
YOffset = 0;
}
if (SBType != SB_CTL)
{
PWND pwnd = ValidateHwnd(Wnd);
if (!pwnd) return;
XOffset = pwnd->rcClient.left - pwnd->rcWindow.left;
YOffset = pwnd->rcClient.top - pwnd->rcWindow.top;
ScreenToClient(Wnd, &Pt);
Pt.x += XOffset;
Pt.y += YOffset;
}
IntScrollHandleScrollEvent(Wnd, SBType, WM_LBUTTONDOWN, Pt);
do
{
if (! GetMessageW(&Msg, 0, 0, 0))
{
break;
}
if (CallMsgFilterW(&Msg, MSGF_SCROLLBAR))
{
continue;
}
switch(Msg.message)
{
case WM_SYSTIMER:
case WM_LBUTTONUP:
case WM_MOUSEMOVE:
Pt.x = LOWORD(Msg.lParam) + XOffset;
Pt.y = HIWORD(Msg.lParam) + YOffset;
IntScrollHandleScrollEvent(Wnd, SBType, Msg.message, Pt);
break;
default:
TranslateMessage(&Msg);
DispatchMessageW(&Msg);
break;
}
if (! IsWindow(Wnd))
{
{
if (!GetMessageW(&Msg, 0, 0, 0)) break;
if (CallMsgFilterW(&Msg, MSGF_SCROLLBAR)) continue;
if ( Msg.message == WM_LBUTTONUP ||
Msg.message == WM_MOUSEMOVE ||
(Msg.message == WM_SYSTIMER && Msg.wParam == SCROLL_TIMER))
{
Pt.x = LOWORD(Msg.lParam) + XOffset;
Pt.y = HIWORD(Msg.lParam) + YOffset;
IntScrollHandleScrollEvent(Wnd, SBType, Msg.message, Pt);
}
else
{
TranslateMessage(&Msg);
DispatchMessageW(&Msg);
}
if (!IsWindow(Wnd))
{
ReleaseCapture();
break;
}
}
while (WM_LBUTTONUP != Msg.message);
}
} while (Msg.message != WM_LBUTTONUP && GetCapture() == Wnd);
}

View file

@ -522,7 +522,7 @@ GetThreadDesktop(
HDESK
WINAPI
OpenDesktopA(
LPSTR lpszDesktop,
LPCSTR lpszDesktop,
DWORD dwFlags,
BOOL fInherit,
ACCESS_MASK dwDesiredAccess)
@ -558,7 +558,7 @@ OpenDesktopA(
HDESK
WINAPI
OpenDesktopW(
LPWSTR lpszDesktop,
LPCWSTR lpszDesktop,
DWORD dwFlags,
BOOL fInherit,
ACCESS_MASK dwDesiredAccess)

View file

@ -18,7 +18,7 @@
* @implemented
*/
HWINSTA WINAPI
CreateWindowStationA(LPSTR lpwinsta,
CreateWindowStationA(LPCSTR lpwinsta,
DWORD dwReserved,
ACCESS_MASK dwDesiredAccess,
LPSECURITY_ATTRIBUTES lpsa)
@ -52,7 +52,7 @@ CreateWindowStationA(LPSTR lpwinsta,
* @implemented
*/
HWINSTA WINAPI
CreateWindowStationW(LPWSTR lpwinsta,
CreateWindowStationW(LPCWSTR lpwinsta,
DWORD dwReserved,
ACCESS_MASK dwDesiredAccess,
LPSECURITY_ATTRIBUTES lpsa)
@ -266,7 +266,7 @@ EnumWindowStationsW(WINSTAENUMPROCW EnumFunc,
* @implemented
*/
HWINSTA WINAPI
OpenWindowStationA(LPSTR lpszWinSta,
OpenWindowStationA(LPCSTR lpszWinSta,
BOOL fInherit,
ACCESS_MASK dwDesiredAccess)
{
@ -298,7 +298,7 @@ OpenWindowStationA(LPSTR lpszWinSta,
* @implemented
*/
HWINSTA WINAPI
OpenWindowStationW(LPWSTR lpszWinSta,
OpenWindowStationW(LPCWSTR lpszWinSta,
BOOL fInherit,
ACCESS_MASK dwDesiredAccess)
{

View file

@ -851,10 +851,6 @@ DefWndHandleWindowPosChanging(HWND hWnd, WINDOWPOS* Pos)
return 0;
}
/* Undocumented flags. */
#define SWP_NOCLIENTMOVE 0x0800
#define SWP_NOCLIENTSIZE 0x1000
LRESULT
DefWndHandleWindowPosChanged(HWND hWnd, WINDOWPOS* Pos)
{

View file

@ -37,8 +37,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(user32);
/* GLOBALS *******************************************************************/
#define DSS_DEFAULT 0x0040 /* Make it bold */
static const WORD wPattern_AA55[8] = { 0xaaaa, 0x5555, 0xaaaa, 0x5555,
0xaaaa, 0x5555, 0xaaaa, 0x5555 };

View file

@ -9,7 +9,7 @@
#pragma once
#define NOEXTAPI
#include <ntddk.h>
#include <ntifs.h>
#define NDEBUG
#include <halfuncs.h>
#include <stdio.h>

View file

@ -1,188 +0,0 @@
/*
* PROJECT: ReactOS Kernel
* LICENSE: GPL - See COPYING in the top level directory
* FILE: drivers/battery/cmbatt/cmbatt.c
* PURPOSE: Control Method Battery Miniclass Driver
* PROGRAMMERS: Cameron Gutman (cameron.gutman@reactos.org)
*/
#include <cmbatt.h>
#define NDEBUG
#include <debug.h>
LIST_ENTRY BatteryList;
KSPIN_LOCK BatteryListLock;
VOID
NTAPI
CmBattUnload(PDRIVER_OBJECT DriverObject)
{
DPRINT("Control method battery miniclass driver unloaded\n");
}
NTSTATUS
NTAPI
CmBattDeviceControl(PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
PCMBATT_DEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
NTSTATUS Status;
Status = BatteryClassIoctl(DeviceExtension->BattClassHandle,
Irp);
if (Status == STATUS_NOT_SUPPORTED)
{
Irp->IoStatus.Status = Status;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
}
return Status;
}
NTSTATUS
NTAPI
CmBattPnP(PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
PCMBATT_DEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
UNIMPLEMENTED
IoSkipCurrentIrpStackLocation(Irp);
return IoCallDriver(DeviceExtension->Ldo, Irp);
}
NTSTATUS
NTAPI
CmBattSystemControl(PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
UNIMPLEMENTED
Irp->IoStatus.Status = STATUS_WMI_GUID_NOT_FOUND;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_WMI_GUID_NOT_FOUND;
}
NTSTATUS
NTAPI
CmBattPower(PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
PCMBATT_DEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
UNIMPLEMENTED
IoSkipCurrentIrpStackLocation(Irp);
PoStartNextPowerIrp(Irp);
return PoCallDriver(DeviceExtension->Ldo, Irp);
}
NTSTATUS
NTAPI
CmBattCreateClose(PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_SUCCESS;
}
NTSTATUS
NTAPI
CmBattAddDevice(PDRIVER_OBJECT DriverObject,
PDEVICE_OBJECT PhysicalDeviceObject)
{
NTSTATUS Status;
PDEVICE_OBJECT DeviceObject;
PCMBATT_DEVICE_EXTENSION DeviceExtension;
BATTERY_MINIPORT_INFO BattInfo;
Status = IoCreateDevice(DriverObject,
sizeof(CMBATT_DEVICE_EXTENSION),
NULL,
FILE_DEVICE_BATTERY,
0,
FALSE,
&DeviceObject);
if (!NT_SUCCESS(Status))
return Status;
DeviceExtension = DeviceObject->DeviceExtension;
DeviceExtension->Pdo = PhysicalDeviceObject;
DeviceExtension->Fdo = DeviceObject;
DeviceExtension->Ldo = IoAttachDeviceToDeviceStack(DeviceObject,
PhysicalDeviceObject);
DeviceObject->Flags |= DO_BUFFERED_IO | DO_POWER_PAGABLE;
/* We require an extra stack entry */
DeviceObject->StackSize = PhysicalDeviceObject->StackSize + 2;
BattInfo.MajorVersion = BATTERY_CLASS_MAJOR_VERSION;
BattInfo.MinorVersion = BATTERY_CLASS_MINOR_VERSION;
BattInfo.Context = DeviceExtension;
BattInfo.QueryTag = CmBattQueryTag;
BattInfo.QueryInformation = CmBattQueryInformation;
BattInfo.SetInformation = CmBattSetInformation;
BattInfo.QueryStatus = CmBattQueryStatus;
BattInfo.SetStatusNotify = CmBattSetStatusNotify;
BattInfo.DisableStatusNotify = CmBattDisableStatusNotify;
BattInfo.Pdo = PhysicalDeviceObject;
BattInfo.DeviceName = NULL;
Status = BatteryClassInitializeDevice(&BattInfo,
&DeviceExtension->BattClassHandle);
if (!NT_SUCCESS(Status))
{
IoDetachDevice(DeviceExtension->Ldo);
IoDeleteDevice(DeviceObject);
return Status;
}
ExInterlockedInsertTailList(&BatteryList,
&DeviceExtension->ListEntry,
&BatteryListLock);
DeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
DPRINT("Successfully registered battery with battc (0x%x)\n", DeviceExtension->BattClassHandle);
return STATUS_SUCCESS;
}
NTSTATUS
NTAPI
DriverEntry(PDRIVER_OBJECT DriverObject,
PUNICODE_STRING RegistryPath)
{
DPRINT("Control method battery miniclass driver initialized\n");
DriverObject->DriverUnload = CmBattUnload;
DriverObject->DriverExtension->AddDevice = CmBattAddDevice;
DriverObject->MajorFunction[IRP_MJ_POWER] = CmBattPower;
DriverObject->MajorFunction[IRP_MJ_PNP] = CmBattPnP;
DriverObject->MajorFunction[IRP_MJ_CREATE] = CmBattCreateClose;
DriverObject->MajorFunction[IRP_MJ_CLOSE] = CmBattCreateClose;
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = CmBattDeviceControl;
DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = CmBattSystemControl;
KeInitializeSpinLock(&BatteryListLock);
InitializeListHead(&BatteryList);
return STATUS_SUCCESS;
}

View file

@ -1,58 +0,0 @@
/*
* PROJECT: ReactOS Kernel
* LICENSE: GPL - See COPYING in the top level directory
* FILE: drivers/battery/cmbatt/cmbatt.h
* PURPOSE: Control Method Battery Miniclass Driver
* PROGRAMMERS: Cameron Gutman (cameron.gutman@reactos.org)
*/
#pragma once
#include <ntddk.h>
#include <batclass.h>
typedef struct _CMBATT_DEVICE_EXTENSION {
PDEVICE_OBJECT Pdo;
PDEVICE_OBJECT Ldo;
PDEVICE_OBJECT Fdo;
PVOID BattClassHandle;
LIST_ENTRY ListEntry;
} CMBATT_DEVICE_EXTENSION, *PCMBATT_DEVICE_EXTENSION;
NTSTATUS
NTAPI
CmBattQueryTag(PVOID Context,
PULONG BatteryTag);
NTSTATUS
NTAPI
CmBattDisableStatusNotify(PVOID Context);
NTSTATUS
NTAPI
CmBattSetStatusNotify(PVOID Context,
ULONG BatteryTag,
PBATTERY_NOTIFY BatteryNotify);
NTSTATUS
NTAPI
CmBattQueryInformation(PVOID Context,
ULONG BatteryTag,
BATTERY_QUERY_INFORMATION_LEVEL Level,
OPTIONAL LONG AtRate,
PVOID Buffer,
ULONG BufferLength,
PULONG ReturnedLength);
NTSTATUS
NTAPI
CmBattQueryStatus(PVOID Context,
ULONG BatteryTag,
PBATTERY_STATUS BatteryStatus);
NTSTATUS
NTAPI
CmBattSetInformation(PVOID Context,
ULONG BatteryTag,
BATTERY_SET_INFORMATION_LEVEL Level,
OPTIONAL PVOID Buffer);

View file

@ -1,11 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="cmbatt" type="kernelmodedriver" installbase="system32/drivers" installname="cmbatt.sys">
<library>ntoskrnl</library>
<library>hal</library>
<library>battc</library>
<include base="cmbatt">.</include>
<file>cmbatt.c</file>
<file>miniclass.c</file>
<file>cmbatt.rc</file>
</module>

View file

@ -1,5 +0,0 @@
#define REACTOS_VERSION_DLL
#define REACTOS_STR_FILE_DESCRIPTION "Control Method Battery Miniclass Driver\0"
#define REACTOS_STR_INTERNAL_NAME "cmbatt\0"
#define REACTOS_STR_ORIGINAL_FILENAME "cmbatt.sys\0"
#include <reactos/version.rc>

View file

@ -1,82 +0,0 @@
/*
* PROJECT: ReactOS Kernel
* LICENSE: GPL - See COPYING in the top level directory
* FILE: drivers/battery/cmbatt/miniclass.c
* PURPOSE: Control Method Battery Miniclass Driver
* PROGRAMMERS: Cameron Gutman (cameron.gutman@reactos.org)
*/
#include <cmbatt.h>
#define NDEBUG
#include <debug.h>
NTSTATUS
NTAPI
CmBattQueryTag(PVOID Context,
PULONG BatteryTag)
{
UNIMPLEMENTED
*BatteryTag = 0;
return STATUS_SUCCESS;
}
NTSTATUS
NTAPI
CmBattDisableStatusNotify(PVOID Context)
{
UNIMPLEMENTED
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
CmBattSetStatusNotify(PVOID Context,
ULONG BatteryTag,
PBATTERY_NOTIFY BatteryNotify)
{
UNIMPLEMENTED
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
CmBattQueryInformation(PVOID Context,
ULONG BatteryTag,
BATTERY_QUERY_INFORMATION_LEVEL Level,
OPTIONAL LONG AtRate,
PVOID Buffer,
ULONG BufferLength,
PULONG ReturnedLength)
{
UNIMPLEMENTED
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
CmBattQueryStatus(PVOID Context,
ULONG BatteryTag,
PBATTERY_STATUS BatteryStatus)
{
UNIMPLEMENTED
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
CmBattSetInformation(PVOID Context,
ULONG BatteryTag,
BATTERY_SET_INFORMATION_LEVEL Level,
OPTIONAL PVOID Buffer)
{
UNIMPLEMENTED
return STATUS_NOT_SUPPORTED;
}

View file

@ -4,7 +4,4 @@
<directory name="battc">
<xi:include href="battc/battc.rbuild" />
</directory>
<directory name="cmbatt">
<xi:include href="cmbatt/cmbatt.rbuild" />
</directory>
</group>

View file

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="cmbattx" type="kernelmodedriver" installbase="system32/drivers" installname="cmbattx.sys">
<module name="cmbatt" type="kernelmodedriver" installbase="system32/drivers" installname="cmbatt.sys">
<library>ntoskrnl</library>
<library>hal</library>
<library>battc</library>

View file

@ -567,8 +567,7 @@ CmBattCreateFdo(IN PDRIVER_OBJECT DriverObject,
}
/* Set FDO flags */
FdoDeviceObject->Flags |= DO_BUFFERED_IO;
FdoDeviceObject->Flags |= DO_MAP_IO_BUFFER;
FdoDeviceObject->Flags |= (DO_POWER_PAGABLE | DO_BUFFERED_IO);
FdoDeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
/* Initialize the extension */

View file

@ -21,8 +21,17 @@ NTAPI
CompBattOpenClose(IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
PAGED_CODE();
if (CompBattDebug & 0x100) DbgPrint("CompBatt: ENTERING OpenClose\n");
/* Complete the IRP with success */
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
/* Return success */
if (CompBattDebug & 0x100) DbgPrint("CompBatt: Exiting OpenClose\n");
return STATUS_SUCCESS;
}
NTSTATUS
@ -30,8 +39,28 @@ NTAPI
CompBattSystemControl(IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
PCOMPBATT_DEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
NTSTATUS Status;
PAGED_CODE();
if (CompBattDebug & 1) DbgPrint("CompBatt: ENTERING System Control\n");
/* Are we attached yet? */
if (DeviceExtension->AttachedDevice)
{
/* Send it up the stack */
IoSkipCurrentIrpStackLocation(Irp);
Status = IoCallDriver(DeviceExtension->AttachedDevice, Irp);
}
else
{
/* We don't support WMI */
Status = STATUS_NOT_SUPPORTED;
Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
}
/* Return status */
return Status;
}
NTSTATUS
@ -46,18 +75,47 @@ CompBattMonitorIrpComplete(IN PDEVICE_OBJECT DeviceObject,
NTSTATUS
NTAPI
CompBattMonitorIrpCompleteWorker(IN PCOMPBATT_BATTERY_ENTRY BatteryData)
CompBattMonitorIrpCompleteWorker(IN PCOMPBATT_BATTERY_DATA BatteryData)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
}
NTSTATUS
VOID
NTAPI
CompBattRecalculateTag(IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
PCOMPBATT_BATTERY_DATA BatteryData;
ULONG Tag;
PLIST_ENTRY ListHead, NextEntry;
if (CompBattDebug & 0x100) DbgPrint("CompBatt: ENTERING CompBattRecalculateTag\n");
/* Loop the battery list */
ExAcquireFastMutex(&DeviceExtension->Lock);
ListHead = &DeviceExtension->BatteryList;
NextEntry = ListHead->Flink;
while (NextEntry != ListHead)
{
/* Get the battery information and check if it has a tag */
BatteryData = CONTAINING_RECORD(NextEntry, COMPBATT_BATTERY_DATA, BatteryLink);
if (BatteryData->Flags & COMPBATT_TAG_ASSIGNED)
{
/* Generate the next tag and exit */
Tag = DeviceExtension->NextTag;
DeviceExtension->Flags |= COMPBATT_TAG_ASSIGNED;
DeviceExtension->Tag = Tag;
DeviceExtension->NextTag = Tag + 1;
break;
}
/* No tag for this device extension, clear it */
DeviceExtension->Tag = 0;
NextEntry = NextEntry->Flink;
}
/* We're done */
ExReleaseFastMutex(&DeviceExtension->Lock);
if (CompBattDebug & 0x100) DbgPrint("CompBatt: EXITING CompBattRecalculateTag\n");
}
NTSTATUS
@ -65,8 +123,23 @@ NTAPI
CompBattIoctl(IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
PCOMPBATT_DEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
NTSTATUS Status;
if (CompBattDebug & 1) DbgPrint("CompBatt: ENTERING Ioctl\n");
/* Let the class driver handle it */
Status = BatteryClassIoctl(DeviceExtension->ClassData, Irp);
if (Status == STATUS_NOT_SUPPORTED)
{
/* It failed, try the next driver up the stack */
Irp->IoStatus.Status = Status;
IoSkipCurrentIrpStackLocation(Irp);
Status = IoCallDriver(DeviceExtension->AttachedDevice, Irp);
}
/* Return status */
if (CompBattDebug & 1) DbgPrint("CompBatt: EXITING Ioctl\n");
return Status;
}
NTSTATUS
@ -74,16 +147,61 @@ NTAPI
CompBattQueryTag(IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension,
OUT PULONG Tag)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
NTSTATUS Status;
PAGED_CODE();
if (CompBattDebug & 0x100) DbgPrint("CompBatt: ENTERING QueryTag\n");
/* Was a tag assigned? */
if (!(DeviceExtension->Flags & COMPBATT_TAG_ASSIGNED))
{
/* Assign one */
CompBattRecalculateTag(DeviceExtension);
}
/* Do we have a tag now? */
if ((DeviceExtension->Flags & COMPBATT_TAG_ASSIGNED) && (DeviceExtension->Tag))
{
/* Return the tag */
*Tag = DeviceExtension->Tag;
Status = STATUS_SUCCESS;
}
else
{
/* No tag */
*Tag = 0;
Status = STATUS_NO_SUCH_DEVICE;
}
/* Return status */
if (CompBattDebug & 0x100) DbgPrint("CompBatt: EXITING QueryTag\n");
return Status;
}
NTSTATUS
NTAPI
CompBattDisableStatusNotify(IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
PCOMPBATT_BATTERY_DATA BatteryData;
PLIST_ENTRY ListHead, NextEntry;
if (CompBattDebug & 0x100) DbgPrint("CompBatt: ENTERING DisableStatusNotify\n");
/* Loop the battery list */
ExAcquireFastMutex(&DeviceExtension->Lock);
ListHead = &DeviceExtension->BatteryList;
NextEntry = ListHead->Flink;
while (NextEntry != ListHead)
{
/* Get the battery information and clear capacity data */
BatteryData = CONTAINING_RECORD(NextEntry, COMPBATT_BATTERY_DATA, BatteryLink);
BatteryData->WaitStatus.LowCapacity = 0;
BatteryData->WaitStatus.HighCapacity = 0x7FFFFFFF;
NextEntry = NextEntry->Flink;
}
/* Done */
ExReleaseFastMutex(&DeviceExtension->Lock);
if (CompBattDebug & 0x100) DbgPrint("CompBatt: EXITING DisableStatusNotify\n");
return STATUS_SUCCESS;
}
NTSTATUS
@ -117,11 +235,158 @@ CompBattQueryStatus(IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension,
NTSTATUS
NTAPI
CompBattGetBatteryInformation(OUT PBATTERY_INFORMATION BatteryInformation,
CompBattGetBatteryInformation(OUT PBATTERY_INFORMATION BatteryInfo,
IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
NTSTATUS Status = STATUS_SUCCESS;
BATTERY_QUERY_INFORMATION InputBuffer;
PCOMPBATT_BATTERY_DATA BatteryData;
PLIST_ENTRY ListHead, NextEntry;
if (CompBattDebug & 1) DbgPrint("CompBatt: ENTERING GetBatteryInformation\n");
/* Set defaults */
BatteryInfo->DefaultAlert1 = 0;
BatteryInfo->DefaultAlert2 = 0;
BatteryInfo->CriticalBias = 0;
/* Loop the battery list */
ExAcquireFastMutex(&DeviceExtension->Lock);
ListHead = &DeviceExtension->BatteryList;
NextEntry = ListHead->Flink;
while (NextEntry != ListHead)
{
/* Try to acquire the remove lock */
BatteryData = CONTAINING_RECORD(NextEntry, COMPBATT_BATTERY_DATA, BatteryLink);
if (NT_SUCCESS(IoAcquireRemoveLock(&BatteryData->RemoveLock, 0)))
{
/* Now release the device lock since the battery can't go away */
ExReleaseFastMutex(&DeviceExtension->Lock);
/* Build the query */
InputBuffer.BatteryTag = BatteryData->Tag;
InputBuffer.InformationLevel = BatteryInformation;
InputBuffer.AtRate = 0;
/* Make sure the battery has a tag */
if (BatteryData->Tag)
{
/* Do we already have the data? */
if (!(BatteryData->Flags & COMPBATT_BATTERY_INFORMATION_PRESENT))
{
/* Send the IOCTL to query the information */
RtlZeroMemory(&BatteryData->BatteryInformation,
sizeof(BatteryData->BatteryInformation));
Status = BatteryIoctl(IOCTL_BATTERY_QUERY_INFORMATION,
BatteryData->DeviceObject,
&InputBuffer,
sizeof(InputBuffer),
&BatteryData->BatteryInformation,
sizeof(BatteryData->BatteryInformation),
0);
if (!NT_SUCCESS(Status))
{
/* Fail if the query had a problem */
if (Status == STATUS_DEVICE_REMOVED) Status = STATUS_NO_SUCH_DEVICE;
ExAcquireFastMutex(&DeviceExtension->Lock);
IoReleaseRemoveLock(&BatteryData->RemoveLock, 0);
break;
}
/* Next time we can use the static copy */
BatteryData->Flags |= COMPBATT_BATTERY_INFORMATION_PRESENT;
if (CompBattDebug & 2)
DbgPrint("CompBattGetBatteryInformation: Read individual BATTERY_INFORMATION\n"
"-------- Capabilities = %x\n-------- Technology = %x\n"
"-------- Chemistry[4] = %x\n-------- DesignedCapacity = %x\n"
"-------- FullChargedCapacity = %x\n-------- DefaultAlert1 = %x\n"
"-------- DefaultAlert2 = %x\n-------- CriticalBias = %x\n"
"-------- CycleCount = %x\n",
BatteryData->BatteryInformation.Capabilities,
BatteryData->BatteryInformation.Technology,
BatteryData->BatteryInformation.Chemistry,
BatteryData->BatteryInformation.DesignedCapacity,
BatteryData->BatteryInformation.FullChargedCapacity,
BatteryData->BatteryInformation.DefaultAlert1,
BatteryData->BatteryInformation.DefaultAlert2,
BatteryData->BatteryInformation.CriticalBias,
BatteryData->BatteryInformation.CycleCount);
}
/* Combine capabilities */
BatteryInfo->Capabilities |= BatteryData->BatteryInformation.Capabilities;
/* Add-on capacity */
if (BatteryData->BatteryInformation.DesignedCapacity != BATTERY_UNKNOWN_CAPACITY)
{
BatteryInfo->DesignedCapacity += BatteryData->BatteryInformation.DesignedCapacity;
}
/* Add on fully charged capacity */
if (BatteryData->BatteryInformation.FullChargedCapacity != BATTERY_UNKNOWN_CAPACITY)
{
BatteryInfo->FullChargedCapacity += BatteryData->BatteryInformation.FullChargedCapacity;
}
/* Choose the highest alert */
BatteryInfo->DefaultAlert1 = max(BatteryInfo->DefaultAlert1,
BatteryData->BatteryInformation.DefaultAlert1);
/* Choose the highest alert */
BatteryInfo->DefaultAlert2 = max(BatteryInfo->DefaultAlert2,
BatteryData->BatteryInformation.DefaultAlert2);
/* Choose the highest critical bias */
BatteryInfo->CriticalBias = max(BatteryInfo->CriticalBias,
BatteryData->BatteryInformation.CriticalBias);
}
/* Re-acquire the device extension lock and release the remove lock */
ExAcquireFastMutex(&DeviceExtension->Lock);
IoReleaseRemoveLock(&BatteryData->RemoveLock, 0);
}
/* Next entry */
NextEntry = NextEntry->Flink;
}
/* We are done with the list, check if the information was queried okay */
ExReleaseFastMutex(&DeviceExtension->Lock);
if (NT_SUCCESS(Status))
{
/* If there's no fully charged capacity, use the design capacity */
if (!BatteryInfo->FullChargedCapacity)
{
BatteryInfo->FullChargedCapacity = BatteryInfo->DesignedCapacity;
}
/* Print out final combined data */
if (CompBattDebug & 2)
DbgPrint("CompBattGetBatteryInformation: Returning BATTERY_INFORMATION\n"
"-------- Capabilities = %x\n-------- Technology = %x\n"
"-------- Chemistry[4] = %x\n-------- DesignedCapacity = %x\n"
"-------- FullChargedCapacity = %x\n-------- DefaultAlert1 = %x\n"
"-------- DefaultAlert2 = %x\n-------- CriticalBias = %x\n"
"-------- CycleCount = %x\n",
BatteryInfo->Capabilities,
BatteryInfo->Technology,
BatteryInfo->Chemistry,
BatteryInfo->DesignedCapacity,
BatteryInfo->FullChargedCapacity,
BatteryInfo->DefaultAlert1,
BatteryInfo->DefaultAlert2,
BatteryInfo->CriticalBias,
BatteryInfo->CycleCount);
/* Copy the data into the device extension */
RtlCopyMemory(&DeviceExtension->BatteryInformation,
BatteryInfo,
sizeof(DeviceExtension->BatteryInformation));
DeviceExtension->Flags |= COMPBATT_BATTERY_INFORMATION_PRESENT;
}
/* We are done */
if (CompBattDebug & 1) DbgPrint("CompBatt: EXITING GetBatteryInformation\n");
return Status;
}
NTSTATUS
@ -129,8 +394,85 @@ NTAPI
CompBattGetBatteryGranularity(OUT PBATTERY_REPORTING_SCALE ReportingScale,
IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
NTSTATUS Status = STATUS_SUCCESS;
BATTERY_QUERY_INFORMATION InputBuffer;
PCOMPBATT_BATTERY_DATA BatteryData;
BATTERY_REPORTING_SCALE BatteryScale[4];
PLIST_ENTRY ListHead, NextEntry;
ULONG i;
if (CompBattDebug & 1) DbgPrint("CompBatt: ENTERING GetBatteryGranularity\n");
/* Set defaults */
ReportingScale[0].Granularity = -1;
ReportingScale[1].Granularity = -1;
ReportingScale[2].Granularity = -1;
ReportingScale[3].Granularity = -1;
/* Loop the battery list */
ExAcquireFastMutex(&DeviceExtension->Lock);
ListHead = &DeviceExtension->BatteryList;
NextEntry = ListHead->Flink;
while (NextEntry != ListHead)
{
/* Try to acquire the remove lock */
BatteryData = CONTAINING_RECORD(NextEntry, COMPBATT_BATTERY_DATA, BatteryLink);
if (NT_SUCCESS(IoAcquireRemoveLock(&BatteryData->RemoveLock, 0)))
{
/* Now release the device lock since the battery can't go away */
ExReleaseFastMutex(&DeviceExtension->Lock);
/* Build the query */
InputBuffer.BatteryTag = BatteryData->Tag;
InputBuffer.InformationLevel = BatteryGranularityInformation;
/* Make sure the battery has a tag */
if (BatteryData->Tag)
{
/* Send the IOCTL to query the information */
RtlZeroMemory(&BatteryData->BatteryInformation,
sizeof(BatteryData->BatteryInformation));
Status = BatteryIoctl(IOCTL_BATTERY_QUERY_INFORMATION,
BatteryData->DeviceObject,
&InputBuffer,
sizeof(InputBuffer),
&BatteryScale,
sizeof(BatteryScale),
0);
if (!NT_SUCCESS(Status))
{
/* Fail if the query had a problem */
ExAcquireFastMutex(&DeviceExtension->Lock);
IoReleaseRemoveLock(&BatteryData->RemoveLock, 0);
break;
}
/* Loop all 4 scales */
for (i = 0; i < 4; i++)
{
/* Check for valid granularity */
if (BatteryScale[i].Granularity)
{
/* If it's smaller, use it instead */
ReportingScale[i].Granularity = min(BatteryScale[i].Granularity,
ReportingScale[i].Granularity);
}
}
}
/* Re-acquire the device extension lock and release the remove lock */
ExAcquireFastMutex(&DeviceExtension->Lock);
IoReleaseRemoveLock(&BatteryData->RemoveLock, 0);
}
/* Next entry */
NextEntry = NextEntry->Flink;
}
/* All done */
ExReleaseFastMutex(&DeviceExtension->Lock);
if (CompBattDebug & 1) DbgPrint("CompBatt: EXITING GetBatteryGranularity\n");
return STATUS_SUCCESS;
}
NTSTATUS
@ -144,7 +486,7 @@ CompBattGetEstimatedTime(OUT PULONG Time,
NTSTATUS
NTAPI
CompBattQueryInformation(IN PCOMPBATT_DEVICE_EXTENSION FdoExtension,
CompBattQueryInformation(IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension,
IN ULONG Tag,
IN BATTERY_QUERY_INFORMATION_LEVEL InfoLevel,
IN OPTIONAL LONG AtRate,
@ -152,8 +494,109 @@ CompBattQueryInformation(IN PCOMPBATT_DEVICE_EXTENSION FdoExtension,
IN ULONG BufferLength,
OUT PULONG ReturnedLength)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
BATTERY_INFORMATION BatteryInfo;
BATTERY_REPORTING_SCALE BatteryGranularity[4];
PWCHAR BatteryName = L"Composite Battery";
BATTERY_MANUFACTURE_DATE Date;
ULONG Dummy, Time;
PVOID QueryData = NULL;
ULONG QueryLength = 0;
NTSTATUS Status = STATUS_SUCCESS;
PAGED_CODE();
if (CompBattDebug & 1) DbgPrint("CompBatt: ENTERING QueryInformation\n");
/* Check for valid/correct tag */
if ((Tag != DeviceExtension->Tag) ||
(!(DeviceExtension->Flags & COMPBATT_TAG_ASSIGNED)))
{
/* Not right, so fail */
return STATUS_NO_SUCH_DEVICE;
}
/* Check what caller wants */
switch (InfoLevel)
{
case BatteryInformation:
/* Query combined battery information */
RtlZeroMemory(&BatteryInfo, sizeof(BatteryInfo));
Status = CompBattGetBatteryInformation(&BatteryInfo, DeviceExtension);
if (NT_SUCCESS(Status))
{
/* Return the data if successful */
QueryData = &BatteryInfo;
QueryLength = sizeof(BatteryInfo);
}
break;
case BatteryGranularityInformation:
/* Query combined granularity information */
RtlZeroMemory(&BatteryGranularity, sizeof(BatteryGranularity));
Status = CompBattGetBatteryGranularity(BatteryGranularity, DeviceExtension);
if (NT_SUCCESS(Status))
{
/* Return the data if successful */
QueryLength = sizeof(BatteryGranularity);
QueryData = &BatteryGranularity;
}
break;
case BatteryEstimatedTime:
/* Query combined time estimate information */
RtlZeroMemory(&Time, sizeof(Time));
Status = CompBattGetEstimatedTime(&Time, DeviceExtension);
if (NT_SUCCESS(Status))
{
/* Return the data if successful */
QueryLength = sizeof(Time);
QueryData = &Time;
}
break;
case BatteryManufactureName:
case BatteryDeviceName:
/* Return the static buffer */
QueryData = BatteryName;
QueryLength = sizeof(L"Composite Battery");
break;
case BatteryManufactureDate:
/* Static data */
Date.Day = 26;
Date.Month = 06;
Date.Year = 1997;
break;
case BatteryTemperature:
case BatteryUniqueID:
/* Return zero */
Dummy = 0;
QueryData = &Dummy;
QueryLength = sizeof(Dummy);
break;
default:
/* Everything else is unknown */
Status = STATUS_INVALID_PARAMETER;
break;
}
/* Return the required length and check if the caller supplied enough */
*ReturnedLength = QueryLength;
if (BufferLength < QueryLength) Status = STATUS_BUFFER_TOO_SMALL;
/* Copy the data if there's enough space and it exists */
if ((NT_SUCCESS(Status)) && (QueryData)) RtlCopyMemory(Buffer, QueryData, QueryLength);
/* Return function result */
if (CompBattDebug & 1) DbgPrint("CompBatt: EXITING QueryInformation\n");
return Status;
}
NTSTATUS
@ -161,8 +604,17 @@ NTAPI
DriverEntry(IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPath)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
/* Register add device routine */
DriverObject->DriverExtension->AddDevice = CompBattAddDevice;
/* Register other handlers */
DriverObject->MajorFunction[IRP_MJ_CREATE] = CompBattOpenClose;
DriverObject->MajorFunction[IRP_MJ_CLOSE] = CompBattOpenClose;
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = CompBattIoctl;
DriverObject->MajorFunction[IRP_MJ_POWER] = CompBattPowerDispatch;
DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = CompBattSystemControl;
DriverObject->MajorFunction[IRP_MJ_PNP] = CompBattPnpDispatch;
return STATUS_SUCCESS;
}
/* EOF */

View file

@ -10,8 +10,12 @@
#include <initguid.h>
#include <batclass.h>
#include <debug.h>
#include <wdmguid.h>
typedef struct _COMPBATT_BATTERY_ENTRY
#define COMPBATT_BATTERY_INFORMATION_PRESENT 0x04
#define COMPBATT_TAG_ASSIGNED 0x80
typedef struct _COMPBATT_BATTERY_DATA
{
LIST_ENTRY BatteryLink;
IO_REMOVE_LOCK RemoveLock;
@ -31,7 +35,7 @@ typedef struct _COMPBATT_BATTERY_ENTRY
BATTERY_STATUS BatteryStatus;
ULONGLONG InterruptTime;
UNICODE_STRING BatteryName;
} COMPBATT_BATTERY_ENTRY, *PCOMPBATT_BATTERY_ENTRY;
} COMPBATT_BATTERY_DATA, *PCOMPBATT_BATTERY_DATA;
typedef struct _COMPBATT_DEVICE_EXTENSION
{
@ -52,6 +56,103 @@ typedef struct _COMPBATT_DEVICE_EXTENSION
PVOID NotificationEntry;
} COMPBATT_DEVICE_EXTENSION, *PCOMPBATT_DEVICE_EXTENSION;
extern ULONG CmBattDebug;
NTSTATUS
NTAPI
CompBattAddDevice(
IN PDRIVER_OBJECT DriverObject,
IN PDEVICE_OBJECT PdoDeviceObject
);
NTSTATUS
NTAPI
CompBattPowerDispatch(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
);
NTSTATUS
NTAPI
CompBattPnpDispatch(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
);
NTSTATUS
NTAPI
CompBattQueryInformation(
IN PCOMPBATT_DEVICE_EXTENSION FdoExtension,
IN ULONG Tag,
IN BATTERY_QUERY_INFORMATION_LEVEL InfoLevel,
IN OPTIONAL LONG AtRate,
IN PVOID Buffer,
IN ULONG BufferLength,
OUT PULONG ReturnedLength
);
NTSTATUS
NTAPI
CompBattQueryStatus(
IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension,
IN ULONG Tag,
IN PBATTERY_STATUS BatteryStatus
);
NTSTATUS
NTAPI
CompBattSetStatusNotify(
IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension,
IN ULONG BatteryTag,
IN PBATTERY_NOTIFY BatteryNotify
);
NTSTATUS
NTAPI
CompBattDisableStatusNotify(
IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension
);
NTSTATUS
NTAPI
CompBattQueryTag(
IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension,
OUT PULONG Tag
);
NTSTATUS
NTAPI
CompBattMonitorIrpComplete(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp,
IN PKEVENT Event
);
NTSTATUS
NTAPI
CompBattMonitorIrpCompleteWorker(
IN PCOMPBATT_BATTERY_DATA BatteryData
);
NTSTATUS
NTAPI
CompBattGetDeviceObjectPointer(
IN PUNICODE_STRING DeviceName,
IN ACCESS_MASK DesiredAccess,
OUT PFILE_OBJECT *FileObject,
OUT PDEVICE_OBJECT *DeviceObject
);
NTSTATUS
NTAPI
BatteryIoctl(
IN ULONG IoControlCode,
IN PDEVICE_OBJECT DeviceObject,
IN PVOID InputBuffer,
IN ULONG InputBufferLength,
IN PVOID OutputBuffer,
IN ULONG OutputBufferLength,
IN BOOLEAN InternalDeviceIoControl
);
extern ULONG CompBattDebug;
/* EOF */

View file

@ -22,19 +22,102 @@ BatteryIoctl(IN ULONG IoControlCode,
IN ULONG OutputBufferLength,
IN BOOLEAN InternalDeviceIoControl)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
IO_STATUS_BLOCK IoStatusBlock;
KEVENT Event;
NTSTATUS Status;
PIRP Irp;
PAGED_CODE();
if (CompBattDebug & 0x100) DbgPrint("CompBatt: ENTERING BatteryIoctl\n");
/* Initialize the event and IRP */
KeInitializeEvent(&Event, SynchronizationEvent, 0);
Irp = IoBuildDeviceIoControlRequest(IoControlCode,
DeviceObject,
InputBuffer,
InputBufferLength,
OutputBuffer,
OutputBufferLength,
InternalDeviceIoControl,
&Event,
&IoStatusBlock);
if (Irp)
{
/* Call the class driver miniport */
Status = IofCallDriver(DeviceObject, Irp);
if (Status == STATUS_PENDING)
{
/* Wait for result */
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
Status = IoStatusBlock.Status;
}
/* Print failure */
if (!(NT_SUCCESS(Status)) && (CompBattDebug & 8))
DbgPrint("BatteryIoctl: Irp failed - %x\n", Status);
/* Done */
if (CompBattDebug & 0x100) DbgPrint("CompBatt: EXITING BatteryIoctl\n");
}
else
{
/* Out of memory */
if (CompBattDebug & 8) DbgPrint("BatteryIoctl: couldn't create Irp\n");
Status = STATUS_INSUFFICIENT_RESOURCES;
}
/* Return status */
return Status;
}
NTSTATUS
NTAPI
CompBattGetDeviceObjectPointer(IN PCUNICODE_STRING DeviceName,
CompBattGetDeviceObjectPointer(IN PUNICODE_STRING DeviceName,
IN ACCESS_MASK DesiredAccess,
OUT PFILE_OBJECT *FileObject,
OUT PDEVICE_OBJECT *DeviceObject)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
NTSTATUS Status;
OBJECT_ATTRIBUTES ObjectAttributes;
IO_STATUS_BLOCK IoStatusBlock;
PFILE_OBJECT LocalFileObject;
HANDLE DeviceHandle;
PAGED_CODE();
/* Open a file object handle to the device */
InitializeObjectAttributes(&ObjectAttributes, DeviceName, 0, NULL, NULL);
Status = ZwCreateFile(&DeviceHandle,
DesiredAccess,
&ObjectAttributes,
&IoStatusBlock,
NULL,
0,
FILE_SHARE_READ | FILE_SHARE_WRITE,
FILE_OPEN,
0,
NULL,
0);
if (NT_SUCCESS(Status))
{
/* Reference the file object */
Status = ObReferenceObjectByHandle(DeviceHandle,
0,
IoFileObjectType,
KernelMode,
(PVOID)&LocalFileObject,
NULL);
if (NT_SUCCESS(Status))
{
/* Return the FO and the associated DO */
*FileObject = LocalFileObject;
*DeviceObject = IoGetRelatedDeviceObject(LocalFileObject);
}
/* Close the handle */
ZwClose(DeviceHandle);
}
/* Return status */
return Status;
}
/* EOF */

View file

@ -17,17 +17,57 @@ NTAPI
CompBattPowerDispatch(IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
PCOMPBATT_DEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
if (CompBattDebug & 1) DbgPrint("CompBatt: PowerDispatch recieved power IRP.\n");
/* Start the next IRP */
PoStartNextPowerIrp(Irp);
/* Call the next driver in the stack */
IoSkipCurrentIrpStackLocation(Irp);
return PoCallDriver(DeviceExtension->AttachedDevice, Irp);
}
PCOMPBATT_BATTERY_ENTRY
PCOMPBATT_BATTERY_DATA
NTAPI
RemoveBatteryFromList(IN PCUNICODE_STRING BatteryName,
IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
return NULL;
PLIST_ENTRY ListHead, NextEntry;
PCOMPBATT_BATTERY_DATA BatteryData;
if (CompBattDebug & 1)
DbgPrint("CompBatt: ENTERING RemoveBatteryFromList\n");
/* Loop the battery list */
ExAcquireFastMutex(&DeviceExtension->Lock);
ListHead = &DeviceExtension->BatteryList;
NextEntry = ListHead->Flink;
while (NextEntry != ListHead)
{
/* Get the battery information and compare the name */
BatteryData = CONTAINING_RECORD(NextEntry, COMPBATT_BATTERY_DATA, BatteryLink);
if (!RtlCompareUnicodeString(BatteryName, &BatteryData->BatteryName, TRUE))
{
/* Flush pending deletes and any lock waiters */
IoAcquireRemoveLock(&BatteryData->RemoveLock, 0);
ExReleaseFastMutex(&DeviceExtension->Lock);
IoReleaseRemoveLockAndWait(&BatteryData->RemoveLock, 0);
/* Remove the entry from the list */
ExAcquireFastMutex(&DeviceExtension->Lock);
RemoveEntryList(&BatteryData->BatteryLink);
ExReleaseFastMutex(&DeviceExtension->Lock);
return BatteryData;
}
/* Next */
NextEntry = NextEntry->Flink;
}
/* Done */
ExReleaseFastMutex(&DeviceExtension->Lock);
if (CompBattDebug & 1) DbgPrint("CompBatt: EXITING RemoveBatteryFromList\n");
return STATUS_SUCCESS;
}
BOOLEAN
@ -35,17 +75,143 @@ NTAPI
IsBatteryAlreadyOnList(IN PCUNICODE_STRING BatteryName,
IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
return FALSE;
PLIST_ENTRY ListHead, NextEntry;
PCOMPBATT_BATTERY_DATA BatteryData;
BOOLEAN Found = FALSE;
if (CompBattDebug & 1)
DbgPrint("CompBatt: ENTERING IsBatteryAlreadyOnList\n");
/* Loop the battery list */
ExAcquireFastMutex(&DeviceExtension->Lock);
ListHead = &DeviceExtension->BatteryList;
NextEntry = ListHead->Flink;
while (NextEntry != ListHead)
{
/* Get the battery information and compare the name */
BatteryData = CONTAINING_RECORD(NextEntry, COMPBATT_BATTERY_DATA, BatteryLink);
if (!RtlCompareUnicodeString(BatteryName, &BatteryData->BatteryName, TRUE))
{
/* Got it */
Found = TRUE;
break;
}
/* Next */
NextEntry = NextEntry->Flink;
}
/* Release the lock and return search status */
ExReleaseFastMutex(&DeviceExtension->Lock);
if (CompBattDebug & 1) DbgPrint("CompBatt: EXITING IsBatteryAlreadyOnList\n");
return Found;
}
NTSTATUS
NTAPI
CompBattAddNewBattery(IN PCUNICODE_STRING BatteryName,
CompBattAddNewBattery(IN PUNICODE_STRING BatteryName,
IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
NTSTATUS Status = STATUS_SUCCESS;
PCOMPBATT_BATTERY_DATA BatteryData;
PIRP Irp;
PIO_STACK_LOCATION IoStackLocation;
PFILE_OBJECT FileObject;
PAGED_CODE();
if (CompBattDebug & 1)
DbgPrint("CompBatt: ENTERING AddNewBattery \"%w\" \n", BatteryName->Buffer);
/* Is this a new battery? */
if (!IsBatteryAlreadyOnList(BatteryName, DeviceExtension))
{
/* Allocate battery data */
BatteryData = ExAllocatePoolWithTag(NonPagedPool,
sizeof(COMPBATT_BATTERY_DATA) +
BatteryName->Length,
'CtaB');
if (BatteryData)
{
/* Initialize the data and write the battery name */
RtlZeroMemory(BatteryData, sizeof(COMPBATT_BATTERY_DATA));
BatteryData->Tag = 0;
BatteryData->BatteryName.MaximumLength = BatteryName->Length;
BatteryData->BatteryName.Buffer = (PWCHAR)(BatteryData + 1);
RtlCopyUnicodeString(&BatteryData->BatteryName, BatteryName);
/* Get the device object */
Status = CompBattGetDeviceObjectPointer(BatteryName,
FILE_ALL_ACCESS,
&FileObject,
&BatteryData->DeviceObject);
if (NT_SUCCESS(Status))
{
/* Reference the DO and drop the FO */
ObfReferenceObject(BatteryData->DeviceObject);
ObfDereferenceObject(FileObject);
/* Allocate the battery IRP */
Irp = IoAllocateIrp(BatteryData->DeviceObject->StackSize + 1, 0);
if (Irp)
{
/* Save it */
BatteryData->Irp = Irp;
/* Setup the stack location */
IoStackLocation = IoGetNextIrpStackLocation(Irp);
IoStackLocation->Parameters.Others.Argument1 = DeviceExtension;
IoStackLocation->Parameters.Others.Argument2 = BatteryData;
/* Set IRP data */
IoSetNextIrpStackLocation(Irp);
Irp->IoStatus.Status = STATUS_DEVICE_NOT_CONNECTED;
BatteryData->WaitFlag = 0;
/* Insert this battery in the list */
ExAcquireFastMutex(&DeviceExtension->Lock);
InsertTailList(&DeviceExtension->BatteryList,
&BatteryData->BatteryLink);
ExReleaseFastMutex(&DeviceExtension->Lock);
/* Initialize the work item and delete lock */
IoInitializeRemoveLock(&BatteryData->RemoveLock, 0, 0, 0);
ExInitializeWorkItem(&BatteryData->WorkItem,
(PVOID)CompBattMonitorIrpCompleteWorker,
BatteryData);
/* Setup the IRP work entry */
CompBattMonitorIrpComplete(BatteryData->DeviceObject, Irp, 0);
Status = STATUS_SUCCESS;
}
else
{
/* Fail, no memory */
if (CompBattDebug & 8)
DbgPrint("CompBatt: Couldn't allocate new battery Irp\n");
Status = STATUS_INSUFFICIENT_RESOURCES;
ObfDereferenceObject(BatteryData->DeviceObject);
}
}
else if (CompBattDebug & 8)
{
/* Fail */
DbgPrint("CompBattAddNewBattery: Failed to get device Object. status = %lx\n",
Status);
}
/* Free the battery data */
ExFreePool(BatteryData);
}
else
{
/* Fail, no memory */
if (CompBattDebug & 8)
DbgPrint("CompBatt: Couldn't allocate new battery node\n");
Status = STATUS_INSUFFICIENT_RESOURCES;
}
}
/* We're done */
if (CompBattDebug & 1) DbgPrint("CompBatt: EXITING AddNewBattery\n");
return Status;
}
NTSTATUS
@ -53,16 +219,65 @@ NTAPI
CompBattRemoveBattery(IN PCUNICODE_STRING BatteryName,
IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
PCOMPBATT_BATTERY_DATA BatteryData;
if (CompBattDebug & 1) DbgPrint("CompBatt: RemoveBattery\n");
/* Remove the entry */
BatteryData = RemoveBatteryFromList(BatteryName, DeviceExtension);
if (BatteryData)
{
/* Dereference and free it */
ObfDereferenceObject(BatteryData->DeviceObject);
ExFreePool(BatteryData);
/* Notify class driver */
DeviceExtension->Flags = 0;
BatteryClassStatusNotify(DeviceExtension->ClassData);
}
/* It's done */
return STATUS_SUCCESS;
}
NTSTATUS
NTAPI
CompBattGetBatteries(IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
PWCHAR p;
NTSTATUS Status;
PWCHAR LinkList;
UNICODE_STRING LinkString;
if (CompBattDebug & 1) DbgPrint("CompBatt: ENTERING GetBatteries\n");
/* Get all battery links */
Status = IoGetDeviceInterfaces(&GUID_DEVICE_BATTERY, NULL, 0, &LinkList);
p = LinkList;
if (NT_SUCCESS(Status))
{
/* Loop all strings inside */
while (TRUE)
{
/* Create the string */
RtlInitUnicodeString(&LinkString, p);
if (!LinkString.Length) break;
/* Add this battery and move on */
Status = CompBattAddNewBattery(&LinkString, DeviceExtension);
p += (LinkString.Length / sizeof(WCHAR)) + sizeof(UNICODE_NULL);
}
/* Parsing complete, clean up buffer */
ExFreePool(LinkList);
}
else if (CompBattDebug & 8)
{
/* Fail */
DbgPrint("CompBatt: Couldn't get list of batteries\n");
}
/* Done */
if (CompBattDebug & 1) DbgPrint("CompBatt: EXITING GetBatteries\n");
return Status;
}
NTSTATUS
@ -70,8 +285,32 @@ NTAPI
CompBattPnpEventHandler(IN PDEVICE_INTERFACE_CHANGE_NOTIFICATION Notification,
IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
if (CompBattDebug & 1) DbgPrint("CompBatt: ENTERING PnpEventHandler\n");
if (CompBattDebug & 2) DbgPrint("CompBatt: Received device interface change notification\n");
/* Check what happened */
if (IsEqualGUIDAligned(&Notification->Event, &GUID_DEVICE_INTERFACE_ARRIVAL))
{
/* Add the new battery */
if (CompBattDebug & 2)
DbgPrint("CompBatt: Received notification of battery arrival\n");
CompBattAddNewBattery(Notification->SymbolicLinkName, DeviceExtension);
}
else if (IsEqualGUIDAligned(&Notification->Event, &GUID_DEVICE_INTERFACE_REMOVAL))
{
/* Don't do anything */
if (CompBattDebug & 2)
DbgPrint("CompBatt: Received notification of battery removal\n");
}
else
{
/* Shouldn't happen */
if (CompBattDebug & 2) DbgPrint("CompBatt: Received unhandled PnP event\n");
}
/* Done, return success */
if (CompBattDebug & 1) DbgPrint("CompBatt: EXITING PnpEventHandler\n");
return STATUS_SUCCESS;
}
NTSTATUS
@ -79,8 +318,82 @@ NTAPI
CompBattAddDevice(IN PDRIVER_OBJECT DriverObject,
IN PDEVICE_OBJECT PdoDeviceObject)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
NTSTATUS Status;
UNICODE_STRING DeviceName;
PCOMPBATT_DEVICE_EXTENSION DeviceExtension;
PDEVICE_OBJECT DeviceObject;
UNICODE_STRING SymbolicLinkName;
BATTERY_MINIPORT_INFO MiniportInfo;
if (CompBattDebug & 2) DbgPrint("CompBatt: Got an AddDevice - %x\n", PdoDeviceObject);
/* Create the device */
RtlInitUnicodeString(&DeviceName, L"\\Device\\CompositeBattery");
Status = IoCreateDevice(DriverObject,
sizeof(COMPBATT_DEVICE_EXTENSION),
&DeviceName,
FILE_DEVICE_BATTERY,
FILE_DEVICE_SECURE_OPEN,
FALSE,
&DeviceObject);
if (!NT_SUCCESS(Status)) return Status;
/* Setup symbolic link for Win32 access */
RtlInitUnicodeString(&SymbolicLinkName, L"\\DosDevices\\CompositeBattery");
IoCreateSymbolicLink(&SymbolicLinkName, &DeviceName);
/* Initialize the device extension */
DeviceExtension = DeviceObject->DeviceExtension;
RtlZeroMemory(DeviceExtension, 0x1B0u);
/* Attach to device stack and set DO pointers */
DeviceExtension->AttachedDevice = IoAttachDeviceToDeviceStack(DeviceObject,
PdoDeviceObject);
DeviceExtension->DeviceObject = DeviceObject;
if (!DeviceExtension->AttachedDevice)
{
/* Fail */
if (CompBattDebug & 8)
DbgPrint("CompBattAddDevice: Could not attach to LowerDevice.\n");
IoDeleteDevice(DeviceObject);
return STATUS_UNSUCCESSFUL;
}
/* Set device object flags */
DeviceObject->Flags |= (DO_POWER_PAGABLE | DO_BUFFERED_IO);
DeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
/* Setup the device extension */
ExInitializeFastMutex(&DeviceExtension->Lock);
InitializeListHead(&DeviceExtension->BatteryList);
DeviceExtension->Flags = 0;
DeviceExtension->NextTag = 1;
/* Setup the miniport data */
RtlZeroMemory(&MiniportInfo, sizeof(MiniportInfo));
MiniportInfo.MajorVersion = BATTERY_CLASS_MAJOR_VERSION;
MiniportInfo.MinorVersion = BATTERY_CLASS_MINOR_VERSION;
MiniportInfo.Context = DeviceExtension;
MiniportInfo.DeviceName = &DeviceName;
MiniportInfo.QueryTag = (BCLASS_QUERY_TAG)CompBattQueryTag;
MiniportInfo.QueryInformation = (BCLASS_QUERY_INFORMATION)CompBattQueryInformation;
MiniportInfo.SetInformation = NULL;
MiniportInfo.QueryStatus = (BCLASS_QUERY_STATUS)CompBattQueryStatus;
MiniportInfo.SetStatusNotify = (BCLASS_SET_STATUS_NOTIFY)CompBattSetStatusNotify;
MiniportInfo.DisableStatusNotify = (BCLASS_DISABLE_STATUS_NOTIFY)CompBattDisableStatusNotify;
MiniportInfo.Pdo = NULL;
/* Register with the class driver */
Status = BatteryClassInitializeDevice(&MiniportInfo,
&DeviceExtension->ClassData);
if (!NT_SUCCESS(Status))
{
/* Undo everything */
IoDetachDevice(DeviceExtension->AttachedDevice);
IoDeleteDevice(DeviceObject);
}
/* Return status */
return Status;
}
NTSTATUS
@ -88,8 +401,94 @@ NTAPI
CompBattPnpDispatch(IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
PIO_STACK_LOCATION IoStackLocation = IoGetCurrentIrpStackLocation(Irp);
NTSTATUS Status;
PCOMPBATT_DEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
if (CompBattDebug & 1) DbgPrint("CompBatt: ENTERING PnpDispatch\n");
/* Set default error */
Status = STATUS_NOT_SUPPORTED;
/* Check what kind of PnP function this is */
switch (IoStackLocation->MinorFunction)
{
case IRP_MN_START_DEVICE:
/* Device is starting, register for new batteries and pick up current ones */
Status = IoRegisterPlugPlayNotification(EventCategoryDeviceInterfaceChange,
0,
(PVOID)&GUID_DEVICE_BATTERY,
DeviceObject->DriverObject,
(PDRIVER_NOTIFICATION_CALLBACK_ROUTINE)CompBattPnpEventHandler,
DeviceExtension,
&DeviceExtension->NotificationEntry);
if (NT_SUCCESS(Status))
{
/* Now go get the batteries */
if (CompBattDebug & 2)
DbgPrint("CompBatt: Successfully registered for PnP notification\n");
Status = CompBattGetBatteries(DeviceExtension);
}
else
{
/* We failed */
if (CompBattDebug & 8)
DbgPrint("CompBatt: Couldn't register for PnP notification - %x\n",
Status);
}
case IRP_MN_CANCEL_STOP_DEVICE:
/* Explicitly say ok */
Status = STATUS_SUCCESS;
break;
case IRP_MN_CANCEL_REMOVE_DEVICE:
/* Explicitly say ok */
Status = STATUS_SUCCESS;
break;
case IRP_MN_SURPRISE_REMOVAL:
/* Explicitly say ok */
Status = STATUS_SUCCESS;
break;
case IRP_MN_QUERY_PNP_DEVICE_STATE:
/* Add this in */
Irp->IoStatus.Information |= PNP_DEVICE_NOT_DISABLEABLE;
Status = STATUS_SUCCESS;
break;
default:
/* Not supported */
Status = STATUS_INVALID_DEVICE_REQUEST;
break;
}
/* Set IRP status if we have one */
if (Status != STATUS_NOT_SUPPORTED) Irp->IoStatus.Status = Status;
/* Did someone pick it up? */
if ((NT_SUCCESS(Status)) || (Status == STATUS_NOT_SUPPORTED))
{
/* Still unsupported, try ACPI */
IoSkipCurrentIrpStackLocation(Irp);
Status = IoCallDriver(DeviceExtension->AttachedDevice, Irp);
}
else
{
/* Complete the request */
Status = Irp->IoStatus.Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
}
/* Release the remove lock and return status */
if (CompBattDebug & 1) DbgPrint("CompBatt: EXITING PnpDispatch\n");
return Status;
}
/* EOF */

View file

@ -275,7 +275,7 @@ ACPIDispatchDeviceControl(
Caps |= SYS_BUTTON_SLEEP;
}
}
if (wcsstr(((PPDO_DEVICE_DATA)commonData)->HardwareIDs, L"PNP0C0C"))
else if (wcsstr(((PPDO_DEVICE_DATA)commonData)->HardwareIDs, L"PNP0C0C"))
{
DPRINT1("Control method power button reported to power manager\n");
Caps |= SYS_BUTTON_POWER;

View file

@ -10,4 +10,7 @@
<directory name="pci">
<xi:include href="pci/pci.rbuild" />
</directory>
<directory name="pcix">
<xi:include href="pcix/pcix.rbuild" />
</directory>
</group>

View file

@ -0,0 +1,19 @@
/*
* PROJECT: ReactOS PCI Bus Driver
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/bus/pci/arb/ar_busno.c
* PURPOSE: Bus Number Arbitration
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
#include <pci.h>
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
/* FUNCTIONS ******************************************************************/
/* EOF */

View file

@ -0,0 +1,19 @@
/*
* PROJECT: ReactOS PCI Bus Driver
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/bus/pci/arb/ar_memiono.c
* PURPOSE: Memory and I/O Port Resource Arbitration
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
#include <pci.h>
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
/* FUNCTIONS ******************************************************************/
/* EOF */

View file

@ -0,0 +1,19 @@
/*
* PROJECT: ReactOS PCI Bus Driver
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/bus/pci/arb/arb_comn.c
* PURPOSE: Common Arbitration Code
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
#include <pci.h>
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
/* FUNCTIONS ******************************************************************/
/* EOF */

View file

@ -0,0 +1,19 @@
/*
* PROJECT: ReactOS PCI Bus Driver
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/bus/pci/arb/tr_irq.c
* PURPOSE: IRQ Resource Translation
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
#include <pci.h>
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
/* FUNCTIONS ******************************************************************/
/* EOF */

19
drivers/bus/pcix/debug.c Normal file
View file

@ -0,0 +1,19 @@
/*
* PROJECT: ReactOS PCI Bus Driver
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/bus/pci/debug.c
* PURPOSE: Debug Helpers
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
#include <pci.h>
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
/* FUNCTIONS ******************************************************************/
/* EOF */

19
drivers/bus/pcix/device.c Normal file
View file

@ -0,0 +1,19 @@
/*
* PROJECT: ReactOS PCI Bus Driver
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/bus/pci/device.c
* PURPOSE: Device Management
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
#include <pci.h>
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
/* FUNCTIONS ******************************************************************/
/* EOF */

View file

@ -0,0 +1,19 @@
/*
* PROJECT: ReactOS PCI Bus Driver
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/bus/pci/dispatch.c
* PURPOSE: WDM Dispatch Routines
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
#include <pci.h>
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
/* FUNCTIONS ******************************************************************/
/* EOF */

19
drivers/bus/pcix/enum.c Normal file
View file

@ -0,0 +1,19 @@
/*
* PROJECT: ReactOS PCI Bus Driver
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/bus/pci/enum.c
* PURPOSE: PCI Bus/Device Enumeration
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
#include <pci.h>
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
/* FUNCTIONS ******************************************************************/
/* EOF */

19
drivers/bus/pcix/fdo.c Normal file
View file

@ -0,0 +1,19 @@
/*
* PROJECT: ReactOS PCI Bus Driver
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/bus/pci/fdo.c
* PURPOSE: FDO Device Management
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
#include <pci.h>
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
/* FUNCTIONS ******************************************************************/
/* EOF */

19
drivers/bus/pcix/guid.c Normal file
View file

@ -0,0 +1,19 @@
/*
* PROJECT: ReactOS PCI Bus Driver
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/bus/pci/guid.c
* PURPOSE: GUID Data
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
#include <pci.h>
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
/* FUNCTIONS ******************************************************************/
/* EOF */

View file

@ -0,0 +1,19 @@
/*
* PROJECT: ReactOS PCI Bus Driver
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/bus/pci/hookhal.c
* PURPOSE: HAL Bus Handler Dispatch Routine Support
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
#include <pci.h>
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
/* FUNCTIONS ******************************************************************/
/* EOF */

30
drivers/bus/pcix/init.c Normal file
View file

@ -0,0 +1,30 @@
/*
* PROJECT: ReactOS PCI Bus Driver
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/bus/pci/init.c
* PURPOSE: Driver Initialization
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
#include <pci.h>
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
/* FUNCTIONS ******************************************************************/
NTSTATUS
NTAPI
DriverEntry(IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPath)
{
DPRINT1("PCI: DriverEntry!\n");
/* FIXME: TODO */
return STATUS_NOT_SUPPORTED;
}
/* EOF */

View file

@ -0,0 +1,19 @@
/*
* PROJECT: ReactOS PCI Bus Driver
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/bus/pci/intrface/agpintrf.c
* PURPOSE: AGP Interface
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
#include <pci.h>
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
/* FUNCTIONS ******************************************************************/
/* EOF */

View file

@ -0,0 +1,19 @@
/*
* PROJECT: ReactOS PCI Bus Driver
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/bus/pci/intrface/busintrf.c
* PURPOSE: Bus Interface
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
#include <pci.h>
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
/* FUNCTIONS ******************************************************************/
/* EOF */

View file

@ -0,0 +1,19 @@
/*
* PROJECT: ReactOS PCI Bus Driver
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/bus/pci/intrface/cardbus.c
* PURPOSE: CardBus Interface
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
#include <pci.h>
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
/* FUNCTIONS ******************************************************************/
/* EOF */

View file

@ -0,0 +1,19 @@
/*
* PROJECT: ReactOS PCI Bus Driver
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/bus/pci/intrface/ideintrf.c
* PURPOSE: IDE Interface
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
#include <pci.h>
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
/* FUNCTIONS ******************************************************************/
/* EOF */

View file

@ -0,0 +1,19 @@
/*
* PROJECT: ReactOS PCI Bus Driver
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/bus/pci/intrface/intrface.c
* PURPOSE: Common Interface Support Routines
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
#include <pci.h>
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
/* FUNCTIONS ******************************************************************/
/* EOF */

View file

@ -0,0 +1,19 @@
/*
* PROJECT: ReactOS PCI Bus Driver
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/bus/pci/intrface/lddintrf.c
* PURPOSE: Legacy Device Detection Interface
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
#include <pci.h>
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
/* FUNCTIONS ******************************************************************/
/* EOF */

View file

@ -0,0 +1,19 @@
/*
* PROJECT: ReactOS PCI Bus Driver
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/bus/pci/intrface/locintrf.c
* PURPOSE: Location Interface
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
#include <pci.h>
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
/* FUNCTIONS ******************************************************************/
/* EOF */

View file

@ -0,0 +1,19 @@
/*
* PROJECT: ReactOS PCI Bus Driver
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/bus/pci/intrface/pmeintf.c
* PURPOSE: Power Management Event# Signal Interface
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
#include <pci.h>
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
/* FUNCTIONS ******************************************************************/
/* EOF */

View file

@ -0,0 +1,19 @@
/*
* PROJECT: ReactOS PCI Bus Driver
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/bus/pci/intrface/routinf.c
* PURPOSE: Routing Interface
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
#include <pci.h>
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
/* FUNCTIONS ******************************************************************/
/* EOF */

11
drivers/bus/pcix/pci.h Normal file
View file

@ -0,0 +1,11 @@
/*
* PROJECT: ReactOS PCI Bus Driver
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/bus/pci/pci.h
* PURPOSE: Main Header File
* PROGRAMMERS: ReactOS Portable Systems Group
*/
#include <ntddk.h>
/* EOF */

5
drivers/bus/pcix/pci.rc Normal file
View file

@ -0,0 +1,5 @@
#define REACTOS_VERSION_DLL
#define REACTOS_STR_FILE_DESCRIPTION "PCI Bus Driver\0"
#define REACTOS_STR_INTERNAL_NAME "pci\0"
#define REACTOS_STR_ORIGINAL_FILENAME "pci.sys\0"
#include <reactos/version.rc>

Some files were not shown because too many files have changed in this diff Show more