Commit 90476d6b authored by Alexandre Julliard's avatar Alexandre Julliard

Moved SystemHeap allocations to the process heap.

parent 6fdb5ddc
......@@ -733,7 +733,7 @@ LsaQueryInformationPolicy(
{
case PolicyAuditEventsInformation: /* 2 */
{
PPOLICY_AUDIT_EVENTS_INFO p = HeapAlloc(SystemHeap, HEAP_ZERO_MEMORY, sizeof(POLICY_AUDIT_EVENTS_INFO));
PPOLICY_AUDIT_EVENTS_INFO p = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(POLICY_AUDIT_EVENTS_INFO));
p->AuditingMode = FALSE; /* no auditing */
*Buffer = p;
}
......@@ -747,7 +747,7 @@ LsaQueryInformationPolicy(
};
SID_IDENTIFIER_AUTHORITY localSidAuthority = {SECURITY_NT_AUTHORITY};
struct di * xdi = HeapAlloc(SystemHeap, HEAP_ZERO_MEMORY, sizeof(xdi));
struct di * xdi = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(xdi));
RtlInitUnicodeString(&(xdi->ppdi.Name), HEAP_strdupAtoW(GetProcessHeap(),0,"DOMAIN"));
xdi->ppdi.Sid = &(xdi->sid);
xdi->sid.Revision = SID_REVISION;
......@@ -816,7 +816,7 @@ NTSTATUS WINAPI
LsaFreeMemory(IN PVOID Buffer)
{
TRACE("(%p)\n",Buffer);
return HeapFree(SystemHeap, 0, Buffer);
return HeapFree(GetProcessHeap(), 0, Buffer);
}
/******************************************************************************
* LsaClose [ADVAPI32.243]
......
......@@ -177,7 +177,7 @@ HFILE WINAPI LZInit( HFILE hfSrc )
}
for (i = 0; i < MAX_LZSTATES; i++) if (!lzstates[i]) break;
if (i == MAX_LZSTATES) return LZERROR_GLOBALLOC;
lzstates[i] = lzs = HeapAlloc( SystemHeap, 0, sizeof(struct lzstate) );
lzstates[i] = lzs = HeapAlloc( GetProcessHeap(), 0, sizeof(struct lzstate) );
memset(lzs,'\0',sizeof(*lzs));
lzs->realfd = hfSrc;
......@@ -637,7 +637,7 @@ void WINAPI LZClose( HFILE fd )
if (lzs->get) HeapFree( GetProcessHeap(), 0, lzs->get );
CloseHandle(lzs->realfd);
lzstates[fd - 0x400] = NULL;
HeapFree( SystemHeap, 0, lzs );
HeapFree( GetProcessHeap(), 0, lzs );
}
}
......
......@@ -18,7 +18,7 @@ DEFAULT_DEBUG_CHANNEL(mpr)
*/
LPVOID WINAPI MPR_Alloc( DWORD dwSize )
{
return HeapAlloc( SystemHeap, HEAP_ZERO_MEMORY, dwSize );
return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, dwSize );
}
/*****************************************************************
......@@ -27,9 +27,9 @@ LPVOID WINAPI MPR_Alloc( DWORD dwSize )
LPVOID WINAPI MPR_ReAlloc( LPVOID lpSrc, DWORD dwSize )
{
if ( lpSrc )
return HeapReAlloc( SystemHeap, HEAP_ZERO_MEMORY, lpSrc, dwSize );
return HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, lpSrc, dwSize );
else
return HeapAlloc( SystemHeap, HEAP_ZERO_MEMORY, dwSize );
return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, dwSize );
}
/*****************************************************************
......@@ -38,7 +38,7 @@ LPVOID WINAPI MPR_ReAlloc( LPVOID lpSrc, DWORD dwSize )
BOOL WINAPI MPR_Free( LPVOID lpMem )
{
if ( lpMem )
return HeapFree( SystemHeap, 0, lpMem );
return HeapFree( GetProcessHeap(), 0, lpMem );
else
return FALSE;
}
......
......@@ -80,7 +80,7 @@ ASPI_OpenDevice16(SRB_ExecSCSICmd16 *prb)
}
/* device is now open */
curr = HeapAlloc( SystemHeap, 0, sizeof(ASPI_DEVICE_INFO) );
curr = HeapAlloc( GetProcessHeap(), 0, sizeof(ASPI_DEVICE_INFO) );
curr->fd = fd;
curr->hostId = prb->SRB_HaId;
curr->target = prb->SRB_Target;
......
......@@ -2211,7 +2211,7 @@ static BOOL MMDRV_InitPerType(LPWINE_MM_DRIVER lpDrv, UINT num,
lpDrv->name, llTypes[type].name);
/* realloc translation table */
llTypes[type].lpMlds = (LPWINE_MLD)
HeapReAlloc(SystemHeap, 0, (llTypes[type].lpMlds) ? llTypes[type].lpMlds - 1 : NULL,
HeapReAlloc(GetProcessHeap(), 0, (llTypes[type].lpMlds) ? llTypes[type].lpMlds - 1 : NULL,
sizeof(WINE_MLD) * (llTypes[type].wMaxId + 1)) + 1;
/* re-build the translation table */
if (llTypes[type].nMapper != -1) {
......
......@@ -341,7 +341,7 @@ static UINT MCI_SetCommandTable(LPWINE_MM_IDATA iData, HANDLE hMem,
count++;
} while (eid != MCI_END_COMMAND_LIST);
S_MciCmdTable[uTbl].aVerbs = HeapAlloc(SystemHeap, 0, count * sizeof(LPCSTR));
S_MciCmdTable[uTbl].aVerbs = HeapAlloc(GetProcessHeap(), 0, count * sizeof(LPCSTR));
S_MciCmdTable[uTbl].nVerbs = count;
lmem = S_MciCmdTable[uTbl].lpTable;
......@@ -373,7 +373,7 @@ static BOOL MCI_DeleteCommandTable(UINT uTbl)
FreeResource16(S_MciCmdTable[uTbl].hMem);
S_MciCmdTable[uTbl].hMem = 0;
if (S_MciCmdTable[uTbl].aVerbs) {
HeapFree(SystemHeap, 0, S_MciCmdTable[uTbl].aVerbs);
HeapFree(GetProcessHeap(), 0, S_MciCmdTable[uTbl].aVerbs);
S_MciCmdTable[uTbl].aVerbs = 0;
}
return TRUE;
......@@ -1121,7 +1121,7 @@ static MCI_MapType MCI_MapMsg16To32A(WORD uDevType, WORD wMsg, DWORD* lParam)
break;
case MCI_BREAK:
{
LPMCI_BREAK_PARMS mbp32 = HeapAlloc(SystemHeap, 0, sizeof(MCI_BREAK_PARMS));
LPMCI_BREAK_PARMS mbp32 = HeapAlloc(GetProcessHeap(), 0, sizeof(MCI_BREAK_PARMS));
LPMCI_BREAK_PARMS16 mbp16 = PTR_SEG_TO_LIN(*lParam);
if (mbp32) {
......@@ -1136,7 +1136,7 @@ static MCI_MapType MCI_MapMsg16To32A(WORD uDevType, WORD wMsg, DWORD* lParam)
return MCI_MAP_OKMEM;
case MCI_ESCAPE:
{
LPMCI_VD_ESCAPE_PARMSA mvep32a = HeapAlloc(SystemHeap, 0, sizeof(MCI_VD_ESCAPE_PARMSA));
LPMCI_VD_ESCAPE_PARMSA mvep32a = HeapAlloc(GetProcessHeap(), 0, sizeof(MCI_VD_ESCAPE_PARMSA));
LPMCI_VD_ESCAPE_PARMS16 mvep16 = PTR_SEG_TO_LIN(*lParam);
if (mvep32a) {
......@@ -1150,7 +1150,7 @@ static MCI_MapType MCI_MapMsg16To32A(WORD uDevType, WORD wMsg, DWORD* lParam)
return MCI_MAP_OKMEM;
case MCI_INFO:
{
LPMCI_INFO_PARMSA mip32a = HeapAlloc(SystemHeap, 0, sizeof(MCI_INFO_PARMSA));
LPMCI_INFO_PARMSA mip32a = HeapAlloc(GetProcessHeap(), 0, sizeof(MCI_INFO_PARMSA));
LPMCI_INFO_PARMS16 mip16 = PTR_SEG_TO_LIN(*lParam);
/* FIXME this is wrong if device is of type
......@@ -1169,7 +1169,7 @@ static MCI_MapType MCI_MapMsg16To32A(WORD uDevType, WORD wMsg, DWORD* lParam)
case MCI_OPEN:
case MCI_OPEN_DRIVER:
{
LPMCI_OPEN_PARMSA mop32a = HeapAlloc(SystemHeap, 0, sizeof(LPMCI_OPEN_PARMS16) + sizeof(MCI_OPEN_PARMSA) + 2 * sizeof(DWORD));
LPMCI_OPEN_PARMSA mop32a = HeapAlloc(GetProcessHeap(), 0, sizeof(LPMCI_OPEN_PARMS16) + sizeof(MCI_OPEN_PARMSA) + 2 * sizeof(DWORD));
LPMCI_OPEN_PARMS16 mop16 = PTR_SEG_TO_LIN(*lParam);
if (mop32a) {
......@@ -1197,7 +1197,7 @@ static MCI_MapType MCI_MapMsg16To32A(WORD uDevType, WORD wMsg, DWORD* lParam)
return MCI_MAP_OKMEM;
case MCI_SYSINFO:
{
LPMCI_SYSINFO_PARMSA msip32a = HeapAlloc(SystemHeap, 0, sizeof(MCI_SYSINFO_PARMSA));
LPMCI_SYSINFO_PARMSA msip32a = HeapAlloc(GetProcessHeap(), 0, sizeof(MCI_SYSINFO_PARMSA));
LPMCI_SYSINFO_PARMS16 msip16 = PTR_SEG_TO_LIN(*lParam);
if (msip32a) {
......@@ -1282,7 +1282,7 @@ static MCI_MapType MCI_UnMapMsg16To32A(WORD uDevType, WORD wMsg, DWORD lParam)
case MCI_ESCAPE:
case MCI_INFO:
case MCI_SYSINFO:
HeapFree(SystemHeap, 0, (LPVOID)lParam);
HeapFree(GetProcessHeap(), 0, (LPVOID)lParam);
return MCI_MAP_OK;
case MCI_OPEN:
case MCI_OPEN_DRIVER:
......@@ -1291,7 +1291,7 @@ static MCI_MapType MCI_UnMapMsg16To32A(WORD uDevType, WORD wMsg, DWORD lParam)
LPMCI_OPEN_PARMS16 mop16 = *(LPMCI_OPEN_PARMS16*)((char*)mop32a - sizeof(LPMCI_OPEN_PARMS16));
mop16->wDeviceID = mop32a->wDeviceID;
if (!HeapFree(SystemHeap, 0, (LPVOID)(lParam - sizeof(LPMCI_OPEN_PARMS16))))
if (!HeapFree(GetProcessHeap(), 0, (LPVOID)(lParam - sizeof(LPMCI_OPEN_PARMS16))))
FIXME("bad free line=%d\n", __LINE__);
}
return MCI_MAP_OK;
......@@ -2476,7 +2476,7 @@ BOOL MULTIMEDIA_MciInit(void)
LPSTR ptr1, ptr2;
MCI_InstalledCount = 0;
ptr1 = MCI_lpInstallNames = HeapAlloc(SystemHeap, 0, 2048);
ptr1 = MCI_lpInstallNames = HeapAlloc(GetProcessHeap(), 0, 2048);
if (!MCI_lpInstallNames)
return FALSE;
......
......@@ -179,7 +179,7 @@ static BOOL OSS_MidiInit(void)
return TRUE;
}
tmplpCaps = HeapAlloc(SystemHeap, 0, sizeof(MIDIOUTCAPSA));
tmplpCaps = HeapAlloc(GetProcessHeap(), 0, sizeof(MIDIOUTCAPSA));
if (!tmplpCaps)
break;
/* We also have the information sinfo.synth_subtype, not used here
......@@ -258,7 +258,7 @@ static BOOL OSS_MidiInit(void)
return TRUE;
}
tmplpOutCaps = HeapAlloc(SystemHeap, 0, sizeof(MIDIOUTCAPSA));
tmplpOutCaps = HeapAlloc(GetProcessHeap(), 0, sizeof(MIDIOUTCAPSA));
if (!tmplpOutCaps)
break;
/* This whole part is somewhat obscure to me. I'll keep trying to dig
......@@ -284,7 +284,7 @@ static BOOL OSS_MidiInit(void)
midiOutDevices[numsynthdevs + i] = tmplpOutCaps;
tmplpInCaps = HeapAlloc(SystemHeap, 0, sizeof(MIDIOUTCAPSA));
tmplpInCaps = HeapAlloc(GetProcessHeap(), 0, sizeof(MIDIOUTCAPSA));
if (!tmplpInCaps)
break;
/* This whole part is somewhat obscure to me. I'll keep trying to dig
......
......@@ -117,7 +117,7 @@ ASPI_OpenDevice(SRB_ExecSCSICmd *prb)
}
/* device is now open */
curr = HeapAlloc( SystemHeap, 0, sizeof(ASPI_DEVICE_INFO) );
curr = HeapAlloc( GetProcessHeap(), 0, sizeof(ASPI_DEVICE_INFO) );
curr->fd = fd;
curr->hostId = prb->SRB_HaId;
curr->target = prb->SRB_Target;
......
......@@ -321,7 +321,7 @@ static int DOSFS_MatchLong( const char *mask, const char *name,
*/
static DOS_DIR *DOSFS_OpenDir( LPCSTR path )
{
DOS_DIR *dir = HeapAlloc( SystemHeap, 0, sizeof(*dir) );
DOS_DIR *dir = HeapAlloc( GetProcessHeap(), 0, sizeof(*dir) );
if (!dir)
{
SetLastError( ERROR_NOT_ENOUGH_MEMORY );
......@@ -357,7 +357,7 @@ static DOS_DIR *DOSFS_OpenDir( LPCSTR path )
if (!(dir->dir = opendir( path )))
{
HeapFree( SystemHeap, 0, dir );
HeapFree( GetProcessHeap(), 0, dir );
return NULL;
}
return dir;
......@@ -373,7 +373,7 @@ static void DOSFS_CloseDir( DOS_DIR *dir )
if (dir->fd != -1) close( dir->fd );
#endif /* VFAT_IOCTL_READDIR_BOTH */
if (dir->dir) closedir( dir->dir );
HeapFree( SystemHeap, 0, dir );
HeapFree( GetProcessHeap(), 0, dir );
}
......@@ -1384,7 +1384,7 @@ HANDLE16 WINAPI FindFirstFile16( LPCSTR path, WIN32_FIND_DATAA *data )
if (!(handle = GlobalAlloc16( GMEM_MOVEABLE, sizeof(FIND_FIRST_INFO) )))
return INVALID_HANDLE_VALUE16;
info = (FIND_FIRST_INFO *)GlobalLock16( handle );
info->path = HEAP_strdupA( SystemHeap, 0, full_name.long_name );
info->path = HEAP_strdupA( GetProcessHeap(), 0, full_name.long_name );
info->long_mask = strrchr( info->path, '/' );
*(info->long_mask++) = '\0';
info->short_mask = NULL;
......@@ -1462,7 +1462,7 @@ BOOL16 WINAPI FindNextFile16( HANDLE16 handle, WIN32_FIND_DATAA *data )
if (!DOSFS_FindNextEx( info, data ))
{
DOSFS_CloseDir( info->dir ); info->dir = NULL;
HeapFree( SystemHeap, 0, info->path );
HeapFree( GetProcessHeap(), 0, info->path );
info->path = info->long_mask = NULL;
SetLastError( ERROR_NO_MORE_FILES );
return FALSE;
......@@ -1513,7 +1513,7 @@ BOOL16 WINAPI FindClose16( HANDLE16 handle )
return FALSE;
}
if (info->dir) DOSFS_CloseDir( info->dir );
if (info->path) HeapFree( SystemHeap, 0, info->path );
if (info->path) HeapFree( GetProcessHeap(), 0, info->path );
GlobalUnlock16( handle );
GlobalFree16( handle );
return TRUE;
......
......@@ -174,9 +174,9 @@ int DRIVE_Init(void)
continue;
}
drive->root = HEAP_strdupA( SystemHeap, 0, path );
drive->dos_cwd = HEAP_strdupA( SystemHeap, 0, "" );
drive->unix_cwd = HEAP_strdupA( SystemHeap, 0, "" );
drive->root = HEAP_strdupA( GetProcessHeap(), 0, path );
drive->dos_cwd = HEAP_strdupA( GetProcessHeap(), 0, "" );
drive->unix_cwd = HEAP_strdupA( GetProcessHeap(), 0, "" );
drive->type = DRIVE_GetDriveType( name );
drive->device = NULL;
drive->flags = 0;
......@@ -207,7 +207,7 @@ int DRIVE_Init(void)
buffer, sizeof(buffer) );
if (buffer[0])
{
drive->device = HEAP_strdupA( SystemHeap, 0, buffer );
drive->device = HEAP_strdupA( GetProcessHeap(), 0, buffer );
drive->read_volinfo =
(BOOL)PROFILE_GetWineIniInt( name, "ReadVolInfo", 1);
}
......@@ -232,9 +232,9 @@ int DRIVE_Init(void)
{
MESSAGE("Warning: no valid DOS drive found, check your configuration file.\n" );
/* Create a C drive pointing to Unix root dir */
DOSDrives[2].root = HEAP_strdupA( SystemHeap, 0, "/" );
DOSDrives[2].dos_cwd = HEAP_strdupA( SystemHeap, 0, "" );
DOSDrives[2].unix_cwd = HEAP_strdupA( SystemHeap, 0, "" );
DOSDrives[2].root = HEAP_strdupA( GetProcessHeap(), 0, "/" );
DOSDrives[2].dos_cwd = HEAP_strdupA( GetProcessHeap(), 0, "" );
DOSDrives[2].unix_cwd = HEAP_strdupA( GetProcessHeap(), 0, "" );
strcpy( DOSDrives[2].label_conf, "Drive C " );
DOSDrives[2].serial_conf = 12345678;
DOSDrives[2].type = TYPE_HD;
......@@ -641,11 +641,11 @@ int DRIVE_Chdir( int drive, const char *path )
TRACE("(%c:): unix_cwd=%s dos_cwd=%s\n",
'A' + drive, unix_cwd, full_name.short_name + 3 );
HeapFree( SystemHeap, 0, DOSDrives[drive].dos_cwd );
HeapFree( SystemHeap, 0, DOSDrives[drive].unix_cwd );
DOSDrives[drive].dos_cwd = HEAP_strdupA( SystemHeap, 0,
HeapFree( GetProcessHeap(), 0, DOSDrives[drive].dos_cwd );
HeapFree( GetProcessHeap(), 0, DOSDrives[drive].unix_cwd );
DOSDrives[drive].dos_cwd = HEAP_strdupA( GetProcessHeap(), 0,
full_name.short_name + 3 );
DOSDrives[drive].unix_cwd = HEAP_strdupA( SystemHeap, 0, unix_cwd );
DOSDrives[drive].unix_cwd = HEAP_strdupA( GetProcessHeap(), 0, unix_cwd );
if (pTask && (pTask->curdrive & 0x80) &&
((pTask->curdrive & ~0x80) == drive))
......@@ -719,9 +719,9 @@ int DRIVE_SetLogicalMapping ( int existing_drive, int new_drive )
return 0;
}
new->root = HEAP_strdupA( SystemHeap, 0, old->root );
new->dos_cwd = HEAP_strdupA( SystemHeap, 0, old->dos_cwd );
new->unix_cwd = HEAP_strdupA( SystemHeap, 0, old->unix_cwd );
new->root = HEAP_strdupA( GetProcessHeap(), 0, old->root );
new->dos_cwd = HEAP_strdupA( GetProcessHeap(), 0, old->dos_cwd );
new->unix_cwd = HEAP_strdupA( GetProcessHeap(), 0, old->unix_cwd );
memcpy ( new->label_conf, old->label_conf, 12 );
new->serial_conf = old->serial_conf;
new->type = old->type;
......
......@@ -983,7 +983,7 @@ HFILE WINAPI OpenFile( LPCSTR name, OFSTRUCT *ofs, UINT mode )
BOOL FILE_InitProcessDosHandles( void ) {
HANDLE *ptr;
if (!(ptr = HeapAlloc( SystemHeap, HEAP_ZERO_MEMORY,
if (!(ptr = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(*ptr) * DOS_TABLE_SIZE )))
return FALSE;
PROCESS_Current()->dos_handles = ptr;
......@@ -2082,11 +2082,11 @@ static BOOL DOS_AddLock(FILE_OBJECT *file, struct flock *f)
}
#endif
curr = HeapAlloc( SystemHeap, 0, sizeof(DOS_FILE_LOCK) );
curr = HeapAlloc( GetProcessHeap(), 0, sizeof(DOS_FILE_LOCK) );
curr->processId = GetCurrentProcessId();
curr->base = f->l_start;
curr->len = f->l_len;
/* curr->unix_name = HEAP_strdupA( SystemHeap, 0, file->unix_name);*/
/* curr->unix_name = HEAP_strdupA( GetProcessHeap(), 0, file->unix_name);*/
curr->next = locks;
curr->dos_file = file;
locks = curr;
......@@ -2105,8 +2105,8 @@ static void DOS_RemoveFileLocks(FILE_OBJECT *file)
if ((*curr)->dos_file == file) {
rem = *curr;
*curr = (*curr)->next;
/* HeapFree( SystemHeap, 0, rem->unix_name );*/
HeapFree( SystemHeap, 0, rem );
/* HeapFree( GetProcessHeap(), 0, rem->unix_name );*/
HeapFree( GetProcessHeap(), 0, rem );
}
else
curr = &(*curr)->next;
......@@ -2128,8 +2128,8 @@ static BOOL DOS_RemoveLock(FILE_OBJECT *file, struct flock *f)
/* this is the same lock */
rem = *curr;
*curr = (*curr)->next;
/* HeapFree( SystemHeap, 0, rem->unix_name );*/
HeapFree( SystemHeap, 0, rem );
/* HeapFree( GetProcessHeap(), 0, rem->unix_name );*/
HeapFree( GetProcessHeap(), 0, rem );
return TRUE;
}
}
......
......@@ -26,12 +26,12 @@ static GRAPHICS_DRIVER *genericDriver = NULL;
*/
BOOL DRIVER_RegisterDriver( LPCSTR name, const DC_FUNCTIONS *funcs )
{
GRAPHICS_DRIVER *driver = HeapAlloc( SystemHeap, 0, sizeof(*driver) );
GRAPHICS_DRIVER *driver = HeapAlloc( GetProcessHeap(), 0, sizeof(*driver) );
if (!driver) return FALSE;
driver->funcs = funcs;
if (name)
{
driver->name = HEAP_strdupA( SystemHeap, 0, name );
driver->name = HEAP_strdupA( GetProcessHeap(), 0, name );
driver->next = firstDriver;
firstDriver = driver;
return TRUE;
......@@ -40,7 +40,7 @@ BOOL DRIVER_RegisterDriver( LPCSTR name, const DC_FUNCTIONS *funcs )
if (genericDriver)
{
WARN(" already a generic driver\n" );
HeapFree( SystemHeap, 0, driver );
HeapFree( GetProcessHeap(), 0, driver );
return FALSE;
}
driver->name = NULL;
......@@ -80,8 +80,8 @@ BOOL DRIVER_UnregisterDriver( LPCSTR name )
{
GRAPHICS_DRIVER *driver = *ppDriver;
(*ppDriver) = driver->next;
HeapFree( SystemHeap, 0, driver->name );
HeapFree( SystemHeap, 0, driver );
HeapFree( GetProcessHeap(), 0, driver->name );
HeapFree( GetProcessHeap(), 0, driver );
return TRUE;
}
ppDriver = &(*ppDriver)->next;
......@@ -91,7 +91,7 @@ BOOL DRIVER_UnregisterDriver( LPCSTR name )
else
{
if (!genericDriver) return FALSE;
HeapFree( SystemHeap, 0, genericDriver );
HeapFree( GetProcessHeap(), 0, genericDriver );
genericDriver = NULL;
return TRUE;
}
......
......@@ -310,7 +310,7 @@ EMFDRV_Polylinegon( DC *dc, const POINT* pt, INT count, DWORD iType )
size = sizeof(EMRPOLYLINE) + sizeof(POINTL) * (count - 1);
emr = HeapAlloc( SystemHeap, 0, size );
emr = HeapAlloc( GetProcessHeap(), 0, size );
emr->emr.iType = iType;
emr->emr.nSize = size;
......@@ -334,7 +334,7 @@ EMFDRV_Polylinegon( DC *dc, const POINT* pt, INT count, DWORD iType )
ret = EMFDRV_WriteRecord( dc, &emr->emr );
if(ret)
EMFDRV_UpdateBBox( dc, &emr->rclBounds );
HeapFree( SystemHeap, 0, emr );
HeapFree( GetProcessHeap(), 0, emr );
return ret;
}
......@@ -392,7 +392,7 @@ EMFDRV_PolyPolylinegon( DC *dc, const POINT* pt, const INT* counts, UINT polys,
size = sizeof(EMRPOLYPOLYLINE) + (polys - 1) * sizeof(DWORD) +
(cptl - 1) * sizeof(POINTL);
emr = HeapAlloc( SystemHeap, 0, size );
emr = HeapAlloc( GetProcessHeap(), 0, size );
emr->emr.iType = iType;
emr->emr.nSize = size;
......@@ -404,7 +404,7 @@ EMFDRV_PolyPolylinegon( DC *dc, const POINT* pt, const INT* counts, UINT polys,
ret = EMFDRV_WriteRecord( dc, &emr->emr );
if(ret)
EMFDRV_UpdateBBox( dc, &emr->rclBounds );
HeapFree( SystemHeap, 0, emr );
HeapFree( GetProcessHeap(), 0, emr );
return ret;
}
......@@ -461,7 +461,7 @@ BOOL EMFDRV_FillRgn( DC *dc, HRGN hrgn, HBRUSH hbrush )
rgnsize = GetRegionData( hrgn, 0, NULL );
size = rgnsize + sizeof(EMRFILLRGN) - 1;
emr = HeapAlloc( SystemHeap, 0, size );
emr = HeapAlloc( GetProcessHeap(), 0, size );
GetRegionData( hrgn, rgnsize, (RGNDATA *)&emr->RgnData );
......@@ -477,7 +477,7 @@ BOOL EMFDRV_FillRgn( DC *dc, HRGN hrgn, HBRUSH hbrush )
ret = EMFDRV_WriteRecord( dc, &emr->emr );
if(ret)
EMFDRV_UpdateBBox( dc, &emr->rclBounds );
HeapFree( SystemHeap, 0, emr );
HeapFree( GetProcessHeap(), 0, emr );
return ret;
}
/*********************************************************************
......@@ -494,7 +494,7 @@ BOOL EMFDRV_FrameRgn( DC *dc, HRGN hrgn, HBRUSH hbrush, INT width, INT height )
rgnsize = GetRegionData( hrgn, 0, NULL );
size = rgnsize + sizeof(EMRFRAMERGN) - 1;
emr = HeapAlloc( SystemHeap, 0, size );
emr = HeapAlloc( GetProcessHeap(), 0, size );
GetRegionData( hrgn, rgnsize, (RGNDATA *)&emr->RgnData );
......@@ -512,7 +512,7 @@ BOOL EMFDRV_FrameRgn( DC *dc, HRGN hrgn, HBRUSH hbrush, INT width, INT height )
ret = EMFDRV_WriteRecord( dc, &emr->emr );
if(ret)
EMFDRV_UpdateBBox( dc, &emr->rclBounds );
HeapFree( SystemHeap, 0, emr );
HeapFree( GetProcessHeap(), 0, emr );
return ret;
}
......@@ -530,7 +530,7 @@ static BOOL EMFDRV_PaintInvertRgn( DC *dc, HRGN hrgn, DWORD iType )
rgnsize = GetRegionData( hrgn, 0, NULL );
size = rgnsize + sizeof(EMRINVERTRGN) - 1;
emr = HeapAlloc( SystemHeap, 0, size );
emr = HeapAlloc( GetProcessHeap(), 0, size );
GetRegionData( hrgn, rgnsize, (RGNDATA *)&emr->RgnData );
......@@ -545,7 +545,7 @@ static BOOL EMFDRV_PaintInvertRgn( DC *dc, HRGN hrgn, DWORD iType )
ret = EMFDRV_WriteRecord( dc, &emr->emr );
if(ret)
EMFDRV_UpdateBBox( dc, &emr->rclBounds );
HeapFree( SystemHeap, 0, emr );
HeapFree( GetProcessHeap(), 0, emr );
return ret;
}
......
......@@ -122,8 +122,8 @@ static BOOL EMFDRV_DeleteDC( DC *dc )
{
EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE *)dc->physDev;
if (physDev->emh) HeapFree( SystemHeap, 0, physDev->emh );
HeapFree( SystemHeap, 0, physDev );
if (physDev->emh) HeapFree( GetProcessHeap(), 0, physDev->emh );
HeapFree( GetProcessHeap(), 0, physDev );
dc->physDev = NULL;
GDI_FreeObject(dc->hSelf);
return TRUE;
......@@ -150,7 +150,7 @@ BOOL EMFDRV_WriteRecord( DC *dc, EMR *emr )
return FALSE;
} else {
len = physDev->emh->nBytes;
emh = HeapReAlloc( SystemHeap, 0, physDev->emh, len );
emh = HeapReAlloc( GetProcessHeap(), 0, physDev->emh, len );
if (!emh) return FALSE;
physDev->emh = emh;
memcpy((CHAR *)physDev->emh + physDev->emh->nBytes - emr->nSize, emr,
......@@ -252,7 +252,7 @@ HDC WINAPI CreateEnhMetaFileW(
if (!(dc = DC_AllocDC( &EMFDRV_Funcs ))) return 0;
dc->header.wMagic = ENHMETAFILE_DC_MAGIC;
physDev = (EMFDRV_PDEVICE *)HeapAlloc(SystemHeap,0,sizeof(*physDev));
physDev = (EMFDRV_PDEVICE *)HeapAlloc(GetProcessHeap(),0,sizeof(*physDev));
if (!physDev) {
GDI_HEAP_FREE( dc->hSelf );
return 0;
......@@ -267,8 +267,8 @@ HDC WINAPI CreateEnhMetaFileW(
}
size = sizeof(ENHMETAHEADER) + (length + 3) / 4 * 4;
if (!(physDev->emh = HeapAlloc( SystemHeap, HEAP_ZERO_MEMORY, size))) {
HeapFree( SystemHeap, 0, physDev );
if (!(physDev->emh = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, size))) {
HeapFree( GetProcessHeap(), 0, physDev );
GDI_HEAP_FREE( dc->hSelf );
return 0;
}
......@@ -362,7 +362,7 @@ HENHMETAFILE WINAPI CloseEnhMetaFile( HDC hdc /* metafile DC */ )
EMFDRV_DeleteDC( dc );
return 0;
}
HeapFree( SystemHeap, 0, physDev->emh );
HeapFree( GetProcessHeap(), 0, physDev->emh );
hMapping = CreateFileMappingA(physDev->hFile, NULL, PAGE_READONLY, 0,
0, NULL);
TRACE("hMapping = %08x\n", hMapping );
......
......@@ -64,8 +64,8 @@ DWORD EMFDRV_CreateBrushIndirect( DC *dc, HBRUSH hBrush )
info->bmiHeader.biBitCount);
biSize = DIB_BitmapInfoSize(info, LOWORD(brushObj->logbrush.lbColor));
size = sizeof(EMRCREATEDIBPATTERNBRUSHPT) + biSize + bmSize;
emr = HeapAlloc( SystemHeap, 0, size );
if(!emr) break;;
emr = HeapAlloc( GetProcessHeap(), 0, size );
if(!emr) break;
emr->emr.iType = EMR_CREATEDIBPATTERNBRUSHPT;
emr->emr.nSize = size;
emr->ihBrush = index = EMFDRV_AddHandleDC( dc );
......@@ -78,7 +78,7 @@ DWORD EMFDRV_CreateBrushIndirect( DC *dc, HBRUSH hBrush )
if(!EMFDRV_WriteRecord( dc, &emr->emr ))
index = 0;
HeapFree( SystemHeap, 0, emr );
HeapFree( GetProcessHeap(), 0, emr );
GlobalUnlock16(brushObj->logbrush.lbHatch);
}
break;
......
......@@ -39,7 +39,7 @@ BOOL MFDRV_BitBlt( DC *dcDst, INT xDst, INT yDst, INT width, INT height,
GetObject16(dcSrc->w.hBitmap, sizeof(BITMAP16), &BM);
len = sizeof(METARECORD) + 12 * sizeof(INT16) + BM.bmWidthBytes * BM.bmHeight;
if (!(mr = HeapAlloc(SystemHeap, 0, len)))
if (!(mr = HeapAlloc(GetProcessHeap(), 0, len)))
return FALSE;
mr->rdFunction = META_BITBLT;
*(mr->rdParm + 7) = BM.bmWidth;
......@@ -63,7 +63,7 @@ BOOL MFDRV_BitBlt( DC *dcDst, INT xDst, INT yDst, INT width, INT height,
}
else
ret = FALSE;
HeapFree( SystemHeap, 0, mr);
HeapFree( GetProcessHeap(), 0, mr);
return ret;
}
......@@ -96,7 +96,7 @@ BOOL MFDRV_StretchBlt( DC *dcDst, INT xDst, INT yDst, INT widthDst,
len = sizeof(METARECORD) + 10 * sizeof(INT16)
+ sizeof(BITMAPINFOHEADER) + (nBPP != 24 ? 1 << nBPP: 0) * sizeof(RGBQUAD)
+ ((BM.bmWidth * nBPP + 31) / 32) * 4 * BM.bmHeight;
if (!(mr = HeapAlloc( SystemHeap, 0, len)))
if (!(mr = HeapAlloc( GetProcessHeap(), 0, len)))
return FALSE;
mr->rdFunction = META_DIBSTRETCHBLT;
lpBMI=(LPBITMAPINFOHEADER)(mr->rdParm+10);
......@@ -120,7 +120,7 @@ BOOL MFDRV_StretchBlt( DC *dcDst, INT xDst, INT yDst, INT widthDst,
(LPBITMAPINFO)lpBMI, DIB_RGB_COLORS))
#else
len = sizeof(METARECORD) + 15 * sizeof(INT16) + BM.bmWidthBytes * BM.bmHeight;
if (!(mr = HeapAlloc( SystemHeap, 0, len )))
if (!(mr = HeapAlloc( GetProcessHeap(), 0, len )))
return FALSE;
mr->rdFunction = META_STRETCHBLT;
*(mr->rdParm +10) = BM.bmWidth;
......@@ -148,7 +148,7 @@ BOOL MFDRV_StretchBlt( DC *dcDst, INT xDst, INT yDst, INT widthDst,
}
else
ret = FALSE;
HeapFree( SystemHeap, 0, mr);
HeapFree( GetProcessHeap(), 0, mr);
return ret;
}
......@@ -170,7 +170,7 @@ INT MFDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst,
info->bmiHeader.biBitCount );
len = sizeof(METARECORD) + 10 * sizeof(WORD) + infosize + imagesize;
mr = (METARECORD *)HeapAlloc( SystemHeap, 0, len );
mr = (METARECORD *)HeapAlloc( GetProcessHeap(), 0, len );
if(!mr) return 0;
mr->rdSize = len / 2;
......@@ -189,7 +189,7 @@ INT MFDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst,
memcpy(mr->rdParm + 11, info, infosize);
memcpy(mr->rdParm + 11 + infosize / 2, bits, imagesize);
MFDRV_WriteRecord( dc, mr, mr->rdSize * 2 );
HeapFree( SystemHeap, 0, mr );
HeapFree( GetProcessHeap(), 0, mr );
return heightSrc;
}
......@@ -212,7 +212,7 @@ INT MFDRV_SetDIBitsToDevice( DC *dc, INT xDst, INT yDst, DWORD cx,
info->bmiHeader.biBitCount );
len = sizeof(METARECORD) + 8 * sizeof(WORD) + infosize + imagesize;
mr = (METARECORD *)HeapAlloc( SystemHeap, 0, len );
mr = (METARECORD *)HeapAlloc( GetProcessHeap(), 0, len );
if(!mr) return 0;
mr->rdSize = len / 2;
......@@ -229,7 +229,7 @@ INT MFDRV_SetDIBitsToDevice( DC *dc, INT xDst, INT yDst, DWORD cx,
memcpy(mr->rdParm + 9, info, infosize);
memcpy(mr->rdParm + 9 + infosize / 2, bits, imagesize);
MFDRV_WriteRecord( dc, mr, mr->rdSize * 2 );
HeapFree( SystemHeap, 0, mr );
HeapFree( GetProcessHeap(), 0, mr );
return lines;
}
......
......@@ -120,7 +120,7 @@ static BOOL MFDRV_MetaPoly(DC *dc, short func, LPPOINT16 pt, short count)
METARECORD *mr;
len = sizeof(METARECORD) + (count * 4);
if (!(mr = HeapAlloc( SystemHeap, HEAP_ZERO_MEMORY, len )))
if (!(mr = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, len )))
return FALSE;
mr->rdSize = len / 2;
......@@ -128,7 +128,7 @@ static BOOL MFDRV_MetaPoly(DC *dc, short func, LPPOINT16 pt, short count)
*(mr->rdParm) = count;
memcpy(mr->rdParm + 1, pt, count * 4);
ret = MFDRV_WriteRecord( dc, mr, mr->rdSize * 2);
HeapFree( SystemHeap, 0, mr);
HeapFree( GetProcessHeap(), 0, mr);
return ret;
}
......@@ -227,7 +227,7 @@ static INT16 MFDRV_CreateRegion(DC *dc, HRGN hrgn)
BOOL ret;
len = GetRegionData( hrgn, 0, NULL );
if( !(rgndata = HeapAlloc( SystemHeap, 0, len )) ) {
if( !(rgndata = HeapAlloc( GetProcessHeap(), 0, len )) ) {
WARN("Can't alloc rgndata buffer\n");
return -1;
}
......@@ -237,9 +237,9 @@ static INT16 MFDRV_CreateRegion(DC *dc, HRGN hrgn)
* Assume every rect is a separate band -> 6 WORDs per rect
*/
len = sizeof(METARECORD) + 20 + (rgndata->rdh.nCount * 12);
if( !(mr = HeapAlloc( SystemHeap, HEAP_ZERO_MEMORY, len )) ) {
if( !(mr = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, len )) ) {
WARN("Can't alloc METARECORD buffer\n");
HeapFree( SystemHeap, 0, rgndata );
HeapFree( GetProcessHeap(), 0, rgndata );
return -1;
}
......@@ -287,8 +287,8 @@ static INT16 MFDRV_CreateRegion(DC *dc, HRGN hrgn)
mr->rdFunction = META_CREATEREGION;
mr->rdSize = len / 2;
ret = MFDRV_WriteRecord( dc, mr, mr->rdSize * 2 );
HeapFree( SystemHeap, 0, mr );
HeapFree( SystemHeap, 0, rgndata );
HeapFree( GetProcessHeap(), 0, mr );
HeapFree( GetProcessHeap(), 0, rgndata );
if(!ret)
{
WARN("MFDRV_WriteRecord failed\n");
......
......@@ -125,7 +125,7 @@ static DC *MFDRV_AllocMetaFile(void)
if (!(dc = DC_AllocDC( &MFDRV_Funcs ))) return NULL;
dc->header.wMagic = METAFILE_DC_MAGIC;
physDev = (METAFILEDRV_PDEVICE *)HeapAlloc(SystemHeap,0,sizeof(*physDev));
physDev = (METAFILEDRV_PDEVICE *)HeapAlloc(GetProcessHeap(),0,sizeof(*physDev));
if (!physDev)
{
GDI_HEAP_FREE( dc->hSelf );
......@@ -133,9 +133,9 @@ static DC *MFDRV_AllocMetaFile(void)
}
dc->physDev = physDev;
if (!(physDev->mh = HeapAlloc( SystemHeap, 0, sizeof(*physDev->mh) )))
if (!(physDev->mh = HeapAlloc( GetProcessHeap(), 0, sizeof(*physDev->mh) )))
{
HeapFree( SystemHeap, 0, physDev );
HeapFree( GetProcessHeap(), 0, physDev );
GDI_HEAP_FREE( dc->hSelf );
return NULL;
}
......@@ -161,8 +161,8 @@ static BOOL MFDRV_DeleteDC( DC *dc )
{
METAFILEDRV_PDEVICE *physDev = (METAFILEDRV_PDEVICE *)dc->physDev;
if (physDev->mh) HeapFree( SystemHeap, 0, physDev->mh );
HeapFree( SystemHeap, 0, physDev );
if (physDev->mh) HeapFree( GetProcessHeap(), 0, physDev->mh );
HeapFree( GetProcessHeap(), 0, physDev );
dc->physDev = NULL;
GDI_FreeObject(dc->hSelf);
return TRUE;
......@@ -352,7 +352,7 @@ BOOL MFDRV_WriteRecord( DC *dc, METARECORD *mr, DWORD rlen)
{
case METAFILE_MEMORY:
len = physDev->mh->mtSize * 2 + rlen;
mh = HeapReAlloc( SystemHeap, 0, physDev->mh, len );
mh = HeapReAlloc( GetProcessHeap(), 0, physDev->mh, len );
if (!mh) return FALSE;
physDev->mh = mh;
memcpy((WORD *)physDev->mh + physDev->mh->mtSize, mr, rlen);
......
......@@ -52,7 +52,7 @@ INT16 MFDRV_CreateBrushIndirect(DC *dc, HBRUSH hBrush )
lb16.lbColor = brushObj->logbrush.lbColor;
lb16.lbHatch = brushObj->logbrush.lbHatch;
size = sizeof(METARECORD) + sizeof(LOGBRUSH16) - 2;
mr = HeapAlloc( SystemHeap, 0, size );
mr = HeapAlloc( GetProcessHeap(), 0, size );
mr->rdSize = size / 2;
mr->rdFunction = META_CREATEBRUSHINDIRECT;
memcpy( mr->rdParm, &lb16, sizeof(LOGBRUSH));
......@@ -76,7 +76,7 @@ INT16 MFDRV_CreateBrushIndirect(DC *dc, HBRUSH hBrush )
size = sizeof(METARECORD) + sizeof(WORD) + sizeof(BITMAPINFO) +
sizeof(RGBQUAD) + bmSize;
mr = HeapAlloc(SystemHeap, HEAP_ZERO_MEMORY, size);
mr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
if(!mr) return FALSE;
mr->rdFunction = META_DIBCREATEPATTERNBRUSH;
mr->rdSize = size / 2;
......@@ -113,7 +113,7 @@ INT16 MFDRV_CreateBrushIndirect(DC *dc, HBRUSH hBrush )
biSize = DIB_BitmapInfoSize(info,
LOWORD(brushObj->logbrush.lbColor));
size = sizeof(METARECORD) + biSize + bmSize + 2;
mr = HeapAlloc(SystemHeap, HEAP_ZERO_MEMORY, size);
mr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
if(!mr) return FALSE;
mr->rdFunction = META_DIBCREATEPATTERNBRUSH;
mr->rdSize = size / 2;
......@@ -129,7 +129,7 @@ INT16 MFDRV_CreateBrushIndirect(DC *dc, HBRUSH hBrush )
index = MFDRV_AddHandleDC( dc );
if(!MFDRV_WriteRecord( dc, mr, mr->rdSize * 2))
index = -1;
HeapFree(SystemHeap, 0, mr);
HeapFree(GetProcessHeap(), 0, mr);
GDI_HEAP_UNLOCK( hBrush );
return index;
}
......
......@@ -210,7 +210,7 @@ BOOL WIN16DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device, LPCSTR output,
TRACE("In creatdc for (%s,%s,%s) initData 0x%p\n",
driver, device, output, initData);
physDev = (WIN16DRV_PDEVICE *)HeapAlloc( SystemHeap, 0, sizeof(*physDev) );
physDev = (WIN16DRV_PDEVICE *)HeapAlloc( GetProcessHeap(), 0, sizeof(*physDev) );
if (!physDev) return FALSE;
dc->physDev = physDev;
......@@ -218,7 +218,7 @@ BOOL WIN16DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device, LPCSTR output,
if (pLPD == NULL)
{
WARN("Failed to find printer driver\n");
HeapFree( SystemHeap, 0, physDev );
HeapFree( GetProcessHeap(), 0, physDev );
return FALSE;
}
TRACE("windevCreateDC pLPD 0x%p\n", pLPD);
......
......@@ -185,7 +185,7 @@ LOADED_PRINTER_DRIVER *LoadPrinterDriver(const char *pszDriver)
memset(pLPD, 0 , sizeof(LOADED_PRINTER_DRIVER));
pLPD->hInst = hInst;
pLPD->szDriver = HEAP_strdupA(SystemHeap,0,pszDriver);
pLPD->szDriver = HEAP_strdupA(GetProcessHeap(),0,pszDriver);
/* Get DS for the printer module */
pLPD->ds_reg = hInst;
......@@ -421,7 +421,7 @@ WORD PRTDRV_Output(LPPDEVICE lpDestDev,
RGNDATA *clip;
size = GetRegionData( hClipRgn, 0, NULL );
clip = HeapAlloc( SystemHeap, 0, size );
clip = HeapAlloc( GetProcessHeap(), 0, size );
if(!clip)
{
WARN("Can't alloc clip array in PRTDRV_Output\n");
......@@ -456,7 +456,7 @@ WORD PRTDRV_Output(LPPDEVICE lpDestDev,
}
SEGPTR_FREE(lP8);
}
HeapFree( SystemHeap, 0, clip );
HeapFree( GetProcessHeap(), 0, clip );
}
else
{
......
......@@ -328,7 +328,7 @@ static LFD* LFD_Parse(LPSTR lpFont)
if (*lpch)
WARN("Extra ignored in font '%s'\n", lpFont);
lfd = HeapAlloc( SystemHeap, 0, sizeof(LFD) );
lfd = HeapAlloc( GetProcessHeap(), 0, sizeof(LFD) );
if (lfd)
{
lfd->foundry = lfd_fld[0];
......@@ -1341,7 +1341,7 @@ static void XFONT_LoadDefault(LPCSTR ini, LPCSTR fonttype)
XFONT_LoadDefaultLFD(lfd, fonttype);
else
WARN("Ini section [%s]%s is malformed\n", INIFontSection, ini);
HeapFree(SystemHeap, 0, lfd);
HeapFree(GetProcessHeap(), 0, lfd);
}
}
}
......@@ -1376,7 +1376,7 @@ static fontAlias* XFONT_CreateAlias( LPCSTR lpTypeFace, LPCSTR lpAlias )
}
j = lstrlenA(lpTypeFace) + 1;
pfa = HeapAlloc( SystemHeap, 0, sizeof(fontAlias) +
pfa = HeapAlloc( GetProcessHeap(), 0, sizeof(fontAlias) +
j + lstrlenA(lpAlias) + 1 );
if (pfa)
{
......@@ -1444,7 +1444,7 @@ static void XFONT_LoadAlias(const LFD* lfd, LPCSTR lpAlias, BOOL bSubst)
/* Update any references to the substituted font in aliasTable */
if(!strcmp(frMatch->lfFaceName, pfa->faTypeFace))
pfa->faTypeFace = HEAP_strdupA( SystemHeap, 0, lpAlias );
pfa->faTypeFace = HEAP_strdupA( GetProcessHeap(), 0, lpAlias );
prev = pfa;
}
......@@ -1511,7 +1511,7 @@ static void XFONT_LoadAliases(void)
XFONT_LoadAlias( lfd, "Times New Roman", FALSE);
XFONT_LoadDefaultLFD( lfd, "serif ");
HeapFree(SystemHeap, 0, lfd);
HeapFree(GetProcessHeap(), 0, lfd);
}
PROFILE_GetWineIniString( INIFontSection, INIDefaultSansSerif,
......@@ -1525,7 +1525,7 @@ static void XFONT_LoadAliases(void)
XFONT_LoadAlias( lfd, "Arial", FALSE);
XFONT_LoadDefaultLFD( lfd, "sans serif ");
HeapFree(SystemHeap, 0, lfd);
HeapFree(GetProcessHeap(), 0, lfd);
}
/* then user specified aliases */
......@@ -1549,7 +1549,7 @@ static void XFONT_LoadAliases(void)
if (lfd)
{
XFONT_LoadAlias(lfd, buffer, bSubst);
HeapFree(SystemHeap, 0, lfd);
HeapFree(GetProcessHeap(), 0, lfd);
}
}
else
......@@ -1601,10 +1601,10 @@ void XFONT_RemoveFontResource( fontResource** ppfr )
while( pfr->fi )
{
pfi = pfr->fi->next;
HeapFree( SystemHeap, 0, pfr->fi );
HeapFree( GetProcessHeap(), 0, pfr->fi );
pfr->fi = pfi;
}
HeapFree( SystemHeap, 0, pfr );
HeapFree( GetProcessHeap(), 0, pfr );
#endif
*ppfr = pfr->next;
}
......@@ -1647,7 +1647,7 @@ static void XFONT_LoadIgnore(char* lfdname)
else
WARN("Malformed font resource\n");
HeapFree(SystemHeap, 0, lfd);
HeapFree(GetProcessHeap(), 0, lfd);
}
static void XFONT_LoadIgnores(void)
......@@ -1696,7 +1696,7 @@ static char* XFONT_UserMetricsCache( char* buffer, int* buf_size )
int i = strlen( home ) + strlen( INIWinePrefix ) +
strlen( INIFontMetrics ) + strlen( pchDisplay ) + 2;
if( i > *buf_size )
buffer = (char*) HeapReAlloc( SystemHeap, 0, buffer, *buf_size = i );
buffer = (char*) HeapReAlloc( GetProcessHeap(), 0, buffer, *buf_size = i );
strcpy( buffer, home );
strcat( buffer, INIWinePrefix );
strcat( buffer, INIFontMetrics );
......@@ -1759,7 +1759,7 @@ static void XFONT_CheckFIList( fontResource* fr, fontInfo* fi, int action)
fr->fi_count--;
if( prev ) prev->next = pfi = pfi->next;
else fr->fi = pfi = pfi->next;
HeapFree( SystemHeap, 0, subset );
HeapFree( GetProcessHeap(), 0, subset );
continue;
}
}
......@@ -1834,14 +1834,14 @@ static int XFONT_BuildMetrics(char** x_pattern, int res, unsigned x_checksum, in
XFontStruct* x_fs;
fontInfo* pfi;
typeface = HEAP_strdupA(SystemHeap, 0, x_pattern[i]);
typeface = HEAP_strdupA(GetProcessHeap(), 0, x_pattern[i]);
if (!typeface)
break;
lfd = LFD_Parse(typeface);
if (!lfd)
{
HeapFree(SystemHeap, 0, typeface);
HeapFree(GetProcessHeap(), 0, typeface);
continue;
}
......@@ -1854,7 +1854,7 @@ static int XFONT_BuildMetrics(char** x_pattern, int res, unsigned x_checksum, in
pfr = fr;
}
if( !fi ) fi = (fontInfo*) HeapAlloc(SystemHeap, 0, sizeof(fontInfo));
if( !fi ) fi = (fontInfo*) HeapAlloc(GetProcessHeap(), 0, sizeof(fontInfo));
if( !LFD_InitFontInfo( fi, lfd, x_pattern[i]) )
goto nextfont;
......@@ -1862,17 +1862,17 @@ static int XFONT_BuildMetrics(char** x_pattern, int res, unsigned x_checksum, in
if( !fr ) /* add new family */
{
n_ff++;
fr = (fontResource*) HeapAlloc(SystemHeap, 0, sizeof(fontResource));
fr = (fontResource*) HeapAlloc(GetProcessHeap(), 0, sizeof(fontResource));
if (fr)
{
memset(fr, 0, sizeof(fontResource));
fr->resource = (LFD*) HeapAlloc(SystemHeap, 0, sizeof(LFD));
fr->resource = (LFD*) HeapAlloc(GetProcessHeap(), 0, sizeof(LFD));
memset(fr->resource, 0, sizeof(LFD));
TRACE("family: -%s-%s-\n", lfd->foundry, lfd->family );
fr->resource->foundry = HEAP_strdupA(SystemHeap, 0, lfd->foundry);
fr->resource->family = HEAP_strdupA(SystemHeap, 0, lfd->family);
fr->resource->foundry = HEAP_strdupA(GetProcessHeap(), 0, lfd->foundry);
fr->resource->family = HEAP_strdupA(GetProcessHeap(), 0, lfd->family);
fr->resource->weight = "";
if( pfr ) pfr->next = fr;
......@@ -1934,10 +1934,10 @@ static int XFONT_BuildMetrics(char** x_pattern, int res, unsigned x_checksum, in
XFONT_CheckFIList( fr, fi, UNMARK_SUBSETS );
}
nextfont:
HeapFree(SystemHeap, 0, lfd);
HeapFree(SystemHeap, 0, typeface);
HeapFree(GetProcessHeap(), 0, lfd);
HeapFree(GetProcessHeap(), 0, typeface);
}
if( fi ) HeapFree(SystemHeap, 0, fi);
if( fi ) HeapFree(GetProcessHeap(), 0, fi);
return n_ff;
}
......@@ -1969,7 +1969,7 @@ static BOOL XFONT_ReadCachedMetrics( int fd, int res, unsigned x_checksum, int x
if( length == (i + offset) )
{
lseek( fd, offset, SEEK_SET );
fontList = (fontResource*)HeapAlloc( SystemHeap, 0, i);
fontList = (fontResource*)HeapAlloc( GetProcessHeap(), 0, i);
if( fontList )
{
fontResource* pfr = fontList;
......@@ -2033,7 +2033,7 @@ static BOOL XFONT_ReadCachedMetrics( int fd, int res, unsigned x_checksum, int x
}
}
fail:
if( fontList ) HeapFree( SystemHeap, 0, fontList );
if( fontList ) HeapFree( GetProcessHeap(), 0, fontList );
fontList = NULL;
close( fd );
}
......@@ -2576,7 +2576,7 @@ static fontObject* XFONT_GetCacheEntry(void)
/* FIXME: lpXForm, lpPixmap */
if(fontCache[j].lpX11Trans)
HeapFree( SystemHeap, 0, fontCache[j].lpX11Trans );
HeapFree( GetProcessHeap(), 0, fontCache[j].lpX11Trans );
TSXFreeFont( display, fontCache[j].fs );
......@@ -2591,7 +2591,7 @@ static fontObject* XFONT_GetCacheEntry(void)
TRACE("\tgrowing font cache from %i to %i\n", fontCacheSize, prev_i );
if( (newCache = (fontObject*)HeapReAlloc(SystemHeap, 0,
if( (newCache = (fontObject*)HeapReAlloc(GetProcessHeap(), 0,
fontCache, prev_i)) )
{
i = fontCacheSize;
......@@ -2654,7 +2654,7 @@ BOOL X11DRV_FONT_Init( DeviceCaps* pDevCaps )
}
x_checksum |= X_PFONT_MAGIC;
buf_size = 128;
buffer = HeapAlloc( SystemHeap, 0, buf_size );
buffer = HeapAlloc( GetProcessHeap(), 0, buf_size );
/* deal with systemwide font metrics cache */
......@@ -2700,7 +2700,7 @@ BOOL X11DRV_FONT_Init( DeviceCaps* pDevCaps )
TSXFreeFont(display, x_fs);
}
}
HeapFree(SystemHeap, 0, buffer);
HeapFree(GetProcessHeap(), 0, buffer);
XFONT_WindowsNames();
XFONT_LoadAliases();
......@@ -2712,7 +2712,7 @@ BOOL X11DRV_FONT_Init( DeviceCaps* pDevCaps )
/* fontList initialization is over, allocate X font cache */
fontCache = (fontObject*) HeapAlloc(SystemHeap, 0, fontCacheSize * sizeof(fontObject));
fontCache = (fontObject*) HeapAlloc(GetProcessHeap(), 0, fontCacheSize * sizeof(fontObject));
XFONT_GrowFreeList(0, fontCacheSize - 1);
TRACE("done!\n");
......@@ -2746,7 +2746,7 @@ static BOOL XFONT_SetX11Trans( fontObject *pfo )
}
if (lfd->pixel_size[0] != '[') {
HeapFree(SystemHeap, 0, lfd);
HeapFree(GetProcessHeap(), 0, lfd);
TSXFree(fontName);
return FALSE;
}
......@@ -2755,7 +2755,7 @@ static BOOL XFONT_SetX11Trans( fontObject *pfo )
sscanf(lfd->pixel_size, "[%f%f%f%f]", &PX->a, &PX->b, &PX->c, &PX->d);
TSXFree(fontName);
HeapFree(SystemHeap, 0, lfd);
HeapFree(GetProcessHeap(), 0, lfd);
TSXGetFontProperty( pfo->fs, RAW_ASCENT, &PX->RAW_ASCENT );
TSXGetFontProperty( pfo->fs, RAW_DESCENT, &PX->RAW_DESCENT );
......@@ -2830,9 +2830,9 @@ static X_PHYSFONT XFONT_RealizeFont( const LPLOGFONT16 plf, LPCSTR* faceMatched)
if(pfo->lf.lfEscapement != 0) {
pfo->lpX11Trans = HeapAlloc(SystemHeap, 0, sizeof(XFONTTRANS));
pfo->lpX11Trans = HeapAlloc(GetProcessHeap(), 0, sizeof(XFONTTRANS));
if(!XFONT_SetX11Trans( pfo )) {
HeapFree(SystemHeap, 0, pfo->lpX11Trans);
HeapFree(GetProcessHeap(), 0, pfo->lpX11Trans);
pfo->lpX11Trans = NULL;
}
}
......
......@@ -118,18 +118,18 @@ SNOOP16_RegisterDLL(NE_MODULE *pModule,LPCSTR name) {
return; /* already registered */
dll = &((*dll)->next);
}
*dll = (SNOOP16_DLL*)HeapAlloc(SystemHeap,HEAP_ZERO_MEMORY,sizeof(SNOOP16_DLL));
*dll = (SNOOP16_DLL*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(SNOOP16_DLL));
(*dll)->next = NULL;
(*dll)->hmod = pModule->self;
if ((s=strrchr(name,'\\')))
name = s+1;
(*dll)->name = HEAP_strdupA(SystemHeap,0,name);
(*dll)->name = HEAP_strdupA(GetProcessHeap(),0,name);
if ((s=strrchr((*dll)->name,'.')))
*s='\0';
(*dll)->funhandle = GlobalHandleToSel16(GLOBAL_Alloc(GMEM_ZEROINIT,65535,0,TRUE,FALSE,FALSE));
(*dll)->funs = GlobalLock16((*dll)->funhandle);
if (!(*dll)->funs) {
HeapFree(SystemHeap,0,*dll);
HeapFree(GetProcessHeap(),0,*dll);
FIXME("out of memory\n");
return;
}
......@@ -185,9 +185,9 @@ SNOOP16_GetProcAddress16(HMODULE16 hmod,DWORD ordinal,FARPROC16 origfun) {
}
}
if (*cpnt)
fun->name = HEAP_strdupA(SystemHeap,0,name);
fun->name = HEAP_strdupA(GetProcessHeap(),0,name);
else
fun->name = HEAP_strdupA(SystemHeap,0,"");
fun->name = HEAP_strdupA(GetProcessHeap(),0,"");
if (!SNOOP_ShowDebugmsgSnoop(dll->name, ordinal, fun->name))
return origfun;
......@@ -196,7 +196,7 @@ SNOOP16_GetProcAddress16(HMODULE16 hmod,DWORD ordinal,FARPROC16 origfun) {
char *s=strchr(fun->name,'_');
if (!strncasecmp(s,"_thunkdata",10)) {
HeapFree(SystemHeap,0,fun->name);
HeapFree(GetProcessHeap(),0,fun->name);
fun->name = NULL;
return origfun;
}
......@@ -270,7 +270,7 @@ void WINAPI SNOOP16_Entry(FARPROC proc, LPBYTE args, CONTEXT86 *context) {
DPRINTF(" ...");
} else if (fun->nrofargs<0) {
DPRINTF("<unknown, check return>");
ret->args = HeapAlloc(SystemHeap,0,16*sizeof(WORD));
ret->args = HeapAlloc(GetProcessHeap(),0,16*sizeof(WORD));
memcpy(ret->args,(LPBYTE)((char *) PTR_SEG_OFF_TO_LIN(SS_reg(context),LOWORD(ESP_reg(context)))+8),sizeof(WORD)*16);
}
DPRINTF(") ret=%04x:%04x\n",HIWORD(ret->origreturn),LOWORD(ret->origreturn));
......@@ -306,7 +306,7 @@ void WINAPI SNOOP16_Return(FARPROC proc, LPBYTE args, CONTEXT86 *context) {
DPRINTF(") retval = %04x:%04x ret=%04x:%04x\n",
DX_reg(context),AX_reg(context),HIWORD(ret->origreturn),LOWORD(ret->origreturn)
);
HeapFree(SystemHeap,0,ret->args);
HeapFree(GetProcessHeap(),0,ret->args);
ret->args = NULL;
} else
DPRINTF("Ret %s.%ld: %s() retval = %04x:%04x ret=%04x:%04x\n",
......
......@@ -150,7 +150,7 @@ FARPROC THUNK_Alloc( FARPROC16 func, RELAY relay )
}
/* Otherwise, we need to alloc a thunk */
thunk = HeapAlloc( SystemHeap, 0, sizeof(*thunk) );
thunk = HeapAlloc( GetProcessHeap(), 0, sizeof(*thunk) );
if (thunk)
{
thunk->popl_eax = 0x58;
......@@ -179,14 +179,14 @@ void THUNK_Free( FARPROC thunk )
|| t->magic != CALLTO16_THUNK_MAGIC )
return;
if (HEAP_IsInsideHeap( SystemHeap, 0, t ))
if (HEAP_IsInsideHeap( GetProcessHeap(), 0, t ))
{
THUNK **prev = &firstThunk;
while (*prev && (*prev != t)) prev = &(*prev)->next;
if (*prev)
{
*prev = t->next;
HeapFree( SystemHeap, 0, t );
HeapFree( GetProcessHeap(), 0, t );
return;
}
}
......
......@@ -90,13 +90,13 @@ static char *get_tok(const char *str, const char *delim)
if(str && buf)
{
HeapFree(SystemHeap, 0, buf);
HeapFree(GetProcessHeap(), 0, buf);
buf = NULL;
}
if(str && !buf)
{
buf = HEAP_strdupA(SystemHeap, 0, str);
buf = HEAP_strdupA(GetProcessHeap(), 0, str);
cptr = strtok(buf, delim);
}
else
......@@ -106,7 +106,7 @@ static char *get_tok(const char *str, const char *delim)
if(!cptr)
{
HeapFree(SystemHeap, 0, buf);
HeapFree(GetProcessHeap(), 0, buf);
buf = NULL;
}
return cptr;
......@@ -193,7 +193,7 @@ static BOOL AddLoadOrder(module_loadorder_t *plo, BOOL override)
{
/* No space in current array, make it larger */
nmodule_loadorder_alloc += LOADORDER_ALLOC_CLUSTER;
module_loadorder = (module_loadorder_t *)HeapReAlloc(SystemHeap,
module_loadorder = (module_loadorder_t *)HeapReAlloc(GetProcessHeap(),
0,
module_loadorder,
nmodule_loadorder_alloc * sizeof(module_loadorder_t));
......@@ -204,7 +204,7 @@ static BOOL AddLoadOrder(module_loadorder_t *plo, BOOL override)
}
}
memcpy(module_loadorder[nmodule_loadorder].loadorder, plo->loadorder, sizeof(plo->loadorder));
module_loadorder[nmodule_loadorder].modulename = HEAP_strdupA(SystemHeap, 0, plo->modulename);
module_loadorder[nmodule_loadorder].modulename = HEAP_strdupA(GetProcessHeap(), 0, plo->modulename);
nmodule_loadorder++;
return TRUE;
}
......@@ -262,7 +262,7 @@ static BOOL ParseCommandlineOverrides(void)
if(!Options.dllFlags)
return TRUE;
cpy = HEAP_strdupA(SystemHeap, 0, Options.dllFlags);
cpy = HEAP_strdupA(GetProcessHeap(), 0, Options.dllFlags);
key = cpy;
next = key;
for(; next; key = next)
......@@ -291,7 +291,7 @@ static BOOL ParseCommandlineOverrides(void)
}
}
endit:
HeapFree(SystemHeap, 0, cpy);
HeapFree(GetProcessHeap(), 0, cpy);
return retval;;
}
......@@ -375,7 +375,7 @@ BOOL MODULE_InitLoadOrder(void)
if(nbuffer)
{
extra_ld_library_path = HEAP_strdupA(SystemHeap, 0, buffer);
extra_ld_library_path = HEAP_strdupA(GetProcessHeap(), 0, buffer);
TRACE("Setting extra LD_LIBRARY_PATH=%s\n", buffer);
}
#endif
......
......@@ -499,12 +499,12 @@ static HMODULE16 NE_LoadExeHeader( LPCSTR filename )
fastload_length=ne_header.fastload_length<<ne_header.align_shift_count;
TRACE("Using fast-load area offset=%x len=%d\n",
fastload_offset, fastload_length );
if ((fastload = HeapAlloc( SystemHeap, 0, fastload_length )) != NULL)
if ((fastload = HeapAlloc( GetProcessHeap(), 0, fastload_length )) != NULL)
{
_llseek16( hFile, fastload_offset, SEEK_SET);
if (_hread16(hFile, fastload, fastload_length) != fastload_length)
{
HeapFree( SystemHeap, 0, fastload );
HeapFree( GetProcessHeap(), 0, fastload );
WARN("Error reading fast-load area!\n");
fastload = NULL;
}
......@@ -514,7 +514,7 @@ static HMODULE16 NE_LoadExeHeader( LPCSTR filename )
/* Get the segment table */
pModule->seg_table = (int)pData - (int)pModule;
buffer = HeapAlloc( SystemHeap, 0, ne_header.n_segment_tab *
buffer = HeapAlloc( GetProcessHeap(), 0, ne_header.n_segment_tab *
sizeof(struct ne_segment_table_entry_s));
if (buffer)
{
......@@ -525,9 +525,9 @@ static HMODULE16 NE_LoadExeHeader( LPCSTR filename )
ne_header.n_segment_tab * sizeof(struct ne_segment_table_entry_s),
buffer ))
{
HeapFree( SystemHeap, 0, buffer );
HeapFree( GetProcessHeap(), 0, buffer );
if (fastload)
HeapFree( SystemHeap, 0, fastload );
HeapFree( GetProcessHeap(), 0, fastload );
GlobalFree16( hModule );
_lclose16( hFile );
return (HMODULE16)11; /* invalid exe */
......@@ -538,12 +538,12 @@ static HMODULE16 NE_LoadExeHeader( LPCSTR filename )
memcpy( pData, pSeg, sizeof(*pSeg) );
pData += sizeof(SEGTABLEENTRY);
}
HeapFree( SystemHeap, 0, buffer );
HeapFree( GetProcessHeap(), 0, buffer );
}
else
{
if (fastload)
HeapFree( SystemHeap, 0, fastload );
HeapFree( GetProcessHeap(), 0, fastload );
GlobalFree16( hModule );
_lclose16( hFile );
return (HMODULE16)11; /* invalid exe */
......@@ -574,7 +574,7 @@ static HMODULE16 NE_LoadExeHeader( LPCSTR filename )
pData ))
{
if (fastload)
HeapFree( SystemHeap, 0, fastload );
HeapFree( GetProcessHeap(), 0, fastload );
GlobalFree16( hModule );
_lclose16( hFile );
return (HMODULE16)11; /* invalid exe */
......@@ -591,7 +591,7 @@ static HMODULE16 NE_LoadExeHeader( LPCSTR filename )
pData ))
{
if (fastload)
HeapFree( SystemHeap, 0, fastload );
HeapFree( GetProcessHeap(), 0, fastload );
GlobalFree16( hModule );
_lclose16( hFile );
return (HMODULE16)11; /* invalid exe */
......@@ -608,7 +608,7 @@ static HMODULE16 NE_LoadExeHeader( LPCSTR filename )
pData ))
{
if (fastload)
HeapFree( SystemHeap, 0, fastload );
HeapFree( GetProcessHeap(), 0, fastload );
GlobalFree16( hModule );
_lclose16( hFile );
return (HMODULE16)11; /* invalid exe */
......@@ -617,7 +617,7 @@ static HMODULE16 NE_LoadExeHeader( LPCSTR filename )
/* Load entry table, convert it to the optimized version used by Windows */
if ((pTempEntryTable = HeapAlloc( SystemHeap, 0, ne_header.entry_tab_length)) != NULL)
if ((pTempEntryTable = HeapAlloc( GetProcessHeap(), 0, ne_header.entry_tab_length)) != NULL)
{
BYTE nr_entries, type, *s;
......@@ -626,9 +626,9 @@ static HMODULE16 NE_LoadExeHeader( LPCSTR filename )
if (!READ( mz_header.e_lfanew + ne_header.entry_tab_offset,
ne_header.entry_tab_length, pTempEntryTable ))
{
HeapFree( SystemHeap, 0, pTempEntryTable );
HeapFree( GetProcessHeap(), 0, pTempEntryTable );
if (fastload)
HeapFree( SystemHeap, 0, fastload );
HeapFree( GetProcessHeap(), 0, fastload );
GlobalFree16( hModule );
_lclose16( hFile );
return (HMODULE16)11; /* invalid exe */
......@@ -689,12 +689,12 @@ static HMODULE16 NE_LoadExeHeader( LPCSTR filename )
}
}
}
HeapFree( SystemHeap, 0, pTempEntryTable );
HeapFree( GetProcessHeap(), 0, pTempEntryTable );
}
else
{
if (fastload)
HeapFree( SystemHeap, 0, fastload );
HeapFree( GetProcessHeap(), 0, fastload );
GlobalFree16( hModule );
_lclose16( hFile );
return (HMODULE16)11; /* invalid exe */
......@@ -718,7 +718,7 @@ static HMODULE16 NE_LoadExeHeader( LPCSTR filename )
#undef READ
if (fastload)
HeapFree( SystemHeap, 0, fastload );
HeapFree( GetProcessHeap(), 0, fastload );
/* Get the non-resident names table */
......
......@@ -305,7 +305,7 @@ static DWORD Release_reserved_mutex (HANDLE mutex, LPSTR mutex_name, BOOL releas
if (!ReleaseMutex(mutex))
{
ERR("ReleaseMutex failed - %s mutex %li\n",mutex_name,GetLastError());
HeapFree(SystemHeap, 0, this_instance);
HeapFree(GetProcessHeap(), 0, this_instance);
if ( release_handle_m )
{
ReleaseMutex(handle_mutex);
......@@ -314,7 +314,7 @@ static DWORD Release_reserved_mutex (HANDLE mutex, LPSTR mutex_name, BOOL releas
}
if ( release_this_i )
{
HeapFree(SystemHeap, 0, this_instance);
HeapFree(GetProcessHeap(), 0, this_instance);
}
return DMLERR_NO_ERROR;
}
......@@ -565,7 +565,7 @@ UINT WINAPI DdeInitializeW( LPDWORD pidInst, PFNCALLBACK pfnCallback,
/* grab enough heap for one control struct - not really necessary for re-initialise
* but allows us to use same validation routines */
this_instance= (DDE_HANDLE_ENTRY*)HeapAlloc( SystemHeap, 0, sizeof(DDE_HANDLE_ENTRY) );
this_instance= (DDE_HANDLE_ENTRY*)HeapAlloc( GetProcessHeap(), 0, sizeof(DDE_HANDLE_ENTRY) );
if ( this_instance == NULL )
{
/* catastrophe !! warn user & abort */
......@@ -616,7 +616,7 @@ UINT WINAPI DdeInitializeW( LPDWORD pidInst, PFNCALLBACK pfnCallback,
handle_mutex = ConvertToGlobalHandle(handle_mutex); /* fixme when having seperate adresspaces*/
if ( !handle_mutex ) {
ERR("CreateMutex failed - handle list %li\n",GetLastError());
HeapFree(SystemHeap, 0, this_instance);
HeapFree(GetProcessHeap(), 0, this_instance);
return DMLERR_SYS_ERROR;
}
} else {
......@@ -706,7 +706,7 @@ UINT WINAPI DdeInitializeW( LPDWORD pidInst, PFNCALLBACK pfnCallback,
if ( !WaitForMutex(handle_mutex) )
{
HeapFree(SystemHeap, 0, this_instance);
HeapFree(GetProcessHeap(), 0, this_instance);
return DMLERR_SYS_ERROR;
}
......@@ -715,7 +715,7 @@ UINT WINAPI DdeInitializeW( LPDWORD pidInst, PFNCALLBACK pfnCallback,
if ( Release_reserved_mutex(handle_mutex,"handle_mutex",0,1,this_instance)) return DMLERR_SYS_ERROR;
return DMLERR_DLL_USAGE;
}
HeapFree(SystemHeap, 0, this_instance); /* finished - release heap space used as work store */
HeapFree(GetProcessHeap(), 0, this_instance); /* finished - release heap space used as work store */
/* can't reinitialise if we have initialised nothing !! */
reference_inst = DDE_Handle_Table_Base;
/* must first check if we have been given a valid instance to re-initialise !! how do we do that ? */
......@@ -1888,10 +1888,10 @@ HDDEDATA WINAPI DdeNameService( DWORD idInst, HSZ hsz1, HSZ hsz2,
reference_service = this_service;
this_service = this_service->next;
DdeReleaseAtom(reference_inst,reference_service->hsz);
HeapFree(SystemHeap, 0, reference_service); /* finished - release heap space used as work store */
HeapFree(GetProcessHeap(), 0, reference_service); /* finished - release heap space used as work store */
}
DdeReleaseAtom(reference_inst,this_service->hsz);
HeapFree(SystemHeap, 0, this_service); /* finished - release heap space used as work store */
HeapFree(GetProcessHeap(), 0, this_service); /* finished - release heap space used as work store */
reference_inst->ServiceNames = NULL;
TRACE("General de-register - finished\n");
}
......@@ -1913,7 +1913,7 @@ HDDEDATA WINAPI DdeNameService( DWORD idInst, HSZ hsz1, HSZ hsz2,
DdeReserveAtom(reference_inst, hsz1);
this_service = (ServiceNode*)HeapAlloc( SystemHeap, 0, sizeof(ServiceNode) );
this_service = (ServiceNode*)HeapAlloc( GetProcessHeap(), 0, sizeof(ServiceNode) );
this_service->hsz = hsz1;
this_service->FilterOn = TRUE;
......@@ -1937,7 +1937,7 @@ HDDEDATA WINAPI DdeNameService( DWORD idInst, HSZ hsz1, HSZ hsz2,
{
*pServiceNode = this_service->next;
DdeReleaseAtom(reference_inst,this_service->hsz);
HeapFree(SystemHeap, 0, this_service);
HeapFree(GetProcessHeap(), 0, this_service);
}
}
if ( afCmd & DNS_FILTERON )
......
......@@ -50,10 +50,10 @@ BOOL16 WINAPI NotifyRegister16( HTASK16 htask, FARPROC16 lpfnCallback,
break;
if (i==nrofnotifys) {
if (notifys==NULL)
notifys=(struct notify*)HeapAlloc( SystemHeap, 0,
notifys=(struct notify*)HeapAlloc( GetProcessHeap(), 0,
sizeof(struct notify) );
else
notifys=(struct notify*)HeapReAlloc( SystemHeap, 0, notifys,
notifys=(struct notify*)HeapReAlloc( GetProcessHeap(), 0, notifys,
sizeof(struct notify)*(nrofnotifys+1));
if (!notifys) return FALSE;
nrofnotifys++;
......@@ -76,7 +76,7 @@ BOOL16 WINAPI NotifyUnregister16( HTASK16 htask )
if (i==-1)
return FALSE;
memcpy(notifys+i,notifys+(i+1),sizeof(struct notify)*(nrofnotifys-i-1));
notifys=(struct notify*)HeapReAlloc( SystemHeap, 0, notifys,
notifys=(struct notify*)HeapReAlloc( GetProcessHeap(), 0, notifys,
(nrofnotifys-1)*sizeof(struct notify));
nrofnotifys--;
return TRUE;
......
......@@ -63,7 +63,7 @@ static BOOL EMF_Delete_HENHMETAFILE( HENHMETAFILE hmf )
CloseHandle( metaObj->hMapping );
CloseHandle( metaObj->hFile );
} else
HeapFree( SystemHeap, 0, metaObj->emh );
HeapFree( GetProcessHeap(), 0, metaObj->emh );
return GDI_FreeObject( hmf );
}
......@@ -256,7 +256,7 @@ UINT WINAPI GetEnhMetaFileDescriptionW(
*/
HENHMETAFILE WINAPI SetEnhMetaFileBits(UINT bufsize, const BYTE *buf)
{
ENHMETAHEADER *emh = HeapAlloc( SystemHeap, 0, bufsize );
ENHMETAHEADER *emh = HeapAlloc( GetProcessHeap(), 0, bufsize );
memmove(emh, buf, bufsize);
return EMF_Create_HENHMETAFILE( emh, 0, 0 );
}
......@@ -1333,7 +1333,7 @@ HENHMETAFILE WINAPI CopyEnhMetaFileA(
if(!emrSrc) return FALSE;
if (!file) {
emrDst = HeapAlloc( SystemHeap, 0, emrSrc->nBytes );
emrDst = HeapAlloc( GetProcessHeap(), 0, emrSrc->nBytes );
memcpy( emrDst, emrSrc, emrSrc->nBytes );
hmfDst = EMF_Create_HENHMETAFILE( emrDst, 0, 0 );
} else {
......@@ -1478,7 +1478,7 @@ HENHMETAFILE WINAPI SetWinMetaFileBits(UINT cbBuffer,
/* 1. Get the header - skip over this and get straight to the records */
uNewEnhMetaFileBufferSize = sizeof( ENHMETAHEADER );
lpNewEnhMetaFileBuffer = HeapAlloc( SystemHeap, HEAP_ZERO_MEMORY,
lpNewEnhMetaFileBuffer = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
uNewEnhMetaFileBufferSize );
if( lpNewEnhMetaFileBuffer == NULL )
......@@ -1533,7 +1533,7 @@ HENHMETAFILE WINAPI SetWinMetaFileBits(UINT cbBuffer,
#define EMF_ReAllocAndAdjustPointers( a , b ) \
{ \
LPVOID lpTmp; \
lpTmp = HeapReAlloc( SystemHeap, 0, \
lpTmp = HeapReAlloc( GetProcessHeap(), 0, \
lpNewEnhMetaFileBuffer, \
uNewEnhMetaFileBufferSize + (b) ); \
if( lpTmp == NULL ) { ERR( "No memory!\n" ); goto error; } \
......@@ -1802,7 +1802,7 @@ HENHMETAFILE WINAPI SetWinMetaFileBits(UINT cbBuffer,
error:
/* Free the data associated with our copy since it's been copied */
HeapFree( SystemHeap, 0, lpNewEnhMetaFileBuffer );
HeapFree( GetProcessHeap(), 0, lpNewEnhMetaFileBuffer );
return 0;
}
......
......@@ -165,7 +165,7 @@ BOOL WINAPI DeleteMetaFile( HMETAFILE hmf )
METAHEADER *mh = MF_GetMetaHeader( hmf );
if(!mh) return FALSE;
HeapFree( SystemHeap, 0, mh );
HeapFree( GetProcessHeap(), 0, mh );
GDI_FreeObject( hmf );
return TRUE;
}
......@@ -182,21 +182,21 @@ static METAHEADER *MF_ReadMetaFile(HFILE hfile)
DWORD BytesRead, size;
size = sizeof(METAHEADER);
mh = HeapAlloc( SystemHeap, 0, size );
mh = HeapAlloc( GetProcessHeap(), 0, size );
if(!mh) return NULL;
if(ReadFile( hfile, mh, size, &BytesRead, NULL) == 0 ||
BytesRead != size) {
HeapFree( SystemHeap, 0, mh );
HeapFree( GetProcessHeap(), 0, mh );
return NULL;
}
size = mh->mtSize * 2;
mh = HeapReAlloc( SystemHeap, 0, mh, size );
mh = HeapReAlloc( GetProcessHeap(), 0, mh, size );
if(!mh) return NULL;
size -= sizeof(METAHEADER);
if(ReadFile( hfile, (char *)mh + sizeof(METAHEADER), size, &BytesRead,
NULL) == 0 ||
BytesRead != size) {
HeapFree( SystemHeap, 0, mh );
HeapFree( GetProcessHeap(), 0, mh );
return NULL;
}
......@@ -319,10 +319,10 @@ METAHEADER *MF_CreateMetaHeaderDisk(METAHEADER *mh, LPCSTR filename)
METAHEADERDISK *mhd;
DWORD size;
mh = HeapReAlloc( SystemHeap, 0, mh,
mh = HeapReAlloc( GetProcessHeap(), 0, mh,
sizeof(METAHEADER) + sizeof(METAHEADERDISK));
mh->mtType = METAFILE_DISK;
size = HeapSize( SystemHeap, 0, mh );
size = HeapSize( GetProcessHeap(), 0, mh );
mhd = (METAHEADERDISK *)((char *)mh + sizeof(METAHEADER));
strcpy(mhd->filename, filename);
return mh;
......@@ -344,7 +344,7 @@ HMETAFILE16 WINAPI CopyMetaFile16( HMETAFILE16 hSrcMetaFile, LPCSTR lpFilename)
if(mh->mtType == METAFILE_DISK)
mh2 = MF_LoadDiskBasedMetaFile(mh);
else {
mh2 = HeapAlloc( SystemHeap, 0, mh->mtSize * 2 );
mh2 = HeapAlloc( GetProcessHeap(), 0, mh->mtSize * 2 );
memcpy( mh2, mh, mh->mtSize * 2 );
}
MF_ReleaseMetaHeader16( hSrcMetaFile );
......@@ -352,7 +352,7 @@ HMETAFILE16 WINAPI CopyMetaFile16( HMETAFILE16 hSrcMetaFile, LPCSTR lpFilename)
if(lpFilename) { /* disk based metafile */
if((hFile = CreateFileA(lpFilename, GENERIC_WRITE, 0, NULL,
CREATE_ALWAYS, 0, -1)) == HFILE_ERROR) {
HeapFree( SystemHeap, 0, mh2 );
HeapFree( GetProcessHeap(), 0, mh2 );
return 0;
}
WriteFile(hFile, mh2, mh2->mtSize * 2, NULL, NULL);
......@@ -394,7 +394,7 @@ HMETAFILE WINAPI CopyMetaFileA(
if(mh->mtType == METAFILE_DISK)
mh2 = MF_LoadDiskBasedMetaFile(mh);
else {
mh2 = HeapAlloc( SystemHeap, 0, mh->mtSize * 2 );
mh2 = HeapAlloc( GetProcessHeap(), 0, mh->mtSize * 2 );
memcpy( mh2, mh, mh->mtSize * 2 );
}
MF_ReleaseMetaHeader( hSrcMetaFile );
......@@ -402,7 +402,7 @@ HMETAFILE WINAPI CopyMetaFileA(
if(lpFilename) { /* disk based metafile */
if((hFile = CreateFileA(lpFilename, GENERIC_WRITE, 0, NULL,
CREATE_ALWAYS, 0, -1)) == HFILE_ERROR) {
HeapFree( SystemHeap, 0, mh2 );
HeapFree( GetProcessHeap(), 0, mh2 );
return 0;
}
WriteFile(hFile, mh2, mh2->mtSize * 2, NULL, NULL);
......@@ -487,7 +487,7 @@ static BOOL MF_PlayMetaFile( HDC hdc, METAHEADER *mh)
hFont = GetCurrentObject(hdc, OBJ_FONT);
/* create the handle table */
ht = HeapAlloc( SystemHeap, HEAP_ZERO_MEMORY,
ht = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(HANDLETABLE16) * mh->mtNoObjects);
if(!ht) return FALSE;
......@@ -518,9 +518,9 @@ static BOOL MF_PlayMetaFile( HDC hdc, METAHEADER *mh)
DeleteObject(*(ht->objectHandle + i));
/* free handle table */
HeapFree( SystemHeap, 0, ht );
HeapFree( GetProcessHeap(), 0, ht );
if(loaded)
HeapFree( SystemHeap, 0, mh );
HeapFree( GetProcessHeap(), 0, mh );
return TRUE;
}
......@@ -631,7 +631,7 @@ BOOL16 WINAPI EnumMetaFile16( HDC16 hdc, HMETAFILE16 hmf,
/* free handle table */
GlobalFree16(hHT);
if(loaded)
HeapFree( SystemHeap, 0, mh );
HeapFree( GetProcessHeap(), 0, mh );
MF_ReleaseMetaHeader16(hmf);
return result;
}
......@@ -679,7 +679,7 @@ BOOL WINAPI EnumMetaFile(
hBrush = GetCurrentObject(hdc, OBJ_BRUSH);
hFont = GetCurrentObject(hdc, OBJ_FONT);
ht = HeapAlloc( SystemHeap, HEAP_ZERO_MEMORY,
ht = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(HANDLETABLE) * mh->mtNoObjects);
/* loop through metafile records */
......@@ -710,9 +710,9 @@ BOOL WINAPI EnumMetaFile(
DeleteObject(*(ht->objectHandle + i));
/* free handle table */
HeapFree( SystemHeap, 0, ht);
HeapFree( GetProcessHeap(), 0, ht);
if(loaded)
HeapFree( SystemHeap, 0, mh );
HeapFree( GetProcessHeap(), 0, mh );
MF_ReleaseMetaHeader(hmf);
return result;
}
......@@ -1269,7 +1269,7 @@ HMETAFILE WINAPI SetMetaFileBitsEx(
const BYTE *lpData /* pointer to metafile data */
)
{
METAHEADER *mh = HeapAlloc( SystemHeap, 0, size );
METAHEADER *mh = HeapAlloc( GetProcessHeap(), 0, size );
if (!mh) return 0;
memcpy(mh, lpData, size);
return MF_Create_HMETAFILE(mh);
......
......@@ -131,17 +131,17 @@ SNOOP_RegisterDLL(HMODULE hmod,LPCSTR name,DWORD nrofordinals) {
return; /* already registered */
dll = &((*dll)->next);
}
*dll = (SNOOP_DLL*)HeapAlloc(SystemHeap,HEAP_ZERO_MEMORY,sizeof(SNOOP_DLL));
*dll = (SNOOP_DLL*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(SNOOP_DLL));
(*dll)->next = NULL;
(*dll)->hmod = hmod;
(*dll)->nrofordinals = nrofordinals;
(*dll)->name = HEAP_strdupA(SystemHeap,0,name);
(*dll)->name = HEAP_strdupA(GetProcessHeap(),0,name);
if ((s=strrchr((*dll)->name,'.')))
*s='\0';
(*dll)->funs = VirtualAlloc(NULL,nrofordinals*sizeof(SNOOP_FUN),MEM_COMMIT|MEM_RESERVE,PAGE_EXECUTE_READWRITE);
memset((*dll)->funs,0,nrofordinals*sizeof(SNOOP_FUN));
if (!(*dll)->funs) {
HeapFree(SystemHeap,0,*dll);
HeapFree(GetProcessHeap(),0,*dll);
FIXME("out of memory\n");
return;
}
......@@ -187,7 +187,7 @@ SNOOP_GetProcAddress(HMODULE hmod,LPCSTR name,DWORD ordinal,FARPROC origfun) {
return origfun;
assert(ordinal<dll->nrofordinals);
fun = dll->funs+ordinal;
if (!fun->name) fun->name = HEAP_strdupA(SystemHeap,0,name);
if (!fun->name) fun->name = HEAP_strdupA(GetProcessHeap(),0,name);
fun->lcall = 0xe8;
/* NOTE: origreturn struct member MUST come directly after snoopentry */
fun->snoopentry = (char*)SNOOP_Entry-((char*)(&fun->nrofargs));
......@@ -323,7 +323,7 @@ void WINAPI SNOOP_DoEntry( CONTEXT86 *context )
DPRINTF(" ...");
} else if (fun->nrofargs<0) {
DPRINTF("<unknown, check return>");
ret->args = HeapAlloc(SystemHeap,0,16*sizeof(DWORD));
ret->args = HeapAlloc(GetProcessHeap(),0,16*sizeof(DWORD));
memcpy(ret->args,(LPBYTE)(ESP_reg(context)+4),sizeof(DWORD)*16);
}
DPRINTF(") ret=%08lx fs=%04lx\n",(DWORD)ret->origreturn,FS_reg(context));
......@@ -355,7 +355,7 @@ void WINAPI SNOOP_DoReturn( CONTEXT86 *context )
DPRINTF(") retval = %08lx ret=%08lx fs=%04lx\n",
EAX_reg(context),(DWORD)ret->origreturn,FS_reg(context)
);
HeapFree(SystemHeap,0,ret->args);
HeapFree(GetProcessHeap(),0,ret->args);
ret->args = NULL;
} else
DPRINTF("Ret %s.%ld: %s() retval = %08lx ret=%08lx fs=%04lx\n",
......
......@@ -180,7 +180,7 @@ static int DRIVER_MapMsg16To32(WORD wMsg, DWORD* lParam1, DWORD* lParam2)
*lParam1 = (DWORD)PTR_SEG_TO_LIN(*lParam1);
if (*lParam2 && wMsg == DRV_OPEN) {
LPMCI_OPEN_DRIVER_PARMS16 modp16 = PTR_SEG_TO_LIN(*lParam2);
char* ptr = HeapAlloc(SystemHeap, 0, sizeof(LPMCI_OPEN_DRIVER_PARMS16) + sizeof(MCI_OPEN_DRIVER_PARMSA));
char* ptr = HeapAlloc(GetProcessHeap(), 0, sizeof(LPMCI_OPEN_DRIVER_PARMS16) + sizeof(MCI_OPEN_DRIVER_PARMSA));
LPMCI_OPEN_DRIVER_PARMSA modp32;
if (ptr) {
......@@ -200,13 +200,13 @@ static int DRIVER_MapMsg16To32(WORD wMsg, DWORD* lParam1, DWORD* lParam2)
case DRV_INSTALL:
/* lParam1 is a handle to a window (or not used), lParam2 is a pointer to DRVCONFIGINFO */
if (*lParam2) {
LPDRVCONFIGINFO dci32 = HeapAlloc(SystemHeap, 0, sizeof(DRVCONFIGINFO));
LPDRVCONFIGINFO dci32 = HeapAlloc(GetProcessHeap(), 0, sizeof(DRVCONFIGINFO));
LPDRVCONFIGINFO16 dci16 = PTR_SEG_TO_LIN(*lParam2);
if (dci32) {
dci32->dwDCISize = sizeof(DRVCONFIGINFO);
dci32->lpszDCISectionName = HEAP_strdupAtoW(SystemHeap, 0, PTR_SEG_TO_LIN(dci16->lpszDCISectionName));
dci32->lpszDCIAliasName = HEAP_strdupAtoW(SystemHeap, 0, PTR_SEG_TO_LIN(dci16->lpszDCIAliasName));
dci32->lpszDCISectionName = HEAP_strdupAtoW(GetProcessHeap(), 0, PTR_SEG_TO_LIN(dci16->lpszDCISectionName));
dci32->lpszDCIAliasName = HEAP_strdupAtoW(GetProcessHeap(), 0, PTR_SEG_TO_LIN(dci16->lpszDCIAliasName));
if (dci32->lpszDCISectionName == NULL || dci32->lpszDCIAliasName == NULL)
return -2;
} else {
......@@ -265,7 +265,7 @@ static int DRIVER_UnMapMsg16To32(WORD wMsg, DWORD lParam1, DWORD lParam2)
modp16->wCustomCommandTable = modp32->wCustomCommandTable;
modp16->wType = modp32->wType;
if (!HeapFree(SystemHeap, 0, modp32))
if (!HeapFree(GetProcessHeap(), 0, modp32))
FIXME("bad free line=%d\n", __LINE__);
}
ret = 0;
......@@ -275,11 +275,11 @@ static int DRIVER_UnMapMsg16To32(WORD wMsg, DWORD lParam1, DWORD lParam2)
/* lParam1 is a handle to a window (or not used), lParam2 is a pointer to DRVCONFIGINFO, lParam2 */
if (lParam2) {
LPDRVCONFIGINFO dci32 = (LPDRVCONFIGINFO)lParam2;
if (!HeapFree(SystemHeap, 0, (LPVOID)dci32->lpszDCISectionName))
if (!HeapFree(GetProcessHeap(), 0, (LPVOID)dci32->lpszDCISectionName))
FIXME("bad free line=%d\n", __LINE__);
if (!HeapFree(SystemHeap, 0, (LPVOID)dci32->lpszDCIAliasName))
if (!HeapFree(GetProcessHeap(), 0, (LPVOID)dci32->lpszDCIAliasName))
FIXME("bad free line=%d\n", __LINE__);
if (!HeapFree(SystemHeap, 0, dci32))
if (!HeapFree(GetProcessHeap(), 0, dci32))
FIXME("bad free line=%d\n", __LINE__);
}
ret = 0;
......@@ -369,18 +369,18 @@ static int DRIVER_MapMsg32To16(WORD wMsg, DWORD* lParam1, DWORD* lParam2)
dci16->dwDCISize = sizeof(DRVCONFIGINFO16);
if ((str1 = HEAP_strdupWtoA(SystemHeap, 0, dci32->lpszDCISectionName)) != NULL &&
if ((str1 = HEAP_strdupWtoA(GetProcessHeap(), 0, dci32->lpszDCISectionName)) != NULL &&
(str2 = SEGPTR_STRDUP(str1)) != NULL) {
dci16->lpszDCISectionName = (LPSTR)SEGPTR_GET(str2);
if (!HeapFree(SystemHeap, 0, str1))
if (!HeapFree(GetProcessHeap(), 0, str1))
FIXME("bad free line=%d\n", __LINE__);
} else {
return -2;
}
if ((str1 = HEAP_strdupWtoA(SystemHeap, 0, dci32->lpszDCIAliasName)) != NULL &&
if ((str1 = HEAP_strdupWtoA(GetProcessHeap(), 0, dci32->lpszDCIAliasName)) != NULL &&
(str2 = SEGPTR_STRDUP(str1)) != NULL) {
dci16->lpszDCIAliasName = (LPSTR)SEGPTR_GET(str2);
if (!HeapFree(SystemHeap, 0, str1))
if (!HeapFree(GetProcessHeap(), 0, str1))
FIXME("bad free line=%d\n", __LINE__);
} else {
return -2;
......@@ -655,7 +655,7 @@ BOOL DRIVER_CloseDriver(LPWINE_DRIVER lpDrv, DWORD lParam1, DWORD lParam2)
SendDriverMessage((HDRVR)lpDrv, DRV_CLOSE, lParam1, lParam2);
if (DRIVER_RemoveFromList(lpDrv)) {
HeapFree(SystemHeap, 0, lpDrv);
HeapFree(GetProcessHeap(), 0, lpDrv);
return TRUE;
}
}
......@@ -674,7 +674,7 @@ LPWINE_DRIVER DRIVER_RegisterDriver16(LPCSTR lpName, HMODULE16 hModule, DRIVERPR
{
LPWINE_DRIVER lpDrv;
lpDrv = HeapAlloc(SystemHeap, 0, sizeof(WINE_DRIVER));
lpDrv = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_DRIVER));
if (lpDrv != NULL) {
lpDrv->dwFlags = WINE_GDF_EXIST|WINE_GDF_16BIT;
lpDrv->dwDriverID = 0;
......@@ -684,7 +684,7 @@ LPWINE_DRIVER DRIVER_RegisterDriver16(LPCSTR lpName, HMODULE16 hModule, DRIVERPR
lpDrv->d.d16.lpDrvProc = lpProc;
if (!DRIVER_AddToList(lpDrv, lParam, bCallFrom32)) {
HeapFree(SystemHeap, 0, lpDrv);
HeapFree(GetProcessHeap(), 0, lpDrv);
lpDrv = NULL;
}
}
......@@ -702,7 +702,7 @@ LPWINE_DRIVER DRIVER_RegisterDriver32(LPCSTR lpName, HMODULE hModule, DRIVERPROC
{
LPWINE_DRIVER lpDrv;
lpDrv = HeapAlloc(SystemHeap, 0, sizeof(WINE_DRIVER));
lpDrv = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_DRIVER));
if (lpDrv != NULL) {
lpDrv->dwFlags = WINE_GDF_EXIST;
lpDrv->dwDriverID = 0;
......@@ -712,7 +712,7 @@ LPWINE_DRIVER DRIVER_RegisterDriver32(LPCSTR lpName, HMODULE hModule, DRIVERPROC
lpDrv->d.d32.lpDrvProc = lpProc;
if (!DRIVER_AddToList(lpDrv, lParam, bCallFrom32)) {
HeapFree(SystemHeap, 0, lpDrv);
HeapFree(GetProcessHeap(), 0, lpDrv);
lpDrv = NULL;
}
}
......
......@@ -2704,7 +2704,7 @@ HWND WINAPI GetLastActivePopup( HWND hwnd )
* WIN_BuildWinArray
*
* Build an array of pointers to the children of a given window.
* The array must be freed with HeapFree(SystemHeap). Return NULL
* The array must be freed with WIN_ReleaseWinArray. Return NULL
* when no windows are found.
*/
WND **WIN_BuildWinArray( WND *wndPtr, UINT bwaFlags, UINT* pTotal )
......@@ -2739,7 +2739,7 @@ WND **WIN_BuildWinArray( WND *wndPtr, UINT bwaFlags, UINT* pTotal )
{
/* Now build the list of all windows */
if ((list = (WND **)HeapAlloc( SystemHeap, 0, sizeof(WND *) * (count + 1))))
if ((list = (WND **)HeapAlloc( GetProcessHeap(), 0, sizeof(WND *) * (count + 1))))
{
for (pWnd = WIN_LockWndPtr(wndPtr->child), ppWnd = list, count = 0; pWnd; WIN_UpdateWndPtr(&pWnd,pWnd->next))
{
......@@ -2765,7 +2765,7 @@ WND **WIN_BuildWinArray( WND *wndPtr, UINT bwaFlags, UINT* pTotal )
void WIN_ReleaseWinArray(WND **wndArray)
{
/* Future : this function will also unlock all windows associated with wndArray */
HeapFree( SystemHeap, 0, wndArray );
HeapFree( GetProcessHeap(), 0, wndArray );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment