*/
HRGN
WINAPI
- CreatePolyPolygonRgn( const POINT* lppt,
- const INT* lpPolyCounts,
- int nCount,
- int fnPolyFillMode)
+ CreatePolygonRgn( const POINT * lppt, int cPoints, int fnPolyFillMode)
{
- return (HRGN) NtGdiPolyPolyDraw( ULongToHandle(fnPolyFillMode), (PPOINT) lppt, (PULONG) lpPolyCounts, (ULONG) nCount, GdiPolyPolyRgn );
- return (HRGN) NtGdiPolyPolyDraw( (HDC) fnPolyFillMode, (PPOINT) lppt, (PULONG) &cPoints, 1, GdiPolyPolyRgn);
++ return (HRGN) NtGdiPolyPolyDraw(ULongToHandle(fnPolyFillMode), (PPOINT) lppt, (PULONG) &cPoints, 1, GdiPolyPolyRgn);
}
/*
MmUnmapIoSpace(VirtualAddress, NumberPages << PAGE_SHIFT);
}
+ VOID
+ NTAPI
+ HalpFlushTLB(VOID)
+ {
+ ULONG Flags, Cr4;
+ INT CpuInfo[4];
+ ULONG_PTR PageDirectory;
+
+ //
+ // Disable interrupts
+ //
+ Flags = __readeflags();
+ _disable();
+
+ //
+ // Get page table directory base
+ //
+ PageDirectory = __readcr3();
+
+ //
+ // Check for CPUID support
+ //
+ if (KeGetCurrentPrcb()->CpuID)
+ {
+ //
+ // Check for global bit in CPU features
+ //
+ __cpuid(CpuInfo, 1);
+ if (CpuInfo[3] & 0x2000)
+ {
+ //
+ // Get current CR4 value
+ //
+ Cr4 = __readcr4();
+
+ //
+ // Disable global pit
+ //
+ __writecr4(Cr4 & ~CR4_PGE);
+
+ //
+ // Flush TLB and re-enable global bit
+ //
+ __writecr3(PageDirectory);
+ __writecr4(Cr4);
+
+ //
+ // Restore interrupts
+ //
+ __writeeflags(Flags);
+ }
+ }
+
+ //
+ // Legacy: just flush TLB
+ //
+ __writecr3(PageDirectory);
+ __writeeflags(Flags);
+ }
+
+VOID
+NTAPI
+HalpSetInterruptGate(ULONG index, PVOID address)
+{
+ KIDTENTRY *idt;
+ KIDT_ACCESS Access;
+
+ /* Set the IDT Access Bits */
+ Access.Reserved = 0;
+ Access.Present = 1;
+ Access.Dpl = 0; /* Kernel-Mode */
+ Access.SystemSegmentFlag = 0;
+ Access.SegmentType = I386_INTERRUPT_GATE;
+
+ idt = (KIDTENTRY*)((ULONG)KeGetPcr()->IDT + index * sizeof(KIDTENTRY));
+ idt->Offset = (USHORT)((ULONG_PTR)address & 0xffff);
+ idt->Selector = KGDT_R0_CODE;
+ idt->Access = Access.Value;
+ idt->ExtendedOffset = (USHORT)((ULONG_PTR)address >> 16);
+}
+
/* FUNCTIONS *****************************************************************/
/*
NTAPI
KeFlushWriteBuffer(VOID)
{
- /* Not implemented on x86 */
+ //
+ // Not implemented on x86
+ //
return;
}
+