ReactOS  0.4.15-dev-4857-g47842d7
deskadp.c File Reference
#include "precomp.h"
#include <tchar.h>
#include <debug.h>
#include "resource.h"
Include dependency graph for deskadp.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Typedefs

typedef INT_PTR(WINAPIPDEVICEPROPERTIESW) (HWND, LPCWSTR, LPCWSTR, BOOL)
 

Functions

static VOID GetColorDescription (PDEVMODEW lpDevMode, LPTSTR lpBuffer, DWORD dwBufferLen)
 
static VOID GetRefreshRateDescription (PDEVMODEW lpDevMode, LPTSTR lpBuffer, DWORD dwBufferLen)
 
static VOID InitListAllModesDialog (PDESKDISPLAYADAPTER This, HWND hwndListAllModesDlg)
 
static BOOL ChangeSelectedMode (PDESKDISPLAYADAPTER This, HWND hwndListAllModesDlg)
 
static INT_PTR CALLBACK ListAllModesDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static VOID ShowListAllModes (PDESKDISPLAYADAPTER This)
 
static VOID ShowAdapterProperties (PDESKDISPLAYADAPTER This)
 
static VOID InitDisplayAdapterDialog (PDESKDISPLAYADAPTER This)
 
static LONG ApplyDisplayAdapterChanges (PDESKDISPLAYADAPTER This)
 
static VOID ResetDisplayAdapterChanges (PDESKDISPLAYADAPTER This)
 
static INT_PTR CALLBACK DisplayAdapterDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static VOID IDeskDisplayAdapter_Destroy (PDESKDISPLAYADAPTER This)
 
ULONG IDeskDisplayAdapter_AddRef (PDESKDISPLAYADAPTER This)
 
ULONG IDeskDisplayAdapter_Release (PDESKDISPLAYADAPTER This)
 
HRESULT STDMETHODCALLTYPE IDeskDisplayAdapter_QueryInterface (PDESKDISPLAYADAPTER This, REFIID iid, PVOID *pvObject)
 
HRESULT IDeskDisplayAdapter_Initialize (PDESKDISPLAYADAPTER This, LPCITEMIDLIST pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID)
 
HRESULT IDeskDisplayAdapter_AddPages (PDESKDISPLAYADAPTER This, LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam)
 
HRESULT IDeskDisplayAdapter_ReplacePage (PDESKDISPLAYADAPTER This, EXPPS uPageID, LPFNADDPROPSHEETPAGE pfnReplacePage, LPARAM lParam)
 
HRESULT IDeskDisplayAdapter_Constructor (REFIID riid, LPVOID *ppv)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
 

Variables

static HINSTANCE hInstance
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 5 of file deskadp.c.

Typedef Documentation

◆ PDEVICEPROPERTIESW

typedef INT_PTR(WINAPI * PDEVICEPROPERTIESW) (HWND, LPCWSTR, LPCWSTR, BOOL)

Definition at line 12 of file deskadp.c.

Function Documentation

◆ ApplyDisplayAdapterChanges()

static LONG ApplyDisplayAdapterChanges ( PDESKDISPLAYADAPTER  This)
static

Definition at line 338 of file deskadp.c.

339 {
340  LONG lChangeRet;
341 
342  if (This->DeskExtInterface != NULL)
343  {
344  /* Change the display settings through desk.cpl */
345  lChangeRet = DeskCplExtDisplaySaveSettings(This->DeskExtInterface,
346  This->hwndDlg);
347  if (lChangeRet == DISP_CHANGE_SUCCESSFUL)
348  {
349  /* Save the new mode */
350  This->lpDevModeOnInit = This->DeskExtInterface->GetCurrentMode(This->DeskExtInterface->Context);
351  This->lpSelDevMode = This->lpDevModeOnInit;
352  return PSNRET_NOERROR;
353  }
354  else if (lChangeRet == DISP_CHANGE_RESTART)
355  {
356  /* Notify desk.cpl that the user needs to reboot */
358  return PSNRET_NOERROR;
359  }
360  }
361 
363 }
#define DISP_CHANGE_RESTART
Definition: winuser.h:191
#define PropSheet_RestartWindows(d)
Definition: prsht.h:352
static __inline LONG DeskCplExtDisplaySaveSettings(PDESK_EXT_INTERFACE DeskExtInterface, HWND hwndDlg)
Definition: deskcplx.h:122
long LONG
Definition: pedump.c:60
#define PSNRET_INVALID_NOCHANGEPAGE
Definition: prsht.h:131
#define DISP_CHANGE_SUCCESSFUL
Definition: winuser.h:190
#define PSNRET_NOERROR
Definition: prsht.h:129
HWND WINAPI GetParent(_In_ HWND)
#define NULL
Definition: types.h:112

Referenced by DisplayAdapterDlgProc().

◆ ChangeSelectedMode()

static BOOL ChangeSelectedMode ( PDESKDISPLAYADAPTER  This,
HWND  hwndListAllModesDlg 
)
static

Definition at line 159 of file deskadp.c.

161 {
162  INT i;
163  PDEVMODEW lpSelDevMode = NULL;
164  BOOL bRet = FALSE;
165 
166  i = (INT)SendDlgItemMessage(hwndListAllModesDlg,
168  LB_GETCURSEL,
169  0,
170  0);
171 
172  if (i >= 0)
173  {
174  lpSelDevMode = (PDEVMODEW)SendDlgItemMessage(hwndListAllModesDlg,
177  (WPARAM)i,
178  0);
179  }
180 
181  if (lpSelDevMode != NULL)
182  {
183  This->lpSelDevMode = lpSelDevMode;
184  bRet = TRUE;
185  }
186 
187  return bRet;
188 }
struct _devicemodeW * PDEVMODEW
#define TRUE
Definition: types.h:120
#define LB_GETITEMDATA
Definition: winuser.h:2028
#define INT
Definition: polytest.cpp:20
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5822
int32_t INT
Definition: typedefs.h:58
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define IDC_ALLVALIDMODES
Definition: resource.h:16
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
#define LB_GETCURSEL
Definition: winuser.h:2026
#define NULL
Definition: types.h:112

Referenced by ListAllModesDlgProc().

◆ DisplayAdapterDlgProc()

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

Definition at line 376 of file deskadp.c.

380 {
382  INT_PTR Ret = 0;
383 
384  if (uMsg != WM_INITDIALOG)
385  {
387  }
388 
389  switch (uMsg)
390  {
391  case WM_INITDIALOG:
393  This->hwndDlg = hwndDlg;
395 
397  Ret = TRUE;
398  break;
399 
400  case WM_COMMAND:
401  switch (LOWORD(wParam))
402  {
405  break;
406 
407  case IDC_LISTALLMODES:
409  break;
410  }
411 
412  break;
413 
414  case WM_NOTIFY:
415  {
416  NMHDR *nmh = (NMHDR *)lParam;
417 
418  switch (nmh->code)
419  {
420  case PSN_APPLY:
421  {
422  SetWindowLongPtr(hwndDlg,
425  Ret = TRUE;
426  break;
427  }
428 
429  case PSN_RESET:
431  break;
432  }
433  break;
434  }
435  }
436 
437  return Ret;
438 }
#define IDC_LISTALLMODES
Definition: resource.h:13
static VOID ResetDisplayAdapterChanges(PDESKDISPLAYADAPTER This)
Definition: deskadp.c:366
#define TRUE
Definition: types.h:120
static VOID ShowAdapterProperties(PDESKDISPLAYADAPTER This)
Definition: deskadp.c:268
#define PSN_APPLY
Definition: prsht.h:117
int32_t INT_PTR
Definition: typedefs.h:64
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define DWLP_MSGRESULT
Definition: winuser.h:864
UINT code
Definition: winuser.h:3139
#define LPCPROPSHEETPAGE
Definition: prsht.h:391
struct _DESKDISPLAYADAPTER * PDESKDISPLAYADAPTER
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1727
static LONG ApplyDisplayAdapterChanges(PDESKDISPLAYADAPTER This)
Definition: deskadp.c:338
#define PSN_RESET
Definition: prsht.h:118
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define IDC_ADAPTERPROPERTIES
Definition: resource.h:7
static VOID ShowListAllModes(PDESKDISPLAYADAPTER This)
Definition: deskadp.c:244
#define GetWindowLongPtr
Definition: treelist.c:73
static VOID InitDisplayAdapterDialog(PDESKDISPLAYADAPTER This)
Definition: deskadp.c:291
#define WM_INITDIALOG
Definition: winuser.h:1726
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by IDeskDisplayAdapter_AddPages().

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinstDLL,
DWORD  dwReason,
LPVOID  lpvReserved 
)

Definition at line 613 of file deskadp.c.

616 {
617  switch (dwReason)
618  {
619  case DLL_PROCESS_ATTACH:
620  hInstance = hinstDLL;
622  break;
623  }
624 
625  return TRUE;
626 }
#define TRUE
Definition: types.h:120
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
DWORD dwReason
Definition: misc.cpp:154
static HINSTANCE hInstance
Definition: deskadp.c:10

◆ GetColorDescription()

static VOID GetColorDescription ( PDEVMODEW  lpDevMode,
LPTSTR  lpBuffer,
DWORD  dwBufferLen 
)
static

Definition at line 15 of file deskadp.c.

18 {
19  UINT uid = 0;
20 
21  switch (lpDevMode->dmBitsPerPel)
22  {
23  case 4:
24  uid = IDS_4BPP;
25  break;
26  case 8:
27  uid = IDS_8BPP;
28  break;
29  case 15:
30  uid = IDS_15BPP;
31  break;
32  case 16:
33  uid = IDS_16BPP;
34  break;
35  case 24:
36  uid = IDS_24BPP;
37  break;
38  case 32:
39  uid = IDS_32BPP;
40  break;
41  }
42 
43  if (uid == 0 ||
45  uid,
46  lpBuffer,
47  dwBufferLen))
48  {
49  lpBuffer[0] = TEXT('\0');
50  }
51 }
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
#define IDS_4BPP
Definition: resource.h:21
#define IDS_15BPP
Definition: resource.h:23
static _In_ DWORD _Inout_ PDEVMODEA lpDevMode
Definition: dispmode.c:77
#define IDS_16BPP
Definition: resource.h:24
#define IDS_24BPP
Definition: resource.h:25
DWORD dmBitsPerPel
Definition: wingdi.h:1595
#define TEXT(s)
Definition: k32.h:26
unsigned int UINT
Definition: ndis.h:50
#define IDS_32BPP
Definition: resource.h:26
#define LoadString
Definition: winuser.h:5799
#define IDS_8BPP
Definition: resource.h:22
static HINSTANCE hInstance
Definition: deskadp.c:10

Referenced by InitListAllModesDialog().

◆ GetRefreshRateDescription()

static VOID GetRefreshRateDescription ( PDEVMODEW  lpDevMode,
LPTSTR  lpBuffer,
DWORD  dwBufferLen 
)
static

Definition at line 54 of file deskadp.c.

57 {
58  TCHAR szFormat[64];
59 
60  if (lpDevMode->dmDisplayFrequency <= 1)
61  {
62  if (!LoadString(hInstance,
64  lpBuffer,
65  dwBufferLen))
66  {
67  lpBuffer[0] = TEXT('\0');
68  }
69  }
70  else
71  {
72  if (!LoadString(hInstance,
74  szFormat,
75  sizeof(szFormat) / sizeof(szFormat[0])))
76  {
77  szFormat[0] = TEXT('\0');
78  }
79 
81  dwBufferLen,
82  szFormat,
84  }
85 }
DWORD dmDisplayFrequency
Definition: wingdi.h:1602
#define IDES_REFRESHRATEFMT
Definition: resource.h:20
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
static _In_ DWORD _Inout_ PDEVMODEA lpDevMode
Definition: dispmode.c:77
char TCHAR
Definition: xmlstorage.h:189
#define _sntprintf
Definition: xmlstorage.h:201
#define TEXT(s)
Definition: k32.h:26
#define LoadString
Definition: winuser.h:5799
#define IDS_DEFREFRESHRATE
Definition: resource.h:19
static HINSTANCE hInstance
Definition: deskadp.c:10

Referenced by InitListAllModesDialog().

◆ IDeskDisplayAdapter_AddPages()

HRESULT IDeskDisplayAdapter_AddPages ( PDESKDISPLAYADAPTER  This,
LPFNADDPROPSHEETPAGE  pfnAddPage,
LPARAM  lParam 
)

Definition at line 550 of file deskadp.c.

553 {
554  HPROPSHEETPAGE hpsp;
555  PROPSHEETPAGE psp;
556 
557  DPRINT1("IDeskDisplayAdapter::AddPages(%p,%p)\n", pfnAddPage, lParam);
558 
559  psp.dwSize = sizeof(psp);
560  psp.dwFlags = PSP_DEFAULT;
561  psp.hInstance = hInstance;
562  psp.pszTemplate = MAKEINTRESOURCE(IDD_DISPLAYADAPTER);
563  psp.pfnDlgProc = DisplayAdapterDlgProc;
564  psp.lParam = (LPARAM)This;
565 
566  hpsp = CreatePropertySheetPage(&psp);
567  if (hpsp != NULL && pfnAddPage(hpsp, lParam))
568  return S_OK;
569 
570  return S_FALSE;
571 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDD_DISPLAYADAPTER
Definition: resource.h:3
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
#define S_FALSE
Definition: winerror.h:2357
LONG_PTR LPARAM
Definition: windef.h:208
#define CreatePropertySheetPage
Definition: prsht.h:399
static INT_PTR CALLBACK DisplayAdapterDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: deskadp.c:376
#define PSP_DEFAULT
Definition: prsht.h:22
#define S_OK
Definition: intsafe.h:52
#define NULL
Definition: types.h:112
#define DPRINT1
Definition: precomp.h:8
LPARAM lParam
Definition: combotst.c:139
#define PROPSHEETPAGE
Definition: prsht.h:389
static HINSTANCE hInstance
Definition: deskadp.c:10

Referenced by IDeskDisplayAdapter_IShellPropSheetExt_AddPages().

◆ IDeskDisplayAdapter_AddRef()

ULONG IDeskDisplayAdapter_AddRef ( PDESKDISPLAYADAPTER  This)

Definition at line 463 of file deskadp.c.

464 {
465  ULONG ret;
466 
468  if (ret == 1)
470 
471  return ret;
472 }
DECLSPEC_HIDDEN LONG dll_refs
Definition: devenum_main.c:28
int ret
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1
signed int * PLONG
Definition: retypes.h:5

Referenced by IDeskDisplayAdapter_IClassFactory_AddRef(), IDeskDisplayAdapter_InitIface(), IDeskDisplayAdapter_IShellExtInit_AddRef(), IDeskDisplayAdapter_IShellPropSheetExt_AddRef(), and IDeskDisplayAdapter_QueryInterface().

◆ IDeskDisplayAdapter_Constructor()

HRESULT IDeskDisplayAdapter_Constructor ( REFIID  riid,
LPVOID ppv 
)

Definition at line 584 of file deskadp.c.

586 {
588  HRESULT hRet = E_OUTOFMEMORY;
589 
590  DPRINT1("IDeskDisplayAdapter::Constructor(%p,%p)\n", riid, ppv);
591 
593  0,
594  sizeof(*This));
595  if (This != NULL)
596  {
598  sizeof(*This));
599 
601 
603  riid,
604  ppv);
605  if (!SUCCEEDED(hRet))
607  }
608 
609  return hRet;
610 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define ZeroMemory
Definition: winbase.h:1667
HRESULT STDMETHODCALLTYPE IDeskDisplayAdapter_QueryInterface(PDESKDISPLAYADAPTER This, REFIID iid, PVOID *pvObject)
Definition: deskadp.c:494
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
if SUCCEEDED(hr)
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:79
ULONG IDeskDisplayAdapter_Release(PDESKDISPLAYADAPTER This)
Definition: deskadp.c:475
VOID IDeskDisplayAdapter_InitIface(PDESKDISPLAYADAPTER This)
Definition: shxiface.c:176
#define NULL
Definition: types.h:112
#define DPRINT1
Definition: precomp.h:8

Referenced by DllGetClassObject(), and IDeskDisplayAdapter_IClassFactory_CreateInstance().

◆ IDeskDisplayAdapter_Destroy()

static VOID IDeskDisplayAdapter_Destroy ( PDESKDISPLAYADAPTER  This)
static

Definition at line 441 of file deskadp.c.

442 {
443  if (This->pdtobj != NULL)
444  {
445  IDataObject_Release(This->pdtobj);
446  This->pdtobj = NULL;
447  }
448 
449  if (This->DeskExtInterface != NULL)
450  {
451  LocalFree((HLOCAL)This->DeskExtInterface);
452  This->DeskExtInterface = NULL;
453  }
454 
455  if (This->lpDeviceId != NULL)
456  {
457  LocalFree((HLOCAL)This->lpDeviceId);
458  This->lpDeviceId = NULL;
459  }
460 }
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define NULL
Definition: types.h:112

Referenced by IDeskDisplayAdapter_Release().

◆ IDeskDisplayAdapter_Initialize()

HRESULT IDeskDisplayAdapter_Initialize ( PDESKDISPLAYADAPTER  This,
LPCITEMIDLIST  pidlFolder,
IDataObject pdtobj,
HKEY  hkeyProgID 
)

Definition at line 528 of file deskadp.c.

532 {
533  DPRINT1("IDeskDisplayAdapter::Initialize(%p,%p,%p)\n", pidlFolder, pdtobj, hkeyProgID);
534 
535  if (pdtobj != NULL)
536  {
537  IDataObject_AddRef(pdtobj);
538  This->pdtobj = pdtobj;
539 
540  /* Get a copy of the desk.cpl extension interface */
541  This->DeskExtInterface = QueryDeskCplExtInterface(This->pdtobj);
542  if (This->DeskExtInterface != NULL)
543  return S_OK;
544  }
545 
546  return S_FALSE;
547 }
static __inline PDESK_EXT_INTERFACE QueryDeskCplExtInterface(IDataObject *pdo)
Definition: deskcplx.h:48
#define S_FALSE
Definition: winerror.h:2357
#define S_OK
Definition: intsafe.h:52
#define NULL
Definition: types.h:112
#define DPRINT1
Definition: precomp.h:8

Referenced by IDeskDisplayAdapter_IShellExtInit_Initialize().

◆ IDeskDisplayAdapter_QueryInterface()

HRESULT STDMETHODCALLTYPE IDeskDisplayAdapter_QueryInterface ( PDESKDISPLAYADAPTER  This,
REFIID  iid,
PVOID pvObject 
)

Definition at line 494 of file deskadp.c.

497 {
498  *pvObject = NULL;
499 
500  if (IsEqualIID(iid,
501  &IID_IShellPropSheetExt) ||
502  IsEqualIID(iid,
503  &IID_IUnknown))
504  {
506  }
507  else if (IsEqualIID(iid,
508  &IID_IShellExtInit))
509  {
510  *pvObject = impl_to_interface(This, IShellExtInit);
511  }
512  else if (IsEqualIID(iid,
514  {
515  *pvObject = impl_to_interface(This, IClassFactory);
516  }
517  else
518  {
519  DPRINT1("IDeskDisplayAdapter::QueryInterface(%p,%p): E_NOINTERFACE\n", iid, pvObject);
520  return E_NOINTERFACE;
521  }
522 
524  return S_OK;
525 }
#define E_NOINTERFACE
Definition: winerror.h:2364
ULONG IDeskDisplayAdapter_AddRef(PDESKDISPLAYADAPTER This)
Definition: deskadp.c:463
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:52
#define impl_to_interface(impl, iface)
Definition: dwnl.c:35
#define NULL
Definition: types.h:112
#define DPRINT1
Definition: precomp.h:8
const GUID IID_IClassFactory
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

Referenced by IDeskDisplayAdapter_Constructor(), IDeskDisplayAdapter_IClassFactory_QueryInterface(), IDeskDisplayAdapter_IShellExtInit_QueryInterface(), and IDeskDisplayAdapter_IShellPropSheetExt_QueryInterface().

◆ IDeskDisplayAdapter_Release()

ULONG IDeskDisplayAdapter_Release ( PDESKDISPLAYADAPTER  This)

Definition at line 475 of file deskadp.c.

476 {
477  ULONG ret;
478 
480  if (ret == 0)
481  {
484 
486  0,
487  This);
488  }
489 
490  return ret;
491 }
DECLSPEC_HIDDEN LONG dll_refs
Definition: devenum_main.c:28
static VOID IDeskDisplayAdapter_Destroy(PDESKDISPLAYADAPTER This)
Definition: deskadp.c:441
#define GetProcessHeap()
Definition: compat.h:595
int ret
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1
signed int * PLONG
Definition: retypes.h:5
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by IDeskDisplayAdapter_Constructor(), IDeskDisplayAdapter_IClassFactory_Release(), IDeskDisplayAdapter_IShellExtInit_Release(), and IDeskDisplayAdapter_IShellPropSheetExt_Release().

◆ IDeskDisplayAdapter_ReplacePage()

HRESULT IDeskDisplayAdapter_ReplacePage ( PDESKDISPLAYADAPTER  This,
EXPPS  uPageID,
LPFNADDPROPSHEETPAGE  pfnReplacePage,
LPARAM  lParam 
)

Definition at line 574 of file deskadp.c.

578 {
579  DPRINT1("IDeskDisplayAdapter::ReplacePage(%u,%p,%p)\n", uPageID, pfnReplacePage, lParam);
580  return E_NOTIMPL;
581 }
#define E_NOTIMPL
Definition: ddrawi.h:99
#define DPRINT1
Definition: precomp.h:8
LPARAM lParam
Definition: combotst.c:139

Referenced by IDeskDisplayAdapter_IShellPropSheetExt_ReplacePage().

◆ InitDisplayAdapterDialog()

static VOID InitDisplayAdapterDialog ( PDESKDISPLAYADAPTER  This)
static

Definition at line 291 of file deskadp.c.

292 {
293  LPTSTR lpAdapterName;
294 
295  This->lpDeviceId = QueryDeskCplString(This->pdtobj,
297  EnableWindow(GetDlgItem(This->hwndDlg,
299  This->lpDeviceId != NULL && This->lpDeviceId[0] != TEXT('\0'));
300  lpAdapterName = QueryDeskCplString(This->pdtobj,
302  if (lpAdapterName != NULL)
303  {
304  SetDlgItemText(This->hwndDlg,
306  lpAdapterName);
307 
308  LocalFree((HLOCAL)lpAdapterName);
309  }
310 
311  if (This->DeskExtInterface != NULL)
312  {
313  SetDlgItemTextW(This->hwndDlg,
314  IDC_CHIPTYPE,
315  This->DeskExtInterface->ChipType);
316  SetDlgItemTextW(This->hwndDlg,
317  IDC_DACTYPE,
318  This->DeskExtInterface->DacType);
319  SetDlgItemTextW(This->hwndDlg,
321  This->DeskExtInterface->MemorySize);
322  SetDlgItemTextW(This->hwndDlg,
324  This->DeskExtInterface->AdapterString);
325  SetDlgItemTextW(This->hwndDlg,
327  This->DeskExtInterface->BiosString);
328 
329  This->lpDevModeOnInit = This->DeskExtInterface->GetCurrentMode(This->DeskExtInterface->Context);
330  }
331  else
332  This->lpDevModeOnInit = NULL;
333 
334  This->lpSelDevMode = This->lpDevModeOnInit;
335 }
#define IDC_MEMORYSIZE
Definition: resource.h:10
#define DESK_EXT_DISPLAYNAME
Definition: deskcplx.h:9
#define IDC_ADAPTERSTRING
Definition: resource.h:11
#define DESK_EXT_DISPLAYID
Definition: deskcplx.h:10
CHAR * LPTSTR
Definition: xmlstorage.h:192
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define IDC_CHIPTYPE
Definition: resource.h:8
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define SetDlgItemText
Definition: winuser.h:5829
#define IDC_ADAPTERNAME
Definition: resource.h:6
#define RegisterClipboardFormat
Definition: winuser.h:5818
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define TEXT(s)
Definition: k32.h:26
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define NULL
Definition: types.h:112
#define IDC_ADAPTERPROPERTIES
Definition: resource.h:7
static __inline LPTSTR QueryDeskCplString(IDataObject *pdo, UINT cfFormat)
Definition: deskcplx.h:84
#define IDC_DACTYPE
Definition: resource.h:9
#define IDC_BIOSINFORMATION
Definition: resource.h:12

Referenced by DisplayAdapterDlgProc().

◆ InitListAllModesDialog()

static VOID InitListAllModesDialog ( PDESKDISPLAYADAPTER  This,
HWND  hwndListAllModesDlg 
)
static

Definition at line 88 of file deskadp.c.

90 {
91  TCHAR szFormat[64], szBuffer[64], szColors[64], szRefreshRate[64];
92  PDEVMODEW lpDevMode, lpCurrentDevMode;
93  DWORD dwIndex = 0;
94  INT i;
95 
96  if (This->DeskExtInterface != NULL)
97  {
98  if (!LoadString(hInstance,
100  szFormat,
101  sizeof(szFormat) / sizeof(szFormat[0])))
102  {
103  szFormat[0] = TEXT('\0');
104  }
105 
106  lpCurrentDevMode = This->DeskExtInterface->GetCurrentMode(This->DeskExtInterface->Context);
107 
108  do
109  {
110  lpDevMode = This->DeskExtInterface->EnumAllModes(This->DeskExtInterface->Context,
111  dwIndex++);
112  if (lpDevMode != NULL)
113  {
115  szColors,
116  sizeof(szColors) / sizeof(szColors[0]));
117 
119  szRefreshRate,
120  sizeof(szRefreshRate) / sizeof(szRefreshRate[0]));
121 
122  _sntprintf(szBuffer,
123  sizeof(szBuffer) / sizeof(szBuffer[0]),
124  szFormat,
127  szColors,
128  szRefreshRate);
129 
130  i = (INT)SendDlgItemMessage(hwndListAllModesDlg,
132  LB_ADDSTRING,
133  0,
134  (LPARAM)szBuffer);
135  if (i >= 0)
136  {
137  SendDlgItemMessage(hwndListAllModesDlg,
140  (WPARAM)i,
141  (LPARAM)lpDevMode);
142 
143  if (lpDevMode == lpCurrentDevMode)
144  {
145  SendDlgItemMessage(hwndListAllModesDlg,
147  LB_SETCURSEL,
148  (WPARAM)i,
149  0);
150  }
151  }
152  }
153 
154  } while (lpDevMode != NULL);
155  }
156 }
#define LB_SETCURSEL
Definition: winuser.h:2050
#define LB_ADDSTRING
Definition: winuser.h:2018
#define INT
Definition: polytest.cpp:20
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5822
int32_t INT
Definition: typedefs.h:58
LONG_PTR LPARAM
Definition: windef.h:208
static _In_ DWORD _Inout_ PDEVMODEA lpDevMode
Definition: dispmode.c:77
static VOID GetColorDescription(PDEVMODEW lpDevMode, LPTSTR lpBuffer, DWORD dwBufferLen)
Definition: deskadp.c:15
char TCHAR
Definition: xmlstorage.h:189
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IDS_MODEFMT
Definition: resource.h:18
DWORD dmPelsHeight
Definition: wingdi.h:1597
#define LB_SETITEMDATA
Definition: winuser.h:2052
#define _sntprintf
Definition: xmlstorage.h:201
#define TEXT(s)
Definition: k32.h:26
#define IDC_ALLVALIDMODES
Definition: resource.h:16
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
#define NULL
Definition: types.h:112
#define LoadString
Definition: winuser.h:5799
static VOID GetRefreshRateDescription(PDEVMODEW lpDevMode, LPTSTR lpBuffer, DWORD dwBufferLen)
Definition: deskadp.c:54
static HINSTANCE hInstance
Definition: deskadp.c:10
DWORD dmPelsWidth
Definition: wingdi.h:1596

Referenced by ListAllModesDlgProc().

◆ ListAllModesDlgProc()

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

Definition at line 191 of file deskadp.c.

195 {
197  INT_PTR Ret = 0;
198 
199  if (uMsg != WM_INITDIALOG)
200  {
202  }
203 
204  switch (uMsg)
205  {
206  case WM_INITDIALOG:
209 
211  hwndDlg);
212  Ret = TRUE;
213  break;
214 
215  case WM_COMMAND:
216  switch (LOWORD(wParam))
217  {
218  case IDOK:
220  hwndDlg))
221  {
222  EndDialog(hwndDlg,
223  IDOK);
224  }
225  break;
226 
227  case IDCANCEL:
228  EndDialog(hwndDlg,
229  IDCANCEL);
230  break;
231  }
232  break;
233 
234  case WM_CLOSE:
235  EndDialog(hwndDlg,
236  IDCANCEL);
237  break;
238  }
239 
240  return Ret;
241 }
#define IDOK
Definition: winuser.h:824
static VOID InitListAllModesDialog(PDESKDISPLAYADAPTER This, HWND hwndListAllModesDlg)
Definition: deskadp.c:88
#define TRUE
Definition: types.h:120
int32_t INT_PTR
Definition: typedefs.h:64
#define SetWindowLongPtr
Definition: treelist.c:70
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
static BOOL ChangeSelectedMode(PDESKDISPLAYADAPTER This, HWND hwndListAllModesDlg)
Definition: deskadp.c:159
#define WM_CLOSE
Definition: winuser.h:1608
struct _DESKDISPLAYADAPTER * PDESKDISPLAYADAPTER
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1727
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1726
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

Referenced by ShowListAllModes().

◆ ResetDisplayAdapterChanges()

static VOID ResetDisplayAdapterChanges ( PDESKDISPLAYADAPTER  This)
static

Definition at line 366 of file deskadp.c.

367 {
368  if (This->DeskExtInterface != NULL && This->lpDevModeOnInit != NULL)
369  {
370  This->DeskExtInterface->SetCurrentMode(This->DeskExtInterface->Context,
371  This->lpDevModeOnInit);
372  }
373 }
#define NULL
Definition: types.h:112

Referenced by DisplayAdapterDlgProc().

◆ ShowAdapterProperties()

static VOID ShowAdapterProperties ( PDESKDISPLAYADAPTER  This)
static

Definition at line 268 of file deskadp.c.

269 {
270  HMODULE hDevMgr;
271  PDEVICEPROPERTIESW pDevicePropertiesW;
272 
273  hDevMgr = LoadLibrary(TEXT("devmgr.dll"));
274  if (hDevMgr != NULL)
275  {
276  pDevicePropertiesW = (PDEVICEPROPERTIESW)GetProcAddress(hDevMgr,
277  "DevicePropertiesW");
278  if (pDevicePropertiesW != NULL)
279  {
280  pDevicePropertiesW(This->hwndDlg,
281  NULL,
282  This->lpDeviceId,
283  FALSE);
284  }
285 
286  FreeLibrary(hDevMgr);
287  }
288 }
#define LoadLibrary
Definition: winbase.h:3723
#define FALSE
Definition: types.h:117
INT_PTR(WINAPI * PDEVICEPROPERTIESW)(HWND, LPCWSTR, LPCWSTR, BOOL)
Definition: deskadp.c:12
#define FreeLibrary(x)
Definition: compat.h:607
#define TEXT(s)
Definition: k32.h:26
#define NULL
Definition: types.h:112
#define GetProcAddress(x, y)
Definition: compat.h:612

Referenced by DisplayAdapterDlgProc().

◆ ShowListAllModes()

static VOID ShowListAllModes ( PDESKDISPLAYADAPTER  This)
static

Definition at line 244 of file deskadp.c.

245 {
246  PDEVMODEW lpPrevSel;
247 
248  lpPrevSel = This->lpSelDevMode;
249 
250  if (This->DeskExtInterface != NULL &&
253  This->hwndDlg,
255  (LPARAM)This) == IDOK)
256  {
257  if (lpPrevSel != This->lpSelDevMode)
258  {
260  This->hwndDlg);
261  This->DeskExtInterface->SetCurrentMode(This->DeskExtInterface->Context,
262  This->lpSelDevMode);
263  }
264  }
265 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDOK
Definition: winuser.h:824
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
static INT_PTR CALLBACK ListAllModesDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: deskadp.c:191
LONG_PTR LPARAM
Definition: windef.h:208
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define DialogBoxParam
Definition: winuser.h:5744
HWND WINAPI GetParent(_In_ HWND)
#define NULL
Definition: types.h:112
#define IDD_LISTALLMODES
Definition: resource.h:4
static HINSTANCE hInstance
Definition: deskadp.c:10

Referenced by DisplayAdapterDlgProc().

Variable Documentation

◆ hInstance