mirror of
https://github.com/reactos/reactos.git
synced 2024-07-30 08:08:56 +00:00
[NTOSKRNL]
- Implement Ke386IoSetAccessProcess, Ke386SetIoAccessMap, and Ke386QueryIoAccessMap [NDK] - Add definition of KIO_ACCESS_MAP - Patch by Samuel Serapion - Fixes bug 2641 svn path=/trunk/; revision=47108
This commit is contained in:
parent
ac293dd5d6
commit
8481a4f1b9
|
@ -151,6 +151,10 @@ Author:
|
||||||
(USHORT)(sizeof(KTSS)) : \
|
(USHORT)(sizeof(KTSS)) : \
|
||||||
(USHORT)(FIELD_OFFSET(KTSS, IoMaps[MapNumber-1].IoMap))
|
(USHORT)(FIELD_OFFSET(KTSS, IoMaps[MapNumber-1].IoMap))
|
||||||
|
|
||||||
|
typedef UCHAR KIO_ACCESS_MAP[IOPM_SIZE];
|
||||||
|
|
||||||
|
typedef KIO_ACCESS_MAP *PKIO_ACCESS_MAP;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Size of the XMM register save area in the FXSAVE format
|
// Size of the XMM register save area in the FXSAVE format
|
||||||
//
|
//
|
||||||
|
|
|
@ -659,37 +659,87 @@ Ke386CallBios(IN ULONG Int,
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
Ke386IoSetAccessProcess(IN PKPROCESS Process,
|
Ke386IoSetAccessProcess(IN PKPROCESS Process,
|
||||||
IN ULONG Flag)
|
IN ULONG MapNumber)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
USHORT MapOffset;
|
||||||
return FALSE;
|
PKPRCB Prcb;
|
||||||
|
KAFFINITY TargetProcessors;
|
||||||
|
|
||||||
|
if(MapNumber > IOPM_COUNT)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
MapOffset = KiComputeIopmOffset(MapNumber);
|
||||||
|
|
||||||
|
Process->IopmOffset = MapOffset;
|
||||||
|
|
||||||
|
TargetProcessors = Process->ActiveProcessors;
|
||||||
|
Prcb = KeGetCurrentPrcb();
|
||||||
|
if (TargetProcessors & Prcb->SetMember)
|
||||||
|
KeGetPcr()->TSS->IoMapBase = MapOffset;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
Ke386SetIoAccessMap(IN ULONG Flag,
|
Ke386SetIoAccessMap(IN ULONG MapNumber,
|
||||||
IN PVOID IopmBuffer)
|
IN PKIO_ACCESS_MAP IopmBuffer)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
PKPROCESS CurrentProcess;
|
||||||
return FALSE;
|
PKPRCB Prcb;
|
||||||
|
PVOID pt;
|
||||||
|
|
||||||
|
if ((MapNumber > IOPM_COUNT) || (MapNumber == IO_ACCESS_MAP_NONE))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
Prcb = KeGetCurrentPrcb();
|
||||||
|
|
||||||
|
// Copy the IOP map and load the map for the current process.
|
||||||
|
pt = &(KeGetPcr()->TSS->IoMaps[MapNumber-1].IoMap);
|
||||||
|
RtlMoveMemory(pt, (PVOID)IopmBuffer, IOPM_SIZE);
|
||||||
|
CurrentProcess = Prcb->CurrentThread->ApcState.Process;
|
||||||
|
KeGetPcr()->TSS->IoMapBase = CurrentProcess->IopmOffset;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
Ke386QueryIoAccessMap(IN ULONG Flag,
|
Ke386QueryIoAccessMap(IN ULONG MapNumber,
|
||||||
IN PVOID IopmBuffer)
|
IN PKIO_ACCESS_MAP IopmBuffer)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
ULONG i;
|
||||||
return FALSE;
|
PVOID Map;
|
||||||
|
PUCHAR p;
|
||||||
|
|
||||||
|
if (MapNumber > IOPM_COUNT)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (MapNumber == IO_ACCESS_MAP_NONE)
|
||||||
|
{
|
||||||
|
// no access, simply return a map of all 1s
|
||||||
|
p = (PUCHAR)IopmBuffer;
|
||||||
|
for (i = 0; i < IOPM_SIZE; i++) {
|
||||||
|
p[i] = (UCHAR)-1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// copy the bits
|
||||||
|
Map = (PVOID)&(KeGetPcr()->TSS->IoMaps[MapNumber-1].IoMap);
|
||||||
|
RtlMoveMemory((PVOID)IopmBuffer, Map, IOPM_SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue