ntoskrnl.exe: Implemented PsGetVersion and added stubs for a couple of other Ps functions.

This commit is contained in:
Alexandre Julliard 2007-05-17 09:49:28 +02:00
parent 4cbe5b78d3
commit e0d5dbaeb8
2 changed files with 58 additions and 4 deletions

View File

@ -51,6 +51,7 @@ typedef struct _KSERVICE_TABLE_DESCRIPTOR
KSERVICE_TABLE_DESCRIPTOR KeServiceDescriptorTable[4]; KSERVICE_TABLE_DESCRIPTOR KeServiceDescriptorTable[4];
typedef void (WINAPI *PCREATE_PROCESS_NOTIFY_ROUTINE)(HANDLE,HANDLE,BOOLEAN);
#ifdef __i386__ #ifdef __i386__
#define DEFINE_FASTCALL1_ENTRYPOINT( name ) \ #define DEFINE_FASTCALL1_ENTRYPOINT( name ) \
@ -416,6 +417,59 @@ void WINAPI MmFreeNonCachedMemory( void *addr, SIZE_T size )
} }
/***********************************************************************
* PsGetCurrentProcessId (NTOSKRNL.EXE.@)
*/
HANDLE WINAPI PsGetCurrentProcessId(void)
{
return (HANDLE)GetCurrentProcessId(); /* FIXME: not quite right... */
}
/***********************************************************************
* PsGetCurrentThreadId (NTOSKRNL.EXE.@)
*/
HANDLE WINAPI PsGetCurrentThreadId(void)
{
return (HANDLE)GetCurrentThreadId(); /* FIXME: not quite right... */
}
/***********************************************************************
* PsGetVersion (NTOSKRNL.EXE.@)
*/
BOOLEAN WINAPI PsGetVersion(ULONG *major, ULONG *minor, ULONG *build, UNICODE_STRING *version )
{
RTL_OSVERSIONINFOEXW info;
RtlGetVersion( &info );
if (major) *major = info.dwMajorVersion;
if (minor) *minor = info.dwMinorVersion;
if (build) *build = info.dwBuildNumber;
if (version)
{
#if 0 /* FIXME: GameGuard passes an uninitialized pointer in version->Buffer */
size_t len = min( strlenW(info.szCSDVersion)*sizeof(WCHAR), version->MaximumLength );
memcpy( version->Buffer, info.szCSDVersion, len );
if (len < version->MaximumLength) version->Buffer[len / sizeof(WCHAR)] = 0;
version->Length = len;
#endif
}
return TRUE;
}
/***********************************************************************
* PsSetCreateProcessNotifyRoutine (NTOSKRNL.EXE.@)
*/
NTSTATUS WINAPI PsSetCreateProcessNotifyRoutine( PCREATE_PROCESS_NOTIFY_ROUTINE callback, BOOLEAN remove )
{
FIXME( "stub: %p %d\n", callback, remove );
return STATUS_SUCCESS;
}
/***************************************************** /*****************************************************
* DllMain * DllMain
*/ */

View File

@ -850,10 +850,10 @@
@ stub PsEstablishWin32Callouts @ stub PsEstablishWin32Callouts
@ stub PsGetContextThread @ stub PsGetContextThread
@ stub PsGetCurrentProcess @ stub PsGetCurrentProcess
@ stub PsGetCurrentProcessId @ stdcall PsGetCurrentProcessId()
@ stub PsGetCurrentProcessSessionId @ stub PsGetCurrentProcessSessionId
@ stub PsGetCurrentThread @ stub PsGetCurrentThread
@ stub PsGetCurrentThreadId @ stdcall PsGetCurrentThreadId()
@ stub PsGetCurrentThreadPreviousMode @ stub PsGetCurrentThreadPreviousMode
@ stub PsGetCurrentThreadStackBase @ stub PsGetCurrentThreadStackBase
@ stub PsGetCurrentThreadStackLimit @ stub PsGetCurrentThreadStackLimit
@ -884,7 +884,7 @@
@ stub PsGetThreadSessionId @ stub PsGetThreadSessionId
@ stub PsGetThreadTeb @ stub PsGetThreadTeb
@ stub PsGetThreadWin32Thread @ stub PsGetThreadWin32Thread
@ stub PsGetVersion @ stdcall PsGetVersion(ptr ptr ptr ptr)
@ stub PsImpersonateClient @ stub PsImpersonateClient
@ stub PsInitialSystemProcess @ stub PsInitialSystemProcess
@ stub PsIsProcessBeingDebugged @ stub PsIsProcessBeingDebugged
@ -907,7 +907,7 @@
@ stub PsRevertThreadToSelf @ stub PsRevertThreadToSelf
@ stub PsRevertToSelf @ stub PsRevertToSelf
@ stub PsSetContextThread @ stub PsSetContextThread
@ stub PsSetCreateProcessNotifyRoutine @ stdcall PsSetCreateProcessNotifyRoutine(ptr long)
@ stub PsSetCreateThreadNotifyRoutine @ stub PsSetCreateThreadNotifyRoutine
@ stub PsSetJobUIRestrictionsClass @ stub PsSetJobUIRestrictionsClass
@ stub PsSetLegoNotifyRoutine @ stub PsSetLegoNotifyRoutine