ntdll: Implement NtGetCurrentProcessorNumber.

This commit is contained in:
Detlef Riekenberg 2012-05-17 19:28:31 +02:00 committed by Alexandre Julliard
parent 6c51c1ba13
commit 02b74d3fd3
5 changed files with 28 additions and 0 deletions

View file

@ -498,6 +498,7 @@
@ stdcall GetCurrentDirectoryW(long ptr) @ stdcall GetCurrentDirectoryW(long ptr)
@ stdcall GetCurrentProcess() @ stdcall GetCurrentProcess()
@ stdcall GetCurrentProcessId() @ stdcall GetCurrentProcessId()
@ stdcall GetCurrentProcessorNumber() ntdll.NtGetCurrentProcessorNumber
@ stdcall GetCurrentThread() @ stdcall GetCurrentThread()
@ stdcall GetCurrentThreadId() @ stdcall GetCurrentThreadId()
@ stdcall GetDateFormatA(long long ptr str ptr long) @ stdcall GetDateFormatA(long long ptr str ptr long)

View file

@ -176,6 +176,7 @@
@ stdcall NtFreeVirtualMemory(long ptr ptr long) @ stdcall NtFreeVirtualMemory(long ptr ptr long)
@ stdcall NtFsControlFile(long long long long long long long long long long) @ stdcall NtFsControlFile(long long long long long long long long long long)
@ stdcall NtGetContextThread(long ptr) @ stdcall NtGetContextThread(long ptr)
@ stdcall NtGetCurrentProcessorNumber()
# @ stub NtGetDevicePowerState # @ stub NtGetDevicePowerState
@ stub NtGetPlugPlayEvent @ stub NtGetPlugPlayEvent
@ stdcall NtGetTickCount() @ stdcall NtGetTickCount()

View file

@ -1173,3 +1173,20 @@ NTSTATUS WINAPI NtSetInformationThread( HANDLE handle, THREADINFOCLASS class,
return STATUS_NOT_IMPLEMENTED; return STATUS_NOT_IMPLEMENTED;
} }
} }
/******************************************************************************
* NtGetCurrentProcessorNumber (NTDLL.@)
*
* Return the processor, on which the thread is running
*
*/
ULONG WINAPI NtGetCurrentProcessorNumber(void)
{
if (NtCurrentTeb()->Peb->NumberOfProcessors > 1) {
FIXME("need multicore support (%d processors)\n", NtCurrentTeb()->Peb->NumberOfProcessors);
}
/* fallback to the first processor */
return 0;
}

View file

@ -1634,6 +1634,8 @@ WINADVAPI BOOL WINAPI GetCurrentHwProfileA(LPHW_PROFILE_INFOA);
WINADVAPI BOOL WINAPI GetCurrentHwProfileW(LPHW_PROFILE_INFOW); WINADVAPI BOOL WINAPI GetCurrentHwProfileW(LPHW_PROFILE_INFOW);
#define GetCurrentHwProfile WINELIB_NAME_AW(GetCurrentHwProfile) #define GetCurrentHwProfile WINELIB_NAME_AW(GetCurrentHwProfile)
WINBASEAPI HANDLE WINAPI GetCurrentProcess(void); WINBASEAPI HANDLE WINAPI GetCurrentProcess(void);
WINBASEAPI DWORD WINAPI GetCurrentProcessorNumber(void);
WINBASEAPI VOID WINAPI GetCurrentProcessorNumberEx(PPROCESSOR_NUMBER);
WINBASEAPI HANDLE WINAPI GetCurrentThread(void); WINBASEAPI HANDLE WINAPI GetCurrentThread(void);
#define GetCurrentTime() GetTickCount() #define GetCurrentTime() GetTickCount()
WINBASEAPI BOOL WINAPI GetDefaultCommConfigA(LPCSTR,LPCOMMCONFIG,LPDWORD); WINBASEAPI BOOL WINAPI GetDefaultCommConfigA(LPCSTR,LPCOMMCONFIG,LPDWORD);

View file

@ -5286,6 +5286,13 @@ typedef struct _GROUP_AFFINITY
WORD Reserved[3]; WORD Reserved[3];
} GROUP_AFFINITY, *PGROUP_AFFINITY; } GROUP_AFFINITY, *PGROUP_AFFINITY;
typedef struct _PROCESSOR_NUMBER
{
WORD Group;
BYTE Number;
BYTE Reserved;
} PROCESSOR_NUMBER, *PPROCESSOR_NUMBER;
typedef struct _PROCESSOR_RELATIONSHIP typedef struct _PROCESSOR_RELATIONSHIP
{ {
BYTE Flags; BYTE Flags;