ReactOS  0.4.13-dev-455-g28ed234
precomp.h File Reference
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <ole2.h>
#include <objsel.h>
#include <aclui.h>
#include <ndk/rtlfuncs.h>
Include dependency graph for precomp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _ACE_ENTRY
 
struct  _PRINCIPAL_LISTITEM
 
struct  _SECURITY_PAGE
 
struct  _NMCHANGEITEMCHECKBOX
 
struct  _SIDREQRESULT
 

Macros

#define _ACLUI_
 
#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COM_NO_WINDOWS_H
 
#define NTOS_MODE_USER
 
#define EnableRedrawWindow(hwnd)   SendMessage((hwnd), WM_SETREDRAW, TRUE, 0)
 
#define DisableRedrawWindow(hwnd)   SendMessage((hwnd), WM_SETREDRAW, FALSE, 0)
 
#define CIS_DENYDISABLED   (0x8)
 
#define CIS_DENYENABLED   (0x0)
 
#define CIS_ALLOWDISABLED   (0x4)
 
#define CIS_ALLOWENABLED   (0x0)
 
#define CIS_ALLOW   (0x2)
 
#define CIS_DENY   (0x1)
 
#define CIS_NONE   (0x0)
 
#define CIS_DISABLED   (CIS_ALLOWDISABLED | CIS_DENYDISABLED)
 
#define CLB_ALLOW   (0x1)
 
#define CLB_DENY   (0x0)
 
#define CIS_MASK   (CIS_DISABLED | CIS_ALLOW | CIS_DENY)
 
#define CLM_ADDITEM   (WM_USER + 1)
 
#define CLM_DELITEM   (WM_USER + 2)
 
#define CLM_GETITEMCOUNT   (WM_USER + 3)
 
#define CLM_CLEAR   (WM_USER + 4)
 
#define CLM_SETCHECKBOXCOLUMN   (WM_USER + 5)
 
#define CLM_GETCHECKBOXCOLUMN   (WM_USER + 6)
 
#define CLM_CLEARCHECKBOXES   (WM_USER + 7)
 
#define CLM_SETITEMSTATE   (WM_USER + 8)
 
#define CLM_ENABLEQUICKSEARCH   (WM_USER + 9)
 
#define CLM_SETQUICKSEARCH_TIMEOUT_RESET   (WM_USER + 10)
 
#define CLM_SETQUICKSEARCH_TIMEOUT_SETFOCUS   (WM_USER + 11)
 
#define CLM_FINDITEMBYACCESSMASK   (WM_USER + 12)
 
#define CLN_CHANGINGITEMCHECKBOX   (101)
 

Typedefs

typedef struct _ACE_ENTRY ACE_ENTRY
 
typedef struct _ACE_ENTRYPACE_ENTRY
 
typedef struct _PRINCIPAL_LISTITEM PRINCIPAL_LISTITEM
 
typedef struct _PRINCIPAL_LISTITEMPPRINCIPAL_LISTITEM
 
typedef struct _SECURITY_PAGE SECURITY_PAGE
 
typedef struct _SECURITY_PAGEPSECURITY_PAGE
 
typedef BOOL(* POBJPICK_SELECTED_SID) (IN IDsObjectPicker *pDsObjectPicker, IN HWND hwndParent OPTIONAL, IN PSID pSid, IN PVOID Context OPTIONAL)
 
typedef struct _NMCHANGEITEMCHECKBOX NMCHANGEITEMCHECKBOX
 
typedef struct _NMCHANGEITEMCHECKBOXPNMCHANGEITEMCHECKBOX
 
typedef struct _SIDREQRESULT SIDREQRESULT
 
typedef struct _SIDREQRESULTPSIDREQRESULT
 
typedef VOID(* PSIDREQCOMPLETIONPROC) (IN HANDLE SidCacheMgr, IN PSID Sid, IN PSIDREQRESULT SidRequestResult, IN PVOID Context)
 

Functions

DWORD LoadAndFormatString (IN HINSTANCE hInstance, IN UINT uID, OUT LPWSTR *lpTarget,...)
 
LPARAM ListViewGetSelectedItemData (IN HWND hwnd)
 
BOOL ListViewSelectItem (IN HWND hwnd, IN INT Index)
 
HRESULT InitializeObjectPicker (IN PCWSTR ServerName, IN PSI_OBJECT_INFO ObjectInfo, OUT IDsObjectPicker **pDsObjectPicker)
 
VOID FreeObjectPicker (IN IDsObjectPicker *pDsObjectPicker)
 
HRESULT InvokeObjectPickerDialog (IN IDsObjectPicker *pDsObjectPicker, IN HWND hwndParent OPTIONAL, IN POBJPICK_SELECTED_SID SelectedSidCallback, IN PVOID Context OPTIONAL)
 
BOOL RegisterCheckListControl (HINSTANCE hInstance)
 
VOID UnregisterCheckListControl (HINSTANCE hInstance)
 
BOOL WINAPI DllMain (IN HINSTANCE hinstDLL, IN DWORD dwReason, IN LPVOID lpvReserved)
 
HANDLE CreateSidCacheMgr (IN HANDLE Heap, IN LPCWSTR SystemName)
 
VOID DestroySidCacheMgr (IN HANDLE SidCacheMgr)
 
VOID DequeueSidLookup (IN HANDLE SidCacheMgr, IN PSID pSid)
 
BOOL LookupSidCache (IN HANDLE SidCacheMgr, IN PSID pSid, IN PSIDREQCOMPLETIONPROC CompletionProc, IN PVOID Context)
 
VOID ReferenceSidReqResult (IN HANDLE SidCacheMgr, IN PSIDREQRESULT ReqResult)
 
VOID DereferenceSidReqResult (IN HANDLE SidCacheMgr, IN PSIDREQRESULT ReqResult)
 

Variables

HINSTANCE hDllInstance
 

Macro Definition Documentation

◆ _ACLUI_

#define _ACLUI_

Definition at line 4 of file precomp.h.

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 9 of file precomp.h.

◆ CIS_ALLOW

#define CIS_ALLOW   (0x2)

Definition at line 117 of file precomp.h.

◆ CIS_ALLOWDISABLED

#define CIS_ALLOWDISABLED   (0x4)

Definition at line 115 of file precomp.h.

◆ CIS_ALLOWENABLED

#define CIS_ALLOWENABLED   (0x0)

Definition at line 116 of file precomp.h.

◆ CIS_DENY

#define CIS_DENY   (0x1)

Definition at line 118 of file precomp.h.

◆ CIS_DENYDISABLED

#define CIS_DENYDISABLED   (0x8)

Definition at line 113 of file precomp.h.

◆ CIS_DENYENABLED

#define CIS_DENYENABLED   (0x0)

Definition at line 114 of file precomp.h.

◆ CIS_DISABLED

#define CIS_DISABLED   (CIS_ALLOWDISABLED | CIS_DENYDISABLED)

Definition at line 120 of file precomp.h.

◆ CIS_MASK

#define CIS_MASK   (CIS_DISABLED | CIS_ALLOW | CIS_DENY)

Definition at line 125 of file precomp.h.

◆ CIS_NONE

#define CIS_NONE   (0x0)

Definition at line 119 of file precomp.h.

◆ CLB_ALLOW

#define CLB_ALLOW   (0x1)

Definition at line 122 of file precomp.h.

◆ CLB_DENY

#define CLB_DENY   (0x0)

Definition at line 123 of file precomp.h.

◆ CLM_ADDITEM

#define CLM_ADDITEM   (WM_USER + 1)

Definition at line 127 of file precomp.h.

◆ CLM_CLEAR

#define CLM_CLEAR   (WM_USER + 4)

Definition at line 130 of file precomp.h.

◆ CLM_CLEARCHECKBOXES

#define CLM_CLEARCHECKBOXES   (WM_USER + 7)

Definition at line 133 of file precomp.h.

◆ CLM_DELITEM

#define CLM_DELITEM   (WM_USER + 2)

Definition at line 128 of file precomp.h.

◆ CLM_ENABLEQUICKSEARCH

#define CLM_ENABLEQUICKSEARCH   (WM_USER + 9)

Definition at line 135 of file precomp.h.

◆ CLM_FINDITEMBYACCESSMASK

#define CLM_FINDITEMBYACCESSMASK   (WM_USER + 12)

Definition at line 138 of file precomp.h.

◆ CLM_GETCHECKBOXCOLUMN

#define CLM_GETCHECKBOXCOLUMN   (WM_USER + 6)

Definition at line 132 of file precomp.h.

◆ CLM_GETITEMCOUNT

#define CLM_GETITEMCOUNT   (WM_USER + 3)

Definition at line 129 of file precomp.h.

◆ CLM_SETCHECKBOXCOLUMN

#define CLM_SETCHECKBOXCOLUMN   (WM_USER + 5)

Definition at line 131 of file precomp.h.

◆ CLM_SETITEMSTATE

#define CLM_SETITEMSTATE   (WM_USER + 8)

Definition at line 134 of file precomp.h.

◆ CLM_SETQUICKSEARCH_TIMEOUT_RESET

#define CLM_SETQUICKSEARCH_TIMEOUT_RESET   (WM_USER + 10)

Definition at line 136 of file precomp.h.

◆ CLM_SETQUICKSEARCH_TIMEOUT_SETFOCUS

#define CLM_SETQUICKSEARCH_TIMEOUT_SETFOCUS   (WM_USER + 11)

Definition at line 137 of file precomp.h.

◆ CLN_CHANGINGITEMCHECKBOX

#define CLN_CHANGINGITEMCHECKBOX   (101)

Definition at line 140 of file precomp.h.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 10 of file precomp.h.

◆ DisableRedrawWindow

#define DisableRedrawWindow (   hwnd)    SendMessage((hwnd), WM_SETREDRAW, FALSE, 0)

Definition at line 24 of file precomp.h.

◆ EnableRedrawWindow

#define EnableRedrawWindow (   hwnd)    SendMessage((hwnd), WM_SETREDRAW, TRUE, 0)

Definition at line 21 of file precomp.h.

◆ NTOS_MODE_USER

#define NTOS_MODE_USER

Definition at line 18 of file precomp.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 8 of file precomp.h.

Typedef Documentation

◆ ACE_ENTRY

◆ NMCHANGEITEMCHECKBOX

◆ PACE_ENTRY

◆ PNMCHANGEITEMCHECKBOX

◆ POBJPICK_SELECTED_SID

typedef BOOL(* POBJPICK_SELECTED_SID) (IN IDsObjectPicker *pDsObjectPicker, IN HWND hwndParent OPTIONAL, IN PSID pSid, IN PVOID Context OPTIONAL)

Definition at line 100 of file precomp.h.

◆ PPRINCIPAL_LISTITEM

◆ PRINCIPAL_LISTITEM

◆ PSECURITY_PAGE

◆ PSIDREQCOMPLETIONPROC

typedef VOID(* PSIDREQCOMPLETIONPROC) (IN HANDLE SidCacheMgr, IN PSID Sid, IN PSIDREQRESULT SidRequestResult, IN PVOID Context)

Definition at line 175 of file precomp.h.

◆ PSIDREQRESULT

◆ SECURITY_PAGE

◆ SIDREQRESULT

Function Documentation

◆ CreateSidCacheMgr()

HANDLE CreateSidCacheMgr ( IN HANDLE  Heap,
IN LPCWSTR  SystemName 
)

Definition at line 590 of file sidcache.c.

592 {
593  PSIDCACHEMGR scm;
594 
595  if (SystemName == NULL)
596  SystemName = L"";
597 
598  scm = HeapAlloc(Heap,
599  0,
601  SystemName[wcslen(SystemName) + 1]));
602  if (scm != NULL)
603  {
604  /* zero the static part of the structure */
605  ZeroMemory(scm,
607  SystemName));
608 
609  scm->RefCount = 1;
610  scm->Heap = Heap;
611 
612  wcscpy(scm->SystemName,
613  SystemName);
614 
618 
620  FALSE,
621  FALSE,
622  NULL);
623  if (scm->LookupEvent == NULL)
624  {
625  goto Cleanup;
626  }
627 
630  &scm->LsaHandle))
631  {
632  goto Cleanup;
633  }
634 
636  0,
638  scm,
639  0,
640  NULL);
641  if (scm->LookupThread == NULL)
642  {
643 Cleanup:
644  if (scm->LookupEvent != NULL)
645  {
646  CloseHandle(scm->LookupEvent);
647  }
648 
649  if (scm->LsaHandle != NULL)
650  {
651  LsaClose(scm->LsaHandle);
652  }
653 
654  HeapFree(Heap,
655  0,
656  scm);
657  scm = NULL;
658  }
659  }
660  else
661  {
663  }
664 
665  return (HANDLE)scm;
666 }
#define CreateEvent
Definition: winbase.h:3562
LIST_ENTRY QueueListHead
Definition: sidcache.c:44
HANDLE LookupThread
Definition: sidcache.c:49
#define CloseHandle
Definition: compat.h:398
volatile LONG RefCount
Definition: sidcache.c:41
#define POLICY_VIEW_LOCAL_INFORMATION
Definition: ntsecapi.h:61
static DWORD WINAPI LookupThreadProc(IN LPVOID lpParameter)
Definition: sidcache.c:449
NTSTATUS WINAPI LsaClose(IN LSA_HANDLE ObjectHandle)
Definition: lsa.c:192
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
static BOOL OpenLSAPolicyHandle(IN LPWSTR SystemName, IN ACCESS_MASK DesiredAccess, OUT PLSA_HANDLE PolicyHandle)
Definition: sidcache.c:172
#define ZeroMemory
Definition: winbase.h:1635
CRITICAL_SECTION Lock
Definition: sidcache.c:43
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:111
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:697
smooth NULL
Definition: ftsmooth.c:416
#define POLICY_LOOKUP_NAMES
Definition: ntsecapi.h:72
LSA_HANDLE LsaHandle
Definition: sidcache.c:42
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define SetLastError(x)
Definition: compat.h:409
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
static const WCHAR Cleanup[]
Definition: register.c:80
HANDLE Heap
Definition: sidcache.c:47
LIST_ENTRY CacheListHead
Definition: sidcache.c:46
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
WCHAR SystemName[1]
Definition: sidcache.c:50
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:394
HANDLE LookupEvent
Definition: sidcache.c:48

Referenced by CreateSecurityPage().

◆ DequeueSidLookup()

VOID DequeueSidLookup ( IN HANDLE  SidCacheMgr,
IN PSID  pSid 
)

Definition at line 786 of file sidcache.c.

788 {
789  PLIST_ENTRY CurrentEntry;
790  PSIDQUEUEENTRY QueueEntry;
791  PSIDCACHEMGR scm;
792 
793  scm = ReferenceSidCacheMgr(SidCacheMgr);
794  if (scm != NULL)
795  {
796  EnterCriticalSection(&scm->Lock);
797 
798  if (scm->QueueLookingUp != NULL &&
799  EqualSid(pSid,
800  (PSID)(scm->QueueLookingUp + 1)))
801  {
802  /* don't free the queue lookup item! this will be
803  done in the lookup thread */
804  scm->QueueLookingUp = NULL;
805  }
806  else
807  {
808  CurrentEntry = &scm->QueueListHead;
809  while (CurrentEntry != &scm->QueueListHead)
810  {
811  QueueEntry = CONTAINING_RECORD(CurrentEntry,
813  ListEntry);
814 
815  if (EqualSid(pSid,
816  (PSID)(QueueEntry + 1)))
817  {
818  FreeQueueEntry(scm,
819  QueueEntry);
820  break;
821  }
822 
823  CurrentEntry = CurrentEntry->Flink;
824  }
825  }
826 
827  LeaveCriticalSection(&scm->Lock);
828 
830  }
831 }
LIST_ENTRY QueueListHead
Definition: sidcache.c:44
static VOID DereferenceSidCacheMgr(IN PSIDCACHEMGR scm)
Definition: sidcache.c:161
BOOL WINAPI EqualSid(PSID pSid1, PSID pSid2)
Definition: security.c:708
CRITICAL_SECTION Lock
Definition: sidcache.c:43
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static VOID FreeQueueEntry(IN PSIDCACHEMGR scm, IN PSIDQUEUEENTRY QueueEntry)
Definition: sidcache.c:81
smooth NULL
Definition: ftsmooth.c:416
struct _SIDQUEUEENTRY * QueueLookingUp
Definition: sidcache.c:45
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
static PSIDCACHEMGR ReferenceSidCacheMgr(IN HANDLE SidCacheMgr)
Definition: sidcache.c:147
Definition: typedefs.h:117
static PSID pSid
Definition: security.c:74
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ DereferenceSidReqResult()

VOID DereferenceSidReqResult ( IN HANDLE  SidCacheMgr,
IN PSIDREQRESULT  ReqResult 
)

Definition at line 851 of file sidcache.c.

853 {
854  PSIDCACHEMGR scm;
855 
856  scm = ReferenceSidCacheMgr(SidCacheMgr);
857  if (scm != NULL)
858  {
859  if (InterlockedDecrement(&ReqResult->RefCount) == 0)
860  {
861  HeapFree(scm->Heap,
862  0,
863  ReqResult);
864  }
865 
867  }
868 }
static VOID DereferenceSidCacheMgr(IN PSIDCACHEMGR scm)
Definition: sidcache.c:161
smooth NULL
Definition: ftsmooth.c:416
static PSIDCACHEMGR ReferenceSidCacheMgr(IN HANDLE SidCacheMgr)
Definition: sidcache.c:147
#define InterlockedDecrement
Definition: armddk.h:52
HANDLE Heap
Definition: sidcache.c:47
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by FreePrincipalsList(), LookupSidCache(), LookupThreadProc(), and UpdatePrincipalListItem().

◆ DestroySidCacheMgr()

VOID DestroySidCacheMgr ( IN HANDLE  SidCacheMgr)

Definition at line 670 of file sidcache.c.

671 {
672  PSIDCACHEMGR scm = HandleToScm(SidCacheMgr);
673 
674  if (scm != NULL)
675  {
676  /* remove the keep-alive reference */
678  }
679 }
static VOID DereferenceSidCacheMgr(IN PSIDCACHEMGR scm)
Definition: sidcache.c:161
smooth NULL
Definition: ftsmooth.c:416
#define HandleToScm(Handle)
Definition: sidcache.c:36

Referenced by CreateSecurityPage(), and DestroySecurityPage().

◆ DllMain()

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

Definition at line 83 of file kbsdll.c.

86 {
87  switch (dwReason)
88  {
89  case DLL_PROCESS_ATTACH:
90  {
91  hInstance = hinstDLL;
93  if (!hKbSwitchWnd)
94  {
95  return FALSE;
96  }
97  }
98  break;
99  }
100 
101  return TRUE;
102 }
HWND hKbSwitchWnd
Definition: kbsdll.c:13
HINSTANCE hInstance
Definition: kbsdll.c:12
#define TRUE
Definition: types.h:120
#define FindWindow
Definition: winuser.h:5643
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
DWORD dwReason
Definition: misc.cpp:154
smooth NULL
Definition: ftsmooth.c:416
TCHAR szKbSwitcherName[]
Definition: kbswitch.h:30

◆ FreeObjectPicker()

VOID FreeObjectPicker ( IN IDsObjectPicker *  pDsObjectPicker)

Definition at line 335 of file misc.c.

336 {
337  pDsObjectPicker->lpVtbl->Release(pDsObjectPicker);
338 }

◆ InitializeObjectPicker()

HRESULT InitializeObjectPicker ( IN PCWSTR  ServerName,
IN PSI_OBJECT_INFO  ObjectInfo,
OUT IDsObjectPicker **  pDsObjectPicker 
)

Definition at line 176 of file misc.c.

179 {
180  HRESULT hRet;
181 
182  *pDsObjectPicker = NULL;
183 
184  hRet = CoCreateInstance(&CLSID_DsObjectPicker,
185  NULL,
186  CLSCTX_INPROC_SERVER,
187  &IID_IDsObjectPicker,
188  (LPVOID*)pDsObjectPicker);
189  if (SUCCEEDED(hRet))
190  {
191  DSOP_INIT_INFO InitInfo;
192  UINT i;
193  static DSOP_SCOPE_INIT_INFO Scopes[] =
194  {
195  {
196  sizeof(DSOP_SCOPE_INIT_INFO),
200  {
201  {
202  0,
203  0,
204  0
205  },
208  },
209  NULL,
210  NULL,
211  S_OK
212  },
213  };
214 
215  InitInfo.cbSize = sizeof(InitInfo);
216  InitInfo.pwzTargetComputer = ServerName;
217  InitInfo.cDsScopeInfos = sizeof(Scopes) / sizeof(Scopes[0]);
218  InitInfo.aDsScopeInfos = Scopes;
219  InitInfo.flOptions = DSOP_FLAG_MULTISELECT;
220  InitInfo.cAttributesToFetch = sizeof(ObjectPickerAttributes) / sizeof(ObjectPickerAttributes[0]);
222 
223  for (i = 0; i < InitInfo.cDsScopeInfos; i++)
224  {
225  if ((ObjectInfo->dwFlags & SI_SERVER_IS_DC) &&
227  {
228  /* only set the domain controller string if we know the target
229  computer is a domain controller and the scope type is an
230  up-level domain to which the target computer is joined */
231  InitInfo.aDsScopeInfos[i].pwzDcName = InitInfo.pwzTargetComputer;
232  }
233  }
234 
235  hRet = (*pDsObjectPicker)->lpVtbl->Initialize(*pDsObjectPicker,
236  &InitInfo);
237 
238  if (FAILED(hRet))
239  {
240  /* delete the object picker in case initialization failed! */
241  (*pDsObjectPicker)->lpVtbl->Release(*pDsObjectPicker);
242  }
243  }
244 
245  return hRet;
246 }
#define DSOP_FLAG_MULTISELECT
Definition: objsel.h:104
#define DSOP_SCOPE_FLAG_DEFAULT_FILTER_GROUPS
Definition: objsel.h:87
#define SI_SERVER_IS_DC
Definition: accctrl.h:126
ULONG cAttributesToFetch
Definition: objsel.h:114
PCWSTR * apwzAttributeNames
Definition: objsel.h:115
#define DSOP_DOWNLEVEL_FILTER_ALL_WELLKNOWN_SIDS
Definition: objsel.h:68
PCWSTR pwzTargetComputer
Definition: objsel.h:110
ULONG cDsScopeInfos
Definition: objsel.h:111
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
ULONG cbSize
Definition: objsel.h:109
#define DSOP_SCOPE_FLAG_DEFAULT_FILTER_USERS
Definition: objsel.h:86
smooth NULL
Definition: ftsmooth.c:416
struct _DSOP_SCOPE_INIT_INFO DSOP_SCOPE_INIT_INFO
LONG HRESULT
Definition: typedefs.h:77
PDSOP_SCOPE_INIT_INFO aDsScopeInfos
Definition: objsel.h:112
#define DSOP_DOWNLEVEL_FILTER_LOCAL_GROUPS
Definition: objsel.h:52
#define DSOP_DOWNLEVEL_FILTER_GLOBAL_GROUPS
Definition: objsel.h:53
ULONG flOptions
Definition: objsel.h:113
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
#define S_OK
Definition: intsafe.h:59
#define DSOP_SCOPE_TYPE_UPLEVEL_JOINED_DOMAIN
Definition: objsel.h:122
#define DSOP_SCOPE_TYPE_TARGET_COMPUTER
Definition: objsel.h:121
unsigned int UINT
Definition: ndis.h:50
#define DSOP_SCOPE_FLAG_STARTING_SCOPE
Definition: objsel.h:80
#define DSOP_DOWNLEVEL_FILTER_USERS
Definition: objsel.h:51
static PCWSTR ObjectPickerAttributes[]
Definition: misc.c:34
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by SecurityPageProc().

◆ InvokeObjectPickerDialog()

HRESULT InvokeObjectPickerDialog ( IN IDsObjectPicker *  pDsObjectPicker,
IN HWND hwndParent  OPTIONAL,
IN POBJPICK_SELECTED_SID  SelectedSidCallback,
IN PVOID Context  OPTIONAL 
)

Definition at line 249 of file misc.c.

253 {
254  IDataObject *pdo = NULL;
255  HRESULT hRet;
256 
257  hRet = pDsObjectPicker->lpVtbl->InvokeDialog(pDsObjectPicker,
258  hwndParent,
259  &pdo);
260  if (hRet == S_OK)
261  {
262  STGMEDIUM stm;
263  FORMATETC fe;
264 
266  fe.ptd = NULL;
267  fe.dwAspect = DVASPECT_CONTENT;
268  fe.lindex = -1;
269  fe.tymed = TYMED_HGLOBAL;
270 
271  hRet = pdo->lpVtbl->GetData(pdo,
272  &fe,
273  &stm);
274  if (SUCCEEDED(hRet))
275  {
276  PDS_SELECTION_LIST SelectionList = (PDS_SELECTION_LIST)GlobalLock(stm.hGlobal);
277  if (SelectionList != NULL)
278  {
279  LPVARIANT vSid;
280  PSID pSid;
281  UINT i;
282  BOOL contLoop = TRUE;
283 
284  for (i = 0; i < SelectionList->cItems && contLoop; i++)
285  {
286  vSid = SelectionList->aDsSelection[i].pvarFetchedAttributes;
287 
288  if (vSid != NULL && V_VT(vSid) == (VT_ARRAY | VT_UI1))
289  {
290  hRet = SafeArrayAccessData(V_ARRAY(vSid),
291  (void **)&pSid);
292  if (FAILED(hRet))
293  {
294  break;
295  }
296 
297  if (pSid != NULL)
298  {
299  contLoop = SelectedSidCallback(pDsObjectPicker,
300  hwndParent,
301  pSid,
302  Context);
303  }
304 
306  }
307  }
308 
309  GlobalUnlock(stm.hGlobal);
310 
311  if (SUCCEEDED(hRet))
312  {
313  /* return S_OK instead of possible other success codes if
314  everything went well */
315  hRet = S_OK;
316  }
317  }
318  else
319  {
320  /* unable to translate the selection pointer handle, indicate
321  failure */
322  hRet = E_FAIL;
323  }
324 
325  ReleaseStgMedium(&stm);
326  }
327 
328  pdo->lpVtbl->Release(pdo);
329  }
330 
331  return hRet;
332 }
#define TRUE
Definition: types.h:120
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
Definition: ole2.c:2036
struct _DS_SELECTION_LIST * PDS_SELECTION_LIST
#define V_ARRAY(A)
Definition: oleauto.h:222
HRESULT GetData([in, unique] FORMATETC *pformatetcIn, [out] STGMEDIUM *pmedium)
#define E_FAIL
Definition: ddrawi.h:102
#define CFSTR_DSOP_DS_SELECTION_LIST
Definition: objsel.h:27
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
HRESULT WINAPI SafeArrayAccessData(SAFEARRAY *psa, void **ppvData)
Definition: safearray.c:1139
unsigned int BOOL
Definition: ntddk_ex.h:94
ULONG Release()
smooth NULL
Definition: ftsmooth.c:416
static HWND hwndParent
Definition: cryptui.c:300
LONG HRESULT
Definition: typedefs.h:77
VARIANT * pvarFetchedAttributes
Definition: objsel.h:138
unsigned short WORD
Definition: ntddk_ex.h:93
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
#define V_VT(A)
Definition: oleauto.h:211
DS_SELECTION aDsSelection[ANYSIZE_ARRAY]
Definition: objsel.h:146
#define RegisterClipboardFormat
Definition: winuser.h:5704
#define S_OK
Definition: intsafe.h:59
unsigned int UINT
Definition: ndis.h:50
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
static PSID pSid
Definition: security.c:74
HRESULT WINAPI SafeArrayUnaccessData(SAFEARRAY *psa)
Definition: safearray.c:1170
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by SecurityPageProc().

◆ ListViewGetSelectedItemData()

LPARAM ListViewGetSelectedItemData ( IN HWND  hwnd)

Definition at line 134 of file misc.c.

135 {
136  int Index;
137 
139  -1,
140  LVNI_SELECTED);
141  if (Index != -1)
142  {
143  LVITEM li;
144 
145  li.mask = LVIF_PARAM;
146  li.iItem = Index;
147  li.iSubItem = 0;
148 
150  &li))
151  {
152  return li.lParam;
153  }
154  }
155 
156  return 0;
157 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define ListView_GetNextItem(hwnd, i, flags)
Definition: commctrl.h:2406
#define LVNI_SELECTED
Definition: commctrl.h:2396
static const UCHAR Index[8]
Definition: usbohci.c:18
#define ListView_GetItem(hwnd, pitem)
Definition: commctrl.h:2366
#define LVIF_PARAM
Definition: commctrl.h:2283
#define LVITEM
Definition: commctrl.h:2347

◆ ListViewSelectItem()

BOOL ListViewSelectItem ( IN HWND  hwnd,
IN INT  Index 
)

Definition at line 160 of file misc.c.

162 {
163  LVITEM li;
164 
165  li.mask = LVIF_STATE;
166  li.iItem = Index;
167  li.iSubItem = 0;
168  li.state = LVIS_SELECTED;
169  li.stateMask = LVIS_SELECTED;
170 
171  return ListView_SetItem(hwnd,
172  &li);
173 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define ListView_SetItem(hwnd, pitem)
Definition: commctrl.h:2373
#define LVIS_SELECTED
Definition: commctrl.h:2291
static const UCHAR Index[8]
Definition: usbohci.c:18
#define LVITEM
Definition: commctrl.h:2347
#define LVIF_STATE
Definition: commctrl.h:2284

Referenced by SecurityPageProc().

◆ LoadAndFormatString()

DWORD LoadAndFormatString ( IN HINSTANCE  hInstance,
IN UINT  uID,
OUT LPWSTR lpTarget,
  ... 
)

Definition at line 76 of file misc.c.

80 {
81  DWORD Ret = 0;
83  va_list lArgs;
84 
86  hInstance,
87  uID) > 0)
88  {
89  va_start(lArgs, lpTarget);
90  /* let's use Format to format it because it has the ability to allocate
91  memory automatically */
93  lpFormat,
94  0,
95  0,
96  (LPWSTR)lpTarget,
97  0,
98  &lArgs);
99  va_end(lArgs);
100 
102  }
103 
104  return Ret;
105 }
#define FORMAT_MESSAGE_FROM_STRING
Definition: winbase.h:402
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
HINSTANCE hInstance
Definition: charmap.c:20
#define va_end(ap)
Definition: acmsvcex.h:90
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
char * va_list
Definition: acmsvcex.h:78
unsigned long DWORD
Definition: ntddk_ex.h:95
LPCWSTR lpFormat
Definition: trayclock.cpp:32
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
INT AllocAndLoadString(OUT LPWSTR *lpTarget, IN HINSTANCE hInst, IN UINT uID)
Definition: misc.c:50
#define va_start(ap, A)
Definition: acmsvcex.h:91
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ LookupSidCache()

BOOL LookupSidCache ( IN HANDLE  SidCacheMgr,
IN PSID  pSid,
IN PSIDREQCOMPLETIONPROC  CompletionProc,
IN PVOID  Context 
)

Definition at line 872 of file sidcache.c.

876 {
877  BOOL Found = FALSE;
878  PSIDREQRESULT ReqResult = NULL;
879  PSIDCACHEMGR scm;
880 
881  scm = ReferenceSidCacheMgr(SidCacheMgr);
882  if (scm != NULL)
883  {
884  EnterCriticalSection(&scm->Lock);
885 
886  /* search the cache */
887  Found = FindSidInCache(scm,
888  pSid,
889  &ReqResult);
890 
891  if (!Found)
892  {
893  /* the sid is not in the cache, queue it if not already queued */
894  if (!QueueSidLookup(scm,
895  pSid,
896  CompletionProc,
897  Context))
898  {
899  PSIDREQRESULT FoundReqResult = NULL;
900 
901  /* unable to queue it, look it up now */
902 
903  LeaveCriticalSection(&scm->Lock);
904 
905  /* lookup everything we need */
906  if (!LookupSidInformation(scm,
907  pSid,
908  &ReqResult))
909  {
910  ReqResult = NULL;
911  }
912 
913  EnterCriticalSection(&scm->Lock);
914 
915  /* see if the SID was added to the cache in the meanwhile */
916  if (!FindSidInCache(scm,
917  pSid,
918  &FoundReqResult))
919  {
920  if (ReqResult != NULL)
921  {
922  /* cache the results */
923  CacheLookupResults(scm,
924  pSid,
925  ReqResult);
926  }
927  }
928  else
929  {
930  if (ReqResult != NULL)
931  {
932  /* free the information of our lookup and use the cached
933  information*/
935  ReqResult);
936  }
937 
938  ReqResult = FoundReqResult;
939  }
940 
941  Found = (ReqResult != NULL);
942  }
943  }
944 
945  LeaveCriticalSection(&scm->Lock);
946 
947  /* call the completion callback */
948  if (Found)
949  {
950  CompletionProc(SidCacheMgr,
951  pSid,
952  ReqResult,
953  Context);
954 
955  if (ReqResult != NULL)
956  {
957  HeapFree(scm->Heap,
958  0,
959  ReqResult);
960  }
961  }
962 
964  }
965 
966  return Found;
967 }
static VOID DereferenceSidCacheMgr(IN PSIDCACHEMGR scm)
Definition: sidcache.c:161
static VOID CacheLookupResults(IN PSIDCACHEMGR scm, IN PSID pSid, IN PSIDREQRESULT ReqResult)
Definition: sidcache.c:395
CRITICAL_SECTION Lock
Definition: sidcache.c:43
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
unsigned int BOOL
Definition: ntddk_ex.h:94
VOID DereferenceSidReqResult(IN HANDLE SidCacheMgr, IN PSIDREQRESULT ReqResult)
Definition: sidcache.c:851
static BOOL QueueSidLookup(IN PSIDCACHEMGR scm, IN PSID pSid, IN PSIDREQCOMPLETIONPROC CompletionProc, IN PVOID Context)
Definition: sidcache.c:683
smooth NULL
Definition: ftsmooth.c:416
return Found
Definition: dirsup.c:1270
static BOOL LookupSidInformation(IN PSIDCACHEMGR scm, IN PSID pSid, OUT PSIDREQRESULT *ReqResult)
Definition: sidcache.c:207
static PSIDCACHEMGR ReferenceSidCacheMgr(IN HANDLE SidCacheMgr)
Definition: sidcache.c:147
HANDLE Heap
Definition: sidcache.c:47
static PSID pSid
Definition: security.c:74
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static BOOL FindSidInCache(IN PSIDCACHEMGR scm, IN PSID pSid, OUT PSIDREQRESULT *ReqResult)
Definition: sidcache.c:329
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by AddPrincipalToList(), and ReloadPrincipalsList().

◆ ReferenceSidReqResult()

VOID ReferenceSidReqResult ( IN HANDLE  SidCacheMgr,
IN PSIDREQRESULT  ReqResult 
)

Definition at line 835 of file sidcache.c.

837 {
838  PSIDCACHEMGR scm;
839 
840  scm = ReferenceSidCacheMgr(SidCacheMgr);
841  if (scm != NULL)
842  {
843  InterlockedIncrement(&ReqResult->RefCount);
844 
846  }
847 }
static VOID DereferenceSidCacheMgr(IN PSIDCACHEMGR scm)
Definition: sidcache.c:161
smooth NULL
Definition: ftsmooth.c:416
static PSIDCACHEMGR ReferenceSidCacheMgr(IN HANDLE SidCacheMgr)
Definition: sidcache.c:147
#define InterlockedIncrement
Definition: armddk.h:53

Referenced by UpdatePrincipalListItem().

◆ RegisterCheckListControl()

BOOL RegisterCheckListControl ( HINSTANCE  hInstance)

◆ UnregisterCheckListControl()

VOID UnregisterCheckListControl ( HINSTANCE  hInstance)

Definition at line 2614 of file checklist.c.

2615 {
2617  hInstance);
2618 }
HINSTANCE hInstance
Definition: charmap.c:20
static const WCHAR szCheckListWndClass[]
Definition: checklist.c:39
#define UnregisterClass
Definition: winuser.h:5727

Referenced by DllMain().

Variable Documentation

◆ hDllInstance

HINSTANCE hDllInstance

Definition at line 17 of file netlogon.c.