ReactOS  0.4.15-dev-499-g1f31905
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 589 of file sidcache.c.

591 {
592  PSIDCACHEMGR scm;
593 
594  if (SystemName == NULL)
595  SystemName = L"";
596 
597  scm = HeapAlloc(Heap,
598  0,
600  SystemName[wcslen(SystemName) + 1]));
601  if (scm != NULL)
602  {
603  /* zero the static part of the structure */
604  ZeroMemory(scm,
606  SystemName));
607 
608  scm->RefCount = 1;
609  scm->Heap = Heap;
610 
611  wcscpy(scm->SystemName,
612  SystemName);
613 
617 
619  FALSE,
620  FALSE,
621  NULL);
622  if (scm->LookupEvent == NULL)
623  {
624  goto Cleanup;
625  }
626 
629  &scm->LsaHandle))
630  {
631  goto Cleanup;
632  }
633 
635  0,
637  scm,
638  0,
639  NULL);
640  if (scm->LookupThread == NULL)
641  {
642 Cleanup:
643  if (scm->LookupEvent != NULL)
644  {
645  CloseHandle(scm->LookupEvent);
646  }
647 
648  if (scm->LsaHandle != NULL)
649  {
650  LsaClose(scm->LsaHandle);
651  }
652 
653  HeapFree(Heap,
654  0,
655  scm);
656  scm = NULL;
657  }
658  }
659  else
660  {
662  }
663 
664  return (HANDLE)scm;
665 }
#define CreateEvent
Definition: winbase.h:3588
LIST_ENTRY QueueListHead
Definition: sidcache.c:44
HANDLE LookupThread
Definition: sidcache.c:49
#define CloseHandle
Definition: compat.h:407
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:448
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:1648
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:136
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
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:418
_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:403
HANDLE LookupEvent
Definition: sidcache.c:48

Referenced by CreateSecurityPage().

◆ DequeueSidLookup()

VOID DequeueSidLookup ( IN HANDLE  SidCacheMgr,
IN PSID  pSid 
)

Definition at line 784 of file sidcache.c.

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

◆ DereferenceSidReqResult()

VOID DereferenceSidReqResult ( IN HANDLE  SidCacheMgr,
IN PSIDREQRESULT  ReqResult 
)

Definition at line 848 of file sidcache.c.

850 {
851  PSIDCACHEMGR scm;
852 
853  scm = ReferenceSidCacheMgr(SidCacheMgr);
854  if (scm != NULL)
855  {
856  if (InterlockedDecrement(&ReqResult->RefCount) == 0)
857  {
858  HeapFree(scm->Heap,
859  0,
860  ReqResult);
861  }
862 
864  }
865 }
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:403

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

◆ DestroySidCacheMgr()

VOID DestroySidCacheMgr ( IN HANDLE  SidCacheMgr)

Definition at line 669 of file sidcache.c.

670 {
671  PSIDCACHEMGR scm = HandleToScm(SidCacheMgr);
672 
673  if (scm != NULL)
674  {
675  /* remove the keep-alive reference */
677  }
678 }
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  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 TRUE
Definition: types.h:120
#define FindWindow
Definition: winuser.h:5752
#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:78
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: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:2033
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:1137
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:78
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:5813
#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:1168
#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:2430
#define LVNI_SELECTED
Definition: commctrl.h:2420
static const UCHAR Index[8]
Definition: usbohci.c:18
#define ListView_GetItem(hwnd, pitem)
Definition: commctrl.h:2390
#define LVIF_PARAM
Definition: commctrl.h:2307
#define LVITEM
Definition: commctrl.h:2371

◆ 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:2397
#define LVIS_SELECTED
Definition: commctrl.h:2315
static const UCHAR Index[8]
Definition: usbohci.c:18
#define LVITEM
Definition: commctrl.h:2371
#define LVIF_STATE
Definition: commctrl.h:2308

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 869 of file sidcache.c.

873 {
874  BOOL Found = FALSE;
875  PSIDREQRESULT ReqResult = NULL;
876  PSIDCACHEMGR scm;
877 
878  scm = ReferenceSidCacheMgr(SidCacheMgr);
879  if (scm != NULL)
880  {
881  EnterCriticalSection(&scm->Lock);
882 
883  /* search the cache */
884  Found = FindSidInCache(scm,
885  pSid,
886  &ReqResult);
887 
888  if (!Found)
889  {
890  /* the sid is not in the cache, queue it if not already queued */
891  if (!QueueSidLookup(scm,
892  pSid,
893  CompletionProc,
894  Context))
895  {
896  PSIDREQRESULT FoundReqResult = NULL;
897 
898  /* unable to queue it, look it up now */
899 
900  LeaveCriticalSection(&scm->Lock);
901 
902  /* lookup everything we need */
903  if (!LookupSidInformation(scm,
904  pSid,
905  &ReqResult))
906  {
907  ReqResult = NULL;
908  }
909 
910  EnterCriticalSection(&scm->Lock);
911 
912  /* see if the SID was added to the cache in the meanwhile */
913  if (!FindSidInCache(scm,
914  pSid,
915  &FoundReqResult))
916  {
917  if (ReqResult != NULL)
918  {
919  /* cache the results */
920  CacheLookupResults(scm,
921  pSid,
922  ReqResult);
923  }
924  }
925  else
926  {
927  if (ReqResult != NULL)
928  {
929  /* free the information of our lookup and use the cached
930  information*/
932  ReqResult);
933  }
934 
935  ReqResult = FoundReqResult;
936  }
937 
938  Found = (ReqResult != NULL);
939  }
940  }
941 
942  LeaveCriticalSection(&scm->Lock);
943 
944  /* call the completion callback */
945  if (Found)
946  {
947  CompletionProc(SidCacheMgr,
948  pSid,
949  ReqResult,
950  Context);
951 
952  if (ReqResult != NULL)
953  {
954  HeapFree(scm->Heap,
955  0,
956  ReqResult);
957  }
958  }
959 
961  }
962 
963  return Found;
964 }
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:394
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:848
static BOOL QueueSidLookup(IN PSIDCACHEMGR scm, IN PSID pSid, IN PSIDREQCOMPLETIONPROC CompletionProc, IN PVOID Context)
Definition: sidcache.c:682
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:403

Referenced by AddPrincipalToList(), and ReloadPrincipalsList().

◆ ReferenceSidReqResult()

VOID ReferenceSidReqResult ( IN HANDLE  SidCacheMgr,
IN PSIDREQRESULT  ReqResult 
)

Definition at line 832 of file sidcache.c.

834 {
835  PSIDCACHEMGR scm;
836 
837  scm = ReferenceSidCacheMgr(SidCacheMgr);
838  if (scm != NULL)
839  {
840  InterlockedIncrement(&ReqResult->RefCount);
841 
843  }
844 }
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:5836

Referenced by DllMain().

Variable Documentation

◆ hDllInstance

HINSTANCE hDllInstance

Definition at line 17 of file browser.c.