Permalink
Browse files

WinCDEmu 4.0

  • Loading branch information...
1 parent cac4df1 commit 2dca49648e3ada1ce002982a597f2ef88a659aaf Sysprogs committed Jun 3, 2015
Showing with 24,867 additions and 0 deletions.
  1. +257 −0 BazisPortableCDBus/BazisPortableCDBus.cpp
  2. +104 −0 BazisPortableCDBus/BazisPortableCDBus.rc
  3. +6 −0 BazisPortableCDBus/BazisPortableCDBus.reg
  4. +438 −0 BazisPortableCDBus/BazisPortableCDBus.vcproj
  5. +274 −0 BazisPortableCDBus/BazisPortableCDBus.vcxproj
  6. +41 −0 BazisPortableCDBus/BazisPortableCDBus.vcxproj.filters
  7. +14 −0 BazisPortableCDBus/resource.h
  8. +2 −0 BazisPortableCDBus/stdafx.cpp
  9. +1 −0 BazisPortableCDBus/stdafx.h
  10. +14 −0 BazisVirtualCDBus/BazisVirtualCDBus.Win32.vddklaunch
  11. +449 −0 BazisVirtualCDBus/BazisVirtualCDBus.cpp
  12. +148 −0 BazisVirtualCDBus/BazisVirtualCDBus.h
  13. +58 −0 BazisVirtualCDBus/BazisVirtualCDBus.inf
  14. +104 −0 BazisVirtualCDBus/BazisVirtualCDBus.rc
  15. +211 −0 BazisVirtualCDBus/BazisVirtualCDBus.sln
  16. +456 −0 BazisVirtualCDBus/BazisVirtualCDBus.vcproj
  17. +287 −0 BazisVirtualCDBus/BazisVirtualCDBus.vcxproj
  18. +50 −0 BazisVirtualCDBus/BazisVirtualCDBus.vcxproj.filters
  19. +74 −0 BazisVirtualCDBus/DeviceControl.h
  20. +122 −0 BazisVirtualCDBus/PersistentImageDatabase.cpp
  21. +33 −0 BazisVirtualCDBus/PersistentImageDatabase.h
  22. +851 −0 BazisVirtualCDBus/VirtualCDDevice.cpp
  23. +195 −0 BazisVirtualCDBus/VirtualCDDevice.h
  24. +15 −0 BazisVirtualCDBus/resource.h
  25. +2 −0 BazisVirtualCDBus/stdafx.cpp
  26. +5 −0 BazisVirtualCDBus/stdafx.h
  27. +81 −0 DebugLogAnalyzer/DebugLogAnalyzer.csproj
  28. +20 −0 DebugLogAnalyzer/DebugLogAnalyzer.sln
  29. +75 −0 DebugLogAnalyzer/Form1.Designer.cs
  30. +25 −0 DebugLogAnalyzer/Form1.cs
  31. +120 −0 DebugLogAnalyzer/Form1.resx
  32. +410 −0 DebugLogAnalyzer/ParsedLogFile.cs
  33. +20 −0 DebugLogAnalyzer/Program.cs
  34. +36 −0 DebugLogAnalyzer/Properties/AssemblyInfo.cs
  35. +71 −0 DebugLogAnalyzer/Properties/Resources.Designer.cs
  36. +117 −0 DebugLogAnalyzer/Properties/Resources.resx
  37. +30 −0 DebugLogAnalyzer/Properties/Settings.Designer.cs
  38. +7 −0 DebugLogAnalyzer/Properties/Settings.settings
  39. +218 −0 ImageDump/ImageDump.cpp
  40. +180 −0 ImageDump/ImageDump.sln
  41. +225 −0 ImageDump/ImageDump.vcproj
  42. +33 −0 ImageDump/ReadMe.txt
  43. +140 −0 ImageDump/cdstruct.h
  44. +8 −0 ImageDump/stdafx.cpp
  45. +16 −0 ImageDump/stdafx.h
  46. +13 −0 ImageDump/targetver.h
  47. +235 −0 ImageFormats/CCDParser.cpp
  48. +12 −0 ImageFormats/CCDParser.h
  49. +122 −0 ImageFormats/CUEParser.cpp
  50. +12 −0 ImageFormats/CUEParser.h
  51. +78 −0 ImageFormats/Filesystems/UDFHelpers.cpp
  52. +14 −0 ImageFormats/Filesystems/UDFHelpers.h
  53. +334 −0 ImageFormats/Filesystems/UDFStructures.h
  54. +361 −0 ImageFormats/Filesystems/miniudf.cpp
  55. +274 −0 ImageFormats/Filesystems/miniudf.h
  56. +36 −0 ImageFormats/IMGParser.cpp
  57. +46 −0 ImageFormats/IMGParser.h
  58. +76 −0 ImageFormats/ImageFormats.cpp
  59. +141 −0 ImageFormats/ImageFormats.h
  60. +329 −0 ImageFormats/ImageFormats.vcxproj
  61. +119 −0 ImageFormats/ImageFormats.vcxproj.filters
  62. +41 −0 ImageFormats/ImageHelpers.h
  63. +86 −0 ImageFormats/MDS/MDSFormats.h
  64. +249 −0 ImageFormats/MDS/MDSParser.cpp
  65. +12 −0 ImageFormats/MDS/MDSParser.h
  66. 0 ImageFormats/MDS/MDSRecordSet.h
  67. +136 −0 ImageFormats/MultiTrackImage.h
  68. +225 −0 ImageFormats/NRG/NRGParser.cpp
  69. +12 −0 ImageFormats/NRG/NRGParser.h
  70. +114 −0 ImageFormats/NRG/NRGRecordSet.h
  71. +64 −0 ImageFormats/NRG/NRGStructures.h
  72. +264 −0 ImageFormats/RawCDFormats.cpp
  73. +14 −0 ImageFormats/RawCDFormats.h
  74. +63 −0 ImageFormats/UDFAnalyzer.cpp
  75. +11 −0 ImageFormats/UDFAnalyzer.h
  76. +2 −0 ImageFormats/stdafx.cpp
  77. +13 −0 ImageFormats/stdafx.h
  78. +275 −0 InstallerStub/CustomInstaller.cpp
  79. +48 −0 InstallerStub/CustomInstaller.h
  80. +143 −0 InstallerStub/InstallerStub.cpp
  81. +3 −0 InstallerStub/InstallerStub.h
  82. BIN InstallerStub/InstallerStub.ico
  83. +186 −0 InstallerStub/InstallerStub.rc
  84. +58 −0 InstallerStub/InstallerStub.sln
  85. +265 −0 InstallerStub/InstallerStub.vcproj
  86. +143 −0 InstallerStub/InstallerStub.vcxproj
  87. +65 −0 InstallerStub/InstallerStub.vcxproj.filters
  88. +55 −0 InstallerStub/ReadMe.txt
  89. BIN InstallerStub/box.ico
  90. BIN InstallerStub/chbox.ico
  91. +21 −0 InstallerStub/compat.manifest
  92. BIN InstallerStub/ico203.ico
  93. BIN InstallerStub/installer.ico
  94. +37 −0 InstallerStub/resource.h
  95. BIN InstallerStub/small.ico
  96. +8 −0 InstallerStub/stdafx.cpp
  97. +24 −0 InstallerStub/stdafx.h
  98. +24 −0 InstallerStub/targetver.h
  99. +36 −0 InstallerStub/versioninfo.h
  100. BIN InstallerStub/wcd-icon.ico
  101. BIN InstallerStub/wcd-icon128.bmp
  102. +33 −0 Uninstall/ReadMe.txt
  103. +8 −0 Uninstall/stdafx.cpp
  104. +11 −0 Uninstall/stdafx.h
  105. +13 −0 Uninstall/targetver.h
  106. +289 −0 Uninstall/uninstall.cpp
  107. +396 −0 Uninstall/uninstall.vcproj
  108. +215 −0 Uninstall/uninstall.vcxproj
  109. +36 −0 Uninstall/uninstall.vcxproj.filters
  110. +49 −0 VirtualAutorunDisabler/ReadMe.txt
  111. +26 −0 VirtualAutorunDisabler/VirtualAutorunDisabler.cpp
  112. +50 −0 VirtualAutorunDisabler/VirtualAutorunDisabler.idl
  113. +147 −0 VirtualAutorunDisabler/VirtualAutorunDisabler.rc
  114. +15 −0 VirtualAutorunDisabler/VirtualAutorunDisabler.rgs
  115. +530 −0 VirtualAutorunDisabler/VirtualAutorunDisabler.vcproj
  116. +308 −0 VirtualAutorunDisabler/VirtualAutorunDisabler.vcxproj
  117. +71 −0 VirtualAutorunDisabler/VirtualAutorunDisabler.vcxproj.filters
  118. +328 −0 VirtualAutorunDisabler/VirtualAutorunDisablerPS.vcproj
  119. +183 −0 VirtualAutorunDisabler/VirtualAutorunDisablerPS.vcxproj
  120. +26 −0 VirtualAutorunDisabler/VirtualAutorunDisablerPS.vcxproj.filters
  121. +5 −0 VirtualAutorunDisabler/VirtualAutorunDisabler_p.c
  122. +8 −0 VirtualAutorunDisabler/VirtualAutorunDisablerps.def
  123. +102 −0 VirtualAutorunDisabler/VirtualAutorunDisablingMonitor.cpp
  124. +116 −0 VirtualAutorunDisabler/VirtualAutorunDisablingMonitor.h
  125. +51 −0 VirtualAutorunDisabler/VirtualAutorunDisablingMonitor.rgs
  126. +37 −0 VirtualAutorunDisabler/dlldata.c
  127. +18 −0 VirtualAutorunDisabler/resource.h
  128. +5 −0 VirtualAutorunDisabler/stdafx.cpp
  129. +26 −0 VirtualAutorunDisabler/stdafx.h
  130. +26 −0 VirtualAutorunDisabler/targetver.h
  131. +69 −0 VirtualCDCtl/BadSectorDatabase.h
  132. +204 −0 VirtualCDCtl/CDSpeed.cpp
  133. +7 −0 VirtualCDCtl/CDSpeed.h
  134. +431 −0 VirtualCDCtl/DriveReadingThread.cpp
  135. +116 −0 VirtualCDCtl/DriveReadingThread.h
  136. +30 −0 VirtualCDCtl/ReadMe.txt
  137. +354 −0 VirtualCDCtl/VirtualCDClient.cpp
  138. +121 −0 VirtualCDCtl/VirtualCDClient.h
  139. +169 −0 VirtualCDCtl/VirtualCDCtl.vcxproj
  140. +60 −0 VirtualCDCtl/VirtualCDCtl.vcxproj.filters
  141. +92 −0 VirtualCDCtl/VirtualDriveClient.cpp
  142. +14 −0 VirtualCDCtl/VirtualDriveClient.h
  143. +8 −0 VirtualCDCtl/stdafx.cpp
  144. +18 −0 VirtualCDCtl/stdafx.h
  145. +13 −0 VirtualCDCtl/targetver.h
  146. +185 −0 VirtualDriveManager/DriverInstaller.cpp
  147. +7 −0 VirtualDriveManager/DriverInstaller.h
  148. +301 −0 VirtualDriveManager/MainDlg.cpp
  149. +78 −0 VirtualDriveManager/MainDlg.h
  150. +129 −0 VirtualDriveManager/VirtualDriveManager.cpp
  151. +1 −0 VirtualDriveManager/VirtualDriveManager.h
  152. +280 −0 VirtualDriveManager/VirtualDriveManager.rc
  153. +279 −0 VirtualDriveManager/VirtualDriveManager.vcproj
  154. +196 −0 VirtualDriveManager/VirtualDriveManager.vcxproj
  155. +63 −0 VirtualDriveManager/VirtualDriveManager.vcxproj.filters
  156. BIN VirtualDriveManager/res/VirtualDriveManager.ico
  157. +25 −0 VirtualDriveManager/resource.h
  158. +9 −0 VirtualDriveManager/stdafx.cpp
  159. +33 −0 VirtualDriveManager/stdafx.h
  160. +230 −0 WinCDEmu.sln
  161. +42 −0 WinCDEmuContextMenu/ContextMenuBase.cpp
  162. +12 −0 WinCDEmuContextMenu/ContextMenuBase.h
  163. +112 −0 WinCDEmuContextMenu/DriveContextMenu.cpp
  164. +98 −0 WinCDEmuContextMenu/DriveContextMenu.h
  165. +48 −0 WinCDEmuContextMenu/DriveContextMenu.rgs
  166. +56 −0 WinCDEmuContextMenu/ReadMe.txt
  167. +195 −0 WinCDEmuContextMenu/TransparentMenuBitmap.cpp
  168. +4 −0 WinCDEmuContextMenu/TransparentMenuBitmap.h
  169. +119 −0 WinCDEmuContextMenu/VCDImgContextMenu.cpp
  170. +94 −0 WinCDEmuContextMenu/VCDImgContextMenu.h
  171. +37 −0 WinCDEmuContextMenu/VCDImgContextMenu.rgs
  172. +93 −0 WinCDEmuContextMenu/WinCDEmuContextMenu.cpp
  173. +10 −0 WinCDEmuContextMenu/WinCDEmuContextMenu.def
  174. +57 −0 WinCDEmuContextMenu/WinCDEmuContextMenu.idl
  175. +162 −0 WinCDEmuContextMenu/WinCDEmuContextMenu.rc
  176. +11 −0 WinCDEmuContextMenu/WinCDEmuContextMenu.rgs
  177. +671 −0 WinCDEmuContextMenu/WinCDEmuContextMenu.vcproj
  178. +349 −0 WinCDEmuContextMenu/WinCDEmuContextMenu.vcxproj
  179. +113 −0 WinCDEmuContextMenu/WinCDEmuContextMenu.vcxproj.filters
  180. +5 −0 WinCDEmuContextMenu/WinCDEmuContextMenu_p.c
  181. +37 −0 WinCDEmuContextMenu/dlldata.c
  182. +18 −0 WinCDEmuContextMenu/dlldatax.c
  183. +15 −0 WinCDEmuContextMenu/dlldatax.h
  184. +38 −0 WinCDEmuContextMenu/dllmain.cpp
  185. +10 −0 WinCDEmuContextMenu/dllmain.h
  186. +21 −0 WinCDEmuContextMenu/resource.h
  187. +5 −0 WinCDEmuContextMenu/stdafx.cpp
  188. +29 −0 WinCDEmuContextMenu/stdafx.h
  189. +26 −0 WinCDEmuContextMenu/targetver.h
  190. +24 −0 _distr/VirtualCD.xit
  191. +24 −0 _distr/drivers.xic
  192. BIN _distr/langfiles/vmnt_bulgarian.lng
  193. BIN _distr/langfiles/vmnt_dansk.lng
  194. BIN _distr/langfiles/vmnt_dutch.lng
  195. BIN _distr/langfiles/vmnt_english.lng
  196. BIN _distr/langfiles/vmnt_estonian.lng
  197. BIN _distr/langfiles/vmnt_french.lng
  198. BIN _distr/langfiles/vmnt_german.lng
  199. BIN _distr/langfiles/vmnt_greek.lng
  200. BIN _distr/langfiles/vmnt_hebrew.lng
  201. BIN _distr/langfiles/vmnt_italian.lng
  202. BIN _distr/langfiles/vmnt_japanese.lng
  203. BIN _distr/langfiles/vmnt_korean.lng
  204. BIN _distr/langfiles/vmnt_lithuanian.lng
  205. BIN _distr/langfiles/vmnt_norsk.lng
  206. BIN _distr/langfiles/vmnt_polish.lng
  207. BIN _distr/langfiles/vmnt_portuguese.lng
  208. BIN _distr/langfiles/vmnt_romanian.lng
  209. BIN _distr/langfiles/vmnt_russian.lng
  210. BIN _distr/langfiles/vmnt_spanish.lng
  211. BIN _distr/langfiles/vmnt_swedish.lng
  212. BIN _distr/langfiles/vmnt_turkish.lng
  213. BIN _distr/langfiles/vmnt_zh_CN.lng
  214. BIN _distr/langfiles/vmnt_zh_TW.lng
  215. +52 −0 _distr/main.xic
  216. +45 −0 _distr/make.bat
  217. +131 −0 _distr/readme.txt
  218. +33 −0 batchmnt/ReadMe.txt
  219. +307 −0 batchmnt/batchmnt.cpp
  220. +104 −0 batchmnt/batchmnt.rc
  221. +402 −0 batchmnt/batchmnt.vcproj
  222. +209 −0 batchmnt/batchmnt.vcxproj
  223. +47 −0 batchmnt/batchmnt.vcxproj.filters
  224. +8 −0 batchmnt/main.cpp
  225. +14 −0 batchmnt/resource.h
  226. +8 −0 batchmnt/stdafx.cpp
  227. +21 −0 batchmnt/stdafx.h
  228. +13 −0 batchmnt/targetver.h
  229. +71 −0 vmnt/BadSectorDialog.h
  230. +62 −0 vmnt/BadSectorReportDialog.h
  231. +13 −0 vmnt/ContextMenuLabels.h
  232. +276 −0 vmnt/ISOBuildProgressDialog.cpp
  233. +83 −0 vmnt/ISOBuildProgressDialog.h
  234. +312 −0 vmnt/ISOProgressDialog.cpp
  235. +76 −0 vmnt/ISOProgressDialog.h
  236. +178 −0 vmnt/LetterSelectionDialog.cpp
  237. +89 −0 vmnt/LetterSelectionDialog.h
  238. +58 −0 vmnt/RegistryParams.h
  239. +145 −0 vmnt/SettingsDialog.cpp
  240. +47 −0 vmnt/SettingsDialog.h
  241. +82 −0 vmnt/TaskBarInterface.h
  242. +39 −0 vmnt/UACInvokerDialog.h
  243. BIN vmnt/cd.ico
  244. +70 −0 vmnt/resource.h
  245. +1 −0 vmnt/stdafx.cpp
  246. +38 −0 vmnt/stdafx.h
  247. +36 −0 vmnt/versioninfo.h
  248. +481 −0 vmnt/vmnt.cpp
  249. +320 −0 vmnt/vmnt.rc
  250. +466 −0 vmnt/vmnt.vcproj
  251. +303 −0 vmnt/vmnt.vcxproj
  252. +91 −0 vmnt/vmnt.vcxproj.filters
  253. BIN vmnt/wcd-icon.ico
  254. +9 −0 wcdversion.h
@@ -0,0 +1,257 @@
+#include "stdafx.h"
+#include <bzshlp/WinKernel/driver.h>
+#include <bzshlp/WinKernel/DeviceEnumerator.h>
+#define SKIP_WINCDEMU_GUID_DEFINITION
+#include "../BazisVirtualCDBus/BazisVirtualCDBus.h"
+
+extern "C" PDEVICE_OBJECT __stdcall IoGetLowerDeviceObject(IN PDEVICE_OBJECT DeviceObject);
+
+using namespace BazisLib;
+using namespace BazisLib::DDK;
+
+typedef struct _OBJECT_HEADER
+{
+ LONG PointerCount;
+ union
+ {
+ LONG HandleCount;
+ PVOID NextToFree;
+ };
+ POBJECT_TYPE Type;
+ UCHAR NameInfoOffset;
+ UCHAR HandleInfoOffset;
+ UCHAR QuotaInfoOffset;
+ UCHAR Flags;
+ PVOID Unused;
+ PVOID SecurityDescriptor;
+ QUAD Body;
+} OBJECT_HEADER, *POBJECT_HEADER;
+
+class PciFilterDevice : BazisVirtualCDBus
+{
+public:
+ PciFilterDevice()
+ {
+ }
+
+ virtual NTSTATUS DispatchRoutine(IN IncomingIrp *Irp, IO_STACK_LOCATION *IrpSp) override
+ {
+ if (IrpSp->MajorFunction == IRP_MJ_PNP)
+ return __super::DispatchRoutine(Irp, IrpSp);
+ else
+ return CallNextDriverSynchronously(Irp);
+ }
+
+ NTSTATUS Attach(Driver *pDriver, PDEVICE_OBJECT PhysicalDeviceObject)
+ {
+ NTSTATUS st = AddDevice(pDriver, PhysicalDeviceObject);
+ if (!NT_SUCCESS(st))
+ return st;
+
+ SetNewPNPState(Started);
+ return STATUS_SUCCESS;
+ }
+
+ void Detach()
+ {
+ DetachDevice();
+ SetNewPNPState(Stopped);
+ }
+
+ virtual NTSTATUS OnDeviceControl(ULONG ControlCode, bool IsInternal, void *pInOutBuffer, ULONG InputLength, ULONG OutputLength, PULONG_PTR pBytesDone) override
+ {
+ return __super::OnDeviceControl(ControlCode, IsInternal, pInOutBuffer, InputLength, OutputLength, pBytesDone);
+ }
+
+
+};
+
+class BazisPortableCDBus : public Device
+{
+private:
+ PciFilterDevice *m_pFilterDevice;
+
+public:
+ BazisPortableCDBus()
+ : Device(FILE_DEVICE_BUS_EXTENDER, L"BazisPortableCDBus")
+ , m_pFilterDevice(NULL)
+ {
+ }
+
+ ~BazisPortableCDBus()
+ {
+ }
+
+ NTSTATUS OnDeviceControl(ULONG ControlCode, bool IsInternal, void *pInOutBuffer, ULONG InputLength, ULONG OutputLength, PULONG_PTR pBytesDone)
+ {
+ if (m_pFilterDevice)
+ return m_pFilterDevice->OnDeviceControl(ControlCode, IsInternal, pInOutBuffer, InputLength, OutputLength, pBytesDone);
+ else
+ return STATUS_INTERNAL_ERROR;
+ }
+
+ void AttachPCIFilterDevice(PciFilterDevice *pDevice)
+ {
+ m_pFilterDevice = pDevice;
+ }
+
+ virtual NTSTATUS DispatchRoutine(IN IncomingIrp *Irp, IO_STACK_LOCATION *IrpSp)
+ {
+ NTSTATUS status = STATUS_INVALID_DEVICE_REQUEST;
+
+ if (IrpSp->MajorFunction == IRP_MJ_DEVICE_CONTROL)
+ {
+ switch (METHOD_FROM_CTL_CODE(IrpSp->Parameters.DeviceIoControl.IoControlCode))
+ {
+ case METHOD_BUFFERED:
+ status = OnDeviceControl(IrpSp->Parameters.DeviceIoControl.IoControlCode,
+ (IrpSp->MajorFunction == IRP_MJ_INTERNAL_DEVICE_CONTROL),
+ Irp->GetSystemBuffer(),
+ IrpSp->Parameters.DeviceIoControl.InputBufferLength,
+ IrpSp->Parameters.DeviceIoControl.OutputBufferLength,
+ &Irp->GetIoStatus()->Information);
+ break;
+ default:
+ return __super::DispatchRoutine(Irp, IrpSp);
+ }
+ }
+ else
+ return __super::DispatchRoutine(Irp, IrpSp);
+
+ Irp->SetIoStatus(status);
+ Irp->CompleteRequest();
+ return status;
+ }
+
+};
+
+extern "C" POBJECT_TYPE ObGetObjectType(PVOID Object);
+
+PDEVICE_OBJECT GetLowestDeviceObject(PDEVICE_OBJECT pDevObj)
+{
+ PDEVICE_OBJECT pTmp = pDevObj;
+ while (pTmp)
+ {
+ PDEVICE_OBJECT pLower = IoGetLowerDeviceObject(pTmp);
+ if (!pLower)
+ return pTmp;
+ if (pTmp != pDevObj)
+ ObDereferenceObject(pTmp);
+ pTmp = pLower;
+ }
+ return NULL;
+}
+
+PVOID g_pDriverType;
+
+class BazisPortableCDBusDriver : public Driver
+{
+private:
+ BazisPortableCDBus *pDevice;
+ PciFilterDevice *pFilter;
+
+public:
+ BazisPortableCDBusDriver() : DDK::Driver(false)
+ {
+ pDevice = new BazisPortableCDBus();
+ pFilter = NULL;
+ }
+
+ virtual NTSTATUS DriverLoad(IN PUNICODE_STRING RegistryPath) override
+ {
+ DbgPrint("BazisPortableCDBus: Starting BazisPortableCDBus...\r\n");
+ DbgPrint("BazisPortableCDBus: Locating ACPI and PCI driver objects...\r\n");
+ DriverObjectFinder drvACPI(L"acpi");
+ DeviceEnumerator drvPCI(L"pci");
+
+ if (!drvACPI.Valid() || !drvPCI.Valid())
+ return STATUS_DEVICE_NOT_READY;
+
+ PDEVICE_OBJECT pPciBusPDO = NULL;
+
+ DbgPrint("BazisPortableCDBus: Searching for PCI bus PDO...\r\n");
+
+ for (size_t i = 0; i < drvPCI.DeviceCount(); i++)
+ {
+ PDEVICE_OBJECT pDevObj = drvPCI.GetDeviceByIndex(i);
+ PDEVICE_OBJECT pLower = IoGetLowerDeviceObject(pDevObj);
+ if (!pLower)
+ continue;
+ if (pLower->DriverObject == drvACPI.GetDriverObject())
+ {
+ PDEVICE_OBJECT pPreLower = IoGetLowerDeviceObject(pLower);
+ if (!pPreLower)
+ pPciBusPDO = pLower;
+ else
+ ObDereferenceObject(pPreLower);
+ }
+ ObDereferenceObject(pLower);
+ }
+
+ if (!pPciBusPDO)
+ {
+ size_t FDOCount = 0, potentialFDOCount = 0;
+ DbgPrint("BazisPortableCDBus: Standard lookup found nothing.\r\nPerforming advanced PDO lookup...\r\nChecking all %d device objects owned by PCI driver...\r\n", drvPCI.DeviceCount());
+ for (size_t i = 0; i < drvPCI.DeviceCount(); i++)
+ {
+ PDEVICE_OBJECT pDevObj = drvPCI.GetDeviceByIndex(i);
+ PDEVICE_OBJECT pLower = IoGetLowerDeviceObject(pDevObj);
+ if (!pLower)
+ continue;
+ potentialFDOCount++;
+ PDEVICE_OBJECT pPreLower = GetLowestDeviceObject(pLower);
+ if (pPreLower)
+ {
+ if (pPreLower->DriverObject == drvACPI.GetDriverObject())
+ {
+ FDOCount++;
+ pPciBusPDO = pPreLower;
+ }
+ ObDereferenceObject(pPreLower);
+ }
+
+ ObDereferenceObject(pLower);
+ }
+ DbgPrint("BazisPortableCDBus: Found %d PCI FDO(s); %d potential FDOs.\r\n", FDOCount, potentialFDOCount);
+ if (!pPciBusPDO)
+ return STATUS_NO_SUCH_DEVICE;
+ }
+
+ DbgPrint("BazisPortableCDBus: Found the PCI PDO (%X)...\r\n", pPciBusPDO);
+
+ DbgPrint("BazisPortableCDBus: Creating \\Device\\BazisPortableCDBus...\r\n");
+ NTSTATUS status = __super::DriverLoad(RegistryPath);
+ status = pDevice->RegisterDevice(this, true, L"\\DosDevices\\BazisPortableCDBus");
+ if (!NT_SUCCESS(status))
+ return status;
+
+ pFilter = NULL;
+ pFilter = new PciFilterDevice();
+ status = pFilter->Attach(this, pPciBusPDO);
+ if (!NT_SUCCESS(status))
+ return status;
+
+ DbgPrint("BazisPortableCDBus: Hooking PCI bus driver...\r\n");
+ pDevice->AttachPCIFilterDevice(pFilter);
+
+ return STATUS_SUCCESS;
+ }
+
+ virtual ~BazisPortableCDBusDriver()
+ {
+ DbgPrint("BazisPortableCDBus: Unloading BazisPortableCDBus...\r\n");
+ pDevice->AttachPCIFilterDevice(NULL);
+
+ if (pFilter)
+ {
+ pFilter->Detach();
+ delete pFilter;
+ }
+ delete pDevice;
+ }
+};
+
+DDK::Driver *_stdcall CreateMainDriverInstance()
+{
+ return new BazisPortableCDBusDriver();
+}
@@ -0,0 +1,104 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+#include "../wcdversion.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Russian resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
+#ifdef _WIN32
+LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
+#pragma code_page(1251)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION WINCDEMU_VERSION
+ PRODUCTVERSION WINCDEMU_VERSION
+ FILEFLAGSMASK 0x17L
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "000004b0"
+ BEGIN
+ VALUE "Comments", COMMENTS_STR
+ VALUE "CompanyName", COMPANY_STR
+ VALUE "FileDescription", "Portable WinCDEmu driver"
+ VALUE "FileVersion", WINCDEMU_VERSION_STR
+ VALUE "LegalCopyright", COPYRIGHT_STR
+ VALUE "LegalTrademarks", TRADEMARKS_STR
+ VALUE "OriginalFilename", "BazisPortableCDBus.sys"
+ VALUE "ProductName", PRODUCTNAME_STR
+ VALUE "ProductVersion", WINCDEMU_VERSION_STR
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0, 1200
+ END
+END
+
+#endif // Russian resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
@@ -0,0 +1,6 @@
+REGEDIT4
+
+[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BazisPortableCDBus]
+"ErrorControl"=dword:00000001
+"Start"=dword:00000001
+"Type"=dword:00000001
Oops, something went wrong.

0 comments on commit 2dca496

Please sign in to comment.