ReactOS  0.4.14-dev-583-g2a1ba2c
handle.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "shlwapi.h"
#include "wine/debug.h"
#include "msi.h"
#include "msiquery.h"
#include "msipriv.h"
Include dependency graph for handle.c:

Go to the source code of this file.

Classes

struct  msi_handle_info_t
 

Macros

#define COBJMACROS
 

Typedefs

typedef struct msi_handle_info_t msi_handle_info
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msi)
 
void msi_free_handle_table (void)
 
static MSIHANDLE alloc_handle_table_entry (void)
 
MSIHANDLE alloc_msihandle (MSIOBJECTHDR *obj)
 
MSIHANDLE alloc_msi_remote_handle (IUnknown *unk)
 
voidmsihandle2msiinfo (MSIHANDLE handle, UINT type)
 
IUnknownmsi_get_remote (MSIHANDLE handle)
 
voidalloc_msiobject (UINT type, UINT size, msihandledestructor destroy)
 
void msiobj_addref (MSIOBJECTHDR *info)
 
void msiobj_lock (MSIOBJECTHDR *info)
 
void msiobj_unlock (MSIOBJECTHDR *info)
 
int msiobj_release (MSIOBJECTHDR *info)
 
UINT WINAPI MsiCloseHandle (MSIHANDLE handle)
 
UINT WINAPI MsiCloseAllHandles (void)
 

Variables

static CRITICAL_SECTION MSI_handle_cs = { &MSI_handle_cs_debug, -1, 0, 0, 0, 0 }
 
static CRITICAL_SECTION_DEBUG MSI_handle_cs_debug
 
static CRITICAL_SECTION MSI_object_cs = { &MSI_object_cs_debug, -1, 0, 0, 0, 0 }
 
static CRITICAL_SECTION_DEBUG MSI_object_cs_debug
 
static msi_handle_infomsihandletable = NULL
 
static unsigned int msihandletable_size = 0
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file handle.c.

Typedef Documentation

◆ msi_handle_info

Function Documentation

◆ alloc_handle_table_entry()

static MSIHANDLE alloc_handle_table_entry ( void  )
static

Definition at line 78 of file handle.c.

79 {
80  UINT i;
81 
82  /* find a slot */
83  for(i=0; i<msihandletable_size; i++)
84  if( !msihandletable[i].u.obj && !msihandletable[i].u.unk )
85  break;
86  if( i==msihandletable_size )
87  {
89  int newsize;
90  if (msihandletable_size == 0)
91  {
92  newsize = 256;
93  p = msi_alloc_zero(newsize*sizeof(msi_handle_info));
94  }
95  else
96  {
97  newsize = msihandletable_size * 2;
99  newsize*sizeof(msi_handle_info));
100  }
101  if (!p)
102  return 0;
103  msihandletable = p;
104  msihandletable_size = newsize;
105  }
106  return i + 1;
107 }
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 * u
Definition: glfuncs.h:240
union msi_handle_info_t::@483 u
static void * msi_alloc_zero(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1210
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
static msi_handle_info * msihandletable
Definition: handle.c:66
IUnknown * unk
Definition: handle.c:61
unsigned int UINT
Definition: ndis.h:50
static void * msi_realloc_zero(void *mem, size_t len) __WINE_ALLOC_SIZE(2)
Definition: msipriv.h:1222
GLfloat GLfloat p
Definition: glext.h:8902
static unsigned int msihandletable_size
Definition: handle.c:67

Referenced by alloc_msi_remote_handle(), and alloc_msihandle().

◆ alloc_msi_remote_handle()

MSIHANDLE alloc_msi_remote_handle ( IUnknown unk)

Definition at line 133 of file handle.c.

134 {
136  MSIHANDLE ret;
137 
139 
141  if (ret)
142  {
143  entry = &msihandletable[ ret - 1 ];
144  IUnknown_AddRef( unk );
145  entry->u.unk = unk;
146  entry->dwThreadId = GetCurrentThreadId();
147  entry->remote = TRUE;
148  }
149 
151 
152  TRACE("%p -> %d\n", unk, ret);
153 
154  return ret;
155 }
#define TRUE
Definition: types.h:120
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
unsigned long MSIHANDLE
Definition: msiserver.idl:25
static msi_handle_info * msihandletable
Definition: handle.c:66
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
static MSIHANDLE alloc_handle_table_entry(void)
Definition: handle.c:78
#define TRACE(s)
Definition: solgame.cpp:4
int ret
uint32_t entry
Definition: isohybrid.c:63
static CRITICAL_SECTION MSI_handle_cs
Definition: handle.c:36
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

Referenced by ACTION_CallDllFunction(), and mrp_GetActiveDatabase().

◆ alloc_msihandle()

MSIHANDLE alloc_msihandle ( MSIOBJECTHDR obj)

Definition at line 109 of file handle.c.

110 {
112  MSIHANDLE ret;
113 
115 
117  if (ret)
118  {
119  entry = &msihandletable[ ret - 1 ];
120  msiobj_addref( obj );
121  entry->u.obj = obj;
122  entry->dwThreadId = GetCurrentThreadId();
123  entry->remote = FALSE;
124  }
125 
127 
128  TRACE("%p -> %d\n", obj, ret );
129 
130  return ret;
131 }
void msiobj_addref(MSIOBJECTHDR *info)
Definition: handle.c:218
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
unsigned long MSIHANDLE
Definition: msiserver.idl:25
GLsizei GLsizei GLuint * obj
Definition: glext.h:6042
static msi_handle_info * msihandletable
Definition: handle.c:66
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
static MSIHANDLE alloc_handle_table_entry(void)
Definition: handle.c:78
#define TRACE(s)
Definition: solgame.cpp:4
int ret
uint32_t entry
Definition: isohybrid.c:63
static CRITICAL_SECTION MSI_handle_cs
Definition: handle.c:36
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

Referenced by ACTION_CallScript(), mcr_GetActionInfo(), MSI_ProcessMessageVerbatim(), msi_publish_product_properties(), MsiCreateRecord(), MsiDatabaseGetPrimaryKeysW(), MsiDatabaseOpenViewW(), MsiEnableUIPreview(), MsiGetActiveDatabase(), MsiGetSummaryInformationW(), MsiOpenDatabaseW(), MsiOpenPackageExW(), MsiOpenProductW(), MsiViewFetch(), and MsiViewGetColumnInfo().

◆ alloc_msiobject()

void* alloc_msiobject ( UINT  type,
UINT  size,
msihandledestructor  destroy 
)

Definition at line 202 of file handle.c.

203 {
205 
206  info = msi_alloc_zero( size );
207  if( info )
208  {
209  info->magic = MSIHANDLE_MAGIC;
210  info->type = type;
211  info->refcount = 1;
212  info->destructor = destroy;
213  }
214 
215  return info;
216 }
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static void * msi_alloc_zero(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1210
struct _test_info info[]
Definition: SetCursorPos.c:19
GLsizeiptr size
Definition: glext.h:5919
void destroy(_Tp *__pointer)
Definition: _construct.h:278
#define MSIHANDLE_MAGIC
Definition: msipriv.h:713

Referenced by create_suminfo(), MSI_CreateRecord(), MSI_DatabaseOpenViewW(), MSI_EnableUIPreview(), and MSI_OpenDatabaseW().

◆ msi_free_handle_table()

void msi_free_handle_table ( void  )

Definition at line 69 of file handle.c.

70 {
76 }
static msi_handle_info * msihandletable
Definition: handle.c:66
smooth NULL
Definition: ftsmooth.c:416
static CRITICAL_SECTION MSI_object_cs
Definition: handle.c:46
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static CRITICAL_SECTION MSI_handle_cs
Definition: handle.c:36
static unsigned int msihandletable_size
Definition: handle.c:67

Referenced by DllMain().

◆ msi_get_remote()

IUnknown* msi_get_remote ( MSIHANDLE  handle)

Definition at line 182 of file handle.c.

183 {
184  IUnknown *unk = NULL;
185 
187  handle--;
189  goto out;
190  if( !msihandletable[handle].remote)
191  goto out;
192  unk = msihandletable[handle].u.unk;
193  if( unk )
194  IUnknown_AddRef( unk );
195 
196 out:
198 
199  return unk;
200 }
union msi_handle_info_t::@483 u
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static msi_handle_info * msihandletable
Definition: handle.c:66
smooth NULL
Definition: ftsmooth.c:416
static FILE * out
Definition: regtests2xml.c:44
IUnknown * unk
Definition: handle.c:61
static CRITICAL_SECTION MSI_handle_cs
Definition: handle.c:36
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static unsigned int msihandletable_size
Definition: handle.c:67

Referenced by MSI_GetProperty(), MSI_GetSourcePath(), MSI_GetTargetPath(), MSI_OpenPackageW(), MsiDatabaseApplyTransformW(), MsiDatabaseCommit(), MsiDatabaseExportW(), MsiDatabaseGetPrimaryKeysW(), MsiDatabaseImportW(), MsiDatabaseIsTablePersistentW(), MsiDatabaseOpenViewW(), MsiDoActionW(), MsiEnableUIPreview(), MsiEnumComponentCostsW(), MsiEvaluateConditionW(), MsiFormatRecordW(), MsiGetActiveDatabase(), MsiGetComponentStateW(), MsiGetFeatureCostW(), MsiGetFeatureStateW(), MsiGetLanguage(), MsiGetMode(), MsiGetSummaryInformationW(), MsiProcessMessage(), MsiSequenceW(), MsiSetComponentStateW(), MsiSetFeatureStateW(), MsiSetInstallLevel(), MsiSetMode(), MsiSetPropertyW(), and MsiSetTargetPathW().

◆ MsiCloseAllHandles()

UINT WINAPI MsiCloseAllHandles ( void  )

Definition at line 326 of file handle.c.

327 {
328  UINT i, n=0;
329 
330  TRACE("\n");
331 
333  for(i=0; i<msihandletable_size; i++)
334  {
336  {
338  MsiCloseHandle( i+1 );
340  n++;
341  }
342  }
344 
345  return n;
346 }
GLdouble n
Definition: glext.h:7729
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
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
static msi_handle_info * msihandletable
Definition: handle.c:66
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
#define TRACE(s)
Definition: solgame.cpp:4
DWORD dwThreadId
Definition: fdebug.c:31
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:270
unsigned int UINT
Definition: ndis.h:50
static CRITICAL_SECTION MSI_handle_cs
Definition: handle.c:36
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static unsigned int msihandletable_size
Definition: handle.c:67

Referenced by DllThread(), and ScriptThread().

◆ MsiCloseHandle()

UINT WINAPI MsiCloseHandle ( MSIHANDLE  handle)

Definition at line 270 of file handle.c.

271 {
274 
275  TRACE("%x\n",handle);
276 
277  if (!handle)
278  return ERROR_SUCCESS;
279 
281 
282  handle--;
284  goto out;
285 
286  if (msihandletable[handle].remote)
287  {
288  IUnknown_Release( msihandletable[handle].u.unk );
289  }
290  else
291  {
293  if( !info )
294  goto out;
295 
296  if( info->magic != MSIHANDLE_MAGIC )
297  {
298  ERR("Invalid handle!\n");
299  goto out;
300  }
301  }
302 
306 
307  ret = ERROR_SUCCESS;
308 
309  TRACE("handle %x destroyed\n", handle+1);
310 out:
312  if( info )
313  msiobj_release( info );
314 
315  return ret;
316 }
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 * u
Definition: glfuncs.h:240
union msi_handle_info_t::@483 u
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static msi_handle_info * msihandletable
Definition: handle.c:66
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
static FILE * out
Definition: regtests2xml.c:44
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
MSIOBJECTHDR * obj
Definition: handle.c:60
int ret
#define ERR(fmt,...)
Definition: debug.h:109
unsigned int UINT
Definition: ndis.h:50
static CRITICAL_SECTION MSI_handle_cs
Definition: handle.c:36
#define MSIHANDLE_MAGIC
Definition: msipriv.h:713
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
DWORD dwThreadId
Definition: handle.c:63
static unsigned int msihandletable_size
Definition: handle.c:67

Referenced by ACTION_CallDllFunction(), ACTION_CallScript(), add_custom_dll(), AutomationObject_Release(), create_database(), create_database_wordcount(), do_query(), find_entry(), find_entryW(), find_prop_in_property(), generate_transform(), get_column_info(), get_columns_table_type(), get_integer(), get_patch_product_codes(), get_string(), helper_createpackage(), mrd_Release(), mrp_Release(), MSI_ProcessMessageVerbatim(), msi_publish_product_properties(), MsiCloseAllHandles(), MsiCollectUserInfoA(), MsiCollectUserInfoW(), MsiVerifyPackageW(), ok_(), package_from_db(), query_file_path(), run_query(), run_queryW(), set_admin_summary_info(), set_suminfo(), set_suminfo_prop(), set_summary_dword(), set_summary_info(), set_summary_str(), set_transform_summary_info(), test_access(), test_alter(), test_appsearch(), test_appsearch_complocator(), test_appsearch_drlocator(), test_appsearch_inilocator(), test_appsearch_reglocator(), test_binary(), test_binary_import(), test_carriagereturn(), test_ccpsearch(), test_collation(), test_columnorder(), test_complocator(), test_condition(), test_controlevent(), test_createpackage(), test_createtable(), test_dbmerge(), test_dbtopackage(), test_defaultdatabase(), test_deleterow(), test_doaction(), test_droptable(), test_embedded_nulls(), test_emptypackage(), test_externalui(), test_externalui_message(), test_featureparents(), test_fieldzero(), test_forcecodepage(), test_formatrecord(), test_formatrecord2(), test_formatrecord_tables(), test_getcolinfo(), test_getproperty(), test_gettargetpath_bad(), test_handle_limit(), test_icon_table(), test_insertorder(), test_installprops(), test_int_widths(), test_integers(), test_join(), test_launchconditions(), test_longstrings(), test_markers(), test_msibadqueries(), test_msidatabase(), test_MsiDatabaseCommit(), test_MsiEnumComponentCosts(), test_msiexport(), test_MsiGetFeatureInfo(), test_MsiGetProductProperty(), test_MsiGetSourcePath(), test_msiimport(), test_msiinsert(), test_MsiOpenDatabase(), test_MsiOpenProduct(), test_msipackage(), test_msirecord(), test_MsiRecordGetInteger(), test_MsiRecordGetString(), test_MsiSetComponentState(), test_MsiSetFeatureAttributes(), test_MsiSetProperty(), test_noquotes(), test_order(), test_packagecoltypes(), test_property_table(), test_props(), test_quotes(), test_removefiles(), test_rows_order(), test_select_column_names(), test_select_markers(), test_select_with_tablenames(), test_settargetpath(), test_shortlongsource(), test_simple_patch(), test_sourcedir(), test_special_tables(), test_states(), test_storages_table(), test_streamtable(), test_stringtable(), test_suminfo(), test_suminfo_import(), test_summary_binary(), test_system_tables(), test_tables_order(), test_temporary_table(), test_top_level_action(), test_try_transform(), test_update(), test_viewgetcolumninfo(), test_viewmodify(), test_viewmodify_assign(), test_viewmodify_delete(), test_viewmodify_delete_temporary(), test_viewmodify_refresh(), test_viewmodify_update(), test_where(), test_where_not_in_selected(), test_where_viewmodify(), try_insert_query(), try_query_param(), and write_msi_summary_info().

◆ msihandle2msiinfo()

void* msihandle2msiinfo ( MSIHANDLE  handle,
UINT  type 
)

Definition at line 157 of file handle.c.

158 {
159  MSIOBJECTHDR *ret = NULL;
160 
162  handle--;
163  if( handle >= msihandletable_size )
164  goto out;
165  if( msihandletable[handle].remote)
166  goto out;
167  if( !msihandletable[handle].u.obj )
168  goto out;
169  if( msihandletable[handle].u.obj->magic != MSIHANDLE_MAGIC )
170  goto out;
171  if( type && (msihandletable[handle].u.obj->type != type) )
172  goto out;
174  msiobj_addref( ret );
175 
176 out:
178 
179  return ret;
180 }
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 * u
Definition: glfuncs.h:240
void msiobj_addref(MSIOBJECTHDR *info)
Definition: handle.c:218
union msi_handle_info_t::@483 u
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static msi_handle_info * msihandletable
Definition: handle.c:66
smooth NULL
Definition: ftsmooth.c:416
static FILE * out
Definition: regtests2xml.c:44
MSIOBJECTHDR * obj
Definition: handle.c:60
int ret
static CRITICAL_SECTION MSI_handle_cs
Definition: handle.c:36
#define MSIHANDLE_MAGIC
Definition: msipriv.h:713
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static unsigned int msihandletable_size
Definition: handle.c:67

Referenced by MSI_OpenPackageW(), MsiDatabaseApplyTransformW(), MsiDatabaseCommit(), MsiDatabaseExportW(), MsiDatabaseGetPrimaryKeysW(), MsiDatabaseImportW(), MsiDatabaseIsTablePersistentW(), MsiDatabaseMergeW(), MsiDatabaseOpenViewW(), MsiEnableUIPreview(), MsiEnumComponentCostsW(), MsiFormatRecordW(), MsiGetDatabaseState(), MsiGetFeatureInfoW(), MsiGetSummaryInformationW(), MsiPreviewDialogW(), MsiProcessMessage(), MsiRecordClearData(), MsiRecordDataSize(), MsiRecordGetFieldCount(), MsiRecordGetInteger(), MsiRecordGetStringA(), MsiRecordGetStringW(), MsiRecordIsNull(), MsiRecordReadStream(), MsiRecordSetInteger(), MsiRecordSetStreamW(), MsiRecordSetStringA(), MsiRecordSetStringW(), MsiSetFeatureAttributesW(), MsiSummaryInfoGetPropertyA(), MsiSummaryInfoGetPropertyCount(), MsiSummaryInfoGetPropertyW(), MsiSummaryInfoPersist(), MsiSummaryInfoSetPropertyA(), MsiSummaryInfoSetPropertyW(), MsiViewClose(), MsiViewExecute(), MsiViewFetch(), MsiViewGetColumnInfo(), MsiViewGetErrorA(), MsiViewGetErrorW(), and MsiViewModify().

◆ msiobj_addref()

void msiobj_addref ( MSIOBJECTHDR info)

Definition at line 218 of file handle.c.

219 {
220  if( !info )
221  return;
222 
223  if( info->magic != MSIHANDLE_MAGIC )
224  {
225  ERR("Invalid handle!\n");
226  return;
227  }
228 
229  InterlockedIncrement(&info->refcount);
230 }
#define ERR(fmt,...)
Definition: debug.h:109
#define InterlockedIncrement
Definition: armddk.h:53
#define MSIHANDLE_MAGIC
Definition: msipriv.h:713

Referenced by alloc_msihandle(), CREATE_CreateView(), DISTINCT_CreateView(), do_msidbCustomActionTypeDll(), do_msidbCustomActionTypeScript(), INSERT_CreateView(), MSI_CreatePackage(), MSI_DatabaseOpenViewW(), MSI_EnableUIPreview(), MSI_OpenDatabaseW(), msihandle2msiinfo(), UPDATE_CreateView(), and WHERE_CreateView().

◆ msiobj_lock()

◆ msiobj_release()

int msiobj_release ( MSIOBJECTHDR info)

Definition at line 242 of file handle.c.

243 {
244  int ret;
245 
246  if( !info )
247  return -1;
248 
249  if( info->magic != MSIHANDLE_MAGIC )
250  {
251  ERR("Invalid handle!\n");
252  return -1;
253  }
254 
255  ret = InterlockedDecrement( &info->refcount );
256  if( ret==0 )
257  {
258  if( info->destructor )
259  info->destructor( info );
260  msi_free( info );
261  TRACE("object %p destroyed\n", info);
262  }
263 
264  return ret;
265 }
#define TRACE(s)
Definition: solgame.cpp:4
int ret
#define InterlockedDecrement
Definition: armddk.h:52
#define ERR(fmt,...)
Definition: debug.h:109
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
#define MSIHANDLE_MAGIC
Definition: msipriv.h:713

Referenced by ACTION_AllocateRegistrySpace(), ACTION_AppSearch(), ACTION_AppSearchComponents(), ACTION_AppSearchDr(), ACTION_AppSearchGetSignature(), ACTION_AppSearchIni(), ACTION_AppSearchReg(), ACTION_BindImage(), ACTION_CCPSearch(), ACTION_CostFinalize(), ACTION_CreateFolders(), ACTION_CreateShortcuts(), ACTION_CustomAction(), ACTION_DeleteServices(), ACTION_DuplicateFiles(), ACTION_ExecuteAction(), ACTION_FindRelatedProducts(), ACTION_InstallODBC(), ACTION_InstallServices(), ACTION_InstallValidate(), ACTION_LaunchConditions(), ACTION_MigrateFeatureStates(), ACTION_MoveFiles(), ACTION_MsiPublishAssemblies(), ACTION_MsiUnpublishAssemblies(), ACTION_PerformActionSequence(), ACTION_ProcessComponents(), ACTION_ProcessExecSequence(), ACTION_ProcessUISequence(), ACTION_PublishComponents(), ACTION_PublishFeatures(), ACTION_PublishProduct(), ACTION_RegisterClassInfo(), ACTION_RegisterExtensionInfo(), ACTION_RegisterFonts(), ACTION_RegisterMIMEInfo(), ACTION_RegisterProduct(), ACTION_RegisterProgIdInfo(), ACTION_RegisterTypeLibraries(), ACTION_RegisterUser(), ACTION_RemoveDuplicateFiles(), ACTION_RemoveEnvironmentStrings(), ACTION_RemoveExistingProducts(), ACTION_RemoveFiles(), ACTION_RemoveFolders(), ACTION_RemoveIniValues(), ACTION_RemoveODBC(), ACTION_RemoveRegistryValues(), ACTION_RemoveShortcuts(), ACTION_SelfRegModules(), ACTION_SelfUnregModules(), ACTION_SetODBCFolders(), ACTION_ShowDialog(), ACTION_StartServices(), ACTION_StopServices(), ACTION_UnpublishComponents(), ACTION_UnregisterClassInfo(), ACTION_UnregisterExtensionInfo(), ACTION_UnregisterFonts(), ACTION_UnregisterMIMEInfo(), ACTION_UnregisterProgIdInfo(), ACTION_UnregisterTypeLibraries(), ACTION_WriteEnvironmentStrings(), ACTION_WriteIniValues(), ACTION_WriteRegistryValues(), add_stream(), alter_add_column(), check_column_exists(), check_transform_applicable(), construct_record(), CREATE_delete(), create_diff_row_query(), create_temp_binary(), create_temp_property_table(), deformat_string(), dialog_create(), dialog_map_events(), DISTINCT_delete(), gather_merge_data(), get_assembly_display_name(), get_assembly_record(), get_key_value(), get_local_package(), get_package_code(), get_product_code(), HANDLE_CustomType19(), HANDLE_CustomType5_6(), INSERT_delete(), INSERT_execute(), internal_ui_handler(), is_uninstallable(), iterate_appsearch(), ITERATE_CreateFolders(), ITERATE_DeleteService(), ITERATE_DuplicateFiles(), ITERATE_FindRelatedProducts(), ITERATE_InstallODBCDataSource(), ITERATE_InstallODBCDriver(), ITERATE_InstallODBCTranslator(), ITERATE_InstallService(), ITERATE_MoveFiles(), iterate_properties(), ITERATE_PublishComponent(), ITERATE_RegisterFonts(), ITERATE_RemoveDuplicateFiles(), ITERATE_RemoveEnvironmentString(), ITERATE_RemoveFiles(), ITERATE_RemoveFolders(), ITERATE_RemoveIniValuesOnInstall(), ITERATE_RemoveIniValuesOnUninstall(), ITERATE_RemoveODBCDataSource(), ITERATE_RemoveODBCDriver(), ITERATE_RemoveODBCTranslator(), ITERATE_RemoveRegistryValuesOnInstall(), ITERATE_RemoveRegistryValuesOnUninstall(), ITERATE_SelfRegModules(), ITERATE_SelfUnregModules(), ITERATE_StartService(), ITERATE_StopService(), ITERATE_UnpublishComponent(), ITERATE_UnregisterFonts(), ITERATE_WriteEnvironmentString(), ITERATE_WriteIniValues(), ITERATE_WriteRegistryValues(), join_modify_update(), load_all_classes(), load_all_extensions(), load_all_files(), load_all_folders(), load_all_media(), load_all_mimes(), load_all_patches(), load_all_progids(), load_all_verbs(), load_feature(), load_file_disk_id(), load_file_hash(), load_folder_persistence(), load_given_appid(), load_given_class(), load_given_extension(), load_given_mime(), load_given_progid(), load_patch_disk_id(), merge_diff_row(), merge_diff_tables(), merge_free_rows(), merge_verify_colnames(), merge_verify_primary_keys(), msi_add_records_to_table(), msi_add_suminfo(), msi_add_table_to_db(), MSI_ApplicablePatchW(), msi_apply_patch_package(), msi_apply_registered_patch(), msi_arrange_record(), msi_change_media(), msi_clone_properties(), MSI_CloneRecord(), MSI_ClosePreview(), MSI_CloseView(), msi_combobox_add_items(), msi_create_table(), MSI_CreatePackage(), MSI_DatabaseExport(), MSI_DatabaseGetPrimaryKeys(), MSI_DatabaseOpenViewW(), msi_dialog_build_font_list(), msi_dialog_button_handler(), msi_dialog_evaluate_control_conditions(), msi_dialog_fill_controls(), msi_dialog_get_uitext(), msi_dialog_oncreate(), msi_dialog_radiogroup_control(), msi_dialog_seltree_handler(), MSI_EnableUIPreview(), msi_export_suminfo(), msi_file_update_ui(), MSI_FormatRecordW(), MSI_FreePackage(), msi_get_checkbox_value(), msi_get_db_suminfo(), msi_get_error_message(), msi_get_merge_table(), msi_get_property(), msi_get_property_row(), msi_get_query_columns(), msi_get_query_types(), msi_get_suminfo(), msi_get_suminfo_product(), msi_get_table_labels(), msi_get_transform_record(), MSI_GetProperty(), MSI_GetSourcePath(), MSI_GetTargetPath(), MSI_IterateRecords(), msi_listbox_add_items(), msi_load_all_components(), msi_load_all_features(), msi_load_assembly(), msi_load_image(), msi_load_media_info(), msi_load_picture(), msi_load_suminfo_properties(), msi_media_get_disk_info(), MSI_OpenDatabaseW(), MSI_OpenPackageW(), msi_publish_icons(), msi_query_merge_record(), MSI_QueryGetRecord(), msi_refresh_record(), msi_select_update(), MSI_Sequence(), msi_set_property(), msi_table_load_transform(), msi_ui_progress(), msi_unimplemented_action_stub(), msi_unpublish_feature(), msi_unpublish_icons(), MsiCloseHandle(), MsiCollectUserInfoA(), MsiCollectUserInfoW(), MsiConfigureFeatureW(), MsiConfigureProductExW(), MsiCreateRecord(), MsiDatabaseApplyTransformW(), MsiDatabaseCommit(), MsiDatabaseExportW(), MsiDatabaseGetPrimaryKeysW(), MsiDatabaseImportW(), MsiDatabaseIsTablePersistentW(), MsiDatabaseMergeW(), MsiDatabaseOpenViewW(), MsiDetermineApplicablePatchesW(), MsiDeterminePatchSequenceW(), MsiDoActionW(), MsiEnableUIPreview(), MsiEnumComponentCostsW(), MsiEvaluateConditionW(), MsiFormatRecordW(), MsiGetActiveDatabase(), MsiGetComponentStateW(), MsiGetDatabaseState(), MsiGetFeatureCostW(), MsiGetFeatureInfoW(), MsiGetFeatureStateW(), MsiGetLanguage(), MsiGetMode(), MsiGetProductPropertyW(), MsiGetSummaryInformationW(), MsiInstallProductW(), MsiOpenDatabaseW(), MsiOpenPackageExW(), MsiOpenProductW(), MsiPreviewDialogW(), MsiProcessMessage(), MsiRecordClearData(), MsiRecordDataSize(), MsiRecordGetFieldCount(), MsiRecordGetInteger(), MsiRecordGetStringA(), MsiRecordGetStringW(), MsiRecordIsNull(), MsiRecordReadStream(), MsiRecordSetInteger(), MsiRecordSetStreamW(), MsiRecordSetStringA(), MsiRecordSetStringW(), MsiReinstallFeatureW(), MsiSequenceW(), MsiSetComponentStateW(), MsiSetFeatureAttributesW(), MsiSetFeatureStateW(), MsiSetInstallLevel(), MsiSetMode(), MsiSetPropertyW(), MsiSetTargetPathW(), MsiSummaryInfoGetPropertyA(), MsiSummaryInfoGetPropertyCount(), MsiSummaryInfoGetPropertyW(), MsiSummaryInfoPersist(), MsiSummaryInfoSetPropertyA(), MsiSummaryInfoSetPropertyW(), MsiViewClose(), MsiViewExecute(), MsiViewFetch(), MsiViewGetColumnInfo(), MsiViewGetErrorA(), MsiViewGetErrorW(), MsiViewModify(), patch_add_media(), patch_offset_get_filepatches(), patch_offset_get_files(), patch_offset_modify_db(), patch_set_media_source_prop(), patch_set_offsets(), patch_update_filepatch_sequence(), release_custom_action_data(), resolve_keypath(), SELECT_insert_row(), SELECT_set_row(), TABLE_add_column(), TABLE_drop(), TABLE_remove_column(), ui_actioninfo(), ui_actionstart(), ui_sequence_exists(), UPDATE_delete(), UPDATE_execute(), update_merge_errors(), WHERE_delete(), and WHERE_set_row().

◆ msiobj_unlock()

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msi  )

Variable Documentation

◆ MSI_handle_cs

◆ MSI_handle_cs_debug

CRITICAL_SECTION_DEBUG MSI_handle_cs_debug
static
Initial value:
=
{
0, 0, &MSI_handle_cs,
0, 0, { (DWORD_PTR)(__FILE__ ": MSI_handle_cs") }
}
#define DWORD_PTR
Definition: treelist.c:76
LIST_ENTRY ProcessLocksList
Definition: winbase.h:855
static CRITICAL_SECTION_DEBUG MSI_handle_cs_debug
Definition: handle.c:37
static CRITICAL_SECTION MSI_handle_cs
Definition: handle.c:36

Definition at line 37 of file handle.c.

◆ MSI_object_cs

static CRITICAL_SECTION MSI_object_cs = { &MSI_object_cs_debug, -1, 0, 0, 0, 0 }
static

Definition at line 46 of file handle.c.

Referenced by msi_free_handle_table(), msiobj_lock(), and msiobj_unlock().

◆ MSI_object_cs_debug

CRITICAL_SECTION_DEBUG MSI_object_cs_debug
static
Initial value:
=
{
0, 0, &MSI_object_cs,
0, 0, { (DWORD_PTR)(__FILE__ ": MSI_object_cs") }
}
#define DWORD_PTR
Definition: treelist.c:76
static CRITICAL_SECTION MSI_object_cs
Definition: handle.c:46
LIST_ENTRY ProcessLocksList
Definition: winbase.h:855
static CRITICAL_SECTION_DEBUG MSI_object_cs_debug
Definition: handle.c:47

Definition at line 47 of file handle.c.

◆ msihandletable

◆ msihandletable_size

unsigned int msihandletable_size = 0
static