Author: ekohl
Date: Sun Sep 16 17:38:26 2007
New Revision: 29067
URL:
http://svn.reactos.org/svn/reactos?rev=29067&view=rev
Log:
Indentation clean-up. No code changes.
Modified:
trunk/reactos/dll/cpl/appwiz/appwiz.c
trunk/reactos/dll/cpl/hdwwiz/hdwwiz.c
trunk/reactos/dll/cpl/liccpa/liccpa.c
Modified: trunk/reactos/dll/cpl/appwiz/appwiz.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/appwiz.c?re…
==============================================================================
--- trunk/reactos/dll/cpl/appwiz/appwiz.c (original)
+++ trunk/reactos/dll/cpl/appwiz/appwiz.c Sun Sep 16 17:38:26 2007
@@ -19,7 +19,7 @@
/* $Id$
*
* PROJECT: ReactOS Software Control Panel
- * FILE: lib/cpl/system/appwiz.c
+ * FILE: dll/cpl/appwiz/appwiz.c
* PURPOSE: ReactOS Software Control Panel
* PROGRAMMER: Gero Kuehn (reactos.filter(a)gkware.com)
* UPDATE HISTORY:
@@ -49,214 +49,221 @@
/* Applets */
APPLET Applets[NUM_APPLETS] =
{
- {IDI_CPLSYSTEM, IDS_CPLSYSTEMNAME, IDS_CPLSYSTEMDESCRIPTION, SystemApplet}
+ {IDI_CPLSYSTEM, IDS_CPLSYSTEMNAME, IDS_CPLSYSTEMDESCRIPTION, SystemApplet}
};
static VOID
CallUninstall(HWND hwndDlg)
{
- STARTUPINFO si;
- PROCESS_INFORMATION pi;
- int nIndex;
- HKEY hKey;
- DWORD dwType;
- TCHAR pszUninstallString[MAX_PATH];
- DWORD dwSize;
-
- nIndex = (int) SendDlgItemMessage(hwndDlg, IDC_SOFTWARELIST, LB_GETCURSEL, 0, 0);
- if (nIndex == -1)
- {
- MessageBox(hwndDlg,
- _TEXT("No item selected"),
- _TEXT("Error"),
- MB_ICONSTOP);
- }
- else
- {
- hKey = (HKEY)SendDlgItemMessage(hwndDlg, IDC_SOFTWARELIST, LB_GETITEMDATA,
(WPARAM)nIndex, 0);
-
- dwType = REG_SZ;
+ STARTUPINFO si;
+ PROCESS_INFORMATION pi;
+ INT nIndex;
+ HKEY hKey;
+ DWORD dwType;
+ TCHAR pszUninstallString[MAX_PATH];
+ DWORD dwSize;
+
+ nIndex = (INT)SendDlgItemMessage(hwndDlg, IDC_SOFTWARELIST, LB_GETCURSEL, 0, 0);
+ if (nIndex == -1)
+ {
+ MessageBox(hwndDlg,
+ _TEXT("No item selected"),
+ _TEXT("Error"),
+ MB_ICONSTOP);
+ }
+ else
+ {
+ hKey = (HKEY)SendDlgItemMessage(hwndDlg, IDC_SOFTWARELIST, LB_GETITEMDATA,
(WPARAM)nIndex, 0);
+
+ dwType = REG_SZ;
+ dwSize = MAX_PATH;
+ if (RegQueryValueEx(hKey,
+ _TEXT("UninstallString"),
+ NULL,
+ &dwType,
+ (LPBYTE)pszUninstallString,
+ &dwSize) == ERROR_SUCCESS)
+ {
+ ZeroMemory(&si, sizeof(si));
+ si.cb = sizeof(si);
+ si.wShowWindow = SW_SHOW;
+ if
(CreateProcess(NULL,pszUninstallString,NULL,NULL,FALSE,0,NULL,NULL,&si,&pi))
+ {
+ CloseHandle(pi.hProcess);
+ CloseHandle(pi.hThread);
+ }
+ }
+ else
+ {
+ MessageBox(hwndDlg,
+ _TEXT("Unable to read UninstallString. This entry is invalid
or has been created by an MSI installer."),
+ _TEXT("Error"),
+ MB_ICONSTOP);
+ }
+ }
+}
+
+
+static VOID
+FillSoftwareList(HWND hwndDlg)
+{
+ TCHAR pszName[MAX_PATH];
+ TCHAR pszDisplayName[MAX_PATH];
+ TCHAR pszParentKeyName[MAX_PATH];
+ FILETIME FileTime;
+ HKEY hKey;
+ HKEY hSubKey;
+ DWORD dwType;
+ DWORD dwSize;
+ DWORD dwValue = 0;
+ BOOL bIsUpdate = FALSE;
+ BOOL bIsSystemComponent = FALSE;
+ BOOL bShowUpdates = FALSE;
+ INT i;
+ ULONG ulIndex;
+
+ bShowUpdates = (SendMessage(GetDlgItem(hwndDlg, IDC_SHOWUPDATES), BM_GETCHECK, 0, 0)
== BST_CHECKED);
+
+ if (RegOpenKey(HKEY_LOCAL_MACHINE,
+
_TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"),
+ &hKey) != ERROR_SUCCESS)
+ {
+ MessageBox(hwndDlg,
+ _TEXT("Unable to open Uninstall Key"),
+ _TEXT("Error"),
+ MB_ICONSTOP);
+ return;
+ }
+
+ i = 0;
dwSize = MAX_PATH;
- if (RegQueryValueEx(hKey,
- _TEXT("UninstallString"),
- NULL,
- &dwType,
- (LPBYTE)pszUninstallString,
- &dwSize) == ERROR_SUCCESS)
- {
- ZeroMemory(&si, sizeof(si));
- si.cb = sizeof(si);
- si.wShowWindow = SW_SHOW;
- if
(CreateProcess(NULL,pszUninstallString,NULL,NULL,FALSE,0,NULL,NULL,&si,&pi))
- {
- CloseHandle(pi.hProcess);
- CloseHandle(pi.hThread);
- }
- }
- else
- {
- MessageBox(hwndDlg,
- _TEXT("Unable to read UninstallString. This entry is invalid or has
been created by an MSI installer."),
- _TEXT("Error"),
- MB_ICONSTOP);
- }
- }
-}
-
-
-static void FillSoftwareList(HWND hwndDlg)
-{
- TCHAR pszName[MAX_PATH];
- TCHAR pszDisplayName[MAX_PATH];
- TCHAR pszParentKeyName[MAX_PATH];
- FILETIME FileTime;
- HKEY hKey;
- HKEY hSubKey;
- DWORD dwType;
- DWORD dwSize;
- DWORD dwValue = 0;
- BOOL bIsUpdate = FALSE;
- BOOL bIsSystemComponent = FALSE;
- BOOL bShowUpdates = FALSE;
- int i;
- ULONG index;
-
- bShowUpdates = (SendMessage(GetDlgItem(hwndDlg, IDC_SHOWUPDATES), BM_GETCHECK, 0, 0) ==
BST_CHECKED);
-
- if (RegOpenKey(HKEY_LOCAL_MACHINE,
-
_TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"),
- &hKey) != ERROR_SUCCESS)
- {
- MessageBox(hwndDlg,
- _TEXT("Unable to open Uninstall Key"),
- _TEXT("Error"),
- MB_ICONSTOP);
- return;
- }
-
- i = 0;
- dwSize = MAX_PATH;
- while (RegEnumKeyEx (hKey, i, pszName, &dwSize, NULL, NULL, NULL, &FileTime) ==
ERROR_SUCCESS)
- {
- if (RegOpenKey(hKey,pszName,&hSubKey)==ERROR_SUCCESS)
- {
- dwType = REG_DWORD;
- dwSize = sizeof(DWORD);
- if (RegQueryValueEx(hSubKey,
- _TEXT("SystemComponent"),
- NULL,
- &dwType,
- (LPBYTE)&dwValue,
- &dwSize) == ERROR_SUCCESS)
- {
- bIsSystemComponent = (dwValue == 0x1);
- }
- else {
- bIsSystemComponent = FALSE;
- }
- dwType = REG_SZ;
- dwSize = MAX_PATH;
- bIsUpdate = (RegQueryValueEx(hSubKey,
- _TEXT("ParentKeyName"),
- NULL,
- &dwType,
- (LPBYTE)pszParentKeyName,
- &dwSize) == ERROR_SUCCESS);
- dwSize = MAX_PATH;
- if (RegQueryValueEx(hSubKey,
- _TEXT("DisplayName"),
- NULL,
- &dwType,
- (LPBYTE)pszDisplayName,
- &dwSize) == ERROR_SUCCESS)
- {
- if ((!bIsUpdate) && (!bIsSystemComponent))
+ while (RegEnumKeyEx (hKey, i, pszName, &dwSize, NULL, NULL, NULL, &FileTime)
== ERROR_SUCCESS)
+ {
+ if (RegOpenKey(hKey,pszName,&hSubKey) == ERROR_SUCCESS)
{
- index = (ULONG)
SendDlgItemMessage(hwndDlg,IDC_SOFTWARELIST,LB_ADDSTRING,0,(LPARAM)pszDisplayName);
-
SendDlgItemMessage(hwndDlg,IDC_SOFTWARELIST,LB_SETITEMDATA,index,(LPARAM)hSubKey);
+ dwType = REG_DWORD;
+ dwSize = sizeof(DWORD);
+ if (RegQueryValueEx(hSubKey,
+ _TEXT("SystemComponent"),
+ NULL,
+ &dwType,
+ (LPBYTE)&dwValue,
+ &dwSize) == ERROR_SUCCESS)
+ {
+ bIsSystemComponent = (dwValue == 0x1);
+ }
+ else
+ {
+ bIsSystemComponent = FALSE;
+ }
+
+ dwType = REG_SZ;
+ dwSize = MAX_PATH;
+ bIsUpdate = (RegQueryValueEx(hSubKey,
+ _TEXT("ParentKeyName"),
+ NULL,
+ &dwType,
+ (LPBYTE)pszParentKeyName,
+ &dwSize) == ERROR_SUCCESS);
+ dwSize = MAX_PATH;
+ if (RegQueryValueEx(hSubKey,
+ _TEXT("DisplayName"),
+ NULL,
+ &dwType,
+ (LPBYTE)pszDisplayName,
+ &dwSize) == ERROR_SUCCESS)
+ {
+ if ((!bIsUpdate) && (!bIsSystemComponent))
+ {
+ ulIndex =
(ULONG)SendDlgItemMessage(hwndDlg,IDC_SOFTWARELIST,LB_ADDSTRING,0,(LPARAM)pszDisplayName);
+
SendDlgItemMessage(hwndDlg,IDC_SOFTWARELIST,LB_SETITEMDATA,ulIndex,(LPARAM)hSubKey);
+ }
+ else if (bIsUpdate && bShowUpdates)
+ {
+ ulIndex =
(ULONG)SendDlgItemMessage(hwndDlg,IDC_SOFTWARELIST,LB_ADDSTRING,0,(LPARAM)pszDisplayName);
+
SendDlgItemMessage(hwndDlg,IDC_SOFTWARELIST,LB_SETITEMDATA,ulIndex,(LPARAM)hSubKey);
+ }
+ }
}
- else if (bIsUpdate && bShowUpdates)
- {
- index = (ULONG)
SendDlgItemMessage(hwndDlg,IDC_SOFTWARELIST,LB_ADDSTRING,0,(LPARAM)pszDisplayName);
-
SendDlgItemMessage(hwndDlg,IDC_SOFTWARELIST,LB_SETITEMDATA,index,(LPARAM)hSubKey);
- }
- }
- }
-
- dwSize = MAX_PATH;
- i++;
- }
-
- RegCloseKey(hKey);
-}
+
+ dwSize = MAX_PATH;
+ i++;
+ }
+
+ RegCloseKey(hKey);
+}
+
/* Property page dialog callback */
static INT_PTR CALLBACK
-InstallPageProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
-{
- UNREFERENCED_PARAMETER(lParam);
- switch (uMsg)
- {
- case WM_INITDIALOG:
- EnableWindow(GetDlgItem(hwndDlg,IDC_INSTALL), FALSE);
- FillSoftwareList(hwndDlg);
- break;
-
- case WM_COMMAND:
- switch (LOWORD(wParam))
- {
- case IDC_SHOWUPDATES:
- if (HIWORD(wParam) == BN_CLICKED)
- {
- SendDlgItemMessage(hwndDlg, IDC_SOFTWARELIST, LB_RESETCONTENT, 0, 0);
+InstallPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+ UNREFERENCED_PARAMETER(lParam);
+
+ switch (uMsg)
+ {
+ case WM_INITDIALOG:
+ EnableWindow(GetDlgItem(hwndDlg, IDC_INSTALL), FALSE);
FillSoftwareList(hwndDlg);
- }
- break;
- case IDC_SOFTWARELIST:
- if (HIWORD(wParam) == LBN_DBLCLK)
- {
- CallUninstall(hwndDlg);
- }
- break;
-
- case IDC_ADDREMOVE:
- CallUninstall(hwndDlg);
- break;
- }
- break;
- }
-
- return FALSE;
+ break;
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam))
+ {
+ case IDC_SHOWUPDATES:
+ if (HIWORD(wParam) == BN_CLICKED)
+ {
+ SendDlgItemMessage(hwndDlg, IDC_SOFTWARELIST, LB_RESETCONTENT, 0,
0);
+ FillSoftwareList(hwndDlg);
+ }
+ break;
+
+ case IDC_SOFTWARELIST:
+ if (HIWORD(wParam) == LBN_DBLCLK)
+ {
+ CallUninstall(hwndDlg);
+ }
+ break;
+
+ case IDC_ADDREMOVE:
+ CallUninstall(hwndDlg);
+ break;
+ }
+ break;
+ }
+
+ return FALSE;
}
/* Property page dialog callback */
static INT_PTR CALLBACK
-RosPageProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
-{
- UNREFERENCED_PARAMETER(lParam);
- UNREFERENCED_PARAMETER(wParam);
- UNREFERENCED_PARAMETER(hwndDlg);
- switch(uMsg)
- {
- case WM_INITDIALOG:
- break;
- }
-
- return FALSE;
+RosPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+ UNREFERENCED_PARAMETER(lParam);
+ UNREFERENCED_PARAMETER(wParam);
+ UNREFERENCED_PARAMETER(hwndDlg);
+
+ switch (uMsg)
+ {
+ case WM_INITDIALOG:
+ break;
+ }
+
+ return FALSE;
}
static VOID
InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc)
{
- ZeroMemory(psp, sizeof(PROPSHEETPAGE));
- psp->dwSize = sizeof(PROPSHEETPAGE);
- psp->dwFlags = PSP_DEFAULT;
- psp->hInstance = hApplet;
- psp->pszTemplate = MAKEINTRESOURCE(idDlg);
- psp->pfnDlgProc = DlgProc;
+ ZeroMemory(psp, sizeof(PROPSHEETPAGE));
+ psp->dwSize = sizeof(PROPSHEETPAGE);
+ psp->dwFlags = PSP_DEFAULT;
+ psp->hInstance = hApplet;
+ psp->pszTemplate = MAKEINTRESOURCE(idDlg);
+ psp->pfnDlgProc = DlgProc;
}
@@ -265,28 +272,28 @@
LONG CALLBACK
SystemApplet(VOID)
{
- PROPSHEETPAGE psp[2];
- PROPSHEETHEADER psh;
- TCHAR Caption[1024];
-
- LoadString(hApplet, IDS_CPLSYSTEMNAME, Caption, sizeof(Caption) / sizeof(TCHAR));
-
- ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
- psh.dwSize = sizeof(PROPSHEETHEADER);
- psh.dwFlags = PSH_PROPSHEETPAGE;
- psh.hwndParent = NULL;
- psh.hInstance = hApplet;
- psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_CPLSYSTEM));
- psh.pszCaption = Caption;
- psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
- psh.nStartPage = 0;
- psh.ppsp = psp;
- psh.pfnCallback = NULL;
-
- InitPropSheetPage(&psp[0], IDD_PROPPAGEINSTALL, (DLGPROC) InstallPageProc);
- InitPropSheetPage(&psp[1], IDD_PROPPAGEROSSETUP, (DLGPROC) RosPageProc);
-
- return (LONG)(PropertySheet(&psh) != -1);
+ PROPSHEETPAGE psp[2];
+ PROPSHEETHEADER psh;
+ TCHAR Caption[1024];
+
+ LoadString(hApplet, IDS_CPLSYSTEMNAME, Caption, sizeof(Caption) / sizeof(TCHAR));
+
+ ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
+ psh.dwSize = sizeof(PROPSHEETHEADER);
+ psh.dwFlags = PSH_PROPSHEETPAGE;
+ psh.hwndParent = NULL;
+ psh.hInstance = hApplet;
+ psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_CPLSYSTEM));
+ psh.pszCaption = Caption;
+ psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
+ psh.nStartPage = 0;
+ psh.ppsp = psp;
+ psh.pfnCallback = NULL;
+
+ InitPropSheetPage(&psp[0], IDD_PROPPAGEINSTALL, (DLGPROC) InstallPageProc);
+ InitPropSheetPage(&psp[1], IDD_PROPPAGEROSSETUP, (DLGPROC) RosPageProc);
+
+ return (LONG)(PropertySheet(&psh) != -1);
}
@@ -294,47 +301,49 @@
LONG CALLBACK
CPlApplet(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
{
- CPLINFO *CPlInfo;
- DWORD i;
-
- UNREFERENCED_PARAMETER(hwndCPl);
-
- i = (DWORD)lParam1;
- switch(uMsg)
- {
- case CPL_INIT:
- return TRUE;
-
- case CPL_GETCOUNT:
- return NUM_APPLETS;
-
- case CPL_INQUIRE:
- CPlInfo = (CPLINFO*)lParam2;
- CPlInfo->lData = 0;
- CPlInfo->idIcon = Applets[i].idIcon;
- CPlInfo->idName = Applets[i].idName;
- CPlInfo->idInfo = Applets[i].idDescription;
- break;
-
- case CPL_DBLCLK:
- Applets[i].AppletProc();
- break;
- }
-
- return FALSE;
+ CPLINFO *CPlInfo;
+ DWORD i;
+
+ UNREFERENCED_PARAMETER(hwndCPl);
+
+ i = (DWORD)lParam1;
+ switch (uMsg)
+ {
+ case CPL_INIT:
+ return TRUE;
+
+ case CPL_GETCOUNT:
+ return NUM_APPLETS;
+
+ case CPL_INQUIRE:
+ CPlInfo = (CPLINFO*)lParam2;
+ CPlInfo->lData = 0;
+ CPlInfo->idIcon = Applets[i].idIcon;
+ CPlInfo->idName = Applets[i].idName;
+ CPlInfo->idInfo = Applets[i].idDescription;
+ break;
+
+ case CPL_DBLCLK:
+ Applets[i].AppletProc();
+ break;
+ }
+
+ return FALSE;
}
BOOL WINAPI
DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
{
- UNREFERENCED_PARAMETER(lpvReserved);
- switch(dwReason)
- {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- hApplet = hinstDLL;
- break;
- }
- return TRUE;
-}
+ UNREFERENCED_PARAMETER(lpvReserved);
+
+ switch (dwReason)
+ {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ hApplet = hinstDLL;
+ break;
+ }
+
+ return TRUE;
+}
Modified: trunk/reactos/dll/cpl/hdwwiz/hdwwiz.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/hdwwiz.c?re…
==============================================================================
--- trunk/reactos/dll/cpl/hdwwiz/hdwwiz.c (original)
+++ trunk/reactos/dll/cpl/hdwwiz/hdwwiz.c Sun Sep 16 17:38:26 2007
@@ -18,7 +18,7 @@
*/
/*
* PROJECT: ReactOS Add hardware control panel
- * FILE: lib/cpl/hdwwiz/hdwwiz.c
+ * FILE: dll/cpl/hdwwiz/hdwwiz.c
* PURPOSE: ReactOS Add hardware control panel
* PROGRAMMER: Hervé Poussineau (hpoussin(a)reactos.org)
*/
@@ -39,7 +39,7 @@
/* Applets */
APPLET Applets[] =
{
- {IDI_CPLICON, IDS_CPLNAME, IDS_CPLDESCRIPTION, Applet}
+ {IDI_CPLICON, IDS_CPLNAME, IDS_CPLDESCRIPTION, Applet}
};
typedef BOOL (WINAPI *PINSTALL_NEW_DEVICE)(HWND, LPGUID, PDWORD);
@@ -47,105 +47,108 @@
static LONG APIENTRY
Applet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
{
- HMODULE hNewDev = NULL;
- PINSTALL_NEW_DEVICE InstallNewDevice;
- DWORD Reboot;
- BOOL ret;
- LONG rc;
+ HMODULE hNewDev = NULL;
+ PINSTALL_NEW_DEVICE InstallNewDevice;
+ DWORD Reboot;
+ BOOL ret;
+ LONG rc;
- UNREFERENCED_PARAMETER(lParam);
- UNREFERENCED_PARAMETER(wParam);
- UNREFERENCED_PARAMETER(uMsg);
+ UNREFERENCED_PARAMETER(lParam);
+ UNREFERENCED_PARAMETER(wParam);
+ UNREFERENCED_PARAMETER(uMsg);
- hNewDev = LoadLibrary(_T("newdev.dll"));
- if (!hNewDev)
- {
- rc = 1;
- goto cleanup;
- }
+ hNewDev = LoadLibrary(_T("newdev.dll"));
+ if (!hNewDev)
+ {
+ rc = 1;
+ goto cleanup;
+ }
- InstallNewDevice = (PINSTALL_NEW_DEVICE)GetProcAddress(hNewDev,
(LPCSTR)"InstallNewDevice");
- if (!InstallNewDevice)
- {
- rc = 2;
- goto cleanup;
- }
+ InstallNewDevice = (PINSTALL_NEW_DEVICE)GetProcAddress(hNewDev,
(LPCSTR)"InstallNewDevice");
+ if (!InstallNewDevice)
+ {
+ rc = 2;
+ goto cleanup;
+ }
- ret = InstallNewDevice(hwnd, NULL, &Reboot);
- if (!ret)
- {
- rc = 3;
- goto cleanup;
- }
+ ret = InstallNewDevice(hwnd, NULL, &Reboot);
+ if (!ret)
+ {
+ rc = 3;
+ goto cleanup;
+ }
- if (Reboot != DI_NEEDRESTART && Reboot != DI_NEEDREBOOT)
- {
- /* We're done with installation */
- rc = 0;
- goto cleanup;
- }
+ if (Reboot != DI_NEEDRESTART && Reboot != DI_NEEDREBOOT)
+ {
+ /* We're done with installation */
+ rc = 0;
+ goto cleanup;
+ }
- /* We need to reboot */
- if (SetupPromptReboot(NULL, hwnd, FALSE) == -1)
- {
- /* User doesn't want to reboot, or an error occurred */
- rc = 5;
- goto cleanup;
- }
+ /* We need to reboot */
+ if (SetupPromptReboot(NULL, hwnd, FALSE) == -1)
+ {
+ /* User doesn't want to reboot, or an error occurred */
+ rc = 5;
+ goto cleanup;
+ }
- rc = 0;
+ rc = 0;
cleanup:
- if (hNewDev != NULL)
- FreeLibrary(hNewDev);
- return rc;
+ if (hNewDev != NULL)
+ FreeLibrary(hNewDev);
+ return rc;
}
+
/* Control Panel Callback */
LONG CALLBACK
CPlApplet(HWND hwndCpl,
- UINT uMsg,
- LPARAM lParam1,
- LPARAM lParam2)
+ UINT uMsg,
+ LPARAM lParam1,
+ LPARAM lParam2)
{
- int i = (int)lParam1;
+ INT i = (INT)lParam1;
- switch (uMsg)
- {
- case CPL_INIT:
- return TRUE;
+ switch (uMsg)
+ {
+ case CPL_INIT:
+ return TRUE;
- case CPL_GETCOUNT:
- return sizeof(Applets)/sizeof(Applets[0]);
+ case CPL_GETCOUNT:
+ return sizeof(Applets)/sizeof(Applets[0]);
- case CPL_INQUIRE:
- {
- CPLINFO *CPlInfo = (CPLINFO*)lParam2;
- CPlInfo->lData = 0;
- CPlInfo->idIcon = Applets[i].idIcon;
- CPlInfo->idName = Applets[i].idName;
- CPlInfo->idInfo = Applets[i].idDescription;
- break;
- }
+ case CPL_INQUIRE:
+ {
+ CPLINFO *CPlInfo = (CPLINFO*)lParam2;
+ CPlInfo->lData = 0;
+ CPlInfo->idIcon = Applets[i].idIcon;
+ CPlInfo->idName = Applets[i].idName;
+ CPlInfo->idInfo = Applets[i].idDescription;
+ }
+ break;
- case CPL_DBLCLK:
- {
- Applets[i].AppletProc(hwndCpl, uMsg, lParam1, lParam2);
- break;
- }
- }
- return FALSE;
+ case CPL_DBLCLK:
+ Applets[i].AppletProc(hwndCpl, uMsg, lParam1, lParam2);
+ break;
+ }
+
+ return FALSE;
}
+
BOOL WINAPI
DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
{
- UNREFERENCED_PARAMETER(lpvReserved);
- switch(dwReason)
- {
- case DLL_PROCESS_ATTACH:
- hApplet = hinstDLL;
- break;
- }
- return TRUE;
+ UNREFERENCED_PARAMETER(lpvReserved);
+
+ switch (dwReason)
+ {
+ case DLL_PROCESS_ATTACH:
+ hApplet = hinstDLL;
+ break;
+ }
+
+ return TRUE;
}
Modified: trunk/reactos/dll/cpl/liccpa/liccpa.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/liccpa/liccpa.c?re…
==============================================================================
--- trunk/reactos/dll/cpl/liccpa/liccpa.c (original)
+++ trunk/reactos/dll/cpl/liccpa/liccpa.c Sun Sep 16 17:38:26 2007
@@ -2,7 +2,7 @@
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS License Manager
- * FILE: lib/cpl/liccpa
+ * FILE: dll/cpl/liccpa/liccpa.c
* PURPOSE: License Manager GUI
*
* PROGRAMMERS: Steven Edwards (steven_ed4153(a)yahoo.com)
@@ -20,108 +20,97 @@
HINSTANCE hApplet = 0;
+
INT_PTR CALLBACK
-DlgMainProc(
- HWND hwndDlg,
- UINT uMsg,
- WPARAM wParam,
- LPARAM lParam
-)
+DlgMainProc(HWND hwndDlg,
+ UINT uMsg,
+ WPARAM wParam,
+ LPARAM lParam)
{
- TCHAR szString[256];
+ TCHAR szString[256];
- switch(uMsg)
- {
- case WM_INITDIALOG:
- break;
+ switch (uMsg)
+ {
+ case WM_INITDIALOG:
+ break;
- case WM_COMMAND:
- {
- switch(HIWORD(wParam))
- {
- case LBN_DBLCLK:
- {
- switch(LOWORD(wParam))
- {
- }
- break;
- }
- default:
- {
- switch(LOWORD(wParam))
- {
- case IDC_OK:
+ case WM_COMMAND:
+ switch (HIWORD(wParam))
{
- break;
+ case LBN_DBLCLK:
+ switch (LOWORD(wParam))
+ {
+ }
+ break;
+
+ default:
+ switch (LOWORD(wParam))
+ {
+ case IDC_OK:
+ break;
+
+ case IDC_CANCEL:
+ EndDialog(hwndDlg, IDC_CANCEL);
+ break;
+ }
+ break;
}
- case IDC_CANCEL:
- {
- EndDialog(hwndDlg, IDC_CANCEL);
- break;
- }
- }
- break;
- }
- }
- break;
+ break;
+
+ case WM_CLOSE:
+ EndDialog(hwndDlg, IDC_CANCEL);
+ return TRUE;
}
- case WM_CLOSE:
- {
- EndDialog(hwndDlg, IDC_CANCEL);
- return TRUE;
- }
- }
- return FALSE;
+
+ return FALSE;
}
+
LONG CALLBACK
-CPlApplet(
- HWND hwndCPl,
- UINT uMsg,
- LPARAM lParam1,
- LPARAM lParam2)
+CPlApplet(HWND hwndCPl,
+ UINT uMsg,
+ LPARAM lParam1,
+ LPARAM lParam2)
{
- switch(uMsg)
- {
- case CPL_INIT:
+ switch (uMsg)
{
- return TRUE;
+ case CPL_INIT:
+ return TRUE;
+
+ case CPL_GETCOUNT:
+ return 1;
+
+ case CPL_INQUIRE:
+ {
+ CPLINFO *CPlInfo = (CPLINFO*)lParam2;
+ CPlInfo->lData = 0;
+ CPlInfo->idIcon = IDC_CPLICON_1;
+ CPlInfo->idName = IDS_CPLNAME_1;
+ CPlInfo->idInfo = IDS_CPLDESCRIPTION_1;
+ }
+ break;
+
+ case CPL_DBLCLK:
+ DialogBox(hApplet, MAKEINTRESOURCE(IDD_PROPPAGE1), NULL, DlgMainProc);
+ break;
}
- case CPL_GETCOUNT:
- {
- return 1;
- }
- case CPL_INQUIRE:
- {
- CPLINFO *CPlInfo = (CPLINFO*)lParam2;
- CPlInfo->lData = 0;
- CPlInfo->idIcon = IDC_CPLICON_1;
- CPlInfo->idName = IDS_CPLNAME_1;
- CPlInfo->idInfo = IDS_CPLDESCRIPTION_1;
- break;
- }
- case CPL_DBLCLK:
- {
- DialogBoxParam(hApplet, MAKEINTRESOURCE(IDD_PROPPAGE1), hwndCPl, DlgMainProc,
WM_INITDIALOG);
- break;
- }
- }
- return FALSE;
+
+ return FALSE;
}
BOOL STDCALL
-DllMain(
- HINSTANCE hinstDLL,
- DWORD dwReason,
- LPVOID lpvReserved)
+DllMain(HINSTANCE hinstDLL,
+ DWORD dwReason,
+ LPVOID lpvReserved)
{
- switch(dwReason)
- {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- hApplet = hinstDLL;
- break;
- }
- return TRUE;
+ switch (dwReason)
+ {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ hApplet = hinstDLL;
+ break;
+ }
+
+ return TRUE;
}