https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9a7bd386b9b38fa591733…
commit 9a7bd386b9b38fa5917331502a9d3de92b199b9f
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Mon Dec 20 00:08:06 2021 +0100
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Mon Dec 20 00:08:06 2021 +0100
[STORPROP] Add missing stubs and move some functions around
---
dll/win32/storprop/CMakeLists.txt | 13 ++--
dll/win32/storprop/disk.c | 116 ++++++++++++++++++++++++++++++++++++
dll/win32/storprop/dvd.c | 122 ++++++++++++++++++++++++++++++++++++++
dll/win32/storprop/ide.c | 29 +++++++++
dll/win32/storprop/lang/en-US.rc | 18 ++++++
dll/win32/storprop/precomp.h | 21 +++++++
dll/win32/storprop/resource.h | 4 ++
dll/win32/storprop/storprop.c | 76 +-----------------------
dll/win32/storprop/storprop.spec | 9 +--
9 files changed, 326 insertions(+), 82 deletions(-)
diff --git a/dll/win32/storprop/CMakeLists.txt b/dll/win32/storprop/CMakeLists.txt
index 3244c669a6d..7cb5ce5dae6 100644
--- a/dll/win32/storprop/CMakeLists.txt
+++ b/dll/win32/storprop/CMakeLists.txt
@@ -1,13 +1,18 @@
spec2def(storprop.dll storprop.spec)
+list(APPEND SOURCE
+ disk.c
+ dvd.c
+ ide.c
+ storprop.c)
+
add_library(storprop MODULE
- storprop.c
+ ${SOURCE}
storprop.rc
- ${CMAKE_CURRENT_BINARY_DIR}/storprop_stubs.c
${CMAKE_CURRENT_BINARY_DIR}/storprop.def)
set_module_type(storprop win32dll UNICODE)
-target_link_libraries(storprop wine)
-add_importlibs(storprop setupapi advapi32 msvcrt kernel32 ntdll)
+add_importlibs(storprop setupapi comctl32 advapi32 user32 msvcrt kernel32 ntdll)
+add_pch(storprop precomp.h SOURCE)
add_cd_file(TARGET storprop DESTINATION reactos/system32 FOR all)
diff --git a/dll/win32/storprop/disk.c b/dll/win32/storprop/disk.c
new file mode 100644
index 00000000000..cf45c29b7bf
--- /dev/null
+++ b/dll/win32/storprop/disk.c
@@ -0,0 +1,116 @@
+/*
+ * PROJECT: ReactOS system libraries
+ * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later)
+ * PURPOSE: Storage device properties
+ * COPYRIGHT: 2021 Eric Kohl (eric.kohl(a)reactos.org)
+ */
+
+#include "precomp.h"
+
+#define NDEBUG
+#include <debug.h>
+
+
+static
+INT_PTR
+CALLBACK
+DiskPropPageDialog(
+ _In_ HWND hwnd,
+ _In_ UINT uMsg,
+ _In_ WPARAM wParam,
+ _In_ LPARAM lParam)
+{
+ DPRINT1("DiskPropPageDialog()\n");
+
+ switch (uMsg)
+ {
+ case WM_INITDIALOG:
+ return TRUE; //OnInitDialog(hwnd, wParam, lParam);
+
+ case WM_COMMAND:
+ EndDialog(hwnd, 0); //OnCommand(hwnd, wParam, lParam);
+ break;
+/*
+ case WM_NOTIFY:
+ OnNotify(hwnd, wParam, lParam);
+ break;
+
+ case WM_DESTROY:
+ OnDestroy(hwnd);
+ break;
+*/
+ }
+
+ return FALSE;
+}
+
+
+/*
+ * @unimplemented
+ */
+DWORD
+WINAPI
+DiskClassInstaller(
+ _In_ DI_FUNCTION InstallFunction,
+ _In_ HDEVINFO DeviceInfoSet,
+ _In_ PSP_DEVINFO_DATA DeviceInfoData OPTIONAL)
+{
+ SP_ADDPROPERTYPAGE_DATA AddPropertyPageData = {0};
+ PROPSHEETPAGE Page;
+ HPROPSHEETPAGE PageHandle;
+
+ DPRINT1("DiskClassInstaller(%u %p %p)\n",
+ InstallFunction, DeviceInfoSet, DeviceInfoData);
+
+ if (InstallFunction == DIF_ADDPROPERTYPAGE_ADVANCED)
+ {
+ if (DeviceInfoData == NULL)
+ return ERROR_DI_DO_DEFAULT;
+
+ AddPropertyPageData.ClassInstallHeader.cbSize = sizeof(SP_CLASSINSTALL_HEADER);
+ if (SetupDiGetClassInstallParamsW(DeviceInfoSet,
+ DeviceInfoData,
+
(PSP_CLASSINSTALL_HEADER)&AddPropertyPageData,
+ sizeof(SP_ADDPROPERTYPAGE_DATA),
+ NULL))
+ {
+ DPRINT1("\n");
+ if (AddPropertyPageData.NumDynamicPages >= MAX_INSTALLWIZARD_DYNAPAGES)
+ return ERROR_SUCCESS;
+
+ ZeroMemory(&Page, sizeof(PROPSHEETPAGE));
+ Page.dwSize = sizeof(PROPSHEETPAGE);
+ Page.dwFlags = PSP_USECALLBACK;
+ Page.hInstance = hInstance;
+ Page.pszTemplate = MAKEINTRESOURCE(IDD_DISK_POLICIES);
+ Page.pfnDlgProc = DiskPropPageDialog;
+ Page.pfnCallback = NULL; //DiskPropPageCallback;
+ Page.lParam = (LPARAM)NULL;
+
+ PageHandle = CreatePropertySheetPage(&Page);
+ if (PageHandle == NULL)
+ {
+ DPRINT1("CreatePropertySheetPage() failed!\n");
+ return ERROR_SUCCESS;
+ }
+
+ AddPropertyPageData.DynamicPages[AddPropertyPageData.NumDynamicPages] =
PageHandle;
+ AddPropertyPageData.NumDynamicPages++;
+ DPRINT1("Pages: %ld\n", AddPropertyPageData.NumDynamicPages);
+
+ if (!SetupDiSetClassInstallParamsW(DeviceInfoSet,
+ DeviceInfoData,
+
(PSP_CLASSINSTALL_HEADER)&AddPropertyPageData,
+ sizeof(SP_ADDPROPERTYPAGE_DATA)))
+ {
+ DPRINT1("SetupDiSetClassInstallParamsW() failed (Error %lu)\n",
GetLastError());
+ }
+ }
+
+ return ERROR_SUCCESS;
+ }
+
+ return ERROR_DI_DO_DEFAULT;
+}
+
+/* EOF */
diff --git a/dll/win32/storprop/dvd.c b/dll/win32/storprop/dvd.c
new file mode 100644
index 00000000000..2c527843377
--- /dev/null
+++ b/dll/win32/storprop/dvd.c
@@ -0,0 +1,122 @@
+/*
+ * PROJECT: ReactOS system libraries
+ * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later)
+ * PURPOSE: Storage device properties
+ * COPYRIGHT: 2021 Eric Kohl (eric.kohl(a)reactos.org)
+ */
+
+#include "precomp.h"
+
+#define NDEBUG
+#include <debug.h>
+
+
+/*
+ * @unimplemented
+ */
+LONG
+WINAPI
+CdromDisableDigitalPlayback(
+ _In_ HDEVINFO DeviceInfoSet,
+ _In_ PSP_DEVINFO_DATA DeviceInfoData)
+{
+ DPRINT1("CdromDisableDigitalPlayback(%p %p)\n",
+ DeviceInfoSet, DeviceInfoData);
+ return ERROR_SUCCESS;
+}
+
+
+/*
+ * @unimplemented
+ */
+LONG
+WINAPI
+CdromEnableDigitalPlayback(
+ _In_ HDEVINFO DeviceInfoSet,
+ _In_ PSP_DEVINFO_DATA DeviceInfoData,
+ _In_ BOOLEAN ForceUnknown)
+{
+ DPRINT1("CdromEnableDigitalPlayback(%p %p %u)\n",
+ DeviceInfoSet, DeviceInfoData, ForceUnknown);
+ return ERROR_SUCCESS;
+}
+
+
+/*
+ * @unimplemented
+ */
+LONG
+WINAPI
+CdromIsDigitalPlaybackEnabled(
+ _In_ HDEVINFO DeviceInfoSet,
+ _In_ PSP_DEVINFO_DATA DeviceInfoData,
+ _Out_ PBOOLEAN Enabled)
+{
+ DPRINT1("CdromIsDigitalPlaybackEnabled(%p %p %p)\n",
+ DeviceInfoSet, DeviceInfoData, Enabled);
+ return ERROR_SUCCESS;
+}
+
+
+/*
+ * @unimplemented
+ */
+BOOL
+WINAPI
+CdromKnownGoodDigitalPlayback(
+ _In_ HDEVINFO DeviceInfoSet,
+ _In_ PSP_DEVINFO_DATA DeviceInfoData)
+{
+ DPRINT1("CdromKnownGoodDigitalPlayback(%p %p)\n",
+ DeviceInfoSet, DeviceInfoData);
+ return TRUE;
+}
+
+
+/*
+ * @unimplemented
+ */
+DWORD
+WINAPI
+DvdClassInstaller(
+ _In_ DI_FUNCTION InstallFunction,
+ _In_ HDEVINFO DeviceInfoSet,
+ _In_ PSP_DEVINFO_DATA DeviceInfoData OPTIONAL)
+{
+ DPRINT1("DvdClassInstaller(%u %p %p)\n",
+ InstallFunction, DeviceInfoSet, DeviceInfoData);
+
+ return ERROR_DI_DO_DEFAULT;
+}
+
+
+/*
+ * @unimplemented
+ */
+BOOL
+WINAPI
+DvdPropPageProvider(
+ _In_ PSP_PROPSHEETPAGE_REQUEST lpPropSheetPageRequest,
+ _In_ LPFNADDPROPSHEETPAGE lpfnAddPropSheetPageProc,
+ _In_ LPARAM lParam)
+{
+ DPRINT1("DvdPropPageProvider(%p %p %lx)\n",
+ lpPropSheetPageRequest, lpfnAddPropSheetPageProc, lParam);
+ return FALSE;
+}
+
+
+/*
+ * @unimplemented
+ */
+BOOL
+WINAPI
+DvdLauncher(
+ _In_ HWND HWnd,
+ _In_ CHAR DriveLetter)
+{
+ DPRINT1("DvdLauncher(%p %c)\n", HWnd, DriveLetter);
+ return FALSE;
+}
+
+/* EOF */
diff --git a/dll/win32/storprop/ide.c b/dll/win32/storprop/ide.c
new file mode 100644
index 00000000000..72559dd6b8a
--- /dev/null
+++ b/dll/win32/storprop/ide.c
@@ -0,0 +1,29 @@
+/*
+ * PROJECT: ReactOS system libraries
+ * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later)
+ * PURPOSE: Storage device properties
+ * COPYRIGHT: 2021 Eric Kohl (eric.kohl(a)reactos.org)
+ */
+
+#include "precomp.h"
+
+#define NDEBUG
+#include <debug.h>
+
+
+/*
+ * @unimplemented
+ */
+BOOL
+WINAPI
+IdePropPageProvider(
+ _In_ PSP_PROPSHEETPAGE_REQUEST lpPropSheetPageRequest,
+ _In_ LPFNADDPROPSHEETPAGE lpfnAddPropSheetPageProc,
+ _In_ LPARAM lParam)
+{
+ DPRINT1("IdePropPageProvider(%p %p %lx)\n",
+ lpPropSheetPageRequest, lpfnAddPropSheetPageProc, lParam);
+ return FALSE;
+}
+
+/* EOF */
diff --git a/dll/win32/storprop/lang/en-US.rc b/dll/win32/storprop/lang/en-US.rc
new file mode 100644
index 00000000000..401da1572e3
--- /dev/null
+++ b/dll/win32/storprop/lang/en-US.rc
@@ -0,0 +1,18 @@
+/*
+ * PROJECT: ReactOS system libraries
+ * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later)
+ * PURPOSE: Storage device properties
+ * COPYRIGHT: 2021 Eric Kohl (eric.kohl(a)reactos.org)
+ */
+
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+
+IDD_DISK_POLICIES DIALOGEX 0, 0, 252, 218
+STYLE WS_CHILD | WS_VISIBLE | WS_CAPTION
+CAPTION "Policies"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ GROUPBOX "Removal Policy", -1, 7, 7, 238, 204
+ AUTORADIOBUTTON "Quick removal", IDC_QUICK_REMOVAL_BUTTON, 14, 28, 127, 10
+ AUTORADIOBUTTON "Better performance", IDC_BETTER_PERFORMANCE_BUTTON, 14,
28, 127, 10
+END
diff --git a/dll/win32/storprop/precomp.h b/dll/win32/storprop/precomp.h
new file mode 100644
index 00000000000..c9a9bae0fe6
--- /dev/null
+++ b/dll/win32/storprop/precomp.h
@@ -0,0 +1,21 @@
+/*
+ * PROJECT: ReactOS system libraries
+ * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later)
+ * PURPOSE: Storage device properties
+ * COPYRIGHT: 2021 Eric Kohl (eric.kohl(a)reactos.org)
+ */
+
+#define WIN32_NO_STATUS
+#include <stdarg.h>
+#include <windef.h>
+#include <winbase.h>
+#include <winreg.h>
+#include <winuser.h>
+#include <commctrl.h>
+#include <setupapi.h>
+
+#include "resource.h"
+
+extern HINSTANCE hInstance;
+
+/* EOF */
diff --git a/dll/win32/storprop/resource.h b/dll/win32/storprop/resource.h
index 6f70f09beec..89c57e0cb82 100644
--- a/dll/win32/storprop/resource.h
+++ b/dll/win32/storprop/resource.h
@@ -1 +1,5 @@
#pragma once
+
+#define IDD_DISK_POLICIES 100
+#define IDC_QUICK_REMOVAL_BUTTON 101
+#define IDC_BETTER_PERFORMANCE_BUTTON 102
\ No newline at end of file
diff --git a/dll/win32/storprop/storprop.c b/dll/win32/storprop/storprop.c
index 7a07a3bff82..d1967421216 100644
--- a/dll/win32/storprop/storprop.c
+++ b/dll/win32/storprop/storprop.c
@@ -5,86 +5,13 @@
* COPYRIGHT: 2020 Eric Kohl (eric.kohl(a)reactos.org)
*/
-#define WIN32_NO_STATUS
-#include <stdarg.h>
-#include <windef.h>
-#include <winbase.h>
-#include <winreg.h>
-#include <winuser.h>
-#include <commctrl.h>
-#include <setupapi.h>
+#include "precomp.h"
#define NDEBUG
#include <debug.h>
HINSTANCE hInstance = NULL;
-/*
- * @unimplemented
- */
-DWORD
-WINAPI
-DiskClassInstaller(
- _In_ DI_FUNCTION InstallFunction,
- _In_ HDEVINFO DeviceInfoSet,
- _In_ PSP_DEVINFO_DATA DeviceInfoData OPTIONAL)
-{
- DPRINT("DiskClassInstaller(%u %p %p)\n",
- InstallFunction, DeviceInfoSet, DeviceInfoData);
-
- if (InstallFunction == DIF_ADDPROPERTYPAGE_ADVANCED)
- {
- return ERROR_SUCCESS;
- }
-
- return ERROR_DI_DO_DEFAULT;
-}
-
-/*
- * @unimplemented
- */
-DWORD
-WINAPI
-DvdClassInstaller(
- _In_ DI_FUNCTION InstallFunction,
- _In_ HDEVINFO DeviceInfoSet,
- _In_ PSP_DEVINFO_DATA DeviceInfoData OPTIONAL)
-{
- DPRINT("DvdClassInstaller(%u %p %p)\n",
- InstallFunction, DeviceInfoSet, DeviceInfoData);
-
- return ERROR_DI_DO_DEFAULT;
-}
-
-/*
- * @unimplemented
- */
-BOOL
-WINAPI
-DvdPropPageProvider(
- _In_ PSP_PROPSHEETPAGE_REQUEST lpPropSheetPageRequest,
- _In_ LPFNADDPROPSHEETPAGE lpfnAddPropSheetPageProc,
- _In_ LPARAM lParam)
-{
- DPRINT("DvdPropPageProvider(%p %p %lx)\n",
- lpPropSheetPageRequest, lpfnAddPropSheetPageProc, lParam);
- return FALSE;
-}
-
-/*
- * @unimplemented
- */
-BOOL
-WINAPI
-IdePropPageProvider(
- _In_ PSP_PROPSHEETPAGE_REQUEST lpPropSheetPageRequest,
- _In_ LPFNADDPROPSHEETPAGE lpfnAddPropSheetPageProc,
- _In_ LPARAM lParam)
-{
- DPRINT("IdePropPageProvider(%p %p %lx)\n",
- lpPropSheetPageRequest, lpfnAddPropSheetPageProc, lParam);
- return FALSE;
-}
/*
* @implemented
@@ -101,6 +28,7 @@ VolumePropPageProvider(
return FALSE;
}
+
BOOL
WINAPI
DllMain(
diff --git a/dll/win32/storprop/storprop.spec b/dll/win32/storprop/storprop.spec
index f0d37a3bb16..49c080b58d7 100644
--- a/dll/win32/storprop/storprop.spec
+++ b/dll/win32/storprop/storprop.spec
@@ -1,10 +1,11 @@
-@ stub CdromDisableDigitalPlayback
-@ stub CdromEnableDigitalPlayback
-@ stub CdromIsDigitalPlaybackEnabled
+@ stdcall CdromDisableDigitalPlayback(ptr ptr)
+@ stdcall CdromEnableDigitalPlayback(ptr ptr long)
+@ stdcall CdromIsDigitalPlaybackEnabled(ptr ptr ptr)
+@ stdcall CdromKnownGoodDigitalPlayback(ptr ptr)
@ stdcall DiskClassInstaller(long ptr ptr)
@ stdcall DllMain(ptr long ptr)
@ stdcall DvdClassInstaller(long ptr ptr)
-@ stub DvdLauncher
+@ stdcall DvdLauncher(ptr long)
@ stdcall DvdPropPageProvider(ptr ptr long)
@ stdcall IdePropPageProvider(ptr ptr long)
@ stdcall VolumePropPageProvider(ptr ptr long)