mirror of
https://github.com/reactos/reactos.git
synced 2025-01-07 06:45:24 +00:00
[PSAPI]
Bye bye PSAPI. Welcome PSAPI :-). This is a rewrite of the PSAPI DLL to make it match the W2K3 DLL. It fixes several bugs and implements missing features. It doesn't use the EPSAPI library anylonger (which old and buggy). All winetests are passing when executed on W2K3 with this DLL. Not all tests are passing on ReactOS though, because of missing features in the kernel. Anyway, this greatly reduces the amount of failed tests. ROSTESTS-122 #comment Fixed with r60794 #resolve svn path=/trunk/; revision=60794
This commit is contained in:
parent
5aeeadda17
commit
bb4fe2c408
5 changed files with 1158 additions and 1054 deletions
|
@ -2,7 +2,6 @@
|
|||
spec2def(psapi.dll psapi.spec ADD_IMPORTLIB)
|
||||
|
||||
list(APPEND SOURCE
|
||||
malloc.c
|
||||
psapi.c
|
||||
psapi.rc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/psapi.def)
|
||||
|
@ -10,7 +9,7 @@ list(APPEND SOURCE
|
|||
add_library(psapi SHARED ${SOURCE})
|
||||
|
||||
set_module_type(psapi win32dll)
|
||||
target_link_libraries(psapi epsapi ${PSEH_LIB})
|
||||
target_link_libraries(psapi ${PSEH_LIB})
|
||||
add_importlibs(psapi msvcrt kernel32 ntdll)
|
||||
|
||||
add_pch(psapi precomp.h)
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
/*
|
||||
* epsapi.h
|
||||
*
|
||||
* Process Status Helper API, native interface
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __INTERNAL_PSAPI_H_INCLUDED__
|
||||
#define __INTERNAL_PSAPI_H_INCLUDED__
|
||||
|
||||
#ifndef SetLastErrorByStatus
|
||||
#define SetLastErrorByStatus(__S__) \
|
||||
((void)SetLastError(RtlNtStatusToDosError(__S__)))
|
||||
#endif /* SetLastErrorByStatus */
|
||||
|
||||
#endif /* __INTERNAL_PSAPI_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
|
@ -1,69 +0,0 @@
|
|||
/*
|
||||
* COPYRIGHT: None
|
||||
* LICENSE: Public domain
|
||||
* PROJECT: ReactOS system libraries
|
||||
* FILE: reactos/lib/psapi/misc/malloc.c
|
||||
* PURPOSE: Memory allocator for PSAPI
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 10/06/2002: Created
|
||||
* 12/02/2003: malloc and free renamed to PsaiMalloc and PsaiFree,
|
||||
* for better reusability
|
||||
*/
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
PVOID
|
||||
WINAPI
|
||||
MemAlloc(IN HANDLE Heap,
|
||||
IN PVOID Ptr,
|
||||
IN ULONG Size)
|
||||
{
|
||||
PVOID pBuf = NULL;
|
||||
|
||||
if(Size == 0 && Ptr == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(Heap == NULL)
|
||||
{
|
||||
Heap = NtCurrentPeb()->ProcessHeap;
|
||||
}
|
||||
|
||||
if(Size > 0)
|
||||
{
|
||||
if(Ptr == NULL)
|
||||
/* malloc */
|
||||
pBuf = RtlAllocateHeap(Heap, 0, Size);
|
||||
else
|
||||
/* realloc */
|
||||
pBuf = RtlReAllocateHeap(Heap, 0, Ptr, Size);
|
||||
}
|
||||
else
|
||||
/* free */
|
||||
RtlFreeHeap(Heap, 0, Ptr);
|
||||
|
||||
return pBuf;
|
||||
}
|
||||
|
||||
void *PsaiMalloc(SIZE_T size)
|
||||
{
|
||||
return MemAlloc(NULL, NULL, size);
|
||||
}
|
||||
|
||||
void *PsaiRealloc(void *ptr, SIZE_T size)
|
||||
{
|
||||
return MemAlloc(NULL, ptr, size);
|
||||
}
|
||||
|
||||
void PsaiFree(void *ptr)
|
||||
{
|
||||
MemAlloc(NULL, ptr, 0);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
@ -10,8 +10,5 @@
|
|||
#include <ndk/rtlfuncs.h>
|
||||
|
||||
#include <psapi.h>
|
||||
#include <epsapi/epsapi.h>
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
#include <pseh/pseh2.h>
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue