I looked for this on one of my Vista targets. Unless I’m missing
something, Ke386CallBios is no longer an export. I don’t know much
about videoprt.sys, but it looks like it might now use x86BiosCall
instead, but I looked casually at that and it looks like it emulates the
stream (hal!XmEmulateStream). It may actually execute it directly; I
really don’t know, there does not seem to be anything in nt!*386*, at
least on the 6001-x64-CHK target at which I looked.
Microsoft (R) COFF/PE Dumper Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file l:\videoprt.sys
File Type: EXECUTABLE IMAGE
Section contains the following imports:
ntoskrnl.exe
19050 Import Address Table
38050 Import Name Table
0 time date stamp
0 Index of first forwarder reference
6EC ZwSetValueKey
2E1 KeReleaseSpinLock
9B ExQueueWorkItem
417 PoRequestPowerIrp
90 ExInterlockedInsertTailList
BA ExUnregisterCallback
67 ExAllocatePoolWithTag
28D KeClearEvent
193 IoBuildDeviceIoControlRequest
65D ZwClose
668 ZwCreateKey
7D ExFreePoolWithTag
219 IoRegisterPlugPlayNotification
A3 ExRegisterCallback
1D5 IoGetAttachedDeviceReference
49A RtlAppendStringToString
406 ObfReferenceObject
1D4 IoGetAttachedDevice
405 ObfDereferenceObject
202 IoOpenDeviceRegistryKey
195 IoBuildSynchronousFsdRequest
6A ExCreateCallback
3FA ObOpenObjectByPointer
648 ZwAllocateVirtualMemory
37C MmUnmapLockedPages
68D ZwMapViewOfSection
37B MmUnmapIoSpace
292 KeDetachProcess
35D MmMapLockedPagesSpecifyCache
6F4 ZwUnmapViewOfSection
1DA IoGetCurrentProcess
682 ZwFreeVirtualMemory
35B MmMapIoSpace
33E MmCreateMdl
288 KeAttachProcess
1E3 IoGetDmaAdapter
1D0 IoFreeMdl
369 MmProbeAndLockPages
37A MmUnlockPages
187 IoAllocateMdl
332 MmAllocateContiguousMemory
391 NtBuildNumber
5DF SeExports
57F RtlSetDaclSecurityDescriptor
6F7 ZwWriteFile
4C0 RtlCreateRegistryKey
544 RtlLengthSid
4A5 RtlCheckRegistryKey
4C1 RtlCreateSecurityDescriptor
1AB IoCreateFile
20D IoRaiseInformationalHardError
185 IoAllocateErrorLogEntry
490 RtlAddAccessAllowedAce
28C KeCapturePersistentThreadState
438 PsGetCurrentThread
265 IoWriteErrorLogEntry
4A2 RtlCaptureContext
5BC RtlWriteRegistryValue
4BD RtlCreateAcl
1F4 IoInitializeRemoveLockEx
1A8 IoCreateDevice
2A9 KeInitializeMutex
498 RtlAnsiStringToUnicodeString
1BC IoDeleteDevice
41B PoSetPowerState
70E _vsnwprintf
5B9 RtlVirtualUnwind
2B3 KeInsertQueueApc
56A RtlQueryRegistryValues
2C9 KeQueryPriorityThread
432 PsGetContextThread
3D DbgPrintEx
28E KeDelayExecutionThread
42C PsCreateSystemThread
38 DbgBreakPoint
26D KdDebuggerEnabled
47C PsSetContextThread
A0 ExRaiseStatus
54D RtlLookupFunctionEntry
26E KdDebuggerNotPresent
394 NtClose
2CB KeQueryTimeIncrement
2FB KeSetPriorityThread
2A1 KeInitializeApc
3FD ObReferenceObjectByHandle
2F6 KeSetEvent
511 RtlInitAnsiString
37D MmUnmapReservedMapping
33A MmBuildMdlForNonPagedPool
347 MmFreeMappingAddress
35E MmMapLockedPagesWithReservedMapping
335 MmAllocateMappingAddress
316 KiBugCheckData
2B4 KeInsertQueueDpc
26B IofCompleteRequest
21C IoReleaseRemoveLockAndWaitEx
40D PoCallDriver
17F IoAcquireRemoveLockEx
1E4 IoGetDriverObjectExtension
1DF IoGetDeviceProperty
305 KeStackAttachProcess
21D IoReleaseRemoveLockEx
1BF IoDetachDevice
30E KeUnstackDetachProcess
41F PoStartNextPowerIrp
222 IoReportResourceForDetection
223 IoReportResourceUsage
18D IoAssignResources
712 _wcsnicmp
2CE KeReadStateEvent
2E3 KeReleaseSpinLockFromDpcLevel
27F KeAcquireSpinLockAtDpcLevel
1BE IoDeleteSymbolicLink
337 MmAllocatePagesForMdl
205 IoQueryDeviceDescription
680 ZwFlushKey
67B ZwEnumerateKey
21A IoRegisterShutdownNotification
49 EmProviderRegister
171 InbvCheckDisplayOwnership
5AB RtlUpcaseUnicodeString
1F8 IoInvalidateDeviceState
190 IoAttachDeviceToDeviceStack
4F6 RtlFreeUnicodeString
2D5 KeRegisterBugCheckReasonCallback
214 IoRegisterDeviceInterface
3FB ObQueryNameString
1DD IoGetDeviceInterfaces
697 ZwOpenKey
748 wcsrchr
74A wcsstr
22B IoSetDeviceInterfaceState
16B HalDispatchTable
6C5 ZwQueryValueKey
374 MmSetBankedSection
1B2 IoCreateSymbolicLink
290 KeDeregisterBugCheckReasonCallback
6C8 ZwReadFile
4BC RtlCopyUnicodeString
245 IoStopTimer
184 IoAllocateDriverObjectExtension
47 EmProviderDeregister
243 IoStartTimer
177 InbvNotifyDisplayOwnershipLost
525 RtlIntegerToUnicodeString
73C vDbgPrintEx
1C3 IoDisconnectInterrupt
695 ZwOpenFile
173 InbvEnableBootDriver
746 wcsncmp
49C RtlAppendUnicodeToString
740 wcschr
67D ZwEnumerateValueKey
6B5 ZwQueryInformationFile
1F5 IoInitializeTimer
50A RtlGetVersion
24D IoUnregisterPlugPlayNotification
435 PsGetCurrentProcessSessionId
49B RtlAppendUnicodeStringToString
2A4 KeInitializeDpc
589 RtlStringFromGUID
220 IoReportDetectedDevice
6C4 ZwQuerySystemInformation
69D ZwOpenSection
1F7 IoInvalidateDeviceRelations
1A4 IoConnectInterrupt
307 KeSynchronizeExecution
BC ExUuidCreate
25E IoWMIRegistrationControl
263 IoWMIWriteEvent
2A5 KeInitializeEvent
281 KeAcquireSpinLockRaiseToDpc
26A IofCallDriver
515 RtlInitUnicodeString
3C DbgPrint
4A1 RtlAssert
314 KeWaitForSingleObject
2DE KeReleaseMutex
28A KeBugCheckEx
5FE SeSinglePrivilegeCheck
6F9 __C_specific_handler
HAL.dll
19000 Import Address Table
38000 Import Name Table
0 time date stamp
0 Index of first forwarder reference
46 KeQueryPerformanceCounter
15 HalGetBusDataByOffset
47 KeStallExecutionProcessor
4C x86BiosWriteMemory
49 x86BiosCall
4A x86BiosFreeBuffer
4B x86BiosReadMemory
48 x86BiosAllocateBuffer
3B HalTranslateBusAddress
watchdog.sys
19600 Import Address Table
38600 Import Name Table
0 time date stamp
0 Index of first forwarder reference
2A WdDiagShutdown
27 WdDiagInit
29 WdDiagNotifyUser
31 WdGetLowestDeviceObject
2F WdGetDeviceObject
30 WdGetLastEvent
1B WdCompleteEvent
36 WdMadeAnyProgress
13 SMgrGetActiveSessionProcess
5 DMgrReleaseDisplayOwnership
6 DMgrReleaseGdiViewId
0 DMgrAcquireDisplayOwnership
2 DMgrGetDisplayOwnership
1 DMgrAcquireGdiViewId
7 DMgrWriteDeviceCountToRegistry
12 SMgrGdiCallout
Summary
1000 .data
2000 .edata
1000 .pdata
2000 .rdata
1000 .reloc
1000 .rsrc
8000 .text
3000 INIT
17000 PAGE
1000 PAGE_DAT
>> xxxxx@probo.com 2007-05-15 12:43:31 >>>
Paul Gardiner wrote:
Michael Huang wrote:
>
> I know it’s probably not recommeded by anyone, but I really really
> need to call some real mode code in a driver. I found some info
about
> how to do it on x86 processor, looks like it’s doable from x86
> driver. but I cannot find any info on how to call real mode code
from
> x64 driver, anyone can give me some ideas? Or is it completely not
> possible?
>
> Thanks in advance.
It may not be possible. 64bit Windows uses the CPU in IA-32e mode,
some
of the time in its 64bit submode, and some of the time in
compatibility
mode. Compatibility mode behaves like 32bit protected mode, and
allows
32bit apps to run.
The trouble is compatibility mode doesn’t include Virtual 8086
submode
(subsubmode maybe). It was Virtual 8086 that allowed for the running
of realmode code from 32bit protected mode. Its not there. The CPU
can’t do it, not while in IA-32e mode.
I admit that I haven’t read about the details here, but it’s a fact
that
MANY pre-Vista display drivers use INT 10 to call into the video BIOS
for setting the video mode, using APIs like Ke386CallBios. I guess I
would be extremely surprised to learn that display driver writers had
to
rewrite their mode set routines in order to make their display drivers
Win64-compatible.
And, in fact, there’s a hint here. If you do “link /dump /imports
videoprt.sys” on a Vista 64 system and it still shows Ke386CallBios,
then a disassembly of ntoskrnl.exe might prove to be very
enlightening.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer