Index: trunk/src/imagehlp/imagehlp.cpp
===================================================================
--- trunk/src/imagehlp/imagehlp.cpp	(revision 736)
+++ trunk/src/imagehlp/imagehlp.cpp	(revision 736)
@@ -0,0 +1,822 @@
+/* $Id: imagehlp.cpp,v 1.1 1999-08-29 14:54:54 sandervl Exp $ */
+/*
+ *	IMAGEHLP library
+ *
+ *	Copyright 1998	Patrik Stridvall
+ *	Copyright 1999	Jens Wiessner
+ */
+
+#include <os2win.h>
+#include <debugdefs.h>
+#include <imagehlp.h>
+#include <heapstring.h>
+#include "debugtools.h"
+
+DEFAULT_DEBUG_CHANNEL(imagehlp)
+
+
+/***********************************************************************
+ *           Data
+ */
+
+static PLOADED_IMAGE IMAGEHLP_pFirstLoadedImage=NULL;
+static PLOADED_IMAGE IMAGEHLP_pLastLoadedImage=NULL;
+
+static LOADED_IMAGE IMAGEHLP_EmptyLoadedImage = {
+  NULL,       /* ModuleName */
+  0xffffffff, /* hFile */
+  NULL,       /* MappedAddress */
+  NULL,       /* FileHeader */
+  NULL,       /* LastRvaSection */
+  0,          /* NumberOfSections */
+  NULL,       /* Sections */
+  1,          /* Characteristics */
+  FALSE,      /* fSystemImage */
+  FALSE,      /* fDOSImage */
+  { &IMAGEHLP_EmptyLoadedImage.Links, &IMAGEHLP_EmptyLoadedImage.Links }, /* Links */
+  148,        /* SizeOfImage; */
+};
+
+
+/**********************************************************************/
+
+HANDLE IMAGEHLP_hHeap = (HANDLE) NULL;
+
+static API_VERSION IMAGEHLP_ApiVersion = { 4, 0, 0, 5 };
+
+/***********************************************************************
+ *           IMAGEHLP_LibMain (IMAGEHLP.init)
+ */
+BOOL WINAPI IMAGEHLP_LibMain(
+  HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+{
+  switch(fdwReason)
+    {
+    case DLL_PROCESS_ATTACH:
+      IMAGEHLP_hHeap = HeapCreate(0, 0x10000, 0);
+      break;
+    case DLL_PROCESS_DETACH:
+      HeapDestroy(IMAGEHLP_hHeap);
+      IMAGEHLP_hHeap = (HANDLE) NULL;
+      break;
+    case DLL_THREAD_ATTACH:
+      break;
+    case DLL_THREAD_DETACH:
+      break;
+    default:
+      break;
+    }
+  return TRUE;
+}
+
+
+/***********************************************************************
+ *           BindImage32 (IMAGEHLP.1)
+ */
+BOOL WINAPI BindImage(
+  LPSTR ImageName, LPSTR DllPath, LPSTR SymbolPath)
+{
+  return BindImageEx(0, ImageName, DllPath, SymbolPath, NULL);
+}
+
+/***********************************************************************
+ *           BindImageEx32 (IMAGEHLP.2)
+ */
+BOOL WINAPI BindImageEx(
+  DWORD Flags, LPSTR ImageName, LPSTR DllPath, LPSTR SymbolPath,
+  PIMAGEHLP_STATUS_ROUTINE StatusRoutine)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           CheckSumMappedFile32 (IMAGEHLP.3)
+ */
+PIMAGE_NT_HEADERS WINAPI CheckSumMappedFile(
+  LPVOID BaseAddress, DWORD FileLength, 
+  LPDWORD HeaderSum, LPDWORD CheckSum)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return NULL;
+}
+
+/***********************************************************************
+ *           EnumerateLoadedModules32 (IMAGEHLP.4)
+ */
+BOOL WINAPI EnumerateLoadedModules(
+  HANDLE hProcess,
+  PENUMLOADED_MODULES_CALLBACK EnumLoadedModulesCallback,
+  PVOID UserContext)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           FindDebugInfoFile32 (IMAGEHLP.5)
+ */
+HANDLE WINAPI FindDebugInfoFile(
+  LPSTR FileName, LPSTR SymbolPath, LPSTR DebugFilePath)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return (HANDLE) NULL;
+}
+
+/***********************************************************************
+ *           FindExecutableImage32 (IMAGEHLP.6)
+ */
+HANDLE WINAPI FindExecutableImage(
+  LPSTR FileName, LPSTR SymbolPath, LPSTR ImageFilePath)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return (HANDLE) NULL;
+}
+
+/***********************************************************************
+ *           GetImageConfigInformation32 (IMAGEHLP.7)
+ */
+BOOL WINAPI GetImageConfigInformation(
+  PLOADED_IMAGE LoadedImage,
+  PIMAGE_LOAD_CONFIG_DIRECTORY ImageConfigInformation)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           GetImageUnusedHeaderBytes32 (IMAGEHLP.8)
+ */
+DWORD WINAPI GetImageUnusedHeaderBytes(
+  PLOADED_IMAGE LoadedImage,
+  LPDWORD SizeUnusedHeaderBytes)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+/***********************************************************************
+ *           GetTimestampForLoadedLibrary32 (IMAGEHLP.9)
+ */
+DWORD WINAPI GetTimestampForLoadedLibrary(HMODULE Module)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+/***********************************************************************
+ *           ImageAddCertificate32 (IMAGEHLP.10)
+ */
+
+BOOL WINAPI ImageAddCertificate(
+  HANDLE FileHandle, PWIN_CERTIFICATE Certificate, PDWORD Index)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           ImageDirectoryEntryToData32 (IMAGEHLP.11)
+ */
+PVOID WINAPI ImageDirectoryEntryToData(
+  PVOID Base, BOOLEAN MappedAsImage, USHORT DirectoryEntry, PULONG Size)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return NULL;
+}
+
+/***********************************************************************
+ *           ImageEnumerateCertificates32 (IMAGEHLP.12)
+ */
+BOOL WINAPI ImageEnumerateCertificates(
+  HANDLE FileHandle, WORD TypeFilter, PDWORD CertificateCount,
+  PDWORD Indices, DWORD IndexCount)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           ImageGetCertificateData32 (IMAGEHLP.13)
+ */
+BOOL WINAPI ImageGetCertificateData(
+  HANDLE FileHandle, DWORD CertificateIndex,
+  PWIN_CERTIFICATE Certificate, PDWORD RequiredLength)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           ImageGetCertificateHeader32 (IMAGEHLP.14)
+ */
+BOOL WINAPI ImageGetCertificateHeader(
+  HANDLE FileHandle, DWORD CertificateIndex,
+  PWIN_CERTIFICATE Certificateheader)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           ImageGetDigestStream32 (IMAGEHLP.15)
+ */
+BOOL WINAPI ImageGetDigestStream(
+  HANDLE FileHandle, DWORD DigestLevel,
+  DIGEST_FUNCTION DigestFunction, DIGEST_HANDLE DigestHandle)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           ImageLoad32 (IMAGEHLP.16)
+ */
+PLOADED_IMAGE WINAPI ImageLoad(LPSTR DllName, LPSTR DllPath)
+{
+// FIXME-JW  PLOADED_IMAGE pLoadedImage = HeapAlloc (IMAGEHLP_hHeap, 0, sizeof(LOADED_IMAGE));
+// FIXME-JW  return pLoadedImage;
+  return NULL;
+}
+
+/***********************************************************************
+ *           ImageNtHeader32 (IMAGEHLP.17)
+ */
+PIMAGE_NT_HEADERS WINAPI ImageNtHeader(PVOID Base)
+{
+  return (PIMAGE_NT_HEADERS)
+    ((LPBYTE) Base + ((PIMAGE_DOS_HEADER) Base)->e_lfanew);
+}
+
+/***********************************************************************
+ *           ImageRemoveCertificate32 (IMAGEHLP.18)
+ */
+BOOL WINAPI ImageRemoveCertificate(HANDLE FileHandle, DWORD Index)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           ImageRvaToSection32 (IMAGEHLP.19)
+ */
+PIMAGE_SECTION_HEADER WINAPI ImageRvaToSection(
+  PIMAGE_NT_HEADERS NtHeaders, PVOID Base, ULONG Rva)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return NULL;
+}
+
+/***********************************************************************
+ *           ImageRvaToVa32 (IMAGEHLP.20)
+ */
+PVOID WINAPI ImageRvaToVa(
+  PIMAGE_NT_HEADERS NtHeaders, PVOID Base, ULONG Rva,
+  PIMAGE_SECTION_HEADER *LastRvaSection)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return NULL;
+}
+
+/***********************************************************************
+ *           ImageUnload32 (IMAGEHLP.21)
+ */
+BOOL WINAPI ImageUnload(PLOADED_IMAGE pLoadedImage)
+{
+  LIST_ENTRY *pCurrent, *pFind;
+  if(!IMAGEHLP_pFirstLoadedImage || !pLoadedImage)
+    {
+      /* No image loaded or null pointer */
+      SetLastError(ERROR_INVALID_PARAMETER);
+      return FALSE;
+    }
+
+  pFind=&pLoadedImage->Links;
+  pCurrent=&IMAGEHLP_pFirstLoadedImage->Links;
+  while((pCurrent != pFind) && 
+    (pCurrent != NULL)) 
+      pCurrent = pCurrent->Flink;
+  if(!pCurrent)
+    {
+      /* Not found */
+      SetLastError(ERROR_INVALID_PARAMETER);
+      return FALSE;
+    }
+
+  if(pCurrent->Blink)
+    pCurrent->Blink->Flink = pCurrent->Flink;
+  else
+    IMAGEHLP_pFirstLoadedImage = pCurrent->Flink?CONTAINING_RECORD(
+      pCurrent->Flink, LOADED_IMAGE, Links):NULL;
+
+  if(pCurrent->Flink)
+    pCurrent->Flink->Blink = pCurrent->Blink;
+  else
+    IMAGEHLP_pLastLoadedImage = pCurrent->Blink?CONTAINING_RECORD(
+      pCurrent->Blink, LOADED_IMAGE, Links):NULL;
+
+  return FALSE;
+}
+
+
+/***********************************************************************
+ *           ImagehlpApiVersion32 (IMAGEHLP.22)
+ */
+PAPI_VERSION WINAPI ImagehlpApiVersion()
+{
+  return &IMAGEHLP_ApiVersion;
+}
+
+/***********************************************************************
+ *           ImagehlpApiVersionEx32 (IMAGEHLP.23)
+ */
+PAPI_VERSION WINAPI ImagehlpApiVersionEx(PAPI_VERSION AppVersion)
+{
+  if(!AppVersion)
+    return NULL;
+
+  AppVersion->MajorVersion = IMAGEHLP_ApiVersion.MajorVersion;
+  AppVersion->MinorVersion = IMAGEHLP_ApiVersion.MinorVersion;
+  AppVersion->Revision = IMAGEHLP_ApiVersion.Revision;
+  AppVersion->Reserved = IMAGEHLP_ApiVersion.Reserved;
+
+  return AppVersion;
+}
+
+/***********************************************************************
+ *           MakeSureDirectoryPathExists32 (IMAGEHLP.24)
+ */
+BOOL WINAPI MakeSureDirectoryPathExists(LPCSTR DirPath)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           MapAndLoad32 (IMAGEHLP.25)
+ */
+BOOL WINAPI MapAndLoad(
+  LPSTR pszImageName, LPSTR pszDllPath, PLOADED_IMAGE pLoadedImage,
+  BOOL bDotDll, BOOL bReadOnly)
+{
+  CHAR szFileName[MAX_PATH];
+  HANDLE hFile = (HANDLE) NULL;
+  HANDLE hFileMapping = (HANDLE) NULL;
+  HMODULE hModule = (HMODULE) NULL;
+  PIMAGE_NT_HEADERS pNtHeader = NULL;
+
+  /* PathCombine(&szFileName, pszDllPath, pszImageName); */
+  /* PathRenameExtension(&szFileName, bDotDll?:"dll":"exe"); */
+
+  /* FIXME: Check if the file already loaded (use IMAGEHLP_pFirstLoadedImage32) */
+  if(!(hFile = CreateFileA(
+    szFileName, GENERIC_READ, 1, /* FIXME: FILE_SHARE_READ not defined */
+    NULL, OPEN_EXISTING, 0, (HANDLE) NULL)))
+    {
+      SetLastError(ERROR_FILE_NOT_FOUND);
+      goto Error;
+    }
+
+  if(!(hFileMapping = CreateFileMappingA(
+    hFile, NULL, PAGE_READONLY | SEC_COMMIT, 0, 0, NULL)))
+    {
+      DWORD dwLastError = GetLastError();
+//      WARN("CreateFileMapping: Error = %ld\n", dwLastError);
+      SetLastError(dwLastError);
+      goto Error;
+    }
+  CloseHandle(hFile);
+  hFile = (HANDLE) NULL;
+
+  if(!(hModule = (HMODULE) MapViewOfFile(
+    hFileMapping, FILE_MAP_READ, 0, 0, 0)))
+    {
+      DWORD dwLastError = GetLastError();
+//      WARN("MapViewOfFile: Error = %ld\n", dwLastError);
+      SetLastError(dwLastError);
+      goto Error;
+    }
+
+  CloseHandle(hFileMapping);
+  hFileMapping=(HANDLE) NULL;
+
+  pLoadedImage = (PLOADED_IMAGE) HeapAlloc(
+    IMAGEHLP_hHeap, 0, sizeof(LOADED_IMAGE)
+  );
+
+  pNtHeader = ImageNtHeader((PVOID) hModule);
+
+  pLoadedImage->ModuleName =
+    HEAP_strdupA(IMAGEHLP_hHeap, 0, pszDllPath); /* FIXME: Correct? */
+  pLoadedImage->hFile = hFile;
+  pLoadedImage->MappedAddress = (PUCHAR) hModule;
+  pLoadedImage->FileHeader = pNtHeader;
+  pLoadedImage->Sections = (PIMAGE_SECTION_HEADER)
+    ((LPBYTE) &pNtHeader->OptionalHeader +
+      pNtHeader->FileHeader.SizeOfOptionalHeader);
+  pLoadedImage->NumberOfSections =
+    pNtHeader->FileHeader.NumberOfSections;
+  pLoadedImage->SizeOfImage =
+    pNtHeader->OptionalHeader.SizeOfImage;
+  pLoadedImage->Characteristics =
+    pNtHeader->FileHeader.Characteristics;
+  pLoadedImage->LastRvaSection = pLoadedImage->Sections;
+
+  pLoadedImage->fSystemImage = FALSE; /* FIXME */
+  pLoadedImage->fDOSImage = FALSE;    /* FIXME */
+
+  /* FIXME: Make thread safe */
+  pLoadedImage->Links.Flink = NULL;
+  pLoadedImage->Links.Blink = &IMAGEHLP_pLastLoadedImage->Links;
+  if(IMAGEHLP_pLastLoadedImage)
+    IMAGEHLP_pLastLoadedImage->Links.Flink = &pLoadedImage->Links;
+  IMAGEHLP_pLastLoadedImage = pLoadedImage;
+  if(!IMAGEHLP_pFirstLoadedImage)
+    IMAGEHLP_pFirstLoadedImage = pLoadedImage;
+
+  return TRUE;
+
+Error:
+  if(hModule)
+    UnmapViewOfFile((PVOID) hModule);
+  if(hFileMapping)
+    CloseHandle(hFileMapping);
+  if(hFile)
+    CloseHandle(hFile);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           MapDebugInformation32 (IMAGEHLP.26)
+ */
+PIMAGE_DEBUG_INFORMATION WINAPI MapDebugInformation(
+  HANDLE FileHandle, LPSTR FileName,
+  LPSTR SymbolPath, DWORD ImageBase)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return NULL;
+}
+
+/***********************************************************************
+ *           MapFileAndCheckSum32A (IMAGEHLP.27)
+ */
+DWORD WINAPI MapFileAndCheckSumA(
+  LPSTR Filename, LPDWORD HeaderSum, LPDWORD CheckSum)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return CHECKSUM_OPEN_FAILURE;
+}
+
+/***********************************************************************
+ *           MapFileAndCheckSum32W (IMAGEHLP.28)
+ */
+DWORD WINAPI MapFileAndCheckSumW(
+  LPWSTR Filename, LPDWORD HeaderSum, LPDWORD CheckSum)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return CHECKSUM_OPEN_FAILURE;
+}
+
+/***********************************************************************
+ *           MarkImageAsRunFromSwap (IMAGEHLP.29)
+ * FIXME
+ *   No documentation available.
+ */
+
+/***********************************************************************
+ *           ReBaseImage32 (IMAGEHLP.30)
+ */
+BOOL WINAPI ReBaseImage(
+  LPSTR CurrentImageName, LPSTR SymbolPath, BOOL fReBase,
+  BOOL fRebaseSysfileOk, BOOL fGoingDown, ULONG CheckImageSize,
+  ULONG *OldImageSize, ULONG *OldImageBase, ULONG *NewImageSize,
+  ULONG *NewImageBase, ULONG TimeStamp)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           RemovePrivateCvSymbolic32 (IMAGEHLP.31)
+ */
+BOOL WINAPI RemovePrivateCvSymbolic(
+  PCHAR DebugData, PCHAR *NewDebugData, ULONG *NewDebugSize)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           RemoveRelocations32 (IMAGEHLP.32)
+ */
+VOID WINAPI RemoveRelocations(PCHAR ImageName)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+}
+
+
+/***********************************************************************
+ *           SearchTreeForFile32 (IMAGEHLP.33)
+ */
+BOOL WINAPI SearchTreeForFile(
+  LPSTR RootPath, LPSTR InputPathName, LPSTR OutputPathBuffer)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           SetImageConfigInformation32 (IMAGEHLP.34)
+ */
+BOOL WINAPI SetImageConfigInformation(
+  PLOADED_IMAGE LoadedImage,
+  PIMAGE_LOAD_CONFIG_DIRECTORY ImageConfigInformation)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           SplitSymbols32 (IMAGEHLP.35)
+ */
+BOOL WINAPI SplitSymbols(
+  LPSTR ImageName, LPSTR SymbolsPath, 
+  LPSTR SymbolFilePath, DWORD Flags)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           StackWalk32 (IMAGEHLP.36)
+ */
+BOOL WINAPI StackWalk(
+  DWORD MachineType, HANDLE hProcess, HANDLE hThread,
+  PSTACKFRAME StackFrame, PVOID ContextRecord,
+  PREAD_PROCESS_MEMORY_ROUTINE ReadMemoryRoutine,
+  PFUNCTION_TABLE_ACCESS_ROUTINE FunctionTableAccessRoutine,
+  PGET_MODULE_BASE_ROUTINE GetModuleBaseRoutine,
+  PTRANSLATE_ADDRESS_ROUTINE TranslateAddress)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           SymCleanup32 (IMAGEHLP.37)
+ */
+BOOL WINAPI SymCleanup(HANDLE hProcess)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           SymEnumerateModules32 (IMAGEHLP.38)
+ */
+
+BOOL WINAPI SymEnumerateModules(
+  HANDLE hProcess, PSYM_ENUMMODULES_CALLBACK EnumModulesCallback,
+  PVOID UserContext)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           SymEnumerateSymbols32 (IMAGEHLP.39)
+ */
+BOOL WINAPI SymEnumerateSymbols(
+  HANDLE hProcess, DWORD BaseOfDll,
+  PSYM_ENUMSYMBOLS_CALLBACK EnumSymbolsCallback, PVOID UserContext)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           SymFunctionTableAccess32 (IMAGEHLP.40)
+ */
+PVOID WINAPI SymFunctionTableAccess(HANDLE hProcess, DWORD AddrBase)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           SymGetModuleBase32 (IMAGEHLP.41)
+ */
+DWORD WINAPI SymGetModuleBase(HANDLE hProcess, DWORD dwAddr)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+/***********************************************************************
+ *           SymGetModuleInfo32 (IMAGEHLP.42)
+ */
+BOOL WINAPI SymGetModuleInfo(
+  HANDLE hProcess, DWORD dwAddr,
+  PIMAGEHLP_MODULE ModuleInfo)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           SymGetOptions32 (IMAGEHLP.43)
+ */
+DWORD WINAPI SymGetOptions()
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+/***********************************************************************
+ *           SymGetSearchPath32 (IMAGEHLP.44)
+ */
+BOOL WINAPI SymGetSearchPath(
+  HANDLE hProcess, LPSTR szSearchPath, DWORD SearchPathLength)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           SymGetSymFromAddr32 (IMAGEHLP.45)
+ */
+BOOL WINAPI SymGetSymFromAddr(
+  HANDLE hProcess, DWORD dwAddr, 
+  PDWORD pdwDisplacement, PIMAGEHLP_SYMBOL Symbol)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           SymGetSymFromName32 (IMAGEHLP.46)
+ */
+BOOL WINAPI SymGetSymFromName(
+  HANDLE hProcess, LPSTR Name, PIMAGEHLP_SYMBOL Symbol)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           SymGetSymNext32 (IMAGEHLP.47)
+ */
+BOOL WINAPI SymGetSymNext(
+  HANDLE hProcess, PIMAGEHLP_SYMBOL Symbol)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           SymGetSymPrev32 (IMAGEHLP.48)
+ */
+
+BOOL WINAPI SymGetSymPrev(
+  HANDLE hProcess, PIMAGEHLP_SYMBOL Symbol)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           SymInitialize32 (IMAGEHLP.49)
+ */
+BOOL WINAPI SymInitialize(
+  HANDLE hProcess, LPSTR UserSearchPath, BOOL fInvadeProcess)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           SymLoadModule32 (IMAGEHLP.50)
+ */
+
+BOOL WINAPI SymLoadModule(
+  HANDLE hProcess, HANDLE hFile, LPSTR ImageName, LPSTR ModuleName,
+  DWORD BaseOfDll, DWORD SizeOfDll)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           SymRegisterCallback32 (IMAGEHLP.51)
+ */
+BOOL WINAPI SymRegisterCallback(
+  HANDLE hProcess, PSYMBOL_REGISTERED_CALLBACK CallbackFunction,
+  PVOID UserContext)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           SymSetOptions32 (IMAGEHLP.52)
+ */
+DWORD WINAPI SymSetOptions(DWORD SymOptions)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+/***********************************************************************
+ *           SymSetSearchPath32 (IMAGEHLP.53)
+ */
+BOOL WINAPI SymSetSearchPath(HANDLE hProcess, LPSTR szSearchPath)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           SymUnDName32 (IMAGEHLP.54)
+ */
+BOOL WINAPI SymUnDName(
+  PIMAGEHLP_SYMBOL sym, LPSTR UnDecName, DWORD UnDecNameLength)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           SymUnloadModule32 (IMAGEHLP.55)
+ */
+BOOL WINAPI SymUnloadModule(
+  HANDLE hProcess, DWORD BaseOfDll)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           TouchFileTimes32 (IMAGEHLP.56)
+ */
+BOOL WINAPI TouchFileTimes(
+  HANDLE FileHandle, LPSYSTEMTIME lpSystemTime)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           UnDecorateSymbolName32 (IMAGEHLP.57)
+ */
+DWORD WINAPI UnDecorateSymbolName(
+  LPCSTR DecoratedName, LPSTR UnDecoratedName,
+  DWORD UndecoratedLength, DWORD Flags)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+/***********************************************************************
+ *           UnMapAndLoad32 (IMAGEHLP.58)
+ */
+BOOL WINAPI UnMapAndLoad(PLOADED_IMAGE LoadedImage)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           UnmapDebugInformation32 (IMAGEHLP.59)
+ */
+
+BOOL WINAPI UnmapDebugInformation(
+  PIMAGE_DEBUG_INFORMATION DebugInfo)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           UpdateDebugInfoFile32 (IMAGEHLP.60)
+ */
+BOOL WINAPI UpdateDebugInfoFile(
+  LPSTR ImageFileName, LPSTR SymbolPath,
+  LPSTR DebugFilePath, PIMAGE_NT_HEADERS NtHeaders)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           UpdateDebugInfoFileEx32 (IMAGEHLP.?)
+ * FIXME
+ *   Function has no ordinal.
+ */
+BOOL WINAPI UpdateDebugInfoFileEx(
+  LPSTR ImageFileName, LPSTR SymbolPath, LPSTR DebugFilePath,
+  PIMAGE_NT_HEADERS NtHeaders, DWORD OldChecksum)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
Index: trunk/src/imagehlp/imagehlp.def
===================================================================
--- trunk/src/imagehlp/imagehlp.def	(revision 736)
+++ trunk/src/imagehlp/imagehlp.def	(revision 736)
@@ -0,0 +1,68 @@
+; $Id: imagehlp.def,v 1.1 1999-08-29 14:54:54 sandervl Exp $
+
+;Created by BLAST for IBM's compiler
+LIBRARY IMAGEHLP INITINSTANCE TERMINSTANCE
+DATA MULTIPLE NONSHARED
+
+EXPORTS
+    BindImage			= _BindImage@12			@1
+    BindImageEx			= _BindImageEx@20		@2
+    CheckSumMappedFile		= _CheckSumMappedFile@16	@3
+    EnumerateLoadedModules	= _EnumerateLoadedModules@12	@4
+    FindDebugInfoFile		= _FindDebugInfoFile@12		@5
+    FindExecutableImage		= _FindExecutableImage@12	@6
+    GetImageConfigInformation	= _GetImageConfigInformation@8	@7
+    GetImageUnusedHeaderBytes	= _GetImageUnusedHeaderBytes@8	@8
+    GetTimestampForLoadedLibrary= _GetTimestampForLoadedLibrary@4	@9
+    ImageAddCertificate		= _ImageAddCertificate@12	@10
+    ImageDirectoryEntryToData	= _ImageDirectoryEntryToData@16	@11
+    ImageEnumerateCertificates	= _ImageEnumerateCertificates@20	@12
+    ImageGetCertificateData	= _ImageGetCertificateData@16	@13
+    ImageGetCertificateHeader	= _ImageGetCertificateHeader@12	@14
+    ImageGetDigestStream	= _ImageGetDigestStream@16	@15
+    ImageLoad			= _ImageLoad@8			@16
+    ImageNtHeader		= _ImageNtHeader@4		@17
+    ImageRemoveCertificate	= _ImageRemoveCertificate@8	@18
+    ImageRvaToSection		= _ImageRvaToSection@12		@19
+    ImageRvaToVa		= _ImageRvaToVa@16		@20
+    ImageUnload			= _ImageUnload@4		@21
+    ImagehlpApiVersion		= _ImagehlpApiVersion@0		@22
+    ImagehlpApiVersionEx	= _ImagehlpApiVersionEx@4	@23
+    MakeSureDirectoryPathExists	= _MakeSureDirectoryPathExists@4	@24
+    MapAndLoad			= _MapAndLoad@20		@25
+    MapDebugInformation		= _MapDebugInformation@16	@26
+    MapFileAndCheckSumA		= _MapFileAndCheckSumA@12	@27
+    MapFileAndCheckSumW		= _MapFileAndCheckSumW@12	@28
+;    MarkImageAsRunFromSwap	= _MarkImageAsRunFromSwap	@29
+    ReBaseImage			= _ReBaseImage@44		@30
+    RemovePrivateCvSymbolic	= _RemovePrivateCvSymbolic@12	@31
+    RemoveRelocations		= _RemoveRelocations@4		@32
+    SearchTreeForFile		= _SearchTreeForFile@12		@33
+    SetImageConfigInformation	= _SetImageConfigInformation@8	@34
+    SplitSymbols		= _SplitSymbols@16		@35
+    StackWalk			= _StackWalk@36			@36
+    SymCleanup			= _SymCleanup@4			@37
+    SymEnumerateModules		= _SymEnumerateModules@12	@38
+    SymEnumerateSymbols		= _SymEnumerateSymbols@16	@39
+    SymFunctionTableAccess	= _SymFunctionTableAccess@8	@40
+    SymGetModuleBase		= _SymGetModuleBase@8		@41
+    SymGetModuleInfo		= _SymGetModuleInfo@12		@42
+    SymGetOptions		= _SymGetOptions@0		@43
+    SymGetSearchPath		= _SymGetSearchPath@12		@44
+    SymGetSymFromAddr		= _SymGetSymFromAddr@16		@45
+    SymGetSymFromName		= _SymGetSymFromName@12		@46
+    SymGetSymNext		= _SymGetSymNext@8		@47
+    SymGetSymPrev		= _SymGetSymPrev@8		@48
+    SymInitialize		= _SymInitialize@12		@49
+    SymLoadModule		= _SymLoadModule@24		@50
+    SymRegisterCallback		= _SymRegisterCallback@12	@51
+    SymSetOptions		= _SymSetOptions@4		@52
+    SymSetSearchPath		= _SymSetSearchPath@8		@53
+    SymUnDName			= _SymUnDName@12		@54
+    SymUnloadModule		= _SymUnloadModule@8		@55
+    TouchFileTimes		= _TouchFileTimes@8		@56
+    UnDecorateSymbolName	= _UnDecorateSymbolName@16	@57
+    UnMapAndLoad		= _UnMapAndLoad@4		@58
+    UnmapDebugInformation	= _UnmapDebugInformation@4	@59
+    UpdateDebugInfoFile		= _UpdateDebugInfoFile@16	@60
+    UpdateDebugInfoFileEx	= _UpdateDebugInfoFileEx@20	@61
Index: trunk/src/imagehlp/initterm.cpp
===================================================================
--- trunk/src/imagehlp/initterm.cpp	(revision 736)
+++ trunk/src/imagehlp/initterm.cpp	(revision 736)
@@ -0,0 +1,111 @@
+/* $Id: initterm.cpp,v 1.1 1999-08-29 14:54:54 sandervl Exp $ */
+
+/*
+ * DLL entry point
+ *
+ * Copyright 1998 Sander van Leeuwen
+ * Copyright 1998 Peter Fitzsimmons
+ *
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+
+/*-------------------------------------------------------------*/
+/* INITERM.C -- Source for a custom dynamic link library       */
+/*              initialization and termination (_DLL_InitTerm) */
+/*              function.                                      */
+/*                                                             */
+/* When called to perform initialization, this sample function */
+/* gets storage for an array of integers, and initializes its  */
+/* elements with random integers.  At termination time, it     */
+/* frees the array.  Substitute your own special processing.   */
+/*-------------------------------------------------------------*/
+
+
+/* Include files */
+#define  INCL_DOSMODULEMGR
+#define  INCL_DOSPROCESS
+#include <os2wrap.h>    //Odin32 OS/2 api wrappers
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <odin.h>
+#include <misc.h>       /*PLF Wed  98-03-18 23:18:15*/
+#include <winconst.h>
+
+extern "C" {
+void CDECL _ctordtorInit( void );
+void CDECL _ctordtorTerm( void );
+}
+
+BOOL WINAPI IMAGEHLP_LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);
+
+/*-------------------------------------------------------------------*/
+/* A clean up routine registered with DosExitList must be used if    */
+/* runtime calls are required and the runtime is dynamically linked. */
+/* This will guarantee that this clean up routine is run before the  */
+/* library DLL is terminated.                                        */
+/*-------------------------------------------------------------------*/
+static void APIENTRY cleanup(ULONG reason);
+
+
+/****************************************************************************/
+/* _DLL_InitTerm is the function that gets called by the operating system   */
+/* loader when it loads and frees this DLL for each process that accesses   */
+/* this DLL.  However, it only gets called the first time the DLL is loaded */
+/* and the last time it is freed for a particular process.  The system      */
+/* linkage convention MUST be used because the operating system loader is   */
+/* calling this function.                                                   */
+/****************************************************************************/
+unsigned long SYSTEM _DLL_InitTerm(unsigned long hModule, unsigned long
+                                   ulFlag)
+{
+   size_t i;
+   APIRET rc;
+
+   /*-------------------------------------------------------------------------*/
+   /* If ulFlag is zero then the DLL is being loaded so initialization should */
+   /* be performed.  If ulFlag is 1 then the DLL is being freed so            */
+   /* termination should be performed.                                        */
+   /*-------------------------------------------------------------------------*/
+
+   switch (ulFlag) {
+      case 0 :
+         _ctordtorInit();
+
+         CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed  98-03-18 05:28:48*/
+
+         /*******************************************************************/
+         /* A DosExitList routine must be used to clean up if runtime calls */
+         /* are required and the runtime is dynamically linked.             */
+         /*******************************************************************/
+
+         rc = DosExitList(0x0000F000|EXLST_ADD, cleanup);
+         if(rc)
+                return 0UL;
+
+	 IMAGEHLP_LibMain(hModule, DLL_PROCESS_ATTACH, 0);
+
+         break;
+      case 1 :
+	 IMAGEHLP_LibMain(hModule, DLL_PROCESS_DETACH, 0);
+         break;
+
+      default  :
+         return 0UL;
+   }
+
+   /***********************************************************/
+   /* A non-zero value must be returned to indicate success.  */
+   /***********************************************************/
+   return 1UL;
+}
+
+
+static void APIENTRY cleanup(ULONG ulReason)
+{
+   _ctordtorTerm();
+   DosExitList(EXLST_EXIT, cleanup);
+   return ;
+}
Index: trunk/src/imagehlp/internal.cpp
===================================================================
--- trunk/src/imagehlp/internal.cpp	(revision 736)
+++ trunk/src/imagehlp/internal.cpp	(revision 736)
@@ -0,0 +1,111 @@
+/* $Id: internal.cpp,v 1.1 1999-08-29 14:54:54 sandervl Exp $ */
+/*
+ *	IMAGEHLP library
+ *
+ *	Copyright 1998	Patrik Stridvall
+ *	Copyright 1999	Jens Wiessner
+ */
+
+#include <os2win.h>
+
+/***********************************************************************
+ *           InitializeListHead32
+ */
+VOID InitializeListHead(PLIST_ENTRY pListHead)
+{
+  pListHead->Flink = pListHead;
+  pListHead->Blink = pListHead;
+}
+
+/***********************************************************************
+ *           InsertHeadList32
+ */
+VOID InsertHeadList(PLIST_ENTRY pListHead, PLIST_ENTRY pEntry)
+{
+  pEntry->Blink = pListHead;
+  pEntry->Flink = pListHead->Flink;
+  pListHead->Flink = pEntry;
+}
+
+/***********************************************************************
+ *           InsertTailList32
+ */
+VOID InsertTailList(PLIST_ENTRY pListHead, PLIST_ENTRY pEntry)
+{
+  pEntry->Flink = pListHead;
+  pEntry->Blink = pListHead->Blink;
+  pListHead->Blink = pEntry;
+}
+
+/***********************************************************************
+ *           IsListEmpty32
+ */
+BOOLEAN IsListEmpty(PLIST_ENTRY pListHead)
+{
+  return !pListHead;
+}
+
+/***********************************************************************
+ *           PopEntryList32
+ */
+PSINGLE_LIST_ENTRY PopEntryList(PSINGLE_LIST_ENTRY pListHead)
+{
+  pListHead->Next = NULL;
+  return pListHead;
+}
+
+/***********************************************************************
+ *           PushEntryList32
+ */
+VOID PushEntryList(
+  PSINGLE_LIST_ENTRY pListHead, PSINGLE_LIST_ENTRY pEntry)
+{
+  pEntry->Next=pListHead;
+}
+
+/***********************************************************************
+ *           RemoveEntryList32
+ */
+VOID RemoveEntryList(PLIST_ENTRY pEntry)
+{
+  pEntry->Flink->Blink = pEntry->Blink;
+  pEntry->Blink->Flink = pEntry->Flink;
+  pEntry->Flink = NULL;
+  pEntry->Blink = NULL;
+}
+
+/***********************************************************************
+ *           RemoveHeadList32
+ */
+PLIST_ENTRY RemoveHeadList(PLIST_ENTRY pListHead)
+{
+  PLIST_ENTRY p = pListHead->Flink;
+  
+  if(p != pListHead)
+    {
+      RemoveEntryList(pListHead); 
+      return p;
+    }
+  else
+    {
+      pListHead->Flink = NULL;
+      pListHead->Blink = NULL;
+      return NULL;
+    }
+}
+
+/***********************************************************************
+ *           RemoveTailList32
+ */
+PLIST_ENTRY RemoveTailList(PLIST_ENTRY pListHead)
+{
+  RemoveHeadList(pListHead->Blink);
+  if(pListHead != pListHead->Blink)
+    return pListHead;
+  else
+    return NULL;
+}
+
+
+
+
Index: trunk/src/imagehlp/makefile
===================================================================
--- trunk/src/imagehlp/makefile	(revision 736)
+++ trunk/src/imagehlp/makefile	(revision 736)
@@ -0,0 +1,52 @@
+# $Id: makefile,v 1.1 1999-08-29 14:54:55 sandervl Exp $
+
+#
+# PD-Win32 API
+#
+#	imagehlp.dll makefile
+#
+
+PDWIN32_INCLUDE = ..\..\include
+PDWIN32_LIB = ..\..\lib
+PDWIN32_BIN = ..\..\bin
+
+
+!include $(PDWIN32_INCLUDE)/pdwin32.mk
+
+
+CFLAGS = $(CFLAGS) -I$(PDWIN32_INCLUDE) /DNONAMELESSUNION
+CXXFLAGS = $(CXXFLAGS) -I$(PDWIN32_INCLUDE) /DNONAMELESSUNION
+
+
+TARGET = imagehlp
+
+OBJS =  imagehlp.obj internal.obj initterm.obj
+
+all: $(TARGET).dll $(TARGET).lib
+
+
+$(TARGET).dll: $(OBJS) $(TARGET).def
+	$(LD) $(LDFLAGS) -Fm -Fe$@ $(OBJS) $(TARGET).def \
+              $(PDWIN32_LIB)/pmwinx.lib $(PDWIN32_LIB)/kernel32.lib \
+              $(PDWIN32_LIB)/odincrt.lib OS2386.LIB $(RTLLIB_O)
+	$(CP) $@ $(PDWIN32_BIN)
+
+
+$(TARGET).lib: $(TARGET).dll
+	$(IMPLIB) $(IMPLIBFLAGS) $@ $(TARGET).dll
+	$(CP) $@ $(PDWIN32_LIB)
+
+
+initterm.obj: initterm.cpp
+imagehlp.obj: imagehlp.cpp
+internal.obj: internal.cpp
+
+clean:
+	$(RM) *.obj *.lib *.dll *~ *.map *.pch	
+	$(RM) $(PDWIN32_BIN)\$(TARGET).dll
+	$(RM) $(PDWIN32_LIB)\$(TARGET).lib
+
+
+
+
+
Index: trunk/src/imm32/imm32.cpp
===================================================================
--- trunk/src/imm32/imm32.cpp	(revision 736)
+++ trunk/src/imm32/imm32.cpp	(revision 736)
@@ -0,0 +1,798 @@
+/* $Id: imm32.cpp,v 1.1 1999-08-29 14:55:23 sandervl Exp $ */
+/*
+ *	IMM32 library
+ *
+ *	Copyright 1998	Patrik Stridvall
+ *	Copyright 1999	Jens Wiessner
+ */
+
+#include <os2win.h>
+#include <imm.h>
+#include <debugdefs.h>
+#include "winversion.h"
+#include "imm32.h"
+#include "debugtools.h"
+
+
+
+DEFAULT_DEBUG_CHANNEL(imm)
+
+/***********************************************************************
+ *           ImmAssociateContext32 (IMM32.1)
+ */
+HIMC WINAPI ImmAssociateContext(HWND hWnd, HIMC hIMC)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return (HIMC)NULL;
+}
+
+
+/***********************************************************************
+ *           ImmAssociateContextEx32 (IMM32.2)
+ */
+BOOL WINAPI ImmAssociateContextEx(HWND hWnd, HIMC hIMC, DWORD dword)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return (HIMC)NULL;
+}
+
+
+/***********************************************************************
+ *           ImmConfigureIME32A (IMM32.3)
+ */
+BOOL WINAPI ImmConfigureIMEA(HKL hKL, HWND hWnd, DWORD dwMode, LPVOID lpData)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/************** *********************************************************
+ *           ImmConfigureIME32W (IMM32.4)
+ */
+BOOL WINAPI ImmConfigureIMEW(HKL hKL, HWND hWnd, DWORD dwMode, LPVOID lpData)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           ImmCreateContext32 (IMM32.5)
+ */
+HIMC WINAPI ImmCreateContext()
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return (HIMC)NULL;
+}
+
+
+/***********************************************************************
+ *           ImmCreateIMCC32 (IMM32.6)
+ */
+HIMCC  WINAPI ImmCreateIMCC(DWORD dword)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return (HIMC)NULL;
+}
+
+
+/***********************************************************************
+ *           ImmCreateSoftKeyboard32 (IMM32.7)
+ */
+HWND WINAPI ImmCreateSoftKeyboard(UINT uint, HWND hwnd, int in1, int in2)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return (HIMC)NULL;
+}
+
+
+/***********************************************************************
+ *           ImmDestroyContext32 (IMM32.8)
+ */
+BOOL WINAPI ImmDestroyContext(HIMC hIMC)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+
+/***********************************************************************
+ *           ImmDestroyIMCC32 (IMM32.9)
+ */
+HIMCC  WINAPI ImmDestroyIMCC(HIMCC himcc)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+
+/***********************************************************************
+ *           ImmDestroySoftKeyboard32 (IMM32.10)
+ */
+BOOL WINAPI ImmDestroySoftKeyboard(HWND hwnd)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+
+/***********************************************************************
+ *           IMMDisableIME32 (IMM32.11)
+ */
+BOOL WINAPI ImmDisableIME(DWORD dword)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+
+/***********************************************************************
+ *           ImmEnumRegisterWord32A (IMM32.12)
+ */
+UINT WINAPI ImmEnumRegisterWordA( HKL hKL, REGISTERWORDENUMPROCA lpfnEnumProc,
+  LPCSTR lpszReading, DWORD dwStyle,  LPCSTR lpszRegister, LPVOID lpData)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+
+/***********************************************************************
+ *           ImmEnumRegisterWord32W (IMM32.13)
+ */
+UINT WINAPI ImmEnumRegisterWordW(  HKL hKL, REGISTERWORDENUMPROCW lpfnEnumProc,
+  LPCWSTR lpszReading, DWORD dwStyle,  LPCWSTR lpszRegister, LPVOID lpData)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+
+/***********************************************************************
+ *           ImmEscape32A (IMM32.14)
+ */
+LRESULT WINAPI ImmEscapeA(  HKL hKL, HIMC hIMC,   UINT uEscape, LPVOID lpData)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+
+/***********************************************************************
+ *           ImmEscape32W (IMM32.15)
+ */
+LRESULT WINAPI ImmEscapeW(  HKL hKL, HIMC hIMC,  UINT uEscape, LPVOID lpData)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+
+/***********************************************************************
+ *           ImmGenerateMessage32 (IMM32.16)
+ */
+BOOL WINAPI ImmGenerateMessage(HIMC himc)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+
+/***********************************************************************
+ *           ImmGetCandidateList32A (IMM32.17)
+ */
+DWORD WINAPI ImmGetCandidateListA(  HIMC hIMC, DWORD deIndex,   
+		LPCANDIDATELIST lpCandList, DWORD dwBufLen)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+/***********************************************************************
+ *           ImmGetCandidateListCount32A (IMM32.18)
+ */
+DWORD WINAPI ImmGetCandidateListCountA( HIMC hIMC, LPDWORD lpdwListCount)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+/***********************************************************************
+ *           ImmGetCandidateListCount32W (IMM32.19)
+ */
+DWORD WINAPI ImmGetCandidateListCountW( HIMC hIMC, LPDWORD lpdwListCount)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+/***********************************************************************
+ *           ImmGetCandidateList32W (IMM32.20)
+ */
+DWORD WINAPI ImmGetCandidateListW(  HIMC hIMC, DWORD deIndex, 
+  LPCANDIDATELIST lpCandList, DWORD dwBufLen)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+/***********************************************************************
+ *           ImmGetCandidateWindow32 (IMM32.21)
+ */
+BOOL WINAPI ImmGetCandidateWindow(HIMC hIMC, DWORD dwBufLen, LPCANDIDATEFORM lpCandidate)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           ImmGetCompositionFont32A (IMM32.22)
+ */
+BOOL WINAPI ImmGetCompositionFontA(HIMC hIMC, LPLOGFONTA lplf)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           ImmGetCompositionFont32W (IMM32.23)
+ */
+BOOL WINAPI ImmGetCompositionFontW(HIMC hIMC, LPLOGFONTW lplf)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           ImmGetCompositionString32A (IMM32.24)
+ */
+LONG WINAPI ImmGetCompositionStringA(HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  switch(GetVersion())
+    {
+    default:
+//      FIXME("%s not supported",GetVersionName());
+    case WIN95:
+      return 0xffffffff;
+    case NT40:
+      return 0;
+    }
+}
+
+/***********************************************************************
+ *           ImmGetCompositionString32W (IMM32.25)
+ */
+LONG WINAPI ImmGetCompositionStringW( HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  switch(GetVersion())
+    {
+    default:
+//      FIXME("%s not supported",GetVersionName());
+    case WIN95:
+      return 0xffffffff;
+    case NT40:
+      return 0;
+    }
+}
+
+/***********************************************************************
+ *           ImmGetCompositionWindow32 (IMM32.26)
+ */
+BOOL WINAPI ImmGetCompositionWindow(HIMC hIMC, LPCOMPOSITIONFORM lpCompForm)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+/***********************************************************************
+ *           ImmGetContext32 (IMM32.27)
+ */
+HIMC WINAPI ImmGetContext(HWND hWnd)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return (HIMC)NULL;
+}
+
+/***********************************************************************
+ *           ImmGetConversionList32A (IMM32.28)
+ */
+DWORD WINAPI ImmGetConversionListA(  HKL hKL, HIMC hIMC,
+  LPCSTR pSrc, LPCANDIDATELIST lpDst,  DWORD dwBufLen, UINT uFlag)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+/***********************************************************************
+ *           ImmGetConversionList32W (IMM32.29)
+ */
+DWORD WINAPI ImmGetConversionListW(  HKL hKL, HIMC hIMC,
+  LPCWSTR pSrc, LPCANDIDATELIST lpDst,  DWORD dwBufLen, UINT uFlag)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+/***********************************************************************
+ *           ImmGetConversionStatus32 (IMM32.30)
+ */
+BOOL WINAPI ImmGetConversionStatus(HIMC hIMC, LPDWORD lpfdwConversion, LPDWORD lpfdwSentence)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           ImmGetDefaultIMEWnd32 (IMM32.31)
+ */
+HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return (HWND)NULL;
+}
+
+/***********************************************************************
+ *           ImmGetDescription32A (IMM32.32)
+ */
+UINT WINAPI ImmGetDescriptionA(HKL hKL, LPSTR lpszDescription, UINT uBufLen)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+/***********************************************************************
+ *           ImmGetDescription32W (IMM32.33)
+ */
+UINT WINAPI ImmGetDescriptionW(HKL hKL, LPWSTR lpszDescription, UINT uBufLen)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+/***********************************************************************
+ *           ImmGetGuideLine32A (IMM32.34)
+ */
+DWORD WINAPI ImmGetGuideLineA(
+  HIMC hIMC, DWORD dwIndex, LPSTR lpBuf, DWORD dwBufLen)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+/***********************************************************************
+ *           ImmGetGuideLine32W (IMM32.35)
+ */
+DWORD WINAPI ImmGetGuideLineW(HIMC hIMC, DWORD dwIndex, LPWSTR lpBuf, DWORD dwBufLen)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+
+/***********************************************************************
+ *           ImmGetHotKey32 (IMM32.36)
+ */
+BOOL WINAPI ImmGetHotKey(DWORD dword, LPUINT lpuModifiers, LPUINT lpuVKey, LPHKL lphkl)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+
+/***********************************************************************
+ *           ImmGetIMCCLockCount32 (IMM32.37)
+ */
+DWORD  WINAPI ImmGetIMCCLockCount(HIMCC himcc)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+
+/***********************************************************************
+ *           ImmGetIMCCSize32 (IMM32.38)
+ */
+DWORD  WINAPI ImmGetIMCCSize(HIMCC himcc)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+
+/***********************************************************************
+ *           ImmGetIMCLockCount32 (IMM32.39)
+ */
+DWORD WINAPI ImmGetIMCLockCount(HIMC himc)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+
+/***********************************************************************
+ *           ImmGetIMEFileName32A (IMM32.40)
+ */
+UINT WINAPI ImmGetIMEFileNameA( HKL hKL, LPSTR lpszFileName, UINT uBufLen)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+/***********************************************************************
+ *           ImmGetIMEFileName32W (IMM32.41)
+ */
+UINT WINAPI ImmGetIMEFileNameW( HKL hKL, LPWSTR lpszFileName, UINT uBufLen)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+
+/***********************************************************************
+ *           ImmGetImeMenuItems32A (IMM32.42)
+ */
+DWORD WINAPI ImmGetImeMenuItemsA(HIMC himc, DWORD dword, DWORD dword2, LPIMEMENUITEMINFOA lpimena, LPIMEMENUITEMINFOA lpimena2, DWORD dword3)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+
+/***********************************************************************
+ *           ImmGetImeMenuItems32W (IMM32.43)
+ */
+DWORD WINAPI ImmGetImeMenuItemsW(HIMC himc, DWORD dword, DWORD dword2, LPIMEMENUITEMINFOW lpimenw, LPIMEMENUITEMINFOW lpimenw2, DWORD dword3)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+
+/***********************************************************************
+ *           ImmGetOpenStatus32 (IMM32.44)
+ */
+BOOL WINAPI ImmGetOpenStatus(HIMC hIMC)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           ImmGetProperty32 (IMM32.45)
+ */
+DWORD WINAPI ImmGetProperty(HKL hKL, DWORD fdwIndex)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+/***********************************************************************
+ *           ImmGetRegisterWordStyle32A (IMM32.46)
+ */
+UINT WINAPI ImmGetRegisterWordStyleA(HKL hKL, UINT nItem, LPSTYLEBUFA lpStyleBuf)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+/***********************************************************************
+ *           ImmGetRegisterWordStyle32W (IMM32.47)
+ */
+UINT WINAPI ImmGetRegisterWordStyleW(HKL hKL, UINT nItem, LPSTYLEBUFW lpStyleBuf)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return 0;
+}
+
+/***********************************************************************
+ *           ImmGetStatusWindowPos32 (IMM32.48)
+ */
+BOOL WINAPI ImmGetStatusWindowPos(HIMC hIMC, LPPOINT lpptPos)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           ImmGetVirtualKey32 (IMM32.49)
+ */
+UINT WINAPI ImmGetVirtualKey(HWND hWnd)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  switch(GetVersion())
+    {
+    default:
+//      FIXME("%s not supported", GetVersionName());
+    case WIN95:
+      return VK_PROCESSKEY;
+    case NT40:
+      return 0;
+    }
+}
+
+/***********************************************************************
+ *           ImmInstallIME32A (IMM32.50)
+ */
+HKL WINAPI ImmInstallIMEA(LPCSTR lpszIMEFileName, LPCSTR lpszLayoutText)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return (HKL)NULL;
+}
+
+/***********************************************************************
+ *           ImmInstallIME32W (IMM32.51)
+ */
+HKL WINAPI ImmInstallIMEW(LPCWSTR lpszIMEFileName, LPCWSTR lpszLayoutText)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return (HKL)NULL;
+}
+
+/***********************************************************************
+ *           ImmIsIME32 (IMM32.52)
+ */
+BOOL WINAPI ImmIsIME(HKL hKL)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           ImmIsUIMessage32A (IMM32.53)
+ */
+BOOL WINAPI ImmIsUIMessageA(HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           ImmIsUIMessage32W (IMM32.54)
+ */
+BOOL WINAPI ImmIsUIMessageW(HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+
+/***********************************************************************
+ *           ImmLockIMC32	 (IMM32.55)
+ */
+LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC himc)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+
+/***********************************************************************
+ *           ImmLockIMCC32	 (IMM32.56)
+ */
+LPVOID WINAPI ImmLockIMCC(HIMCC himcc)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+
+/***********************************************************************
+ *           ImmNotifyIME32 (IMM32.57)
+ */
+BOOL WINAPI ImmNotifyIME(HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+
+/***********************************************************************
+ *           ImmReSizeIMCC32 (IMM32.58)
+ */
+HIMCC  WINAPI ImmReSizeIMCC(HIMCC himcc, DWORD dword)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           ImmRegisterWord32A (IMM32.59)
+ */
+BOOL WINAPI ImmRegisterWordA( HKL hKL, LPCSTR lpszReading, DWORD dwStyle, LPCSTR lpszRegister)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           ImmRegisterWord32W (IMM32.60)
+ */
+BOOL WINAPI ImmRegisterWordW(HKL hKL, LPCWSTR lpszReading, DWORD dwStyle, LPCWSTR lpszRegister)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           ImmReleaseContext32 (IMM32.61)
+ */
+BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+
+/***********************************************************************
+ *           ImmRequestMessage32A (IMM32.62)
+ */
+LRESULT WINAPI ImmRequestMessageA(HIMC himc, WPARAM wparam, LPARAM lparam)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+
+/***********************************************************************
+ *           ImmRequestMessage32W (IMM32.63)
+ */
+LRESULT WINAPI ImmRequestMessageW(HIMC himc, WPARAM wparam, LPARAM lparam)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+
+/***********************************************************************
+ *           ImmSetCandidateWindow32 (IMM32.64)
+ */
+BOOL WINAPI ImmSetCandidateWindow(HIMC hIMC, LPCANDIDATEFORM lpCandidate)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           ImmSetCompositionFont32A (IMM32.65)
+ */
+BOOL WINAPI ImmSetCompositionFontA(HIMC hIMC, LPLOGFONTA lplf)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           ImmSetCompositionFont32W (IMM32.66)
+ */
+BOOL WINAPI ImmSetCompositionFontW(HIMC hIMC, LPLOGFONTW lplf)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           ImmSetCompositionString32A (IMM32.67)
+ */
+BOOL WINAPI ImmSetCompositionStringA(  HIMC hIMC, DWORD dwIndex, 
+  LPCVOID lpComp, DWORD dwCompLen, LPCVOID lpRead, DWORD dwReadLen)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           ImmSetCompositionString32W (IMM32.68)
+ */
+BOOL WINAPI ImmSetCompositionStringW(HIMC hIMC, DWORD dwIndex,
+	LPCVOID lpComp, DWORD dwCompLen,LPCVOID lpRead, DWORD dwReadLen)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           ImmSetCompositionWindow32 (IMM32.69)
+ */
+BOOL WINAPI ImmSetCompositionWindow(HIMC hIMC, LPCOMPOSITIONFORM lpCompForm)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           ImmSetConversionStatus32 (IMM32.70)
+ */
+BOOL WINAPI ImmSetConversionStatus(HIMC hIMC, DWORD fdwConversion, DWORD fdwSentence)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+
+/***********************************************************************
+ *           ImmSetHotKey32 (IMM32.71)
+ */
+BOOL WINAPI ImmSetHotKey(DWORD dword, UINT uint, UINT uint2, HKL hkl)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+
+/***********************************************************************
+ *           ImmSetOpenStatus32 (IMM32.72)
+ */
+BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           ImmSetStatusWindowPos32 (IMM32.73)
+ */
+BOOL WINAPI ImmSetStatusWindowPos(HIMC hIMC, LPPOINT lpptPos)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+
+/***********************************************************************
+ *           ImmShowSoftKeyboard (IMM32.74)
+ */
+BOOL WINAPI ImmShowSoftKeyboard(HWND hwnd, int in1)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+
+/***********************************************************************
+ *           ImmSimulateHotKey32 (IMM32.75)
+ */
+BOOL WINAPI ImmSimulateHotKey(HWND hWnd, DWORD dwHotKeyID)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+
+/***********************************************************************
+ *           ImmUnlockIMC32 (IMM32.76)
+ */
+BOOL  WINAPI ImmUnlockIMC(HIMC himc)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+
+/***********************************************************************
+ *           ImmUnlockIMCC32 (IMM32.77)
+ */
+BOOL  WINAPI ImmUnlockIMCC(HIMCC himcc)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+
+/***********************************************************************
+ *           ImmUnregisterWord32A (IMM32.78)
+ */
+BOOL WINAPI ImmUnregisterWordA(HKL hKL, LPCSTR lpszReading, DWORD dwStyle, LPCSTR lpszUnregister)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
+
+/***********************************************************************
+ *           ImmUnregisterWord32W (IMM32.79)
+ */
+BOOL WINAPI ImmUnregisterWordW(HKL hKL, LPCWSTR lpszReading, DWORD dwStyle, LPCWSTR lpszUnregister)
+{
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+  return FALSE;
+}
Index: trunk/src/imm32/imm32.def
===================================================================
--- trunk/src/imm32/imm32.def	(revision 736)
+++ trunk/src/imm32/imm32.def	(revision 736)
@@ -0,0 +1,86 @@
+; $Id: imm32.def,v 1.1 1999-08-29 14:55:23 sandervl Exp $
+
+;Created by BLAST for IBM's compiler
+LIBRARY IMM32 INITINSTANCE
+DATA MULTIPLE NONSHARED
+
+EXPORTS
+    ImmAssociateContext		= _ImmAssociateContext@8	@1
+    ImmAssociateContextEx	= _ImmAssociateContextEx@12	@2
+    ImmConfigureIMEA		= _ImmConfigureIMEA@16		@3
+    ImmConfigureIMEW		= _ImmConfigureIMEW@16		@4
+    ImmCreateContext		= _ImmCreateContext@0		@5
+    ImmCreateIMCC		= _ImmCreateIMCC@4		@6
+    ImmCreateSoftKeyboard	= _ImmCreateSoftKeyboard@16	@7
+    ImmDestroyContext		= _ImmDestroyContext@4		@8
+    ImmDestroyIMCC		= _ImmDestroyIMCC@4		@9
+    ImmDestroySoftKeyboard	= _ImmDestroySoftKeyboard@4	@10
+    ImmDisableIME		= _ImmDisableIME@4		@11
+    ImmEnumRegisterWordA	= _ImmEnumRegisterWordA@24	@12
+    ImmEnumRegisterWordW	= _ImmEnumRegisterWordW@24	@13
+    ImmEscapeA			= _ImmEscapeA@16		@14
+    ImmEscapeW			= _ImmEscapeW@16		@15
+    ImmGenerateMessage		= _ImmGenerateMessage@4		@16
+    ImmGetCandidateListA	= _ImmGetCandidateListA@16	@17
+    ImmGetCandidateListCountA	= _ImmGetCandidateListCountA@8	@18
+    ImmGetCandidateListCountW	= _ImmGetCandidateListCountW@8	@19
+    ImmGetCandidateListW	= _ImmGetCandidateListW@16	@20
+    ImmGetCandidateWindow	= _ImmGetCandidateWindow@12	@21
+    ImmGetCompositionFontA	= _ImmGetCompositionFontA@8	@22
+    ImmGetCompositionFontW	= _ImmGetCompositionFontW@8	@23
+    ImmGetCompositionStringA	= _ImmGetCompositionStringA@16	@24
+    ImmGetCompositionStringW	= _ImmGetCompositionStringW@16	@25
+    ImmGetCompositionWindow	= _ImmGetCompositionWindow@8	@26
+    ImmGetContext		= _ImmGetContext@4		@27
+    ImmGetConversionListA	= _ImmGetConversionListA@24	@28
+    ImmGetConversionListW	= _ImmGetConversionListW@24	@29
+    ImmGetConversionStatus	= _ImmGetConversionStatus@12	@30
+    ImmGetDefaultIMEWnd		= _ImmGetDefaultIMEWnd@4	@31
+    ImmGetDescriptionA		= _ImmGetDescriptionA@12	@32
+    ImmGetDescriptionW		= _ImmGetDescriptionW@12	@33
+    ImmGetGuideLineA		= _ImmGetGuideLineA@16		@34
+    ImmGetGuideLineW		= _ImmGetGuideLineW@16		@35
+    ImmGetHotKey		= _ImmGetHotKey@16		@36
+    ImmGetIMCCLockCount		= _ImmGetIMCCLockCount@4	@37
+    ImmGetIMCCSize		= _ImmGetIMCCSize@4		@38
+    ImmGetIMCLockCount		= _ImmGetIMCLockCount@4		@39
+    ImmGetIMEFileNameA		= _ImmGetIMEFileNameA@12	@40
+    ImmGetIMEFileNameW		= _ImmGetIMEFileNameW@12	@41
+    ImmGetImeMenuItemsA		= _ImmGetImeMenuItemsA@24	@42
+    ImmGetImeMenuItemsW		= _ImmGetImeMenuItemsW@24	@43
+    ImmGetOpenStatus		= _ImmGetOpenStatus@4		@44
+    ImmGetProperty		= _ImmGetProperty@8		@45
+    ImmGetRegisterWordStyleA	= _ImmGetRegisterWordStyleA@12	@46
+    ImmGetRegisterWordStyleW	= _ImmGetRegisterWordStyleW@12	@47
+    ImmGetStatusWindowPos	= _ImmGetStatusWindowPos@8	@48
+    ImmGetVirtualKey		= _ImmGetVirtualKey@4		@49
+    ImmInstallIMEA		= _ImmInstallIMEA@8		@50
+    ImmInstallIMEW		= _ImmInstallIMEW@8		@51
+    ImmIsIME			= _ImmIsIME@4			@52
+    ImmIsUIMessageA		= _ImmIsUIMessageA@16		@53
+    ImmIsUIMessageW		= _ImmIsUIMessageW@16		@54
+    ImmLockIMC			= _ImmLockIMC@4			@55
+    ImmLockIMCC			= _ImmLockIMCC@4		@56
+    ImmNotifyIME		= _ImmNotifyIME@16		@57
+    ImmReSizeIMCC		= _ImmReSizeIMCC@8		@58
+    ImmRegisterWordA		= _ImmRegisterWordA@16		@59
+    ImmRegisterWordW		= _ImmRegisterWordW@16		@60
+    ImmReleaseContext		= _ImmReleaseContext@8		@61
+    ImmRequestMessageA		= _ImmRequestMessageA@12	@62
+    ImmRequestMessageW		= _ImmRequestMessageW@12	@63
+    ImmSetCandidateWindow	= _ImmSetCandidateWindow@8	@64
+    ImmSetCompositionFontA	= _ImmSetCompositionFontA@8	@65
+    ImmSetCompositionFontW	= _ImmSetCompositionFontW@8	@66
+    ImmSetCompositionStringA	= _ImmSetCompositionStringA@24	@67
+    ImmSetCompositionStringW	= _ImmSetCompositionStringW@24	@68
+    ImmSetCompositionWindow	= _ImmSetCompositionWindow@8	@69
+    ImmSetConversionStatus	= _ImmSetConversionStatus@12	@70
+    ImmSetHotKey		= _ImmSetHotKey@16		@71
+    ImmSetOpenStatus		= _ImmSetOpenStatus@8		@72
+    ImmSetStatusWindowPos	= _ImmSetStatusWindowPos@8	@73
+    ImmShowSoftKeyboard		= _ImmShowSoftKeyboard@8	@74
+    ImmSimulateHotKey		= _ImmSimulateHotKey@8		@75
+    ImmUnlockIMC		= _ImmUnlockIMC@4		@76
+    ImmUnlockIMCC		= _ImmUnlockIMCC@4		@77
+    ImmUnregisterWordA		= _ImmUnregisterWordA@16	@78
+    ImmUnregisterWordW		= _ImmUnregisterWordW@16	@79
Index: trunk/src/imm32/imm32.h
===================================================================
--- trunk/src/imm32/imm32.h	(revision 736)
+++ trunk/src/imm32/imm32.h	(revision 736)
@@ -0,0 +1,72 @@
+/* $Id: imm32.h,v 1.1 1999-08-29 14:55:23 sandervl Exp $ */
+/* Definitions for the IMM32 DLL (IMM32.DLL)
+ *
+ * Copyright 1999 Jens Wiessner
+ */
+
+#ifndef _IMM32_
+#define _IMM32_        // defined if IMM32.H has been included
+
+
+typedef struct tagINPUTCONTEXT {
+    HWND                hWnd;
+    BOOL                fOpen;
+    POINT               ptStatusWndPos;
+    POINT               ptSoftKbdPos;
+    DWORD               fdwConversion;
+    DWORD               fdwSentence;
+    union   {
+        LOGFONTA        A;
+        LOGFONTW        W;
+    } lfFont;
+    COMPOSITIONFORM     cfCompForm;
+    CANDIDATEFORM       cfCandForm[4];
+    HIMCC               hCompStr;
+    HIMCC               hCandInfo;
+    HIMCC               hGuideLine;
+    HIMCC               hPrivate;
+    DWORD               dwNumMsgBuf;
+    HIMCC               hMsgBuf;
+    DWORD               fdwInit;
+    DWORD               dwReserve[3];
+} INPUTCONTEXT, *PINPUTCONTEXT, *NPINPUTCONTEXT, *LPINPUTCONTEXT;
+
+
+#define IMEMENUITEM_STRING_SIZE 80
+
+typedef struct tagIMEMENUITEMINFOA {
+    UINT        cbSize;
+    UINT        fType;
+    UINT        fState;
+    UINT        wID;
+    HBITMAP     hbmpChecked;
+    HBITMAP     hbmpUnchecked;
+    DWORD       dwItemData;
+    CHAR        szString[IMEMENUITEM_STRING_SIZE];
+    HBITMAP     hbmpItem;
+} IMEMENUITEMINFOA, *PIMEMENUITEMINFOA, *NPIMEMENUITEMINFOA, *LPIMEMENUITEMINFOA;
+typedef struct tagIMEMENUITEMINFOW {
+    UINT        cbSize;
+    UINT        fType;
+    UINT        fState;
+    UINT        wID;
+    HBITMAP     hbmpChecked;
+    HBITMAP     hbmpUnchecked;
+    DWORD       dwItemData;
+    WCHAR       szString[IMEMENUITEM_STRING_SIZE];
+    HBITMAP     hbmpItem;
+} IMEMENUITEMINFOW, *PIMEMENUITEMINFOW, *NPIMEMENUITEMINFOW, *LPIMEMENUITEMINFOW;
+
+#ifdef UNICODE
+typedef IMEMENUITEMINFOW IMEMENUITEMINFO;
+typedef PIMEMENUITEMINFOW PIMEMENUITEMINFO;
+typedef NPIMEMENUITEMINFOW NPIMEMENUITEMINFO;
+typedef LPIMEMENUITEMINFOW LPIMEMENUITEMINFO;
+#else
+typedef IMEMENUITEMINFOA IMEMENUITEMINFO;
+typedef PIMEMENUITEMINFOA PIMEMENUITEMINFO;
+typedef NPIMEMENUITEMINFOA NPIMEMENUITEMINFO;
+typedef LPIMEMENUITEMINFOA LPIMEMENUITEMINFO;
+#endif // UNICODE
+
+#endif
Index: trunk/src/imm32/initterm.cpp
===================================================================
--- trunk/src/imm32/initterm.cpp	(revision 736)
+++ trunk/src/imm32/initterm.cpp	(revision 736)
@@ -0,0 +1,104 @@
+/* $Id: initterm.cpp,v 1.1 1999-08-29 14:55:23 sandervl Exp $ */
+
+/*
+ * DLL entry point
+ *
+ * Copyright 1998 Sander van Leeuwen
+ * Copyright 1998 Peter Fitzsimmons
+ *
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+
+/*-------------------------------------------------------------*/
+/* INITERM.C -- Source for a custom dynamic link library       */
+/*              initialization and termination (_DLL_InitTerm) */
+/*              function.                                      */
+/*                                                             */
+/* When called to perform initialization, this sample function */
+/* gets storage for an array of integers, and initializes its  */
+/* elements with random integers.  At termination time, it     */
+/* frees the array.  Substitute your own special processing.   */
+/*-------------------------------------------------------------*/
+
+
+/* Include files */
+#define  INCL_DOSMODULEMGR
+#define  INCL_DOSPROCESS
+#include <os2wrap.h>    //Odin32 OS/2 api wrappers
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <odin.h>
+#include <misc.h>       /*PLF Wed  98-03-18 23:18:15*/
+
+extern "C" {
+void CDECL _ctordtorInit( void );
+void CDECL _ctordtorTerm( void );
+}
+
+/*-------------------------------------------------------------------*/
+/* A clean up routine registered with DosExitList must be used if    */
+/* runtime calls are required and the runtime is dynamically linked. */
+/* This will guarantee that this clean up routine is run before the  */
+/* library DLL is terminated.                                        */
+/*-------------------------------------------------------------------*/
+static void APIENTRY cleanup(ULONG reason);
+
+
+/****************************************************************************/
+/* _DLL_InitTerm is the function that gets called by the operating system   */
+/* loader when it loads and frees this DLL for each process that accesses   */
+/* this DLL.  However, it only gets called the first time the DLL is loaded */
+/* and the last time it is freed for a particular process.  The system      */
+/* linkage convention MUST be used because the operating system loader is   */
+/* calling this function.                                                   */
+/****************************************************************************/
+unsigned long SYSTEM _DLL_InitTerm(unsigned long hModule, unsigned long
+                                   ulFlag)
+{
+   size_t i;
+   APIRET rc;
+
+   /*-------------------------------------------------------------------------*/
+   /* If ulFlag is zero then the DLL is being loaded so initialization should */
+   /* be performed.  If ulFlag is 1 then the DLL is being freed so            */
+   /* termination should be performed.                                        */
+   /*-------------------------------------------------------------------------*/
+
+   switch (ulFlag) {
+      case 0 :
+         _ctordtorInit();
+
+         CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed  98-03-18 05:28:48*/
+
+         /*******************************************************************/
+         /* A DosExitList routine must be used to clean up if runtime calls */
+         /* are required and the runtime is dynamically linked.             */
+         /*******************************************************************/
+
+         rc = DosExitList(0x0000F000|EXLST_ADD, cleanup);
+         if(rc)
+                return 0UL;
+
+         break;
+      case 1 :
+         break;
+      default  :
+         return 0UL;
+   }
+
+   /***********************************************************/
+   /* A non-zero value must be returned to indicate success.  */
+   /***********************************************************/
+   return 1UL;
+}
+
+
+static void APIENTRY cleanup(ULONG ulReason)
+{
+   _ctordtorTerm();
+   DosExitList(EXLST_EXIT, cleanup);
+   return ;
+}
Index: trunk/src/imm32/makefile
===================================================================
--- trunk/src/imm32/makefile	(revision 736)
+++ trunk/src/imm32/makefile	(revision 736)
@@ -0,0 +1,51 @@
+# $Id: makefile,v 1.1 1999-08-29 14:55:23 sandervl Exp $
+
+#
+# PD-Win32 API
+#
+#	imm32.dll makefile
+#
+
+PDWIN32_INCLUDE = ..\..\include
+PDWIN32_LIB = ..\..\lib
+PDWIN32_BIN = ..\..\bin
+
+
+!include $(PDWIN32_INCLUDE)/pdwin32.mk
+
+
+CFLAGS = $(CFLAGS) -I$(PDWIN32_INCLUDE) /DNONAMELESSUNION
+CXXFLAGS = $(CXXFLAGS) -I$(PDWIN32_INCLUDE) /DNONAMELESSUNION
+
+
+TARGET = imm32
+
+OBJS =  imm32.obj initterm.obj
+
+all: $(TARGET).dll $(TARGET).lib
+
+
+$(TARGET).dll: $(OBJS) $(TARGET).def
+	$(LD) $(LDFLAGS) -Fm -Fe$@ $(OBJS) $(TARGET).def \
+              $(PDWIN32_LIB)/pmwinx.lib $(PDWIN32_LIB)/kernel32.lib \
+              $(PDWIN32_LIB)/odincrt.lib OS2386.LIB $(RTLLIB_O)
+	$(CP) $@ $(PDWIN32_BIN)
+
+
+$(TARGET).lib: $(TARGET).dll
+	$(IMPLIB) $(IMPLIBFLAGS) $@ $(TARGET).dll
+	$(CP) $@ $(PDWIN32_LIB)
+
+
+initterm.obj: initterm.cpp
+imm32.obj: imm32.cpp
+
+clean:
+	$(RM) *.obj *.lib *.dll *~ *.map *.pch	
+	$(RM) $(PDWIN32_BIN)\$(TARGET).dll
+	$(RM) $(PDWIN32_LIB)\$(TARGET).lib
+
+
+
+
+
