ReactOS  0.4.13-dev-241-g63286c6
desk.h File Reference
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#include <wingdi.h>
#include <winuser.h>
#include <wincon.h>
#include <commdlg.h>
#include <cpl.h>
#include <tchar.h>
#include <setupapi.h>
#include <shlobj.h>
#include <regstr.h>
#include <dll/desk/deskcplx.h>
#include <strsafe.h>
#include <gdiplus.h>
#include "appearance.h"
#include "preview.h"
#include "draw.h"
#include "monslctl.h"
#include "resource.h"
Include dependency graph for desk.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _APPLET
 
struct  _DIBITMAP
 
struct  _RESOLUTION_INFO
 
struct  _SETTINGS_ENTRY
 
struct  _DISPLAY_DEVICE_ENTRY
 
struct  _GLOBAL_DATA
 

Macros

#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COM_NO_WINDOWS_H
 
#define COBJMACROS
 
#define MAX_DESK_PAGES   32
 
#define NUM_SPECTRUM_BITMAPS   3
 

Typedefs

typedef struct _APPLET APPLET
 
typedef struct _APPLETPAPPLET
 
typedef struct _DIBITMAP DIBITMAP
 
typedef struct _DIBITMAPPDIBITMAP
 
typedef struct _RESOLUTION_INFO RESOLUTION_INFO
 
typedef struct _RESOLUTION_INFOPRESOLUTION_INFO
 
typedef struct _SETTINGS_ENTRY SETTINGS_ENTRY
 
typedef struct _SETTINGS_ENTRYPSETTINGS_ENTRY
 
typedef struct _DISPLAY_DEVICE_ENTRY DISPLAY_DEVICE_ENTRY
 
typedef struct _DISPLAY_DEVICE_ENTRYPDISPLAY_DEVICE_ENTRY
 
typedef struct _GLOBAL_DATA GLOBAL_DATA
 
typedef struct _GLOBAL_DATAPGLOBAL_DATA
 

Functions

HMENU LoadPopupMenu (IN HINSTANCE hInstance, IN LPCTSTR lpMenuName)
 
PDIBITMAP DibLoadImage (LPTSTR lpFilename)
 
VOID DibFreeImage (PDIBITMAP lpBitmap)
 
INT AllocAndLoadString (LPTSTR *lpTarget, HINSTANCE hInst, UINT uID)
 
ULONG __cdecl DbgPrint (PCCH Format,...)
 
BOOL DisplayAdvancedSettings (HWND hWndParent, PDISPLAY_DEVICE_ENTRY DisplayDevice)
 
IDataObjectCreateDevSettings (PDISPLAY_DEVICE_ENTRY DisplayDeviceInfo)
 
HPSXA WINAPI SHCreatePropSheetExtArrayEx (HKEY, LPCWSTR, UINT, IDataObject *)
 
INT_PTR CALLBACK AdvGeneralPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
LONG RegLoadMUIStringW (IN HKEY hKey, IN LPCWSTR pszValue OPTIONAL, OUT LPWSTR pszOutBuf, IN DWORD cbOutBuf, OUT LPDWORD pcbData OPTIONAL, IN DWORD Flags, IN LPCWSTR pszDirectory OPTIONAL)
 

Variables

HINSTANCE hApplet
 
GLOBAL_DATA g_GlobalData
 
HWND hCPLWindow
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 7 of file desk.h.

◆ COBJMACROS

#define COBJMACROS

Definition at line 10 of file desk.h.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 8 of file desk.h.

◆ MAX_DESK_PAGES

#define MAX_DESK_PAGES   32

Definition at line 66 of file desk.h.

◆ NUM_SPECTRUM_BITMAPS

#define NUM_SPECTRUM_BITMAPS   3

Definition at line 67 of file desk.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 6 of file desk.h.

Typedef Documentation

◆ APPLET

◆ DIBITMAP

◆ DISPLAY_DEVICE_ENTRY

◆ GLOBAL_DATA

◆ PAPPLET

typedef struct _APPLET * PAPPLET

◆ PDIBITMAP

◆ PDISPLAY_DEVICE_ENTRY

◆ PGLOBAL_DATA

◆ PRESOLUTION_INFO

◆ PSETTINGS_ENTRY

◆ RESOLUTION_INFO

◆ SETTINGS_ENTRY

Function Documentation

◆ AdvGeneralPageProc()

INT_PTR CALLBACK AdvGeneralPageProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 115 of file general.c.

119 {
120  PDISPLAY_DEVICE_ENTRY DispDevice = NULL;
121  INT_PTR Ret = 0;
122 
123  if (uMsg != WM_INITDIALOG)
124  DispDevice = (PDISPLAY_DEVICE_ENTRY)GetWindowLongPtr(hwndDlg, DWLP_USER);
125 
126  switch (uMsg)
127  {
128  case WM_INITDIALOG:
130  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)DispDevice);
131 
132  InitFontSizeList(hwndDlg);
133  InitRadioButtons(hwndDlg);
134 
135  Ret = TRUE;
136  break;
137  case WM_COMMAND:
138  switch (LOWORD(wParam))
139  {
140  case IDC_FONTSIZE_COMBO:
141  if (HIWORD(wParam) == CBN_SELCHANGE)
142  {
143  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
144  }
145  break;
146  case IDC_RESTART_RB:
148  case IDC_ASKME_RB:
149  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
150  break;
151  }
152  break;
153  }
154 
155  return Ret;
156 }
#define TRUE
Definition: types.h:120
Definition: precomp.h:67
int32_t INT_PTR
Definition: typedefs.h:62
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define IDC_FONTSIZE_COMBO
Definition: resource.h:172
static VOID InitFontSizeList(HWND hWnd)
Definition: general.c:11
#define LPPROPSHEETPAGE
Definition: prsht.h:372
smooth NULL
Definition: ftsmooth.c:416
#define IDC_RESTART_RB
Definition: resource.h:174
#define IDC_WITHOUTREBOOT_RB
Definition: resource.h:175
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
struct _DISPLAY_DEVICE_ENTRY * PDISPLAY_DEVICE_ENTRY
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1716
HWND WINAPI GetParent(_In_ HWND)
static VOID InitRadioButtons(HWND hWnd)
Definition: general.c:78
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define CBN_SELCHANGE
Definition: winuser.h:1940
#define HIWORD(l)
Definition: typedefs.h:246
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDC_ASKME_RB
Definition: resource.h:176
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

Referenced by DisplayAdvancedSettings().

◆ AllocAndLoadString()

INT AllocAndLoadString ( LPTSTR lpTarget,
HINSTANCE  hInst,
UINT  uID 
)

◆ CreateDevSettings()

IDataObject* CreateDevSettings ( PDISPLAY_DEVICE_ENTRY  DisplayDeviceInfo)

Definition at line 887 of file devsett.c.

888 {
890 
892  0,
893  sizeof(*This));
894  if (This != NULL)
895  {
896  This->lpIDataObjectVtbl = &vtblIDataObject;
897  This->ref = 1;
898 
900  DisplayDeviceInfo)))
901  {
903  }
904 
906  }
907 
908  return NULL;
909 }
static const struct IDataObjectVtbl vtblIDataObject
Definition: devsett.c:871
smooth NULL
Definition: ftsmooth.c:416
#define impl_to_interface(impl, iface)
Definition: devsett.c:55
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static ULONG STDMETHODCALLTYPE CDevSettings_Release(IDataObject *iface)
Definition: devsett.c:538
static HRESULT pCDevSettings_Initialize(PCDevSettings This, PDISPLAY_DEVICE_ENTRY DisplayDeviceInfo)
Definition: devsett.c:424
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by DisplayAdvancedSettings().

◆ DbgPrint()

ULONG __cdecl DbgPrint ( PCCH  Format,
  ... 
)

Definition at line 420 of file debug.c.

421 {
422  return 0;
423 }

◆ DibFreeImage()

VOID DibFreeImage ( PDIBITMAP  lpBitmap)

Definition at line 90 of file dibitmap.c.

91 {
92  if (lpBitmap == NULL)
93  return;
94 
95  /* Free the image data */
96  if (lpBitmap->bits != NULL)
97  HeapFree(GetProcessHeap(), 0, lpBitmap->bits);
98 
99  /* Free the bitmap info */
100  if (lpBitmap->info != NULL)
101  HeapFree(GetProcessHeap(), 0, lpBitmap->info);
102 
103  /* Free the bitmap structure */
104  if (lpBitmap != NULL)
105  HeapFree(GetProcessHeap(), 0, lpBitmap);
106 }
BYTE * bits
Definition: desk.h:46
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
BITMAPINFO * info
Definition: desk.h:45
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by BackgroundPageProc(), and ListViewItemChanged().

◆ DibLoadImage()

PDIBITMAP DibLoadImage ( LPTSTR  lpFilename)

Definition at line 13 of file dibitmap.c.

14 {
15  PDIBITMAP lpBitmap;
18 
19  if (GdipCreateBitmapFromFile(lpFilename, &bitmap) != Ok)
20  {
21  return NULL;
22  }
23 
24  lpBitmap = HeapAlloc(GetProcessHeap(), 0, sizeof(DIBITMAP));
25  if (lpBitmap == NULL)
26  {
28  return NULL;
29  }
30 
31  lpBitmap->info = HeapAlloc(GetProcessHeap(), 0, sizeof(BITMAPINFO));
32  if (lpBitmap->info == NULL)
33  {
34  HeapFree(GetProcessHeap(), 0, lpBitmap);
36  return NULL;
37  }
38 
39  if (GdipGetImageWidth((GpImage*)bitmap, &lpBitmap->width) != Ok ||
40  GdipGetImageHeight((GpImage*)bitmap, &lpBitmap->height) != Ok)
41  {
42  HeapFree(GetProcessHeap(), 0, lpBitmap->info);
43  HeapFree(GetProcessHeap(), 0, lpBitmap);
45  return NULL;
46  }
47 
48  lpBitmap->bits = HeapAlloc(GetProcessHeap(), 0, lpBitmap->width * lpBitmap->height * 4);
49  if (!lpBitmap->bits)
50  {
51  HeapFree(GetProcessHeap(), 0, lpBitmap->info);
52  HeapFree(GetProcessHeap(), 0, lpBitmap);
54  return NULL;
55  }
56 
57  ZeroMemory(lpBitmap->info, sizeof(BITMAPINFO));
58  lpBitmap->info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
59  lpBitmap->info->bmiHeader.biWidth = lpBitmap->width;
60  lpBitmap->info->bmiHeader.biHeight = -(INT)lpBitmap->height;
61  lpBitmap->info->bmiHeader.biPlanes = 1;
62  lpBitmap->info->bmiHeader.biBitCount = 32;
63  lpBitmap->info->bmiHeader.biCompression = BI_RGB;
64  lpBitmap->info->bmiHeader.biSizeImage = lpBitmap->width * lpBitmap->height * 4;
65 
66  lock.Width = lpBitmap->width;
67  lock.Height = lpBitmap->height;
68  lock.Stride = lpBitmap->width * 4;
69  lock.PixelFormat = PixelFormat32bppPARGB;
70  lock.Scan0 = lpBitmap->bits;
71  lock.Reserved = 0;
72 
74  {
75  HeapFree(GetProcessHeap(), 0, lpBitmap->bits);
76  HeapFree(GetProcessHeap(), 0, lpBitmap->info);
77  HeapFree(GetProcessHeap(), 0, lpBitmap);
79  return NULL;
80  }
81 
84 
85  return lpBitmap;
86 }
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1454
rwlock_t lock
Definition: tcpcore.h:1163
UINT height
Definition: desk.h:48
GpStatus WINGDIPAPI GdipGetImageWidth(GpImage *image, UINT *width)
Definition: image.c:2342
struct tagBITMAPINFOHEADER BITMAPINFOHEADER
#define INT
Definition: polytest.cpp:20
#define ZeroMemory
Definition: winbase.h:1635
BYTE * bits
Definition: desk.h:46
GpStatus WINGDIPAPI GdipGetImageHeight(GpImage *image, UINT *height)
Definition: image.c:2239
GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap *bitmap, GDIPCONST GpRect *rect, UINT flags, PixelFormat format, BitmapData *lockeddata)
Definition: image.c:1030
DWORD biCompression
Definition: amvideo.idl:35
UINT width
Definition: desk.h:47
smooth NULL
Definition: ftsmooth.c:416
Definition: uimain.c:88
GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap *bitmap, BitmapData *lockeddata)
Definition: image.c:1176
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
if(!(yy_init))
Definition: macro.lex.yy.c:714
BITMAPINFO * info
Definition: desk.h:45
DWORD biSizeImage
Definition: amvideo.idl:36
GpStatus WINGDIPAPI GdipCreateBitmapFromFile(GDIPCONST WCHAR *filename, GpBitmap **bitmap)
Definition: image.c:1360
GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image)
Definition: image.c:2107
Definition: desk.h:43
#define PixelFormat32bppPARGB
static HBITMAP bitmap
Definition: clipboard.c:1344
#define BI_RGB
Definition: precomp.h:35
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by ListViewItemChanged().

◆ DisplayAdvancedSettings()

BOOL DisplayAdvancedSettings ( HWND  hWndParent,
PDISPLAY_DEVICE_ENTRY  DisplayDevice 
)

Definition at line 81 of file advmon.c.

82 {
83  TCHAR szCaption[128];
85  PROPSHEETHEADER psh;
86  HPSXA hpsxaDev, hpsxaDisp;
87  BOOL Ret;
88  IDataObject *pdo;
89 #ifdef _MSC_VER
91  CPSEAE msvc_SHCreatePropSheetExtArrayEx;
92 #endif
93 
94  /* FIXME: Build the "%s and %s" caption string for the monitor and adapter name */
95  szCaption[0] = _T('\0');
96 
97  ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
98  psh.dwSize = sizeof(PROPSHEETHEADER);
99  psh.dwFlags = PSH_PROPTITLE;
100  psh.hwndParent = hWndParent;
101  psh.hInstance = hApplet;
102  psh.pszCaption = szCaption;
103  psh.phpage = hpsp;
104 
106 
107  pdo = CreateDevSettings(DisplayDevice);
108 
109  if (pdo != NULL)
110  BuildAdvPropTitle(pdo, szCaption, sizeof(szCaption) / sizeof(szCaption[0]));
111 
112 #ifdef _MSC_VER
113  hShell32 = LoadLibrary(_T("shell32.dll"));
114  if (hShell32 == NULL)
115  return FALSE;
116  msvc_SHCreatePropSheetExtArrayEx = (CPSEAE)GetProcAddress(hShell32, (LPCSTR)194);
117  hpsxaDev = msvc_SHCreatePropSheetExtArrayEx(HKEY_LOCAL_MACHINE, REGSTR_PATH_CONTROLSFOLDER TEXT("\\Device"), MAX_ADVANCED_PAGES - psh.nPages, pdo);
118 #else
120 #endif
121  if (hpsxaDev != NULL)
123 
124 #ifdef _MSC_VER
125  hpsxaDisp = msvc_SHCreatePropSheetExtArrayEx(HKEY_LOCAL_MACHINE, REGSTR_PATH_CONTROLSFOLDER TEXT("\\Device"), MAX_ADVANCED_PAGES - psh.nPages, pdo);
126 #else
128 #endif
129  if (hpsxaDisp != NULL)
131 
132  Ret = (LONG)(PropertySheet(&psh) != -1);
133 
134  if (hpsxaDisp != NULL)
135  SHDestroyPropSheetExtArray(hpsxaDisp);
136 
137  if (hpsxaDev != NULL)
138  SHDestroyPropSheetExtArray(hpsxaDev);
139 
140  IDataObject_Release(pdo);
141 
142 #ifdef _MSC_VER
143  if (hShell32)
145 #endif
146 
147  return Ret;
148 }
void WINAPI SHDestroyPropSheetExtArray(HPSXA hpsxa)
Definition: shellord.c:1755
#define MAX_ADVANCED_PAGES
Definition: advmon.c:10
#define LoadLibrary
Definition: winbase.h:3676
UINT WINAPI SHAddFromPropSheetExtArray(HPSXA hpsxa, LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam)
Definition: shellord.c:1577
#define REGSTR_PATH_CONTROLSFOLDER
Definition: regstr.h:76
#define ZeroMemory
Definition: winbase.h:1635
HINSTANCE hApplet
Definition: access.c:17
#define IDD_ADVANCED_GENERAL
Definition: resource.h:16
HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY, LPCWSTR, UINT, IDataObject *)
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
HPSXA(WINAPI * CPSEAE)(HKEY, LPCWSTR, UINT, IDataObject *)
Definition: advmon.c:78
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
smooth NULL
Definition: ftsmooth.c:416
#define PROPSHEETHEADER
Definition: prsht.h:374
LONG_PTR LPARAM
Definition: windef.h:208
const char * LPCSTR
Definition: xmlstorage.h:183
static BOOL DisplayAdvancedSettingsInitPropSheetPage(PROPSHEETHEADER *ppsh, WORD idDlg, DLGPROC DlgProc, LPARAM lParam)
Definition: advmon.c:26
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
#define FreeLibrary(x)
Definition: compat.h:405
#define PSH_PROPTITLE
Definition: prsht.h:40
static VOID BuildAdvPropTitle(IDataObject *pdo, LPTSTR lpBuffer, DWORD dwBufferLen)
Definition: advmon.c:52
static BOOL CALLBACK PropSheetAddPage(HPROPSHEETPAGE hpage, LPARAM lParam)
Definition: advmon.c:13
#define TEXT(s)
Definition: k32.h:26
#define PropertySheet
Definition: prsht.h:382
IDataObject * CreateDevSettings(PDISPLAY_DEVICE_ENTRY DisplayDeviceInfo)
Definition: devsett.c:887
#define GetProcAddress(x, y)
Definition: compat.h:410
INT_PTR CALLBACK AdvGeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: general.c:115
static HMODULE hShell32
Definition: string.c:34
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by SettingsPageProc().

◆ LoadPopupMenu()

HMENU LoadPopupMenu ( IN HINSTANCE  hInstance,
IN LPCTSTR  lpMenuName 
)

Definition at line 40 of file desk.c.

42 {
43  HMENU hMenu, hSubMenu = NULL;
44 
45  hMenu = LoadMenu(hInstance,
46  lpMenuName);
47 
48  if (hMenu != NULL)
49  {
50  hSubMenu = GetSubMenu(hMenu,
51  0);
52  if (hSubMenu != NULL &&
53  !RemoveMenu(hMenu,
54  0,
56  {
57  hSubMenu = NULL;
58  }
59 
60  DestroyMenu(hMenu);
61  }
62 
63  return hSubMenu;
64 }
HINSTANCE hInstance
Definition: charmap.c:20
#define MF_BYPOSITION
Definition: winuser.h:203
smooth NULL
Definition: ftsmooth.c:416
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define LoadMenu
Definition: winuser.h:5683
BOOL WINAPI RemoveMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60

◆ RegLoadMUIStringW()

LONG RegLoadMUIStringW ( IN HKEY  hKey,
IN LPCWSTR pszValue  OPTIONAL,
OUT LPWSTR  pszOutBuf,
IN DWORD  cbOutBuf,
OUT LPDWORD pcbData  OPTIONAL,
IN DWORD  Flags,
IN LPCWSTR pszDirectory  OPTIONAL 
)

Definition at line 53 of file muireg.c.

60 {
61  DWORD dwValueType, cbData;
62  LPWSTR pwszTempBuffer = NULL, pwszExpandedBuffer = NULL;
63  LONG result;
64 
65  /* Parameter sanity checks. */
66  if (!hKey || !pszOutBuf)
68 
69  if (pszDirectory && *pszDirectory)
70  {
71  //FIXME("BaseDir parameter not yet supported!\n");
73  }
74 
75  /* Check for value existence and correctness of it's type, allocate a buffer and load it. */
76  result = RegQueryValueExW(hKey, pszValue, NULL, &dwValueType, NULL, &cbData);
77  if (result != ERROR_SUCCESS) goto cleanup;
78  if (!(dwValueType == REG_SZ || dwValueType == REG_EXPAND_SZ) || !cbData)
79  {
81  goto cleanup;
82  }
83  pwszTempBuffer = HeapAlloc(GetProcessHeap(), 0, cbData);
84  if (!pwszTempBuffer)
85  {
87  goto cleanup;
88  }
89  result = RegQueryValueExW(hKey, pszValue, NULL, &dwValueType, (LPBYTE)pwszTempBuffer, &cbData);
90  if (result != ERROR_SUCCESS) goto cleanup;
91 
92  /* Expand environment variables, if appropriate, or copy the original string over. */
93  if (dwValueType == REG_EXPAND_SZ)
94  {
95  cbData = ExpandEnvironmentStringsW(pwszTempBuffer, NULL, 0) * sizeof(WCHAR);
96  if (!cbData) goto cleanup;
97  pwszExpandedBuffer = HeapAlloc(GetProcessHeap(), 0, cbData);
98  if (!pwszExpandedBuffer)
99  {
101  goto cleanup;
102  }
103  ExpandEnvironmentStringsW(pwszTempBuffer, pwszExpandedBuffer, cbData);
104  }
105  else
106  {
107  pwszExpandedBuffer = HeapAlloc(GetProcessHeap(), 0, cbData);
108  memcpy(pwszExpandedBuffer, pwszTempBuffer, cbData);
109  }
110 
111  /* If the value references a resource based string, parse the value and load the string.
112  * Else just copy over the original value. */
114  if (*pwszExpandedBuffer != L'@') /* '@' is the prefix for resource based string entries. */
115  {
116  lstrcpynW(pszOutBuf, pwszExpandedBuffer, cbOutBuf / sizeof(WCHAR));
117  }
118  else
119  {
120  WCHAR *pComma = wcsrchr(pwszExpandedBuffer, L',');
121  UINT uiStringId;
123 
124  /* Format of the expanded value is 'path_to_dll,-resId' */
125  if (!pComma || pComma[1] != L'-')
126  {
128  goto cleanup;
129  }
130 
131  uiStringId = _wtoi(pComma+2);
132  *pComma = L'\0';
133 
134  hModule = LoadLibraryExW(pwszExpandedBuffer + 1, NULL, LOAD_LIBRARY_AS_DATAFILE);
135  if (!hModule || !load_string(hModule, uiStringId, pszOutBuf, cbOutBuf / sizeof(WCHAR)))
138  }
139 
140 cleanup:
141  HeapFree(GetProcessHeap(), 0, pwszTempBuffer);
142  HeapFree(GetProcessHeap(), 0, pwszExpandedBuffer);
143  return result;
144 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define ERROR_SUCCESS
Definition: deptool.c:10
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:286
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define lstrcpynW
Definition: compat.h:397
unsigned char * LPBYTE
Definition: typedefs.h:52
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
_Check_return_ _CRTIMP _CONST_RETURN wchar_t *__cdecl wcsrchr(_In_z_ const wchar_t *_Str, _In_ wchar_t _Ch)
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define FreeLibrary(x)
Definition: compat.h:405
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ERROR_BADKEY
Definition: winerror.h:589
static const WCHAR L[]
Definition: oid.c:1250
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define LOAD_LIBRARY_AS_DATAFILE
Definition: winbase.h:338
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
unsigned int UINT
Definition: ndis.h:50
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
static int load_string(HINSTANCE hModule, UINT resId, LPWSTR pwszBuffer, INT cMaxChars)
Definition: muireg.c:10
char * cleanup(char *str)
Definition: wpickclick.c:99
WCHAR * LPWSTR
Definition: xmlstorage.h:184
GLuint64EXT * result
Definition: glext.h:11304
#define HeapFree(x, y, z)
Definition: compat.h:394
HMODULE hModule
Definition: animate.c:44
#define REG_SZ
Definition: layer.c:22

Referenced by CDefaultContextMenu::AddStaticContextMenusToMenu(), FileTypesDlg_InsertToLV(), HCR_GetClassNameW(), HCR_MapTypeToValueW(), LoadClassicColorSchemes(), LoadSchemeSizes(), and RegLoadMUIStringA().

◆ SHCreatePropSheetExtArrayEx()

HPSXA WINAPI SHCreatePropSheetExtArrayEx ( HKEY  ,
LPCWSTR  ,
UINT  ,
IDataObject  
)

Referenced by DisplayAdvancedSettings().

Variable Documentation

◆ g_GlobalData

◆ hApplet

HINSTANCE hApplet

Definition at line 17 of file access.c.

◆ hCPLWindow

HWND hCPLWindow

Definition at line 18 of file access.c.

Referenced by Applet(), CPlApplet(), DisplayApplet(), LoadSchemeFromTheme(), and SystemApplet().