Compare commits

...

8 Commits

Author SHA1 Message Date
Art Yerkes
8cd5420808 @@@ revision 25750
svn path=/branches/arty-stable/; revision=25904
2007-02-25 07:47:42 +00:00
Art Yerkes
b1978d0fcf Remove my branch pending reconstruction at known good rev 25750.
svn path=/branches/arty-stable/; revision=25903
2007-02-25 07:18:11 +00:00
Art Yerkes
eacc36fdc5 Merge up to 25067.
svn path=/branches/arty-stable/; revision=25068
2006-12-05 07:30:24 +00:00
Art Yerkes
6a5767b51c Unregress gdb installer.
svn path=/branches/arty-stable/; revision=25032
2006-12-03 12:36:50 +00:00
Art Yerkes
882fa75307 Other part of python installer unregression (verified as necessary)
What's here fixes the problem but no doubt others will find at least the
changes to address space locking thoroughly objectionable.

svn path=/branches/arty-stable/; revision=25031
2006-12-03 11:51:07 +00:00
Art Yerkes
5cf7fca4ba After a clean, these seem to be needed. Probably due to my patchy import.
svn path=/branches/arty-stable/; revision=25030
2006-12-03 11:25:56 +00:00
Art Yerkes
d6749f7cc3 Partially unregress python 2.4 installer.
svn path=/branches/arty-stable/; revision=25028
2006-12-03 10:42:35 +00:00
Art Yerkes
342b63c398 Stable branch (mostly at 24900)
WORKSFORME

svn path=/branches/arty-stable/; revision=25024
2006-12-03 04:54:29 +00:00
118 changed files with 16 additions and 6129 deletions

View File

View File

View File

View File

View File

View File

@@ -1,87 +0,0 @@
/*
ReactOS Kernel Streaming
Port Class API: Adapter initialization
Author: Andrew Greenwood
*/
#include <portcls.h>
NTSTATUS
PcStartIo(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
/* Internal function */
return STATUS_UNSUCCESSFUL;
}
NTSTATUS
PcUnload(
IN PDRIVER_OBJECT DriverObject)
{
/* Internal function */
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
PORTCLASSAPI NTSTATUS NTAPI
PcInitializeAdapterDriver(
IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPathName,
IN PDRIVER_ADD_DEVICE AddDevice)
{
/*
This is effectively a common DriverEntry function for PortCls drivers.
So it has similar responsibilities to a normal driver.
First 2 parameters are from DriverEntry.
Installs the supplied AddDevice routine in the driver object?s driver extension and installs the PortCls driver?s IRP handlers in the driver object itself.
*/
DriverObject->DriverExtension->AddDevice = AddDevice;
/*
TODO: (* = implement here, otherwise KS default)
IRP_MJ_CLOSE
* IRP_MJ_CREATE
IRP_MJ_DEVICE_CONTROL
IRP_MJ_FLUSH_BUFFERS
* IRP_MJ_PNP
* IRP_MJ_POWER
IRP_MJ_QUERY_SECURITY
IRP_MJ_READ
IRP_MJ_SET_SECURITY
* IRP_MJ_SYSTEM_CONTROL
IRP_MJ_WRITE
*/
UNIMPLEMENTED;
return STATUS_SUCCESS;
}
/*
* @unimplemented
*/
PORTCLASSAPI NTSTATUS NTAPI
PcAddAdapterDevice(
IN PDRIVER_OBJECT DriverObject,
IN PDEVICE_OBJECT PhysicalDeviceObject,
IN PCPFNSTARTDEVICE StartDevice,
IN ULONG MaxObjects,
IN ULONG DeviceExtensionSize)
{
/*
Note - after this has been called, we can
handle IRP_MN_START_DEVICE by calling StartDevice
*/
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}

View File

@@ -1,29 +0,0 @@
/*
ReactOS Kernel Streaming
Port Class / Library Init and Cleanup
Author: Andrew Greenwood
Notes:
-
*/
#include <ntddk.h>
/*
* @implemented
*/
ULONG STDCALL
DllInitialize(ULONG Unknown)
{
return 0;
}
/*
* @implemented
*/
ULONG STDCALL
DllUnload(VOID)
{
return 0;
}

View File

@@ -1,73 +0,0 @@
/*
ReactOS Kernel Streaming
Port Class / Digital Rights Management
Author: Andrew Greenwood
Notes:
These are convenience functions for accessing DRM facilities, as
documented here:
http://www.osronline.com/ddkx/stream/aud-prop_9f77.htm
*/
#include <portcls.h>
#include <drmk.h>
PORTCLASSAPI NTSTATUS NTAPI
PcAddContentHandlers(
IN ULONG ContentId,
IN PVOID *paHandlers,
IN ULONG NumHandlers)
{
return DrmAddContentHandlers(ContentId, paHandlers, NumHandlers);
}
PORTCLASSAPI NTSTATUS NTAPI
PcCreateContentMixed(
IN PULONG paContentId,
IN ULONG cContentId,
OUT PULONG pMixedContentId)
{
return DrmCreateContentMixed(paContentId, cContentId, pMixedContentId);
}
PORTCLASSAPI NTSTATUS NTAPI
PcDestroyContent(
IN ULONG ContentId)
{
return DrmDestroyContent(ContentId);
}
PORTCLASSAPI NTSTATUS NTAPI
PcForwardContentToDeviceObject(
IN ULONG ContentId,
IN PVOID Reserved,
IN PCDRMFORWARD DrmForward)
{
return DrmForwardContentToDeviceObject(ContentId, Reserved, DrmForward);
}
PORTCLASSAPI NTSTATUS NTAPI
PcForwardContentToFileObject(
IN ULONG ContentId,
IN PFILE_OBJECT FileObject)
{
return DrmForwardContentToFileObject(ContentId, FileObject);
}
PORTCLASSAPI NTSTATUS NTAPI
PcForwardContentToInterface(
IN ULONG ContentId,
IN PUNKNOWN pUnknown,
IN ULONG NumMethods)
{
return DrmForwardContentToInterface(ContentId, pUnknown, NumMethods);
}
PORTCLASSAPI NTSTATUS NTAPI
PcGetContentRights(
IN ULONG ContentId,
OUT PDRMRIGHTS DrmRights)
{
return DrmGetContentRights(ContentId, DrmRights);
}

View File

@@ -1,489 +0,0 @@
/*
* PROJECT: ReactOS Sound System
* LICENSE: GPL - See COPYING in the top level directory
* FILE: drivers/multimedia/portcls/portcls.c
* PURPOSE: Audio Port Class Functions
* PROGRAMMERS:
*
*/
#include "portcls.h"
#define NDEBUG
#include <debug.h>
NTSTATUS STDCALL
DriverEntry(PDRIVER_OBJECT DriverObject,
PUNICODE_STRING RegistryPath)
{
return STATUS_SUCCESS;
}
/*
* @implemented
*/
ULONG STDCALL
DllInitialize(ULONG Unknown)
{
return 0;
}
/*
* @implemented
*/
ULONG STDCALL
DllUnload(VOID)
{
return 0;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcAddAdapterDevice(
ULONG DriverObject,
ULONG PhysicalDeviceObject,
ULONG StartDevice,
ULONG MaxObjects,
ULONG DeviceExtensionSize
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcAddContentHandlers(
ULONG ContentId,
ULONG paHandlers,
ULONG NumHandlers
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcCompleteIrp(
ULONG DeviceObject,
ULONG Irp,
ULONG Status
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcCompletePendingPropertyRequest(
ULONG PropertyRequest,
ULONG NtStatus
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcCreateContentMixed(
ULONG paContentId,
ULONG cContentId,
ULONG pMixedContentId
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcDestroyContent(
ULONG ContentId
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcDispatchIrp(
ULONG DeviceObject,
ULONG Irp
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcForwardContentToDeviceObject(
ULONG ContentId,
ULONG Reserved,
ULONG DrmForward
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcForwardContentToFileObject(
ULONG ContentId,
ULONG FileObject
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcForwardContentToInterface(
ULONG ContentId,
ULONG Unknown,
ULONG NumMethods
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcForwardIrpSynchronous(
ULONG DeviceObject,
ULONG Irp
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcGetContentRights(
ULONG ContentId,
ULONG DrmRights
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcGetDeviceProperty(
ULONG DeviceObject,
ULONG DeviceProperty,
ULONG BufferLength,
ULONG PropertyBuffer,
ULONG ResultLength
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @implemented
*/
ULONGLONG STDCALL
PcGetTimeInterval(
ULONGLONG Timei
)
{
LARGE_INTEGER CurrentTime;
KeQuerySystemTime( &CurrentTime);
return (Timei - CurrentTime.QuadPart);
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcInitializeAdapterDriver(
ULONG DriverObject,
ULONG RegistryPathName,
ULONG AddDevice
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcNewDmaChannel(
ULONG OutDmaChannel,
ULONG Unknown,
ULONG PoolType,
ULONG DeviceDescription,
ULONG DeviceObject
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcNewInterruptSync(
ULONG OutInterruptSync,
ULONG Unknown,
ULONG ResourceList,
ULONG ResourceIndex,
ULONG Mode
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcNewMiniport(
ULONG OutMiniport,
ULONG ClassId
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcNewPort(
ULONG OutPort,
ULONG ClassId
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcNewRegistryKey(
ULONG OutRegistryKey,
ULONG Unknown,
ULONG RegistryKeyType,
ULONG DesiredAccess,
ULONG DeviceObject,
ULONG SubDevice,
ULONG ObjectAttributes,
ULONG CreateOptions,
ULONG Disposition
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcNewResourceList(
ULONG OutResourceList,
ULONG Unknown,
ULONG PoolType,
ULONG TranslatedResources,
ULONG UntranslatedResources
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcNewResourceSublist(
ULONG OutResourceList,
ULONG Unknown,
ULONG PoolType,
ULONG ParentList,
ULONG MaximumEntries
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcNewServiceGroup(
ULONG OutServiceGroup,
ULONG Unknown
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcRegisterAdapterPowerManagement(
ULONG Unknown,
ULONG pvContext
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcRegisterIoTimeout(
ULONG pDeviceObject,
ULONG pTimerRoutine,
ULONG pContext
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcRegisterPhysicalConnection(
ULONG DeviceObject,
ULONG FromUnknown,
ULONG FromPin,
ULONG ToUnknown,
ULONG ToPin
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcRegisterPhysicalConnectionFromExternal(
ULONG DeviceObject,
ULONG FromString,
ULONG FromPin,
ULONG ToUnknown,
ULONG ToPin
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcRegisterPhysicalConnectionToExternal(
ULONG DeviceObject,
ULONG FromUnknown,
ULONG FromPin,
ULONG ToString,
ULONG ToPin
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcRegisterSubdevice(
ULONG DeviceObject,
ULONG SubdevName,
ULONG Unknown
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcRequestNewPowerState(
ULONG pDeviceObject,
ULONG RequestedNewState
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
NTSTATUS STDCALL
PcUnregisterIoTimeout(
ULONG pDeviceObject,
ULONG pTimerRoutine,
ULONG pContext
)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}

View File

@@ -1,55 +0,0 @@
;
; Exports definition file for portcls.sys
;
EXPORTS
DllInitialize@4
DllUnload@0
; Adapters (adapter.c)
PcAddAdapterDevice@20
PcInitializeAdapterDriver@12
; Factories
PcNewDmaChannel@20
PcNewInterruptSync@20
PcNewMiniport@8
PcNewPort@8
PcNewRegistryKey@36
PcNewResourceList@20
PcNewResourceSublist@20
PcNewServiceGroup@8
; Digital Rights Management (drm.c)
PcAddContentHandlers@12
PcCreateContentMixed@12
PcDestroyContent@4
PcForwardContentToDeviceObject@12
PcForwardContentToFileObject@8
PcForwardContentToInterface@12
PcGetContentRights@8
; IRP Helpers
PcCompleteIrp@12
PcDispatchIrp@8
PcForwardIrpSynchronous@8
; Misc
PcGetTimeInterval@8
PcRegisterSubdevice@12
; Physical Connections
PcRegisterPhysicalConnection@20
PcRegisterPhysicalConnectionFromExternal@20
PcRegisterPhysicalConnectionToExternal@20
; Power Management
PcRegisterAdapterPowerManagement@8
PcRequestNewPowerState@8
; Properties
PcCompletePendingPropertyRequest@8
PcGetDeviceProperty@20
; Timeouts
PcRegisterIoTimeout@12
PcUnregisterIoTimeout@12

View File

@@ -1,253 +0,0 @@
/*
Move to w32api when it is ready.
*/
#ifndef _PORTCLS_H
#define _PORTCLS_H
#if __GNUC__ >=3
#pragma GCC system_header
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* This header is total bull**** */
#include <ntddk.h>
#define PORTCLASSAPI extern
PORTCLASSAPI NTSTATUS STDCALL
PcAddAdapterDevice(
ULONG DriverObject,
ULONG PhysicalDeviceObject,
ULONG StartDevice,
ULONG MaxObjects,
ULONG DeviceExtensionSize
);
PORTCLASSAPI NTSTATUS STDCALL
PcAddContentHandlers(
ULONG ContentId,
ULONG paHandlers,
ULONG NumHandlers
);
PORTCLASSAPI NTSTATUS STDCALL
PcCompleteIrp(
ULONG DeviceObject,
ULONG Irp,
ULONG Status
);
PORTCLASSAPI NTSTATUS STDCALL
PcCompletePendingPropertyRequest(
ULONG PropertyRequest,
ULONG NtStatus
);
PORTCLASSAPI NTSTATUS STDCALL
PcCreateContentMixed(
ULONG paContentId,
ULONG cContentId,
ULONG pMixedContentId
);
PORTCLASSAPI NTSTATUS STDCALL
PcDestroyContent(
ULONG ContentId
);
PORTCLASSAPI NTSTATUS STDCALL
PcDispatchIrp(
ULONG DeviceObject,
ULONG Irp
);
PORTCLASSAPI NTSTATUS STDCALL
PcForwardContentToDeviceObject(
ULONG ContentId,
ULONG Reserved,
ULONG DrmForward
);
PORTCLASSAPI NTSTATUS STDCALL
PcForwardContentToFileObject(
ULONG ContentId,
ULONG FileObject
);
PORTCLASSAPI NTSTATUS STDCALL
PcForwardContentToInterface(
ULONG ContentId,
ULONG Unknown,
ULONG NumMethods
);
PORTCLASSAPI NTSTATUS STDCALL
PcForwardIrpSynchronous(
ULONG DeviceObject,
ULONG Irp
);
PORTCLASSAPI NTSTATUS STDCALL
PcGetContentRights(
ULONG ContentId,
ULONG DrmRights
);
PORTCLASSAPI NTSTATUS STDCALL
PcGetDeviceProperty(
ULONG DeviceObject,
ULONG DeviceProperty,
ULONG BufferLength,
ULONG PropertyBuffer,
ULONG ResultLength
);
PORTCLASSAPI ULONGLONG STDCALL
PcGetTimeInterval(
ULONGLONG Timei
);
PORTCLASSAPI NTSTATUS STDCALL
PcInitializeAdapterDriver(
ULONG DriverObject,
ULONG RegistryPathName,
ULONG AddDevice
);
PORTCLASSAPI NTSTATUS STDCALL
PcNewDmaChannel(
ULONG OutDmaChannel,
ULONG Unknown,
ULONG PoolType,
ULONG DeviceDescription,
ULONG DeviceObject
);
PORTCLASSAPI NTSTATUS STDCALL
PcNewInterruptSync(
ULONG OutInterruptSync,
ULONG Unknown,
ULONG ResourceList,
ULONG ResourceIndex,
ULONG Mode
);
PORTCLASSAPI NTSTATUS STDCALL
PcNewMiniport(
ULONG OutMiniport,
ULONG ClassId
);
PORTCLASSAPI NTSTATUS STDCALL
PcNewPort(
ULONG OutPort,
ULONG ClassId
);
PORTCLASSAPI NTSTATUS STDCALL
PcNewRegistryKey(
ULONG OutRegistryKey,
ULONG Unknown,
ULONG RegistryKeyType,
ULONG DesiredAccess,
ULONG DeviceObject,
ULONG SubDevice,
ULONG ObjectAttributes,
ULONG CreateOptions,
ULONG Disposition
);
PORTCLASSAPI NTSTATUS STDCALL
PcNewResourceList(
ULONG OutResourceList,
ULONG Unknown,
ULONG PoolType,
ULONG TranslatedResources,
ULONG UntranslatedResources
);
PORTCLASSAPI NTSTATUS STDCALL
PcNewResourceSublist(
ULONG OutResourceList,
ULONG Unknown,
ULONG PoolType,
ULONG ParentList,
ULONG MaximumEntries
);
PORTCLASSAPI NTSTATUS STDCALL
PcNewServiceGroup(
ULONG OutServiceGroup,
ULONG Unknown
);
PORTCLASSAPI NTSTATUS STDCALL
PcRegisterAdapterPowerManagement(
ULONG Unknown,
ULONG pvContext
);
PORTCLASSAPI NTSTATUS STDCALL
PcRegisterIoTimeout(
ULONG pDeviceObject,
ULONG pTimerRoutine,
ULONG pContext
);
PORTCLASSAPI NTSTATUS STDCALL
PcRegisterPhysicalConnection(
ULONG DeviceObject,
ULONG FromUnknown,
ULONG FromPin,
ULONG ToUnknown,
ULONG ToPin
);
PORTCLASSAPI NTSTATUS STDCALL
PcRegisterPhysicalConnectionFromExternal(
ULONG DeviceObject,
ULONG FromString,
ULONG FromPin,
ULONG ToUnknown,
ULONG ToPin
);
PORTCLASSAPI NTSTATUS STDCALL
PcRegisterPhysicalConnectionToExternal(
ULONG DeviceObject,
ULONG FromUnknown,
ULONG FromPin,
ULONG ToString,
ULONG ToPin
);
PORTCLASSAPI NTSTATUS STDCALL
PcRegisterSubdevice(
ULONG DeviceObject,
ULONG SubdevName,
ULONG Unknown
);
PORTCLASSAPI NTSTATUS STDCALL
PcRequestNewPowerState(
ULONG pDeviceObject,
ULONG RequestedNewState
);
PORTCLASSAPI NTSTATUS STDCALL
PcUnregisterIoTimeout(
ULONG pDeviceObject,
ULONG pTimerRoutine,
ULONG pContext
);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,12 +0,0 @@
<module name="portcls" type="exportdriver" installbase="system32/drivers" installname="portcls.sys" allowwarnings="true">
<importlibrary definition="portcls.def" />
<define name="__USE_W32API" />
<include base="portcls">../include</include>
<library>ntoskrnl</library>
<library>drmk</library>
<file>dll.c</file>
<file>adapter.c</file>
<file>drm.c</file>
<file>stubs.c</file>
<file>portcls.rc</file>
</module>

View File

@@ -1,5 +0,0 @@
#define REACTOS_VERSION_DLL
#define REACTOS_STR_FILE_DESCRIPTION "PORTCLS Port Class Driver API\0"
#define REACTOS_STR_INTERNAL_NAME "portcls\0"
#define REACTOS_STR_ORIGINAL_FILENAME "portcls.sys\0"
#include <reactos/version.rc>

View File

@@ -1,338 +0,0 @@
/*
Port Class API
Stubbed functions
*/
#include <portcls.h>
/*
Factory Stubs
*/
/*
* @unimplemented
*/
PORTCLASSAPI NTSTATUS NTAPI
PcNewDmaChannel(
OUT PDMACHANNEL* OutDmaChannel,
IN PUNKNOWN OuterUnknown OPTIONAL,
IN POOL_TYPE PoolType,
IN PDEVICE_DESCRIPTION DeviceDescription,
IN PDEVICE_OBJECT DeviceObject)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
PORTCLASSAPI NTSTATUS NTAPI
PcNewInterruptSync(
OUT PINTERRUPTSYNC* OUtInterruptSync,
IN PUNKNOWN OuterUnknown OPTIONAL,
IN PRESOURCELIST ResourceList,
IN ULONG ResourceIndex,
IN INTERRUPTSYNCMODE Mode)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
PORTCLASSAPI NTSTATUS NTAPI
PcNewMiniport(
OUT PMINIPORT* OutMiniport,
IN REFCLSID ClassId)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
PORTCLASSAPI NTSTATUS NTAPI
PcNewPort(
OUT PPORT* OutPort,
IN REFCLSID ClassId)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
PORTCLASSAPI NTSTATUS NTAPI
PcNewRegistryKey(
OUT PREGISTRYKEY* OutRegistryKey,
IN PUNKNOWN OuterUnknown OPTIONAL,
IN ULONG RegistryKeyType,
IN ACCESS_MASK DesiredAccess,
IN PVOID DeviceObject OPTIONAL,
IN PVOID SubDevice OPTIONAL,
IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
IN ULONG CreateOptions OPTIONAL,
OUT PULONG Disposition OPTIONAL)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
PORTCLASSAPI NTSTATUS NTAPI
PcNewResourceList(
OUT PRESOURCELIST* OutResourceList,
IN PUNKNOWN OuterUnknown OPTIONAL,
IN POOL_TYPE PoolType,
IN PCM_RESOURCE_LIST TranslatedResources,
IN PCM_RESOURCE_LIST UntranslatedResources)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
PORTCLASSAPI NTSTATUS NTAPI
PcNewResourceSublist(
OUT PRESOURCELIST* OutResourceList,
IN PUNKNOWN OuterUnknown OPTIONAL,
IN POOL_TYPE PoolType,
IN PRESOURCELIST ParentList,
IN ULONG MaximumEntries)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
PORTCLASSAPI NTSTATUS NTAPI
PcNewServiceGroup(
OUT PSERVICEGROUP* OutServiceGroup,
IN PUNKNOWN OuterUnknown OPTIONAL)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/* ===============================================================
IRP Handling
*/
/*
* @unimplemented
*/
PORTCLASSAPI NTSTATUS NTAPI
PcDispatchIrp(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
PORTCLASSAPI NTSTATUS NTAPI
PcCompleteIrp(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp,
IN NTSTATUS Status)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
PORTCLASSAPI NTSTATUS NTAPI
PcForwardIrpSynchronous(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/* ===============================================================
Power Management
*/
/*
* @unimplemented
*/
PORTCLASSAPI NTSTATUS NTAPI
PcRegisterAdapterPowerManagement(
IN PUNKNOWN pUnknown,
IN PVOID pvContext1)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
PORTCLASSAPI NTSTATUS NTAPI
PcRequestNewPowerState(
IN PDEVICE_OBJECT pDeviceObject,
IN DEVICE_POWER_STATE RequestedNewState)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/* ===============================================================
Properties
*/
/*
* @unimplemented
*/
PORTCLASSAPI NTSTATUS NTAPI
PcGetDeviceProperty(
IN PVOID DeviceObject,
IN DEVICE_REGISTRY_PROPERTY DeviceProperty,
IN ULONG BufferLength,
OUT PVOID PropertyBuffer,
OUT PULONG ResultLength)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
PORTCLASSAPI NTSTATUS NTAPI
PcCompletePendingPropertyRequest(
IN PPCPROPERTY_REQUEST PropertyRequest,
IN NTSTATUS NtStatus)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/* ===============================================================
I/O Timeouts
*/
/*
* @unimplemented
*/
PORTCLASSAPI NTSTATUS NTAPI
PcRegisterIoTimeout(
IN PDEVICE_OBJECT pDeviceObject,
IN PIO_TIMER_ROUTINE pTimerRoutine,
IN PVOID pContext)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
PORTCLASSAPI NTSTATUS NTAPI
PcUnregisterIoTimeout(
IN PDEVICE_OBJECT pDeviceObject,
IN PIO_TIMER_ROUTINE pTimerRoutine,
IN PVOID pContext)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/* ===============================================================
Physical Connections
*/
/*
* @unimplemented
*/
PORTCLASSAPI NTSTATUS NTAPI
PcRegisterPhysicalConnection(
IN PDEVICE_OBJECT DeviceObject,
IN PUNKNOWN FromUnknown,
IN ULONG FromPin,
IN PUNKNOWN ToUnknown,
IN ULONG ToPin)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
PORTCLASSAPI NTSTATUS NTAPI
PcRegisterPhysicalConnectionFromExternal(
IN PDEVICE_OBJECT DeviceObject,
IN PUNICODE_STRING FromString,
IN ULONG FromPin,
IN PUNKNOWN ToUnknown,
IN ULONG ToPin)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
PORTCLASSAPI NTSTATUS NTAPI
PcRegisterPhysicalConnectionToExternal(
IN PDEVICE_OBJECT DeviceObject,
IN PUNKNOWN FromUnknown,
IN ULONG FromPin,
IN PUNICODE_STRING ToString,
IN ULONG ToPin)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/* ===============================================================
Misc
*/
/*
* @unimplemented
*/
PORTCLASSAPI ULONGLONG NTAPI
PcGetTimeInterval(
IN ULONGLONG Since)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
* @unimplemented
*/
PORTCLASSAPI NTSTATUS NTAPI
PcRegisterSubdevice(
IN PDEVICE_OBJECT DeviceObject,
IN PWCHAR Name,
IN PUNKNOWN Unknown)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}

View File

@@ -1,70 +0,0 @@
/* ===============================================================
Allocator Functions
*/
#include <ks.h>
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsCreateAllocator(
IN HANDLE ConnectionHandle,
IN PKSALLOCATOR_FRAMING AllocatorFraming,
OUT PHANDLE AllocatorHandle)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsCreateDefaultAllocator(
IN PIRP Irp)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsValidateAllocatorCreateRequest(
IN PIRP Irp,
OUT PKSALLOCATOR_FRAMING* AllocatorFraming)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsCreateDefaultAllocatorEx(
IN PIRP Irp,
IN PVOID InitializeContext OPTIONAL,
IN PFNKSDEFAULTALLOCATE DefaultAllocate OPTIONAL,
IN PFNKSDEFAULTFREE DefaultFree OPTIONAL,
IN PFNKSINITIALIZEALLOCATOR InitializeAllocator OPTIONAL,
IN PFNKSDELETEALLOCATOR DeleteAllocator OPTIONAL)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsValidateAllocatorFramingEx(
IN PKSALLOCATOR_FRAMING_EX Framing,
IN ULONG BufferSize,
IN const KSALLOCATOR_FRAMING_EX* PinFraming)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}

View File

@@ -1,124 +0,0 @@
/* ===============================================================
Clock Functions
*/
#include <ks.h>
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsCreateClock(
IN HANDLE ConnectionHandle,
IN PKSCLOCK_CREATE ClockCreate,
OUT PHANDLE ClockHandle)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsCreateDefaultClock(
IN PIRP Irp,
IN PKSDEFAULTCLOCK DefaultClock)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsAllocateDefaultClock(
OUT PKSDEFAULTCLOCK* DefaultClock)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsAllocateDefaultClockEx(
OUT PKSDEFAULTCLOCK* DefaultClock,
IN PVOID Context OPTIONAL,
IN PFNKSSETTIMER SetTimer OPTIONAL,
IN PFNKSCANCELTIMER CancelTimer OPTIONAL,
IN PFNKSCORRELATEDTIME CorrelatedTime OPTIONAL,
IN const KSRESOLUTION* Resolution OPTIONAL,
IN ULONG Flags)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI VOID NTAPI
KsFreeDefaultClock(
IN PKSDEFAULTCLOCK DefaultClock)
{
UNIMPLEMENTED;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsValidateClockCreateRequest(
IN PIRP Irp,
OUT PKSCLOCK_CREATE* ClockCreate)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI KSSTATE NTAPI
KsGetDefaultClockState(
IN PKSDEFAULTCLOCK DefaultClock)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI VOID NTAPI
KsSetDefaultClockState(
IN PKSDEFAULTCLOCK DefaultClock,
IN KSSTATE State)
{
UNIMPLEMENTED;
}
/*
@unimplemented
*/
KSDDKAPI LONGLONG NTAPI
KsGetDefaultClockTime(
IN PKSDEFAULTCLOCK DefaultClock)
{
UNIMPLEMENTED;
return 0;
}
/*
@unimplemented
*/
KSDDKAPI VOID NTAPI
KsSetDefaultClockTime(
IN PKSDEFAULTCLOCK DefaultClock,
IN LONGLONG Time)
{
UNIMPLEMENTED;
}

View File

@@ -1,64 +0,0 @@
/*
KsCreatePin
KsValidateConnectRequest
KsPinPropertyHandler
KsPinDataIntersection
KsHandleSizedListQuery
*/
#include <ks.h>
KSDDKAPI NTSTATUS NTAPI
KsCreatePin(
IN HANDLE FilterHandle,
IN PKSPIN_CONNECT Connect,
IN ACCESS_MASK DesiredAccess,
OUT PHANDLE ConnectionHandle)
{
return STATUS_SUCCESS;
}
KSDDKAPI NTSTATUS NTAPI
KsValidateConnectRequest(
IN PIRP Irp,
IN ULONG DescriptorsCount,
IN KSPIN_DESCRIPTOR* Descriptor,
OUT PKSPIN_CONNECT* Connect)
{
return STATUS_SUCCESS;
}
KSDDKAPI NTSTATUS NTAPI
KsPinPropertyHandler(
IN PIRP Irp,
IN PKSPROPERTY Property,
IN OUT PVOID Data,
IN ULONG DescriptorsCount,
IN const KSPIN_DESCRIPTOR* Descriptor)
{
return STATUS_SUCCESS;
}
KSDDKAPI NTSTATUS NTAPI
KsPinDataIntersection(
IN PIRP Irp,
IN PKSPIN Pin,
OUT PVOID Data,
IN ULONG DescriptorsCount,
IN const KSPIN_DESCRIPTOR* Descriptor,
IN PFNKSINTERSECTHANDLER IntersectHandler)
{
return STATUS_SUCCESS;
}
/* Does this belong here? */
KSDDKAPI NTSTATUS NTAPI
KsHandleSizedListQuery(
IN PIRP Irp,
IN ULONG DataItemsCount,
IN ULONG DataItemSize,
IN const VOID* DataItems)
{
return STATUS_SUCCESS;
}

View File

@@ -1,100 +0,0 @@
#include <ks.h>
/* ===============================================================
Event Functions
*/
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsGenerateEvent(
IN PKSEVENT_ENTRY EntryEvent)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsEnableEventWithAllocator(
IN PIRP Irp,
IN ULONG EventSetsCount,
IN PKSEVENT_SET EventSet,
IN OUT PLIST_ENTRY EventsList OPTIONAL,
IN KSEVENTS_LOCKTYPE EventsFlags OPTIONAL,
IN PVOID EventsLock OPTIONAL,
IN PFNKSALLOCATOR Allocator OPTIONAL,
IN ULONG EventItemSize OPTIONAL)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsGenerateDataEvent(
IN PKSEVENT_ENTRY EventEntry,
IN ULONG DataSize,
IN PVOID Data)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsEnableEvent(
IN PIRP Irp,
IN ULONG EventSetsCount,
IN KSEVENT_SET* EventSet,
IN OUT PLIST_ENTRY EventsList OPTIONAL,
IN KSEVENTS_LOCKTYPE EventsFlags OPTIONAL,
IN PVOID EventsLock OPTIONAL)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI VOID NTAPI
KsDiscardEvent(
IN PKSEVENT_ENTRY EventEntry)
{
UNIMPLEMENTED;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsDisableEvent(
IN PIRP Irp,
IN OUT PLIST_ENTRY EventsList,
IN KSEVENTS_LOCKTYPE EventsFlags,
IN PVOID EventsLock)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI VOID NTAPI
KsFreeEventList(
IN PFILE_OBJECT FileObject,
IN OUT PLIST_ENTRY EventsList,
IN KSEVENTS_LOCKTYPE EVentsFlags,
IN PVOID EventsLock)
{
UNIMPLEMENTED;
}

View File

@@ -1,479 +0,0 @@
/*
ReactOS Kernel Streaming
IRP Helpers
*/
#include <ks.h>
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsAcquireResetValue(
IN PIRP Irp,
OUT KSRESET* ResetValue)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI VOID NTAPI
KsAddIrpToCancelableQueue(
IN OUT PLIST_ENTRY QueueHead,
IN PKSPIN_LOCK SpinLock,
IN PIRP Irp,
IN KSLIST_ENTRY_LOCATION ListLocation,
IN PDRIVER_CANCEL DriverCancel OPTIONAL)
{
UNIMPLEMENTED;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsAddObjectCreateItemToDeviceHeader(
IN KSDEVICE_HEADER Header,
IN PDRIVER_DISPATCH Create,
IN PVOID Context,
IN PWCHAR ObjectClass,
IN PSECURITY_DESCRIPTOR SecurityDescriptor)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsAddObjectCreateItemToObjectHeader(
IN KSOBJECT_HEADER Header,
IN PDRIVER_DISPATCH Create,
IN PVOID Context,
IN PWCHAR ObjectClass,
IN PSECURITY_DESCRIPTOR SecurityDescriptor)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsAllocateDeviceHeader(
OUT PVOID Header,
IN ULONG ItemsCount,
IN PKSOBJECT_CREATE_ITEM ItemsList OPTIONAL)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsAllocateExtraData(
IN PIRP Irp,
IN ULONG ExtraSize,
OUT PVOID* ExtraBuffer)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsAllocateObjectCreateItem(
IN KSDEVICE_HEADER Header,
IN PKSOBJECT_CREATE_ITEM CreateItem,
IN BOOL AllocateEntry,
IN PFNKSITEMFREECALLBACK ItemFreeCallback OPTIONAL)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsAllocateObjectHeader(
OUT PVOID Header,
IN ULONG ItemsCount,
IN PKSOBJECT_CREATE_ITEM ItemsList OPTIONAL,
IN PIRP Irp,
IN KSDISPATCH_TABLE* Table)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI VOID NTAPI
KsCancelIo(
IN OUT PLIST_ENTRY QueueHead,
IN PKSPIN_LOCK SpinLock)
{
UNIMPLEMENTED;
}
/*
@unimplemented
*/
KSDDKAPI VOID NTAPI
KsCancelRoutine(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
UNIMPLEMENTED;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsDefaultDeviceIoCompletion(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI BOOLEAN NTAPI
KsDispatchFastIoDeviceControlFailure(
IN PFILE_OBJECT FileObject,
IN BOOLEAN Wait,
IN PVOID InputBuffer OPTIONAL,
IN ULONG InputBufferLength,
OUT PVOID OutputBuffer OPTIONAL,
IN ULONG OutputBufferLength,
IN ULONG IoControlCode,
OUT PIO_STATUS_BLOCK IoStatus,
IN PDEVICE_OBJECT DeviceObject) /* always return false */
{
return FALSE;
}
/*
@unimplemented
*/
KSDDKAPI BOOLEAN NTAPI
KsDispatchFastReadFailure(
IN PFILE_OBJECT FileObject,
IN PLARGE_INTEGER FileOffset,
IN ULONG Length,
IN BOOLEAN Wait,
IN ULONG LockKey,
OUT PVOID Buffer,
OUT PIO_STATUS_BLOCK IoStatus,
IN PDEVICE_OBJECT DeviceObject) /* always return false */
{
return FALSE;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsDispatchInvalidDeviceRequest(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsDispatchIrp(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsDispatchSpecificMethod(
IN PIRP Irp,
IN PFNKSHANDLER Handler)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsDispatchSpecificProperty(
IN PIRP Irp,
IN PFNKSHANDLER Handler)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsForwardAndCatchIrp(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp,
IN PFILE_OBJECT FileObject,
IN KSSTACK_USE StackUse)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsForwardIrp(
IN PIRP Irp,
IN PFILE_OBJECT FileObject,
IN BOOLEAN ReuseStackLocation)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI VOID NTAPI
KsFreeDeviceHeader(
IN PVOID Header)
{
UNIMPLEMENTED;
}
/*
@unimplemented
*/
KSDDKAPI VOID NTAPI
KsFreeObjectHeader(
IN PVOID Header)
{
UNIMPLEMENTED;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsGetChildCreateParameter(
IN PIRP Irp,
OUT PVOID* CreateParameter)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsMoveIrpsOnCancelableQueue(
IN OUT PLIST_ENTRY SourceList,
IN PKSPIN_LOCK SourceLock,
IN OUT PLIST_ENTRY DestinationList,
IN PKSPIN_LOCK DestinationLock OPTIONAL,
IN KSLIST_ENTRY_LOCATION ListLocation,
IN PFNKSIRPLISTCALLBACK ListCallback,
IN PVOID Context)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsProbeStreamIrp(
IN PIRP Irp,
IN ULONG ProbeFlags,
IN ULONG HeaderSize)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsQueryInformationFile(
IN PFILE_OBJECT FileObject,
OUT PVOID FileInformation,
IN ULONG Length,
IN FILE_INFORMATION_CLASS FileInformationClass)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI ACCESS_MASK NTAPI
KsQueryObjectAccessMask(
IN KSOBJECT_HEADER Header)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI PKSOBJECT_CREATE_ITEM NTAPI
KsQueryObjectCreateItem(
IN KSOBJECT_HEADER Header)
{
UNIMPLEMENTED;
/* return STATUS_UNSUCCESSFUL; */
return NULL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsReadFile(
IN PFILE_OBJECT FileObject,
IN PKEVENT Event OPTIONAL,
IN PVOID PortContext OPTIONAL,
OUT PIO_STATUS_BLOCK IoStatusBlock,
OUT PVOID Buffer,
IN ULONG Length,
IN ULONG Key OPTIONAL,
IN KPROCESSOR_MODE RequestorMode)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI VOID NTAPI
KsReleaseIrpOnCancelableQueue(
IN PIRP Irp,
IN PDRIVER_CANCEL DriverCancel OPTIONAL)
{
UNIMPLEMENTED;
}
/*
@unimplemented
*/
KSDDKAPI PIRP NTAPI
KsRemoveIrpFromCancelableQueue(
IN OUT PLIST_ENTRY QueueHead,
IN PKSPIN_LOCK SpinLock,
IN KSLIST_ENTRY_LOCATION ListLocation,
IN KSIRP_REMOVAL_OPERATION RemovalOperation)
{
UNIMPLEMENTED;
return NULL;
/*return STATUS_UNSUCCESSFUL; */
}
/*
@unimplemented
*/
KSDDKAPI VOID NTAPI
KsRemoveSpecificIrpFromCancelableQueue(
IN PIRP Irp)
{
UNIMPLEMENTED;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsSetInformationFile(
IN PFILE_OBJECT FileObject,
IN PVOID FileInformation,
IN ULONG Length,
IN FILE_INFORMATION_CLASS FileInformationClass)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsSetMajorFunctionHandler(
IN PDRIVER_OBJECT DriverObject,
IN ULONG MajorFunction)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsStreamIo(
IN PFILE_OBJECT FileObject,
IN PKEVENT Event OPTIONAL,
IN PVOID PortContext OPTIONAL,
IN PIO_COMPLETION_ROUTINE CompletionRoutine OPTIONAL,
IN PVOID CompletionContext OPTIONAL,
IN KSCOMPLETION_INVOCATION CompletionInvocationFlags OPTIONAL,
OUT PIO_STATUS_BLOCK IoStatusBlock,
IN OUT PVOID StreamHeaders,
IN ULONG Length,
IN ULONG Flags,
IN KPROCESSOR_MODE RequestorMode)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsWriteFile(
IN PFILE_OBJECT FileObject,
IN PKEVENT Event OPTIONAL,
IN PVOID PortContext OPTIONAL,
OUT PIO_STATUS_BLOCK IoStatusBlock,
IN PVOID Buffer,
IN ULONG Length,
IN ULONG Key OPTIONAL,
IN KPROCESSOR_MODE RequestorMode)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}

View File

@@ -1,111 +0,0 @@
;
; Exports definition file for ks.sys
;
EXPORTS
KsCreateAllocator@12
KsCreateDefaultAllocator@4
KsValidateAllocatorCreateRequest@8
KsCreateDefaultAllocatorEx@24
KsValidateAllocatorFramingEx@12
KsCreateClock@12
KsCreateDefaultClock@8
KsAllocateDefaultClock@4
KsAllocateDefaultClockEx@28
KsFreeDefaultClock@4
KsValidateClockCreateRequest@8
KsGetDefaultClockState@4
KsSetDefaultClockState@8
KsGetDefaultClockTime@4
KsSetDefaultClockTime@12
KsMethodHandler@12
KsMethodHandlerWithAllocator@20
KsFastMethodHandler@32
KsPropertyHandler@12
KsPropertyHandlerWithAllocator@20
KsUnserializeObjectPropertiesFromRegistry@12
KsFastPropertyHandler@32
KsGenerateEvent@4
KsEnableEventWithAllocator@32
KsGenerateDataEvent@12
KsEnableEvent@24
KsDiscardEvent@4
KsDisableEvent@16
KsFreeEventList@16
KsValidateTopologyNodeCreateRequest@12
KsCreateTopologyNode@16
KsTopologyPropertyHandler@16
KsCreatePin@16
KsValidateConnectRequest@16
KsPinPropertyHandler@20
KsPinDataIntersection@24
KsHandleSizedListQuery@16
KsAcquireResetValue@8
KsAddIrpToCancelableQueue@20
KsAddObjectCreateItemToDeviceHeader@20
KsAddObjectCreateItemToObjectHeader@20
KsAllocateDeviceHeader@12
KsAllocateExtraData@12
KsAllocateObjectCreateItem@16
KsAllocateObjectHeader@20
KsCancelIo@8
KsCancelRoutine@8
KsDefaultDeviceIoCompletion@8
KsDispatchFastIoDeviceControlFailure@36
KsDispatchFastReadFailure@32
; KsDispatchFastWriteFailure@32
KsDispatchInvalidDeviceRequest@8
KsDispatchIrp@8
KsDispatchSpecificMethod@8
KsDispatchSpecificProperty@8
KsForwardAndCatchIrp@16
KsForwardIrp@12
KsFreeDeviceHeader@4
KsFreeObjectHeader@4
KsGetChildCreateParameter@8
KsMoveIrpsOnCancelableQueue@28
KsProbeStreamIrp@12
KsQueryInformationFile@16
KsQueryObjectAccessMask@4
KsQueryObjectCreateItem@4
KsReadFile@32
KsReleaseIrpOnCancelableQueue@8
KsRemoveIrpFromCancelableQueue@16
KsRemoveSpecificIrpFromCancelableQueue@4
KsSetInformationFile@16
KsSetMajorFunctionHandler@8
KsStreamIo@44
KsWriteFile@32
KsRegisterWorker@8
KsUnregisterWorker@4
KsRegisterCountedWorker@12
KsDecrementCountedWorker@4
KsIncrementCountedWorker@4
KsQueueWorkItem@8
KsCacheMedium@12
KsDefaultDispatchPnp@8
KsSetDevicePnpAndBaseObject@12
KsDefaultDispatchPower@8
KsSetPowerDispatch@12
KsReferenceBusObject@4
KsDereferenceBusObject@4
KsFreeObjectCreateItem@8
KsFreeObjectCreateItemsByContext@8
KsLoadResource@24
; KsNullDriverUnload@4
KsPinDataIntersectionEx@32
KsQueryDevicePnpObject@4
KsRecalculateStackDepth@8
KsSetTargetDeviceObject@8
KsSetTargetState@8
KsSynchronousIoControlDevice@32

View File

@@ -1,20 +0,0 @@
<module name="ks" type="exportdriver" installbase="system32/drivers" installname="ks.sys" allowwarnings="true">
<include base="ks">.</include>
<include base="ks">..</include>
<include base="ks">../include</include>
<importlibrary definition="ks.def" />
<library>ntoskrnl</library>
<define name="__USE_W32API" />
<define name="BUILDING_KS" />
<file>ks.rc</file>
<file>allocators.c</file>
<file>clocks.c</file>
<file>connectivity.c</file>
<file>events.c</file>
<file>irp.c</file>
<file>methods.c</file>
<file>misc.c</file>
<file>properties.c</file>
<file>topology.c</file>
<file>worker.c</file>
</module>

View File

@@ -1,5 +0,0 @@
#define REACTOS_VERSION_DLL
#define REACTOS_STR_FILE_DESCRIPTION "Kernel Streaming API\0"
#define REACTOS_STR_INTERNAL_NAME "ks\0"
#define REACTOS_STR_ORIGINAL_FILENAME "ks.sys\0"
#include <reactos/version.rc>

View File

@@ -1,51 +0,0 @@
/* ===============================================================
Method Functions
*/
#include <ks.h>
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsMethodHandler(
IN PIRP Irp,
IN ULONG MethodSetsCount,
IN PKSMETHOD_SET MethodSet)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsMethodHandlerWithAllocator(
IN PIRP Irp,
IN ULONG MethodSetsCount,
IN PKSMETHOD_SET MethodSet,
IN PFNKSALLOCATOR Allocator OPTIONAL,
IN ULONG MethodItemSize OPTIONAL)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI BOOLEAN NTAPI
KsFastMethodHandler(
IN PFILE_OBJECT FileObject,
IN PKSMETHOD UNALIGNED Method,
IN ULONG MethodLength,
IN OUT PVOID UNALIGNED Data,
IN ULONG DataLength,
OUT PIO_STATUS_BLOCK IoStatus,
IN ULONG MethodSetsCount,
IN const KSMETHOD_SET* MethodSet)
{
UNIMPLEMENTED;
return FALSE;
}

View File

@@ -1,218 +0,0 @@
#include <ks.h>
/* ===============================================================
Misc. Helper Functions
*/
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsCacheMedium(
IN PUNICODE_STRING SymbolicLink,
IN PKSPIN_MEDIUM Medium,
IN DWORD PinDirection)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsDefaultDispatchPnp(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI VOID NTAPI
KsSetDevicePnpAndBaseObject(
IN KSDEVICE_HEADER Header,
IN PDEVICE_OBJECT PnpDeviceObject,
IN PDEVICE_OBJECT BaseDevice)
{
UNIMPLEMENTED;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsDefaultDispatchPower(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI VOID NTAPI
KsSetPowerDispatch(
IN KSOBJECT_HEADER Header,
IN PFNKSCONTEXT_DISPATCH PowerDispatch OPTIONAL,
IN PVOID PowerContext OPTIONAL)
{
UNIMPLEMENTED;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsReferenceBusObject(
IN KSDEVICE_HEADER Header)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI VOID NTAPI
KsDereferenceBusObject(
IN KSDEVICE_HEADER Header)
{
UNIMPLEMENTED;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsFreeObjectCreateItem(
IN KSDEVICE_HEADER Header,
IN PUNICODE_STRING CreateItem)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsFreeObjectCreateItemsByContext(
IN KSDEVICE_HEADER Header,
IN PVOID Context)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsLoadResource(
IN PVOID ImageBase,
IN POOL_TYPE PoolType,
IN ULONG_PTR ResourceName,
IN ULONG ResourceType,
OUT PVOID* Resource,
OUT PULONG ResourceSize)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
VOID
KsNullDriverUnload(
IN PDRIVER_OBJECT DriverObject)
{
UNIMPLEMENTED;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsPinDataIntersectionEx(
IN PIRP Irp,
IN PKSP_PIN Pin,
OUT PVOID Data,
IN ULONG DescriptorsCount,
IN const KSPIN_DESCRIPTOR* Descriptor,
IN ULONG DescriptorSize,
IN PFNKSINTERSECTHANDLEREX IntersectHandler OPTIONAL,
IN PVOID HandlerContext OPTIONAL)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI PDEVICE_OBJECT NTAPI
KsQueryDevicePnpObject(
IN KSDEVICE_HEADER Header)
{
UNIMPLEMENTED;
return NULL;
}
/*
@unimplemented
*/
KSDDKAPI VOID NTAPI
KsRecalculateStackDepth(
IN KSDEVICE_HEADER Header,
IN BOOLEAN ReuseStackLocation)
{
UNIMPLEMENTED;
}
/*
@unimplemented
*/
KSDDKAPI VOID NTAPI
KsSetTargetDeviceObject(
IN KSOBJECT_HEADER Header,
IN PDEVICE_OBJECT TargetDevice OPTIONAL)
{
UNIMPLEMENTED;
}
/*
@unimplemented
*/
KSDDKAPI VOID NTAPI
KsSetTargetState(
IN KSOBJECT_HEADER Header,
IN KSTARGET_STATE TargetState)
{
UNIMPLEMENTED;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsSynchronousIoControlDevice(
IN PFILE_OBJECT FileObject,
IN KPROCESSOR_MODE RequestorMode,
IN DWORD IoControl,
IN PVOID InBuffer,
IN ULONG InSize,
OUT PVOID OutBuffer,
IN ULONG OUtSize,
OUT PULONG BytesReturned)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}

View File

@@ -1,64 +0,0 @@
#include <ks.h>
/* ===============================================================
Property Functions
*/
/*
@unimplemented
*/
KSDDKAPI BOOLEAN NTAPI
KsFastPropertyHandler(
IN PFILE_OBJECT FileObject,
IN PKSPROPERTY UNALIGNED Property,
IN ULONG PropertyLength,
IN OUT PVOID UNALIGNED Data,
IN ULONG DataLength,
OUT PIO_STATUS_BLOCK IoStatus,
IN ULONG PropertySetsCount,
IN const KSPROPERTY_SET* PropertySet)
{
UNIMPLEMENTED;
return FALSE;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsPropertyHandler(
IN PIRP Irp,
IN ULONG PropertySetsCount,
IN const KSPROPERTY_SET* PropertySet)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsPropertyHandlerWithAllocator(
IN PIRP Irp,
IN ULONG PropertySetsCount,
IN PKSPROPERTY_SET PropertySet,
IN PFNKSALLOCATOR Allocator OPTIONAL,
IN ULONG PropertyItemSize OPTIONAL)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsUnserializeObjectPropertiesFromRegistry(
IN PFILE_OBJECT FileObject,
IN HANDLE ParentKey OPTIONAL,
IN PUNICODE_STRING RegistryPath OPTIONAL)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}

View File

@@ -1,46 +0,0 @@
#include <ks.h>
/* ===============================================================
Topology Functions
*/
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsCreateTopologyNode(
IN HANDLE ParentHandle,
IN PKSNODE_CREATE NodeCreate,
IN ACCESS_MASK DesiredAccess,
OUT PHANDLE NodeHandle)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsValidateTopologyNodeCreateRequest(
IN PIRP Irp,
IN PKSTOPOLOGY Topology,
OUT PKSNODE_CREATE* NodeCreate)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsTopologyPropertyHandler(
IN PIRP Irp,
IN PKSPROPERTY Property,
IN OUT PVOID Data,
IN const KSTOPOLOGY* Topology)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}

View File

@@ -1,74 +0,0 @@
/* ===============================================================
Worker Management Functions
*/
#include <ks.h>
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsRegisterWorker(
IN WORK_QUEUE_TYPE WorkQueueType,
OUT PKSWORKER* Worker)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI VOID NTAPI
KsUnregisterWorker(
IN PKSWORKER Worker)
{
UNIMPLEMENTED;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsRegisterCountedWorker(
IN WORK_QUEUE_TYPE WorkQueueType,
IN PWORK_QUEUE_ITEM CountedWorkItem,
OUT PKSWORKER* Worker)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}
/*
@unimplemented
*/
KSDDKAPI ULONG NTAPI
KsDecrementCountedWorker(
IN PKSWORKER Worker)
{
UNIMPLEMENTED;
return 0;
}
/*
@unimplemented
*/
KSDDKAPI ULONG NTAPI
KsIncrementCountedWorker(
IN PKSWORKER Worker)
{
UNIMPLEMENTED;
return 0;
}
/*
@unimplemented
*/
KSDDKAPI NTSTATUS NTAPI
KsQueueWorkItem(
IN PKSWORKER Worker,
IN PWORK_QUEUE_ITEM WorkItem)
{
UNIMPLEMENTED;
return STATUS_UNSUCCESSFUL;
}

View File

View File

View File

View File

View File

@@ -1,15 +1,15 @@
#include <windows.h>
#include <ddraw.h>
LPDIRECTDRAW7 DirectDraw = NULL;
LPDIRECTDRAWSURFACE7 FrontBuffer = NULL;
LPDIRECTDRAWCLIPPER Clipper = NULL;
LPDIRECTDRAW7 DirectDraw;
LPDIRECTDRAWSURFACE7 FrontBuffer;
LPDIRECTDRAWCLIPPER Clipper;
PCHAR DDErrorString (HRESULT hResult);
LONG WINAPI WndProc (HWND hwnd, UINT message, UINT wParam, LONG lParam);
bool Fullscreen, Running;
//#define USE_CLIPPER
bool Init (HWND hwnd)
{
@@ -69,7 +69,6 @@ bool Init (HWND hwnd)
return 0;
}
#ifdef USE_CLIPPER
// Set up the clipper
OutputDebugString("=> DDraw->CreateClipper\n");
@@ -95,16 +94,13 @@ bool Init (HWND hwnd)
MessageBox(0,DDErrorString(hResult), "FrontBuffer->SetClipper", 0);
return 0;
}
#endif
return true;
}
void Draw (HWND hwnd)
void Draw (void)
{
// Make the frontbuffer pink
RECT rect;
GetWindowRect(hwnd, &rect); // this is not necessary when clippper is used
// Make the fronbuffer pink
DDBLTFX ddbltfx;
ddbltfx.dwSize = sizeof(DDBLTFX);
@@ -112,7 +108,7 @@ void Draw (HWND hwnd)
OutputDebugString("=> Surface->Blt (DDBLT_COLORFILL)\n");
FrontBuffer->Blt(&rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx);
FrontBuffer->Blt(NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx);
}
void CleanUp (void)
@@ -162,11 +158,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
HWND hwnd = CreateWindow("DDrawDemo",
"ReactOS DirectDraw Demo",
#ifdef USE_CLIPPER
Fullscreen ? WS_POPUP :WS_OVERLAPPEDWINDOW,
#else
WS_POPUP,
#endif
CW_USEDEFAULT,
CW_USEDEFAULT,
800,
@@ -187,7 +179,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
while (Running)
{
if(Fullscreen)
Draw(hwnd);
Draw();
if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
@@ -211,7 +203,7 @@ LONG WINAPI WndProc (HWND hwnd, UINT message,
case WM_PAINT:
{
if(!Fullscreen)
Draw(hwnd);
Draw();
} break;
case WM_KEYDOWN:

View File

@@ -1,17 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "misc.h"
#include "any_op.h"
CPU_INT AnyalsingProcess()
{
/* FIXME it will set a name to the memory if we got one */
/* FIXME build the jump table */
return 0;
}

View File

@@ -1,261 +0,0 @@
#include <windows.h>
#include <winnt.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "misc.h"
#include "any_op.h"
/*
* eax = register 3
* edx = register 4
* esp = register 1
* ebp = register 31
* ecx = 8
* ebx = 9
* esi = 10
* edi = 11
* mmx/sse/fpu 0 = 12
* mmx/sse/fpu 1 = 14
* mmx/sse/fpu 2 = 16
* mmx/sse/fpu 3 = 18
* mmx/sse/fpu 4 = 20
* mmx/sse/fpu 5 = 22
* mmx/sse/fpu 6 = 24
* mmx/sse/fpu 7 = 28
*/
static void standardreg(CPU_INT *RegTableCount, CPU_INT reg, CPU_INT setup_ebp, FILE *outfp)
{
/* eax */
if (reg == RegTableCount[3])
{
fprintf(outfp,"eax");
}
/* ebp */
else if (reg == RegTableCount[31])
{
fprintf(outfp,"ebp");
}
/* edx */
else if (reg == RegTableCount[4])
{
fprintf(outfp,"edx");
}
/* esp */
else if (reg == RegTableCount[1])
{
fprintf(outfp,"esp");
}
/* ecx */
else if (reg == RegTableCount[8])
{
fprintf(outfp,"ecx");
}
/* ebx */
else if (reg == RegTableCount[9])
{
fprintf(outfp,"ebx");
}
/* esi */
else if (reg == RegTableCount[10])
{
fprintf(outfp,"esi");
}
/* edi */
else if (reg == RegTableCount[11])
{
fprintf(outfp,"edi");
}
else
{
if (setup_ebp == 1)
fprintf(outfp,"dword [ebx - %d]");
else
fprintf(outfp,"; unsuported should not happen it happen :(\n");
}
}
CPU_INT ConvertToIA32Process( FILE *outfp,
PMYBrainAnalys pMystart,
PMYBrainAnalys pMyend, CPU_INT regbits,
CPU_INT HowManyRegInUse,
CPU_INT *RegTableCount)
{
CPU_INT stack = 0;
CPU_UNINT tmp;
CPU_INT setup_ebp = 0 ; /* 0 = no, 1 = yes */
CPU_INT t=0;
/* Fixme optimze the RegTableCount table */
//if (HowManyRegInUse > 9)
if (HowManyRegInUse > 8)
{
setup_ebp =1; /* we will use ebx as ebp */
stack = HowManyRegInUse * regbits;
}
if (RegTableCount[1]!=0)
t++;
if (RegTableCount[3]!=0)
t++;
if (RegTableCount[4]!=0)
t++;
if (RegTableCount[8]!=0)
t++;
if (RegTableCount[9]!=0)
t++;
if (RegTableCount[10]!=0)
t++;
if (RegTableCount[11]!=0)
t++;
if (RegTableCount[31]!=0)
t++;
if (HowManyRegInUse != t)
{
/* fixme optimze the table or active the frame pointer */
setup_ebp =1; /* we will use ebx as ebp */
stack = HowManyRegInUse * regbits;
}
fprintf(outfp,"BITS 32\n");
fprintf(outfp,"GLOBAL _main\n");
fprintf(outfp,"SECTION .text\n\n");
fprintf(outfp,"; compile with nasm filename.asm -f win32, ld filename.obj -o filename.exe\n\n");
fprintf(outfp,"_main:\n");
/* setup a frame pointer */
if (setup_ebp == 1)
{
fprintf(outfp,"\n; Setup frame pointer \n");
fprintf(outfp,"push ebx\n");
fprintf(outfp,"mov ebx,esp\n");
fprintf(outfp,"sub esp, %d ; Alloc %d bytes for reg\n\n",stack,stack);
}
fprintf(outfp,"; Start the program \n");
while (pMystart!=NULL)
{
/* fixme the line lookup from anaylysing process */
/* mov not full implement */
if (pMystart->op == OP_ANY_mov)
{
printf("waring OP_ANY_mov are not full implement\n");
if ((pMystart->type & 8)== 8)
{
/* dst are register */
tmp = stack - (pMystart->dst*regbits);
if ((pMystart->type & 2)== 2)
{
fprintf(outfp,"mov ");
standardreg( RegTableCount,
pMystart->dst,
setup_ebp, outfp);
fprintf(outfp," , ");
standardreg( RegTableCount,
pMystart->src,
setup_ebp, outfp);
fprintf(outfp,"\n");
}
if ((pMystart->type & 16)== 16)
{
/* source are imm */
if ((pMystart->src == 0) &&
(setup_ebp == 0))
{
/* small optimze */
fprintf(outfp,"xor ");
standardreg( RegTableCount,
pMystart->dst,
setup_ebp, outfp);
fprintf(outfp,",");
standardreg( RegTableCount,
pMystart->dst,
setup_ebp, outfp);
fprintf(outfp,"\n");
}
else
{
fprintf(outfp,"mov ");
standardreg( RegTableCount,
pMystart->dst,
setup_ebp, outfp);
fprintf(outfp,",%llu\n",pMystart->src);
}
} /* end "source are imm" */
} /* end pMyBrainAnalys->type & 8 */
if ((pMystart->type & 64)== 64)
{
if ((pMystart->type & 2)== 2)
{
/* dest [eax - 0x20], source reg */
fprintf(outfp,"mov dword [");
standardreg( RegTableCount,
pMystart->dst,
setup_ebp, outfp);
if (pMystart->dst_extra>=0)
fprintf(outfp," +%d], ",pMystart->dst_extra);
else
fprintf(outfp," %d], ",pMystart->dst_extra);
standardreg( RegTableCount,
pMystart->src,
setup_ebp, outfp);
fprintf(outfp,"\n");
if ((pMystart->type & 128)== 128)
{
fprintf(outfp,"mov ");
standardreg( RegTableCount,
pMystart->src,
setup_ebp, outfp);
fprintf(outfp," , ");
standardreg( RegTableCount,
pMystart->dst,
setup_ebp, outfp);
fprintf(outfp," %d\n",pMystart->dst_extra);
}
}
}
}
/* return */
if (pMystart->op == OP_ANY_ret)
{
if (pMyBrainAnalys->ptr_next == NULL)
{
if (setup_ebp == 1)
{
fprintf(outfp,"\n; clean up after the frame \n");
fprintf(outfp,"mov esp, ebx\n");
fprintf(outfp,"pop ebx\n");
}
}
fprintf(outfp,"ret\n");
}
if (pMystart == pMyend)
pMystart=NULL;
else
pMystart = (PMYBrainAnalys) pMystart->ptr_next;
}
return 0;
}

View File

@@ -1,180 +0,0 @@
#include <windows.h>
#include <winnt.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "misc.h"
#include "any_op.h"
static void standardreg(CPU_INT *RegTableCount, CPU_UNINT reg,
CPU_INT setup_ebp, FILE *outfp)
{
CPU_INT t, found = 0;
for (t=0;t<31;t++)
{
if (reg == RegTableCount[t])
{
fprintf(outfp,"r%d",t);
found++;
break;
}
}
if (found == 0)
{
fprintf(outfp,"r%d",reg);
}
}
CPU_INT ConvertToPPCProcess( FILE *outfp,
PMYBrainAnalys pMystart,
PMYBrainAnalys pMyend, CPU_INT regbits,
CPU_INT HowManyRegInUse,
CPU_INT *RegTableCount)
{
CPU_INT stack = 0;
//CPU_UNINT tmp;
CPU_INT setup_ebp = 0 ; /* 0 = no, 1 = yes */
CPU_INT t=0;
if (HowManyRegInUse > 31)
{
setup_ebp =1; /* we will use ebx as ebp */
stack = HowManyRegInUse * regbits;
}
if (RegTableCount[1]!=0)
t++;
if (RegTableCount[3]!=0)
t++;
if (RegTableCount[4]!=0)
t++;
if (RegTableCount[8]!=0)
t++;
if (RegTableCount[9]!=0)
t++;
if (RegTableCount[10]!=0)
t++;
if (RegTableCount[11]!=0)
t++;
if (RegTableCount[31]!=0)
t++;
if (HowManyRegInUse != t)
{
/* fixme optimze the table or active the frame pointer */
setup_ebp =1; /* we will use ebx as ebp */
stack = HowManyRegInUse * regbits;
}
/* fixme gas compatible
fprintf(outfp,"BITS 32\n");
fprintf(outfp,"GLOBAL _main\n");
fprintf(outfp,"SECTION .text\n\n");
fprintf(outfp,"; compile with nasm filename.asm -f win32, ld filename.obj -o filename.exe\n\n");
fprintf(outfp,"_main:\n");
*/
/* setup a frame pointer */
if (setup_ebp == 1)
{
/* fixme ppc frame pointer */
// fprintf(outfp,"\n; Setup frame pointer \n");
}
fprintf(outfp,"; Start the program \n");
while (pMystart!=NULL)
{
/* fixme the line lookup from anaylysing process */
/* mov not full implement */
if (pMystart->op == OP_ANY_mov)
{
printf("waring OP_ANY_mov are not full implement\n");
if ((pMystart->type & 8)== 8)
{
/* dst are register */
// FIXME frame pointer setup
// tmp = stack - (pMystart->dst*regbits);
if ((pMystart->type & 2)== 2)
{
fprintf(outfp,"mr ");
standardreg( RegTableCount,
pMystart->dst,
setup_ebp, outfp);
fprintf(outfp,",");
standardreg( RegTableCount,
pMystart->src,
setup_ebp, outfp);
fprintf(outfp,"\n");
}
if ((pMystart->type & 16)== 16)
{
/* source are imm */
if (setup_ebp == 1)
fprintf(outfp,"not supporet\n");
else
{
fprintf(outfp,"li ");
standardreg( RegTableCount,
pMystart->dst,
setup_ebp, outfp);
fprintf(outfp," , %llu\n",pMystart->src);
}
}
} /* end pMyBrainAnalys->type & 8 */
if ((pMystart->type & 64)== 64)
{
if ((pMystart->type & 2)== 2)
{
/* dest [eax - 0x20], source reg */
if ((pMystart->type & 128)== 128)
{
fprintf(outfp,"stwu ");
}
else
{
fprintf(outfp,"stw ");
}
standardreg( RegTableCount,
pMystart->src,
setup_ebp, outfp);
fprintf(outfp,", %d(",pMystart->dst_extra);
standardreg( RegTableCount,
pMystart->dst,
setup_ebp, outfp);
fprintf(outfp,")\n");
}
} /* end pMyBrainAnalys->type & 64 */
}
/* return */
if (pMystart->op == OP_ANY_ret)
{
if (pMyBrainAnalys->ptr_next == NULL)
{
if (setup_ebp == 1)
{
// FIXME end our own frame pointer
fprintf(outfp,"\n; clean up after the frame \n");
}
}
fprintf(outfp,"blr\n");
}
if (pMystart == pMyend)
pMystart=NULL;
else
pMystart = (PMYBrainAnalys) pMystart->ptr_next;
}
return 0;
}

View File

@@ -1,100 +0,0 @@
#include <windows.h>
#include <winnt.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "misc.h"
#include "any_op.h"
/* hack should be in misc.h*/
CPU_INT ConvertProcess(FILE *outfp, CPU_INT FromCpuid, CPU_INT ToCpuid)
{
CPU_INT ret=0;
CPU_INT regbits=-1;
CPU_INT HowManyRegInUse = 0;
CPU_INT RegTableCount[32] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
CPU_INT t;
PMYBrainAnalys pMystart = pStartMyBrainAnalys;
PMYBrainAnalys pMyend = pMyBrainAnalys;
PMYBrainAnalys ptmpMystart = pStartMyBrainAnalys;
PMYBrainAnalys ptmpMyend = pMyBrainAnalys;
if ( (FromCpuid == IMAGE_FILE_MACHINE_POWERPC) ||
(FromCpuid == IMAGE_FILE_MACHINE_I386))
{
regbits = 32 / 8;
}
/* FIXME calc where todo first split */
/* count how many register we got */
ptmpMystart = pMystart;
ptmpMyend = pMyend;
while (ptmpMystart!=NULL)
{
if ((ptmpMystart->type & 2) == 2)
RegTableCount[ptmpMystart->src]++;
if ((ptmpMystart->type & 8) == 8)
RegTableCount[ptmpMystart->dst]++;
if ((ptmpMystart->type & 32) == 32)
RegTableCount[ptmpMystart->src]++;
if ((ptmpMystart->type & 64) == 64)
RegTableCount[ptmpMystart->dst]++;
if (ptmpMystart == ptmpMyend)
ptmpMystart=NULL;
else
ptmpMystart = (PMYBrainAnalys) ptmpMystart->ptr_next;
}
for (t=0;t<=31;t++)
{
if (RegTableCount[t]!=0)
{
HowManyRegInUse++;
RegTableCount[t]=t;
}
}
/* switch to the acual converting now */
switch (ToCpuid)
{
case IMAGE_FILE_MACHINE_I386:
ret = ConvertToIA32Process( outfp, pMystart,
pMyend, regbits,
HowManyRegInUse,
RegTableCount);
if (ret !=0)
{
printf("should not happen contact a devloper, x86 fail\n");
return -1;
}
break;
case IMAGE_FILE_MACHINE_POWERPC:
ret = ConvertToPPCProcess( outfp, pMystart,
pMyend, regbits,
HowManyRegInUse,
RegTableCount);
if (ret !=0)
{
printf("should not happen contact a devloper, x86 fail\n");
return -1;
}
break;
default:
printf("should not happen contact a devloper, unknown fail\n");
return -1;
}
return ret;
}

View File

@@ -1,117 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "misc.h"
#include "any_op.h"
PMYBrainAnalys pMyBrainAnalys = NULL;
PMYBrainAnalys pStartMyBrainAnalys = NULL;
int main(int argc, char * argv[])
{
//CPU_UNINT BaseAddress=0;
//int t=0;
//char *infile=NULL;
//char *outfile=NULL;
//char *cpuid=NULL;
//CPU_INT type=0;
//CPU_INT mode = 1;
//printf("Usage :\n");
//printf(" need for -inbin and autodetect if it does not found a PE header \n");
//printf(" -cpu m68000 : convert motorala 68000/68008 to intel asm \n");
//printf(" -cpu m68010 : convert motorala 68010 to intel asm \n");
//printf(" -cpu m68020 : convert motorala 68020 to intel asm \n");
//printf(" -cpu m68030 : convert motorala 68030 to intel asm \n");
//printf(" -cpu m68040 : convert motorala 68040 to intel asm \n");
//printf(" -cpu ppc : convert PowerPC to intel asm \n");
//printf(" -cpu ARM4 : convert ARM4 to intel asm \n");
//printf("------------------------------------------------------------------\n");
//printf(" for -inbin and autodetect if it does not found a PE header or do\n");
//printf(" not set at all, this options are free to use \n");
//printf(".......-BaseAddress adr : the start base address only accpect \n");
//printf("....... dec value");
//printf("------------------------------------------------------------------\n");
//printf(" -in filename : try autodetect file type for you");
//printf(" whant convert\n");
//printf(" -inBin filename : the bin file you whant convert\n");
//printf(" -inExe filename : the PE file you whant convert\n");
//printf(" -OutAsm filename : the Asm file you whant create\n");
//printf(" -OutDis filename : Do disambler of the source file\n");
//printf("------------------------------------------------------------------\n");
//printf("More cpu will be added with the time or options, this is \n");
//printf("version 0.0.1 of the cpu to intel converter writen by \n");
//printf("Magnus Olsen (magnus@greatlord.com), it does not do anything \n");
//printf("yet, more that basic desgin how it should be writen. \n");
//printf("Copyright 2006 by Magnus Olsen, licen under GPL 2.0 for now. \n");
//if (argc <4)
// return 110;
///* fixme better error checking for the input param */
//for (t=1; t<argc;t+=2)
//{
// if (stricmp(argv[t],"-in"))
// {
// infile = argv[t+1];
// type=0;
// }
// if (stricmp(argv[t],"-inBin"))
// {
// infile = argv[t+1];
// type=1;
// }
// if (stricmp(argv[t],"-inExe"))
// {
// infile = argv[t+1];
// type=1;
// }
// if (stricmp(argv[t],"-OutAsm"))
// {
// outfile = argv[t+1];
// }
// if (stricmp(argv[t],"-OutDis"))
// {
// outfile = argv[t+1];
// mode = 0;
// }
// if (stricmp(argv[t],"-BaseAddress"))
// {
// BaseAddress = atol(argv[t+1]);
// }
// if (stricmp(argv[t],"-cpu"))
// {
// cpuid = argv[t+1];
// }
//}
// mode 0 disambler
// mode 1 convert to intel
// mode 2 convert to ppc
//return LoadPFileImage(infile,outfile,BaseAddress,cpuid,type, mode);
//LoadPFileImage("e:\\testppc.exe","e:\\cputointel.asm",0,0,0,1);
LoadPFileImage("e:\\testppc.exe","e:\\cputointel.asm",0,0,0,1);
//pMyBrainAnalys = NULL;
//pStartMyBrainAnalys = NULL;
//LoadPFileImage("e:\\testppc.exe","e:\\cputoppc.asm",0,0,0,2);
// return LoadPFileImage("e:\\testms.exe","e:\\cputointel.asm",0,0,0,1); // convert
return 0;
}

View File

@@ -1,17 +0,0 @@
#include "../../misc.h"
CPU_INT ARMBrain( CPU_BYTE *cpu_buffer,
CPU_UNINT cpu_pos,
CPU_UNINT cpu_size,
CPU_UNINT BaseAddress,
CPU_UNINT cpuarch,
FILE *outfp);
/* here we put the prototype for the opcode api that brain need we show a example for it */
CPU_INT ARM_(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
/* Export comment thing see m68k for example
* in dummy we do not show it, for it is diffent for each cpu
*/

View File

@@ -1,98 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include "ARMBrain.h"
#include "ARM.h"
#include "../../misc.h"
/*
* DummyBrain is example how you create you own cpu brain to translate from
* cpu to intel assembler, I have not add DummyBrain to the loader it is not
* need it in our example. When you write you own brain, it must be setup in
* misc.c function LoadPFileImage and PEFileStart, PEFileStart maybe does not
* need the brain you have writen so you do not need setup it there then.
*
* input param:
* cpu_buffer : the memory buffer with loaded program we whant translate
* cpu_pos : the positions in the cpu_buffer
* cpu_size : the alloced memory size of the cpu_buffer
* BaseAddress : the virtual memory address we setup to use.
* cpuarch : the sub arch for the brain, example if it exists more one
* cpu with same desgin but few other opcode or extend opcode
* outfp : the output file pointer
*
* mode : if we should run disambler of this binary or
* translate it, Disambler will not calc the
* the row name right so we simple give each
row a name. In translations mode we run a
* analys so we getting better optimzing and
* only row name there we need.
* value for mode are :
* 0 = disambler mode
* 1 = translate mode intel
*
* return value
* 0 : Ok
* 1 : unimplemt
* 2 : Unkonwn Opcode
* 3 : unimplement cpu
* 4 : unknown machine
*/
CPU_INT ARMBrain( CPU_BYTE *cpu_buffer,
CPU_UNINT cpu_pos,
CPU_UNINT cpu_size,
CPU_UNINT BaseAddress,
CPU_UNINT cpuarch,
FILE *outfp)
{
CPU_UNINT cpu_oldpos;
CPU_INT cpuint;
CPU_INT retcode = 0;
CPU_INT retsize;
/* now we start the process */
while (cpu_pos<cpu_size)
{
cpu_oldpos = cpu_pos;
cpuint = cpu_buffer[cpu_pos];
/* Add */
if ((cpuint - (cpuint & GetMaskByte32(cpuARMInit_))) == ConvertBitToByte32(cpuARMInit_))
{
retsize = ARM_( outfp, cpu_buffer, cpu_pos, cpu_size,
BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
cpu_pos += retsize;
}
/* Found all Opcode and breakout and return no error found */
if (cpu_pos >=cpu_size)
{
break;
}
/* Check if we have found a cpu opcode */
if (cpu_oldpos == cpu_pos)
{
if (retcode == 0)
{
/* no unimplement error where found so we return a msg for unknown opcode */
printf("Unkonwn Opcode found at 0x%8x opcode 0x%2x\n",cpu_oldpos+BaseAddress,(unsigned int)cpu_buffer[cpu_oldpos]);
retcode = 2;
}
}
/* Erorro Found ? */
if (retcode!=0)
{
/* Erorro Found break and return the error code */
break;
}
}
return retcode;
}

View File

@@ -1,12 +0,0 @@
#include "../../misc.h"
/* example how setup a opcode, this opcode is 16bit long (taken from M68K)
* 0 and 1 mean normal bit, 2 mean mask bit the bit that are determent diffent
* thing in the opcode, example which reg so on, it can be etither 0 or 1 in
* the opcode. but a opcode have also normal bit that is always been set to
* same. thuse bit are always 0 or 1
*/
CPU_BYTE cpuARMInit_[32] = {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2};

View File

@@ -1,50 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include "../../misc.h"
/* cpuDummyInit_Add
* Input param :
* out : The file pointer that we write to (the output file to intel asm)
* cpu_buffer : The memory buffer we have our binary code that we whant convert
* cpu_pos : Current positions in the cpu_buffer
* cpu_size : The memory size of the cpu_buffer
* BaseAddress : The base address you whant the binay file should run from
* cpuarch : if it exists diffent cpu from a manufactor like pentium,
* pentinum-mmx so on, use this flag to specify which type
* of cpu you whant or do not use it if it does not exists
* other or any sub model.
*
* mode : if we should run disambler of this binary or
* translate it, Disambler will not calc the
* the row name right so we simple give each
row a name. In translations mode we run a
* analys so we getting better optimzing and
* only row name there we need.
* value for mode are :
* 0 = disambler mode
* 1 = translate mode intel
*
* Return value :
* value -1 : unimplement
* value 0 : wrong opcode or not vaild opcode
* value +1 and higher : who many byte we should add to cpu_pos
*/
CPU_INT ARM_( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
/*
* ConvertBitToByte() is perfect to use to get the bit being in use from a bit array
* GetMaskByte() is perfect if u whant known which bit have been mask out
* see M68kopcode.c and how it use the ConvertBitToByte()
*/
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
printf(";Add unimplement\n");
return -1;
}

View File

@@ -1,17 +0,0 @@
#include "../../misc.h"
CPU_INT IA32Brain( CPU_BYTE *cpu_buffer,
CPU_UNINT cpu_pos,
CPU_UNINT cpu_size,
CPU_UNINT BaseAddress,
CPU_UNINT cpuarch,
FILE *outfp);
/* here we put the prototype for the opcode api that brain need we show a example for it */
CPU_INT IA32_Add(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
/* Export comment thing see m68k for example
* in dummy we do not show it, for it is diffent for each cpu
*/

View File

@@ -1,107 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include "IA32Brain.h"
#include "IA32.h"
#include "../../any_op.h"
#include "../../misc.h"
/*
* DummyBrain is example how you create you own cpu brain to translate from
* cpu to intel assembler, I have not add DummyBrain to the loader it is not
* need it in our example. When you write you own brain, it must be setup in
* misc.c function LoadPFileImage and PEFileStart, PEFileStart maybe does not
* need the brain you have writen so you do not need setup it there then.
*
* input param:
* cpu_buffer : the memory buffer with loaded program we whant translate
* cpu_pos : the positions in the cpu_buffer
* cpu_size : the alloced memory size of the cpu_buffer
* BaseAddress : the virtual memory address we setup to use.
* cpuarch : the sub arch for the brain, example if it exists more one
* cpu with same desgin but few other opcode or extend opcode
* outfp : the output file pointer
*
* mode : if we should run disambler of this binary or
* translate it, Disambler will not calc the
* the row name right so we simple give each
row a name. In translations mode we run a
* analys so we getting better optimzing and
* only row name there we need.
* value for mode are :
* 0 = disambler mode
* 1 = translate mode intel
*
* return value
* 0 : Ok
* 1 : unimplemt
* 2 : Unkonwn Opcode
* 3 : unimplement cpu
* 4 : unknown machine
*/
CPU_INT IA32Brain( CPU_BYTE *cpu_buffer,
CPU_UNINT cpu_pos,
CPU_UNINT cpu_size,
CPU_UNINT BaseAddress,
CPU_UNINT cpuarch,
FILE *outfp)
{
CPU_UNINT cpu_oldpos;
CPU_INT cpuint;
CPU_INT retcode = 0;
CPU_INT retsize;
/* now we start the process */
while (cpu_pos<cpu_size)
{
cpu_oldpos = cpu_pos;
/* use the GetData32Be or GetData32Le
to read from the memory the
Le is for small endian and the
Be is for big endian
the 32 is how many bits we should read
*/
cpuint = GetData32Be(&cpu_buffer[cpu_pos]);
/* Add */
if ((cpuint - (cpuint & GetMaskByte(cpuIA32Init_Add))) == ConvertBitToByte(cpuIA32Init_Add))
{
retsize = IA32_Add( outfp, cpu_buffer, cpu_pos, cpu_size,
BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
cpu_pos += retsize;
}
/* Found all Opcode and breakout and return no error found */
if (cpu_pos >=cpu_size)
{
break;
}
/* Check if we have found a cpu opcode */
if (cpu_oldpos == cpu_pos)
{
if (retcode == 0)
{
/* no unimplement error where found so we return a msg for unknown opcode */
printf("Unkonwn Opcode found at 0x%8x opcode 0x%2x\n",cpu_oldpos+BaseAddress,(unsigned int)cpu_buffer[cpu_oldpos]);
retcode = 2;
}
}
/* Erorro Found ? */
if (retcode!=0)
{
/* Erorro Found break and return the error code */
break;
}
}
return retcode;
}

View File

@@ -1,13 +0,0 @@
#include "../../misc.h"
/* example how setup a opcode, this opcode is 16bit long (taken from M68K)
* 0 and 1 mean normal bit, 2 mean mask bit the bit that are determent diffent
* thing in the opcode, example which reg so on, it can be etither 0 or 1 in
* the opcode. but a opcode have also normal bit that is always been set to
* same. thuse bit are always 0 or 1
*/
CPU_BYTE cpuIA32Init_Add[16] = {1,1,0,1,2,2,2,2,2,2,2,2,2,2,2,2};

View File

@@ -1,50 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include "IA32.h"
#include "../../misc.h"
/* cpuDummyInit_Add
* Input param :
* out : The file pointer that we write to (the output file to intel asm)
* cpu_buffer : The memory buffer we have our binary code that we whant convert
* cpu_pos : Current positions in the cpu_buffer
* cpu_size : The memory size of the cpu_buffer
* BaseAddress : The base address you whant the binay file should run from
* cpuarch : if it exists diffent cpu from a manufactor like pentium,
* pentinum-mmx so on, use this flag to specify which type
* of cpu you whant or do not use it if it does not exists
* other or any sub model.
*
* mode : if we should run disambler of this binary or
* translate it, Disambler will not calc the
* the row name right so we simple give each
row a name. In translations mode we run a
* analys so we getting better optimzing and
* only row name there we need.
* value for mode are :
* 0 = disambler mode
* 1 = translate mode intel
*
* Return value :
* value -1 : unimplement
* value 0 : wrong opcode or not vaild opcode
* value +1 and higher : who many byte we should add to cpu_pos
*/
CPU_INT IA32_Add( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
/*
* ConvertBitToByte() is perfect to use to get the bit being in use from a bit array
* GetMaskByte() is perfect if u whant known which bit have been mask out
* see M68kopcode.c and how it use the ConvertBitToByte()
*/
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
printf(";Add unimplement\n");
return -1;
}

View File

@@ -1,23 +0,0 @@
#include "../../misc.h"
CPU_INT PPCBrain( CPU_BYTE *cpu_buffer,
CPU_UNINT cpu_pos,
CPU_UNINT cpu_size,
CPU_UNINT BaseAddress,
CPU_UNINT cpuarch,
FILE *outfp);
/* here we put the prototype for the opcode api that brain need we show a example for it */
CPU_INT PPC_Blr( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
CPU_INT PPC_Li( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
CPU_INT PPC_mr( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
CPU_INT PPC_Stw( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
CPU_INT PPC_Stwu( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
/* Export comment thing see m68k for example
* in dummy we do not show it, for it is diffent for each cpu
*/

View File

@@ -1,143 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include "PPCBrain.h"
#include "PPC.h"
#include "../../misc.h"
/*
* DummyBrain is example how you create you own cpu brain to translate from
* cpu to intel assembler, I have not add DummyBrain to the loader it is not
* need it in our example. When you write you own brain, it must be setup in
* misc.c function LoadPFileImage and PEFileStart, PEFileStart maybe does not
* need the brain you have writen so you do not need setup it there then.
*
* input param:
* cpu_buffer : the memory buffer with loaded program we whant translate
* cpu_pos : the positions in the cpu_buffer
* cpu_size : the alloced memory size of the cpu_buffer
* BaseAddress : the virtual memory address we setup to use.
* cpuarch : the sub arch for the brain, example if it exists more one
* cpu with same desgin but few other opcode or extend opcode
* outfp : the output file pointer
*
* mode : if we should run disambler of this binary or
* translate it, Disambler will not calc the
* the row name right so we simple give each
row a name. In translations mode we run a
* analys so we getting better optimzing and
* only row name there we need.
* value for mode are :
* 0 = disambler mode
* 1 = translate mode intel
*
* return value
* 0 : Ok
* 1 : unimplemt
* 2 : Unkonwn Opcode
* 3 : unimplement cpu
* 4 : unknown machine
*/
CPU_INT PPCBrain( CPU_BYTE *cpu_buffer,
CPU_UNINT cpu_pos,
CPU_UNINT cpu_size,
CPU_UNINT BaseAddress,
CPU_UNINT cpuarch,
FILE *outfp)
{
CPU_UNINT cpu_oldpos;
CPU_INT cpuint;
CPU_INT retcode = 0;
CPU_INT retsize;
/* now we start the process */
while (cpu_pos<cpu_size)
{
cpu_oldpos = cpu_pos;
cpuint = GetData32Le(&cpu_buffer[cpu_pos]);
/* blr */
if ((cpuint - (cpuint & GetMaskByte32(cpuPPCInit_Blr))) == ConvertBitToByte32(cpuPPCInit_Blr))
{
retsize = PPC_Blr( outfp, cpu_buffer, cpu_pos, cpu_size,
BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
cpu_pos += retsize;
}
/* Li*/
if ((cpuint - (cpuint & GetMaskByte32(cpuPPCInit_Li))) == ConvertBitToByte32(cpuPPCInit_Li))
{
retsize = PPC_Li( outfp, cpu_buffer, cpu_pos, cpu_size,
BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
cpu_pos += retsize;
}
/* mr */
if ((cpuint - (cpuint & GetMaskByte32(cpuPPCInit_mr))) == ConvertBitToByte32(cpuPPCInit_mr))
{
retsize = PPC_mr( outfp, cpu_buffer, cpu_pos, cpu_size,
BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
cpu_pos += retsize;
}
/* stw */
if ((cpuint - (cpuint & GetMaskByte32(cpuPPCInit_stw))) == ConvertBitToByte32(cpuPPCInit_stw))
{
retsize = PPC_Stw( outfp, cpu_buffer, cpu_pos, cpu_size,
BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
cpu_pos += retsize;
}
/* stwu */
if ((cpuint - (cpuint & GetMaskByte32(cpuPPCInit_stwu))) == ConvertBitToByte32(cpuPPCInit_stwu))
{
retsize = PPC_Stwu( outfp, cpu_buffer, cpu_pos, cpu_size,
BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
cpu_pos += retsize;
}
/* Found all Opcode and breakout and return no error found */
if (cpu_pos >=cpu_size)
{
break;
}
/* Check if we have found a cpu opcode */
if (cpu_oldpos == cpu_pos)
{
if (retcode == 0)
{
/* no unimplement error where found so we return a msg for unknown opcode */
printf("Unkonwn Opcode found at 0x%8x opcode 0x%2x\n",cpu_oldpos+BaseAddress,(unsigned int)cpu_buffer[cpu_oldpos]);
retcode = 2;
}
}
/* Erorro Found ? */
if (retcode!=0)
{
/* Erorro Found break and return the error code */
break;
}
}
return 0; // hack getting dismabler working or converting working
return retcode;
}

View File

@@ -1,32 +0,0 @@
#include "../../misc.h"
/* example how setup a opcode, this opcode is 16bit long (taken from M68K)
* 0 and 1 mean normal bit, 2 mean mask bit the bit that are determent diffent
* thing in the opcode, example which reg so on, it can be etither 0 or 1 in
* the opcode. but a opcode have also normal bit that is always been set to
* same. thuse bit are always 0 or 1
*/
/* FIXME RA should be 0 in stwu */
CPU_BYTE cpuPPCInit_Blr[32] = {0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 0,1,0,0,1,1, 1,0};
/* addi */
CPU_BYTE cpuPPCInit_Li[32] = {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0, 0,0,1,1,1,0, 2,2};
CPU_BYTE cpuPPCInit_stw[32] = {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 1,0,0,1,0,0, 2,2};
CPU_BYTE cpuPPCInit_stwu[32] = {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 1,0,0,1,0,1, 2,2};
CPU_BYTE cpuPPCInit_mr[32] = {0,1,1,1,1,0,0,0,0,0,0,0,1,0,1,1,2,2,2,2,2,2,2,2, 0,1,1,1,1,1, 2,2};
CPU_BYTE cpuPPCInit_lwz[32] = {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 1,0,0,0,0,0, 2,2};
/* mask */
/*
* no mask we implement function getting the reg right
*/
/* bit index
3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
*/

View File

@@ -1,192 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include "PPC.h"
#include "../../misc.h"
#include "../../any_op.h"
/* reg r0-r31
r3 = eax
*/
/* cpuDummyInit_Add
* Input param :
* out : The file pointer that we write to (the output file to intel asm)
* cpu_buffer : The memory buffer we have our binary code that we whant convert
* cpu_pos : Current positions in the cpu_buffer
* cpu_size : The memory size of the cpu_buffer
* BaseAddress : The base address you whant the binay file should run from
* cpuarch : if it exists diffent cpu from a manufactor like pentium,
* pentinum-mmx so on, use this flag to specify which type
* of cpu you whant or do not use it if it does not exists
* other or any sub model.
*
* Return value :
* value -1 : unimplement
* value 0 : wrong opcode or not vaild opcode
* value +1 and higher : who many byte we should add to cpu_pos
*/
/* Get Dest register */
#define PPC_GetBitArraySrcReg(opcode) (((opcode & 0x3) << 3) | ((opcode & 0xE000) >> 13))
/* Get Source register */
CPU_UNINT PPC_GetBitArrayBto31xx(CPU_UNINT opcode)
{
CPU_INT x1;
/* FIXME make it to a macro
* not tested to 100% yet */
x1 = ((opcode & 0x1F00)>>8);
return x1;
}
CPU_UNINT PPC_GetBitArrayBto31(CPU_UNINT opcode)
{
CPU_INT x1;
/* FIXME make it to a macro
* not tested to 100% yet */
x1 = ((opcode & 0xFFFF0000)>>16);
return x1;
}
CPU_INT PPC_Blr( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
BaseAddress +=cpu_pos;
/* own translatons langues */
if (AllocAny()!=0) /* alloc memory for pMyBrainAnalys */
{
return -1;
}
pMyBrainAnalys->op = OP_ANY_ret;
pMyBrainAnalys->memAdr=BaseAddress;
return 4;
}
CPU_INT PPC_Li( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
CPU_UNINT opcode;
opcode = GetData32Le(&cpu_buffer[cpu_pos]);
BaseAddress +=cpu_pos;
/* own translatons langues */
if (AllocAny()!=0) /* alloc memory for pMyBrainAnalys */
{
return -1;
}
pMyBrainAnalys->op = OP_ANY_mov;
pMyBrainAnalys->type= 8 + 16; /* 8 dst reg, 16 imm */
pMyBrainAnalys->src_size = 16;
pMyBrainAnalys->src = PPC_GetBitArraySrcReg(opcode);
pMyBrainAnalys->dst = PPC_GetBitArrayBto31(opcode);
pMyBrainAnalys->memAdr=BaseAddress;
return 4;
}
CPU_INT PPC_mr( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
CPU_UNINT opcode;
opcode = GetData32Le(&cpu_buffer[cpu_pos]);
BaseAddress +=cpu_pos;
/* own translatons langues */
if (AllocAny()!=0) /* alloc memory for pMyBrainAnalys */
{
return -1;
}
pMyBrainAnalys->op = OP_ANY_mov;
pMyBrainAnalys->type= 2 + 8; /* 8 dst reg, 2 src reg */
pMyBrainAnalys->src_size = 32;
pMyBrainAnalys->src = PPC_GetBitArraySrcReg(opcode);
pMyBrainAnalys->dst = PPC_GetBitArrayBto31xx(opcode);
pMyBrainAnalys->memAdr=BaseAddress;
return 4;
}
CPU_INT PPC_Stw( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
/* r1 store at -0x20(r1) */
CPU_UNINT opcode;
CPU_SHORT tmp = 0;
opcode = GetData32Le(&cpu_buffer[cpu_pos]);
BaseAddress +=cpu_pos;
/* own translatons langues */
if (AllocAny()!=0) /* alloc memory for pMyBrainAnalys */
{
return -1;
}
tmp = _byteswap_ushort( ((CPU_SHORT)((opcode >> 16) & 0xffff)));
pMyBrainAnalys->op = OP_ANY_mov;
pMyBrainAnalys->type= 2 + 64;
pMyBrainAnalys->src_size = 32;
pMyBrainAnalys->dst_size = 32;
pMyBrainAnalys->src = PPC_GetBitArraySrcReg(opcode);
pMyBrainAnalys->dst = PPC_GetBitArrayBto31xx(opcode);
pMyBrainAnalys-> dst_extra = tmp;
pMyBrainAnalys->memAdr=BaseAddress;
return 4;
}
CPU_INT PPC_Stwu( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
/* r1 store at -0x20(r1) */
CPU_UNINT opcode;
CPU_INT DstReg;
CPU_SHORT tmp = 0;
opcode = GetData32Le(&cpu_buffer[cpu_pos]);
DstReg = PPC_GetBitArrayBto31xx(opcode);
if (DstReg == 0)
{
return 0;
}
BaseAddress +=cpu_pos;
/* own translatons langues */
if (AllocAny()!=0) /* alloc memory for pMyBrainAnalys */
{
return -1;
}
tmp = _byteswap_ushort( ((CPU_SHORT)((opcode >> 16) & 0xffff)));
pMyBrainAnalys->op = OP_ANY_mov;
pMyBrainAnalys->type= 2 + 64 + 128;
pMyBrainAnalys->src_size = 32;
pMyBrainAnalys->dst_size = 32;
pMyBrainAnalys->src = PPC_GetBitArraySrcReg(opcode);
pMyBrainAnalys->dst = DstReg;
pMyBrainAnalys-> dst_extra = tmp;
pMyBrainAnalys->memAdr=BaseAddress;
return 4;
}

View File

@@ -1,17 +0,0 @@
#include "../../misc.h"
CPU_INT DummyBrain( CPU_BYTE *cpu_buffer,
CPU_UNINT cpu_pos,
CPU_UNINT cpu_size,
CPU_UNINT BaseAddress,
CPU_UNINT cpuarch,
FILE *outfp);
/* here we put the prototype for the opcode api that brain need we show a example for it */
CPU_INT DUMMY_Add(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
/* Export comment thing see m68k for example
* in dummy we do not show it, for it is diffent for each cpu
*/

Some files were not shown because too many files have changed in this diff Show More