[STORPROP] Add missing stubs and move some functions around

This commit is contained in:
Eric Kohl 2021-12-20 00:08:06 +01:00
parent d375b7f6c5
commit 9a7bd386b9
9 changed files with 326 additions and 82 deletions

View file

@ -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)

116
dll/win32/storprop/disk.c Normal file
View file

@ -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@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 */

122
dll/win32/storprop/dvd.c Normal file
View file

@ -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@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 */

29
dll/win32/storprop/ide.c Normal file
View file

@ -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@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 */

View file

@ -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@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

View file

@ -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@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 */

View file

@ -1 +1,5 @@
#pragma once
#define IDD_DISK_POLICIES 100
#define IDC_QUICK_REMOVAL_BUTTON 101
#define IDC_BETTER_PERFORMANCE_BUTTON 102

View file

@ -5,86 +5,13 @@
* COPYRIGHT: 2020 Eric Kohl (eric.kohl@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(

View file

@ -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)