- Style changes, typo fixes etc.

svn path=/branches/GSoC_2017/rapps/; revision=75560
This commit is contained in:
Alexander Shaposhnikov 2017-08-15 22:35:45 +00:00
parent 0a7403c03b
commit 9f9cf93785
18 changed files with 145 additions and 159 deletions

View file

@ -91,7 +91,7 @@ VOID CAvailableApplicationInfo::RetrieveLanguages()
// Parse parameter string
ATL::CStringW m_szLocale;
int iLCID;
INT iLCID;
for (INT i = 0; szBuffer[i] != UNICODE_NULL; ++i)
{
if (szBuffer[i] != cDelimiter && szBuffer[i] != L'\n')
@ -382,7 +382,7 @@ const PAPPLICATION_INFO CAvailableApps::FindInfo(const ATL::CStringW& szAppName)
ATL::CSimpleArray<PAPPLICATION_INFO> CAvailableApps::FindInfoList(const ATL::CSimpleArray<ATL::CStringW> &arrAppsNames)
{
ATL::CSimpleArray<PAPPLICATION_INFO> result;
for (int i = 0; i < arrAppsNames.GetSize(); ++i)
for (INT i = 0; i < arrAppsNames.GetSize(); ++i)
{
PAPPLICATION_INFO Info = FindInfo(arrAppsNames[i]);
if (Info)
@ -393,17 +393,17 @@ ATL::CSimpleArray<PAPPLICATION_INFO> CAvailableApps::FindInfoList(const ATL::CSi
return result;
}
const ATL::CStringW & CAvailableApps::GetFolderPath()
const ATL::CStringW& CAvailableApps::GetFolderPath()
{
return m_szPath;
}
const ATL::CStringW & CAvailableApps::GetAppPath()
const ATL::CStringW& CAvailableApps::GetAppPath()
{
return m_szAppsPath;
}
const ATL::CStringW & CAvailableApps::GetCabPath()
const ATL::CStringW& CAvailableApps::GetCabPath()
{
return m_szCabPath;
}

View file

@ -26,7 +26,7 @@
HWND hListView = NULL;
INT
GetSystemColorDepth(VOID)
GetSystemColorDepth()
{
DEVMODEW pDevMode;
INT ColorDepth;
@ -236,8 +236,7 @@ class CMainToolbar :
hImageList = ImageList_Create(TOOLBAR_HEIGHT,//GetSystemMetrics(SM_CXSMICON),
TOOLBAR_HEIGHT,//GetSystemMetrics(SM_CYSMICON),
ILC_MASK | GetSystemColorDepth(),
1,
1);
1, 1);
if (!hImageList)
{
/* TODO: Error message */
@ -354,7 +353,7 @@ class CAppsListView :
struct SortContext
{
CAppsListView * lvw;
int iSubItem;
INT iSubItem;
};
BOOL bHasAllChecked;
@ -845,7 +844,7 @@ private:
RECT r = {0, 0, LOWORD(lParam), HIWORD(lParam)};
HDWP hdwp = NULL;
int count = m_ClientPanel->CountSizableChildren();
INT count = m_ClientPanel->CountSizableChildren();
hdwp = BeginDeferWindowPos(count);
if (hdwp)

View file

@ -126,4 +126,4 @@ public:
const LPCWSTR GetFolderPathString();
const LPCWSTR GetAppPathString();
const LPCWSTR GetCabPathString();
};
};

View file

@ -41,7 +41,7 @@ public:
SendMessageW(EM_SETSEL, End, End + 1);
}
LONG GetTextLen(VOID)
LONG GetTextLen()
{
GETTEXTLENGTHEX TxtLenStruct;
@ -87,15 +87,15 @@ public:
LoadedLibrary = LoadLibraryW(L"riched20.dll");
m_hWnd = CreateWindowExW(0,
L"RichEdit20W",
NULL,
WS_CHILD | WS_VISIBLE | ES_MULTILINE |
ES_LEFT | ES_READONLY,
205, 28, 465, 100,
hwndParent,
NULL,
_AtlBaseModule.GetModuleInstance(),
NULL);
L"RichEdit20W",
NULL,
WS_CHILD | WS_VISIBLE | ES_MULTILINE |
ES_LEFT | ES_READONLY,
205, 28, 465, 100,
hwndParent,
NULL,
_AtlBaseModule.GetModuleInstance(),
NULL);
if (m_hWnd)
{

View file

@ -31,4 +31,4 @@
#define APPLICATION_DATABASE_URL L"https://svn.reactos.org/packages/rappmgr.cab"
#define MAX_STR_LEN 256
#define ENUM_ALL_COMPONENTS 30
#define ENUM_ALL_COMPONENTS 30

View file

@ -17,15 +17,15 @@ class CDownloadManager
public:
static INT_PTR CALLBACK DownloadDlgProc(HWND Dlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
static LRESULT CALLBACK DownloadProgressProc(HWND hWnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam,
UINT_PTR uIdSubclass,
static LRESULT CALLBACK DownloadProgressProc(HWND hWnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam,
UINT_PTR uIdSubclass,
DWORD_PTR dwRefData);
static DWORD WINAPI ThreadFunc(LPVOID Context);
static BOOL DownloadListOfApplications(const ATL::CSimpleArray<PAPPLICATION_INFO>& AppsList, BOOL modal = FALSE);
static BOOL DownloadListOfApplications(const ATL::CSimpleArray<PAPPLICATION_INFO>& AppsList, BOOL bIsModal = FALSE);
static BOOL DownloadApplication(PAPPLICATION_INFO pAppInfo, BOOL modal = FALSE);
static VOID DownloadApplicationsDB(LPCWSTR lpUrl);
static VOID LaunchDownloadDialog(BOOL);
@ -35,7 +35,7 @@ public:
VOID CreateSettingsDlg(HWND hwnd);
// About dialog (aboutdlg.cpp)
VOID ShowAboutDialog(VOID);
VOID ShowAboutDialog();
// Installation dialog (installdlg.cpp)
//BOOL InstallApplication(INT Index);
//BOOL InstallApplication(INT Index);

View file

@ -17,4 +17,4 @@ VOID NewRichEditText(const ATL::CStringW& szText, DWORD flags);
VOID InsertRichEditText(const ATL::CStringW& szText, DWORD flags);
CAvailableApps * GetAvailableApps();
extern HWND hListView;
extern ATL::CStringW szSearchPattern;
extern ATL::CStringW szSearchPattern;

View file

@ -9,14 +9,14 @@ INT GetClientWindowWidth(HWND hwnd);
INT GetClientWindowHeight(HWND hwnd);
VOID CopyTextToClipboard(LPCWSTR lpszText);
VOID SetWelcomeText(VOID);
VOID SetWelcomeText();
VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem);
BOOL StartProcess(ATL::CStringW &Path, BOOL Wait);
BOOL StartProcess(LPWSTR lpPath, BOOL Wait);
BOOL GetStorageDirectory(ATL::CStringW &lpDirectory);
BOOL ExtractFilesFromCab(LPCWSTR lpCabName, LPCWSTR lpOutputPath);
VOID InitLogs(VOID);
VOID FreeLogs(VOID);
VOID InitLogs();
VOID FreeLogs();
BOOL WriteLogMessage(WORD wType, DWORD dwEventID, LPCWSTR lpMsg);
BOOL GetInstalledVersion(ATL::CStringW *pszVersion, const ATL::CStringW &szRegName);
@ -42,4 +42,4 @@ public:
UINT GetString(const ATL::CStringW& KeyName, ATL::CStringW& ResultString);
UINT GetInt(const ATL::CStringW& KeyName);
};
};

View file

@ -6,7 +6,7 @@
#include <atlwin.h>
template<class T, int GrowthRate = 10>
template<class T, INT GrowthRate = 10>
class CPointerArray
{
protected:
@ -24,13 +24,13 @@ public:
}
private:
static int CALLBACK s_OnRemoveItem(void * ptr, void * context)
static INT CALLBACK s_OnRemoveItem(PVOID ptr, PVOID context)
{
CPointerArray * self = (CPointerArray*) context;
return (int) self->OnRemoveItem(reinterpret_cast<T*>(ptr));
return (INT) self->OnRemoveItem(reinterpret_cast<T*>(ptr));
}
static int CALLBACK s_OnCompareItems(void *p1, void *p2, LPARAM lParam)
static INT CALLBACK s_OnCompareItems(PVOID p1, PVOID p2, LPARAM lParam)
{
CPointerArray * self = (CPointerArray*) lParam;
return self->OnCompareItems(reinterpret_cast<T*>(p1), reinterpret_cast<T*>(p2));
@ -42,9 +42,9 @@ public:
return TRUE;
}
virtual int OnCompareItems(T * p1, T * p2)
virtual INT OnCompareItems(T * p1, T * p2)
{
int t = (reinterpret_cast<int>(p2) -reinterpret_cast<int>(p1));
INT t = (reinterpret_cast<INT>(p2) - reinterpret_cast<INT>(p1));
if (t > 0)
return 1;
if (t < 0)
@ -53,45 +53,45 @@ public:
}
public:
int GetCount() const
INT GetCount() const
{
return DPA_GetPtrCount(m_hDpa);
}
T* Get(int i) const
T* Get(INT i) const
{
return (T*) DPA_GetPtr(m_hDpa, i);
}
BOOL Set(int i, T* ptr)
BOOL Set(INT i, T* ptr)
{
return DPA_SetPtr(m_hDpa, i, ptr);
}
int Insert(int at, T* ptr)
INT Insert(INT at, T* ptr)
{
return DPA_InsertPtr(m_hDpa, at, ptr);
}
int Append(T* ptr)
INT Append(T* ptr)
{
return DPA_InsertPtr(m_hDpa, DA_LAST, ptr);
}
int IndexOf(T* ptr) const
INT IndexOf(T* ptr) const
{
return DPA_GetPtrIndex(m_hDpa, ptr);
}
BOOL Remove(T* ptr)
{
int i = IndexOf(ptr);
INT i = IndexOf(ptr);
if (i < 0)
return FALSE;
return RemoveAt(i);
}
BOOL RemoveAt(int i)
BOOL RemoveAt(INT i)
{
T* ptr = (T*) DPA_GetPtr(m_hDpa, i);
OnRemoveItem(ptr);
@ -109,7 +109,7 @@ public:
return DPA_Sort(m_hDpa, s_OnCompareItems, (LPARAM)this);
}
int Search(T* item, int iStart, UINT uFlags)
INT Search(T* item, INT iStart, UINT uFlags)
{
return DPA_Search(m_hDpa, s_OnCompareItems, (LPARAM)this);
}
@ -124,7 +124,7 @@ public:
left = right = top = bottom = 0;
}
CUiRect(int l, int t, int r, int b)
CUiRect(INT l, INT t, INT r, INT b)
{
left = l;
right = r;
@ -141,12 +141,12 @@ public:
{
}
CUiMargin(int all)
CUiMargin(INT all)
: CUiRect(all, all, all, all)
{
}
CUiMargin(int horz, int vert)
CUiMargin(INT horz, INT vert)
: CUiRect(horz, vert, horz, vert)
{
}
@ -165,7 +165,7 @@ public:
private:
MeasureType m_Type;
int m_Value;
INT m_Value;
public:
CUiMeasure()
@ -174,13 +174,13 @@ public:
m_Value = 0;
}
CUiMeasure(MeasureType type, int value)
CUiMeasure(MeasureType type, INT value)
{
m_Type = type;
m_Value = value;
}
int ComputeMeasure(int parent, int content)
INT ComputeMeasure(INT parent, INT content)
{
switch (m_Type)
{
@ -208,12 +208,12 @@ public:
return CUiMeasure(Type_FitParent, 0);
}
static CUiMeasure Fixed(int pixels)
static CUiMeasure Fixed(INT pixels)
{
return CUiMeasure(Type_Fixed, pixels);
}
static CUiMeasure Percent(int percent)
static CUiMeasure Percent(INT percent)
{
return CUiMeasure(Type_Percent, percent);
}
@ -242,7 +242,7 @@ protected:
m_VerticalAlignment = UiAlign_LeftTop;
}
virtual void ComputeRect(RECT parentRect, RECT currentRect, RECT* newRect)
virtual VOID ComputeRect(RECT parentRect, RECT currentRect, RECT* newRect)
{
parentRect.left += m_Margin.left;
parentRect.right -= m_Margin.right;
@ -255,8 +255,8 @@ protected:
if (parentRect.bottom < parentRect.top)
parentRect.bottom = parentRect.top;
SIZE szParent = { parentRect.right - parentRect.left, parentRect.bottom - parentRect.top };
SIZE szCurrent = { currentRect.right - currentRect.left, currentRect.bottom - currentRect.top };
SIZE szParent = {parentRect.right - parentRect.left, parentRect.bottom - parentRect.top};
SIZE szCurrent = {currentRect.right - currentRect.left, currentRect.bottom - currentRect.top};
currentRect = parentRect;
@ -297,14 +297,14 @@ protected:
public:
virtual void ComputeMinimalSize(SIZE* size)
virtual VOID ComputeMinimalSize(SIZE* size)
{
// Override in subclass
size->cx = max(size->cx, 0);
size->cy = min(size->cy, 0);
};
virtual void ComputeContentBounds(RECT* rect)
virtual VOID ComputeContentBounds(RECT* rect)
{
// Override in subclass
};
@ -373,9 +373,9 @@ public:
virtual CUiBox * AsBox() { return this; }
virtual void ComputeMinimalSize(SIZE* size)
virtual VOID ComputeMinimalSize(SIZE* size)
{
for (int i = 0; i < m_Children.GetCount(); i++)
for (INT i = 0; i < m_Children.GetCount(); i++)
{
CUiBox * box = m_Children.Get(i)->AsBox();
if (box)
@ -385,9 +385,9 @@ public:
}
};
virtual void ComputeContentBounds(RECT* rect)
virtual VOID ComputeContentBounds(RECT* rect)
{
for (int i = 0; i < m_Children.GetCount(); i++)
for (INT i = 0; i < m_Children.GetCount(); i++)
{
CUiBox * box = m_Children.Get(i)->AsBox();
if (box)
@ -399,8 +399,8 @@ public:
virtual DWORD_PTR CountSizableChildren()
{
int count = 0;
for (int i = 0; i < m_Children.GetCount(); i++)
INT count = 0;
for (INT i = 0; i < m_Children.GetCount(); i++)
{
CUiBox * box = m_Children.Get(i)->AsBox();
if (box)
@ -413,20 +413,20 @@ public:
virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp)
{
RECT rect = { 0 };
RECT rect = {0};
SIZE content = { 0 };
SIZE content = {0};
ComputeMinimalSize(&content);
int preferredWidth = m_Width.ComputeMeasure(parentRect.right - parentRect.left, content.cx);
int preferredHeight = m_Height.ComputeMeasure(parentRect.bottom - parentRect.top, content.cy);
INT preferredWidth = m_Width.ComputeMeasure(parentRect.right - parentRect.left, content.cx);
INT preferredHeight = m_Height.ComputeMeasure(parentRect.bottom - parentRect.top, content.cy);
rect.right = preferredWidth;
rect.bottom = preferredHeight;
ComputeRect(parentRect, rect, &rect);
for (int i = 0; i < m_Children.GetCount(); i++)
for (INT i = 0; i < m_Children.GetCount(); i++)
{
CUiBox * box = m_Children.Get(i)->AsBox();
if (box)
@ -450,13 +450,13 @@ public:
HWND GetWindow() { return T::m_hWnd; }
virtual void ComputeMinimalSize(SIZE* size)
virtual VOID ComputeMinimalSize(SIZE* size)
{
// TODO: Maybe use WM_GETMINMAXINFO?
return CUiBox::ComputeMinimalSize(size);
};
virtual void ComputeContentBounds(RECT* rect)
virtual VOID ComputeContentBounds(RECT* rect)
{
RECT r;
::GetWindowRect(T::m_hWnd, &r);
@ -495,7 +495,7 @@ public:
T::DestroyWindow();
}
void GetWindowTextW(ATL::CStringW& szText)
VOID GetWindowTextW(ATL::CStringW& szText)
{
INT length = CWindow::GetWindowTextLengthW() + 1;
CWindow::GetWindowTextW(szText.GetBuffer(length), length);
@ -508,7 +508,7 @@ class CUiSplitPanel :
public CUiBox,
public CWindowImpl<CUiSplitPanel>
{
static const int THICKNESS = 4;
static const INT THICKNESS = 4;
protected:
@ -522,11 +522,11 @@ protected:
BOOL m_HasOldRect;
public:
int m_Pos;
INT m_Pos;
BOOL m_Horizontal;
BOOL m_DynamicFirst;
int m_MinFirst;
int m_MinSecond;
INT m_MinFirst;
INT m_MinSecond;
CUiMeasure m_Width;
CUiMeasure m_Height;
@ -551,7 +551,7 @@ public:
CUiCollection& First() { return m_First.Children(); }
CUiCollection& Second() { return m_Second.Children(); }
virtual void ComputeMinimalSize(SIZE* size)
virtual VOID ComputeMinimalSize(SIZE* size)
{
if (m_Horizontal)
size->cx = max(size->cx, THICKNESS);
@ -561,7 +561,7 @@ public:
m_Second.ComputeMinimalSize(size);
};
virtual void ComputeContentBounds(RECT* rect)
virtual VOID ComputeContentBounds(RECT* rect)
{
RECT r;
@ -578,7 +578,7 @@ public:
virtual DWORD_PTR CountSizableChildren()
{
int count = 1;
INT count = 1;
count += m_First.CountSizableChildren();
count += m_Second.CountSizableChildren();
return count;
@ -586,20 +586,20 @@ public:
virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp)
{
RECT rect = { 0 };
RECT rect = {0};
SIZE content = { 0 };
SIZE content = {0};
ComputeMinimalSize(&content);
int preferredWidth = m_Width.ComputeMeasure(parentRect.right - parentRect.left, content.cx);
int preferredHeight = m_Width.ComputeMeasure(parentRect.bottom - parentRect.top, content.cy);
INT preferredWidth = m_Width.ComputeMeasure(parentRect.right - parentRect.left, content.cx);
INT preferredHeight = m_Width.ComputeMeasure(parentRect.bottom - parentRect.top, content.cy);
rect.right = preferredWidth;
rect.bottom = preferredHeight;
ComputeRect(parentRect, rect, &rect);
SIZE growth = { 0 };
SIZE growth = {0};
if (m_HasOldRect)
{
RECT oldRect = m_LastRect;
@ -620,7 +620,7 @@ public:
{
if (growth.cy > 0)
{
m_Pos += min(growth.cy, rect.bottom - (m_Pos+THICKNESS));
m_Pos += min(growth.cy, rect.bottom - (m_Pos + THICKNESS));
}
else if (growth.cy < 0)
{
@ -669,25 +669,25 @@ public:
m_LastRect = parentRect;
m_HasOldRect = TRUE;
hDwp = m_First.OnParentSize(first, hDwp);
hDwp = m_Second.OnParentSize(second, hDwp);
if (hDwp)
{
return DeferWindowPos(hDwp, NULL,
splitter.left, splitter.top,
splitter.right - splitter.left,
splitter.bottom - splitter.top,
SWP_NOACTIVATE | SWP_NOZORDER);
splitter.left, splitter.top,
splitter.right - splitter.left,
splitter.bottom - splitter.top,
SWP_NOACTIVATE | SWP_NOZORDER);
}
else
{
SetWindowPos(NULL,
splitter.left, splitter.top,
splitter.right - splitter.left,
splitter.bottom - splitter.top,
SWP_NOACTIVATE | SWP_NOZORDER);
splitter.left, splitter.top,
splitter.right - splitter.left,
splitter.bottom - splitter.top,
SWP_NOACTIVATE | SWP_NOZORDER);
return NULL;
}
};
@ -736,12 +736,12 @@ private:
}
public:
int GetPos(VOID)
INT GetPos()
{
return m_Pos;
}
void SetPos(int NewPos)
VOID SetPos(INT NewPos)
{
RECT rcParent;
@ -772,7 +772,7 @@ public:
m_Pos = rcParent.right;
}
int count = CountSizableChildren();
INT count = CountSizableChildren();
HDWP hdwp = NULL;
hdwp = BeginDeferWindowPos(count);
@ -794,7 +794,7 @@ public:
DWORD style = WS_CHILD | WS_VISIBLE;
DWORD exStyle = WS_EX_TRANSPARENT;
RECT size = { 205, 180, 465, THICKNESS };
RECT size = {205, 180, 465, THICKNESS};
size.right += size.left;
size.bottom += size.top;

View file

@ -5,4 +5,4 @@
#define CMD_KEY_SETUP L"/SETUP"
// return TRUE if the SETUP key was valid
BOOL CmdParser(LPWSTR lpCmdLine);
BOOL CmdParser(LPWSTR lpCmdLine);

View file

@ -32,4 +32,4 @@ VOID SaveSettings(HWND hwnd);
VOID FillDefaultSettings(PSETTINGS_INFO pSettingsInfo);
// integrity.cpp
BOOL VerifyInteg(LPCWSTR lpSHA1Hash, LPCWSTR lpFileName);
BOOL VerifyInteg(LPCWSTR lpSHA1Hash, LPCWSTR lpFileName);

View file

@ -18,22 +18,22 @@ InstallDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
switch (Msg)
{
case WM_INITDIALOG:
{
}
break;
case WM_INITDIALOG:
{
}
break;
case WM_COMMAND:
case WM_COMMAND:
{
switch (LOWORD(wParam))
{
switch (LOWORD(wParam))
{
case IDOK:
case IDCANCEL:
EndDialog(hDlg, LOWORD(wParam));
break;
}
case IDOK:
case IDCANCEL:
EndDialog(hDlg, LOWORD(wParam));
break;
}
break;
}
break;
}
return FALSE;
@ -49,9 +49,9 @@ InstallApplication(INT Index)
if (!AppInfo) return FALSE;
DialogBoxW(hInst,
MAKEINTRESOURCEW(IDD_INSTALL_DIALOG),
hMainWnd,
InstallDlgProc);
MAKEINTRESOURCEW(IDD_INSTALL_DIALOG),
hMainWnd,
InstallDlgProc);
return TRUE;
}

View file

@ -158,9 +158,9 @@ RemoveAppFromRegistry(INT Index)
if (MessageBoxW(hMainWnd, szMsgText, szMsgTitle, MB_YESNO | MB_ICONQUESTION) == IDYES)
{
ATL::CStringW::CopyChars(szFullName,
MAX_PATH,
Info->szKeyName.GetString(),
ATL::CStringW::CopyChars(szFullName,
MAX_PATH,
Info->szKeyName.GetString(),
MAX_PATH - wcslen(szFullName));
if (RegDeleteKeyW(Info->hRootKey, szFullName) == ERROR_SUCCESS)

View file

@ -53,7 +53,7 @@ BOOL VerifyInteg(LPCWSTR lpSHA1Hash, LPCWSTR lpFileName)
WCHAR buf[(sizeof(sha) * 2) + 1];
for (UINT i = 0; i < sizeof(sha); i++)
swprintf(buf + 2 * i, L"%02x", ((unsigned char *)sha)[i]);
swprintf(buf + 2 * i, L"%02x", ((unsigned char *) sha)[i]);
/* does the resulting SHA1 match with the provided one? */
if (!_wcsicmp(buf, lpSHA1Hash))
ret = TRUE;

View file

@ -46,8 +46,8 @@
#include "misc.h"
#ifdef USE_CERT_PINNING
#define CERT_ISSUER_INFO "BE\r\nGlobalSign nv-sa\r\nGlobalSign Domain Validation CA - SHA256 - G2"
#define CERT_SUBJECT_INFO "Domain Control Validated\r\n*.reactos.org"
#define CERT_ISSUER_INFO "BE\r\nGlobalSign nv-sa\r\nGlobalSign Domain Validation CA - SHA256 - G2"
#define CERT_SUBJECT_INFO "Domain Control Validated\r\n*.reactos.org"
#endif
typedef enum
@ -768,7 +768,7 @@ run:
DownloadsListView.SetDownloadStatus(iAppId, DOWNLOAD_STATUS::DLInstalling);
//TODO: issue an install operation separately so that the apps could be downloaded in the background
WaitForSingleObject(shExInfo.hProcess, INFINITE);
CloseHandle(shExInfo.hProcess);
CloseHandle(shExInfo.hProcess);
}
else
{

View file

@ -20,8 +20,8 @@ static HANDLE hLog = NULL;
struct ERF
{
int erfOper;
int erfType;
INT erfOper;
INT erfType;
BOOL fError;
};
@ -160,7 +160,7 @@ VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem)
}
BOOL StartProcess(ATL::CStringW &Path, BOOL Wait)
{
{
return StartProcess(const_cast<LPWSTR>(Path.GetString()), Wait);;
}
@ -498,7 +498,7 @@ UINT CConfigParser::GetInt(const ATL::CStringW& KeyName)
return FALSE;
// convert it to an actual integer
int result = StrToIntW(Buffer.GetString());
INT result = StrToIntW(Buffer.GetString());
return (UINT) (result <= 0) ? 0 : result;
}

View file

@ -17,14 +17,12 @@ BOOL CmdParser(LPWSTR lpCmdLine)
}
// Setup key - single app expected
// TODO: add multiple apps
// TODO: use DB filenames as names because they're shorter
// app setup
ATL::CSimpleArray<ATL::CStringW> arrNames;
if (!StrCmpW(argv[0], CMD_KEY_INSTALL))
{
for (int i = 1; i < argc; ++i)
for (INT i = 1; i < argc; ++i)
{
arrNames.Add(argv[i]);
}
@ -32,7 +30,6 @@ BOOL CmdParser(LPWSTR lpCmdLine)
else
if (!StrCmpW(argv[0], CMD_KEY_SETUP))
{
//TODO: inf file loading
HINF InfHandle = SetupOpenInfFileW(argv[1], NULL, INF_STYLE_WIN4, NULL);
if (InfHandle == INVALID_HANDLE_VALUE)
{
@ -40,24 +37,23 @@ BOOL CmdParser(LPWSTR lpCmdLine)
}
INFCONTEXT Context;
if (!SetupFindFirstLineW(InfHandle, L"RAPPS", L"Install", &Context))
if (SetupFindFirstLineW(InfHandle, L"RAPPS", L"Install", &Context))
{
return FALSE;
}
WCHAR szName[MAX_PATH];
do
{
if (SetupGetStringFieldW(&Context, 1, szName, MAX_PATH, NULL))
WCHAR szName[MAX_PATH];
do
{
arrNames.Add(szName);
}
}
while (SetupFindNextLine(&Context, &Context));
if (SetupGetStringFieldW(&Context, 1, szName, MAX_PATH, NULL))
{
arrNames.Add(szName);
}
} while (SetupFindNextLine(&Context, &Context));
}
SetupCloseInfFile(InfHandle);
}
else
{
return FALSE;
}
CAvailableApps apps;
apps.EnumAvailableApplications(ENUM_ALL_AVAILABLE, NULL);
@ -70,4 +66,3 @@ BOOL CmdParser(LPWSTR lpCmdLine)
return FALSE;
}

View file

@ -31,11 +31,6 @@ END_OBJECT_MAP()
CRAppsModule gModule;
CAtlWinModule gWinModule;
//void *operator new (size_t, void *buf)
//{
// return buf;
//}
static VOID InitializeAtlModule(HINSTANCE hInstance, BOOL bInitialize)
{
if (bInitialize)
@ -51,6 +46,7 @@ static VOID InitializeAtlModule(HINSTANCE hInstance, BOOL bInitialize)
VOID FillDefaultSettings(PSETTINGS_INFO pSettingsInfo)
{
ATL::CStringW szDownloadDir;
ZeroMemory(pSettingsInfo, sizeof(SETTINGS_INFO));
pSettingsInfo->bSaveWndPos = TRUE;
pSettingsInfo->bUpdateAtStart = FALSE;
@ -81,10 +77,6 @@ VOID FillDefaultSettings(PSETTINGS_INFO pSettingsInfo)
pSettingsInfo->Top = CW_USEDEFAULT;
pSettingsInfo->Width = 680;
pSettingsInfo->Height = 450;
pSettingsInfo->Proxy = 0;
pSettingsInfo->szProxyServer[0] = UNICODE_NULL;
pSettingsInfo->szNoProxyFor[0] = UNICODE_NULL;
}
static BOOL LoadSettings()
@ -130,7 +122,7 @@ VOID SaveSettings(HWND hwnd)
}
}
INT WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nShowCmd)
INT WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, INT nShowCmd)
{
LPCWSTR szWindowClass = L"ROSAPPMGR";
HANDLE hMutex;