ReactOS  0.4.14-dev-52-g6116262
ifs.c File Reference
#include "config.h"
#include <ctype.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "ole2.h"
#include "winerror.h"
#include "wine/debug.h"
Include dependency graph for ifs.c:

Go to the source code of this file.

Classes

struct  _Malloc32
 

Macros

#define COBJMACROS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (olemalloc)
 
static BOOL SetSpyedBlockTableLength (DWORD NewLength)
 
static BOOL AddMemoryLocation (LPVOID *pMem)
 
static BOOL RemoveMemoryLocation (LPCVOID pMem)
 
static HRESULT WINAPI IMalloc_fnQueryInterface (IMalloc *iface, REFIID refiid, void **obj)
 
static ULONG WINAPI IMalloc_fnAddRefRelease (IMalloc *iface)
 
static void *WINAPI IMalloc_fnAlloc (IMalloc *iface, SIZE_T cb)
 
static void *WINAPI IMalloc_fnRealloc (IMalloc *iface, void *pv, SIZE_T cb)
 
static void WINAPI IMalloc_fnFree (IMalloc *iface, void *pv)
 
static SIZE_T WINAPI IMalloc_fnGetSize (IMalloc *iface, void *pv)
 
static INT WINAPI IMalloc_fnDidAlloc (IMalloc *iface, void *pv)
 
static void WINAPI IMalloc_fnHeapMinimize (IMalloc *iface)
 
HRESULT WINAPI CoGetMalloc (DWORD context, IMalloc **imalloc)
 
LPVOID WINAPI CoTaskMemAlloc (SIZE_T size)
 
VOID WINAPI CoTaskMemFree (LPVOID ptr)
 
LPVOID WINAPI CoTaskMemRealloc (LPVOID pvOld, SIZE_T size)
 
HRESULT WINAPI CoRegisterMallocSpy (LPMALLOCSPY pMallocSpy)
 
HRESULT WINAPI CoRevokeMallocSpy (void)
 
BOOL WINAPI IsValidInterface (LPUNKNOWN punk)
 

Variables

static const IMallocVtbl VT_IMalloc32
 
static _Malloc32 Malloc32 = {{&VT_IMalloc32}, 0, NULL, 0, 0, NULL, 0}
 
static CRITICAL_SECTION IMalloc32_SpyCS = { &critsect_debug, -1, 0, 0, 0, 0 }
 
static CRITICAL_SECTION_DEBUG critsect_debug
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 29 of file ifs.c.

Function Documentation

◆ AddMemoryLocation()

static BOOL AddMemoryLocation ( LPVOID pMem)
static

Definition at line 91 of file ifs.c.

92 {
93  LPVOID * Current;
94 
95  /* allocate the table if not already allocated */
97  return FALSE;
98 
99  /* find a free location */
100  Current = Malloc32.SpyedBlocks;
101  while (*Current) {
102  Current++;
104  /* no more space in table, grow it */
105  DWORD old_length = Malloc32.SpyedBlockTableLength;
107  return FALSE;
108  Current = Malloc32.SpyedBlocks + old_length;
109  }
110  };
111 
112  /* put the location in our table */
113  *Current = pMem;
115  /*TRACE("%lu\n",Malloc32.SpyedAllocationsLeft);*/
116  return TRUE;
117 }
LPVOID * SpyedBlocks
Definition: ifs.c:58
#define TRUE
Definition: types.h:120
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD SpyedBlockTableLength
Definition: ifs.c:59
static BOOL SetSpyedBlockTableLength(DWORD NewLength)
Definition: ifs.c:76
static _Malloc32 Malloc32
Definition: ifs.c:63
DWORD SpyedAllocationsLeft
Definition: ifs.c:56

Referenced by IMalloc_fnAlloc(), and IMalloc_fnRealloc().

◆ CoGetMalloc()

HRESULT WINAPI CoGetMalloc ( DWORD  context,
IMalloc **  imalloc 
)

Definition at line 383 of file ifs.c.

384 {
385  if (context != MEMCTX_TASK) {
386  *imalloc = NULL;
387  return E_INVALIDARG;
388  }
389 
390  *imalloc = &Malloc32.IMalloc_iface;
391  return S_OK;
392 }
Definition: http.c:6587
IMalloc IMalloc_iface
Definition: ifs.c:53
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define S_OK
Definition: intsafe.h:59
static _Malloc32 Malloc32
Definition: ifs.c:63

Referenced by get_malloc(), InitInstance(), SHGetMalloc(), test_CoGetMalloc(), and test_IMallocSpy().

◆ CoRegisterMallocSpy()

HRESULT WINAPI CoRegisterMallocSpy ( LPMALLOCSPY  pMallocSpy)

Definition at line 462 of file ifs.c.

463 {
464  IMallocSpy* pSpy;
466 
467  TRACE("%p\n", pMallocSpy);
468 
469  if(!pMallocSpy) return E_INVALIDARG;
470 
472 
473  if (Malloc32.pSpy)
475  else if (SUCCEEDED(IMallocSpy_QueryInterface(pMallocSpy, &IID_IMallocSpy, (void**)&pSpy))) {
476  Malloc32.pSpy = pSpy;
477  hres = S_OK;
478  }
479 
481 
482  return hres;
483 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION IMalloc32_SpyCS
Definition: ifs.c:66
#define E_INVALIDARG
Definition: ddrawi.h:101
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
IMallocSpy * pSpy
Definition: ifs.c:55
#define S_OK
Definition: intsafe.h:59
static _Malloc32 Malloc32
Definition: ifs.c:63
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define CO_E_OBJISREG
Definition: winerror.h:2815
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST(), and test_IMallocSpy().

◆ CoRevokeMallocSpy()

HRESULT WINAPI CoRevokeMallocSpy ( void  )

Definition at line 502 of file ifs.c.

503 {
504  HRESULT hres = S_OK;
505  TRACE("\n");
506 
508 
509  if (!Malloc32.pSpy)
511  else if (Malloc32.SpyedAllocationsLeft) {
512  TRACE("SpyReleasePending with %u allocations left\n", Malloc32.SpyedAllocationsLeft);
515  } else {
516  IMallocSpy_Release(Malloc32.pSpy);
517  Malloc32.pSpy = NULL;
518  }
520 
521  return hres;
522 }
#define E_ACCESSDENIED
Definition: winerror.h:2849
#define TRUE
Definition: types.h:120
BOOL SpyReleasePending
Definition: ifs.c:57
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION IMalloc32_SpyCS
Definition: ifs.c:66
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define CO_E_OBJNOTREG
Definition: winerror.h:2814
IMallocSpy * pSpy
Definition: ifs.c:55
#define S_OK
Definition: intsafe.h:59
static _Malloc32 Malloc32
Definition: ifs.c:63
DWORD SpyedAllocationsLeft
Definition: ifs.c:56
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

Referenced by START_TEST(), and test_IMallocSpy().

◆ CoTaskMemAlloc()

LPVOID WINAPI CoTaskMemAlloc ( SIZE_T  size)

Definition at line 406 of file ifs.c.

407 {
408  return IMalloc_Alloc(&Malloc32.IMalloc_iface,size);
409 }
IMalloc IMalloc_iface
Definition: ifs.c:53
GLsizeiptr size
Definition: glext.h:5919
static _Malloc32 Malloc32
Definition: ifs.c:63

Referenced by _SHStrDupAA(), _SHStrDupAW(), a2co(), add_data(), CBandSiteBase::AddBand(), CKsProxy::AdvisePeriodic(), CKsProxy::AdviseTime(), alloc_bstr(), ATL::CComAllocator::Allocate(), Allocate_CoTaskMemAlloc(), AMFilterData_ParseFilterData(), AMTimeline_create(), AntiMonikerImpl_GetDisplayName(), AsyncReader_create(), AVIDec_SetMediaType(), AVISplitter_create(), AVISplitter_first_request(), AVISplitter_ProcessIndex(), AVISplitter_ProcessStreamList(), BaseInputPin_Construct(), BaseOutputPin_Construct(), BasePinImpl_QueryId(), BindInfo_GetBindString(), CComCatCachedCategory::CacheDSA(), ClassMoniker_GetDisplayName(), co_strdupAtoW(), co_strdupW(), co_strdupWtoA(), CoDupStrW(), CoInternetGetSecurityUrl(), COMCAT_ICatInformation_GetCategoryDesc(), CompositeMonikerImpl_GetDisplayName(), copy_formatetc(), copy_propbag2(), CopyBindInfo(), CopyIpAddrString(), CopyMediaType(), CopyStgMedium(), create_coclass_obj(), create_disp_obj(), create_EnumMoniker(), create_PropertyBag(), createenumpins(), CreateFilterList(), CreateMediaType(), CreateMultiSzString(), CInputPin::CreatePinHandle(), COutputPin::CreatePinHandle(), CreateRenderingWindow(), CreateStdDispatch(), createtestfilter(), CreateTextServices(), DataCache_EnumCache(), DEVENUM_IEnumMoniker_Next(), DEVENUM_IMediaCatMoniker_Construct(), DEVENUM_IMediaCatMoniker_GetDisplayName(), DEVENUM_IParseDisplayName_ParseDisplayName(), DEVENUM_IPropertyBag_Read(), DEVENUM_ReadPins(), DEVENUM_ReadPinTypes(), CKsProxy::DeviceInfo(), CNetConnection::Disconnect(), DllGetClassObject(), DSoundRender_create(), DuplicateString(), EnumClientServiceProtocol(), CNetConnectionPropertyUi::EnumComponents(), CNetConnectionManager::EnumerateINetConnections(), EnumerateNetworkAdapter(), CEnumRegRoot::EnumerateNext(), CEnumNTDirectory::EnumerateNext(), CNetFolderEnum::EnumerateRec(), EnumFormatImpl_Next(), CPin::EnumMediaTypes(), CInputPin::EnumMediaTypes(), COutputPin::EnumMediaTypes(), EnumMediaTypes_Construct(), EnumMonikerImpl_Create(), EnumOLEVERB_Next(), EnumPins_Construct(), enumverbs_Next(), EventsQueue_Init(), CExtractIcon::Extract(), FileAsyncReader_RequestAllocator(), FileLockBytesImpl_Stat(), FileMonikerImpl_CommonPrefixWith(), FileMonikerImpl_DecomposePath(), FileMonikerImpl_GetDisplayName(), FileSource_GetCurFile(), FileSource_Load(), FilterGraph2_AddFilter(), FilterGraph_create(), FilterMapper2_create(), FilterMapper3_EnumMatchingFilters(), FilterMapper3_RegisterFilter(), FilterMapper_EnumMatchingFilters(), FilterMapper_RegisterPin(), FilterMapper_RegisterPinType(), FilterMapper_UnregisterPin(), find_mime_from_buffer(), find_mime_from_ext(), FM2_ReadFilterData(), FM2_WriteFilterData(), CRegistryFolder::FormatContentsForDisplay(), CRegistryFolder::FormatValueData(), CInputPin::Get(), COutputPin::Get(), CKsProxy::Get(), get_bool_property(), get_file_name(), get_profile_string(), get_property(), get_token(), GetClassFile(), CShellLink::GetCurFile(), CNetConnectionPropertyUi::GetDeviceInstanceID(), CDrivesFolder::GetDisplayNameOf(), CFSFolder::GetDisplayNameOf(), CRegFolder::GetDisplayNameOf(), CAutoComplete::GetDropDownStatus(), CExtractIcon::GetIconLocation(), GetInternalConnections(), GetListViewEntries(), CKsProxy::GetMediaSeekingFormats(), CKsProxy::GetPinName(), CNetConnection::GetProperties(), CInputPin::GetSupportedSets(), COutputPin::GetSupportedSets(), CKsProxy::GetSupportedSets(), hlink_co_strdupW(), HlinkGetSpecialReference(), hls_ref_Moniker_GetDisplayName(), hls_site_Moniker_GetDisplayName(), HttpNegotiate_BeginningTransaction(), IAudioDataImpl_SetBuffer(), IClassFactory_fnConstructor(), IDispatch_Invoke_Proxy(), IDispatch_Invoke_Stub(), IEnumDMO_fnNext(), IEnumFiltersImpl_Construct(), IEnumMediaTypesImpl_Construct(), IEnumMediaTypesImpl_Reset(), IEnumNetCfgBindingInterface_Constructor(), IEnumNetCfgBindingPath_Constructor(), IEnumNetCfgComponent_Constructor(), IEnumRegFiltersImpl_Construct(), IEnumRegFiltersImpl_Next(), IFileDialogCustomize_fnGetEditBoxText(), INetCfg_Constructor(), INetCfgBindingInterface_Constructor(), INetCfgBindingPath_Constructor(), INetCfgComponent_Constructor(), INetCfgComponent_fnGetBindName(), INetCfgComponent_fnGetDisplayName(), INetCfgComponent_fnGetHelpText(), INetCfgComponent_fnGetId(), INetCfgComponent_fnGetPnpDevNodeId(), INetCfgComponent_fnSetDisplayName(), INetCfgComponentControl_fnApplyRegistryChanges(), INetCfgComponentPropertyUi_fnMergePropPages(), INetCfgLock_fnAcquireWriteLock(), INetCfgLock_fnIsWriteLocked(), info_device_ps_GetValue(), init_texthost(), CNetConnection::Initialize(), Initialize(), CLanStatus::InitializeNetTaskbarNotifications(), InitializePropertyDialog(), InitPropVariantFromBuffer(), InitPropVariantFromCLSID(), InitPropVariantFromGUIDAsString(), InputProcessorProfiles_GetLanguageList(), InstallEngine_EnumDownloadIDs(), InternetBindInfo_GetBindString(), InternetHostSecurityManager_QueryCustomPolicy(), COutputPin::IoProcessRoutine(), IPersistFile_fnGetCurFile(), IPropertyStorage_fnReadPropertyNames(), ItemMonikerImpl_GetDisplayName(), ITS_IMonikerImpl_GetDisplayName(), ITSS_IEnumSTATSTG_Next(), KsGetMediaType(), KsGetMultiplePinFactoryItems(), CKsInterfaceHandler::KsProcessMediaSamples(), CKsDataTypeHandler::KsSetMediaType(), LANStatusUiDetailsDlg(), CKsProxy::Load(), LoadDNSSettings(), LoadFilterSettings(), CComCatCachedCategory::LoadFromRegistry(), CShellBrowser::LoadHistory(), LoadTcpFilterSettingsFromRegistry(), MakeStrRetFromString(), map_url_to_zone(), ME_CreateTextHost(), MediaDet_create(), mediaenum_create(), MimeAlloc_Alloc(), MimeInternat_ConvertBuffer(), MimeInternat_ConvertString(), MimeMessage_GetAttachments(), MMDevice_GetId(), MMDevice_GetPropValue(), MMDevPropStore_GetValue(), MoCopyMediaType(), MoCreateMediaType(), MoDuplicateMediaType(), MoInitMediaType(), Moniker_GetDisplayName(), MPEGSplitter_create(), MPEGSplitter_init_audio(), MSTASK_ITask_GetAccountInformation(), MSTASK_ITask_GetApplicationName(), MSTASK_ITask_GetComment(), MSTASK_ITask_GetParameters(), MSTASK_ITaskScheduler_GetTargetComputer(), CLayerStringList::Next(), CEnumMediaTypes::Next(), CEnumRegKey::NextKey(), CEnumRegKey::NextValue(), nsChannelBSC_beginning_transaction(), NullRenderer_create(), OleMetafilePictFromIconAndLabel(), oleobject_GetUserType(), OleRegGetUserType(), CSearchBar::OnSearchButtonClicked(), parse_security_url(), Parser_AddPin(), Parser_Create(), Parser_RemoveOutputPins(), PMemoryAllocator_Allocate(), PosPassThru_Construct(), ProgIDFromCLSID(), prop_enum_copy_cb(), PropertyStorage_StringCopy(), PropVariantChangeType(), PropVariantCopy(), PropVariantToStringAlloc(), ProtocolStream_Stat(), PullPin_Construct(), CIPV6Filter::PutMulticastList(), CIPV4Filter::PutMulticastList(), CEthernetFilter::PutMulticastList(), QUARTZ_CreateSystemClock(), CPin::QueryId(), CInputPin::QueryId(), COutputPin::QueryId(), ReadBindingString(), ReadRegistryValue(), RecycleBin5_Constructor(), RecycleBin5_RecycleBin5_DeleteFile(), RecycleBin5Enum_Constructor(), RecycleBin5File_Constructor(), RecycleBinGeneric_Constructor(), RecycleBinGeneric_RecycleBin_DeleteFile(), RecycleBinGenericEnum_Constructor(), register_codecs(), register_filters(), RemUnknown_RemQueryInterface(), CNetConnection::Rename(), return_strval(), SAFEARRAY_Malloc(), SampleGrabber_callback(), SampleGrabber_create(), SampleGrabber_IBaseFilter_QueryVendorInfo(), SampleGrabber_In_IPin_ReceiveConnection(), SampleGrabber_IPin_ConnectionMediaType(), SampleGrabber_IPin_QueryId(), SampleGrabber_ISampleGrabber_GetConnectedMediaType(), SampleGrabber_ISampleGrabber_SetMediaType(), CInputPin::Set(), COutputPin::Set(), CKsProxy::Set(), SHAlloc(), SHGetNameFromIDList(), SHStrDupA(), SHStrDupW(), Single_IEnumMediaTypes_Next(), StdMediaSample2_Construct(), StdMediaSample2_GetMediaType(), StdMediaSample2_SetMediaType(), StdMemAllocator_create(), STGMEDIUM_UserUnmarshal(), StorageUtl_CopyDirEntryToSTATSTG(), StoreDNSSettings(), StoreIPSettings(), StoreTcpipBasicSettings(), StoreTcpipFilterSettings(), strdup_AtoW(), STREAM_ReadString(), STREAM_WriteString(), string_enumerator_Next(), StringFromCLSID(), SystemClockImpl_AdvisePeriodic(), SystemClockImpl_AdviseTime(), TcpipAddSuffixDlg(), TcpipAdvancedDnsDlg(), TcpipConfigNotify_Constructor(), test_Alloc(), test_BodyDeleteProp(), test_bstr_cache(), test_ClearCustData(), test_CopyBindInfo(), test_DispCallFunc(), test_knownFolders(), test_marshal_VARIANT(), test_MessageGetPropInfo(), test_MessageOptions(), test_MessageSetProp(), test_metadata_tEXt(), test_PropVariantChangeType_LPWSTR(), test_PropVariantToStringAlloc(), TestACL_Constructor(), TestFilter_Pin_Construct(), TestLockBytes_Stat(), Timeline_IAMTimeline_CreateEmptyNode(), TLB_copy_all_custdata(), TransformFilter_Construct(), TransformFilter_Init(), URLMoniker_GetDisplayName(), user_allocate(), VARIANT_UserUnmarshal(), VideoRenderer_create(), VMR9DefaultAllocatorPresenterImpl_create(), vmr_create(), WAVEParser_create(), WAVEParser_InputPin_PreConnect(), and Widget_int_ptr_ptr().

◆ CoTaskMemFree()

VOID WINAPI CoTaskMemFree ( LPVOID  ptr)

Definition at line 422 of file ifs.c.

423 {
424  IMalloc_Free(&Malloc32.IMalloc_iface, ptr);
425 }
IMalloc IMalloc_iface
Definition: ifs.c:53
static PVOID ptr
Definition: dispmode.c:27
static _Malloc32 Malloc32
Definition: ifs.c:63

Referenced by _check_custom_policy(), CFSDropTarget::_CopyItems(), _test_GetCurMoniker(), _test_urlmon_display_name(), add_data(), add_storages_to_table(), CBandSiteBase::AddBand(), CKsProxy::AdvisePeriodic(), CKsProxy::AdviseTime(), AMFilterData_ParseFilterData(), ApplyOrCancelChanges(), AsyncReader_Release(), AVIDec_BreakConnect(), AVISplitter_Disconnect(), AVISplitter_InputPin_PreConnect(), AVISplitter_ProcessOldIndex(), AVISplitter_ProcessStreamList(), BaseInputPin_Construct(), BaseInputPin_Destroy(), BaseOutputPin_Construct(), BaseOutputPin_Destroy(), CEnumMergedFolder::Begin(), bind_to_object(), BindProtocol_StartEx(), BSCHttpNegotiate_OnResponse(), CDirectSoundCapture_fnInitialize(), CDirectSoundCapture_fnQueryInterface(), CEnumMediaTypes_fnConstructor(), CGuidItemExtractIcon_CreateInstance(), check_display_name_(), check_dropdown_(), check_load_safety(), check_script_safety(), check_storage_contents(), CInputPin::CheckFormat(), COutputPin::CheckFormat(), ChooseFolder(), ClassMoniker_IsEqual(), ClearCustData(), ClientIdentity_QueryMultipleInterfaces(), CISFBand::CloseDW(), coclass1_Release(), CoInternetGetSecurityUrl(), CoInternetGetSecurityUrlEx(), COMCAT_ICatInformation_GetCategoryDesc(), COMDLG32_StrRetToStrNW(), CompositeMonikerImpl_GetDisplayName(), COutputPin::Connect(), CopyBindInfo(), CopyIpAddrString(), count_moniker_matches(), create_activex_object(), create_configuration(), create_EnumSTATPROPSETSTG(), create_internet_session(), create_object(), CreateMediaType(), CreateNotificationObject(), CInputPin::CreatePin(), COutputPin::CreatePin(), CInputPin::CreatePinHandle(), COutputPin::CreatePinHandle(), CKsProxy::CreatePins(), createtestfilter(), DataCache_EnumCache(), DataCacheEntry_Destroy(), delete_vector(), DeleteMediaType(), deleteStorageContents(), DEVENUM_IEnumMoniker_Release(), DEVENUM_IMediaCatMoniker_BindToObject(), DEVENUM_IMediaCatMoniker_IsEqual(), DEVENUM_IMediaCatMoniker_Release(), DEVENUM_IPropertyBag_Release(), DEVENUM_ReadPins(), DEVENUM_ReadPinTypes(), CNetConnection::Disconnect(), disp_obj_Release(), DllGetClassObject(), DllRegisterServer(), DllUnregisterServer(), CEnumMergedFolder::DsaDeleteCallback(), DSCF_Release(), DSoundRender_create(), DSoundRender_Release(), DuplicateString(), enum_stream_names(), CNetConnectionPropertyUi::EnumComponents(), CNetConnectionManager::EnumerateINetConnections(), EnumerateNetworkComponent(), CNetFolderEnum::EnumerateRec(), CInputPin::EnumMediaTypes(), COutputPin::EnumMediaTypes(), EnumMonikerImpl_Release(), EnumOLEVERB_Next(), EventsQueue_Destroy(), ExploreGraph(), CExtractIcon::Extract(), FileAsyncReader_RequestAllocator(), FileAsyncReaderPin_Release(), FILEDLG95_InitControls(), FileExtractDialogWndProc(), FileMonikerImpl_BindToStorage(), FileMonikerImpl_CommonPrefixWith(), FileMonikerImpl_ComposeWith(), FileMonikerImpl_DecomposePath(), FileMonikerImpl_IsEqual(), FileMonikerImpl_RelativePathTo(), FileProtocol_StartEx(), FileSource_Load(), fill_filename_from_selection(), fill_filter_data_information(), CMenuSFToolbar::FillToolbar(), FilterGraph2_AddFilter(), FilterGraph2_Connect(), FilterGraph2_RemoveFilter(), FilterGraph_create(), FilterGraphInner_Release(), FilterMapper3_CreateCategory(), FilterMapper3_EnumMatchingFilters(), FilterMapper3_RegisterFilter(), FilterMapper3_UnregisterFilter(), FilterMapper_EnumMatchingFilters(), FilterMapper_RegisterFilter(), FilterMapper_RegisterPin(), FilterMapper_RegisterPinType(), FilterMapper_UnregisterFilter(), FilterMapper_UnregisterPin(), find_mime_from_buffer(), FM2_DeleteRegFilter(), FM2_WriteClsid(), CRegistryFolder::FormatContentsForDisplay(), ATL::CComAllocator::Free(), free_embedded_arraydesc(), free_embedded_elemdesc(), free_embedded_typedesc(), free_regfilter2(), free_stringtable(), free_structure(), FreeIPAddr(), FreeKnownFolderDefinitionFields(), FreeMediaType(), CInputPin::Get(), COutputPin::Get(), CKsProxy::Get(), get_moniker_comparison_data(), get_next_insertable_verb(), get_profile_string(), get_security_id_for_url(), GetClassFile(), CRegistryFolder::GetDetailsEx(), CRegistryFolder::GetDetailsOf(), CNetConnectionPropertyUi::GetDeviceInstanceID(), CDrivesFolder::GetDisplayNameOf(), CRegFolder::GetDisplayNameOf(), CExtractIcon::GetIconLocation(), CNetConnectionPropertyUi::GetINetCfgComponent(), GetListViewEntries(), CKsProxy::GetMediaSeekingFormats(), CKsProxy::GetPinName(), CNetConnection::GetProperties(), GetSplitter(), CInputPin::GetSupportedSets(), COutputPin::GetSupportedSets(), CKsProxy::GetSupportedSets(), guid2string(), HCR_GetClassNameA(), HCR_GetClassNameW(), HCR_GetFolderAttributes(), HlinkBrowseContext_GetObject(), HlinkClone(), HlinkFrame_Navigate(), HlinkGetSpecialReference(), HlinkResolveMonikerForData(), HlinkSimpleNavigateToMoniker(), hls_site_Moniker_ComposeWith(), HTMLPrivateWindow_SuperNavigate(), HttpProtocol_open_request(), IAMMultiMediaStreamImpl_Release(), IAudioDataImpl_Release(), IAudioDataImpl_SetBuffer(), IClassFactory_fnRelease(), ICommDlgBrowser3_fnIncludeObject(), IDirectSound8_fnInitialize(), IDirectSound8_fnQueryInterface(), IDirectSoundCaptureBufferImpl_QueryInterface(), IDispatch_Invoke_Proxy(), IDispatch_Invoke_Stub(), IEnumFiltersImpl_Release(), IEnumMediaTypesImpl_Construct(), IEnumMediaTypesImpl_Release(), IEnumMediaTypesImpl_Reset(), IEnumPinsImpl_Release(), IEnumRegFiltersImpl_Construct(), IEnumRegFiltersImpl_Next(), IEnumRegFiltersImpl_Release(), IHlink_fnNavigate(), IHlink_fnSetMonikerReference(), INetCfg_fnRelease(), INetCfgBindingInterface_fnRelease(), INetCfgBindingPath_fnRelease(), INetCfgComponent_fnRaisePropertyUi(), INetCfgComponent_fnRelease(), INetCfgComponent_fnSetDisplayName(), INetCfgComponentControl_fnApplyRegistryChanges(), INetCfgComponentPropertyUi_fnMergePropPages(), INetCfgComponentPropertyUi_fnRelease(), init_texthost(), Initialize(), CNetConnectionPropertyUi::InitializeLANPropertiesUIDlg(), CLanStatus::InitializeNetTaskbarNotifications(), InitializePropertyDialog(), Inner_Release(), InstallTypicalNetworkSettings(), CKsProxy::IsFormatSupported(), ItemMonikerImpl_IsEqual(), ITextHostImpl_Release(), ITextServicesImpl_Release(), ITSProtocol_Start(), ITypeInfo_ReleaseFuncDesc_Proxy(), ITypeInfo_ReleaseTypeAttr_Proxy(), ITypeInfo_ReleaseVarDesc_Proxy(), ITypeLib_ReleaseTLibAttr_Proxy(), CKsInterfaceHandler::KsCompleteIo(), KsGetMediaType(), KsGetMediaTypeCount(), KsGetMultiplePinFactoryItems(), CKsInterfaceHandler::KsProcessMediaSamples(), KSPropertySetImpl_fnQueryInterface(), KSPropertySetImpl_Get(), CKsDataTypeHandler::KsSetMediaType(), CInputPin::KsSetPinFramingCache(), COutputPin::KsSetPinFramingCache(), CNetConnectionPropertyUi::LANPropertiesUIDlg(), LANStatusUiDetailsDlg(), CKsProxy::Load(), load_devices_from_reg(), load_mapping_settings(), load_streams(), LoadDNSSettings(), LoadFilterSettings(), CInputPin::LoadProxyPlugins(), COutputPin::LoadProxyPlugins(), CKsProxy::LoadProxyPlugins(), LoadRdpSettingsFromFile(), LoadTcpFilterSettingsFromRegistry(), map_url_to_zone(), MediaDet_get_Filename(), MediaDet_get_FrameRate(), MediaDet_get_StreamMediaType(), MediaDet_inner_Release(), MediaStreamFilterImpl_Release(), MimeAlloc_Free(), MimeInternat_ConvertBuffer(), MimeInternat_ConvertString(), MimeProtocol_Start(), MkProtocol_StartEx(), MMDevEnum_GetDevice(), MoCreateMediaType(), MoDeleteMediaType(), MoFreeMediaType(), anonymous_namespace{mstscax.cpp}::MonikerToString(), MPEGSplitter_create(), MPEGSplitter_pre_connect(), msi_table_apply_transform(), MSTASK_ITaskScheduler_GetTargetComputer(), navigate_hlink(), NcFreeNetconProperties(), NewDirectSound(), NewDirectSoundCapture(), NewKsPropertySet(), CEnumMediaTypes::Next(), notify_if_changed(), NullRenderer_create(), NullRendererInner_Release(), OLE_FreeClipDataArray(), OLECONVERT_GetOLE10ProgID(), OleCreateStaticFromData(), OleDoAutoConvert(), OleMetafilePictFromIconAndLabel(), OleObject_SetClientSite(), OleRegGetUserType(), OleUIAddVerbMenuW(), on_command_filetype(), on_default_action(), parse_security_url(), Parser_AddPin(), Parser_Create(), Parser_Destroy(), Parser_OutputPin_Release(), Parser_RemoveOutputPins(), PersistFile_Load(), PersistFile_Save(), PMemoryAllocator_Free(), PrimaryDirectSoundBuffer8Impl_fnQueryInterface(), ProgIDFromCLSID(), PropertyBag_GetPropertyInfo(), PropertyBag_Release(), PropertyStorage_FindPropertyByName(), PropertyStorage_PropNameDestroy(), PropertyStorage_StringCopy(), PropVariantChangeType(), PropVariantClear(), Protocol_Start(), protocol_start(), ProtocolSinkHandler_ReportData(), proxy_manager_destroy(), Proxy_MarshalInterface(), PullPin_Construct(), PullPin_Release(), CIPV4Filter::PutMulticastList(), CIPV6Filter::PutMulticastList(), CEthernetFilter::PutMulticastList(), CScanningTunner::QueryInterface(), CEnumTuningSpaces::QueryInterface(), CTuneRequest::QueryInterface(), CTuningSpace::QueryInterface(), CTuningSpaceContainer::QueryInterface(), CControlNode::QueryInterface(), CPin::QueryInterface(), CBDALNBInfo::QueryInterface(), CBDADigitalDemodulator::QueryInterface(), CBDAFrequencyFilter::QueryInterface(), CNetworkProvider::QueryInterface(), COutputPin::QueryInterface(), CInputPin::QueryInterface(), CKsProxy::QueryInterface(), CKsProxy::QueryPreferredFormat(), r_getMonikerRef(), r_getStringRef(), read_stream_data(), ReadFmtUserTypeStg(), ReadRegistryValue(), RecycleBin5_Destructor(), RecycleBin5_RecycleBin5_DeleteFile(), RecycleBin5Enum_Constructor(), RecycleBin5Enum_Destructor(), RecycleBin5File_Destructor(), RecycleBinGeneric_Destructor(), RecycleBinGeneric_RecycleBin_DeleteFile(), RecycleBinGenericEnum_Destructor(), reg_context_menu_handler(), reg_icon_overlay(), reg_prop_sheet_handler(), reg_unreg_wine_test_class(), register_clsid(), register_codecs(), register_filters(), release_statdata(), ReleaseBindInfo(), ReleaseStgMedium(), CNetConnection::Rename(), render_embed_source_hack(), ResProtocol_Start(), SAFEARRAY_Free(), SampleGrabber_callback(), SampleGrabber_cleanup(), SampleGrabber_In_IPin_ReceiveConnection(), SampleGrabber_ISampleGrabber_SetMediaType(), SampleGrabber_Release(), save_mapping_settings(), SaveRdpSettingsToFile(), SecondaryDirectSoundBuffer8Impl_fnQueryInterface(), SeekInner_Release(), CInputPin::Set(), COutputPin::Set(), CKsProxy::Set(), set_clipboard_formats(), set_current_mon(), set_downloading_task_destr(), set_format(), set_moniker(), CRegFolder::SetNameOf(), shell_item_exists(), ShellExecCmdLine(), SHEmptyRecycleBinW(), SHFree(), SHGetNameFromIDList(), SHGetObjectCompatFlags(), Single_IEnumMediaTypes_Release(), statusclb_OnDataAvailable(), StdDispatch_Release(), StdMediaSample2_Delete(), StdMemAllocator_create(), StdMemAllocator_Destroy(), StgOpenStorage(), StoreTcpipBasicSettings(), STREAM_ReadString(), STREAM_WriteString(), StrRetToBSTR(), StrRetToBufA(), StrRetToBufW(), StrRetToStrA(), StrRetToStrNA(), StrRetToStrNW(), StrRetToStrW(), stub_manager_delete(), SysFreeString(), SystemClockAdviseThread(), SystemClockImpl_Release(), SystemClockImpl_Unadvise(), TcpipAddSuffixDlg(), TcpipAdvancedDnsDlg(), TcpipFilterSettingsDlg(), test_ACLMulti(), test_assoc_one(), test_audioclient(), test_basics(), test_BindToObject(), test_BindToStorage(), test_cf_dataobject(), test_channelvolume(), test_click_make_new_folder_button(), test_client_security(), test_clock(), test_collection(), test_convert(), test_CopyBindInfo(), test_CreateMessage(), test_customize(), test_deviceinterface(), test_DispCallFunc(), test_encoder_properties(), test_enum_fmtetc(), test_event(), test_filename_opendlg_(), test_filename_savedlg_(), test_filesourcefilter(), test_FindMimeFromData(), test_fmtusertypestg(), test_formats(), test_GetLocalName(), test_GetName(), test_GetRemoteName(), test_GetTargetComputer(), test_globalness(), test_HlinkClone(), test_HlinkCreateExtensionServices(), test_HlinkGetSetMonikerReference(), test_HlinkGetSetStringReference(), test_HlinkParseDisplayName(), test_HttpOptions(), test_IApplicationAssociationRegistration_QueryCurrentDefault(), test_InitPropVariantFromGUIDAsString(), test_InternetGetSecurityUrl(), test_knownFolders(), test_marshal(), test_marshal_pointer(), test_mediadet(), test_mhtml_message(), test_MimeOleObjectFromMoniker(), test_MkParseDisplayNameEx(), test_mon_displayname(), test_moniker(), test_namespace(), test_NameSpace(), test_OleRegGetUserType(), test_overwrite(), test_padding(), test_parse_filter_data(), test_ParseDisplayName(), test_persistserialized(), test_ProgIDFromCLSID(), test_propertybag_getpropertyinfo(), test_propertystore(), test_PropVariantToStringAlloc(), test_reference(), test_references(), test_selection(), test_session(), test_session_creation(), test_SetAccountInformation_GetAccountInformation(), test_SetApplicationName_GetApplicationName(), test_SetComment_GetComment(), test_SetInitialHlink(), test_SetParameters_GetParameters(), test_SetTargetComputer(), test_setvalue_on_wow64(), test_SHCreateShellItem(), test_SHCreateShellItemArray(), test_ShellFolderViewDual(), test_SHGetFolderPathEx(), test_SHGetNameFromIDList(), test_simplevolume(), test_special_reference(), test_StdHlink(), test_storage_refcount(), test_stream_read_write(), test_streamenum(), test_streamvolume(), test_toplevel_stat(), test_volume_dependence(), test_worst_case(), TestFilter_Pin_Release(), TestFilter_Release(), Timeline_Release(), TimelineObj_Release(), TransformFilter_Construct(), TransformFilter_Init(), TransformFilterImpl_Release(), translate_uri(), translate_url(), CKsProxy::Unadvise(), UniformResourceLocatorA_SetUrl(), UniformResourceLocatorW_SetUrl(), Unknown_Release(), unregister_clsid(), URLMoniker_IsEqual(), user_free(), anonymous_namespace{mstscax.cpp}::UUIDToString(), VARIANT_UserFree(), VideoRenderer_create(), VideoRendererInner_Release(), VMR9_ImagePresenter_Release(), VMR9DefaultAllocatorPresenterImpl_create(), VMR9Inner_Release(), vmr_create(), WAVEParser_InputPin_PreConnect(), WelcomeDlgProc(), write_filter_data(), WriteFmtUserTypeStg(), WshCollection_Item(), CACLMulti::~CACLMulti(), CBandSiteBase::~CBandSiteBase(), CDefaultContextMenu::~CDefaultContextMenu(), CEthernetFilter::~CEthernetFilter(), CExtractIcon::~CExtractIcon(), CIPV4Filter::~CIPV4Filter(), CIPV6Filter::~CIPV6Filter(), CKsDataTypeHandler::~CKsDataTypeHandler(), and CNetConnection::~CNetConnection().

◆ CoTaskMemRealloc()

◆ IMalloc_fnAddRefRelease()

static ULONG WINAPI IMalloc_fnAddRefRelease ( IMalloc iface)
static

Definition at line 160 of file ifs.c.

161 {
162  return 1;
163 }

◆ IMalloc_fnAlloc()

static void* WINAPI IMalloc_fnAlloc ( IMalloc iface,
SIZE_T  cb 
)
static

Definition at line 168 of file ifs.c.

169 {
170  void *addr;
171 
172  TRACE("(%ld)\n",cb);
173 
174  if(Malloc32.pSpy) {
175  SIZE_T preAllocResult;
176 
178  preAllocResult = IMallocSpy_PreAlloc(Malloc32.pSpy, cb);
179  if ((cb != 0) && (preAllocResult == 0)) {
180  /* PreAlloc can force Alloc to fail, but not if cb == 0 */
181  TRACE("returning null\n");
183  return NULL;
184  }
185  }
186 
188 
189  if(Malloc32.pSpy) {
190  addr = IMallocSpy_PostAlloc(Malloc32.pSpy, addr);
193  }
194 
195  TRACE("--(%p)\n",addr);
196  return addr;
197 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION IMalloc32_SpyCS
Definition: ifs.c:66
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static DWORD cb
Definition: integrity.c:41
GLenum const GLvoid * addr
Definition: glext.h:9621
IMallocSpy * pSpy
Definition: ifs.c:55
ULONG_PTR SIZE_T
Definition: typedefs.h:78
static _Malloc32 Malloc32
Definition: ifs.c:63
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static BOOL AddMemoryLocation(LPVOID *pMem)
Definition: ifs.c:91

◆ IMalloc_fnDidAlloc()

static INT WINAPI IMalloc_fnDidAlloc ( IMalloc iface,
void pv 
)
static

Definition at line 318 of file ifs.c.

319 {
320  BOOL fSpyed = FALSE;
321  int didAlloc;
322 
323  TRACE("(%p)\n",pv);
324 
325  if(Malloc32.pSpy) {
327  pv = IMallocSpy_PreDidAlloc(Malloc32.pSpy, pv, fSpyed);
328  }
329 
330  didAlloc = -1;
331 
332  if(Malloc32.pSpy) {
333  didAlloc = IMallocSpy_PostDidAlloc(Malloc32.pSpy, pv, fSpyed, didAlloc);
335  }
336  return didAlloc;
337 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION IMalloc32_SpyCS
Definition: ifs.c:66
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
IMallocSpy * pSpy
Definition: ifs.c:55
static _Malloc32 Malloc32
Definition: ifs.c:63
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ IMalloc_fnFree()

static void WINAPI IMalloc_fnFree ( IMalloc iface,
void pv 
)
static

Definition at line 254 of file ifs.c.

255 {
256  BOOL fSpyed = FALSE;
257 
258  TRACE("(%p)\n",pv);
259 
260  if(!pv)
261  return;
262 
263  if(Malloc32.pSpy) {
265  fSpyed = RemoveMemoryLocation(pv);
266  pv = IMallocSpy_PreFree(Malloc32.pSpy, pv, fSpyed);
267  }
268 
269  HeapFree(GetProcessHeap(),0,pv);
270 
271  if(Malloc32.pSpy) {
272  IMallocSpy_PostFree(Malloc32.pSpy, fSpyed);
273 
274  /* check if can release the spy */
276  IMallocSpy_Release(Malloc32.pSpy);
278  Malloc32.pSpy = NULL;
279  }
280 
282  }
283 }
BOOL SpyReleasePending
Definition: ifs.c:57
static BOOL RemoveMemoryLocation(LPCVOID pMem)
Definition: ifs.c:119
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION IMalloc32_SpyCS
Definition: ifs.c:66
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
IMallocSpy * pSpy
Definition: ifs.c:55
static _Malloc32 Malloc32
Definition: ifs.c:63
DWORD SpyedAllocationsLeft
Definition: ifs.c:56
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ IMalloc_fnGetSize()

static SIZE_T WINAPI IMalloc_fnGetSize ( IMalloc iface,
void pv 
)
static

Definition at line 293 of file ifs.c.

294 {
295  SIZE_T cb;
296  BOOL fSpyed = FALSE;
297 
298  TRACE("(%p)\n",pv);
299 
300  if(Malloc32.pSpy) {
302  pv = IMallocSpy_PreGetSize(Malloc32.pSpy, pv, fSpyed);
303  }
304 
305  cb = HeapSize(GetProcessHeap(),0,pv);
306 
307  if(Malloc32.pSpy) {
308  cb = IMallocSpy_PostGetSize(Malloc32.pSpy, cb, fSpyed);
310  }
311 
312  return cb;
313 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
SIZE_T WINAPI HeapSize(HANDLE, DWORD, LPCVOID)
static CRITICAL_SECTION IMalloc32_SpyCS
Definition: ifs.c:66
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
static DWORD cb
Definition: integrity.c:41
IMallocSpy * pSpy
Definition: ifs.c:55
ULONG_PTR SIZE_T
Definition: typedefs.h:78
static _Malloc32 Malloc32
Definition: ifs.c:63
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ IMalloc_fnHeapMinimize()

static void WINAPI IMalloc_fnHeapMinimize ( IMalloc iface)
static

Definition at line 342 of file ifs.c.

343 {
344  TRACE("()\n");
345 
346  if(Malloc32.pSpy) {
348  IMallocSpy_PreHeapMinimize(Malloc32.pSpy);
349  }
350 
351  if(Malloc32.pSpy) {
352  IMallocSpy_PostHeapMinimize(Malloc32.pSpy);
354  }
355 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION IMalloc32_SpyCS
Definition: ifs.c:66
#define TRACE(s)
Definition: solgame.cpp:4
IMallocSpy * pSpy
Definition: ifs.c:55
static _Malloc32 Malloc32
Definition: ifs.c:63
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ IMalloc_fnQueryInterface()

static HRESULT WINAPI IMalloc_fnQueryInterface ( IMalloc iface,
REFIID  refiid,
void **  obj 
)
static

Definition at line 146 of file ifs.c.

147 {
148  TRACE("(%s,%p)\n",debugstr_guid(refiid),obj);
149 
150  if (IsEqualIID(&IID_IUnknown,refiid) || IsEqualIID(&IID_IMalloc,refiid)) {
151  *obj = &Malloc32;
152  return S_OK;
153  }
154  return E_NOINTERFACE;
155 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
static _Malloc32 Malloc32
Definition: ifs.c:63
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ IMalloc_fnRealloc()

static void* WINAPI IMalloc_fnRealloc ( IMalloc iface,
void pv,
SIZE_T  cb 
)
static

Definition at line 202 of file ifs.c.

203 {
204  void *pNewMemory;
205 
206  TRACE("(%p,%ld)\n",pv,cb);
207 
208  if(Malloc32.pSpy) {
209  void *pRealMemory;
210  BOOL fSpyed;
211 
213  fSpyed = RemoveMemoryLocation(pv);
214  cb = IMallocSpy_PreRealloc(Malloc32.pSpy, pv, cb, &pRealMemory, fSpyed);
215 
216  /* check if can release the spy */
218  IMallocSpy_Release(Malloc32.pSpy);
220  Malloc32.pSpy = NULL;
222  }
223 
224  if (0==cb) {
225  /* PreRealloc can force Realloc to fail */
226  if (Malloc32.pSpy)
228  return NULL;
229  }
230 
231  pv = pRealMemory;
232  }
233 
234  if (!pv) pNewMemory = HeapAlloc(GetProcessHeap(),0,cb);
235  else if (cb) pNewMemory = HeapReAlloc(GetProcessHeap(),0,pv,cb);
236  else {
237  HeapFree(GetProcessHeap(),0,pv);
238  pNewMemory = NULL;
239  }
240 
241  if(Malloc32.pSpy) {
242  pNewMemory = IMallocSpy_PostRealloc(Malloc32.pSpy, pNewMemory, TRUE);
243  if (pNewMemory) AddMemoryLocation(pNewMemory);
245  }
246 
247  TRACE("--(%p)\n",pNewMemory);
248  return pNewMemory;
249 }
#define TRUE
Definition: types.h:120
BOOL SpyReleasePending
Definition: ifs.c:57
static BOOL RemoveMemoryLocation(LPCVOID pMem)
Definition: ifs.c:119
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION IMalloc32_SpyCS
Definition: ifs.c:66
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static DWORD cb
Definition: integrity.c:41
IMallocSpy * pSpy
Definition: ifs.c:55
static _Malloc32 Malloc32
Definition: ifs.c:63
#define HeapReAlloc
Definition: compat.h:393
DWORD SpyedAllocationsLeft
Definition: ifs.c:56
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define HeapFree(x, y, z)
Definition: compat.h:394
static BOOL AddMemoryLocation(LPVOID *pMem)
Definition: ifs.c:91

◆ IsValidInterface()

BOOL WINAPI IsValidInterface ( LPUNKNOWN  punk)

Definition at line 535 of file ifs.c.

536 {
537  return !(
538  IsBadReadPtr(punk,4) ||
539  IsBadReadPtr(punk->lpVtbl,4) ||
540  IsBadReadPtr(punk->lpVtbl->QueryInterface,9) ||
541  IsBadCodePtr((FARPROC)punk->lpVtbl->QueryInterface)
542  );
543 }
BOOL NTAPI IsBadCodePtr(FARPROC lpfn)
Definition: except.c:874
BOOL WINAPI IsBadReadPtr(IN LPCVOID lp, IN UINT_PTR ucb)
Definition: except.c:807
int(* FARPROC)()
Definition: compat.h:28

Referenced by MkParseDisplayName().

◆ RemoveMemoryLocation()

static BOOL RemoveMemoryLocation ( LPCVOID  pMem)
static

Definition at line 119 of file ifs.c.

120 {
121  LPVOID * Current;
122 
123  /* allocate the table if not already allocated */
125  return FALSE;
126 
127  Current = Malloc32.SpyedBlocks;
128 
129  /* find the location */
130  while (*Current != pMem) {
131  Current++;
133  return FALSE; /* not found */
134  }
135 
136  /* location found */
138  /*TRACE("%lu\n",Malloc32.SpyedAllocationsLeft);*/
139  *Current = NULL;
140  return TRUE;
141 }
LPVOID * SpyedBlocks
Definition: ifs.c:58
#define TRUE
Definition: types.h:120
smooth NULL
Definition: ftsmooth.c:416
DWORD SpyedBlockTableLength
Definition: ifs.c:59
static BOOL SetSpyedBlockTableLength(DWORD NewLength)
Definition: ifs.c:76
static _Malloc32 Malloc32
Definition: ifs.c:63
DWORD SpyedAllocationsLeft
Definition: ifs.c:56

Referenced by IMalloc_fnFree(), and IMalloc_fnRealloc().

◆ SetSpyedBlockTableLength()

static BOOL SetSpyedBlockTableLength ( DWORD  NewLength)
static

Definition at line 76 of file ifs.c.

77 {
78  LPVOID *NewSpyedBlocks;
79 
80  if (!Malloc32.SpyedBlocks) NewSpyedBlocks = LocalAlloc(LMEM_ZEROINIT, NewLength * sizeof(PVOID));
81  else NewSpyedBlocks = LocalReAlloc(Malloc32.SpyedBlocks, NewLength * sizeof(PVOID), LMEM_ZEROINIT | LMEM_MOVEABLE);
82  if (NewSpyedBlocks) {
83  Malloc32.SpyedBlocks = NewSpyedBlocks;
85  }
86 
87  return NewSpyedBlocks != NULL;
88 }
LPVOID * SpyedBlocks
Definition: ifs.c:58
static USHORT USHORT * NewLength
smooth NULL
Definition: ftsmooth.c:416
#define LMEM_ZEROINIT
Definition: winbase.h:356
#define LMEM_MOVEABLE
Definition: winbase.h:350
DWORD SpyedBlockTableLength
Definition: ifs.c:59
HLOCAL NTAPI LocalReAlloc(HLOCAL hMem, SIZE_T dwBytes, UINT uFlags)
Definition: heapmem.c:1608
static _Malloc32 Malloc32
Definition: ifs.c:63
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1373

Referenced by AddMemoryLocation(), and RemoveMemoryLocation().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( olemalloc  )

Variable Documentation

◆ critsect_debug

CRITICAL_SECTION_DEBUG critsect_debug
static
Initial value:
=
{
0, 0, { (DWORD_PTR)(__FILE__ ": IMalloc32_SpyCS") }
}
#define DWORD_PTR
Definition: treelist.c:76
static CRITICAL_SECTION IMalloc32_SpyCS
Definition: ifs.c:66
LIST_ENTRY ProcessLocksList
Definition: winbase.h:848
static CRITICAL_SECTION_DEBUG critsect_debug
Definition: ifs.c:67

Definition at line 67 of file ifs.c.

◆ IMalloc32_SpyCS

◆ Malloc32

◆ VT_IMalloc32

static const IMallocVtbl VT_IMalloc32
static
Initial value:
=
{
}
static void *WINAPI IMalloc_fnAlloc(IMalloc *iface, SIZE_T cb)
Definition: ifs.c:168
static INT WINAPI IMalloc_fnDidAlloc(IMalloc *iface, void *pv)
Definition: ifs.c:318
static void *WINAPI IMalloc_fnRealloc(IMalloc *iface, void *pv, SIZE_T cb)
Definition: ifs.c:202
static ULONG WINAPI IMalloc_fnAddRefRelease(IMalloc *iface)
Definition: ifs.c:160
static SIZE_T WINAPI IMalloc_fnGetSize(IMalloc *iface, void *pv)
Definition: ifs.c:293
static void WINAPI IMalloc_fnHeapMinimize(IMalloc *iface)
Definition: ifs.c:342
static void WINAPI IMalloc_fnFree(IMalloc *iface, void *pv)
Definition: ifs.c:254
static HRESULT WINAPI IMalloc_fnQueryInterface(IMalloc *iface, REFIID refiid, void **obj)
Definition: ifs.c:146

Definition at line 50 of file ifs.c.