Ignore:
Timestamp:
Jun 8, 2001, 1:04:26 PM (24 years ago)
Author:
sandervl
Message:

pe loader optimizations, WritePrivateProfileStructA added (Wine), WinExec fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/profile.cpp

    r4756 r5932  
    1 /* $Id: profile.cpp,v 1.28 2000-12-05 13:04:48 sandervl Exp $ */
     1/* $Id: profile.cpp,v 1.29 2001-06-08 11:04:24 sandervl Exp $ */
    22
    33/*
     
    309309}
    310310
    311 
    312311/***********************************************************************
    313312 *           PROFILE_DeleteKey
     
    342341}
    343342
     343/***********************************************************************
     344 *           PROFILE_DeleteAllKeys
     345 *
     346 * Delete all keys from a profile tree.
     347 */
     348void PROFILE_DeleteAllKeys( LPCSTR section_name)
     349{
     350    PROFILESECTION **section= &CurProfile->section;
     351    while (*section)
     352    {
     353        if ((*section)->name && !strcasecmp( (*section)->name, section_name ))
     354        {
     355            PROFILEKEY **key = &(*section)->key;
     356            while (*key)
     357            {
     358                PROFILEKEY *to_del = *key;
     359                *key = to_del->next;
     360                if (to_del->name) HeapFree( GetProcessHeap(), 0, to_del->name );
     361                if (to_del->value) HeapFree( GetProcessHeap(), 0, to_del->value);
     362                HeapFree( GetProcessHeap(), 0, to_del );
     363                CurProfile->changed =TRUE;
     364            }
     365        }
     366        section = &(*section)->next;
     367    }
     368}
    344369
    345370/***********************************************************************
     
    13881413              LPCSTR, filename)
    13891414{
    1390   char *p =(char*)string;
    1391 
    1392   dprintf(("Kernel32:Profile:fixme WritePrivateProfileSection32A empty stub\n"));
    1393   return FALSE;
     1415    BOOL ret = FALSE;
     1416    LPSTR p ;
     1417
     1418    dprintf(("WritePrivateProfileSectionA %s %s %s", section, string, filename));
     1419
     1420    EnterCriticalSection( &PROFILE_CritSect );
     1421
     1422    if (PROFILE_Open( filename )) {
     1423        if (!section && !string)
     1424            PROFILE_ReleaseFile();  /* always return FALSE in this case */
     1425        else if (!string) /* delete the named section*/
     1426            ret = PROFILE_SetString(section,NULL,NULL);
     1427        else {
     1428            PROFILE_DeleteAllKeys(section);
     1429            ret = TRUE;
     1430            while(*string) {
     1431                LPSTR buf=HEAP_strdupA( GetProcessHeap(), 0, string );
     1432                if((p=strchr( buf, '='))){
     1433                    *p='\0';
     1434                    ret = PROFILE_SetString( section, buf, p+1 );
     1435                   
     1436                }
     1437                HeapFree( GetProcessHeap(), 0, buf );
     1438                string += strlen(string)+1;
     1439            }
     1440           
     1441        }
     1442    }
     1443
     1444    LeaveCriticalSection( &PROFILE_CritSect );
     1445    return ret;
    13941446}
    13951447
Note: See TracChangeset for help on using the changeset viewer.