diff options
author | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-03-19 01:28:47 +0000 |
---|---|---|
committer | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-03-19 01:28:47 +0000 |
commit | 9c6ffd1f25e7a5b23be5fbc719e29af54d75a5b7 (patch) | |
tree | 2608eb1931d906e80790e2e22df4285dc83c8a10 /db3x_autobackups/dbsettings.c | |
parent | a788cc5902dda036c81b6e0ee25b742cf62d3a1b (diff) |
added GUID's
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@128 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'db3x_autobackups/dbsettings.c')
-rw-r--r-- | db3x_autobackups/dbsettings.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/db3x_autobackups/dbsettings.c b/db3x_autobackups/dbsettings.c index 3c40277..503a5eb 100644 --- a/db3x_autobackups/dbsettings.c +++ b/db3x_autobackups/dbsettings.c @@ -92,7 +92,7 @@ static DWORD __inline GetSettingValueLength(PBYTE pSetting) static char* InsertCachedSetting( const char* szName, size_t cbNameLen, int index )
{
- char* newValue = (char*)HeapAlloc( hCacheHeap, HEAP_NO_SERIALIZE, cbNameLen );
+ char* newValue = (char*)HeapAlloc( hCacheHeap, 0, cbNameLen );
*newValue = 0;
strcpy(newValue+1,szName+1);
li.List_Insert(&lSettings,newValue,index);
@@ -121,9 +121,9 @@ static void SetCachedVariant( DBVARIANT* s /* new */, DBVARIANT* d /* cached */ memcpy( d, s, sizeof( DBVARIANT ));
if (( s->type == DBVT_UTF8 || s->type == DBVT_ASCIIZ ) && s->pszVal != NULL ) {
if ( szSave != NULL )
- d->pszVal = (char*)HeapReAlloc(hCacheHeap,HEAP_NO_SERIALIZE,szSave,strlen(s->pszVal)+1);
+ d->pszVal = (char*)HeapReAlloc(hCacheHeap,0,szSave,strlen(s->pszVal)+1);
else
- d->pszVal = (char*)HeapAlloc(hCacheHeap,HEAP_NO_SERIALIZE,strlen(s->pszVal)+1);
+ d->pszVal = (char*)HeapAlloc(hCacheHeap,0,strlen(s->pszVal)+1);
strcpy(d->pszVal,s->pszVal);
}
@@ -139,7 +139,7 @@ static void SetCachedVariant( DBVARIANT* s /* new */, DBVARIANT* d /* cached */ static void FreeCachedVariant( DBVARIANT* V )
{
if (( V->type == DBVT_ASCIIZ || V->type == DBVT_UTF8 ) && V->pszVal != NULL )
- HeapFree(hCacheHeap,HEAP_NO_SERIALIZE,V->pszVal);
+ HeapFree(hCacheHeap,0,V->pszVal);
}
static DBVARIANT* GetCachedValuePtr( HANDLE hContact, char* szSetting, int bAllocate )
@@ -154,14 +154,14 @@ static DBVARIANT* GetCachedValuePtr( HANDLE hContact, char* szSetting, int bAllo if ( bAllocate == -1 ) {
FreeCachedVariant( &V->value );
li.List_Remove(&lGlobalSettings,index);
- HeapFree(hCacheHeap,HEAP_NO_SERIALIZE,V);
+ HeapFree(hCacheHeap,0,V);
return NULL;
} }
else {
if ( bAllocate != 1 )
return NULL;
- V = (DBCachedGlobalValue*)HeapAlloc(hCacheHeap,HEAP_NO_SERIALIZE+HEAP_ZERO_MEMORY,sizeof(DBCachedGlobalValue));
+ V = (DBCachedGlobalValue*)HeapAlloc(hCacheHeap,HEAP_ZERO_MEMORY,sizeof(DBCachedGlobalValue));
V->name = szSetting;
li.List_Insert(&lGlobalSettings,V,index);
}
@@ -177,10 +177,10 @@ static DBVARIANT* GetCachedValuePtr( HANDLE hContact, char* szSetting, int bAllo VL = (DBCachedContactValueList*)lContacts.items[index];
}
else {
- if ( bAllocate == -1 )
+ if ( bAllocate != 1 )
return NULL;
- VL = (DBCachedContactValueList*)HeapAlloc(hCacheHeap,HEAP_NO_SERIALIZE+HEAP_ZERO_MEMORY,sizeof(DBCachedContactValueList));
+ VL = (DBCachedContactValueList*)HeapAlloc(hCacheHeap,HEAP_ZERO_MEMORY,sizeof(DBCachedContactValueList));
VL->hContact = hContact;
li.List_Insert(&lContacts,VL,index);
}
@@ -189,11 +189,11 @@ static DBVARIANT* GetCachedValuePtr( HANDLE hContact, char* szSetting, int bAllo if (strcmp(V->name,szSetting)==0)
break;
- if ( V == NULL )
- { if ( bAllocate != 1 )
+ if ( V == NULL ) {
+ if ( bAllocate != 1 )
return NULL;
- V = HeapAlloc(hCacheHeap,HEAP_NO_SERIALIZE+HEAP_ZERO_MEMORY,sizeof(DBCachedContactValue));
+ V = HeapAlloc(hCacheHeap,HEAP_ZERO_MEMORY,sizeof(DBCachedContactValue));
V->next = VL->first;
VL->first = V;
V->name = szSetting;
@@ -207,7 +207,7 @@ static DBVARIANT* GetCachedValuePtr( HANDLE hContact, char* szSetting, int bAllo V1->next = V->next;
break;
}
- HeapFree(hCacheHeap,HEAP_NO_SERIALIZE,V);
+ HeapFree(hCacheHeap,0,V);
return NULL;
}
@@ -393,7 +393,7 @@ static int GetContactSettingStr(WPARAM wParam,LPARAM lParam) if ( GetContactSettingWorker(( HANDLE )wParam, dgs, 0 ))
return 1;
- if ( iSaveType == 0 || iSaveType == dgs->pValue->type )
+ if ( iSaveType == 0 || iSaveType == dgs->pValue->type )
return 0;
if ( dgs->pValue->type != DBVT_ASCIIZ && dgs->pValue->type != DBVT_UTF8 )
@@ -432,7 +432,7 @@ static int GetContactSettingStr(WPARAM wParam,LPARAM lParam) return 0;
}
-static int GetContactSettingStatic(WPARAM wParam,LPARAM lParam)
+int GetContactSettingStatic(WPARAM wParam,LPARAM lParam)
{
DBCONTACTGETSETTING* dgs = (DBCONTACTGETSETTING*)lParam;
if ( GetContactSettingWorker(( HANDLE )wParam, dgs, 1 ))
@@ -938,7 +938,7 @@ int InitSettings(void) CreateServiceFunction(MS_DB_SETSETTINGRESIDENT,SetSettingResident);
hSettingChangeEvent=CreateHookableEvent(ME_DB_CONTACT_SETTINGCHANGED);
- hCacheHeap=HeapCreate(HEAP_NO_SERIALIZE,0,0);
+ hCacheHeap=HeapCreate(0,0,0);
lSettings.sortFunc=stringCompare;
lSettings.increment=50;
lContacts.sortFunc=handleCompare;
|