Fixed global and local memory functions

svn path=/trunk/; revision=1776
This commit is contained in:
Eric Kohl 2001-04-05 01:54:42 +00:00
parent b7437fe01a
commit b2a5aa012c
4 changed files with 275 additions and 629 deletions

View file

@ -1,4 +1,4 @@
# $Id: makefile,v 1.46 2001/03/31 01:17:29 dwelch Exp $ # $Id: makefile,v 1.47 2001/04/05 01:53:57 ekohl Exp $
# #
# ReactOS Operating System # ReactOS Operating System
# #
@ -29,8 +29,8 @@ FILE_OBJECTS = file/file.o file/curdir.o file/lfile.o file/dir.o \
file/npipe.o file/tape.o file/mailslot.o file/backup.o \ file/npipe.o file/tape.o file/mailslot.o file/backup.o \
file/cnotify.o file/cnotify.o
MEM_OBJECTS = mem/global.o mem/heap.o mem/isbad.o mem/procmem.o \ MEM_OBJECTS = mem/global.o mem/heap.o mem/isbad.o mem/local.o \
mem/section.o mem/virtual.o mem/procmem.o mem/section.o mem/virtual.o
NLS_OBJECTS = nls/codepage.o nls/cpmisc.o nls/cptable.o\ NLS_OBJECTS = nls/codepage.o nls/cpmisc.o nls/cptable.o\
nls/cp37.o nls/cp437.o nls/cp500.o nls/cp737.o nls/cp775.o nls/cp850.o nls/cp852.o nls/cp855.o nls/cp857.o\ nls/cp37.o nls/cp437.o nls/cp500.o nls/cp737.o nls/cp775.o nls/cp850.o nls/cp852.o nls/cp855.o nls/cp857.o\

View file

@ -1,4 +1,4 @@
/* $Id: global.c,v 1.5 2001/01/20 12:18:54 ekohl Exp $ /* $Id: global.c,v 1.6 2001/04/05 01:54:16 ekohl Exp $
* *
* Win32 Global/Local heap functions (GlobalXXX, LocalXXX). * Win32 Global/Local heap functions (GlobalXXX, LocalXXX).
* These functions included in Win32 for compatibility with 16 bit Windows * These functions included in Win32 for compatibility with 16 bit Windows
@ -18,7 +18,7 @@
#define NDEBUG #define NDEBUG
#include <kernel32/kernel32.h> #include <kernel32/kernel32.h>
#if 0
#define MAGIC_GLOBAL_USED 0x5342BEEF #define MAGIC_GLOBAL_USED 0x5342BEEF
#define GLOBAL_LOCK_MAX 0xFF #define GLOBAL_LOCK_MAX 0xFF
@ -29,30 +29,33 @@ typedef struct __GLOBAL_LOCAL_HANDLE
BYTE Flags; BYTE Flags;
BYTE LockCount; BYTE LockCount;
} GLOBAL_HANDLE, LOCAL_HANDLE, *PGLOBAL_HANDLE, *PLOCAL_HANDLE; } GLOBAL_HANDLE, LOCAL_HANDLE, *PGLOBAL_HANDLE, *PLOCAL_HANDLE;
#endif
/********************************************************************* /* FUNCTIONS ***************************************************************/
* GlobalAlloc -- KERNEL32 *
*********************************************************************/ HGLOBAL STDCALL
HGLOBAL WINAPI GlobalAlloc(UINT flags, DWORD size) GlobalAlloc(UINT uFlags,
DWORD dwBytes)
{ {
#if 0
PGLOBAL_HANDLE phandle; PGLOBAL_HANDLE phandle;
PVOID palloc; PVOID palloc;
#endif
DPRINT("GlobalAlloc( 0x%X, 0x%lX )\n", flags, size ); DPRINT("GlobalAlloc( 0x%X, 0x%lX )\n", uFlags, dwBytes);
if((flags & GMEM_MOVEABLE)==0) /* POINTER */ if ((uFlags & GMEM_MOVEABLE)==0) /* POINTER */
{ {
palloc=RtlAllocateHeap(hProcessHeap, 0, size); return ((HGLOBAL)RtlAllocateHeap(hProcessHeap, 0, dwBytes));
return (HGLOBAL) palloc; }
}
else /* HANDLE */ else /* HANDLE */
{ {
#if 0 #if 0
HeapLock(__ProcessHeap); HeapLock(__ProcessHeap);
phandle=__HeapAllocFragment(__ProcessHeap, 0, sizeof(GLOBAL_HANDLE)); phandle=__HeapAllocFragment(__ProcessHeap, 0, sizeof(GLOBAL_HANDLE));
if(size) if(dwBytes)
{ {
palloc=HeapAlloc(__ProcessHeap, 0, size+sizeof(HANDLE)); palloc=HeapAlloc(__ProcessHeap, 0, size+sizeof(HANDLE));
*(PHANDLE)palloc=(HANDLE) &(phandle->Pointer); *(PHANDLE)palloc=(HANDLE) &(phandle->Pointer);
@ -61,27 +64,133 @@ HGLOBAL WINAPI GlobalAlloc(UINT flags, DWORD size)
else else
phandle->Pointer=NULL; phandle->Pointer=NULL;
phandle->Magic=MAGIC_GLOBAL_USED; phandle->Magic=MAGIC_GLOBAL_USED;
phandle->Flags=flags>>8; phandle->Flags=uFlags>>8;
phandle->LockCount=0; phandle->LockCount=0;
HeapUnlock(__ProcessHeap); HeapUnlock(__ProcessHeap);
return (HGLOBAL) &(phandle->Pointer); return (HGLOBAL) &(phandle->Pointer);
#endif #endif
return (HGLOBAL)NULL; return (HGLOBAL)NULL;
} }
} }
/*********************************************************************
* GlobalLock -- KERNEL32 * UINT STDCALL
*********************************************************************/ GlobalCompact(DWORD dwMinFree)
#if 0
LPVOID WINAPI GlobalLock(HGLOBAL hmem)
{ {
return RtlCompactHeap(hProcessHeap, 0);
}
VOID STDCALL
GlobalFix(HGLOBAL hMem)
{
if (hMem != INVALID_HANDLE_VALUE)
GlobalLock(hMem);
}
UINT STDCALL
GlobalFlags(HGLOBAL hMem)
{
#if 0
DWORD retval;
PGLOBAL_HANDLE phandle;
#endif
DPRINT("GlobalFlags( 0x%lX )\n", (ULONG)hMem);
#if 0
if(((ULONG)hmem%8)==0)
{
retval=0;
}
else
{
HeapLock(__ProcessHeap);
phandle=(PGLOBAL_HANDLE)(((LPVOID) hmem)-4);
if(phandle->Magic==MAGIC_GLOBAL_USED)
{
retval=phandle->LockCount + (phandle->Flags<<8);
if(phandle->Pointer==0)
retval|= LMEM_DISCARDED;
}
else
{
DPRINT("GlobalSize: invalid handle\n");
retval=0;
}
HeapUnlock(__ProcessHeap);
}
return retval;
#endif
return 0;
}
HGLOBAL STDCALL
GlobalFree(HGLOBAL hMem)
{
#if 0
PGLOBAL_HANDLE phandle;
#endif
DPRINT("GlobalFree( 0x%lX )\n", (ULONG)hMem);
if (((ULONG)hMem % 4) == 0) /* POINTER */
{
RtlFreeHeap(hProcessHeap, 0, (PVOID)hMem);
}
else /* HANDLE */
{
#if 0
HeapLock(__ProcessHeap);
phandle=(PGLOBAL_HANDLE)(((LPVOID) hMem)-4);
if(phandle->Magic==MAGIC_GLOBAL_USED)
{
HeapLock(__ProcessHeap);
if(phandle->LockCount!=0)
SetLastError(ERROR_INVALID_HANDLE);
if(phandle->Pointer)
HeapHeapFree(GetProcessHeap(),0,__ProcessHeap, 0, phandle->Pointer-sizeof(HANDLE));
__HeapFreeFragment(__ProcessHeap, 0, phandle);
}
HeapUnlock(__ProcessHeap);
#endif
hMem = NULL;
}
return hMem;
}
HGLOBAL STDCALL
GlobalHandle(LPCVOID pMem)
{
DPRINT("GlobalHandle( 0x%lX )\n", (ULONG)pMem);
#if 0
if(((ULONG)pmem%8)==0) /* FIXED */
return (HGLOBAL) pmem;
else /* MOVEABLE */
return (HGLOBAL) *(LPVOID *)(pmem-sizeof(HANDLE));
#endif
return (HGLOBAL)pMem;
}
LPVOID STDCALL
GlobalLock(HGLOBAL hMem)
{
#if 0
PGLOBAL_HANDLE phandle; PGLOBAL_HANDLE phandle;
LPVOID palloc; LPVOID palloc;
#endif
DPRINT("GlobalLock( 0x%lX )\n", (ULONG) hmem ); DPRINT("GlobalLock( 0x%lX )\n", (ULONG)hMem);
#if 0
if(((ULONG)hmem%8)==0) if(((ULONG)hmem%8)==0)
return (LPVOID) hmem; return (LPVOID) hmem;
@ -100,69 +209,33 @@ LPVOID WINAPI GlobalLock(HGLOBAL hmem)
} }
HeapUnlock(__ProcessHeap); HeapUnlock(__ProcessHeap);
return palloc; return palloc;
} #else
return (LPVOID)hMem;
#endif #endif
/*********************************************************************
* GlobalUnlock -- KERNEL32 *
*********************************************************************/
#if 0
BOOL WINAPI GlobalUnlock(HGLOBAL hmem)
{
PGLOBAL_HANDLE phandle;
BOOL locked;
DPRINT("GlobalUnlock( 0x%lX )\n", (ULONG) hmem );
if(((ULONG)hmem%8)==0)
return FALSE;
HeapLock(__ProcessHeap);
phandle=(PGLOBAL_HANDLE)(((LPVOID) hmem)-4);
if(phandle->Magic==MAGIC_GLOBAL_USED)
{
if((phandle->LockCount<GLOBAL_LOCK_MAX)&&(phandle->LockCount>0))
phandle->LockCount--;
locked=(phandle->LockCount==0) ? TRUE : FALSE;
}
else
{
DPRINT("GlobalUnlock: invalid handle\n");
locked=FALSE;
}
HeapUnlock(__ProcessHeap);
return locked;
} }
#endif
/*********************************************************************
* GlobalHandle -- KERNEL32 * VOID STDCALL
*********************************************************************/ GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer)
#if 0
HGLOBAL WINAPI GlobalHandle(LPCVOID pmem)
{ {
DPRINT("GlobalHandle( 0x%lX )\n", (ULONG) pmem ); SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
if(((ULONG)pmem%8)==0) /* FIXED */
return (HGLOBAL) pmem;
else /* MOVEABLE */
return (HGLOBAL) *(LPVOID *)(pmem-sizeof(HANDLE));
} }
#endif
/*********************************************************************
* GlobalReAlloc -- KERNEL32 * HGLOBAL STDCALL
*********************************************************************/ GlobalReAlloc(HGLOBAL hMem,
#if 0 DWORD dwBytes,
HGLOBAL WINAPI GlobalReAlloc(HGLOBAL hmem, DWORD size, UINT flags) UINT uFlags)
{ {
#if 0
LPVOID palloc; LPVOID palloc;
HGLOBAL hnew; HGLOBAL hnew;
PGLOBAL_HANDLE phandle; PGLOBAL_HANDLE phandle;
#endif
DPRINT("GlobalReAlloc( 0x%lX, 0x%lX, 0x%X )\n", (ULONG) hmem, size, flags ); DPRINT("GlobalReAlloc( 0x%lX, 0x%lX, 0x%X )\n", (ULONG)hMem, dwBytes, uFlags);
#if 0
hnew=NULL; hnew=NULL;
HeapLock(__ProcessHeap); HeapLock(__ProcessHeap);
if(flags & GMEM_MODIFY) /* modify flags */ if(flags & GMEM_MODIFY) /* modify flags */
@ -234,58 +307,25 @@ HGLOBAL WINAPI GlobalReAlloc(HGLOBAL hmem, DWORD size, UINT flags)
} }
HeapUnlock(__ProcessHeap); HeapUnlock(__ProcessHeap);
return hnew; return hnew;
} #else
return ((HGLOBAL)RtlReAllocateHeap(hProcessHeap, uFlags, (LPVOID)hMem, dwBytes));
#endif #endif
/*********************************************************************
* GlobalFree -- KERNEL32 *
*********************************************************************/
HGLOBAL WINAPI GlobalFree(HGLOBAL hmem)
{
#if 0
PGLOBAL_HANDLE phandle;
#endif
DPRINT("GlobalFree( 0x%lX )\n", (ULONG) hmem );
if (((ULONG)hmem % 4) == 0) /* POINTER */
{
RtlFreeHeap(hProcessHeap, 0, (LPVOID)hmem);
}
else /* HANDLE */
{
#if 0
HeapLock(__ProcessHeap);
phandle=(PGLOBAL_HANDLE)(((LPVOID) hmem)-4);
if(phandle->Magic==MAGIC_GLOBAL_USED)
{
HeapLock(__ProcessHeap);
if(phandle->LockCount!=0)
SetLastError(ERROR_INVALID_HANDLE);
if(phandle->Pointer)
HeapHeapFree(GetProcessHeap(),0,__ProcessHeap, 0, phandle->Pointer-sizeof(HANDLE));
__HeapFreeFragment(__ProcessHeap, 0, phandle);
}
HeapUnlock(__ProcessHeap);
#endif
hmem = NULL;
}
return hmem;
} }
/*********************************************************************
* GlobalSize -- KERNEL32 * DWORD STDCALL
*********************************************************************/ GlobalSize(HGLOBAL hMem)
DWORD WINAPI GlobalSize(HGLOBAL hmem)
{ {
DWORD retval; DWORD retval;
#if 0
PGLOBAL_HANDLE phandle; PGLOBAL_HANDLE phandle;
#endif
DPRINT("GlobalSize( 0x%lX )\n", (ULONG) hmem ); DPRINT("GlobalSize( 0x%lX )\n", (ULONG)hMem);
if(((ULONG)hmem % 4) == 0) if(((ULONG)hMem % 4) == 0)
{ {
retval = RtlSizeHeap(hProcessHeap, 0, hmem); retval = RtlSizeHeap(hProcessHeap, 0, hMem);
} }
else else
{ {
@ -308,54 +348,62 @@ DWORD WINAPI GlobalSize(HGLOBAL hmem)
return retval; return retval;
} }
/*********************************************************************
* GlobalWire -- KERNEL32 * VOID STDCALL
*********************************************************************/ GlobalUnfix(HGLOBAL hMem)
#if 0
LPVOID WINAPI GlobalWire(HGLOBAL hmem)
{ {
return GlobalLock( hmem ); if (hMem != INVALID_HANDLE_VALUE)
GlobalUnlock(hMem);
} }
BOOL STDCALL
GlobalUnlock(HGLOBAL hMem)
{
#if 0
PGLOBAL_HANDLE phandle;
BOOL locked;
#endif #endif
/********************************************************************* DPRINT("GlobalUnlock( 0x%lX )\n", (ULONG)hMem);
* GlobalUnWire -- KERNEL32 *
*********************************************************************/
#if 0 #if 0
BOOL WINAPI GlobalUnWire(HGLOBAL hmem) if(((ULONG)hmem%8)==0)
{ return FALSE;
return GlobalUnlock( hmem);
} HeapLock(__ProcessHeap);
phandle=(PGLOBAL_HANDLE)(((LPVOID) hmem)-4);
if(phandle->Magic==MAGIC_GLOBAL_USED)
{
if((phandle->LockCount<GLOBAL_LOCK_MAX)&&(phandle->LockCount>0))
phandle->LockCount--;
locked=(phandle->LockCount==0) ? TRUE : FALSE;
}
else
{
DPRINT("GlobalUnlock: invalid handle\n");
locked=FALSE;
}
HeapUnlock(__ProcessHeap);
return locked;
#endif #endif
/********************************************************************* return TRUE;
* GlobalFix -- KERNEL32 *
*********************************************************************/
#if 0
VOID WINAPI GlobalFix(HGLOBAL hmem)
{
GlobalLock( hmem );
} }
#endif
/*********************************************************************
* GlobalUnfix -- KERNEL32 *
*********************************************************************/
#if 0
VOID WINAPI GlobalUnfix(HGLOBAL hmem)
{
GlobalUnlock( hmem);
}
#endif
/********************************************************************* BOOL STDCALL
* GlobalFlags -- KERNEL32 * GlobalUnWire(HGLOBAL hMem)
*********************************************************************/
#if 0
UINT WINAPI GlobalFlags(HGLOBAL hmem)
{ {
return LocalFlags( (HLOCAL) hmem); return GlobalUnlock(hMem);
}
LPVOID STDCALL
GlobalWire(HGLOBAL hMem)
{
return GlobalLock(hMem);
} }
#endif
/* EOF */ /* EOF */

View file

@ -1,9 +1,9 @@
/* $Id: local.c,v 1.4 2000/07/01 17:07:00 ea Exp $ /* $Id: local.c,v 1.5 2001/04/05 01:54:16 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* Copyright (C) 1996, Onno Hovers, All rights reserved * Copyright (C) 1996, Onno Hovers, All rights reserved
* PROJECT: ReactOS system libraries * PROJECT: ReactOS system libraries
* FILE: lib/kernel32/mem/local.cc * FILE: lib/kernel32/mem/local.c
* PURPOSE: Manages the local heap * PURPOSE: Manages the local heap
* PROGRAMER: Onno Hovers (original wfc version) * PROGRAMER: Onno Hovers (original wfc version)
* David Welch (adapted for ReactOS) * David Welch (adapted for ReactOS)
@ -21,109 +21,86 @@
/* INCLUDES ****************************************************************/ /* INCLUDES ****************************************************************/
#include <ddk/ntddk.h>
#include <ntdll/rtl.h>
#include <windows.h> #include <windows.h>
#include <kernel32/heap.h>
#define NDEBUG #define NDEBUG
#include <kernel32/kernel32> #include <kernel32/kernel32.h>
/* FUNCTIONS ***************************************************************/ /* FUNCTIONS ***************************************************************/
/*********************************************************************
* LocalFlags -- KERNEL32 *
*********************************************************************/
UINT WINAPI LocalFlags(HLOCAL hmem)
{
DWORD retval;
PGLOBAL_HANDLE phandle;
if(((ULONG)hmem%8)==0) HLOCAL STDCALL
{ LocalAlloc(UINT uFlags,
retval=0; UINT uBytes)
} {
else return (HLOCAL)GlobalAlloc(uFlags, uBytes);
{
HeapLock(__ProcessHeap);
phandle=(PGLOBAL_HANDLE)(((LPVOID) hmem)-4);
if(phandle->Magic==MAGIC_GLOBAL_USED)
{
retval=phandle->LockCount + (phandle->Flags<<8);
if(phandle->Pointer==0)
retval|= LMEM_DISCARDED;
}
else
{
DPRINT("GlobalSize: invalid handle\n");
retval=0;
}
HeapUnlock(__ProcessHeap);
}
return retval;
} }
/********************************************************************* UINT STDCALL
* LocalAlloc -- KERNEL32 * LocalCompact(UINT uMinFree)
*********************************************************************/
HLOCAL WINAPI LocalAlloc(UINT flags, UINT size)
{ {
return (HLOCAL) GlobalAlloc( flags, size ); return RtlCompactHeap(hProcessHeap, 0);
} }
/*********************************************************************
* LocalLock -- KERNEL32 * UINT STDCALL
*********************************************************************/ LocalFlags(HLOCAL hMem)
LPVOID WINAPI LocalLock(HLOCAL hmem)
{ {
return GlobalLock( (HGLOBAL) hmem ); return GlobalFlags((HGLOBAL)hMem);
} }
/*********************************************************************
* LocalUnlock -- KERNEL32 * HLOCAL STDCALL
*********************************************************************/ LocalFree(HLOCAL hMem)
BOOL WINAPI LocalUnlock(HLOCAL hmem)
{ {
return GlobalUnlock( (HGLOBAL) hmem); return (HLOCAL)GlobalFree((HGLOBAL)hMem);
} }
/*********************************************************************
* LocalHandle -- KERNEL32 * HLOCAL STDCALL
*********************************************************************/ LocalHandle(LPCVOID pMem)
HLOCAL WINAPI LocalHandle(LPCVOID pmem)
{ {
return (HLOCAL) GlobalHandle(pmem); return (HLOCAL)GlobalHandle(pMem);
} }
/*********************************************************************
* LocalReAlloc -- KERNEL32 * LPVOID STDCALL
*********************************************************************/ LocalLock(HLOCAL hMem)
HLOCAL WINAPI LocalReAlloc(HLOCAL hmem, UINT size, UINT flags)
{ {
return (HLOCAL) GlobalReAlloc( (HGLOBAL) hmem, size, flags); return GlobalLock((HGLOBAL)hMem);
} }
/*********************************************************************
* LocalFree -- KERNEL32 * HLOCAL STDCALL
*********************************************************************/ LocalReAlloc(HLOCAL hMem,
HLOCAL WINAPI LocalHeapFree(GetProcessHeap(),0,HLOCAL hmem) UINT uBytes,
UINT uFlags)
{ {
return (HLOCAL) GlobalHeapFree(GetProcessHeap(),0, (HGLOBAL) hmem ); return (HLOCAL)GlobalReAlloc((HGLOBAL)hMem, uBytes, uFlags);
} }
/*********************************************************************
* LocalSize -- KERNEL32 * UINT STDCALL
*********************************************************************/ LocalShrink(HLOCAL hMem, UINT cbNewSize)
UINT WINAPI LocalSize(HLOCAL hmem)
{ {
return GlobalSize( (HGLOBAL) hmem ); return RtlCompactHeap(hProcessHeap, 0);
} }
/*********************************************************************
* LocalShrink -- KERNEL32 * UINT STDCALL
*********************************************************************/ LocalSize(HLOCAL hMem)
UINT WINAPI LocalShrink(HLOCAL hmem, UINT newsize)
{ {
return (__ProcessHeap->End - (LPVOID) __ProcessHeap); return GlobalSize((HGLOBAL)hMem);
}
BOOL STDCALL
LocalUnlock(HLOCAL hMem)
{
return GlobalUnlock((HGLOBAL)hMem);
} }
/* EOF */ /* EOF */

View file

@ -1,4 +1,4 @@
/* $Id: stubs.c,v 1.26 2001/03/31 01:17:29 dwelch Exp $ /* $Id: stubs.c,v 1.27 2001/04/05 01:54:42 ekohl Exp $
* *
* KERNEL32.DLL stubs (unimplemented functions) * KERNEL32.DLL stubs (unimplemented functions)
* Remove from this file, if you implement them. * Remove from this file, if you implement them.
@ -16,18 +16,6 @@ BaseAttachCompleteThunk (VOID)
} }
BOOL BOOL
STDCALL STDCALL
CmdBatNotification ( CmdBatNotification (
@ -39,9 +27,6 @@ CmdBatNotification (
} }
int int
STDCALL STDCALL
CompareStringA ( CompareStringA (
@ -74,7 +59,6 @@ CompareStringW (
} }
LCID LCID
STDCALL STDCALL
ConvertDefaultLocale ( ConvertDefaultLocale (
@ -86,11 +70,6 @@ ConvertDefaultLocale (
} }
DWORD DWORD
STDCALL STDCALL
CreateVirtualBuffer ( CreateVirtualBuffer (
@ -104,13 +83,6 @@ CreateVirtualBuffer (
} }
WINBOOL WINBOOL
STDCALL STDCALL
EnumCalendarInfoW ( EnumCalendarInfoW (
@ -519,8 +491,6 @@ GetDateFormatA (
} }
int int
STDCALL STDCALL
GetLocaleInfoW ( GetLocaleInfoW (
@ -549,10 +519,6 @@ GetLocaleInfoA (
} }
DWORD DWORD
STDCALL STDCALL
GetNextVDMCommand ( GetNextVDMCommand (
@ -596,9 +562,6 @@ GetNumberFormatA (
} }
UINT UINT
STDCALL STDCALL
GetOEMCP (VOID) GetOEMCP (VOID)
@ -608,11 +571,6 @@ GetOEMCP (VOID)
} }
WINBOOL WINBOOL
STDCALL STDCALL
GetStringTypeExW ( GetStringTypeExW (
@ -709,8 +667,6 @@ GetSystemPowerStatus (
} }
LCID LCID
STDCALL STDCALL
GetThreadLocale (VOID) GetThreadLocale (VOID)
@ -806,160 +762,6 @@ GetVDMCurrentDirectories (
return 0; return 0;
} }
/*
HGLOBAL
STDCALL
GlobalAlloc (
UINT uFlags,
DWORD dwBytes
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
*/
UINT
STDCALL
GlobalCompact (
DWORD dwMinFree
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
VOID
STDCALL
GlobalFix (
HGLOBAL hMem
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
}
UINT
STDCALL
GlobalFlags (
HGLOBAL hMem
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
/*
HGLOBAL
STDCALL
GlobalFree (
HGLOBAL hMem
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return hMem;
}
*/
HGLOBAL
STDCALL
GlobalHandle (
LPCVOID pMem
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
LPVOID
STDCALL
GlobalLock (
HGLOBAL hMem
)
{
/* In Win32 GlobalAlloc returns LPVOID? */
return hMem;
}
VOID
STDCALL
GlobalMemoryStatus (
LPMEMORYSTATUS lpBuffer
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
}
HGLOBAL
STDCALL
GlobalReAlloc (
HGLOBAL hMem,
DWORD dwBytes,
UINT uFlags
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
/*
DWORD
STDCALL
GlobalSize (
HGLOBAL hMem
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
*/
WINBOOL
STDCALL
GlobalUnWire (
HGLOBAL hMem
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
VOID
STDCALL
GlobalUnfix (
HGLOBAL hMem
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
}
WINBOOL
STDCALL
GlobalUnlock (
HGLOBAL hMem
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
LPVOID
STDCALL
GlobalWire (
HGLOBAL hMem
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return NULL; /* ? */
}
DWORD DWORD
STDCALL STDCALL
@ -1044,8 +846,6 @@ HeapWalk (
} }
WINBOOL WINBOOL
STDCALL STDCALL
IsDBCSLeadByte ( IsDBCSLeadByte (
@ -1069,6 +869,25 @@ IsDBCSLeadByteEx (
} }
/**********************************************************************
* NAME PRIVATE
* IsInstalledCP@4
*
* RETURN VALUE
* TRUE if CodePage is installed in the system.
*/
static
BOOL
STDCALL
IsInstalledCP (
UINT CodePage
)
{
/* FIXME */
return TRUE;
}
WINBOOL WINBOOL
STDCALL STDCALL
IsValidCodePage ( IsValidCodePage (
@ -1136,123 +955,6 @@ LoadModule (
} }
HLOCAL
STDCALL
LocalAlloc (
UINT uFlags,
UINT uBytes
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
UINT
STDCALL
LocalCompact (
UINT uMinFree
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
UINT
STDCALL
LocalFlags (
HLOCAL hMem
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
HLOCAL
STDCALL
LocalFree (
HLOCAL hMem
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return hMem;
}
HLOCAL
STDCALL
LocalHandle (
LPCVOID pMem
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
LPVOID
STDCALL
LocalLock (
HLOCAL hMem
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return NULL;
}
HLOCAL
STDCALL
LocalReAlloc (
HLOCAL hMem,
UINT uBytes,
UINT uFlags
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
UINT
STDCALL
LocalShrink (
HLOCAL hMem,
UINT cbNewSize
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
UINT
STDCALL
LocalSize (
HLOCAL hMem
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
WINBOOL
STDCALL
LocalUnlock (
HLOCAL hMem
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
int int
STDCALL STDCALL
MulDiv ( MulDiv (
@ -1266,25 +968,6 @@ MulDiv (
} }
/**********************************************************************
* NAME PRIVATE
* IsInstalledCP@4
*
* RETURN VALUE
* TRUE if CodePage is installed in the system.
*/
static
BOOL
STDCALL
IsInstalledCP (
UINT CodePage
)
{
/* FIXME */
return TRUE;
}
/********************************************************************** /**********************************************************************
* NAME EXPORTED * NAME EXPORTED
* MultiByteToWideChar@24 * MultiByteToWideChar@24
@ -1430,13 +1113,6 @@ MultiByteToWideChar (
} }
WINBOOL WINBOOL
STDCALL STDCALL
QueryPerformanceCounter ( QueryPerformanceCounter (
@ -1459,11 +1135,6 @@ QueryPerformanceFrequency (
} }
WINBOOL WINBOOL
STDCALL STDCALL
RegisterConsoleVDM ( RegisterConsoleVDM (
@ -1507,8 +1178,6 @@ RegisterWowExec (
} }
WINBOOL WINBOOL
STDCALL STDCALL
SetComputerNameA ( SetComputerNameA (
@ -1531,14 +1200,6 @@ SetComputerNameW (
} }
WINBOOL WINBOOL
STDCALL STDCALL
SetLocaleInfoA ( SetLocaleInfoA (
@ -1565,11 +1226,6 @@ SetLocaleInfoW (
} }
WINBOOL WINBOOL
STDCALL STDCALL
SetSystemPowerState ( SetSystemPowerState (
@ -1582,8 +1238,6 @@ SetSystemPowerState (
} }
WINBOOL WINBOOL
STDCALL STDCALL
SetThreadLocale ( SetThreadLocale (
@ -1607,24 +1261,6 @@ SetVDMCurrentDirectories (
} }
DWORD DWORD
STDCALL STDCALL
TrimVirtualBuffer ( TrimVirtualBuffer (
@ -1636,8 +1272,6 @@ TrimVirtualBuffer (
} }
DWORD DWORD
STDCALL STDCALL
VDMConsoleOperation ( VDMConsoleOperation (
@ -1687,9 +1321,6 @@ VerLanguageNameW (
} }
DWORD DWORD
STDCALL STDCALL
VirtualBufferExceptionHandler ( VirtualBufferExceptionHandler (
@ -1703,9 +1334,6 @@ VirtualBufferExceptionHandler (
} }
int int
STDCALL STDCALL
WideCharToMultiByte ( WideCharToMultiByte (
@ -1724,11 +1352,4 @@ WideCharToMultiByte (
} }
/* EOF */ /* EOF */