ReactOS 0.4.16-dev-250-g3ecd236
systempage.c File Reference
#include "precomp.h"
Include dependency graph for systempage.c:

Go to the source code of this file.

Macros

#define BUFFER_SIZE   512
 

Functions

static BOOL LoadSystemIni (WCHAR *szPath, HWND hDlg)
 
static BOOL InitializeSystemDialog (HWND hDlg)
 
INT_PTR CALLBACK SystemPageWndProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 

Variables

HWND hSystemPage
 
HWND hSystemDialog
 

Macro Definition Documentation

◆ BUFFER_SIZE

#define BUFFER_SIZE   512

Definition at line 15 of file systempage.c.

Function Documentation

◆ InitializeSystemDialog()

static BOOL InitializeSystemDialog ( HWND  hDlg)
static

Definition at line 77 of file systempage.c.

78{
79 WCHAR winDir[PATH_MAX];
80
82 return LoadSystemIni(winDir, hDlg);
83}
#define PATH_MAX
Definition: types.h:280
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2352
static BOOL LoadSystemIni(WCHAR *szPath, HWND hDlg)
Definition: systempage.c:18
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by SystemPageWndProc().

◆ LoadSystemIni()

static BOOL LoadSystemIni ( WCHAR szPath,
HWND  hDlg 
)
static

Definition at line 18 of file systempage.c.

19{
20 WCHAR szBuffer[BUFFER_SIZE];
21 HWND hDlgCtrl;
23 FILE* file;
26 HRESULT hr;
27
28 hr = StringCbCopyW(szBuffer, sizeof(szBuffer), szPath);
29 if (FAILED(hr))
30 return FALSE;
31
32 hr = StringCbCatW(szBuffer, sizeof(szBuffer), L"\\system.ini");
33 if (FAILED(hr))
34 return FALSE;
35
36 file = _wfopen(szBuffer, L"rt");
37 if (!file)
38 return FALSE;
39
40 hDlgCtrl = GetDlgItem(hDlg, IDC_SYSTEM_TREE);
41
42 while(!feof(file))
43 {
44 if (fgetws(szBuffer, BUFFER_SIZE, file))
45 {
46 length = wcslen(szBuffer);
47 if (length > 1)
48 {
49 szBuffer[length] = L'\0';
50 szBuffer[length - 1] = L'\0';
51 insert.hInsertAfter = TVI_LAST;
52 insert.item.mask = TVIF_TEXT;
53 insert.item.pszText = szBuffer;
54
55 if (szBuffer[0] == L';' || szBuffer[0] == L'[')
56 {
57 /* Parent */
58 insert.hParent = NULL;
59 parent = TreeView_InsertItem(hDlgCtrl, &insert);
60 }
61 else
62 {
63 /* Child */
64 insert.hParent = parent;
65 TreeView_InsertItem(hDlgCtrl, &insert);
66 }
67 }
68 }
69 }
70
71 fclose(file);
72
73 return TRUE;
74}
#define IDC_SYSTEM_TREE
Definition: resource.h:68
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
r parent
Definition: btrfs.c:3010
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
_Check_return_ _CRTIMP int __cdecl feof(_In_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl _wfopen(_In_z_ const wchar_t *_Filename, _In_z_ const wchar_t *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define FAILED(hr)
Definition: intsafe.h:51
LPCWSTR szPath
Definition: env.c:37
#define BUFFER_SIZE
Definition: systempage.c:15
unsigned int UINT
Definition: ndis.h:50
#define L(x)
Definition: ntvdm.h:50
#define TVI_LAST
Definition: commctrl.h:3375
#define TVIF_TEXT
Definition: commctrl.h:3271
#define TVINSERTSTRUCT
Definition: commctrl.h:3407
#define TreeView_InsertItem(hwnd, lpis)
Definition: commctrl.h:3417
HRESULT hr
Definition: shlfolder.c:183
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
STRSAFEAPI StringCbCatW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:342
Definition: fci.c:127
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
wchar_t * fgetws(wchar_t *buf, int bufsize, FILE *file)
Definition: wmain.c:22
static int insert
Definition: xmllint.c:138

Referenced by InitializeSystemDialog().

◆ SystemPageWndProc()

INT_PTR CALLBACK SystemPageWndProc ( HWND  hDlg,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 87 of file systempage.c.

88{
91 switch (message) {
92 case WM_INITDIALOG:
93 {
94 hSystemDialog = hDlg;
97 return TRUE;
98 }
99 }
100
101 return 0;
102}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static BOOL InitializeSystemDialog(HWND hDlg)
Definition: systempage.c:77
HWND hSystemDialog
Definition: systempage.c:13
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:325
Definition: tftpd.h:60
#define SWP_NOACTIVATE
Definition: winuser.h:1245
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOSIZE
Definition: winuser.h:1248
#define WM_INITDIALOG
Definition: winuser.h:1742
#define SWP_NOOWNERZORDER
Definition: winuser.h:1252
#define SWP_NOZORDER
Definition: winuser.h:1250

Variable Documentation

◆ hSystemDialog

HWND hSystemDialog

Definition at line 13 of file systempage.c.

Referenced by SystemPageWndProc().

◆ hSystemPage

HWND hSystemPage

Definition at line 12 of file systempage.c.

Referenced by MsConfig_OnTabWndSelChange(), MsConfigWndProc(), and OnCreate().