[MSPORTS]

- Implement a simple property sheet provider for serial ports. The property sheet does not show yet because the dialog resource is not found because a call to FindResourceW fails.

svn path=/trunk/; revision=51960
This commit is contained in:
Eric Kohl 2011-05-27 15:33:12 +00:00
parent 94786cb21a
commit ccda38feca
11 changed files with 146 additions and 3 deletions

View file

@ -7,6 +7,7 @@ list(APPEND SOURCE
classinst.c
comdb.c
msports.c
serial.c
msports.rc
${CMAKE_CURRENT_BINARY_DIR}/msports_stubs.c
${CMAKE_CURRENT_BINARY_DIR}/msports.def)
@ -17,7 +18,7 @@ set_module_type(msports win32dll)
target_link_libraries(msports wine)
add_importlibs(msports setupapi advapi32 kernel32 ntdll)
add_importlibs(msports setupapi comctl32 user32 advapi32 kernel32 ntdll)
add_cd_file(TARGET msports DESTINATION reactos/system32 FOR all)
add_importlib_target(msports.spec)

View file

@ -0,0 +1,9 @@
/*
* PROJECT: Ports installer library
* LICENSE: GPL - See COPYING in the top level directory
* FILE: dll\win32\msports\internal.h
* PURPOSE: Global declarations
* COPYRIGHT: Copyright 2011 Eric Kohl
*/
extern HINSTANCE hInstance;

View file

@ -0,0 +1,12 @@
LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
IDD_SERIALSETTINGS DIALOGEX DISCARDABLE 0, 0, 252, 218
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Port Einstellungen"
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "", -1, 7, 4, 238, 114
RTEXT "B&its pro Sekunde:", -1, 77, 19, 62, 8, WS_GROUP
COMBOBOX IDC_SERIALBITSPERSECOND, 142, 17, 99, 13, WS_TABSTOP | CBS_DROPDOWNLIST
END

View file

@ -0,0 +1,12 @@
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
IDD_SERIALSETTINGS DIALOGEX DISCARDABLE 0, 0, 252, 218
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Port Settings"
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "", -1, 7, 4, 238, 114
RTEXT "B&its per second:", -1, 77, 19, 62, 8, WS_GROUP
COMBOBOX IDC_SERIALBITSPERSECOND, 142, 17, 99, 13, WS_TABSTOP | CBS_DROPDOWNLIST
END

View file

@ -1,7 +1,7 @@
/*
* PROJECT: Ports installer library
* LICENSE: GPL - See COPYING in the top level directory
* FILE: dll/win32/msports/msports.c
* FILE: dll\win32\msports\msports.c
* PURPOSE: Library main function
* COPYRIGHT: Copyright 2011 Eric Kohl
*/
@ -12,6 +12,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(msports);
HINSTANCE hInstance;
BOOL
WINAPI
@ -23,6 +24,7 @@ DllMain(HINSTANCE hinstDll,
{
case DLL_PROCESS_ATTACH:
TRACE("DLL_PROCESS_ATTACH\n");
hInstance = hinstDll;
DisableThreadLibraryCalls(hinstDll);
break;
}

View file

@ -4,9 +4,12 @@
<library>wine</library>
<library>kernel32</library>
<library>advapi32</library>
<library>comctl32</library>
<library>user32</library>
<library>setupapi</library>
<file>classinst.c</file>
<file>comdb.c</file>
<file>msports.c</file>
<file>serial.c</file>
<file>msports.rc</file>
</module>

View file

@ -1,7 +1,11 @@
#include <windows.h>
#include "resource.h"
#define REACTOS_VERSION_DLL
#define REACTOS_STR_FILE_DESCRIPTION "Ports Class Installer\0"
#define REACTOS_STR_INTERNAL_NAME "msports\0"
#define REACTOS_STR_ORIGINAL_FILENAME "msports.dll\0"
#include <reactos/version.rc>
#include "lang/de-DE.rc"
#include "lang/en-US.rc"

View file

@ -9,4 +9,4 @@
@ stub ParallelPortPropPageProvider
@ stdcall PortsClassInstaller(long ptr ptr)
@ stub SerialDisplayAdvancedSettings
@ stub SerialPortPropPageProvider
@ stdcall SerialPortPropPageProvider(ptr ptr long)

View file

@ -0,0 +1,3 @@
#define IDD_SERIALSETTINGS 200
#define IDC_SERIALBITSPERSECOND 201

View file

@ -0,0 +1,97 @@
/*
* PROJECT: Ports installer library
* LICENSE: GPL - See COPYING in the top level directory
* FILE: dll\win32\msports\serial.c
* PURPOSE: Serial Port property functions
* COPYRIGHT: Copyright 2011 Eric Kohl
*/
#include <windows.h>
#include <commctrl.h>
#include <prsht.h>
#include <setupapi.h>
#include <wine/debug.h>
#include "internal.h"
#include "resource.h"
WINE_DEFAULT_DEBUG_CHANNEL(msports);
static
BOOL
OnInitDialog(HWND hwnd,
WPARAM wParam,
LPARAM lParam)
{
FIXME("Port_OnInit()\n");
return TRUE;
}
static
INT_PTR
CALLBACK
SerialSettingsDlgProc(HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam)
{
FIXME("SerialSettingsDlgProc()\n");
switch (uMsg)
{
case WM_INITDIALOG:
return OnInitDialog(hwnd, wParam, lParam);
}
return FALSE;
}
BOOL
WINAPI
SerialPortPropPageProvider(PSP_PROPSHEETPAGE_REQUEST lpPropSheetPageRequest,
LPFNADDPROPSHEETPAGE lpfnAddPropSheetPageProc,
LPARAM lParam)
{
PROPSHEETPAGEW PropSheetPage;
HPROPSHEETPAGE hPropSheetPage;
FIXME("SerialPortPropPageProvider(%p %p %lx)\n",
lpPropSheetPageRequest, lpfnAddPropSheetPageProc, lParam);
if (lpPropSheetPageRequest->PageRequested == SPPSR_ENUM_ADV_DEVICE_PROPERTIES)
{
FIXME("SPPSR_ENUM_ADV_DEVICE_PROPERTIES\n");
PropSheetPage.dwSize = sizeof(PROPSHEETPAGEW);
PropSheetPage.dwFlags = 0;
PropSheetPage.hInstance = hInstance;
PropSheetPage.pszTemplate = MAKEINTRESOURCE(IDD_SERIALSETTINGS);
PropSheetPage.pfnDlgProc = SerialSettingsDlgProc;
PropSheetPage.lParam = 0;
PropSheetPage.pfnCallback = NULL;
hPropSheetPage = CreatePropertySheetPageW(&PropSheetPage);
if (hPropSheetPage == NULL)
{
FIXME("CreatePropertySheetPageW() failed!\n");
return FALSE;
}
if (!(*lpfnAddPropSheetPageProc)(hPropSheetPage, lParam))
{
FIXME("lpfnAddPropSheetPageProc() failed!\n");
DestroyPropertySheetPage(hPropSheetPage);
return FALSE;
}
}
FIXME("Done!\n");
return TRUE;
}
/* EOF */

Binary file not shown.