ReactOS 0.4.17-dev-769-g1500a35
compstui_main.c File Reference
#include <assert.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "commctrl.h"
#include "ddk/compstui.h"
#include "wine/debug.h"
#include "wine/list.h"
Include dependency graph for compstui_main.c:

Go to the source code of this file.

Classes

struct  PROPSHEETUI_INFO_HEADERAW
 
struct  propsheet
 
struct  propsheetpage
 
struct  propsheetfunc
 
struct  cps_data
 

Macros

#define COBJMACROS
 
#define HANDLE_FIRST   0x43440001
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (compstui)
 
static LONG_PTR WINAPI cps_callback (HANDLE hcps, UINT func, LPARAM lparam1, LPARAM lparam2)
 
static struct cps_dataget_handle_data (HANDLE handle)
 
static HANDLE alloc_handle (struct cps_data **cps_data, int type)
 
static void free_handle (HANDLE handle)
 
static HANDLE add_hpropsheetpage (HANDLE hcps, HPROPSHEETPAGE hpsp)
 
static HANDLE add_propsheetfunc (HANDLE hcps, PFNPROPSHEETUI func, LPARAM lparam, BOOL unicode)
 
static HANDLE add_propsheetpage (HANDLE hcps, void *psp, PSPINFO *info, DLGPROC dlg_proc, BOOL unicode)
 
static INT_PTR CALLBACK propsheetpage_dlg_procW (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static HANDLE add_propsheetpageW (HANDLE hcps, PROPSHEETPAGEW *psp)
 
static INT_PTR CALLBACK propsheetpage_dlg_procA (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static HANDLE add_propsheetpageA (HANDLE hcps, PROPSHEETPAGEA *psp)
 
static LONG create_property_sheetW (struct propsheet *ps, PROPSHEETUI_INFO_HEADERAW *header)
 
static LONG create_prop_dlg (HWND hwnd, PFNPROPSHEETUI callback, LPARAM lparam, DWORD *res, BOOL unicode)
 
LONG WINAPI CommonPropertySheetUIA (HWND hWnd, PFNPROPSHEETUI pfnPropSheetUI, LPARAM lparam, LPDWORD pResult)
 
LONG WINAPI CommonPropertySheetUIW (HWND hwnd, PFNPROPSHEETUI callback, LPARAM lparam, LPDWORD res)
 
ULONG_PTR WINAPI GetCPSUIUserData (HWND hDlg)
 
BOOL WINAPI SetCPSUIUserData (HWND hDlg, ULONG_PTR UserData)
 
BOOL WINAPI DllMain (HINSTANCE hinst, DWORD reason, void *reserved)
 

Variables

static HMODULE compstui_hmod
 
static struct cps_data handles [0x1000]
 
static struct cps_datafirst_free_handle = handles
 
static CRITICAL_SECTION handles_cs = { &handles_cs_debug, -1, 0, 0, 0, 0 }
 
static CRITICAL_SECTION_DEBUG handles_cs_debug
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 26 of file compstui_main.c.

◆ HANDLE_FIRST

#define HANDLE_FIRST   0x43440001

Definition at line 83 of file compstui_main.c.

Function Documentation

◆ add_hpropsheetpage()

static HANDLE add_hpropsheetpage ( HANDLE  hcps,
HPROPSHEETPAGE  hpsp 
)
static

Definition at line 184 of file compstui_main.c.

185{
186 struct cps_data *cps_data = get_handle_data(hcps);
187 struct cps_data *cpsp_data;
188 HANDLE ret;
189
190 if (!cps_data || !hpsp)
191 return 0;
192
194 {
195 FIXME("unsupported handle type %d\n", cps_data->type);
196 return 0;
197 }
198
199 if (cps_data->ps->pages_cnt == ARRAY_SIZE(cps_data->ps->pages))
200 return 0;
201
203 if (!ret)
204 return 0;
205 cpsp_data->psp->hpsp = hpsp;
206
207 cps_data->ps->pages[cps_data->ps->pages_cnt++] = ret;
208 return ret;
209}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define FIXME(fmt,...)
Definition: precomp.h:53
static struct cps_data * get_handle_data(HANDLE handle)
static HANDLE alloc_handle(struct cps_data **cps_data, int type)
return ret
Definition: mutex.c:147
@ HANDLE_PROPSHEET
Definition: compstui_main.c:89
@ HANDLE_PROPSHEETPAGE
Definition: compstui_main.c:90
enum cps_data::@353 type
struct propsheet * ps
Definition: compstui_main.c:97
struct propsheetpage * psp
Definition: compstui_main.c:98

Referenced by cps_callback().

◆ add_propsheetfunc()

static HANDLE add_propsheetfunc ( HANDLE  hcps,
PFNPROPSHEETUI  func,
LPARAM  lparam,
BOOL  unicode 
)
static

Definition at line 211 of file compstui_main.c.

212{
213 struct cps_data *cps_data = get_handle_data(hcps);
214 struct cps_data *cpsf_data;
216 HANDLE ret;
217 LONG lret;
218
219 if (!cps_data || !func)
220 return 0;
221
223 {
224 FIXME("unsupported handle type %d\n", cps_data->type);
225 return 0;
226 }
227
229 if (!ret)
230 return 0;
231 cpsf_data->psf->handle = ret;
232 cpsf_data->psf->func = func;
233 cpsf_data->psf->unicode = unicode;
234 cpsf_data->psf->lparam = lparam;
235
236 memset(&info, 0, sizeof(info));
237 info.cbSize = sizeof(info);
239 info.Flags = unicode ? PSUIINFO_UNICODE : 0;
241 info.hComPropSheet = hcps;
242 info.pfnComPropSheet = cps_callback;
243 info.lParamInit = lparam;
244
246 lret = func(&callback_info, lparam);
247 cpsf_data->psf->user_data = callback_info.UserData;
248 cpsf_data->psf->result = callback_info.Result;
249 if (lret <= 0)
250 {
253 callback_info.UserData = cpsf_data->psf->user_data;
254 callback_info.Result = cpsf_data->psf->result;
256 func(&callback_info, 0);
257 return 0;
258 }
259
260 list_add_tail(&cps_data->ps->funcs, &cpsf_data->psf->entry);
261 return ret;
262}
@ lparam
Definition: SystemMenu.c:31
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
static void free_handle(HANDLE handle)
static LONG_PTR WINAPI cps_callback(HANDLE hcps, UINT func, LPARAM lparam1, LPARAM lparam2)
GLenum func
Definition: glext.h:6028
long LONG
Definition: pedump.c:60
#define PROPSHEETUI_INFO_VERSION
Definition: compstui.h:635
#define PROPSHEETUI_REASON_INIT
Definition: compstui.h:627
#define PROPSHEETUI_REASON_DESTROY
Definition: compstui.h:629
#define PSUIINFO_UNICODE
Definition: compstui.h:637
#define memset(x, y, z)
Definition: compat.h:39
@ HANDLE_PROPSHEETFUNC
Definition: compstui_main.c:91
struct propsheetfunc * psf
Definition: compstui_main.c:99

Referenced by cps_callback().

◆ add_propsheetpage()

static HANDLE add_propsheetpage ( HANDLE  hcps,
void psp,
PSPINFO info,
DLGPROC  dlg_proc,
BOOL  unicode 
)
static

Definition at line 264 of file compstui_main.c.

266{
267 struct cps_data *cps_data = get_handle_data(hcps);
268 struct cps_data *cpsp_data;
269 HPROPSHEETPAGE hpsp;
270 HANDLE ret;
271
272 if (!cps_data)
273 return 0;
274
276 {
277 FIXME("unsupported handle type %d\n", cps_data->type);
278 return 0;
279 }
280
281 if (cps_data->ps->pages_cnt == ARRAY_SIZE(cps_data->ps->pages))
282 return 0;
283
285 if (!ret)
286 return 0;
287
288 info->cbSize = sizeof(*info);
289 info->wReserved = 0;
290 info->hComPropSheet = hcps;
291 info->hCPSUIPage = ret;
292 info->pfnComPropSheet = cps_callback;
293
294 if (unicode)
296 else
298 if (!hpsp)
299 {
301 return 0;
302 }
303
304 cpsp_data->psp->hpsp = hpsp;
305 cpsp_data->psp->dlg_proc = dlg_proc;
306 cps_data->ps->pages[cps_data->ps->pages_cnt++] = ret;
307 return ret;
308}
HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage)
Definition: propsheet.c:3120
HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(LPCPROPSHEETPAGEA lpPropSheetPage)
Definition: propsheet.c:3036
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
static INT_PTR __stdcall dlg_proc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)

Referenced by add_propsheetpageA(), and add_propsheetpageW().

◆ add_propsheetpageA()

static HANDLE add_propsheetpageA ( HANDLE  hcps,
PROPSHEETPAGEA psp 
)
static

Definition at line 366 of file compstui_main.c.

367{
368 PROPSHEETPAGEA *psp_copy;
369 PSPINFO *info;
370 HANDLE ret;
371
372 if (!psp || psp->dwSize < PROPSHEETPAGEW_V1_SIZE)
373 return 0;
374
375 psp_copy = (PROPSHEETPAGEA*)malloc(psp->dwSize + sizeof(*info));
376 if (!psp_copy)
377 return 0;
378 memcpy(psp_copy, psp, psp->dwSize);
379 psp_copy->dwSize += sizeof(*info);
381
382 info = (PSPINFO*)((BYTE*)psp_copy + psp->dwSize);
383 ret = add_propsheetpage(hcps, psp_copy, info, psp->pfnDlgProc, FALSE);
384 free(psp_copy);
385 return ret;
386}
static HANDLE add_propsheetpage(HANDLE hcps, void *psp, PSPINFO *info, DLGPROC dlg_proc, BOOL unicode)
static INT_PTR CALLBACK propsheetpage_dlg_procA(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define FALSE
Definition: types.h:117
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define PROPSHEETPAGEW_V1_SIZE
Definition: prsht.h:246
DLGPROC pfnDlgProc
Definition: prsht.h:189
DWORD dwSize
Definition: prsht.h:177
unsigned char BYTE
Definition: xxhash.c:193

Referenced by cps_callback().

◆ add_propsheetpageW()

static HANDLE add_propsheetpageW ( HANDLE  hcps,
PROPSHEETPAGEW psp 
)
static

Definition at line 327 of file compstui_main.c.

328{
329 PROPSHEETPAGEW *psp_copy;
330 PSPINFO *info;
331 HANDLE ret;
332
333 if (!psp || psp->dwSize < PROPSHEETPAGEW_V1_SIZE)
334 return 0;
335
336 psp_copy = (PROPSHEETPAGEW*)malloc(psp->dwSize + sizeof(*info));
337 if (!psp_copy)
338 return 0;
339 memcpy(psp_copy, psp, psp->dwSize);
340 psp_copy->dwSize += sizeof(*info);
342
343 info = (PSPINFO*)((BYTE*)psp_copy + psp->dwSize);
344 ret = add_propsheetpage(hcps, psp_copy, info, psp->pfnDlgProc, TRUE);
345 free(psp_copy);
346 return ret;
347}
static INT_PTR CALLBACK propsheetpage_dlg_procW(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
#define TRUE
Definition: types.h:120
DLGPROC pfnDlgProc
Definition: prsht.h:226
DWORD dwSize
Definition: prsht.h:214

Referenced by cps_callback().

◆ alloc_handle()

static HANDLE alloc_handle ( struct cps_data **  cps_data,
int  type 
)
static

Definition at line 126 of file compstui_main.c.

127{
128 void *data = NULL;
129
130 switch(type)
131 {
132 case HANDLE_PROPSHEET:
133 data = calloc(1, sizeof(struct propsheet));
134 break;
135 case HANDLE_PROPSHEETPAGE:
136 data = calloc(1, sizeof(struct propsheetpage));
137 break;
138 case HANDLE_PROPSHEETFUNC:
139 data = calloc(1, sizeof(struct propsheetfunc));
140 break;
141 }
142
143 if (!data)
144 return NULL;
145
147
149 {
151 FIXME("out of handles\n");
152 free(data);
153 return NULL;
154 }
155
157 if ((*cps_data)->next_free)
158 first_free_handle = (*cps_data)->next_free;
159 else
160 first_free_handle = (*cps_data) + 1;
162
163 (*cps_data)->type = type;
164 (*cps_data)->data = data;
165 return (HANDLE)(HANDLE_FIRST + ((*cps_data) - handles));
166}
static struct cps_data * first_free_handle
#define HANDLE_FIRST
Definition: compstui_main.c:83
static CRITICAL_SECTION handles_cs
static struct cps_data handles[0x1000]
#define NULL
Definition: types.h:112
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define calloc
Definition: rosglue.h:14
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)

Referenced by add_hpropsheetpage(), add_propsheetfunc(), add_propsheetpage(), create_prop_dlg(), WinHttpConnect(), WinHttpOpen(), WinHttpOpenRequest(), and WinHttpWebSocketCompleteUpgrade().

◆ CommonPropertySheetUIA()

LONG WINAPI CommonPropertySheetUIA ( HWND  hWnd,
PFNPROPSHEETUI  pfnPropSheetUI,
LPARAM  lparam,
LPDWORD  pResult 
)

Definition at line 606 of file compstui_main.c.

607{
608 FIXME("(%p, %p, 0x%Ix, %p)\n", hWnd, pfnPropSheetUI, lparam, pResult);
609 return CPSUI_CANCEL;
610}
HWND hWnd
Definition: settings.c:17
#define CPSUI_CANCEL
Definition: compstui.h:640

◆ CommonPropertySheetUIW()

LONG WINAPI CommonPropertySheetUIW ( HWND  hwnd,
PFNPROPSHEETUI  callback,
LPARAM  lparam,
LPDWORD  res 
)

Definition at line 616 of file compstui_main.c.

617{
618 TRACE("(%p, %p, 0x%Ix, %p)\n", hwnd, callback, lparam, res);
620}
static LONG create_prop_dlg(HWND hwnd, PFNPROPSHEETUI callback, LPARAM lparam, DWORD *res, BOOL unicode)
GLuint res
Definition: glext.h:9613
static IPrintDialogCallback callback
Definition: printdlg.c:326
#define TRACE(s)
Definition: solgame.cpp:4
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

◆ cps_callback()

static LONG_PTR WINAPI cps_callback ( HANDLE  hcps,
UINT  func,
LPARAM  lparam1,
LPARAM  lparam2 
)
static

Definition at line 388 of file compstui_main.c.

389{
390 TRACE("(%p, %u, %Ix, %Ix\n", hcps, func, lparam1, lparam2);
391
392 switch(func)
393 {
395 return (LONG_PTR)add_hpropsheetpage(hcps, (HPROPSHEETPAGE)lparam1);
398 return (LONG_PTR)add_propsheetfunc(hcps, (PFNPROPSHEETUI)lparam1,
401 return (LONG_PTR)add_propsheetpageA(hcps, (PROPSHEETPAGEA*)lparam1);
403 return (LONG_PTR)add_propsheetpageW(hcps, (PROPSHEETPAGEW*)lparam1);
426 FIXME("func not supported %d\n", func);
427 return 0;
428 default:
429 ERR("unknown func: %d\n", func);
430 return 0;
431 }
432}
#define ERR(fmt,...)
Definition: precomp.h:57
static HANDLE add_hpropsheetpage(HANDLE hcps, HPROPSHEETPAGE hpsp)
static HANDLE add_propsheetpageW(HANDLE hcps, PROPSHEETPAGEW *psp)
static HANDLE add_propsheetfunc(HANDLE hcps, PFNPROPSHEETUI func, LPARAM lparam, BOOL unicode)
static HANDLE add_propsheetpageA(HANDLE hcps, PROPSHEETPAGEA *psp)
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define CPSFUNC_GET_PAGECOUNT
Definition: compstui.h:555
#define CPSFUNC_GET_PFNPROPSHEETUI_ICON
Definition: compstui.h:561
#define CPSFUNC_GET_HPSUIPAGES
Definition: compstui.h:557
#define CPSFUNC_INSERT_PSUIPAGEA
Definition: compstui.h:563
#define CPSFUNC_ADD_PFNPROPSHEETUIA
Definition: compstui.h:551
#define CPSFUNC_DO_APPLY_CPSUI
Definition: compstui.h:572
#define CPSFUNC_INSERT_PSUIPAGEW
Definition: compstui.h:564
#define CPSFUNC_ADD_PCOMPROPSHEETUIW
Definition: compstui.h:550
#define CPSFUNC_ADD_PCOMPROPSHEETUIA
Definition: compstui.h:549
#define CPSFUNC_SET_PSUIPAGE_ICON
Definition: compstui.h:567
#define CPSFUNC_SET_DMPUB_HIDEBITS
Definition: compstui.h:570
#define CPSFUNC_LOAD_CPSUI_ICON
Definition: compstui.h:560
#define CPSFUNC_SET_FUSION_CONTEXT
Definition: compstui.h:575
#define CPSFUNC_SET_DATABLOCK
Definition: compstui.h:568
#define CPSFUNC_ADD_HPROPSHEETPAGE
Definition: compstui.h:547
#define CPSFUNC_SET_PSUIPAGE_TITLEW
Definition: compstui.h:566
#define CPSFUNC_ADD_PFNPROPSHEETUIW
Definition: compstui.h:552
#define CPSFUNC_SET_PSUIPAGE_TITLEA
Definition: compstui.h:565
#define CPSFUNC_LOAD_CPSUI_STRINGW
Definition: compstui.h:559
#define CPSFUNC_IGNORE_CPSUI_PSN_APPLY
Definition: compstui.h:571
#define CPSFUNC_DELETE_HCOMPROPSHEET
Definition: compstui.h:553
#define CPSFUNC_LOAD_CPSUI_STRINGA
Definition: compstui.h:558
#define CPSFUNC_ADD_PROPSHEETPAGEW
Definition: compstui.h:548
#define CPSFUNC_ADD_PROPSHEETPAGEA
Definition: compstui.h:562
#define CPSFUNC_SET_RESULT
Definition: compstui.h:556
LONG(FAR * PFNPROPSHEETUI)(PPROPSHEETUI_INFO pPSUIInfo, LPARAM lParam)
Definition: compstui.h:906
#define CPSFUNC_SET_HSTARTPAGE
Definition: compstui.h:554
#define CPSFUNC_QUERY_DATABLOCK
Definition: compstui.h:569

Referenced by add_propsheetfunc(), add_propsheetpage(), and create_prop_dlg().

◆ create_prop_dlg()

static LONG create_prop_dlg ( HWND  hwnd,
PFNPROPSHEETUI  callback,
LPARAM  lparam,
DWORD res,
BOOL  unicode 
)
static

Definition at line 519 of file compstui_main.c.

520{
523 struct cps_data *cps_data;
524 HANDLE cps_handle;
525 LONG ret;
526 int i;
527
528 if (!callback || !(cps_handle = alloc_handle(&cps_data, HANDLE_PROPSHEET)))
529 {
530 SetLastError(0);
532 }
533 list_init(&cps_data->ps->funcs);
534
535 memset(&info, 0, sizeof(info));
536 info.cbSize = sizeof(info);
537 info.lParamInit = lparam;
541
543 info.Flags = unicode ? PSUIINFO_UNICODE : 0;
544 info.hComPropSheet = cps_handle;
545 info.pfnComPropSheet = cps_callback;
549 info.UserData = callback_info.UserData;
550 info.Result = callback_info.Result;
551 if (ret <= 0)
552 {
554 goto destroy;
555 }
556
557 memset(&header, 0, sizeof(header));
558 header.size = sizeof(header);
559 header.parent = hwnd;
563 info.UserData = callback_info.UserData;
564 info.Result = callback_info.Result;
565 if (ret <= 0)
566 {
568 goto destroy;
569 }
570
572
573destroy:
575 while (!list_empty(&cps_data->ps->funcs))
576 {
577 struct propsheetfunc *func = LIST_ENTRY(list_head(&cps_data->ps->funcs),
578 struct propsheetfunc, entry);
579
580 list_remove(&func->entry);
581
583 callback_info.Flags = func->unicode ? PSUIINFO_UNICODE : 0;
584 callback_info.lParamInit = func->lparam;
585 callback_info.UserData = func->user_data;
586 callback_info.Result = func->result;
587 func->func(&callback_info, ret <= 0 ? 0 : 0x100);
588 free_handle(func->handle);
589 }
590
592 callback(&callback_info, ret <= 0 ? 0 : 0x100);
593
594 for (i = 0; i < cps_data->ps->pages_cnt; i++)
595 free_handle(cps_data->ps->pages[i]);
596 free_handle(cps_handle);
597
598 if (res) *res = callback_info.Result;
599 return ret;
600}
void destroy(_Tp *__pointer)
Definition: _construct.h:278
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static int list_empty(struct list_entry *head)
Definition: list.h:58
static void list_init(struct list_entry *head)
Definition: list.h:51
static LONG create_property_sheetW(struct propsheet *ps, PROPSHEETUI_INFO_HEADERAW *header)
#define SetLastError(x)
Definition: compat.h:752
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
uint32_t entry
Definition: isohybrid.c:63
LONG_PTR LPARAM
Definition: minwindef.h:175
#define PROPSHEETUI_REASON_BEFORE_INIT
Definition: compstui.h:632
#define ERR_CPSUI_GETLASTERROR
Definition: compstui.h:645
#define PROPSHEETUI_REASON_GET_INFO_HEADER
Definition: compstui.h:628
Definition: list.h:15
#define LIST_ENTRY(type)
Definition: queue.h:175

Referenced by CommonPropertySheetUIW().

◆ create_property_sheetW()

static LONG create_property_sheetW ( struct propsheet ps,
PROPSHEETUI_INFO_HEADERAW header 
)
static

Definition at line 434 of file compstui_main.c.

435{
436 HPROPSHEETPAGE hpsp[100];
438 WCHAR title[256];
440 int i, len;
441
442 if (!ps->pages_cnt)
444
445 memset(&psh, 0, sizeof(psh));
446 psh.dwSize = sizeof(psh);
447 if (header->flags & PSUIHDRF_NOAPPLYNOW)
448 psh.dwFlags |= PSH_NOAPPLYNOW;
449 psh.hwndParent = header->parent;
450 psh.hInstance = header->hinst;
451 psh.pszCaption = title;
452
453 if (!(header->flags & PSUIHDRF_USEHICON) && !header->icon_id)
454 header->icon_id = IDI_CPSUI_OPTION;
455
456 if (header->flags & PSUIHDRF_USEHICON)
457 {
458 psh.dwFlags |= PSH_USEHICON;
459 psh.hIcon = header->hicon;
460 }
461 else if (header->icon_id >= IDI_CPSUI_ICONID_FIRST &&
462 header->icon_id <= IDI_CPSUI_ICONID_LAST)
463 {
464 FIXME("icon not implemented: %Id\n", header->icon_id);
465 }
466 else
467 {
468 psh.dwFlags |= PSH_USEICONID;
469 psh.pszIcon = (WCHAR*)header->icon_id;
470 }
471
472 if (header->titleW)
474 else
476
477 if ((header->flags & PSUIHDRF_DEFTITLE) &&
478 (!header->titleW || !(header->flags & PSUIHDRF_EXACT_PTITLE)))
479 {
480 len = wcslen(title);
481 if (len < ARRAY_SIZE(title) - 1)
482 {
483 title[len++] = ' ';
485 }
486 }
487
488 if ((header->flags & PSUIHDRF_PROPTITLE) &&
489 (!header->titleW || !(header->flags & PSUIHDRF_EXACT_PTITLE)))
490 {
491 len = wcslen(title);
492 if (len < ARRAY_SIZE(title) - 1)
493 {
494 title[len++] = ' ';
496 }
497 }
498
499 psh.nPages = ps->pages_cnt;
500 psh.phpage = hpsp;
501 for (i = 0; i < ps->pages_cnt; i++)
502 hpsp[i] = get_handle_data(ps->pages[i])->psp->hpsp;
503
504 ret = PropertySheetW(&psh);
505
506 switch(ret)
507 {
508 case -1:
511 return CPSUI_REBOOTSYSTEM;
514 default:
515 return CPSUI_OK;
516 }
517}
static HMODULE compstui_hmod
Definition: compstui_main.c:39
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2950
_ACRTIMP errno_t __cdecl wcscpy_s(wchar_t *, size_t, const wchar_t *)
Definition: wcs.c:2444
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
GLenum GLsizei len
Definition: glext.h:6722
if(dx< 0)
Definition: linetemp.h:194
short WCHAR
Definition: pedump.c:58
#define ID_PSRESTARTWINDOWS
Definition: prsht.h:132
#define PSH_USEHICON
Definition: prsht.h:41
#define ID_PSREBOOTSYSTEM
Definition: prsht.h:133
#define PSH_USEICONID
Definition: prsht.h:42
#define PSH_NOAPPLYNOW
Definition: prsht.h:47
static char title[]
Definition: ps.c:92
#define IDS_CPSUI_DEFAULT
Definition: compstui.h:179
#define IDS_CPSUI_OPTIONS
Definition: compstui.h:168
#define PSUIHDRF_PROPTITLE
Definition: compstui.h:694
#define IDI_CPSUI_ICONID_LAST
Definition: compstui.h:140
#define PSUIHDRF_NOAPPLYNOW
Definition: compstui.h:693
#define CPSUI_OK
Definition: compstui.h:641
#define PSUIHDRF_USEHICON
Definition: compstui.h:695
#define IDI_CPSUI_ICONID_FIRST
Definition: compstui.h:27
#define CPSUI_REBOOTSYSTEM
Definition: compstui.h:643
#define CPSUI_RESTARTWINDOWS
Definition: compstui.h:642
#define PSUIHDRF_EXACT_PTITLE
Definition: compstui.h:697
#define PSUIHDRF_DEFTITLE
Definition: compstui.h:696
#define IDI_CPSUI_OPTION
Definition: compstui.h:95
#define IDS_CPSUI_PROPERTIES
Definition: compstui.h:160
#define ERR_CPSUI_NO_PROPSHEETPAGE
Definition: compstui.h:652
#define LoadStringW
Definition: utils.h:64
HINSTANCE hInstance
Definition: prsht.h:296
DWORD dwSize
Definition: prsht.h:293
DWORD dwFlags
Definition: prsht.h:294
LPCWSTR pszIcon
Definition: prsht.h:299
HWND hwndParent
Definition: prsht.h:295
HPROPSHEETPAGE * phpage
Definition: prsht.h:309
LPCWSTR pszCaption
Definition: prsht.h:301
HANDLE pages[100]
Definition: compstui_main.c:62

Referenced by create_prop_dlg().

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinst,
DWORD  reason,
void reserved 
)

Definition at line 642 of file compstui_main.c.

643{
646 return TRUE;
647}
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1971
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
static HINSTANCE hinst
Definition: edit.c:551

◆ free_handle()

static void free_handle ( HANDLE  handle)
static

Definition at line 168 of file compstui_main.c.

169{
171
172 if (!data)
173 return;
174
175 data->type = HANDLE_FREE;
176 free(data->data);
177
179 data->next_free = first_free_handle;
182}

Referenced by add_propsheetfunc(), add_propsheetpage(), create_prop_dlg(), pqInsert(), and WinHttpCloseHandle().

◆ get_handle_data()

static struct cps_data * get_handle_data ( HANDLE  handle)
static

Definition at line 115 of file compstui_main.c.

116{
117 struct cps_data *ret;
118
120 return NULL;
121
123 return ret->type == HANDLE_FREE ? NULL : ret;
124}
#define ULONG_PTR
Definition: config.h:101
uint32_t ULONG_PTR
Definition: typedefs.h:65

Referenced by add_hpropsheetpage(), add_propsheetfunc(), add_propsheetpage(), create_property_sheetW(), free_handle(), propsheetpage_dlg_procA(), and propsheetpage_dlg_procW().

◆ GetCPSUIUserData()

ULONG_PTR WINAPI GetCPSUIUserData ( HWND  hDlg)

Definition at line 626 of file compstui_main.c.

627{
628 FIXME("(%p): stub\n", hDlg);
629 return 0;
630}

◆ propsheetpage_dlg_procA()

static INT_PTR CALLBACK propsheetpage_dlg_procA ( HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 349 of file compstui_main.c.

350{
351 if (msg == WM_INITDIALOG)
352 {
354 PSPINFO *info = (PSPINFO*)((BYTE*)lparam + psp->dwSize - sizeof(*info));
355 struct cps_data *cpsp_data = get_handle_data(info->hCPSUIPage);
356
357 psp->dwSize -= sizeof(*info);
358 psp->pfnDlgProc = cpsp_data->psp->dlg_proc;
360 return psp->pfnDlgProc(hwnd, msg, wparam, lparam);
361 }
362
363 return FALSE;
364}
@ wparam
Definition: SystemMenu.c:30
#define msg(x)
Definition: auth_time.c:54
#define SetWindowLongPtrA
Definition: winuser.h:5511
#define DWLP_DLGPROC
Definition: winuser.h:882
#define WM_INITDIALOG
Definition: winuser.h:1767

Referenced by add_propsheetpageA().

◆ propsheetpage_dlg_procW()

static INT_PTR CALLBACK propsheetpage_dlg_procW ( HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 310 of file compstui_main.c.

311{
312 if (msg == WM_INITDIALOG)
313 {
315 PSPINFO *info = (PSPINFO*)((BYTE*)lparam + psp->dwSize - sizeof(*info));
316 struct cps_data *cpsp_data = get_handle_data(info->hCPSUIPage);
317
318 psp->dwSize -= sizeof(*info);
319 psp->pfnDlgProc = cpsp_data->psp->dlg_proc;
321 return psp->pfnDlgProc(hwnd, msg, wparam, lparam);
322 }
323
324 return FALSE;
325}
#define SetWindowLongPtrW
Definition: winuser.h:5512

Referenced by add_propsheetpageW().

◆ SetCPSUIUserData()

BOOL WINAPI SetCPSUIUserData ( HWND  hDlg,
ULONG_PTR  UserData 
)

Definition at line 636 of file compstui_main.c.

637{
638 FIXME("(%p, %08Ix): stub\n", hDlg, UserData);
639 return TRUE;
640}

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( compstui  )

Variable Documentation

◆ compstui_hmod

HMODULE compstui_hmod
static

Definition at line 39 of file compstui_main.c.

Referenced by create_property_sheetW(), and DllMain().

◆ first_free_handle

struct cps_data* first_free_handle = handles
static

Definition at line 102 of file compstui_main.c.

Referenced by alloc_handle(), and free_handle().

◆ handles

struct cps_data handles[0x1000]
static

Referenced by alloc_handle(), and get_handle_data().

◆ handles_cs

static CRITICAL_SECTION handles_cs = { &handles_cs_debug, -1, 0, 0, 0, 0 }
static

Definition at line 104 of file compstui_main.c.

Referenced by alloc_handle(), and free_handle().

◆ handles_cs_debug

CRITICAL_SECTION_DEBUG handles_cs_debug
static
Initial value:
=
{
0, 0, &handles_cs,
0, 0, { (DWORD_PTR)(__FILE__ ": handles_cs") }
}
static CRITICAL_SECTION_DEBUG handles_cs_debug
#define DWORD_PTR
Definition: treelist.c:76

Definition at line 105 of file compstui_main.c.