ReactOS  0.4.15-dev-3440-g915569a
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 596 of file sidcache.c.

598 {
599  PSIDCACHEMGR scm;
600 
601  if (SystemName == NULL)
602  SystemName = L"";
603 
604  scm = HeapAlloc(Heap,
605  0,
607  SystemName[wcslen(SystemName) + 1]));
608  if (scm != NULL)
609  {
610  /* zero the static part of the structure */
611  ZeroMemory(scm,
613  SystemName));
614 
615  scm->RefCount = 1;
616  scm->Heap = Heap;
617 
618  wcscpy(scm->SystemName,
619  SystemName);
620 
624 
626  FALSE,
627  FALSE,
628  NULL);
629  if (scm->LookupEvent == NULL)
630  {
631  goto Cleanup;
632  }
633 
636  &scm->LsaHandle))
637  {
638  goto Cleanup;
639  }
640 
642  0,
644  scm,
645  0,
646  NULL);
647  if (scm->LookupThread == NULL)
648  {
649 Cleanup:
650  if (scm->LookupEvent != NULL)
651  {
652  CloseHandle(scm->LookupEvent);
653  }
654 
655  if (scm->LsaHandle != NULL)
656  {
657  LsaClose(scm->LsaHandle);
658  }
659 
660  HeapFree(Heap,
661  0,
662  scm);
663  scm = NULL;
664  }
665  }
666  else
667  {
669  }
670 
671  return (HANDLE)scm;
672 }
#define CreateEvent
Definition: winbase.h:3604
LIST_ENTRY QueueListHead
Definition: sidcache.c:44
HANDLE LookupThread
Definition: sidcache.c:49
#define CloseHandle
Definition: compat.h:598
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:455
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:1664
CRITICAL_SECTION Lock
Definition: sidcache.c:43
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
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:136
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
#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:611
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
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:255
WCHAR SystemName[1]
Definition: sidcache.c:50
#define NULL
Definition: types.h:112
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:594
HANDLE LookupEvent
Definition: sidcache.c:48

Referenced by CreateSecurityPage().

◆ DequeueSidLookup()

VOID DequeueSidLookup ( IN HANDLE  SidCacheMgr,
IN PSID  pSid 
)

Definition at line 791 of file sidcache.c.

793 {
794  PLIST_ENTRY CurrentEntry;
795  PSIDQUEUEENTRY QueueEntry;
796  PSIDCACHEMGR scm;
797 
798  scm = ReferenceSidCacheMgr(SidCacheMgr);
799  if (scm != NULL)
800  {
801  EnterCriticalSection(&scm->Lock);
802 
803  if (scm->QueueLookingUp != NULL &&
804  EqualSid(pSid,
805  (PSID)(scm->QueueLookingUp + 1)))
806  {
807  /* don't free the queue lookup item! this will be
808  done in the lookup thread */
809  scm->QueueLookingUp = NULL;
810  }
811  else
812  {
813  for (CurrentEntry = scm->QueueListHead.Flink;
814  CurrentEntry != &scm->QueueListHead;
815  CurrentEntry = CurrentEntry->Flink)
816  {
817  QueueEntry = CONTAINING_RECORD(CurrentEntry,
819  ListEntry);
820 
821  if (EqualSid(pSid,
822  (PSID)(QueueEntry + 1)))
823  {
824  FreeQueueEntry(scm,
825  QueueEntry);
826  break;
827  }
828  }
829  }
830 
831  LeaveCriticalSection(&scm->Lock);
832 
834  }
835 }
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:831
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
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:121
static PSIDCACHEMGR ReferenceSidCacheMgr(IN HANDLE SidCacheMgr)
Definition: sidcache.c:147
Definition: typedefs.h:119
#define NULL
Definition: types.h:112
static PSID pSid
Definition: security.c:74
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ DereferenceSidReqResult()

VOID DereferenceSidReqResult ( IN HANDLE  SidCacheMgr,
IN PSIDREQRESULT  ReqResult 
)

Definition at line 855 of file sidcache.c.

857 {
858  PSIDCACHEMGR scm;
859 
860  scm = ReferenceSidCacheMgr(SidCacheMgr);
861  if (scm != NULL)
862  {
863  if (InterlockedDecrement(&ReqResult->RefCount) == 0)
864  {
865  HeapFree(scm->Heap,
866  0,
867  ReqResult);
868  }
869 
871  }
872 }
static VOID DereferenceSidCacheMgr(IN PSIDCACHEMGR scm)
Definition: sidcache.c:161
static PSIDCACHEMGR ReferenceSidCacheMgr(IN HANDLE SidCacheMgr)
Definition: sidcache.c:147
#define InterlockedDecrement
Definition: armddk.h:52
HANDLE Heap
Definition: sidcache.c:47
#define NULL
Definition: types.h:112
#define HeapFree(x, y, z)
Definition: compat.h:594

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

◆ DestroySidCacheMgr()

VOID DestroySidCacheMgr ( IN HANDLE  SidCacheMgr)

Definition at line 676 of file sidcache.c.

677 {
678  PSIDCACHEMGR scm = HandleToScm(SidCacheMgr);
679 
680  if (scm != NULL)
681  {
682  /* remove the keep-alive reference */
684  }
685 }
static VOID DereferenceSidCacheMgr(IN PSIDCACHEMGR scm)
Definition: sidcache.c:161
#define NULL
Definition: types.h:112
#define HandleToScm(Handle)
Definition: sidcache.c:36

Referenced by CreateSecurityPage(), and DestroySecurityPage().

◆ DllMain()

BOOL WINAPI DllMain ( IN HINSTANCE  hDllInstance,
IN DWORD  fdwReason,
IN LPVOID  lpvReserved 
)

@DllMain

Core routine of the Utility Manager's library.

Parameters
[in]hDllInstanceThe entry point instance of the library.
[in]fdwReasonThe reason argument to indicate the motive DllMain is being called.
[in]lpvReservedReserved.
Returns
Returns TRUE when main call initialization has succeeded, FALSE otherwise.

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 FindWindow
Definition: winuser.h:5757
#define TRUE
Definition: types.h:120
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
DWORD dwReason
Definition: misc.cpp:154
#define FALSE
Definition: types.h:117
TCHAR szKbSwitcherName[]
Definition: kbswitch.h:30
#define NULL
Definition: types.h:112

◆ 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
if SUCCEEDED(hr)
ULONG cbSize
Definition: objsel.h:109
#define DSOP_SCOPE_FLAG_DEFAULT_FILTER_USERS
Definition: objsel.h:86
struct _DSOP_SCOPE_INIT_INFO DSOP_SCOPE_INIT_INFO
LONG HRESULT
Definition: typedefs.h:79
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:3325
#define S_OK
Definition: intsafe.h:52
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 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 NULL
Definition: types.h:112
#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

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 }
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
Definition: ole2.c:2033
struct _DS_SELECTION_LIST * PDS_SELECTION_LIST
#define TRUE
Definition: types.h:120
#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
HRESULT WINAPI SafeArrayAccessData(SAFEARRAY *psa, void **ppvData)
Definition: safearray.c:1137
unsigned int BOOL
Definition: ntddk_ex.h:94
if SUCCEEDED(hr)
ULONG Release()
static HWND hwndParent
Definition: cryptui.c:300
LONG HRESULT
Definition: typedefs.h:79
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:5818
#define S_OK
Definition: intsafe.h:52
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
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
static PSID pSid
Definition: security.c:74
HRESULT WINAPI SafeArrayUnaccessData(SAFEARRAY *psa)
Definition: safearray.c:1168

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:2434
#define LVNI_SELECTED
Definition: commctrl.h:2424
_In_ WDFCOLLECTION _In_ ULONG Index
#define ListView_GetItem(hwnd, pitem)
Definition: commctrl.h:2394
#define LVIF_PARAM
Definition: commctrl.h:2311
#define LVITEM
Definition: commctrl.h:2375
LARGE_INTEGER li
Definition: fxtimerapi.cpp:235

◆ 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:2401
#define LVIS_SELECTED
Definition: commctrl.h:2319
_In_ WDFCOLLECTION _In_ ULONG Index
#define LVITEM
Definition: commctrl.h:2375
#define LVIF_STATE
Definition: commctrl.h:2312
LARGE_INTEGER li
Definition: fxtimerapi.cpp:235

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:418
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:416
char * va_list
Definition: acmsvcex.h:78
unsigned long DWORD
Definition: ntddk_ex.h:95
va_start(ap, x)
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
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ LookupSidCache()

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

Definition at line 876 of file sidcache.c.

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

Referenced by AddPrincipalToList(), and ReloadPrincipalsList().

◆ ReferenceSidReqResult()

VOID ReferenceSidReqResult ( IN HANDLE  SidCacheMgr,
IN PSIDREQRESULT  ReqResult 
)

Definition at line 839 of file sidcache.c.

841 {
842  PSIDCACHEMGR scm;
843 
844  scm = ReferenceSidCacheMgr(SidCacheMgr);
845  if (scm != NULL)
846  {
847  InterlockedIncrement(&ReqResult->RefCount);
848 
850  }
851 }
static VOID DereferenceSidCacheMgr(IN PSIDCACHEMGR scm)
Definition: sidcache.c:161
static PSIDCACHEMGR ReferenceSidCacheMgr(IN HANDLE SidCacheMgr)
Definition: sidcache.c:147
#define InterlockedIncrement
Definition: armddk.h:53
#define NULL
Definition: types.h:112

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:5841

Referenced by DllMain().

Variable Documentation

◆ hDllInstance

HINSTANCE hDllInstance

Definition at line 17 of file browser.c.