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

Moved toolhelp implementation into kernel32 dll.

parent fd8a6de9
...@@ -5,6 +5,7 @@ SRCDIR = @srcdir@ ...@@ -5,6 +5,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = none MODULE = none
PROGRAMS = winedbg PROGRAMS = winedbg
IMPORTS = kernel32
C_SRCS = \ C_SRCS = \
break.c \ break.c \
......
...@@ -11,6 +11,7 @@ C_SRCS = \ ...@@ -11,6 +11,7 @@ C_SRCS = \
kernel_main.c \ kernel_main.c \
stress.c \ stress.c \
thunk.c \ thunk.c \
toolhelp.c \
utthunk.c \ utthunk.c \
win87em.c \ win87em.c \
windebug.c \ windebug.c \
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "winbase.h" #include "winbase.h"
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "winerror.h" #include "winerror.h"
#include "local.h"
#include "process.h" #include "process.h"
#include "tlhelp32.h" #include "tlhelp32.h"
#include "toolhelp.h" #include "toolhelp.h"
...@@ -129,6 +130,43 @@ BOOL16 WINAPI InterruptUnRegister16( HTASK16 task ) ...@@ -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) * ToolHelpHook (KERNEL.341)
* see "Undocumented Windows" * see "Undocumented Windows"
*/ */
......
...@@ -20,7 +20,6 @@ C_SRCS = \ ...@@ -20,7 +20,6 @@ C_SRCS = \
printdrv.c \ printdrv.c \
registry.c \ registry.c \
system.c \ system.c \
toolhelp.c \
tweak.c \ tweak.c \
version.c \ version.c \
wsprintf.c wsprintf.c
......
...@@ -73,39 +73,6 @@ WORD WINAPI GetFreeSystemResources16( WORD resType ) ...@@ -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) * 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