Commit 6b141176 authored by Alexandre Julliard's avatar Alexandre Julliard

Moved toolhelp implementation into kernel32 dll.

parent fd8a6de9
......@@ -5,6 +5,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = none
PROGRAMS = winedbg
IMPORTS = kernel32
C_SRCS = \
break.c \
......
......@@ -11,6 +11,7 @@ C_SRCS = \
kernel_main.c \
stress.c \
thunk.c \
toolhelp.c \
utthunk.c \
win87em.c \
windebug.c \
......
......@@ -12,6 +12,7 @@
#include "winbase.h"
#include "wine/winbase16.h"
#include "winerror.h"
#include "local.h"
#include "process.h"
#include "tlhelp32.h"
#include "toolhelp.h"
......@@ -129,6 +130,43 @@ BOOL16 WINAPI InterruptUnRegister16( HTASK16 task )
}
/***********************************************************************
* TimerCount (TOOLHELP.80)
*/
BOOL16 WINAPI TimerCount16( TIMERINFO *pTimerInfo )
{
/* FIXME
* In standard mode, dwmsSinceStart = dwmsThisVM
*
* I tested this, under Windows in enhanced mode, and
* if you never switch VM (ie start/stop DOS) these
* values should be the same as well.
*
* Also, Wine should adjust for the hardware timer
* to reduce the amount of error to ~1ms.
* I can't be bothered, can you?
*/
pTimerInfo->dwmsSinceStart = pTimerInfo->dwmsThisVM = GetTickCount();
return TRUE;
}
/***********************************************************************
* SystemHeapInfo (TOOLHELP.71)
*/
BOOL16 WINAPI SystemHeapInfo16( SYSHEAPINFO *pHeapInfo )
{
WORD user = LoadLibrary16( "USER.EXE" );
WORD gdi = LoadLibrary16( "GDI.EXE" );
pHeapInfo->wUserFreePercent = (int)LOCAL_CountFree(user) * 100 / LOCAL_HeapSize(user);
pHeapInfo->wGDIFreePercent = (int)LOCAL_CountFree(gdi) * 100 / LOCAL_HeapSize(gdi);
pHeapInfo->hUserSegment = user;
pHeapInfo->hGDISegment = gdi;
FreeLibrary16( user );
FreeLibrary16( gdi );
return TRUE;
}
/***********************************************************************
* ToolHelpHook (KERNEL.341)
* see "Undocumented Windows"
*/
......
......@@ -20,7 +20,6 @@ C_SRCS = \
printdrv.c \
registry.c \
system.c \
toolhelp.c \
tweak.c \
version.c \
wsprintf.c
......
......@@ -73,39 +73,6 @@ WORD WINAPI GetFreeSystemResources16( WORD resType )
}
/***********************************************************************
* SystemHeapInfo (TOOLHELP.71)
*/
BOOL16 WINAPI SystemHeapInfo16( SYSHEAPINFO *pHeapInfo )
{
pHeapInfo->wUserFreePercent = GetFreeSystemResources16( GFSR_USERRESOURCES );
pHeapInfo->wGDIFreePercent = GetFreeSystemResources16( GFSR_GDIRESOURCES );
pHeapInfo->hUserSegment = USER_HeapSel;
pHeapInfo->hGDISegment = GDI_HeapSel;
return TRUE;
}
/***********************************************************************
* TimerCount (TOOLHELP.80)
*/
BOOL16 WINAPI TimerCount16( TIMERINFO *pTimerInfo )
{
/* FIXME
* In standard mode, dwmsSinceStart = dwmsThisVM
*
* I tested this, under Windows in enhanced mode, and
* if you never switch VM (ie start/stop DOS) these
* values should be the same as well.
*
* Also, Wine should adjust for the hardware timer
* to reduce the amount of error to ~1ms.
* I can't be bothered, can you?
*/
pTimerInfo->dwmsSinceStart = pTimerInfo->dwmsThisVM = GetTickCount();
return TRUE;
}
/**********************************************************************
* InitApp (USER.5)
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment