diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2012-10-22 11:46:58 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2012-12-06 20:25:47 +0100 |
commit | 722565ce6f7bb2361207c43769f27c76864fdae1 (patch) | |
tree | 2bfd0a686beac3d3fbb65b7ba86f5f1f16bb48f6 /libmsi/handle.c | |
parent | 3dc2025a38b7fccd3cec8990bf46710009c9fa38 (diff) | |
download | msitools-722565ce6f7bb2361207c43769f27c76864fdae1.tar.gz msitools-722565ce6f7bb2361207c43769f27c76864fdae1.tar.xz msitools-722565ce6f7bb2361207c43769f27c76864fdae1.zip |
drop OLE Automation support
Diffstat (limited to 'libmsi/handle.c')
-rw-r--r-- | libmsi/handle.c | 89 |
1 files changed, 15 insertions, 74 deletions
diff --git a/libmsi/handle.c b/libmsi/handle.c index 80c6873..381239f 100644 --- a/libmsi/handle.c +++ b/libmsi/handle.c @@ -55,11 +55,7 @@ static CRITICAL_SECTION MSI_object_cs = { &MSI_object_cs_debug, -1, 0, 0, 0, 0 } typedef struct msi_handle_info_t { - BOOL remote; - union { - MSIOBJECTHDR *obj; - IUnknown *unk; - } u; + MSIOBJECTHDR *obj; DWORD dwThreadId; } msi_handle_info; @@ -81,7 +77,7 @@ static MSIHANDLE alloc_handle_table_entry(void) /* find a slot */ for(i=0; i<msihandletable_size; i++) - if( !msihandletable[i].u.obj && !msihandletable[i].u.unk ) + if( !msihandletable[i].obj ) break; if( i==msihandletable_size ) { @@ -118,9 +114,8 @@ MSIHANDLE alloc_msihandle( MSIOBJECTHDR *obj ) { entry = &msihandletable[ ret - 1 ]; msiobj_addref( obj ); - entry->u.obj = obj; + entry->obj = obj; entry->dwThreadId = GetCurrentThreadId(); - entry->remote = FALSE; } LeaveCriticalSection( &MSI_handle_cs ); @@ -130,30 +125,6 @@ MSIHANDLE alloc_msihandle( MSIOBJECTHDR *obj ) return ret; } -MSIHANDLE alloc_msi_remote_handle( IUnknown *unk ) -{ - msi_handle_info *entry; - MSIHANDLE ret; - - EnterCriticalSection( &MSI_handle_cs ); - - ret = alloc_handle_table_entry(); - if (ret) - { - entry = &msihandletable[ ret - 1 ]; - IUnknown_AddRef( unk ); - entry->u.unk = unk; - entry->dwThreadId = GetCurrentThreadId(); - entry->remote = TRUE; - } - - LeaveCriticalSection( &MSI_handle_cs ); - - TRACE("%p -> %d\n", unk, ret); - - return ret; -} - void *msihandle2msiinfo(MSIHANDLE handle, UINT type) { MSIOBJECTHDR *ret = NULL; @@ -162,15 +133,13 @@ void *msihandle2msiinfo(MSIHANDLE handle, UINT type) handle--; if( handle >= msihandletable_size ) goto out; - if( msihandletable[handle].remote) - goto out; - if( !msihandletable[handle].u.obj ) + if( !msihandletable[handle].obj ) goto out; - if( msihandletable[handle].u.obj->magic != MSIHANDLE_MAGIC ) + if( msihandletable[handle].obj->magic != MSIHANDLE_MAGIC ) goto out; - if( type && (msihandletable[handle].u.obj->type != type) ) + if( type && (msihandletable[handle].obj->type != type) ) goto out; - ret = msihandletable[handle].u.obj; + ret = msihandletable[handle].obj; msiobj_addref( ret ); out: @@ -179,26 +148,6 @@ out: return ret; } -IUnknown *msi_get_remote( MSIHANDLE handle ) -{ - IUnknown *unk = NULL; - - EnterCriticalSection( &MSI_handle_cs ); - handle--; - if( handle>=msihandletable_size ) - goto out; - if( !msihandletable[handle].remote) - goto out; - unk = msihandletable[handle].u.unk; - if( unk ) - IUnknown_AddRef( unk ); - -out: - LeaveCriticalSection( &MSI_handle_cs ); - - return unk; -} - void *alloc_msiobject(UINT type, UINT size, msihandledestructor destroy ) { MSIOBJECTHDR *info; @@ -283,25 +232,17 @@ UINT WINAPI MsiCloseHandle(MSIHANDLE handle) if (handle >= msihandletable_size) goto out; - if (msihandletable[handle].remote) - { - IUnknown_Release( msihandletable[handle].u.unk ); - } - else - { - info = msihandletable[handle].u.obj; - if( !info ) - goto out; + info = msihandletable[handle].obj; + if( !info ) + goto out; - if( info->magic != MSIHANDLE_MAGIC ) - { - ERR("Invalid handle!\n"); - goto out; - } + if( info->magic != MSIHANDLE_MAGIC ) + { + ERR("Invalid handle!\n"); + goto out; } - msihandletable[handle].u.obj = NULL; - msihandletable[handle].remote = 0; + msihandletable[handle].obj = NULL; msihandletable[handle].dwThreadId = 0; ret = ERROR_SUCCESS; |