UniqueProcessId from thread in 2k?

In windows XP my driver was using the following code to get the UniqueProcessId for a given thread:

NTSTATUS GetThreadProcessHandle ( HANDLE threadHandle, HANDLE * processId )
{
THREAD_BASIC_INFORMATION threadBasicInformation;
NTSTATUS status;

PAGED_CODE();

status = ZwQueryInformationThread (
threadHandle,
ThreadBasicInformation,//IN THREADINFOCLASS ThreadInformationClass,
&threadBasicInformation,//OUT PVOID ThreadInformation,
sizeof ( threadBasicInformation ),//IN ULONG ThreadInformationLength,
0
);

// If we were successful
if ( NT_SUCCESS ( status ) )
* processId = threadBasicInformation.ClientId.UniqueProcess;

// Return our status
return ( status );
}

However ZwQueryInformationThread is unavailable in 2k. Any suggestion on how to do this?

I think IoThreadToProcess has always been around, no need to resort to
undocumented ways for that.

//Daniel

wrote in message news:xxxxx@ntdevā€¦
> In windows XP my driver was using the following code to get the
> UniqueProcessId for a given thread:
>
> NTSTATUS GetThreadProcessHandle ( HANDLE threadHandle, HANDLE *
> processId )
> {
> THREAD_BASIC_INFORMATION threadBasicInformation;
> NTSTATUS status;
>
> PAGED_CODE();
>
> status = ZwQueryInformationThread (
> threadHandle,
> ThreadBasicInformation,//IN THREADINFOCLASS ThreadInformationClass,
> &threadBasicInformation,//OUT PVOID ThreadInformation,
> sizeof ( threadBasicInformation ),//IN ULONG ThreadInformationLength,
> 0
> );
>
> // If we were successful
> if ( NT_SUCCESS ( status ) )
> * processId = threadBasicInformation.ClientId.UniqueProcess;
>
> // Return our status
> return ( status );
> }
>
> However ZwQueryInformationThread is unavailable in 2k. Any suggestion on
> how to do this?
>