From 9e92286f5c64a0b5946418a510052a92ff06e953 Mon Sep 17 00:00:00 2001
From: James Tabor
Date: Fri, 2 Apr 2010 11:53:14 +0000
Subject: [PATCH 002/261] [Win32k] - Implement MakeInfoDC and support
functions. Dedicated to Timo.
svn path=/trunk/; revision=46679
---
reactos/subsystems/win32/win32k/include/dc.h | 5 +-
.../subsystems/win32/win32k/include/pdevobj.h | 8 ++-
.../subsystems/win32/win32k/include/surface.h | 2 +
.../subsystems/win32/win32k/objects/dclife.c | 62 +++++++++++++++++-
.../subsystems/win32/win32k/objects/dcutil.c | 65 +++++++++++++++++++
.../subsystems/win32/win32k/objects/device.c | 16 +++++
6 files changed, 151 insertions(+), 7 deletions(-)
diff --git a/reactos/subsystems/win32/win32k/include/dc.h b/reactos/subsystems/win32/win32k/include/dc.h
index b616bdc0ba6..48b0e921400 100644
--- a/reactos/subsystems/win32/win32k/include/dc.h
+++ b/reactos/subsystems/win32/win32k/include/dc.h
@@ -177,6 +177,8 @@ HDC FASTCALL IntGdiCreateDisplayDC(HDEV hDev, ULONG DcType, BOOL EmptyDC);
BOOL FASTCALL IntGdiCleanDC(HDC hDC);
VOID FASTCALL IntvGetDeviceCaps(PPDEVOBJ, PDEVCAPS);
INT FASTCALL IntGdiGetDeviceCaps(PDC,INT);
+BOOL FASTCALL MakeInfoDC(PDC,BOOL);
+BOOL FASTCALL IntSetDefaultRegion(PDC);
extern PPDEVOBJ pPrimarySurface;
@@ -228,6 +230,5 @@ DC_vSelectPalette(PDC pdc, PPALETTE ppal)
pdc->dclevel.ppal = ppal;
}
-BOOL FASTCALL
-IntPrepareDriverIfNeeded(VOID);
+BOOL FASTCALL IntPrepareDriverIfNeeded(VOID);
extern PDEVOBJ PrimarySurface;
diff --git a/reactos/subsystems/win32/win32k/include/pdevobj.h b/reactos/subsystems/win32/win32k/include/pdevobj.h
index 4124509fbe5..ca0c3fa0821 100644
--- a/reactos/subsystems/win32/win32k/include/pdevobj.h
+++ b/reactos/subsystems/win32/win32k/include/pdevobj.h
@@ -88,8 +88,8 @@ typedef struct _PDEVOBJ
// PVOID TypeOneInfo;
PVOID pvGammaRamp; /* Gamma ramp pointer. */
// PVOID RemoteTypeOne;
-// ULONG ulHorzRes;
-// ULONG ulVertRes;
+ ULONG ulHorzRes;
+ ULONG ulVertRes;
// PFN_DrvSetPointerShape pfnDrvSetPointerShape;
// PFN_DrvMovePointer pfnDrvMovePointer;
PFN_DrvMovePointer pfnMovePointer;
@@ -107,7 +107,7 @@ typedef struct _PDEVOBJ
// HANDLE hSpooler; /* Handle to spooler, if spooler dev driver. */
// PVOID pDesktopId;
PGRAPHICS_DEVICE pGraphicsDevice;
-// POINTL ptlOrigion;
+ POINTL ptlOrigion;
PVOID pdmwDev; /* Ptr->DEVMODEW.dmSize + dmDriverExtra == alloc size. */
// DWORD Unknown3;
FLONG DxDd_Flags; /* DxDD active status flags. */
@@ -141,4 +141,6 @@ typedef struct _PDEVEDD
EDD_DIRECTDRAW_GLOBAL EDDgpl;
} PDEVEDD, *PPDEVEDD;
+PSIZEL FASTCALL PDEV_sizl(PPDEVOBJ, PSIZEL);
+
extern ULONG gdwDirectDrawContext;
diff --git a/reactos/subsystems/win32/win32k/include/surface.h b/reactos/subsystems/win32/win32k/include/surface.h
index 57a5ec24f85..3fe90540467 100644
--- a/reactos/subsystems/win32/win32k/include/surface.h
+++ b/reactos/subsystems/win32/win32k/include/surface.h
@@ -3,6 +3,8 @@
#include "win32.h"
#include "gdiobj.h"
+#define PDEV_SURFACE 0x80000000
+
/* GDI surface object */
typedef struct _SURFACE
{
diff --git a/reactos/subsystems/win32/win32k/objects/dclife.c b/reactos/subsystems/win32/win32k/objects/dclife.c
index 3837b78567d..e9f4cf7ecd1 100644
--- a/reactos/subsystems/win32/win32k/objects/dclife.c
+++ b/reactos/subsystems/win32/win32k/objects/dclife.c
@@ -586,8 +586,59 @@ DC_InitDC(HDC DCHandle)
NtGdiSetVirtualResolution(DCHandle, 0, 0, 0, 0);
}
+BOOL
+FASTCALL
+MakeInfoDC(PDC pdc, BOOL bSet)
+{
+ PSURFACE pSurface;
+ SIZEL sizl;
+
+ /* Can not be a display DC. */
+ if (pdc->fs & DC_FLAG_DISPLAY) return FALSE;
+ if (bSet)
+ {
+ if (pdc->fs & DC_FLAG_TEMPINFODC || pdc->dctype == DC_TYPE_DIRECT)
+ return FALSE;
+
+ pSurface = pdc->dclevel.pSurface;
+ pdc->fs |= DC_FLAG_TEMPINFODC;
+ pdc->pSurfInfo = pSurface;
+ pdc->dctype = DC_TYPE_INFO;
+ pdc->dclevel.pSurface = NULL;
+
+ if (PDEV_sizl(pdc->ppdev, &sizl)->cx == pdc->dclevel.sizl.cx &&
+ PDEV_sizl(pdc->ppdev, &sizl)->cy == pdc->dclevel.sizl.cy)
+ return TRUE;
+
+ pdc->dclevel.sizl.cx = PDEV_sizl(pdc->ppdev, &sizl)->cx;
+ pdc->dclevel.sizl.cy = sizl.cy;
+ IntSetDefaultRegion(pdc);
+ }
+ else
+ {
+ if (!(pdc->fs & DC_FLAG_TEMPINFODC) || pdc->dctype != DC_TYPE_INFO)
+ return FALSE;
+
+ pSurface = pdc->pSurfInfo;
+ pdc->fs &= ~DC_FLAG_TEMPINFODC;
+ pdc->dclevel.pSurface = pSurface;
+ pdc->dctype = DC_TYPE_DIRECT;
+ pdc->pSurfInfo = NULL;
+
+ if ( !pSurface ||
+ (pSurface->SurfObj.sizlBitmap.cx == pdc->dclevel.sizl.cx &&
+ pSurface->SurfObj.sizlBitmap.cy == pdc->dclevel.sizl.cy) )
+ return TRUE;
+
+ pdc->dclevel.sizl.cx = pSurface->SurfObj.sizlBitmap.cx;
+ pdc->dclevel.sizl.cy = pSurface->SurfObj.sizlBitmap.cy;
+ IntSetDefaultRegion(pdc);
+ }
+ return TRUE;
+}
+
/*
-* @unimplemented
+* @implemented
*/
BOOL
APIENTRY
@@ -595,7 +646,14 @@ NtGdiMakeInfoDC(
IN HDC hdc,
IN BOOL bSet)
{
- UNIMPLEMENTED;
+ BOOL Ret;
+ PDC pdc = DC_LockDc(hdc);
+ if (pdc)
+ {
+ Ret = MakeInfoDC(pdc, bSet);
+ DC_UnlockDc(pdc);
+ return Ret;
+ }
return FALSE;
}
diff --git a/reactos/subsystems/win32/win32k/objects/dcutil.c b/reactos/subsystems/win32/win32k/objects/dcutil.c
index 9721af3147f..a8c28ecb348 100644
--- a/reactos/subsystems/win32/win32k/objects/dcutil.c
+++ b/reactos/subsystems/win32/win32k/objects/dcutil.c
@@ -125,6 +125,71 @@ IntIsPrimarySurface(SURFOBJ *SurfObj)
}
#endif
+BOOL
+FASTCALL
+IntSetDefaultRegion(PDC pdc)
+{
+ PSURFACE pSurface;
+ PROSRGNDATA prgn;
+ RECTL rclWnd, rclClip;
+
+ IntGdiReleaseRaoRgn(pdc);
+
+ rclWnd.left = 0;
+ rclWnd.top = 0;
+ rclWnd.right = pdc->dclevel.sizl.cx;
+ rclWnd.bottom = pdc->dclevel.sizl.cy;
+ rclClip = rclWnd;
+
+// EngAcquireSemaphoreShared(pdc->ppdev->hsemDevLock);
+ if (pdc->ppdev->flFlags & PDEV_META_DEVICE)
+ {
+ pSurface = pdc->dclevel.pSurface;
+ if (pSurface && pSurface->flFlags & PDEV_SURFACE)
+ {
+ rclClip.left += pdc->ppdev->ptlOrigion.x;
+ rclClip.top += pdc->ppdev->ptlOrigion.y;
+ rclClip.right += pdc->ppdev->ptlOrigion.x;
+ rclClip.bottom += pdc->ppdev->ptlOrigion.y;
+ }
+ }
+// EngReleaseSemaphore(pdc->ppdev->hsemDevLock);
+
+ prgn = pdc->prgnVis;
+
+ if (prgn && prgn != prgnDefault)
+ {
+ REGION_SetRectRgn( prgn,
+ rclClip.left,
+ rclClip.top,
+ rclClip.right ,
+ rclClip.bottom );
+ }
+ else
+ {
+ prgn = IntSysCreateRectpRgn( rclClip.left,
+ rclClip.top,
+ rclClip.right ,
+ rclClip.bottom );
+ pdc->prgnVis = prgn;
+ }
+
+ if (prgn)
+ {
+ pdc->ptlDCOrig.x = 0;
+ pdc->ptlDCOrig.y = 0;
+ pdc->erclWindow = rclWnd;
+ pdc->erclClip = rclClip;
+ /* Might be an InitDC or DCE....*/
+ pdc->ptlFillOrigin.x = pdc->dcattr.VisRectRegion.Rect.right;
+ pdc->ptlFillOrigin.y = pdc->dcattr.VisRectRegion.Rect.bottom;
+ return TRUE;
+ }
+
+ pdc->prgnVis = prgnDefault;
+ return FALSE;
+}
+
BOOL APIENTRY
NtGdiCancelDC(HDC hDC)
diff --git a/reactos/subsystems/win32/win32k/objects/device.c b/reactos/subsystems/win32/win32k/objects/device.c
index 40a79562ede..b1158471282 100644
--- a/reactos/subsystems/win32/win32k/objects/device.c
+++ b/reactos/subsystems/win32/win32k/objects/device.c
@@ -19,6 +19,22 @@ static KEVENT VideoDriverNeedsPreparation;
static KEVENT VideoDriverPrepared;
PDC defaultDCstate = NULL;
+PSIZEL
+FASTCALL
+PDEV_sizl(PPDEVOBJ ppdev, PSIZEL psizl)
+{
+ if (ppdev->flFlags & PDEV_META_DEVICE)
+ {
+ psizl->cx = ppdev->ulHorzRes;
+ psizl->cy = ppdev->ulVertRes;
+ }
+ else
+ {
+ psizl->cx = ppdev->gdiinfo.ulHorzRes;
+ psizl->cy = ppdev->gdiinfo.ulVertRes;
+ }
+ return psizl;
+}
NTSTATUS FASTCALL
InitDcImpl(VOID)
From 90a11f48e9a1f997bfbc01e752cbd525a4666d1a Mon Sep 17 00:00:00 2001
From: Johannes Anderwald
Date: Fri, 2 Apr 2010 13:49:10 +0000
Subject: [PATCH 003/261] [MMIXER] - Copy device name when initializing
WAVEINCAPS / WAVEOUTCAPS - Fixes display wave device name in cpl /
waveInGetDevCaps / waveOutGetDevCaps
svn path=/trunk/; revision=46680
---
reactos/lib/drivers/sound/mmixer/wave.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/reactos/lib/drivers/sound/mmixer/wave.c b/reactos/lib/drivers/sound/mmixer/wave.c
index a8b2675cac9..0ba0aae41b9 100644
--- a/reactos/lib/drivers/sound/mmixer/wave.c
+++ b/reactos/lib/drivers/sound/mmixer/wave.c
@@ -360,6 +360,17 @@ MMixerInitializeWaveInfo(
WaveInfo->DeviceId = MixerData->DeviceId;
WaveInfo->PinId = PinId;
+
+ /* copy device name */
+ if (bWaveIn)
+ {
+ wcscpy(WaveInfo->u.InCaps.szPname, DeviceName);
+ }
+ else
+ {
+ wcscpy(WaveInfo->u.OutCaps.szPname, DeviceName);
+ }
+
/* FIXME determine manufacturer / product id */
if (bWaveIn)
{
@@ -410,6 +421,8 @@ MMixerInitializeWaveInfo(
MixerContext->Free(MultipleItem);
+
+
if (bWaveIn)
{
InsertTailList(&MixerList->WaveInList, &WaveInfo->Entry);
From 95650313d90c6dea23dd0f513bca39f3912843e9 Mon Sep 17 00:00:00 2001
From: Johannes Anderwald
Date: Fri, 2 Apr 2010 14:01:55 +0000
Subject: [PATCH 004/261] [NTOS] - Add support for reference strings in
IoOpenDeviceInterfaceRegistryKey
svn path=/trunk/; revision=46681
---
reactos/ntoskrnl/io/iomgr/deviface.c | 128 ++++++++++++---------------
1 file changed, 59 insertions(+), 69 deletions(-)
diff --git a/reactos/ntoskrnl/io/iomgr/deviface.c b/reactos/ntoskrnl/io/iomgr/deviface.c
index 2b0789b5a60..391c6813664 100644
--- a/reactos/ntoskrnl/io/iomgr/deviface.c
+++ b/reactos/ntoskrnl/io/iomgr/deviface.c
@@ -51,31 +51,29 @@ IoOpenDeviceInterfaceRegistryKey(IN PUNICODE_STRING SymbolicLinkName,
OUT PHANDLE DeviceInterfaceKey)
{
WCHAR StrBuff[MAX_PATH], PathBuff[MAX_PATH];
- PWCHAR Guid;
- UNICODE_STRING EnumU = RTL_CONSTANT_STRING(ENUM_ROOT L"\\");
+ PWCHAR Guid, RefString;
UNICODE_STRING DevParamU = RTL_CONSTANT_STRING(L"\\Device Parameters");
UNICODE_STRING PrefixU = RTL_CONSTANT_STRING(L"\\??\\");
UNICODE_STRING KeyPath, KeyName;
UNICODE_STRING MatchableGuid;
- HANDLE GuidKey, ChildKey;
+ UNICODE_STRING GuidString;
+ HANDLE GuidKey, hInterfaceKey;
ULONG Index = 0;
PKEY_BASIC_INFORMATION KeyInformation;
ULONG KeyInformationLength;
- PKEY_VALUE_PARTIAL_INFORMATION KeyValueInformation;
- ULONG KeyValueInformationLength;
OBJECT_ATTRIBUTES ObjectAttributes;
NTSTATUS Status;
ULONG RequiredLength;
- MatchableGuid.Length = 0;
- MatchableGuid.Length += swprintf(StrBuff,
- L"##?#%ls",
- &SymbolicLinkName->Buffer[PrefixU.Length / sizeof(WCHAR)]);
- StrBuff[++MatchableGuid.Length] = UNICODE_NULL;
+ swprintf(StrBuff, L"##?#%s", &SymbolicLinkName->Buffer[PrefixU.Length / sizeof(WCHAR)]);
- MatchableGuid.Buffer = StrBuff;
- MatchableGuid.MaximumLength = MAX_PATH * sizeof(WCHAR);
- MatchableGuid.Length = (MatchableGuid.Length-1) * sizeof(WCHAR);
+ RefString = wcsstr(StrBuff, L"\\");
+ if (RefString)
+ {
+ RefString[0] = 0;
+ }
+
+ RtlInitUnicodeString(&MatchableGuid, StrBuff);
Guid = wcsstr(StrBuff, L"{");
if (!Guid)
@@ -85,8 +83,11 @@ IoOpenDeviceInterfaceRegistryKey(IN PUNICODE_STRING SymbolicLinkName,
KeyPath.Length = 0;
KeyPath.MaximumLength = MAX_PATH * sizeof(WCHAR);
+ GuidString.Buffer = Guid;
+ GuidString.Length = GuidString.MaximumLength = 38 * sizeof(WCHAR);
+
RtlAppendUnicodeToString(&KeyPath, BaseKeyString);
- RtlAppendUnicodeToString(&KeyPath, Guid);
+ RtlAppendUnicodeStringToString(&KeyPath, &GuidString);
InitializeObjectAttributes(&ObjectAttributes,
&KeyPath,
@@ -142,73 +143,62 @@ IoOpenDeviceInterfaceRegistryKey(IN PUNICODE_STRING SymbolicLinkName,
KeyName.Buffer = KeyInformation->Name;
if (!RtlEqualUnicodeString(&KeyName, &MatchableGuid, TRUE))
- continue;
-
- InitializeObjectAttributes(&ObjectAttributes,
- &KeyName,
- OBJ_CASE_INSENSITIVE,
- GuidKey,
- NULL);
- Status = ZwOpenKey(&ChildKey, KEY_QUERY_VALUE, &ObjectAttributes);
- ZwClose(GuidKey);
- if (!NT_SUCCESS(Status))
- return Status;
-
- RtlInitUnicodeString(&KeyName, L"DeviceInstance");
- Status = ZwQueryValueKey(ChildKey,
- &KeyName,
- KeyValuePartialInformation,
- NULL,
- 0,
- &RequiredLength);
- if (Status == STATUS_BUFFER_TOO_SMALL)
{
- KeyValueInformationLength = RequiredLength;
- KeyValueInformation = ExAllocatePool(PagedPool, KeyValueInformationLength);
- if (!KeyValueInformation)
- {
- ZwClose(ChildKey);
- return Status;
- }
+ ExFreePool(KeyInformation);
+ continue;
+ }
- Status = ZwQueryValueKey(ChildKey,
- &KeyName,
- KeyValuePartialInformation,
- KeyValueInformation,
- KeyValueInformationLength,
- &RequiredLength);
+ KeyPath.Length = 0;
+ RtlAppendUnicodeStringToString(&KeyPath, &KeyName);
+ RtlAppendUnicodeToString(&KeyPath, L"\\");
+
+ /* check for presence of a reference string */
+ if (RefString)
+ {
+ /* append reference string */
+ RefString[0] = L'#';
+ RtlInitUnicodeString(&KeyName, RefString);
}
else
{
- ZwClose(ChildKey);
- return STATUS_OBJECT_PATH_NOT_FOUND;
+ /* no reference string */
+ RtlInitUnicodeString(&KeyName, L"#");
}
- ZwClose(ChildKey);
-
- if (!NT_SUCCESS(Status))
- return Status;
-
- KeyPath.Length = 0;
-
- KeyName.Length = KeyName.MaximumLength = KeyValueInformation->DataLength;
- KeyName.Buffer = (PWCHAR)KeyValueInformation->Data;
-
- RtlAppendUnicodeStringToString(&KeyPath, &EnumU);
RtlAppendUnicodeStringToString(&KeyPath, &KeyName);
- RtlAppendUnicodeStringToString(&KeyPath, &DevParamU);
+ /* initialize reference string attributes */
InitializeObjectAttributes(&ObjectAttributes,
&KeyPath,
OBJ_CASE_INSENSITIVE,
- 0,
+ GuidKey,
NULL);
- Status = ZwCreateKey(DeviceInterfaceKey,
- DesiredAccess,
- &ObjectAttributes,
- 0,
- NULL,
- REG_OPTION_NON_VOLATILE,
- NULL);
+
+ /* now open device interface key */
+ Status = ZwOpenKey(&hInterfaceKey, KEY_CREATE_SUB_KEY, &ObjectAttributes);
+
+ if (NT_SUCCESS(Status))
+ {
+ /* check if it provides a DeviceParameters key */
+ InitializeObjectAttributes(&ObjectAttributes, &DevParamU, OBJ_CASE_INSENSITIVE, hInterfaceKey, NULL);
+
+ Status = ZwCreateKey(DeviceInterfaceKey, DesiredAccess, &ObjectAttributes, 0, NULL, REG_OPTION_NON_VOLATILE, NULL);
+
+ if (NT_SUCCESS(Status))
+ {
+ /* DeviceParameters key present */
+ ZwClose(hInterfaceKey);
+ }
+ else
+ {
+ /* fall back to device interface */
+ *DeviceInterfaceKey = hInterfaceKey;
+ Status = STATUS_SUCCESS;
+ }
+ }
+
+ /* close class key */
+ ZwClose(GuidKey);
+ ExFreePool(KeyInformation);
return Status;
}
From 8051b8115a84839441a03f8ca00d631bb2ecf4af Mon Sep 17 00:00:00 2001
From: Johannes Anderwald
Date: Fri, 2 Apr 2010 14:21:15 +0000
Subject: [PATCH 005/261] [NTOS] - Make sure SymbolicLink is null terminated
svn path=/trunk/; revision=46682
---
reactos/ntoskrnl/io/iomgr/deviface.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/reactos/ntoskrnl/io/iomgr/deviface.c b/reactos/ntoskrnl/io/iomgr/deviface.c
index 391c6813664..d5b2246f31f 100644
--- a/reactos/ntoskrnl/io/iomgr/deviface.c
+++ b/reactos/ntoskrnl/io/iomgr/deviface.c
@@ -1061,6 +1061,7 @@ IoRegisterDeviceInterface(IN PDEVICE_OBJECT PhysicalDeviceObject,
RtlAppendUnicodeStringToString(SymbolicLinkName, ReferenceString);
}
SymbolicLinkName->Buffer[SymbolicLinkName->Length/sizeof(WCHAR)] = L'\0';
+ SymbolicLinkName->Length += sizeof(WCHAR);
/* Write symbolic link name in registry */
SymbolicLinkName->Buffer[1] = '\\';
From 249d39c17aec6380a6e0b3c7ad3ff29527b822e6 Mon Sep 17 00:00:00 2001
From: Eric Kohl
Date: Fri, 2 Apr 2010 15:13:24 +0000
Subject: [PATCH 006/261] [NTOSKRNL] - Check the SeTakeOwnership privilege only
if WRITE_OWNER access is desired. - Move the check for token ownership from
SepAccessCheck because this check grants access rights rather than checking
them.
svn path=/trunk/; revision=46683
---
reactos/ntoskrnl/se/semgr.c | 169 ++++++++++++++++++++++++------------
1 file changed, 112 insertions(+), 57 deletions(-)
diff --git a/reactos/ntoskrnl/se/semgr.c b/reactos/ntoskrnl/se/semgr.c
index d06fb04bbb6..5e22e67d05e 100644
--- a/reactos/ntoskrnl/se/semgr.c
+++ b/reactos/ntoskrnl/se/semgr.c
@@ -314,6 +314,31 @@ SepSidInToken(PACCESS_TOKEN _Token,
return FALSE;
}
+static BOOLEAN
+SepTokenIsOwner(PACCESS_TOKEN Token,
+ PSECURITY_DESCRIPTOR SecurityDescriptor)
+{
+ NTSTATUS Status;
+ PSID Sid = NULL;
+ BOOLEAN Defaulted;
+
+ Status = RtlGetOwnerSecurityDescriptor(SecurityDescriptor,
+ &Sid,
+ &Defaulted);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("RtlGetOwnerSecurityDescriptor() failed (Status %lx)\n", Status);
+ return FALSE;
+ }
+
+ if (Sid == NULL)
+ {
+ DPRINT1("Owner Sid is NULL\n");
+ return FALSE;
+ }
+
+ return SepSidInToken(Token, Sid);
+}
VOID NTAPI
SeQuerySecurityAccessMask(IN SECURITY_INFORMATION SecurityInformation,
@@ -438,22 +463,25 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
CurrentAccess = PreviouslyGrantedAccess;
/* RULE 2: Check token for 'take ownership' privilege */
- Privilege.Luid = SeTakeOwnershipPrivilege;
- Privilege.Attributes = SE_PRIVILEGE_ENABLED;
-
- if (SepPrivilegeCheck(Token,
- &Privilege,
- 1,
- PRIVILEGE_SET_ALL_NECESSARY,
- AccessMode))
+ if (DesiredAccess & WRITE_OWNER)
{
- CurrentAccess |= WRITE_OWNER;
- if ((DesiredAccess & ~VALID_INHERIT_FLAGS) ==
- (CurrentAccess & ~VALID_INHERIT_FLAGS))
+ Privilege.Luid = SeTakeOwnershipPrivilege;
+ Privilege.Attributes = SE_PRIVILEGE_ENABLED;
+
+ if (SepPrivilegeCheck(Token,
+ &Privilege,
+ 1,
+ PRIVILEGE_SET_ALL_NECESSARY,
+ AccessMode))
{
- *GrantedAccess = CurrentAccess;
- *AccessStatus = STATUS_SUCCESS;
- return TRUE;
+ CurrentAccess |= WRITE_OWNER;
+ if ((DesiredAccess & ~VALID_INHERIT_FLAGS) ==
+ (CurrentAccess & ~VALID_INHERIT_FLAGS))
+ {
+ *GrantedAccess = CurrentAccess;
+ *AccessStatus = STATUS_SUCCESS;
+ return TRUE;
+ }
}
}
@@ -465,29 +493,6 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
return FALSE;
}
- /* RULE 3: Check whether the token is the owner */
- Status = RtlGetOwnerSecurityDescriptor(SecurityDescriptor,
- &Sid,
- &Defaulted);
- if (!NT_SUCCESS(Status))
- {
- DPRINT1("RtlGetOwnerSecurityDescriptor() failed (Status %lx)\n", Status);
- *AccessStatus = Status;
- return FALSE;
- }
-
- if (Sid && SepSidInToken(Token, Sid))
- {
- CurrentAccess |= (READ_CONTROL | WRITE_DAC);
- if ((DesiredAccess & ~VALID_INHERIT_FLAGS) ==
- (CurrentAccess & ~VALID_INHERIT_FLAGS))
- {
- *GrantedAccess = CurrentAccess;
- *AccessStatus = STATUS_SUCCESS;
- return TRUE;
- }
- }
-
/* Fail if DACL is absent */
if (Present == FALSE)
{
@@ -649,16 +654,43 @@ SeAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
if (!SubjectContextLocked)
SeLockSubjectContext(SubjectSecurityContext);
- /* Call the internal function */
- ret = SepAccessCheck(SecurityDescriptor,
- SubjectSecurityContext,
- DesiredAccess,
- PreviouslyGrantedAccess,
- Privileges,
- GenericMapping,
- AccessMode,
- GrantedAccess,
- AccessStatus);
+ /* Check if the token is the owner and grant WRITE_DAC and READ_CONTROL rights */
+ if (DesiredAccess & (WRITE_DAC | READ_CONTROL | MAXIMUM_ALLOWED))
+ {
+ PACCESS_TOKEN Token = SubjectSecurityContext->ClientToken ?
+ SubjectSecurityContext->ClientToken : SubjectSecurityContext->PrimaryToken;
+
+ if (SepTokenIsOwner(Token,
+ SecurityDescriptor))
+ {
+ if (DesiredAccess & MAXIMUM_ALLOWED)
+ PreviouslyGrantedAccess |= (WRITE_DAC | READ_CONTROL);
+ else
+ PreviouslyGrantedAccess |= (DesiredAccess & (WRITE_DAC | READ_CONTROL));
+
+ DesiredAccess &= ~(WRITE_DAC | READ_CONTROL);
+ }
+ }
+
+ if (DesiredAccess == 0)
+ {
+ *GrantedAccess = PreviouslyGrantedAccess;
+ *AccessStatus = STATUS_SUCCESS;
+ ret = TRUE;
+ }
+ else
+ {
+ /* Call the internal function */
+ ret = SepAccessCheck(SecurityDescriptor,
+ SubjectSecurityContext,
+ DesiredAccess,
+ PreviouslyGrantedAccess,
+ Privileges,
+ GenericMapping,
+ AccessMode,
+ GrantedAccess,
+ AccessStatus);
+ }
/* Release the lock if needed */
if (!SubjectContextLocked)
@@ -686,6 +718,7 @@ NtAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
PSECURITY_DESCRIPTOR CapturedSecurityDescriptor = NULL;
SECURITY_SUBJECT_CONTEXT SubjectSecurityContext;
KPROCESSOR_MODE PreviousMode = ExGetPreviousMode();
+ ACCESS_MASK PreviouslyGrantedAccess = 0;
PTOKEN Token;
NTSTATUS Status;
PAGED_CODE();
@@ -801,16 +834,38 @@ NtAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
SubjectSecurityContext.ProcessAuditId = NULL;
SeLockSubjectContext(&SubjectSecurityContext);
- /* Now perform the access check */
- SepAccessCheck(SecurityDescriptor, // FIXME: use CapturedSecurityDescriptor
- &SubjectSecurityContext,
- DesiredAccess,
- 0,
- &PrivilegeSet, //FIXME
- GenericMapping,
- PreviousMode,
- GrantedAccess,
- AccessStatus);
+ /* Check if the token is the owner and grant WRITE_DAC and READ_CONTROL rights */
+ if (DesiredAccess & (WRITE_DAC | READ_CONTROL | MAXIMUM_ALLOWED))
+ {
+ if (SepTokenIsOwner(Token, SecurityDescriptor)) // FIXME: use CapturedSecurityDescriptor
+ {
+ if (DesiredAccess & MAXIMUM_ALLOWED)
+ PreviouslyGrantedAccess |= (WRITE_DAC | READ_CONTROL);
+ else
+ PreviouslyGrantedAccess |= (DesiredAccess & (WRITE_DAC | READ_CONTROL));
+
+ DesiredAccess &= ~(WRITE_DAC | READ_CONTROL);
+ }
+ }
+
+ if (DesiredAccess == 0)
+ {
+ *GrantedAccess = PreviouslyGrantedAccess;
+ *AccessStatus = STATUS_SUCCESS;
+ }
+ else
+ {
+ /* Now perform the access check */
+ SepAccessCheck(SecurityDescriptor, // FIXME: use CapturedSecurityDescriptor
+ &SubjectSecurityContext,
+ DesiredAccess,
+ PreviouslyGrantedAccess,
+ &PrivilegeSet, //FIXME
+ GenericMapping,
+ PreviousMode,
+ GrantedAccess,
+ AccessStatus);
+ }
/* Unlock subject context */
SeUnlockSubjectContext(&SubjectSecurityContext);
From b4a44e7a78ce9cae7e4ba97eea472f1427698942 Mon Sep 17 00:00:00 2001
From: Johannes Anderwald
Date: Fri, 2 Apr 2010 16:25:18 +0000
Subject: [PATCH 007/261] [KSPROXY, MSDVBNP] - Remove remaining DebugBreak -
Add debug traces
svn path=/trunk/; revision=46684
---
reactos/dll/directx/ksproxy/enumpins.cpp | 1 -
reactos/dll/directx/ksproxy/input_pin.cpp | 10 ----
reactos/dll/directx/ksproxy/mediasample.cpp | 2 -
reactos/dll/directx/ksproxy/output_pin.cpp | 44 ++++++++++++---
reactos/dll/directx/ksproxy/precomp.h | 2 +-
reactos/dll/directx/ksproxy/proxy.cpp | 62 ++++++++++++++++++---
reactos/dll/directx/msdvbnp/enumpins.cpp | 8 ---
7 files changed, 91 insertions(+), 38 deletions(-)
diff --git a/reactos/dll/directx/ksproxy/enumpins.cpp b/reactos/dll/directx/ksproxy/enumpins.cpp
index a6c3bdfbd16..da07796d066 100644
--- a/reactos/dll/directx/ksproxy/enumpins.cpp
+++ b/reactos/dll/directx/ksproxy/enumpins.cpp
@@ -71,7 +71,6 @@ CEnumPins::QueryInterface(
OutputDebugStringW(Buffer);
CoTaskMemFree(lpstr);
-DebugBreak();
return E_NOINTERFACE;
}
diff --git a/reactos/dll/directx/ksproxy/input_pin.cpp b/reactos/dll/directx/ksproxy/input_pin.cpp
index 51b78726ccb..e56eacb938c 100644
--- a/reactos/dll/directx/ksproxy/input_pin.cpp
+++ b/reactos/dll/directx/ksproxy/input_pin.cpp
@@ -700,7 +700,6 @@ CInputPin::Receive(IMediaSample *pSample)
{
#ifdef KSPROXY_TRACE
OutputDebugStringW(L"CInputPin::Receive NotImplemented\n");
- DebugBreak();
#endif
return E_NOTIMPL;
@@ -712,7 +711,6 @@ CInputPin::ReceiveMultiple(IMediaSample **pSamples, long nSamples, long *nSample
{
#ifdef KSPROXY_TRACE
OutputDebugStringW(L"CInputPin::ReceiveMultiple NotImplemented\n");
- DebugBreak();
#endif
return E_NOTIMPL;
@@ -724,7 +722,6 @@ CInputPin::ReceiveCanBlock( void)
{
#ifdef KSPROXY_TRACE
OutputDebugStringW(L"CInputPin::ReceiveCanBlock NotImplemented\n");
- DebugBreak();
#endif
return S_FALSE;
@@ -923,7 +920,6 @@ CInputPin::KsQualityNotify(
OutputDebugStringW(L"CInputPin::KsQualityNotify NotImplemented\n");
#endif
- DebugBreak();
return E_NOTIMPL;
}
@@ -1114,7 +1110,6 @@ CInputPin::Connect(IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
{
#ifdef KSPROXY_TRACE
OutputDebugStringW(L"CInputPin::Connect NotImplemented\n");
- DebugBreak();
#endif
return NOERROR;
}
@@ -1199,7 +1194,6 @@ CInputPin::ConnectionMediaType(AM_MEDIA_TYPE *pmt)
#ifdef KSPROXY_TRACE
OutputDebugStringW(L"CInputPin::ConnectionMediaType NotImplemented\n");
- DebugBreak();
#endif
return E_NOTIMPL;
@@ -1496,7 +1490,6 @@ CInputPin::CreatePin(
WCHAR Buffer[100];
swprintf(Buffer, L"CInputPin::CreatePin unexpected communication %u %s\n", m_Communication, m_PinName);
OutputDebugStringW(Buffer);
- DebugBreak();
#endif
hr = E_FAIL;
}
@@ -1629,7 +1622,6 @@ CInputPin::CreatePinHandle(
{
#ifdef KSPROXY_TRACE
OutputDebugStringW(L"CInputPin::CreatePinHandle GetSupportedSets failed\n");
- DebugBreak();
#endif
return hr;
}
@@ -1640,7 +1632,6 @@ CInputPin::CreatePinHandle(
{
#ifdef KSPROXY_TRACE
OutputDebugStringW(L"CInputPin::CreatePinHandle LoadProxyPlugins failed\n");
- DebugBreak();
#endif
return hr;
}
@@ -1783,7 +1774,6 @@ CInputPin::LoadProxyPlugins(
{
// store plugin
m_Plugins.push_back(pUnknown);
-DebugBreak();
}
// close key
RegCloseKey(hSubKey);
diff --git a/reactos/dll/directx/ksproxy/mediasample.cpp b/reactos/dll/directx/ksproxy/mediasample.cpp
index e0411938444..28270cdc3bd 100644
--- a/reactos/dll/directx/ksproxy/mediasample.cpp
+++ b/reactos/dll/directx/ksproxy/mediasample.cpp
@@ -21,7 +21,6 @@ public:
STDMETHODIMP_(ULONG) Release()
{
InterlockedDecrement(&m_Ref);
- DebugBreak();
if (!m_Ref)
{
if (m_Allocator)
@@ -280,7 +279,6 @@ STDMETHODCALLTYPE
CMediaSample::SetMediaType(AM_MEDIA_TYPE *pMediaType)
{
OutputDebugStringW(L"CMediaSample::SetMediaType NotImplemented\n");
- DebugBreak();
return E_NOTIMPL;
}
diff --git a/reactos/dll/directx/ksproxy/output_pin.cpp b/reactos/dll/directx/ksproxy/output_pin.cpp
index 17f07804a20..f9f37725c53 100644
--- a/reactos/dll/directx/ksproxy/output_pin.cpp
+++ b/reactos/dll/directx/ksproxy/output_pin.cpp
@@ -1548,7 +1548,6 @@ COutputPin::Connect(IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
OutputDebugStringW(L"COutputPin::Connect no IMemInputPin interface\n");
#endif
- DebugBreak();
return hr;
}
@@ -1946,13 +1945,26 @@ COutputPin::CreatePin(
// query for pin medium
hr = KsQueryMediums(&MediumList);
if (FAILED(hr))
+ {
+#ifdef KSPROXY_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"COutputPin::CreatePin KsQueryMediums failed %lx\n", hr);
+ OutputDebugStringW(Buffer);
+#endif
return hr;
+ }
// query for pin interface
hr = KsQueryInterfaces(&InterfaceList);
if (FAILED(hr))
{
// failed
+#ifdef KSPROXY_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"COutputPin::CreatePin KsQueryInterfaces failed %lx\n", hr);
+ OutputDebugStringW(Buffer);
+#endif
+
CoTaskMemFree(MediumList);
return hr;
}
@@ -2003,6 +2015,12 @@ COutputPin::CreatePin(
CoTaskMemFree(MediumList);
CoTaskMemFree(InterfaceList);
+#ifdef KSPROXY_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"COutputPin::CreatePin failed to create interface handler %lx\n", hr);
+ OutputDebugStringW(Buffer);
+#endif
+
return hr;
}
@@ -2010,7 +2028,12 @@ COutputPin::CreatePin(
hr = InterfaceHandler->KsSetPin((IKsPin*)this);
if (FAILED(hr))
{
- // failed to load interface handler plugin
+ // failed to initialize interface handler plugin
+#ifdef KSPROXY_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"COutputPin::CreatePin failed to initialize interface handler %lx\n", hr);
+ OutputDebugStringW(Buffer);
+#endif
InterfaceHandler->Release();
CoTaskMemFree(MediumList);
CoTaskMemFree(InterfaceList);
@@ -2027,7 +2050,6 @@ COutputPin::CreatePin(
WCHAR Buffer[100];
swprintf(Buffer, L"COutputPin::CreatePin unexpected communication %u %s\n", m_Communication, m_PinName);
OutputDebugStringW(Buffer);
- DebugBreak();
#endif
hr = E_FAIL;
@@ -2037,6 +2059,12 @@ COutputPin::CreatePin(
CoTaskMemFree(MediumList);
CoTaskMemFree(InterfaceList);
+#ifdef KSPROXY_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"COutputPin::CreatePin Result %lx\n", hr);
+ OutputDebugStringW(Buffer);
+#endif
+
return hr;
}
@@ -2058,6 +2086,8 @@ COutputPin::CreatePinHandle(
//KSPROPERTY Property;
//ULONG BytesReturned;
+ OutputDebugStringW(L"COutputPin::CreatePinHandle\n");
+
if (m_hPin != INVALID_HANDLE_VALUE)
{
// pin already exists
@@ -2173,7 +2203,6 @@ COutputPin::CreatePinHandle(
if (FAILED(InitializeIOThread()))
{
OutputDebugStringW(L"COutputPin::CreatePinHandle failed to initialize i/o thread\n");
- DebugBreak();
}
LPGUID pGuid;
@@ -2184,8 +2213,7 @@ COutputPin::CreatePinHandle(
if (FAILED(hr))
{
#ifdef KSPROXY_TRACE
- OutputDebugStringW(L"CInputPin::CreatePinHandle GetSupportedSets failed\n");
- DebugBreak();
+ OutputDebugStringW(L"COutputPin::CreatePinHandle GetSupportedSets failed\n");
#endif
return hr;
}
@@ -2195,8 +2223,7 @@ COutputPin::CreatePinHandle(
if (FAILED(hr))
{
#ifdef KSPROXY_TRACE
- OutputDebugStringW(L"CInputPin::CreatePinHandle LoadProxyPlugins failed\n");
- DebugBreak();
+ OutputDebugStringW(L"COutputPin::CreatePinHandle LoadProxyPlugins failed\n");
#endif
return hr;
}
@@ -2338,7 +2365,6 @@ COutputPin::LoadProxyPlugins(
{
// store plugin
m_Plugins.push_back(pUnknown);
-DebugBreak();
}
// close key
RegCloseKey(hSubKey);
diff --git a/reactos/dll/directx/ksproxy/precomp.h b/reactos/dll/directx/ksproxy/precomp.h
index eae5de0f1aa..f7268b1e026 100644
--- a/reactos/dll/directx/ksproxy/precomp.h
+++ b/reactos/dll/directx/ksproxy/precomp.h
@@ -3,7 +3,7 @@
#define _FORCENAMELESSUNION
#define BUILDING_KS
#define _KSDDK_
-//#define KSPROXY_TRACE
+#define KSPROXY_TRACE
#include
//#include
#include
diff --git a/reactos/dll/directx/ksproxy/proxy.cpp b/reactos/dll/directx/ksproxy/proxy.cpp
index bd34ec8184b..175eff205ca 100644
--- a/reactos/dll/directx/ksproxy/proxy.cpp
+++ b/reactos/dll/directx/ksproxy/proxy.cpp
@@ -1954,7 +1954,6 @@ CKsProxy::IsDirty()
{
#ifdef KSPROXY_TRACE
OutputDebugStringW(L"CKsProxy::IsDirty Notimplemented\n");
- DebugBreak();
#endif
return E_NOTIMPL;
}
@@ -2035,7 +2034,6 @@ CKsProxy::Load(
}while(Length > 0);
- DebugBreak();
return S_OK;
}
@@ -2059,7 +2057,6 @@ CKsProxy::GetSizeMax(
{
#ifdef KSPROXY_TRACE
OutputDebugStringW(L"CKsProxy::GetSizeMax Notimplemented\n");
- DebugBreak();
#endif
return E_NOTIMPL;
@@ -2480,23 +2477,50 @@ CKsProxy::CreatePins()
// query current instance count
hr = GetPinInstanceCount(Index, &Instances);
if (FAILED(hr))
+ {
+#ifdef KSPROXY_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CKsProxy::CreatePins GetPinInstanceCount failed with %lx\n", hr);
+ OutputDebugStringW(Buffer);
+#endif
continue;
+ }
+
// query pin communication;
hr = GetPinCommunication(Index, &Communication);
if (FAILED(hr))
+ {
+#ifdef KSPROXY_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CKsProxy::CreatePins GetPinCommunication failed with %lx\n", hr);
+ OutputDebugStringW(Buffer);
+#endif
continue;
+ }
if (Instances.CurrentCount == Instances.PossibleCount)
{
// already maximum reached for this pin
+#ifdef KSPROXY_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CKsProxy::CreatePins Instances.CurrentCount == Instances.PossibleCount\n");
+ OutputDebugStringW(Buffer);
+#endif
continue;
}
// get direction of pin
hr = GetPinDataflow(Index, &DataFlow);
if (FAILED(hr))
+ {
+#ifdef KSPROXY_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CKsProxy::CreatePins GetPinDataflow failed with %lx\n", hr);
+ OutputDebugStringW(Buffer);
+#endif
continue;
+ }
if (DataFlow == KSPIN_DATAFLOW_IN)
hr = GetPinName(Index, DataFlow, InputPin, &PinName);
@@ -2504,7 +2528,14 @@ CKsProxy::CreatePins()
hr = GetPinName(Index, DataFlow, OutputPin, &PinName);
if (FAILED(hr))
+ {
+#ifdef KSPROXY_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CKsProxy::CreatePins GetPinName failed with %lx\n", hr);
+ OutputDebugStringW(Buffer);
+#endif
continue;
+ }
// construct the pins
if (DataFlow == KSPIN_DATAFLOW_IN)
@@ -2512,6 +2543,11 @@ CKsProxy::CreatePins()
hr = CInputPin_Constructor((IBaseFilter*)this, PinName, m_hDevice, Index, Communication, IID_IPin, (void**)&pPin);
if (FAILED(hr))
{
+#ifdef KSPROXY_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CKsProxy::CreatePins CInputPin_Constructor failed with %lx\n", hr);
+ OutputDebugStringW(Buffer);
+#endif
CoTaskMemFree(PinName);
continue;
}
@@ -2522,6 +2558,11 @@ CKsProxy::CreatePins()
hr = COutputPin_Constructor((IBaseFilter*)this, PinName, Index, Communication, IID_IPin, (void**)&pPin);
if (FAILED(hr))
{
+#ifdef KSPROXY_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CKsProxy::CreatePins COutputPin_Constructor failed with %lx\n", hr);
+ OutputDebugStringW(Buffer);
+#endif
CoTaskMemFree(PinName);
continue;
}
@@ -2627,9 +2668,12 @@ CKsProxy::Load(IPropertyBag *pPropBag, IErrorLog *pErrorLog)
hr = LoadProxyPlugins(pGuid, NumGuids);
if (FAILED(hr))
{
+#if 0 //HACK
CloseHandle(m_hDevice);
m_hDevice = NULL;
return hr;
+#endif
+ OutputDebugStringW(L"CKsProxy::LoadProxyPlugins failed!\n");
}
// free sets
@@ -2638,6 +2682,14 @@ CKsProxy::Load(IPropertyBag *pPropBag, IErrorLog *pErrorLog)
// now create the input / output pins
hr = CreatePins();
+#ifdef KSPROXY_TRACE
+ swprintf(Buffer, L"CKsProxy::Load CreatePins %lx\n", hr);
+ OutputDebugStringW(Buffer);
+#endif
+
+ //HACK
+ hr = S_OK;
+
return hr;
}
@@ -2986,10 +3038,6 @@ STDMETHODCALLTYPE
CKsProxy::EnumPins(
IEnumPins **ppEnum)
{
-#ifdef KSPROXY_TRACE
- OutputDebugStringW(L"CKsProxy::EnumPins\n");
-#endif
-
return CEnumPins_fnConstructor(m_Pins, IID_IEnumPins, (void**)ppEnum);
}
diff --git a/reactos/dll/directx/msdvbnp/enumpins.cpp b/reactos/dll/directx/msdvbnp/enumpins.cpp
index 567705907b7..9466aaae8f3 100644
--- a/reactos/dll/directx/msdvbnp/enumpins.cpp
+++ b/reactos/dll/directx/msdvbnp/enumpins.cpp
@@ -155,14 +155,6 @@ CEnumPins_fnConstructor(
{
CEnumPins * handler = new CEnumPins(NumPins, pins);
-#ifdef MSDVBNP_TRACE
- WCHAR Buffer[MAX_PATH];
- LPOLESTR lpstr;
- StringFromCLSID(riid, &lpstr);
- swprintf(Buffer, L"CEnumPins_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown);
- OutputDebugStringW(Buffer);
-#endif
-
if (!handler)
return E_OUTOFMEMORY;
From 215e19921976ca34e1c34f0dfbcf37a8bbd8e069 Mon Sep 17 00:00:00 2001
From: Johannes Anderwald
Date: Fri, 2 Apr 2010 16:38:48 +0000
Subject: [PATCH 008/261] [KS] - Instantiated pins use as the control mutex the
mutex from the filter - Fix KsAcquireControl & KsReleaseControl - Fix
handling of IRP_MN_QUERY_INTERFACE - Filter centric ks filters expect an
array of KSPROCESSPIN_INDEXENTRY. Allocate array when intializing filter /
new pin factory is added - Store result of pin intersection handler when
result is STATUS_BUFFER_OVERFLOW - Implement setting / retrieving of master
clock - Implement setting / retrieving pin state - Partly implement setting
pin data format - Implement IKsReferenceClock interface - Implement
KsPinGetReferenceClockInterface - Add sanity checks to KsGetPinFromIrp -
Partly implement handling IOCTL_KS_READ_STREAM / IOCTL_KS_WRITE_STREAM -
Supply filter property sets when an IOCTL_KS_PROPERTY request arrives -
Release again filter mutex when closing the pin - Implement allocating a
clock - Tuner pin fails with STATUS_IO_DEVICE_ERROR when set to KSSTATE_RUN,
needs more investigation
svn path=/trunk/; revision=46685
---
reactos/drivers/ksfilter/ks/api.c | 4 +-
reactos/drivers/ksfilter/ks/device.c | 3 +-
reactos/drivers/ksfilter/ks/driver.c | 6 +-
reactos/drivers/ksfilter/ks/filter.c | 101 ++-
reactos/drivers/ksfilter/ks/filterfactory.c | 11 +-
reactos/drivers/ksfilter/ks/kstypes.h | 2 +-
reactos/drivers/ksfilter/ks/pin.c | 854 ++++++++++++++++++--
reactos/drivers/ksfilter/ks/priv.h | 21 +
reactos/drivers/ksfilter/ks/property.c | 2 +-
9 files changed, 903 insertions(+), 101 deletions(-)
diff --git a/reactos/drivers/ksfilter/ks/api.c b/reactos/drivers/ksfilter/ks/api.c
index ef83f9dbedf..8ec11860e02 100644
--- a/reactos/drivers/ksfilter/ks/api.c
+++ b/reactos/drivers/ksfilter/ks/api.c
@@ -1589,7 +1589,7 @@ KsAcquireControl(
/* sanity check */
ASSERT(BasicHeader->Type == KsObjectTypeFilter || BasicHeader->Type == KsObjectTypePin);
- KeWaitForSingleObject(&BasicHeader->ControlMutex, Executive, KernelMode, FALSE, NULL);
+ KeWaitForSingleObject(BasicHeader->ControlMutex, Executive, KernelMode, FALSE, NULL);
}
@@ -1606,7 +1606,7 @@ KsReleaseControl(
/* sanity check */
ASSERT(BasicHeader->Type == KsObjectTypeFilter || BasicHeader->Type == KsObjectTypePin);
- KeReleaseMutex(&BasicHeader->ControlMutex, FALSE);
+ KeReleaseMutex(BasicHeader->ControlMutex, FALSE);
}
diff --git a/reactos/drivers/ksfilter/ks/device.c b/reactos/drivers/ksfilter/ks/device.c
index 345689f49b8..cf1d3f73216 100644
--- a/reactos/drivers/ksfilter/ks/device.c
+++ b/reactos/drivers/ksfilter/ks/device.c
@@ -492,7 +492,7 @@ IKsDevice_Pnp(
}
case IRP_MN_QUERY_INTERFACE:
{
- Status = STATUS_SUCCESS;
+ Status = STATUS_UNSUCCESSFUL;
/* check for pnp notification support */
if (Dispatch)
{
@@ -508,6 +508,7 @@ IKsDevice_Pnp(
if (NT_SUCCESS(Status))
{
/* driver supports a private interface */
+ DPRINT1("IRP_MN_QUERY_INTERFACE Device supports interface\n");
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
diff --git a/reactos/drivers/ksfilter/ks/driver.c b/reactos/drivers/ksfilter/ks/driver.c
index 409977d63d5..949e1285c54 100644
--- a/reactos/drivers/ksfilter/ks/driver.c
+++ b/reactos/drivers/ksfilter/ks/driver.c
@@ -39,10 +39,10 @@ KsGetDevice(
{
PKSBASIC_HEADER BasicHeader = (PKSBASIC_HEADER)((ULONG_PTR)Object - sizeof(KSBASIC_HEADER));
- DPRINT("KsGetDevice %p BasicHeader %p Type %x\n", Object, BasicHeader, BasicHeader->Type);
-
- ASSERT(BasicHeader->Type == KsObjectTypeFilterFactory || BasicHeader->Type == KsObjectTypeFilter || BasicHeader->Type == BasicHeader->Type);
+ ASSERT(BasicHeader->Type == KsObjectTypeFilterFactory || BasicHeader->Type == KsObjectTypeFilter || BasicHeader->Type == KsObjectTypePin);
ASSERT(BasicHeader->KsDevice);
+ ASSERT(BasicHeader->KsDevice->Started);
+ ASSERT(BasicHeader->KsDevice->PhysicalDeviceObject);
return BasicHeader->KsDevice;
}
diff --git a/reactos/drivers/ksfilter/ks/filter.c b/reactos/drivers/ksfilter/ks/filter.c
index 5d06ca2f49d..5c8fe7f463f 100644
--- a/reactos/drivers/ksfilter/ks/filter.c
+++ b/reactos/drivers/ksfilter/ks/filter.c
@@ -26,6 +26,7 @@ typedef struct
ULONG PinDescriptorCount;
PKSFILTERFACTORY Factory;
PFILE_OBJECT FileObject;
+ KMUTEX ControlMutex;
KMUTEX ProcessingMutex;
@@ -34,7 +35,7 @@ typedef struct
ULONG *PinInstanceCount;
PKSPIN * FirstPin;
- KSPROCESSPIN_INDEXENTRY ProcessPinIndex;
+ PKSPROCESSPIN_INDEXENTRY ProcessPinIndex;
}IKsFilterImpl;
@@ -294,18 +295,20 @@ IKsFilter_fnAddProcessPin(
/* first acquire processing mutex */
KeWaitForSingleObject(&This->ProcessingMutex, Executive, KernelMode, FALSE, NULL);
- /* edit process pin descriptor */
- Status = _KsEdit(This->Filter.Bag,
- (PVOID*)&This->ProcessPinIndex.Pins,
- (This->ProcessPinIndex.Count + 1) * sizeof(PKSPROCESSPIN),
- (This->ProcessPinIndex.Count) * sizeof(PKSPROCESSPIN),
+ /* sanity check */
+ ASSERT(This->PinDescriptorCount > ProcessPin->Pin->Id);
+
+ /* allocate new process pin array */
+ Status = _KsEdit(This->Filter.Bag, (PVOID*)&This->ProcessPinIndex[ProcessPin->Pin->Id].Pins,
+ (This->PinDescriptorCount + 1) * sizeof(PKSPROCESSPIN),
+ This->PinDescriptorCount * sizeof(PKSPROCESSPIN),
0);
if (NT_SUCCESS(Status))
{
- /* add new process pin */
- This->ProcessPinIndex.Pins[This->ProcessPinIndex.Count] = ProcessPin;
- This->ProcessPinIndex.Count++;
+ /* store process pin */
+ This->ProcessPinIndex[ProcessPin->Pin->Id].Pins[This->ProcessPinIndex[ProcessPin->Pin->Id].Count] = ProcessPin;
+ This->ProcessPinIndex[ProcessPin->Pin->Id].Count++;
}
/* release process mutex */
@@ -321,25 +324,39 @@ IKsFilter_fnRemoveProcessPin(
IN PKSPROCESSPIN ProcessPin)
{
ULONG Index;
+ ULONG Count;
+ PKSPROCESSPIN * Pins;
+
IKsFilterImpl * This = (IKsFilterImpl*)CONTAINING_RECORD(iface, IKsFilterImpl, lpVtbl);
/* first acquire processing mutex */
KeWaitForSingleObject(&This->ProcessingMutex, Executive, KernelMode, FALSE, NULL);
- /* iterate through process pin index array and search for the process pin to be removed */
- for(Index = 0; Index < This->ProcessPinIndex.Count; Index++)
+ /* sanity check */
+ ASSERT(ProcessPin->Pin);
+ ASSERT(ProcessPin->Pin->Id);
+
+ Count = This->ProcessPinIndex[ProcessPin->Pin->Id].Count;
+ Pins = This->ProcessPinIndex[ProcessPin->Pin->Id].Pins;
+
+ /* search for current process pin */
+ for(Index = 0; Index < Count; Index++)
{
- if (This->ProcessPinIndex.Pins[Index] == ProcessPin)
+ if (Pins[Index] == ProcessPin)
{
- /* found process pin */
- if (Index + 1 < This->ProcessPinIndex.Count)
- {
- /* erase entry */
- RtlMoveMemory(&This->ProcessPinIndex.Pins[Index], &This->ProcessPinIndex.Pins[Index+1], This->ProcessPinIndex.Count - Index - 1);
- }
- /* decrement process pin count */
- This->ProcessPinIndex.Count--;
+ RtlMoveMemory(&Pins[Index], &Pins[Index + 1], (Count - (Index + 1)) * sizeof(PKSPROCESSPIN));
+ break;
}
+
+ }
+
+ /* decrement pin count */
+ This->ProcessPinIndex[ProcessPin->Pin->Id].Count--;
+
+ if (!This->ProcessPinIndex[ProcessPin->Pin->Id].Count)
+ {
+ /* clear entry object bag will delete it */
+ This->ProcessPinIndex[ProcessPin->Pin->Id].Pins = NULL;
}
/* release process mutex */
@@ -394,8 +411,9 @@ NTAPI
IKsFilter_fnGetProcessDispatch(
IKsFilter * iface)
{
- UNIMPLEMENTED
- return NULL;
+ IKsFilterImpl * This = (IKsFilterImpl*)CONTAINING_RECORD(iface, IKsFilterImpl, lpVtbl);
+
+ return This->ProcessPinIndex;
}
static IKsFilterVtbl vt_IKsFilter =
@@ -619,7 +637,7 @@ KspHandleDataIntersection(
Data,
&Length);
- if (Status == STATUS_SUCCESS)
+ if (Status == STATUS_SUCCESS || Status == STATUS_BUFFER_OVERFLOW)
{
IoStatus->Information = Length;
break;
@@ -784,6 +802,7 @@ IKsFilter_CreateDescriptors(
This->PinInstanceCount = NULL;
This->PinDescriptors = NULL;
This->PinDescriptorsEx = NULL;
+ This->ProcessPinIndex = NULL;
This->PinDescriptorCount = 0;
/* initialize topology descriptor */
@@ -842,8 +861,6 @@ IKsFilter_CreateDescriptors(
return Status;
}
-
-
/* add new pin factory */
RtlMoveMemory(This->PinDescriptorsEx, FilterDescriptor->PinDescriptors, sizeof(KSPIN_DESCRIPTOR_EX) * FilterDescriptor->PinDescriptorsCount);
@@ -852,8 +869,19 @@ IKsFilter_CreateDescriptors(
RtlMoveMemory(&This->PinDescriptors[Index], &FilterDescriptor->PinDescriptors[Index].PinDescriptor, sizeof(KSPIN_DESCRIPTOR));
}
+ /* allocate process pin index */
+ Status = _KsEdit(This->Filter.Bag, (PVOID*)&This->ProcessPinIndex, sizeof(KSPROCESSPIN_INDEXENTRY) * FilterDescriptor->PinDescriptorsCount,
+ sizeof(KSPROCESSPIN_INDEXENTRY) * FilterDescriptor->PinDescriptorsCount, 0);
+
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT("IKsFilter_CreateDescriptors _KsEdit failed %lx\n", Status);
+ return Status;
+ }
+
/* store new pin descriptor count */
This->PinDescriptorCount = FilterDescriptor->PinDescriptorsCount;
+
}
if (FilterDescriptor->NodeDescriptorsCount)
@@ -991,7 +1019,7 @@ IKsFilter_DispatchCreatePin(
ASSERT(This->Header.Type == KsObjectTypeFilter);
/* acquire control mutex */
- KeWaitForSingleObject(&This->Header.ControlMutex, Executive, KernelMode, FALSE, NULL);
+ KeWaitForSingleObject(This->Header.ControlMutex, Executive, KernelMode, FALSE, NULL);
/* now validate the connect request */
Status = KsValidateConnectRequest(Irp, This->PinDescriptorCount, This->PinDescriptors, &Connect);
@@ -1029,7 +1057,7 @@ IKsFilter_DispatchCreatePin(
}
/* release control mutex */
- KeReleaseMutex(&This->Header.ControlMutex, FALSE);
+ KeReleaseMutex(This->Header.ControlMutex, FALSE);
if (Status != STATUS_PENDING)
{
@@ -1176,6 +1204,8 @@ KspCreateFilter(
return STATUS_INSUFFICIENT_RESOURCES;
}
+ DPRINT("KspCreateFilter Flags %lx\n", Factory->FilterDescriptor->Flags);
+
/* initialize pin create item */
CreateItem[0].Create = IKsFilter_DispatchCreatePin;
CreateItem[0].Context = (PVOID)This;
@@ -1202,7 +1232,8 @@ KspCreateFilter(
This->Header.KsDevice = &DeviceExtension->DeviceHeader->KsDevice;
This->Header.Parent.KsFilterFactory = iface->lpVtbl->GetStruct(iface);
This->Header.Type = KsObjectTypeFilter;
- KeInitializeMutex(&This->Header.ControlMutex, 0);
+ This->Header.ControlMutex = &This->ControlMutex;
+ KeInitializeMutex(This->Header.ControlMutex, 0);
InitializeListHead(&This->Header.EventList);
KeInitializeSpinLock(&This->Header.EventListLock);
@@ -1224,8 +1255,9 @@ KspCreateFilter(
if (Factory->FilterDescriptor->Dispatch->Create)
{
/* now let driver initialize the filter instance */
- DPRINT("Before instantiating filter Filter %p This %p KSBASIC_HEADER %u\n", &This->Filter, This, sizeof(KSBASIC_HEADER));
+
ASSERT(This->Header.KsDevice);
+ ASSERT(This->Header.KsDevice->Started);
Status = Factory->FilterDescriptor->Dispatch->Create(&This->Filter, Irp);
if (!NT_SUCCESS(Status) && Status != STATUS_PENDING)
@@ -1432,6 +1464,17 @@ KsFilterCreatePinFactory (
RtlMoveMemory(&This->PinDescriptorsEx[This->PinDescriptorCount], InPinDescriptor, sizeof(KSPIN_DESCRIPTOR_EX));
RtlMoveMemory(&This->PinDescriptors[This->PinDescriptorCount], &InPinDescriptor->PinDescriptor, sizeof(KSPIN_DESCRIPTOR));
+
+ /* allocate process pin index */
+ Status = _KsEdit(This->Filter.Bag, (PVOID*)&This->ProcessPinIndex, sizeof(KSPROCESSPIN_INDEXENTRY) * Count,
+ sizeof(KSPROCESSPIN_INDEXENTRY) * This->PinDescriptorCount, 0);
+
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT("KsFilterCreatePinFactory _KsEdit failed %lx\n", Status);
+ return Status;
+ }
+
/* store new pin id */
*PinID = This->PinDescriptorCount;
diff --git a/reactos/drivers/ksfilter/ks/filterfactory.c b/reactos/drivers/ksfilter/ks/filterfactory.c
index a16b2900069..18b2147b679 100644
--- a/reactos/drivers/ksfilter/ks/filterfactory.c
+++ b/reactos/drivers/ksfilter/ks/filterfactory.c
@@ -21,6 +21,8 @@ typedef struct
PFNKSFILTERFACTORYPOWER WakeCallback;
LIST_ENTRY SymbolicLinkList;
+ KMUTEX ControlMutex;
+
}IKsFilterFactoryImpl;
VOID
@@ -225,17 +227,16 @@ IKsFilterFactory_fnInitialize(
This->Header.Parent.KsDevice = &DeviceExtension->DeviceHeader->KsDevice;
This->DeviceHeader = DeviceExtension->DeviceHeader;
+ /* initialize filter factory control mutex */
+ This->Header.ControlMutex = &This->ControlMutex;
+ KeInitializeMutex(This->Header.ControlMutex, 0);
+
/* unused fields */
- KeInitializeMutex(&This->Header.ControlMutex, 0);
InitializeListHead(&This->Header.EventList);
KeInitializeSpinLock(&This->Header.EventListLock);
-
InitializeListHead(&This->SymbolicLinkList);
- /* initialize filter factory control mutex */
- KeInitializeMutex(&This->Header.ControlMutex, 0);
-
/* does the device use a reference string */
if (RefString || !Descriptor->ReferenceGuid)
{
diff --git a/reactos/drivers/ksfilter/ks/kstypes.h b/reactos/drivers/ksfilter/ks/kstypes.h
index 4bdc04c0bcb..d5c7588fda1 100644
--- a/reactos/drivers/ksfilter/ks/kstypes.h
+++ b/reactos/drivers/ksfilter/ks/kstypes.h
@@ -58,7 +58,7 @@ typedef struct
{
KSOBJECTTYPE Type;
PKSDEVICE KsDevice;
- KMUTEX ControlMutex;
+ PRKMUTEX ControlMutex;
LIST_ENTRY EventList;
KSPIN_LOCK EventListLock;
union
diff --git a/reactos/drivers/ksfilter/ks/pin.c b/reactos/drivers/ksfilter/ks/pin.c
index 5d1ee77a6df..70e17e6607a 100644
--- a/reactos/drivers/ksfilter/ks/pin.c
+++ b/reactos/drivers/ksfilter/ks/pin.c
@@ -29,8 +29,9 @@ typedef struct
LIST_ENTRY Entry;
IKsPinVtbl *lpVtbl;
-
LONG ref;
+
+ IKsFilter * Filter;
KMUTEX ProcessingMutex;
PFILE_OBJECT FileObject;
@@ -50,8 +51,355 @@ typedef struct
PFNKSPINFRAMERETURN FrameReturn;
PFNKSPINIRPCOMPLETION IrpCompletion;
+ KSCLOCK_FUNCTIONTABLE ClockTable;
+ PFILE_OBJECT ClockFileObject;
+ IKsReferenceClockVtbl * lpVtblReferenceClock;
+ PKSDEFAULTCLOCK DefaultClock;
+
}IKsPinImpl;
+NTSTATUS NTAPI IKsPin_PinStatePropertyHandler(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data);
+NTSTATUS NTAPI IKsPin_PinDataFormatPropertyHandler(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data);
+NTSTATUS NTAPI IKsPin_PinAllocatorFramingPropertyHandler(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data);
+NTSTATUS NTAPI IKsPin_PinStreamAllocator(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data);
+NTSTATUS NTAPI IKsPin_PinMasterClock(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data);
+NTSTATUS NTAPI IKsPin_PinPipeId(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data);
+
+
+
+DEFINE_KSPROPERTY_CONNECTIONSET(PinConnectionSet, IKsPin_PinStatePropertyHandler, IKsPin_PinDataFormatPropertyHandler, IKsPin_PinAllocatorFramingPropertyHandler);
+DEFINE_KSPROPERTY_STREAMSET(PinStreamSet, IKsPin_PinStreamAllocator, IKsPin_PinMasterClock, IKsPin_PinPipeId);
+
+//TODO
+// KSPROPSETID_Connection
+// KSPROPERTY_CONNECTION_ACQUIREORDERING
+// KSPROPSETID_StreamInterface
+// KSPROPERTY_STREAMINTERFACE_HEADERSIZE
+
+KSPROPERTY_SET PinPropertySet[] =
+{
+ {
+ &KSPROPSETID_Connection,
+ sizeof(PinConnectionSet) / sizeof(KSPROPERTY_ITEM),
+ (const KSPROPERTY_ITEM*)&PinConnectionSet,
+ 0,
+ NULL
+ },
+ {
+ &KSPROPSETID_Stream,
+ sizeof(PinStreamSet) / sizeof(KSPROPERTY_ITEM),
+ (const KSPROPERTY_ITEM*)&PinStreamSet,
+ 0,
+ NULL
+ }
+};
+
+const GUID KSPROPSETID_Connection = {0x1D58C920L, 0xAC9B, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}};
+const GUID KSPROPSETID_Stream = {0x65aaba60L, 0x98ae, 0x11cf, {0xa1, 0x0d, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4}};
+const GUID KSPROPSETID_Clock = {0xDF12A4C0L, 0xAC17, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}};
+
+NTSTATUS
+NTAPI
+IKsPin_PinStreamAllocator(
+ IN PIRP Irp,
+ IN PKSIDENTIFIER Request,
+ IN OUT PVOID Data)
+{
+ UNIMPLEMENTED
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS
+NTAPI
+IKsPin_PinMasterClock(
+ IN PIRP Irp,
+ IN PKSIDENTIFIER Request,
+ IN OUT PVOID Data)
+{
+ PIO_STACK_LOCATION IoStack;
+ PKSIOBJECT_HEADER ObjectHeader;
+ IKsPinImpl * This;
+ NTSTATUS Status = STATUS_SUCCESS;
+ PHANDLE Handle;
+ PFILE_OBJECT FileObject;
+ KPROCESSOR_MODE Mode;
+ KSPROPERTY Property;
+ ULONG BytesReturned;
+
+ /* get current irp stack */
+ IoStack = IoGetCurrentIrpStackLocation(Irp);
+
+ DPRINT("IKsPin_PinMasterClock\n");
+
+ /* sanity check */
+ ASSERT(IoStack->FileObject);
+ ASSERT(IoStack->FileObject->FsContext2);
+
+ /* get the object header */
+ ObjectHeader = (PKSIOBJECT_HEADER)IoStack->FileObject->FsContext2;
+
+ /* locate ks pin implemention from KSPIN offset */
+ This = (IKsPinImpl*)CONTAINING_RECORD(ObjectHeader->ObjectType, IKsPinImpl, Pin);
+
+ /* acquire control mutex */
+ KeWaitForSingleObject(This->BasicHeader.ControlMutex, Executive, KernelMode, FALSE, NULL);
+
+ Handle = (PHANDLE)Data;
+
+ if (Request->Flags & KSPROPERTY_TYPE_GET)
+ {
+ if (This->Pin.Descriptor->PinDescriptor.Communication != KSPIN_COMMUNICATION_NONE &&
+ This->Pin.Descriptor->Dispatch &&
+ (This->Pin.Descriptor->Flags & KSPIN_FLAG_IMPLEMENT_CLOCK))
+ {
+ *Handle = NULL;
+ Status = STATUS_SUCCESS;
+ }
+ else
+ {
+ /* no clock available */
+ Status = STATUS_UNSUCCESSFUL;
+ }
+ }
+ else if (Request->Flags & KSPROPERTY_TYPE_SET)
+ {
+ if (This->Pin.ClientState != KSSTATE_STOP)
+ {
+ /* can only set in stopped state */
+ Status = STATUS_INVALID_DEVICE_STATE;
+ }
+ else
+ {
+ if (*Handle)
+ {
+ Mode = ExGetPreviousMode();
+
+ Status = ObReferenceObjectByHandle(*Handle, SYNCHRONIZE | DIRECTORY_QUERY, IoFileObjectType, Mode, (PVOID*)&FileObject, NULL);
+
+ DPRINT("IKsPin_PinMasterClock ObReferenceObjectByHandle %lx\n", Status);
+ if (NT_SUCCESS(Status))
+ {
+ Property.Set = KSPROPSETID_Clock;
+ Property.Id = KSPROPERTY_CLOCK_FUNCTIONTABLE;
+ Property.Flags = KSPROPERTY_TYPE_GET;
+
+ Status = KsSynchronousIoControlDevice(FileObject, KernelMode, IOCTL_KS_PROPERTY, &Property, sizeof(KSPROPERTY), &This->ClockTable, sizeof(KSCLOCK_FUNCTIONTABLE), &BytesReturned);
+
+ DPRINT("IKsPin_PinMasterClock KSPROPERTY_CLOCK_FUNCTIONTABLE %lx\n", Status);
+
+ if (NT_SUCCESS(Status))
+ {
+ This->ClockFileObject = FileObject;
+ }
+ else
+ {
+ ObDereferenceObject(FileObject);
+ }
+ }
+ }
+ else
+ {
+ /* zeroing clock handle */
+ RtlZeroMemory(&This->ClockTable, sizeof(KSCLOCK_FUNCTIONTABLE));
+ Status = STATUS_SUCCESS;
+ if (This->ClockFileObject)
+ {
+ FileObject = This->ClockFileObject;
+ This->ClockFileObject = NULL;
+
+ ObDereferenceObject(This->ClockFileObject);
+ }
+ }
+ }
+ }
+
+ /* release processing mutex */
+ KeReleaseMutex(This->BasicHeader.ControlMutex, FALSE);
+
+ DPRINT("IKsPin_PinStatePropertyHandler Status %lx\n", Status);
+ return Status;
+}
+
+
+
+NTSTATUS
+NTAPI
+IKsPin_PinPipeId(
+ IN PIRP Irp,
+ IN PKSIDENTIFIER Request,
+ IN OUT PVOID Data)
+{
+ UNIMPLEMENTED
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+NTSTATUS
+NTAPI
+IKsPin_PinStatePropertyHandler(
+ IN PIRP Irp,
+ IN PKSIDENTIFIER Request,
+ IN OUT PVOID Data)
+{
+ PIO_STACK_LOCATION IoStack;
+ PKSIOBJECT_HEADER ObjectHeader;
+ IKsPinImpl * This;
+ NTSTATUS Status = STATUS_SUCCESS;
+ KSSTATE OldState;
+ PKSSTATE NewState;
+
+ /* get current irp stack */
+ IoStack = IoGetCurrentIrpStackLocation(Irp);
+
+ DPRINT("IKsPin_PinStatePropertyHandler\n");
+
+ /* sanity check */
+ ASSERT(IoStack->FileObject);
+ ASSERT(IoStack->FileObject->FsContext2);
+
+ /* get the object header */
+ ObjectHeader = (PKSIOBJECT_HEADER)IoStack->FileObject->FsContext2;
+
+ /* locate ks pin implemention from KSPIN offset */
+ This = (IKsPinImpl*)CONTAINING_RECORD(ObjectHeader->ObjectType, IKsPinImpl, Pin);
+
+ /* acquire control mutex */
+ KeWaitForSingleObject(This->BasicHeader.ControlMutex, Executive, KernelMode, FALSE, NULL);
+
+ /* grab state */
+ NewState = (PKSSTATE)Data;
+
+ if (Request->Flags & KSPROPERTY_TYPE_GET)
+ {
+ *NewState = This->Pin.DeviceState;
+ Irp->IoStatus.Information = sizeof(KSSTATE);
+ }
+ else if (Request->Flags & KSPROPERTY_TYPE_SET)
+ {
+ if (This->Pin.Descriptor->Dispatch->SetDeviceState)
+ {
+ /* backup old state */
+ OldState = This->Pin.ClientState;
+
+ /* set new state */
+ This->Pin.ClientState = *NewState;
+
+ /* check if it supported */
+ Status = This->Pin.Descriptor->Dispatch->SetDeviceState(&This->Pin, *NewState, OldState);
+
+ DPRINT("IKsPin_PinStatePropertyHandler NewState %lu Result %lx\n", *NewState, Status);
+
+ if (!NT_SUCCESS(Status))
+ {
+ /* revert to old state */
+ This->Pin.ClientState = OldState;
+ DbgBreakPoint();
+ }
+ else
+ {
+ /* update device state */
+ This->Pin.DeviceState = *NewState;
+ }
+ }
+ else
+ {
+ /* just set new state */
+ This->Pin.DeviceState = *NewState;
+ This->Pin.ClientState = *NewState;
+ }
+ }
+
+ /* release processing mutex */
+ KeReleaseMutex(This->BasicHeader.ControlMutex, FALSE);
+
+ DPRINT("IKsPin_PinStatePropertyHandler Status %lx\n", Status);
+ return Status;
+}
+
+NTSTATUS
+NTAPI
+IKsPin_PinAllocatorFramingPropertyHandler(
+ IN PIRP Irp,
+ IN PKSIDENTIFIER Request,
+ IN OUT PVOID Data)
+{
+ UNIMPLEMENTED
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS
+NTAPI
+IKsPin_PinDataFormatPropertyHandler(
+ IN PIRP Irp,
+ IN PKSPROPERTY Request,
+ IN OUT PVOID Data)
+{
+ PIO_STACK_LOCATION IoStack;
+ PKSIOBJECT_HEADER ObjectHeader;
+ IKsPinImpl * This;
+ NTSTATUS Status = STATUS_SUCCESS;
+
+ /* get current irp stack */
+ IoStack = IoGetCurrentIrpStackLocation(Irp);
+
+ DPRINT("IKsPin_PinDataFormatPropertyHandler\n");
+
+ /* sanity check */
+ ASSERT(IoStack->FileObject);
+ ASSERT(IoStack->FileObject->FsContext2);
+
+ /* get the object header */
+ ObjectHeader = (PKSIOBJECT_HEADER)IoStack->FileObject->FsContext2;
+
+ /* locate ks pin implemention from KSPIN offset */
+ This = (IKsPinImpl*)CONTAINING_RECORD(ObjectHeader->ObjectType, IKsPinImpl, Pin);
+
+ /* acquire control mutex */
+ KeWaitForSingleObject(This->BasicHeader.ControlMutex, Executive, KernelMode, FALSE, NULL);
+
+ if (Request->Flags & KSPROPERTY_TYPE_GET)
+ {
+ if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < This->Pin.ConnectionFormat->FormatSize)
+ {
+ /* buffer too small */
+ Irp->IoStatus.Information = This->Pin.ConnectionFormat->FormatSize;
+ Status = STATUS_BUFFER_TOO_SMALL;
+ }
+ else
+ {
+ /* copy format */
+ RtlMoveMemory(Data, This->Pin.ConnectionFormat, This->Pin.ConnectionFormat->FormatSize);
+ }
+ }
+ else if (Request->Flags & KSPROPERTY_TYPE_SET)
+ {
+ /* set format */
+ if (This->Pin.Descriptor->Flags & KSPIN_FLAG_FIXED_FORMAT)
+ {
+ /* format cannot be changed */
+ Status = STATUS_INVALID_DEVICE_REQUEST;
+ }
+ else
+ {
+ /* FIXME check if the format is supported */
+ Status = _KsEdit(This->Pin.Bag, (PVOID*)&This->Pin.ConnectionFormat, IoStack->Parameters.DeviceIoControl.OutputBufferLength, This->Pin.ConnectionFormat->FormatSize, 0);
+
+ if (NT_SUCCESS(Status))
+ {
+ /* store new format */
+ RtlMoveMemory(This->Pin.ConnectionFormat, Data, IoStack->Parameters.DeviceIoControl.OutputBufferLength);
+ }
+ }
+ }
+
+ /* release processing mutex */
+ KeReleaseMutex(This->BasicHeader.ControlMutex, FALSE);
+
+ DPRINT("IKsPin_PinDataFormatPropertyHandler Status %lx\n", Status);
+
+ return Status;
+}
+
NTSTATUS
NTAPI
IKsPin_fnQueryInterface(
@@ -67,6 +415,7 @@ IKsPin_fnQueryInterface(
_InterlockedIncrement(&This->ref);
return STATUS_SUCCESS;
}
+ DbgBreakPoint();
return STATUS_UNSUCCESSFUL;
}
@@ -270,6 +619,209 @@ static IKsPinVtbl vt_IKsPin =
//==============================================================
+NTSTATUS
+NTAPI
+IKsReferenceClock_fnQueryInterface(
+ IKsReferenceClock * iface,
+ IN REFIID refiid,
+ OUT PVOID* Output)
+{
+ IKsPinImpl * This = (IKsPinImpl*)CONTAINING_RECORD(iface, IKsPinImpl, lpVtblReferenceClock);
+
+ return IKsPin_fnQueryInterface((IKsPin*)&This->lpVtbl, refiid, Output);
+}
+
+ULONG
+NTAPI
+IKsReferenceClock_fnAddRef(
+ IKsReferenceClock * iface)
+{
+ IKsPinImpl * This = (IKsPinImpl*)CONTAINING_RECORD(iface, IKsPinImpl, lpVtblReferenceClock);
+
+ return IKsPin_fnAddRef((IKsPin*)&This->lpVtbl);
+}
+
+ULONG
+NTAPI
+IKsReferenceClock_fnRelease(
+ IKsReferenceClock * iface)
+{
+ IKsPinImpl * This = (IKsPinImpl*)CONTAINING_RECORD(iface, IKsPinImpl, lpVtblReferenceClock);
+
+ return IKsPin_fnRelease((IKsPin*)&This->lpVtbl);
+}
+
+LONGLONG
+NTAPI
+IKsReferenceClock_fnGetTime(
+ IKsReferenceClock * iface)
+{
+ LONGLONG Result;
+
+ IKsPinImpl * This = (IKsPinImpl*)CONTAINING_RECORD(iface, IKsPinImpl, lpVtblReferenceClock);
+
+ if (!This->ClockFileObject || !This->ClockTable.GetTime)
+ {
+ Result = 0;
+ }
+ else
+ {
+ Result = This->ClockTable.GetTime(This->ClockFileObject);
+ }
+
+ return Result;
+}
+
+LONGLONG
+NTAPI
+IKsReferenceClock_fnGetPhysicalTime(
+ IKsReferenceClock * iface)
+{
+ LONGLONG Result;
+
+ IKsPinImpl * This = (IKsPinImpl*)CONTAINING_RECORD(iface, IKsPinImpl, lpVtblReferenceClock);
+
+ if (!This->ClockFileObject || !This->ClockTable.GetPhysicalTime)
+ {
+ Result = 0;
+ }
+ else
+ {
+ Result = This->ClockTable.GetPhysicalTime(This->ClockFileObject);
+ }
+
+ return Result;
+}
+
+
+LONGLONG
+NTAPI
+IKsReferenceClock_fnGetCorrelatedTime(
+ IKsReferenceClock * iface,
+ OUT PLONGLONG SystemTime)
+{
+ LONGLONG Result;
+
+ IKsPinImpl * This = (IKsPinImpl*)CONTAINING_RECORD(iface, IKsPinImpl, lpVtblReferenceClock);
+
+ if (!This->ClockFileObject || !This->ClockTable.GetCorrelatedTime)
+ {
+ Result = 0;
+ }
+ else
+ {
+ Result = This->ClockTable.GetCorrelatedTime(This->ClockFileObject, SystemTime);
+ }
+
+ return Result;
+}
+
+
+LONGLONG
+NTAPI
+IKsReferenceClock_fnGetCorrelatedPhysicalTime(
+ IKsReferenceClock * iface,
+ OUT PLONGLONG SystemTime)
+{
+ LONGLONG Result;
+
+ IKsPinImpl * This = (IKsPinImpl*)CONTAINING_RECORD(iface, IKsPinImpl, lpVtblReferenceClock);
+
+ if (!This->ClockFileObject || !This->ClockTable.GetCorrelatedPhysicalTime)
+ {
+ Result = 0;
+ }
+ else
+ {
+ Result = This->ClockTable.GetCorrelatedPhysicalTime(This->ClockFileObject, SystemTime);
+ }
+
+ return Result;
+}
+
+NTSTATUS
+NTAPI
+IKsReferenceClock_fnGetResolution(
+ IKsReferenceClock * iface,
+ OUT PKSRESOLUTION Resolution)
+{
+ KSPROPERTY Property;
+ ULONG BytesReturned;
+
+ IKsPinImpl * This = (IKsPinImpl*)CONTAINING_RECORD(iface, IKsPinImpl, lpVtblReferenceClock);
+
+ DPRINT1("IKsReferenceClock_fnGetResolution\n");
+
+ if (!This->ClockFileObject)
+ {
+ Resolution->Error = 0;
+ Resolution->Granularity = 1;
+ DPRINT1("IKsReferenceClock_fnGetResolution Using HACK\n");
+ return STATUS_SUCCESS;
+ }
+
+
+ if (!This->ClockFileObject)
+ return STATUS_DEVICE_NOT_READY;
+
+
+ Property.Set = KSPROPSETID_Clock;
+ Property.Id = KSPROPERTY_CLOCK_RESOLUTION;
+ Property.Flags = KSPROPERTY_TYPE_GET;
+
+ return KsSynchronousIoControlDevice(This->ClockFileObject, KernelMode, IOCTL_KS_PROPERTY, &Property, sizeof(KSPROPERTY), Resolution, sizeof(KSRESOLUTION), &BytesReturned);
+
+}
+
+NTSTATUS
+NTAPI
+IKsReferenceClock_fnGetState(
+ IKsReferenceClock * iface,
+ OUT PKSSTATE State)
+{
+ KSPROPERTY Property;
+ ULONG BytesReturned;
+
+ IKsPinImpl * This = (IKsPinImpl*)CONTAINING_RECORD(iface, IKsPinImpl, lpVtblReferenceClock);
+
+ DPRINT1("IKsReferenceClock_fnGetState\n");
+
+ if (!This->ClockFileObject)
+ {
+ *State = This->Pin.ClientState;
+ DPRINT1("IKsReferenceClock_fnGetState Using HACK\n");
+ return STATUS_SUCCESS;
+ }
+
+
+ if (!This->ClockFileObject)
+ return STATUS_DEVICE_NOT_READY;
+
+
+ Property.Set = KSPROPSETID_Clock;
+ Property.Id = KSPROPERTY_CLOCK_RESOLUTION;
+ Property.Flags = KSPROPERTY_TYPE_GET;
+
+ return KsSynchronousIoControlDevice(This->ClockFileObject, KernelMode, IOCTL_KS_PROPERTY, &Property, sizeof(KSPROPERTY), State, sizeof(KSSTATE), &BytesReturned);
+}
+
+static IKsReferenceClockVtbl vt_ReferenceClock =
+{
+ IKsReferenceClock_fnQueryInterface,
+ IKsReferenceClock_fnAddRef,
+ IKsReferenceClock_fnRelease,
+ IKsReferenceClock_fnGetTime,
+ IKsReferenceClock_fnGetPhysicalTime,
+ IKsReferenceClock_fnGetCorrelatedTime,
+ IKsReferenceClock_fnGetCorrelatedPhysicalTime,
+ IKsReferenceClock_fnGetResolution,
+ IKsReferenceClock_fnGetState
+};
+
+
+//==============================================================
+
+
/*
@implemented
*/
@@ -340,6 +892,7 @@ KsPinAttemptProcessing(
IN BOOLEAN Asynchronous)
{
DPRINT("KsPinAttemptProcessing\n");
+DbgBreakPoint();
UNIMPLEMENTED
}
@@ -448,7 +1001,7 @@ KsPinGetParentFilter(
}
/*
- @unimplemented
+ @implemented
*/
NTSTATUS
NTAPI
@@ -456,9 +1009,22 @@ NTAPI
IN PKSPIN Pin,
OUT PIKSREFERENCECLOCK* Interface)
{
- UNIMPLEMENTED
- DPRINT("KsPinGetReferenceClockInterface Pin %p Interface %p\n", Pin, Interface);
- return STATUS_UNSUCCESSFUL;
+ NTSTATUS Status = STATUS_DEVICE_NOT_READY;
+ IKsPinImpl * This = (IKsPinImpl*)CONTAINING_RECORD(Pin, IKsPinImpl, Pin);
+
+ if (This->ClockFileObject)
+ {
+ /* clock is available */
+ *Interface = (PIKSREFERENCECLOCK)&This->lpVtblReferenceClock;
+ Status = STATUS_SUCCESS;
+ }
+//HACK
+ *Interface = (PIKSREFERENCECLOCK)&This->lpVtblReferenceClock;
+ Status = STATUS_SUCCESS;
+
+ DPRINT("KsPinGetReferenceClockInterface Pin %p Interface %p Status %x\n", Pin, Interface, Status);
+
+ return Status;
}
/*
@@ -547,15 +1113,26 @@ KsGetPinFromIrp(
IN PIRP Irp)
{
PKSIOBJECT_HEADER ObjectHeader;
+ PKSPIN Pin;
+ PKSBASIC_HEADER Header;
PIO_STACK_LOCATION IoStack = IoGetCurrentIrpStackLocation(Irp);
DPRINT("KsGetPinFromIrp\n");
/* get object header */
ObjectHeader = (PKSIOBJECT_HEADER)IoStack->FileObject->FsContext2;
- /* return object type */
- return (PKSPIN)ObjectHeader->ObjectType;
+ if (!ObjectHeader)
+ return NULL;
+
+ Pin = (PKSPIN)ObjectHeader->ObjectType;
+ Header = (PKSBASIC_HEADER)((ULONG_PTR)Pin - sizeof(KSBASIC_HEADER));
+
+ /* sanity check */
+ ASSERT(Header->Type == KsObjectTypePin);
+
+ /* return object type */
+ return Pin;
}
@@ -629,6 +1206,7 @@ KsPinGetLeadingEdgeStreamPointer(
{
UNIMPLEMENTED
DPRINT("KsPinGetLeadingEdgeStreamPointer Pin %p State %x\n", Pin, State);
+DbgBreakPoint();
return NULL;
}
@@ -685,6 +1263,7 @@ KsStreamPointerUnlock(
{
UNIMPLEMENTED
DPRINT("KsStreamPointerUnlock\n");
+DbgBreakPoint();
}
/*
@@ -700,7 +1279,7 @@ KsStreamPointerAdvanceOffsetsAndUnlock(
IN BOOLEAN Eject)
{
DPRINT("KsStreamPointerAdvanceOffsets\n");
-
+DbgBreakPoint();
UNIMPLEMENTED
}
@@ -718,7 +1297,7 @@ KsStreamPointerDelete(
PKSISTREAM_POINTER Pointer = (PKSISTREAM_POINTER)StreamPointer;
DPRINT("KsStreamPointerDelete\n");
-
+DbgBreakPoint();
This = (IKsPinImpl*)CONTAINING_RECORD(Pointer->StreamPointer.Pin, IKsPinImpl, Pin);
/* point to first stream pointer */
@@ -766,6 +1345,7 @@ KsStreamPointerClone(
{
UNIMPLEMENTED
DPRINT("KsStreamPointerClone\n");
+DbgBreakPoint();
return STATUS_NOT_IMPLEMENTED;
}
@@ -878,7 +1458,7 @@ KsPinGetFirstCloneStreamPointer(
IKsPinImpl * This;
DPRINT("KsPinGetFirstCloneStreamPointer %p\n", Pin);
-
+DbgBreakPoint();
This = (IKsPinImpl*)CONTAINING_RECORD(Pin, IKsPinImpl, Pin);
/* return first cloned stream pointer */
return &This->ClonedStreamPointer->StreamPointer;
@@ -896,7 +1476,7 @@ KsStreamPointerGetNextClone(
PKSISTREAM_POINTER Pointer = (PKSISTREAM_POINTER)StreamPointer;
DPRINT("KsStreamPointerGetNextClone\n");
-
+DbgBreakPoint();
/* is there a another cloned stream pointer */
if (!Pointer->Next)
return NULL;
@@ -904,6 +1484,64 @@ KsStreamPointerGetNextClone(
/* return next stream pointer */
return &Pointer->Next->StreamPointer;
}
+NTSTATUS
+IKsPin_DispatchKsStream(
+ PDEVICE_OBJECT DeviceObject,
+ PIRP Irp,
+ IKsPinImpl * This)
+{
+ PKSPROCESSPIN_INDEXENTRY ProcessPinIndex;
+ PKSFILTER Filter;
+ NTSTATUS Status = STATUS_SUCCESS;
+
+ DPRINT("IKsPin_DispatchKsStream\n");
+
+ /* FIXME handle reset states */
+ ASSERT(This->Pin.ResetState == KSRESET_END);
+
+ /* mark irp as pending */
+ IoMarkIrpPending(Irp);
+
+ /* add irp to cancelable queue */
+ KsAddIrpToCancelableQueue(&This->IrpList, &This->IrpListLock, Irp, KsListEntryTail, NULL /* FIXME */);
+
+ if (This->Pin.Descriptor->Dispatch->Process)
+ {
+ /* it is a pin centric avstream */
+ ASSERT(0);
+ //Status = This->Pin.Descriptor->Dispatch->Process(&This->Pin);
+ /* TODO */
+ }
+ else
+ {
+ /* filter-centric avstream */
+ ASSERT(This->Filter);
+
+ ProcessPinIndex = This->Filter->lpVtbl->GetProcessDispatch(This->Filter);
+ Filter = This->Filter->lpVtbl->GetStruct(This->Filter);
+
+ ASSERT(ProcessPinIndex);
+ ASSERT(Filter);
+ ASSERT(Filter->Descriptor);
+ ASSERT(Filter->Descriptor->Dispatch);
+
+ if (!Filter->Descriptor->Dispatch->Process)
+ {
+ /* invalid device request */
+ DPRINT("Filter Centric Processing No Process Routine\n");
+ Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return STATUS_UNSUCCESSFUL;
+ }
+
+ Status = Filter->Descriptor->Dispatch->Process(Filter, ProcessPinIndex);
+
+ DPRINT("IKsPin_DispatchKsStream FilterCentric: Status %lx \n", Status);
+ }
+
+ return Status;
+}
+
NTSTATUS
IKsPin_DispatchKsProperty(
@@ -941,7 +1579,23 @@ IKsPin_DispatchKsProperty(
NULL,
PropertyItemSize);
- DPRINT("IKsPin_DispatchKsProperty PropertySetCount %lu Status %lu\n", PropertySetsCount, Status);
+ if (Status != STATUS_NOT_FOUND)
+ {
+ /* property was handled by driver */
+ if (Status != STATUS_PENDING)
+ {
+ Irp->IoStatus.Status = Status;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ }
+ return Status;
+ }
+
+ /* try our properties */
+ Status = KspPropertyHandler(Irp,
+ sizeof(PinPropertySet) / sizeof(KSPROPERTY_SET),
+ PinPropertySet,
+ NULL,
+ 0);
if (Status != STATUS_NOT_FOUND)
{
@@ -977,7 +1631,6 @@ IKsPin_DispatchDeviceIoControl(
PIO_STACK_LOCATION IoStack;
PKSIOBJECT_HEADER ObjectHeader;
IKsPinImpl * This;
- NTSTATUS Status = STATUS_SUCCESS;
/* get current irp stack */
IoStack = IoGetCurrentIrpStackLocation(Irp);
@@ -998,38 +1651,17 @@ IKsPin_DispatchDeviceIoControl(
return IKsPin_DispatchKsProperty(DeviceObject, Irp, This);
}
-
- if (IoStack->Parameters.DeviceIoControl.IoControlCode != IOCTL_KS_WRITE_STREAM && IoStack->Parameters.DeviceIoControl.IoControlCode != IOCTL_KS_READ_STREAM)
+ if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_WRITE_STREAM ||
+ IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_READ_STREAM)
{
- UNIMPLEMENTED;
- Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
- Irp->IoStatus.Information = 0;
- IoCompleteRequest(Irp, IO_NO_INCREMENT);
- return STATUS_NOT_IMPLEMENTED;
+ /* handle ks properties */
+ return IKsPin_DispatchKsStream(DeviceObject, Irp, This);
}
- /* mark irp as pending */
- IoMarkIrpPending(Irp);
-
- /* add irp to cancelable queue */
- KsAddIrpToCancelableQueue(&This->IrpList, &This->IrpListLock, Irp, KsListEntryTail, NULL /* FIXME */);
-
- if (This->Pin.Descriptor->Dispatch->Process)
- {
- /* it is a pin centric avstream */
- Status = This->Pin.Descriptor->Dispatch->Process(&This->Pin);
-
- /* TODO */
- }
- else
- {
- /* TODO
- * filter-centric avstream
- */
- UNIMPLEMENTED
- }
-
- return Status;
+ UNIMPLEMENTED;
+ Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return STATUS_NOT_IMPLEMENTED;
}
NTSTATUS
@@ -1057,7 +1689,7 @@ IKsPin_Close(
This = (IKsPinImpl*)CONTAINING_RECORD(ObjectHeader->ObjectType, IKsPinImpl, Pin);
/* acquire filter control mutex */
- KsFilterAcquireControl(This->BasicHeader.Parent.KsFilter);
+ KsFilterAcquireControl(&This->Pin);
if (This->Pin.Descriptor->Dispatch->Close)
{
@@ -1082,6 +1714,9 @@ IKsPin_Close(
}
}
+ /* release filter control mutex */
+ KsFilterReleaseControl(&This->Pin);
+
return Status;
}
@@ -1104,11 +1739,80 @@ IKsPin_DispatchCreateClock(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
- UNIMPLEMENTED;
+ PKSPIN Pin;
+ NTSTATUS Status = STATUS_SUCCESS;
+ IKsPinImpl * This;
+ KSRESOLUTION Resolution;
+ PKSRESOLUTION pResolution = NULL;
+ PKSOBJECT_CREATE_ITEM CreateItem;
- Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
+ DPRINT("IKsPin_DispatchCreateClock\n");
+
+ /* get the create item */
+ CreateItem = KSCREATE_ITEM_IRP_STORAGE(Irp);
+
+ /* sanity check */
+ ASSERT(CreateItem);
+
+ /* get the pin object */
+ Pin = (PKSPIN)CreateItem->Context;
+
+ /* sanity check */
+ ASSERT(Pin);
+
+ /* locate ks pin implemention fro KSPIN offset */
+ This = (IKsPinImpl*)CONTAINING_RECORD(Pin, IKsPinImpl, Pin);
+
+ /* sanity check */
+ ASSERT(This->BasicHeader.Type == KsObjectTypePin);
+ ASSERT(This->BasicHeader.ControlMutex);
+
+ /* acquire control mutex */
+ KsAcquireControl(Pin);
+
+ if ((This->Pin.Descriptor->PinDescriptor.Communication != KSPIN_COMMUNICATION_NONE &&
+ This->Pin.Descriptor->Dispatch) ||
+ (This->Pin.Descriptor->Flags & KSPIN_FLAG_IMPLEMENT_CLOCK))
+ {
+ if (!This->DefaultClock)
+ {
+ if (This->Pin.Descriptor->Dispatch && This->Pin.Descriptor->Dispatch->Clock)
+ {
+ if (This->Pin.Descriptor->Dispatch->Clock->Resolution)
+ {
+ This->Pin.Descriptor->Dispatch->Clock->Resolution(&This->Pin, &Resolution);
+ pResolution = &Resolution;
+ }
+
+ Status = KsAllocateDefaultClockEx(&This->DefaultClock,
+ (PVOID)&This->Pin,
+ (PFNKSSETTIMER)This->Pin.Descriptor->Dispatch->Clock->SetTimer,
+ (PFNKSCANCELTIMER)This->Pin.Descriptor->Dispatch->Clock->CancelTimer,
+ (PFNKSCORRELATEDTIME)This->Pin.Descriptor->Dispatch->Clock->CorrelatedTime,
+ pResolution,
+ 0);
+ }
+ else
+ {
+ Status = KsAllocateDefaultClockEx(&This->DefaultClock, (PVOID)&This->Pin, NULL, NULL, NULL, NULL, 0);
+ }
+ }
+
+ if (NT_SUCCESS(Status))
+ {
+ Status = KsCreateDefaultClock(Irp, This->DefaultClock);
+ }
+ }
+
+ DPRINT("IKsPin_DispatchCreateClock %lx\n", Status);
+
+ /* release control mutex */
+ KsReleaseControl(Pin);
+
+ /* done */
+ Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
- return STATUS_NOT_IMPLEMENTED;
+ return Status;
}
NTSTATUS
@@ -1141,7 +1845,7 @@ static KSDISPATCH_TABLE PinDispatchTable =
NTSTATUS
KspCreatePin(
IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp,
+ IN PIRP Irp,
IN PKSDEVICE KsDevice,
IN IKsFilterFactory * FilterFactory,
IN IKsFilter* Filter,
@@ -1155,11 +1859,15 @@ KspCreatePin(
PKSOBJECT_CREATE_ITEM CreateItem;
NTSTATUS Status;
PKSDATAFORMAT DataFormat;
+ PKSBASIC_HEADER BasicHeader;
/* sanity checks */
ASSERT(Descriptor->Dispatch);
- DPRINT("KspCreatePin\n");
+ DPRINT("KspCreatePin PinId %lu Flags %x\n", Connect->PinId, Descriptor->Flags);
+
+//Output Pin: KSPIN_FLAG_PROCESS_IN_RUN_STATE_ONLY
+//Input Pin: KSPIN_FLAG_FIXED_FORMAT|KSPIN_FLAG_DO_NOT_USE_STANDARD_TRANSPORT|KSPIN_FLAG_FRAMES_NOT_REQUIRED_FOR_PROCESSING
/* get current irp stack */
IoStack = IoGetCurrentIrpStackLocation(Irp);
@@ -1192,14 +1900,24 @@ KspCreatePin(
This->BasicHeader.KsDevice = KsDevice;
This->BasicHeader.Type = KsObjectTypePin;
This->BasicHeader.Parent.KsFilter = Filter->lpVtbl->GetStruct(Filter);
- KeInitializeMutex(&This->BasicHeader.ControlMutex, 0);
+
+ ASSERT(This->BasicHeader.Parent.KsFilter);
+
+ BasicHeader = (PKSBASIC_HEADER)((ULONG_PTR)This->BasicHeader.Parent.KsFilter - sizeof(KSBASIC_HEADER));
+
+ This->BasicHeader.ControlMutex = BasicHeader->ControlMutex;
+ ASSERT(This->BasicHeader.ControlMutex);
+
+
InitializeListHead(&This->BasicHeader.EventList);
KeInitializeSpinLock(&This->BasicHeader.EventListLock);
/* initialize pin */
This->lpVtbl = &vt_IKsPin;
+ This->lpVtblReferenceClock = &vt_ReferenceClock;
This->ref = 1;
This->FileObject = IoStack->FileObject;
+ This->Filter = Filter;
KeInitializeMutex(&This->ProcessingMutex, 0);
InitializeListHead(&This->IrpList);
KeInitializeSpinLock(&This->IrpListLock);
@@ -1216,12 +1934,12 @@ KspCreatePin(
}
/* initialize object bag */
- Device->lpVtbl->InitializeObjectBag(Device, This->Pin.Bag, &This->BasicHeader.ControlMutex); /* is using control mutex right? */
+ Device->lpVtbl->InitializeObjectBag(Device, This->Pin.Bag, NULL);
/* get format */
DataFormat = (PKSDATAFORMAT)(Connect + 1);
- /* initialize ks pin descriptor */
+ /* initialize pin descriptor */
This->Pin.Descriptor = Descriptor;
This->Pin.Context = NULL;
This->Pin.Id = Connect->PinId;
@@ -1253,19 +1971,19 @@ KspCreatePin(
This->Pin.ClientState = KSSTATE_STOP;
/* intialize allocator create item */
- CreateItem[0].Context = (PVOID)This;
+ CreateItem[0].Context = (PVOID)&This->Pin;
CreateItem[0].Create = IKsPin_DispatchCreateAllocator;
CreateItem[0].Flags = KSCREATE_ITEM_FREEONSTOP;
RtlInitUnicodeString(&CreateItem[0].ObjectClass, KSSTRING_Allocator);
/* intialize clock create item */
- CreateItem[1].Context = (PVOID)This;
+ CreateItem[1].Context = (PVOID)&This->Pin;
CreateItem[1].Create = IKsPin_DispatchCreateClock;
CreateItem[1].Flags = KSCREATE_ITEM_FREEONSTOP;
RtlInitUnicodeString(&CreateItem[1].ObjectClass, KSSTRING_Clock);
/* intialize topology node create item */
- CreateItem[2].Context = (PVOID)This;
+ CreateItem[2].Context = (PVOID)&This->Pin;
CreateItem[2].Create = IKsPin_DispatchCreateNode;
CreateItem[2].Flags = KSCREATE_ITEM_FREEONSTOP;
RtlInitUnicodeString(&CreateItem[2].ObjectClass, KSSTRING_TopologyNode);
@@ -1289,15 +2007,21 @@ KspCreatePin(
This->ObjectHeader->Unknown = (PUNKNOWN)&This->lpVtbl;
This->ObjectHeader->ObjectType = (PVOID)&This->Pin;
- /* setup process pin */
- This->ProcessPin.Pin = &This->Pin;
- This->ProcessPin.StreamPointer = (PKSSTREAM_POINTER)This->LeadingEdgeStreamPointer;
-
if (!Descriptor->Dispatch || !Descriptor->Dispatch->Process)
{
/* the pin is part of filter-centric processing filter
* add process pin to filter
*/
+ This->ProcessPin.BytesAvailable = 0;
+ This->ProcessPin.BytesUsed = 0;
+ This->ProcessPin.CopySource = NULL;
+ This->ProcessPin.Data = NULL;
+ This->ProcessPin.DelegateBranch = NULL;
+ This->ProcessPin.Flags = 0;
+ This->ProcessPin.InPlaceCounterpart = NULL;
+ This->ProcessPin.Pin = &This->Pin;
+ This->ProcessPin.StreamPointer = (PKSSTREAM_POINTER)This->LeadingEdgeStreamPointer;
+ This->ProcessPin.Terminate = FALSE;
Status = Filter->lpVtbl->AddProcessPin(Filter, &This->ProcessPin);
DPRINT("KspCreatePin AddProcessPin %lx\n", Status);
@@ -1307,7 +2031,8 @@ KspCreatePin(
/* failed to add process pin */
KsFreeObjectBag((KSOBJECT_BAG)This->Pin.Bag);
KsFreeObjectHeader(&This->ObjectHeader);
-
+ FreeItem(This);
+ FreeItem(CreateItem);
/* return failure code */
return Status;
}
@@ -1315,6 +2040,15 @@ KspCreatePin(
/* FIXME add pin instance to filter instance */
+
+ if (Descriptor->Dispatch && Descriptor->Dispatch->SetDataFormat)
+ {
+ Status = Descriptor->Dispatch->SetDataFormat(&This->Pin, NULL, NULL, This->Pin.ConnectionFormat, NULL);
+ DPRINT("KspCreatePin SetDataFormat %lx\n", Status);
+ DbgBreakPoint();
+ }
+
+
/* does the driver have a pin dispatch */
if (Descriptor->Dispatch && Descriptor->Dispatch->Create)
{
@@ -1323,6 +2057,8 @@ KspCreatePin(
DPRINT("KspCreatePin DispatchCreate %lx\n", Status);
}
+
+
DPRINT("KspCreatePin Status %lx\n", Status);
if (!NT_SUCCESS(Status) && Status != STATUS_PENDING)
diff --git a/reactos/drivers/ksfilter/ks/priv.h b/reactos/drivers/ksfilter/ks/priv.h
index cc0b8f95fef..86ea4ebba64 100644
--- a/reactos/drivers/ksfilter/ks/priv.h
+++ b/reactos/drivers/ksfilter/ks/priv.h
@@ -35,3 +35,24 @@ DEFINE_KSPROPERTY_TABLE(PinSet) {\
DEFINE_KSPROPERTY_ITEM_PIN_CONSTRAINEDDATARANGES(PropGeneral),\
DEFINE_KSPROPERTY_ITEM_PIN_PROPOSEDATAFORMAT(PropGeneral)\
}
+
+#define DEFINE_KSPROPERTY_CONNECTIONSET(PinSet,\
+ PropStateHandler, PropDataFormatHandler, PropAllocatorFraming)\
+DEFINE_KSPROPERTY_TABLE(PinSet) {\
+ DEFINE_KSPROPERTY_ITEM_CONNECTION_STATE(PropStateHandler, PropStateHandler),\
+ DEFINE_KSPROPERTY_ITEM_CONNECTION_DATAFORMAT(PropDataFormatHandler, PropDataFormatHandler),\
+ DEFINE_KSPROPERTY_ITEM_CONNECTION_ALLOCATORFRAMING(PropAllocatorFraming)\
+}
+
+
+#define DEFINE_KSPROPERTY_STREAMSET(PinSet,\
+ PropStreamAllocator, PropMasterClock, PropPipeId)\
+DEFINE_KSPROPERTY_TABLE(PinSet) {\
+ DEFINE_KSPROPERTY_ITEM_STREAM_ALLOCATOR(PropStreamAllocator, PropStreamAllocator),\
+ DEFINE_KSPROPERTY_ITEM_STREAM_MASTERCLOCK(PropMasterClock, PropMasterClock),\
+ DEFINE_KSPROPERTY_ITEM_STREAM_PIPE_ID(PropPipeId, PropPipeId)\
+}
+
+
+
+
diff --git a/reactos/drivers/ksfilter/ks/property.c b/reactos/drivers/ksfilter/ks/property.c
index a2e759ca07a..b1a17e3ed09 100644
--- a/reactos/drivers/ksfilter/ks/property.c
+++ b/reactos/drivers/ksfilter/ks/property.c
@@ -137,7 +137,7 @@ KspPropertyHandler(
/* get input property request */
Property = (PKSPROPERTY)IoStack->Parameters.DeviceIoControl.Type3InputBuffer;
- DPRINT("KspPropertyHandler Irp %p PropertySetsCount %u PropertySet %p Allocator %p PropertyItemSize %u ExpectedPropertyItemSize %u\n", Irp, PropertySetsCount, PropertySet, Allocator, PropertyItemSize, sizeof(KSPROPERTY_ITEM));
+// DPRINT("KspPropertyHandler Irp %p PropertySetsCount %u PropertySet %p Allocator %p PropertyItemSize %u ExpectedPropertyItemSize %u\n", Irp, PropertySetsCount, PropertySet, Allocator, PropertyItemSize, sizeof(KSPROPERTY_ITEM));
/* sanity check */
ASSERT(PropertyItemSize == 0 || PropertyItemSize == sizeof(KSPROPERTY_ITEM));
From d214e123907fdd3bd19bcfbae2537a3254e2a6ca Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Fri, 2 Apr 2010 17:05:39 +0000
Subject: [PATCH 009/261] [FREELOADER] - Fix the ShareDisposition value of COM
port interrupts - Fix the Vector value of the interrupt resources
svn path=/trunk/; revision=46686
---
reactos/boot/freeldr/freeldr/arch/i386/hardware.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/reactos/boot/freeldr/freeldr/arch/i386/hardware.c b/reactos/boot/freeldr/freeldr/arch/i386/hardware.c
index d4654ccd138..1dff167c987 100644
--- a/reactos/boot/freeldr/freeldr/arch/i386/hardware.c
+++ b/reactos/boot/freeldr/freeldr/arch/i386/hardware.c
@@ -1419,10 +1419,10 @@ DetectSerialPorts(PCONFIGURATION_COMPONENT_DATA BusKey)
/* Set Interrupt */
PartialDescriptor = &PartialResourceList->PartialDescriptors[1];
PartialDescriptor->Type = CmResourceTypeInterrupt;
- PartialDescriptor->ShareDisposition = CmResourceShareUndetermined;
+ PartialDescriptor->ShareDisposition = CmResourceShareShared;
PartialDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED;
PartialDescriptor->u.Interrupt.Level = Irq[i];
- PartialDescriptor->u.Interrupt.Vector = 0;
+ PartialDescriptor->u.Interrupt.Vector = Irq[i];
PartialDescriptor->u.Interrupt.Affinity = 0xFFFFFFFF;
/* Set serial data (device specific) */
@@ -1529,7 +1529,7 @@ DetectParallelPorts(PCONFIGURATION_COMPONENT_DATA BusKey)
PartialDescriptor->ShareDisposition = CmResourceShareUndetermined;
PartialDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED;
PartialDescriptor->u.Interrupt.Level = Irq[i];
- PartialDescriptor->u.Interrupt.Vector = 0;
+ PartialDescriptor->u.Interrupt.Vector = Irq[i];
PartialDescriptor->u.Interrupt.Affinity = 0xFFFFFFFF;
}
@@ -1715,7 +1715,7 @@ DetectKeyboardController(PCONFIGURATION_COMPONENT_DATA BusKey)
PartialDescriptor->ShareDisposition = CmResourceShareUndetermined;
PartialDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED;
PartialDescriptor->u.Interrupt.Level = 1;
- PartialDescriptor->u.Interrupt.Vector = 0;
+ PartialDescriptor->u.Interrupt.Vector = 1;
PartialDescriptor->u.Interrupt.Affinity = 0xFFFFFFFF;
/* Set IO Port 0x60 */
@@ -1887,7 +1887,7 @@ DetectPS2Mouse(PCONFIGURATION_COMPONENT_DATA BusKey)
PartialResourceList.PartialDescriptors[0].ShareDisposition = CmResourceShareUndetermined;
PartialResourceList.PartialDescriptors[0].Flags = CM_RESOURCE_INTERRUPT_LATCHED;
PartialResourceList.PartialDescriptors[0].u.Interrupt.Level = 12;
- PartialResourceList.PartialDescriptors[0].u.Interrupt.Vector = 0;
+ PartialResourceList.PartialDescriptors[0].u.Interrupt.Vector = 12;
PartialResourceList.PartialDescriptors[0].u.Interrupt.Affinity = 0xFFFFFFFF;
/* Create controller key */
From 3d1eaacc72e0f4e51e7f665d093bf3be94e2e34f Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Fri, 2 Apr 2010 17:07:38 +0000
Subject: [PATCH 010/261] [PCI] - Fix the Vector value of the interrupt
resource - Actually set the device to use the interrupt that the PnP manager
gave us
svn path=/trunk/; revision=46687
---
reactos/drivers/bus/pci/pdo.c | 48 ++++++++++++++++++++++++++++++++++-
1 file changed, 47 insertions(+), 1 deletion(-)
diff --git a/reactos/drivers/bus/pci/pdo.c b/reactos/drivers/bus/pci/pdo.c
index f19e45c1f4c..27cd878b9c3 100644
--- a/reactos/drivers/bus/pci/pdo.c
+++ b/reactos/drivers/bus/pci/pdo.c
@@ -775,7 +775,7 @@ PdoQueryResources(
Descriptor->ShareDisposition = CmResourceShareShared;
Descriptor->Flags = CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE;
Descriptor->u.Interrupt.Level = PciConfig.u.type0.InterruptLine;
- Descriptor->u.Interrupt.Vector = 0;
+ Descriptor->u.Interrupt.Vector = PciConfig.u.type0.InterruptLine;
Descriptor->u.Interrupt.Affinity = 0xFFFFFFFF;
}
}
@@ -1186,6 +1186,49 @@ PdoQueryInterface(
return Status;
}
+static NTSTATUS
+PdoStartDevice(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp,
+ PIO_STACK_LOCATION IrpSp)
+{
+ PCM_RESOURCE_LIST RawResList = IrpSp->Parameters.StartDevice.AllocatedResources;
+ PCM_FULL_RESOURCE_DESCRIPTOR RawFullDesc;
+ PCM_PARTIAL_RESOURCE_DESCRIPTOR RawPartialDesc;
+ ULONG i, ii;
+ PPDO_DEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
+ UCHAR Irq;
+
+ /* TODO: Assign the other resources we get to the card */
+
+ for (i = 0; i < RawResList->Count; i++)
+ {
+ RawFullDesc = &RawResList->List[i];
+
+ for (ii = 0; ii < RawFullDesc->PartialResourceList.Count; ii++)
+ {
+ RawPartialDesc = &RawFullDesc->PartialResourceList.PartialDescriptors[ii];
+
+ if (RawPartialDesc->Type == CmResourceTypeInterrupt)
+ {
+ DPRINT1("Assigning IRQ %x to PCI device (%x, %x)\n",
+ RawPartialDesc->u.Interrupt.Vector,
+ DeviceExtension->PciDevice->SlotNumber.u.AsULONG,
+ DeviceExtension->PciDevice->BusNumber);
+
+ Irq = (UCHAR)RawPartialDesc->u.Interrupt.Vector;
+ HalSetBusDataByOffset(PCIConfiguration,
+ DeviceExtension->PciDevice->BusNumber,
+ DeviceExtension->PciDevice->SlotNumber.u.AsULONG,
+ &Irq,
+ 0x3c /* PCI_INTERRUPT_LINE */,
+ sizeof(UCHAR));
+ }
+ }
+ }
+
+ return STATUS_SUCCESS;
+}
static NTSTATUS
PdoReadConfig(
@@ -1352,6 +1395,9 @@ PdoPnpControl(
break;
case IRP_MN_START_DEVICE:
+ Status = PdoStartDevice(DeviceObject, Irp, IrpSp);
+ break;
+
case IRP_MN_QUERY_STOP_DEVICE:
case IRP_MN_CANCEL_STOP_DEVICE:
case IRP_MN_STOP_DEVICE:
From 809944b6681df172d487cf8ddf224d86eee3bcad Mon Sep 17 00:00:00 2001
From: Johannes Anderwald
Date: Fri, 2 Apr 2010 17:19:57 +0000
Subject: [PATCH 011/261] [PSDK] - Fix build
svn path=/trunk/; revision=46688
---
reactos/include/psdk/ks.h | 93 +++++++++++++++++++++++++++++++++++++++
1 file changed, 93 insertions(+)
diff --git a/reactos/include/psdk/ks.h b/reactos/include/psdk/ks.h
index f728bfb0f78..e66f130418a 100644
--- a/reactos/include/psdk/ks.h
+++ b/reactos/include/psdk/ks.h
@@ -744,6 +744,99 @@ typedef enum
KSPROPERTY_STREAM_PIPE_ID
} KSPROPERTY_STREAM;
+#define DEFINE_KSPROPERTY_ITEM_STREAM_ALLOCATOR(GetHandler, SetHandler)\
+ DEFINE_KSPROPERTY_ITEM(\
+ KSPROPERTY_STREAM_ALLOCATOR,\
+ (GetHandler),\
+ sizeof(KSPROPERTY),\
+ sizeof(HANDLE),\
+ (SetHandler),\
+ NULL, 0, NULL, NULL, 0)
+
+#define DEFINE_KSPROPERTY_ITEM_STREAM_QUALITY(Handler)\
+ DEFINE_KSPROPERTY_ITEM(\
+ KSPROPERTY_STREAM_QUALITY,\
+ (Handler),\
+ sizeof(KSPROPERTY),\
+ sizeof(KSQUALITY_MANAGER),\
+ NULL, NULL, 0, NULL, NULL, 0)
+
+#define DEFINE_KSPROPERTY_ITEM_STREAM_DEGRADATION(GetHandler, SetHandler)\
+ DEFINE_KSPROPERTY_ITEM(\
+ KSPROPERTY_STREAM_DEGRADATION,\
+ (GetHandler),\
+ sizeof(KSPROPERTY),\
+ 0,\
+ (SetHandler),\
+ NULL, 0, NULL, NULL, 0)
+
+#define DEFINE_KSPROPERTY_ITEM_STREAM_MASTERCLOCK(GetHandler, SetHandler)\
+ DEFINE_KSPROPERTY_ITEM(\
+ KSPROPERTY_STREAM_MASTERCLOCK,\
+ (GetHandler),\
+ sizeof(KSPROPERTY),\
+ sizeof(HANDLE),\
+ (SetHandler),\
+ NULL, 0, NULL, NULL, 0)
+
+#define DEFINE_KSPROPERTY_ITEM_STREAM_TIMEFORMAT(Handler)\
+ DEFINE_KSPROPERTY_ITEM(\
+ KSPROPERTY_STREAM_TIMEFORMAT,\
+ (Handler),\
+ sizeof(KSPROPERTY),\
+ sizeof(GUID),\
+ NULL, NULL, 0, NULL, NULL, 0)
+
+#define DEFINE_KSPROPERTY_ITEM_STREAM_PRESENTATIONTIME(GetHandler, SetHandler)\
+ DEFINE_KSPROPERTY_ITEM(\
+ KSPROPERTY_STREAM_PRESENTATIONTIME,\
+ (GetHandler),\
+ sizeof(KSPROPERTY),\
+ sizeof(KSTIME),\
+ (SetHandler),\
+ NULL, 0, NULL, NULL, 0)
+
+#define DEFINE_KSPROPERTY_ITEM_STREAM_PRESENTATIONEXTENT(Handler)\
+ DEFINE_KSPROPERTY_ITEM(\
+ KSPROPERTY_STREAM_PRESENTATIONEXTENT,\
+ (Handler),\
+ sizeof(KSPROPERTY),\
+ sizeof(LONGLONG),\
+ NULL, NULL, 0, NULL, NULL, 0)
+
+#define DEFINE_KSPROPERTY_ITEM_STREAM_FRAMETIME(Handler)\
+ DEFINE_KSPROPERTY_ITEM(\
+ KSPROPERTY_STREAM_FRAMETIME,\
+ (Handler),\
+ sizeof(KSPROPERTY),\
+ sizeof(KSFRAMETIME),\
+ NULL, NULL, 0, NULL, NULL, 0)
+
+#define DEFINE_KSPROPERTY_ITEM_STREAM_RATECAPABILITY(Handler)\
+ DEFINE_KSPROPERTY_ITEM(\
+ KSPROPERTY_STREAM_RATECAPABILITY,\
+ (Handler),\
+ sizeof(KSRATE_CAPABILITY),\
+ sizeof(KSRATE),\
+ NULL, NULL, 0, NULL, NULL, 0)
+
+#define DEFINE_KSPROPERTY_ITEM_STREAM_RATE(GetHandler, SetHandler)\
+ DEFINE_KSPROPERTY_ITEM(\
+ KSPROPERTY_STREAM_RATE,\
+ (GetHandler),\
+ sizeof(KSPROPERTY),\
+ sizeof(KSRATE),\
+ (SetHandler),\
+ NULL, 0, NULL, NULL, 0)
+
+#define DEFINE_KSPROPERTY_ITEM_STREAM_PIPE_ID(GetHandler, SetHandler)\
+ DEFINE_KSPROPERTY_ITEM(\
+ KSPROPERTY_STREAM_PIPE_ID,\
+ (GetHandler),\
+ sizeof(KSPROPERTY),\
+ sizeof(HANDLE),\
+ (SetHandler),\
+ NULL, 0, NULL, NULL, 0)
/* ===============================================================
StreamAllocator
From 74e30b909320bd857dd2859121e7f252687bc09a Mon Sep 17 00:00:00 2001
From: Eric Kohl
Date: Fri, 2 Apr 2010 17:46:24 +0000
Subject: [PATCH 012/261] [NTOSKRNL] - Add the check for
ACESSS_SYSTEM_SECURITY. - Keep the desired access rights that have not been
granted yet in the variable RemainingAccess. - Handle the MAXIMUM_ALLOWED
case if the DACL is empty.
svn path=/trunk/; revision=46689
---
reactos/ntoskrnl/se/semgr.c | 59 ++++++++++++++++++++++++++++++++-----
1 file changed, 51 insertions(+), 8 deletions(-)
diff --git a/reactos/ntoskrnl/se/semgr.c b/reactos/ntoskrnl/se/semgr.c
index 5e22e67d05e..2ebd18090e8 100644
--- a/reactos/ntoskrnl/se/semgr.c
+++ b/reactos/ntoskrnl/se/semgr.c
@@ -390,6 +390,7 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
{
LUID_AND_ATTRIBUTES Privilege;
ACCESS_MASK CurrentAccess, AccessMask;
+ ACCESS_MASK RemainingAccess;
PACCESS_TOKEN Token;
ULONG i;
PACL Dacl;
@@ -424,14 +425,43 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
RtlMapGenericMask(&PreviouslyGrantedAccess, GenericMapping);
-
CurrentAccess = PreviouslyGrantedAccess;
-
+ RemainingAccess = DesiredAccess;
Token = SubjectSecurityContext->ClientToken ?
SubjectSecurityContext->ClientToken : SubjectSecurityContext->PrimaryToken;
+ /* Check for system security access */
+ if (RemainingAccess & ACCESS_SYSTEM_SECURITY)
+ {
+ Privilege.Luid = SeSecurityPrivilege;
+ Privilege.Attributes = SE_PRIVILEGE_ENABLED;
+
+ /* Fail if we do not the SeSecurityPrivilege */
+ if (!SepPrivilegeCheck(Token,
+ &Privilege,
+ 1,
+ PRIVILEGE_SET_ALL_NECESSARY,
+ AccessMode))
+ {
+ *AccessStatus = STATUS_PRIVILEGE_NOT_HELD;
+ return FALSE;
+ }
+
+ /* Adjust access rights */
+ RemainingAccess &= ~ACCESS_SYSTEM_SECURITY;
+ PreviouslyGrantedAccess |= ACCESS_SYSTEM_SECURITY;
+
+ /* Succeed if there are no more rights to grant */
+ if (RemainingAccess == 0)
+ {
+ *GrantedAccess = PreviouslyGrantedAccess;
+ *AccessStatus = STATUS_SUCCESS;
+ return TRUE;
+ }
+ }
+
/* Get the DACL */
Status = RtlGetDaclSecurityDescriptor(SecurityDescriptor,
&Present,
@@ -474,11 +504,15 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
PRIVILEGE_SET_ALL_NECESSARY,
AccessMode))
{
+ /* Adjust access rights */
+ RemainingAccess &= ~WRITE_OWNER;
+ PreviouslyGrantedAccess |= WRITE_OWNER;
CurrentAccess |= WRITE_OWNER;
- if ((DesiredAccess & ~VALID_INHERIT_FLAGS) ==
- (CurrentAccess & ~VALID_INHERIT_FLAGS))
+
+ /* Succeed if there are no more rights to grant */
+ if (RemainingAccess == 0)
{
- *GrantedAccess = CurrentAccess;
+ *GrantedAccess = PreviouslyGrantedAccess;
*AccessStatus = STATUS_SUCCESS;
return TRUE;
}
@@ -488,9 +522,18 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
/* Deny access if the DACL is empty */
if (Dacl->AceCount == 0)
{
- *GrantedAccess = 0;
- *AccessStatus = STATUS_ACCESS_DENIED;
- return FALSE;
+ if (RemainingAccess == MAXIMUM_ALLOWED && PreviouslyGrantedAccess != 0)
+ {
+ *GrantedAccess = PreviouslyGrantedAccess;
+ *AccessStatus = STATUS_SUCCESS;
+ return TRUE;
+ }
+ else
+ {
+ *GrantedAccess = 0;
+ *AccessStatus = STATUS_ACCESS_DENIED;
+ return FALSE;
+ }
}
/* Fail if DACL is absent */
From 6075ae9a8f23bf75a23b9f380839fc680dd1b19e Mon Sep 17 00:00:00 2001
From: Sir Richard
Date: Fri, 2 Apr 2010 17:57:33 +0000
Subject: [PATCH 013/261] [NTOS]: Rewrite boot driver loading code (not the
driver code itself) to use the boot loader's BootDriverListHead, instead of
parsing InOrderListHead and cherry-picking ".sys" files. This is the last
incompatibility with Windows. [NTOS]: Use group prioritiy, tag numbers, and
tag priority to determine the correct loading order for boot drivers, instead
of just parsing the linked list. Dependencies work now! [NTOS]: Load any DLLs
that are driver-dependent with MmCallDllInitialize. Previously, these .DLLS
were ignored and drivers could lose dependencies.
svn path=/trunk/; revision=46690
---
reactos/ntoskrnl/include/internal/io.h | 64 +++++++
reactos/ntoskrnl/io/iomgr/driver.c | 132 ++++++++++++--
reactos/ntoskrnl/io/iomgr/iomgr.c | 3 +
reactos/ntoskrnl/io/pnpmgr/pnpinit.c | 222 +++++++++++++++++++++++
reactos/ntoskrnl/io/pnpmgr/pnputil.c | 185 +++++++++++++++++++
reactos/ntoskrnl/ntoskrnl-generic.rbuild | 2 +
6 files changed, 595 insertions(+), 13 deletions(-)
create mode 100644 reactos/ntoskrnl/io/pnpmgr/pnpinit.c
create mode 100644 reactos/ntoskrnl/io/pnpmgr/pnputil.c
diff --git a/reactos/ntoskrnl/include/internal/io.h b/reactos/ntoskrnl/include/internal/io.h
index 2519a8134d2..dc80ff249a5 100644
--- a/reactos/ntoskrnl/include/internal/io.h
+++ b/reactos/ntoskrnl/include/internal/io.h
@@ -395,6 +395,33 @@ typedef struct _LOAD_UNLOAD_PARAMS
PDRIVER_OBJECT DriverObject;
} LOAD_UNLOAD_PARAMS, *PLOAD_UNLOAD_PARAMS;
+//
+// Boot Driver List Entry
+//
+typedef struct _DRIVER_INFORMATION
+{
+ LIST_ENTRY Link;
+ PDRIVER_OBJECT DriverObject;
+ PBOOT_DRIVER_LIST_ENTRY DataTableEntry;
+ HANDLE ServiceHandle;
+ USHORT TagPosition;
+ ULONG Failed;
+ ULONG Processed;
+ NTSTATUS Status;
+} DRIVER_INFORMATION, *PDRIVER_INFORMATION;
+
+//
+// Boot Driver Node
+//
+typedef struct _BOOT_DRIVER_NODE
+{
+ BOOT_DRIVER_LIST_ENTRY ListEntry;
+ UNICODE_STRING Group;
+ UNICODE_STRING Name;
+ ULONG Tag;
+ ULONG ErrorControl;
+} BOOT_DRIVER_NODE, *PBOOT_DRIVER_NODE;
+
//
// List of Bus Type GUIDs
//
@@ -605,6 +632,43 @@ IopGetRegistryValue(IN HANDLE Handle,
OUT PKEY_VALUE_FULL_INFORMATION *Information);
+//
+// PnP Routines
+//
+NTSTATUS
+NTAPI
+PiInitCacheGroupInformation(
+ VOID
+);
+
+USHORT
+NTAPI
+PpInitGetGroupOrderIndex(
+ IN HANDLE ServiceHandle
+);
+
+USHORT
+NTAPI
+PipGetDriverTagPriority(
+ IN HANDLE ServiceHandle
+);
+
+NTSTATUS
+NTAPI
+PnpRegMultiSzToUnicodeStrings(
+ IN PKEY_VALUE_FULL_INFORMATION KeyValueInformation,
+ OUT PUNICODE_STRING *UnicodeStringList,
+ OUT PULONG UnicodeStringCount
+);
+
+BOOLEAN
+NTAPI
+PnpRegSzToString(
+ IN PWCHAR RegSzData,
+ IN ULONG RegSzLength,
+ OUT PUSHORT StringLength OPTIONAL
+);
+
//
// Initialization Routines
//
diff --git a/reactos/ntoskrnl/io/iomgr/driver.c b/reactos/ntoskrnl/io/iomgr/driver.c
index ef1b78969fb..f00a87d0e09 100644
--- a/reactos/ntoskrnl/io/iomgr/driver.c
+++ b/reactos/ntoskrnl/io/iomgr/driver.c
@@ -34,6 +34,9 @@ POBJECT_TYPE IoDriverObjectType = NULL;
extern BOOLEAN ExpInTextModeSetup;
extern BOOLEAN PnpSystemInit;
+USHORT IopGroupIndex;
+PLIST_ENTRY IopGroupTable;
+
/* PRIVATE FUNCTIONS **********************************************************/
NTSTATUS NTAPI
@@ -880,14 +883,17 @@ VOID
FASTCALL
IopInitializeBootDrivers(VOID)
{
- PLIST_ENTRY ListHead, NextEntry;
+ PLIST_ENTRY ListHead, NextEntry, NextEntry2;
PLDR_DATA_TABLE_ENTRY LdrEntry;
PDEVICE_NODE DeviceNode;
PDRIVER_OBJECT DriverObject;
LDR_DATA_TABLE_ENTRY ModuleObject;
NTSTATUS Status;
UNICODE_STRING DriverName;
-
+ ULONG i, Index;
+ PDRIVER_INFORMATION DriverInfo, DriverInfoTag;
+ HANDLE KeyHandle;
+ PBOOT_DRIVER_LIST_ENTRY BootEntry;
DPRINT("IopInitializeBootDrivers()\n");
/* Use IopRootDeviceNode for now */
@@ -931,6 +937,19 @@ IopInitializeBootDrivers(VOID)
return;
}
+ /* Get highest group order index */
+ IopGroupIndex = PpInitGetGroupOrderIndex(NULL);
+ if (IopGroupIndex == 0xFFFF) ASSERT(FALSE);
+
+ /* Allocate the group table */
+ IopGroupTable = ExAllocatePoolWithTag(PagedPool,
+ IopGroupIndex * sizeof(LIST_ENTRY),
+ TAG_IO);
+ if (IopGroupTable == NULL) ASSERT(FALSE);
+
+ /* Initialize the group table lists */
+ for (i = 0; i < IopGroupIndex; i++) InitializeListHead(&IopGroupTable[i]);
+
/* Loop the boot modules */
ListHead = &KeLoaderBlock->LoadOrderListHead;
NextEntry = ListHead->Flink;
@@ -940,19 +959,83 @@ IopInitializeBootDrivers(VOID)
LdrEntry = CONTAINING_RECORD(NextEntry,
LDR_DATA_TABLE_ENTRY,
InLoadOrderLinks);
-
- /*
- * HACK: Make sure we're loading a driver
- * (we should be using BootDriverListHead!)
- */
- if (wcsstr(_wcsupr(LdrEntry->BaseDllName.Buffer), L".SYS"))
+
+ /* Check if the DLL needs to be initialized */
+ if (LdrEntry->Flags & LDRP_DRIVER_DEPENDENT_DLL)
{
- /* Make sure we didn't load this driver already */
- if (!(LdrEntry->Flags & LDRP_ENTRY_INSERTED))
+ /* Call its entrypoint */
+ MmCallDllInitialize(LdrEntry, NULL);
+ }
+
+ /* Go to the next driver */
+ NextEntry = NextEntry->Flink;
+ }
+
+ /* Loop the boot drivers */
+ ListHead = &KeLoaderBlock->BootDriverListHead;
+ NextEntry = ListHead->Flink;
+ while (ListHead != NextEntry)
+ {
+ /* Get the entry */
+ BootEntry = CONTAINING_RECORD(NextEntry,
+ BOOT_DRIVER_LIST_ENTRY,
+ Link);
+
+ /* Get the driver loader entry */
+ LdrEntry = BootEntry->LdrEntry;
+
+ /* Allocate our internal accounting structure */
+ DriverInfo = ExAllocatePoolWithTag(PagedPool,
+ sizeof(DRIVER_INFORMATION),
+ TAG_IO);
+ if (DriverInfo)
+ {
+ /* Zero it and initialize it */
+ RtlZeroMemory(DriverInfo, sizeof(DRIVER_INFORMATION));
+ InitializeListHead(&DriverInfo->Link);
+ DriverInfo->DataTableEntry = BootEntry;
+
+ /* Open the registry key */
+ Status = IopOpenRegistryKeyEx(&KeyHandle,
+ NULL,
+ &BootEntry->RegistryPath,
+ KEY_READ);
+ if ((NT_SUCCESS(Status)) || /* ReactOS HACK for SETUPLDR */
+ ((KeLoaderBlock->SetupLdrBlock) && (KeyHandle = (PVOID)1)))
{
- DPRINT("Initializing bootdriver %wZ\n", &LdrEntry->BaseDllName);
- /* Initialize it */
- IopInitializeBuiltinDriver(LdrEntry);
+ /* Save the handle */
+ DriverInfo->ServiceHandle = KeyHandle;
+
+ /* Get the group oder index */
+ Index = PpInitGetGroupOrderIndex(KeyHandle);
+
+ /* Get the tag position */
+ DriverInfo->TagPosition = PipGetDriverTagPriority(KeyHandle);
+
+ /* Insert it into the list, at the right place */
+ ASSERT(Index < IopGroupIndex);
+ NextEntry2 = IopGroupTable[Index].Flink;
+ while (NextEntry2 != &IopGroupTable[Index])
+ {
+ /* Get the driver info */
+ DriverInfoTag = CONTAINING_RECORD(NextEntry2,
+ DRIVER_INFORMATION,
+ Link);
+
+ /* Check if we found the right tag position */
+ if (DriverInfoTag->TagPosition > DriverInfo->TagPosition)
+ {
+ /* We're done */
+ break;
+ }
+
+ /* Next entry */
+ NextEntry2 = NextEntry2->Flink;
+ }
+
+ /* Insert us right before the next entry */
+ NextEntry2 = NextEntry2->Blink;
+ InsertHeadList(NextEntry2, &DriverInfo->Link);
}
}
@@ -960,6 +1043,29 @@ IopInitializeBootDrivers(VOID)
NextEntry = NextEntry->Flink;
}
+ /* Loop each group index */
+ for (i = 0; i < IopGroupIndex; i++)
+ {
+ /* Loop each group table */
+ NextEntry = IopGroupTable[i].Flink;
+ while (NextEntry != &IopGroupTable[i])
+ {
+ /* Get the entry */
+ DriverInfo = CONTAINING_RECORD(NextEntry,
+ DRIVER_INFORMATION,
+ Link);
+
+ /* Get the driver loader entry */
+ LdrEntry = DriverInfo->DataTableEntry->LdrEntry;
+
+ /* Initialize it */
+ IopInitializeBuiltinDriver(LdrEntry);
+
+ /* Next entry */
+ NextEntry = NextEntry->Flink;
+ }
+ }
+
/* In old ROS, the loader list became empty after this point. Simulate. */
InitializeListHead(&KeLoaderBlock->LoadOrderListHead);
}
diff --git a/reactos/ntoskrnl/io/iomgr/iomgr.c b/reactos/ntoskrnl/io/iomgr/iomgr.c
index cb32297d25c..c7999660a61 100644
--- a/reactos/ntoskrnl/io/iomgr/iomgr.c
+++ b/reactos/ntoskrnl/io/iomgr/iomgr.c
@@ -489,6 +489,9 @@ IoInitSystem(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
/* Initialize PnP manager */
PnpInit();
+
+ /* Setup the group cache */
+ if (!NT_SUCCESS(PiInitCacheGroupInformation())) return FALSE;
/* Create the group driver list */
IoCreateDriverList();
diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpinit.c b/reactos/ntoskrnl/io/pnpmgr/pnpinit.c
new file mode 100644
index 00000000000..8c5607289a6
--- /dev/null
+++ b/reactos/ntoskrnl/io/pnpmgr/pnpinit.c
@@ -0,0 +1,222 @@
+/*
+ * PROJECT: ReactOS Kernel
+ * LICENSE: BSD - See COPYING.ARM in the top level directory
+ * FILE: ntoskrnl/io/pnpmgr/pnpinit.c
+ * PURPOSE: PnP Initialization Code
+ * PROGRAMMERS: ReactOS Portable Systems Group
+ */
+
+/* INCLUDES *******************************************************************/
+
+#include
+#define NDEBUG
+#include
+
+/* GLOBALS ********************************************************************/
+
+PUNICODE_STRING PiInitGroupOrderTable;
+ULONG PiInitGroupOrderTableCount;
+
+/* FUNCTIONS ******************************************************************/
+
+NTSTATUS
+NTAPI
+PiInitCacheGroupInformation(VOID)
+{
+ HANDLE KeyHandle;
+ NTSTATUS Status;
+ PKEY_VALUE_FULL_INFORMATION KeyValueInformation;
+ PUNICODE_STRING GroupTable;
+ ULONG Count;
+ UNICODE_STRING GroupString =
+ RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet"
+ L"\\Control\\ServiceGroupOrder");
+
+ /* ReactOS HACK for SETUPLDR */
+ if (KeLoaderBlock->SetupLdrBlock)
+ {
+ /* Bogus data */
+ PiInitGroupOrderTableCount = 0;
+ PiInitGroupOrderTable = (PVOID)0xBABEB00B;
+ return STATUS_SUCCESS;
+ }
+
+ /* Open the registry key */
+ Status = IopOpenRegistryKeyEx(&KeyHandle,
+ NULL,
+ &GroupString,
+ KEY_READ);
+ if (NT_SUCCESS(Status))
+ {
+ /* Get the list */
+ Status = IopGetRegistryValue(KeyHandle, L"List", &KeyValueInformation);
+ ZwClose(KeyHandle);
+
+ /* Make sure we got it */
+ if (NT_SUCCESS(Status))
+ {
+ /* Make sure it's valid */
+ if ((KeyValueInformation->Type == REG_MULTI_SZ) &&
+ (KeyValueInformation->DataLength))
+ {
+ /* Convert it to unicode strings */
+ Status = PnpRegMultiSzToUnicodeStrings(KeyValueInformation,
+ &GroupTable,
+ &Count);
+
+ /* Cache it for later */
+ PiInitGroupOrderTable = GroupTable;
+ PiInitGroupOrderTableCount = Count;
+ }
+ else
+ {
+ /* Fail */
+ Status = STATUS_UNSUCCESSFUL;
+ }
+
+ /* Free the information */
+ ExFreePool(KeyValueInformation);
+ }
+ }
+
+ /* Return status */
+ return Status;
+}
+
+USHORT
+NTAPI
+PpInitGetGroupOrderIndex(IN HANDLE ServiceHandle)
+{
+ NTSTATUS Status;
+ PKEY_VALUE_FULL_INFORMATION KeyValueInformation;
+ ULONG i;
+ PVOID Buffer;
+ UNICODE_STRING Group;
+ PAGED_CODE();
+
+ /* Make sure we have a cache */
+ if (!PiInitGroupOrderTable) return -1;
+
+ /* If we don't have a handle, the rest is easy -- return the count */
+ if (!ServiceHandle) return PiInitGroupOrderTableCount + 1;
+
+ /* Otherwise, get the group value */
+ Status = IopGetRegistryValue(ServiceHandle, L"Group", &KeyValueInformation);
+ if (!NT_SUCCESS(Status)) return PiInitGroupOrderTableCount;
+
+ /* Make sure we have a valid string */
+ ASSERT(KeyValueInformation->Type == REG_SZ);
+ ASSERT(KeyValueInformation->DataLength);
+
+ /* Convert to unicode string */
+ Buffer = (PVOID)((ULONG_PTR)KeyValueInformation + KeyValueInformation->DataOffset);
+ PnpRegSzToString(Buffer, KeyValueInformation->DataLength, &Group.Length);
+ Group.MaximumLength = KeyValueInformation->DataLength;
+ Group.Buffer = Buffer;
+
+ /* Loop the groups */
+ for (i = 0; i < PiInitGroupOrderTableCount; i++)
+ {
+ /* Try to find a match */
+ if (RtlEqualUnicodeString(&Group, &PiInitGroupOrderTable[i], TRUE)) break;
+ }
+
+ /* We're done */
+ ExFreePool(KeyValueInformation);
+ return i;
+}
+
+USHORT
+NTAPI
+PipGetDriverTagPriority(IN HANDLE ServiceHandle)
+{
+ NTSTATUS Status;
+ HANDLE KeyHandle = NULL;
+ PKEY_VALUE_FULL_INFORMATION KeyValueInformation = NULL;
+ PKEY_VALUE_FULL_INFORMATION KeyValueInformationTag;
+ PKEY_VALUE_FULL_INFORMATION KeyValueInformationGroupOrderList;
+ PVOID Buffer;
+ UNICODE_STRING Group;
+ PULONG GroupOrder;
+ ULONG i = -1, Count, Tag = 0;
+ UNICODE_STRING GroupString =
+ RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet"
+ L"\\Control\\ServiceGroupOrder");
+
+ /* Open the key */
+ Status = IopOpenRegistryKeyEx(&KeyHandle, NULL, &GroupString, KEY_READ);
+ if (!NT_SUCCESS(Status)) goto Quickie;
+
+ /* Read the group */
+ Status = IopGetRegistryValue(ServiceHandle, L"Group", &KeyValueInformation);
+ if (!NT_SUCCESS(Status)) goto Quickie;
+
+ /* Make sure we have a group */
+ if ((KeyValueInformation->Type == REG_SZ) &&
+ (KeyValueInformation->DataLength))
+ {
+ /* Convert to unicode string */
+ Buffer = (PVOID)((ULONG_PTR)KeyValueInformation + KeyValueInformation->DataOffset);
+ PnpRegSzToString(Buffer, KeyValueInformation->DataLength, &Group.Length);
+ Group.MaximumLength = KeyValueInformation->DataLength;
+ Group.Buffer = Buffer;
+ }
+
+ /* Now read the tag */
+ Status = IopGetRegistryValue(ServiceHandle, L"Tag", &KeyValueInformationTag);
+ if (!NT_SUCCESS(Status)) goto Quickie;
+
+ /* Make sure we have a tag */
+ if ((KeyValueInformationTag->Type == REG_DWORD) &&
+ (KeyValueInformationTag->DataLength))
+ {
+ /* Read it */
+ Tag = *(PULONG)((ULONG_PTR)KeyValueInformationTag +
+ KeyValueInformationTag->DataOffset);
+ }
+
+ /* We can get rid of this now */
+ ExFreePool(KeyValueInformationTag);
+
+ /* Now let's read the group's tag order */
+ Status = IopGetRegistryValue(KeyHandle,
+ Group.Buffer,
+ &KeyValueInformationGroupOrderList);
+
+ /* We can get rid of this now */
+Quickie:
+ if (KeyValueInformation) ExFreePool(KeyValueInformation);
+ if (KeyHandle) NtClose(KeyHandle);
+ if (!NT_SUCCESS(Status)) return -1;
+
+ /* We're on the success path -- validate the tag order*/
+ if ((KeyValueInformationGroupOrderList->Type == REG_BINARY) &&
+ (KeyValueInformationGroupOrderList->DataLength))
+ {
+ /* Get the order array */
+ GroupOrder = (PULONG)((ULONG_PTR)KeyValueInformationGroupOrderList +
+ KeyValueInformationGroupOrderList->DataOffset);
+
+ /* Get the count */
+ Count = *GroupOrder;
+ ASSERT(((Count + 1) * sizeof(ULONG)) <=
+ KeyValueInformationGroupOrderList->DataLength);
+
+ /* Now loop each tag */
+ GroupOrder++;
+ for (i = 1; i <= Count; i++)
+ {
+ /* If we found it, we're out */
+ if (Tag == *GroupOrder) break;
+
+ /* Try the next one */
+ GroupOrder++;
+ }
+ }
+
+ /* Last buffer to free */
+ ExFreePool(KeyValueInformationGroupOrderList);
+ return i;
+}
+
+/* EOF */
diff --git a/reactos/ntoskrnl/io/pnpmgr/pnputil.c b/reactos/ntoskrnl/io/pnpmgr/pnputil.c
new file mode 100644
index 00000000000..f274f3db679
--- /dev/null
+++ b/reactos/ntoskrnl/io/pnpmgr/pnputil.c
@@ -0,0 +1,185 @@
+/*
+ * PROJECT: ReactOS Kernel
+ * LICENSE: BSD - See COPYING.ARM in the top level directory
+ * FILE: ntoskrnl/io/pnpmgr/pnputil.c
+ * PURPOSE: PnP Utility Code
+ * PROGRAMMERS: ReactOS Portable Systems Group
+ */
+
+/* INCLUDES *******************************************************************/
+
+#include
+#define NDEBUG
+#include
+
+/* GLOBALS ********************************************************************/
+
+/* FUNCTIONS ******************************************************************/
+
+VOID
+NTAPI
+PnpFreeUnicodeStringList(IN PUNICODE_STRING UnicodeStringList,
+ IN ULONG StringCount)
+{
+ ULONG i;
+
+ /* Go through the list */
+ if (UnicodeStringList)
+ {
+ /* Go through each string */
+ for (i = 0; i < StringCount; i++)
+ {
+ /* Check if it exists */
+ if (UnicodeStringList[i].Buffer)
+ {
+ /* Free it */
+ ExFreePool(UnicodeStringList[i].Buffer);
+ }
+ }
+
+ /* Free the whole list */
+ ExFreePool(UnicodeStringList);
+ }
+}
+
+NTSTATUS
+NTAPI
+PnpRegMultiSzToUnicodeStrings(IN PKEY_VALUE_FULL_INFORMATION KeyValueInformation,
+ OUT PUNICODE_STRING *UnicodeStringList,
+ OUT PULONG UnicodeStringCount)
+{
+ PWCHAR p, pp, ps;
+ ULONG i = 0, n;
+ ULONG Count = 0;
+
+ /* Validate the key information */
+ if (KeyValueInformation->Type != REG_MULTI_SZ) return STATUS_INVALID_PARAMETER;
+
+ /* Set the pointers */
+ p = (PWCHAR)((ULONG_PTR)KeyValueInformation +
+ KeyValueInformation->DataOffset);
+ pp = (PWCHAR)((ULONG_PTR)p + KeyValueInformation->DataLength);
+
+ /* Loop the data */
+ while (p != pp)
+ {
+ /* If we find a NULL, that means one string is done */
+ if (!*p)
+ {
+ /* Add to our string count */
+ Count++;
+
+ /* Check for a double-NULL, which means we're done */
+ if (((p + 1) == pp) || !(*(p + 1))) break;
+ }
+
+ /* Go to the next character */
+ p++;
+ }
+
+ /* If we looped the whole list over, we missed increment a string, do it */
+ if (p == pp) Count++;
+
+ /* Allocate the list now that we know how big it is */
+ *UnicodeStringList = ExAllocatePoolWithTag(PagedPool,
+ sizeof(UNICODE_STRING) * Count,
+ 'sUpP');
+ if (!(*UnicodeStringList)) return STATUS_INSUFFICIENT_RESOURCES;
+
+ /* Set pointers for second loop */
+ ps = p = (PWCHAR)((ULONG_PTR)KeyValueInformation +
+ KeyValueInformation->DataOffset);
+
+ /* Loop again, to do the copy this time */
+ while (p != pp)
+ {
+ /* If we find a NULL, that means one string is done */
+ if (!*p)
+ {
+ /* Check how long this string is */
+ n = (ULONG_PTR)p - (ULONG_PTR)ps + sizeof(UNICODE_NULL);
+
+ /* Allocate the buffer */
+ (*UnicodeStringList)[i].Buffer = ExAllocatePoolWithTag(PagedPool,
+ n,
+ 'sUpP');
+ if (!(*UnicodeStringList)[i].Buffer)
+ {
+ /* Back out of everything */
+ PnpFreeUnicodeStringList(*UnicodeStringList, i);
+ return STATUS_INSUFFICIENT_RESOURCES;
+ }
+
+ /* Copy the string into the buffer */
+ RtlCopyMemory((*UnicodeStringList)[i].Buffer, ps, n);
+
+ /* Set the lengths */
+ (*UnicodeStringList)[i].MaximumLength = n;
+ (*UnicodeStringList)[i].Length = n - sizeof(UNICODE_NULL);
+
+ /* One more entry done */
+ i++;
+
+ /* Check for a double-NULL, which means we're done */
+ if (((p + 1) == pp) || !(*(p + 1))) break;
+
+ /* New string */
+ ps = p + 1;
+ }
+
+ /* New string */
+ p++;
+ }
+
+ /* Check if we've reached the last string */
+ if (p == pp)
+ {
+ /* Calculate the string length */
+ n = (ULONG_PTR)p - (ULONG_PTR)ps;
+
+ /* Allocate the buffer for it */
+ (*UnicodeStringList)[i].Buffer = ExAllocatePoolWithTag(PagedPool,
+ n +
+ sizeof(UNICODE_NULL),
+ 'sUpP');
+ if (!(*UnicodeStringList)[i].Buffer)
+ {
+ /* Back out of everything */
+ PnpFreeUnicodeStringList(*UnicodeStringList, i);
+ return STATUS_INSUFFICIENT_RESOURCES;
+ }
+
+ /* Make sure there's an actual string here */
+ if (n) RtlCopyMemory((*UnicodeStringList)[i].Buffer, ps, n);
+
+ /* Null-terminate the string ourselves */
+ (*UnicodeStringList)[i].Buffer[n / sizeof(WCHAR)] = UNICODE_NULL;
+
+ /* Set the lenghts */
+ (*UnicodeStringList)[i].Length = n;
+ (*UnicodeStringList)[i].MaximumLength = n + sizeof(UNICODE_NULL);
+ }
+
+ /* And we're done */
+ *UnicodeStringCount = Count;
+ return STATUS_SUCCESS;
+}
+
+BOOLEAN
+NTAPI
+PnpRegSzToString(IN PWCHAR RegSzData,
+ IN ULONG RegSzLength,
+ OUT PUSHORT StringLength OPTIONAL)
+{
+ PWCHAR p, pp;
+
+ /* Find the end */
+ pp = RegSzData + RegSzLength;
+ for (p = RegSzData; p < pp; p++) if (!*p) break;
+
+ /* Return it */
+ if (StringLength) *StringLength = p - RegSzData;
+ return TRUE;
+}
+
+/* EOF */
diff --git a/reactos/ntoskrnl/ntoskrnl-generic.rbuild b/reactos/ntoskrnl/ntoskrnl-generic.rbuild
index a605ee1b147..b6ed1824217 100644
--- a/reactos/ntoskrnl/ntoskrnl-generic.rbuild
+++ b/reactos/ntoskrnl/ntoskrnl-generic.rbuild
@@ -267,10 +267,12 @@
plugplay.c
pnpdma.c
+ pnpinit.c
pnpmgr.c
pnpnotify.c
pnpreport.c
pnproot.c
+ pnputil.c
From 066b696c33325af307700725b233ca2d2aa549fe Mon Sep 17 00:00:00 2001
From: Sylvain Petreolle
Date: Fri, 2 Apr 2010 19:52:03 +0000
Subject: [PATCH 014/261] Fix MP install.
svn path=/trunk/; revision=46691
---
reactos/boot/bootdata/txtsetup.sif | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/reactos/boot/bootdata/txtsetup.sif b/reactos/boot/bootdata/txtsetup.sif
index 7977e447752..870c0d26951 100644
--- a/reactos/boot/bootdata/txtsetup.sif
+++ b/reactos/boot/bootdata/txtsetup.sif
@@ -76,7 +76,7 @@ hal.dll=,,,,,,,,,,,,2
[Files.pci_mp]
ntkrnlmp.exe=,,,,,,,,,,ntoskrnl.exe,,2
-halmp.dll=,,,,,,,,,,hal.dll,,2
+halmps.dll=,,,,,,,,,,hal.dll,,2
[Display]
; = ,,,,,
From d7c28ad92a70fd8005c1188caddf8caf8ac7ff70 Mon Sep 17 00:00:00 2001
From: James Tabor
Date: Fri, 2 Apr 2010 23:52:38 +0000
Subject: [PATCH 015/261] - Simplifying MakeInfoDC.
svn path=/trunk/; revision=46692
---
reactos/subsystems/win32/win32k/objects/dclife.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/reactos/subsystems/win32/win32k/objects/dclife.c b/reactos/subsystems/win32/win32k/objects/dclife.c
index e9f4cf7ecd1..c64139c9426 100644
--- a/reactos/subsystems/win32/win32k/objects/dclife.c
+++ b/reactos/subsystems/win32/win32k/objects/dclife.c
@@ -606,13 +606,14 @@ MakeInfoDC(PDC pdc, BOOL bSet)
pdc->dctype = DC_TYPE_INFO;
pdc->dclevel.pSurface = NULL;
- if (PDEV_sizl(pdc->ppdev, &sizl)->cx == pdc->dclevel.sizl.cx &&
- PDEV_sizl(pdc->ppdev, &sizl)->cy == pdc->dclevel.sizl.cy)
+ PDEV_sizl(pdc->ppdev, &sizl);
+
+ if ( sizl.cx == pdc->dclevel.sizl.cx &&
+ sizl.cy == pdc->dclevel.sizl.cy )
return TRUE;
- pdc->dclevel.sizl.cx = PDEV_sizl(pdc->ppdev, &sizl)->cx;
+ pdc->dclevel.sizl.cx = sizl.cx;
pdc->dclevel.sizl.cy = sizl.cy;
- IntSetDefaultRegion(pdc);
}
else
{
@@ -632,9 +633,8 @@ MakeInfoDC(PDC pdc, BOOL bSet)
pdc->dclevel.sizl.cx = pSurface->SurfObj.sizlBitmap.cx;
pdc->dclevel.sizl.cy = pSurface->SurfObj.sizlBitmap.cy;
- IntSetDefaultRegion(pdc);
}
- return TRUE;
+ return IntSetDefaultRegion(pdc);
}
/*
From 959116f5217fc9b510e72b99a1db7689fdbcf1a1 Mon Sep 17 00:00:00 2001
From: Sir Richard
Date: Sat, 3 Apr 2010 07:44:38 +0000
Subject: [PATCH 016/261] [NTOS]: Implement Configuration Manager routines for
building a driver list, sorting it, detecting circular dependencies and
ordering, combining groups, tags, group orders and tag orders, etc. Replaces
the "drvrlist" I/O interface currently in ReactOS. [NTOS]: Use the new Cm
interface in IopInitializeSystemDrivers to parse the ordered list of system
drivers to load. Make it use ZwLoadDriver directly instead of having a hacked
IopLoadDriver function. [NTOS]: Drivers should not show up loading n times a
reboot now (some drivers seemed to do this in the past when they failed to
load). [NTOS]: The system driver code could be further improved by checknig
if the driver has already been loaded, or attempted and failed to load, but
it is already much better now than in the past. [PERF]: Boot-time improvement
since the new system driver loading code uses low-level Cm interfaces
(portability side-effect: can be shared with FreeLDR) instead of the complex
parse-based object-manager-based system-calls.
svn path=/trunk/; revision=46693
---
reactos/ntoskrnl/config/cmboot.c | 569 ++++++++++++++++++++++-
reactos/ntoskrnl/config/cmsysini.c | 167 ++++++-
reactos/ntoskrnl/include/internal/cm.h | 34 ++
reactos/ntoskrnl/io/iomgr/driver.c | 35 ++
reactos/ntoskrnl/io/iomgr/drvrlist.c | 561 ----------------------
reactos/ntoskrnl/io/iomgr/iomgr.c | 6 -
reactos/ntoskrnl/ntoskrnl-generic.rbuild | 1 -
7 files changed, 794 insertions(+), 579 deletions(-)
delete mode 100644 reactos/ntoskrnl/io/iomgr/drvrlist.c
diff --git a/reactos/ntoskrnl/config/cmboot.c b/reactos/ntoskrnl/config/cmboot.c
index f1dcc347a20..50c6815866f 100644
--- a/reactos/ntoskrnl/config/cmboot.c
+++ b/reactos/ntoskrnl/config/cmboot.c
@@ -1,20 +1,19 @@
/*
* PROJECT: ReactOS Kernel
- * LICENSE: GPL - See COPYING in the top level directory
+ * LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: ntoskrnl/config/cmboot.c
* PURPOSE: Configuration Manager - Boot Initialization
- * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
+ * PROGRAMMERS: ReactOS Portable Systems Group
+ * Alex Ionescu (alex.ionescu@reactos.org)
*/
-/* INCLUDES ******************************************************************/
+/* INCLUDES *******************************************************************/
#include "ntoskrnl.h"
#define NDEBUG
#include "debug.h"
-
-/* GLOBALS *******************************************************************/
-
-/* FUNCTIONS *****************************************************************/
+
+/* FUNCTIONS ******************************************************************/
HCELL_INDEX
NTAPI
@@ -124,3 +123,559 @@ CmpFindControlSet(IN PHHIVE SystemHive,
/* Return the CCS Cell */
return ControlSetCell;
}
+
+ULONG
+NTAPI
+CmpFindTagIndex(IN PHHIVE Hive,
+ IN HCELL_INDEX TagCell,
+ IN HCELL_INDEX GroupOrderCell,
+ IN PUNICODE_STRING GroupName)
+{
+ PCM_KEY_VALUE TagValue, Value;
+ HCELL_INDEX OrderCell;
+ PULONG TagOrder, DriverTag;
+ ULONG CurrentTag, Length;
+ PCM_KEY_NODE Node;
+ BOOLEAN BufferAllocated;
+ ASSERT(Hive->ReleaseCellRoutine == NULL);
+
+ /* Get the tag */
+ Value = HvGetCell(Hive, TagCell);
+ ASSERT(Value);
+ DriverTag = (PULONG)CmpValueToData(Hive, Value, &Length);
+ ASSERT(DriverTag);
+
+ /* Get the order array */
+ Node = HvGetCell(Hive, GroupOrderCell);
+ ASSERT(Node);
+ OrderCell = CmpFindValueByName(Hive, Node, GroupName);
+ if (OrderCell == HCELL_NIL) return -2;
+
+ /* And read it */
+ TagValue = HvGetCell(Hive, OrderCell);
+ CmpGetValueData(Hive, TagValue, &Length, (PVOID*)&TagOrder, &BufferAllocated, &OrderCell);
+ ASSERT(TagOrder);
+
+ /* Parse each tag */
+ for (CurrentTag = 1; CurrentTag <= TagOrder[0]; CurrentTag++)
+ {
+ /* Find a match */
+ if (TagOrder[CurrentTag] == *DriverTag)
+ {
+ /* Found it -- return the tag */
+ if (BufferAllocated) ExFreePool(TagOrder);
+ return CurrentTag;
+ }
+ }
+
+ /* No matches, so assume next to last ordering */
+ if (BufferAllocated) ExFreePool(TagOrder);
+ return -2;
+}
+
+BOOLEAN
+NTAPI
+CmpAddDriverToList(IN PHHIVE Hive,
+ IN HCELL_INDEX DriverCell,
+ IN HCELL_INDEX GroupOrderCell,
+ IN PUNICODE_STRING RegistryPath,
+ IN PLIST_ENTRY BootDriverListHead)
+{
+ PBOOT_DRIVER_NODE DriverNode;
+ PBOOT_DRIVER_LIST_ENTRY DriverEntry;
+ PCM_KEY_NODE Node;
+ ULONG NameLength, Length;
+ HCELL_INDEX ValueCell, TagCell;
+ PCM_KEY_VALUE Value;
+ PUNICODE_STRING FileName, RegistryString;
+ UNICODE_STRING UnicodeString;
+ PULONG ErrorControl;
+ PWCHAR Buffer;
+ ASSERT(Hive->ReleaseCellRoutine == NULL);
+
+ /* Allocate a driver node and initialize it */
+ DriverNode = CmpAllocate(sizeof(BOOT_DRIVER_NODE), FALSE, TAG_CM);
+ if (!DriverNode) return FALSE;
+ DriverEntry = &DriverNode->ListEntry;
+ DriverEntry->RegistryPath.Buffer = NULL;
+ DriverEntry->FilePath.Buffer = NULL;
+
+ /* Get the driver cell */
+ Node = HvGetCell(Hive, DriverCell);
+ ASSERT(Node);
+
+ /* Get the name from the cell */
+ DriverNode->Name.Length = Node->Flags & KEY_COMP_NAME ?
+ CmpCompressedNameSize(Node->Name, Node->NameLength) :
+ Node->NameLength;
+ DriverNode->Name.MaximumLength = DriverNode->Name.Length;
+ NameLength = DriverNode->Name.Length;
+
+ /* Now allocate the buffer for it and copy the name */
+ DriverNode->Name.Buffer = CmpAllocate(NameLength, FALSE, TAG_CM);
+ if (!DriverNode->Name.Buffer) return FALSE;
+ if (Node->Flags & KEY_COMP_NAME)
+ {
+ /* Compressed name */
+ CmpCopyCompressedName(DriverNode->Name.Buffer,
+ DriverNode->Name.Length,
+ Node->Name,
+ Node->NameLength);
+ }
+ else
+ {
+ /* Normal name */
+ RtlCopyMemory(DriverNode->Name.Buffer, Node->Name, Node->NameLength);
+ }
+
+ /* Now find the image path */
+ RtlInitUnicodeString(&UnicodeString, L"ImagePath");
+ ValueCell = CmpFindValueByName(Hive, Node, &UnicodeString);
+ if (ValueCell == HCELL_NIL)
+ {
+ /* Couldn't find it, so assume the drivers path */
+ Length = sizeof(L"System32\\Drivers\\") + NameLength + sizeof(L".sys");
+
+ /* Allocate the path name */
+ FileName = &DriverEntry->FilePath;
+ FileName->Length = 0;
+ FileName->MaximumLength = Length;
+ FileName->Buffer = CmpAllocate(Length, FALSE,TAG_CM);
+ if (!FileName->Buffer) return FALSE;
+
+ /* Write the path name */
+ RtlAppendUnicodeToString(FileName, L"System32\\Drivers\\");
+ RtlAppendUnicodeStringToString(FileName, &DriverNode->Name);
+ RtlAppendUnicodeToString(FileName, L".sys");
+ }
+ else
+ {
+ /* Path name exists, so grab it */
+ Value = HvGetCell(Hive, ValueCell);
+ ASSERT(Value);
+
+ /* Allocate and setup the path name */
+ FileName = &DriverEntry->FilePath;
+ Buffer = (PWCHAR)CmpValueToData(Hive, Value, &Length);
+ FileName->MaximumLength = FileName->Length = Length;
+ FileName->Buffer = CmpAllocate(Length, FALSE, TAG_CM);
+
+ /* Transfer the data */
+ if (!(FileName->Buffer) || !(Buffer)) return FALSE;
+ RtlCopyMemory(FileName->Buffer, Buffer, Length);
+ }
+
+ /* Now build the registry path */
+ RegistryString = &DriverEntry->RegistryPath;
+ RegistryString->Length = 0;
+ RegistryString->MaximumLength = RegistryPath->Length + NameLength;
+ RegistryString->Buffer = CmpAllocate(RegistryString->MaximumLength, FALSE, TAG_CM);
+ if (!RegistryString->Buffer) return FALSE;
+
+ /* Add the driver name to it */
+ RtlAppendUnicodeStringToString(RegistryString, RegistryPath);
+ RtlAppendUnicodeStringToString(RegistryString, &DriverNode->Name);
+
+ /* The entry is done, add it */
+ InsertHeadList(BootDriverListHead, &DriverEntry->Link);
+
+ /* Now find error control settings */
+ RtlInitUnicodeString(&UnicodeString, L"ErrorControl");
+ ValueCell = CmpFindValueByName(Hive, Node, &UnicodeString);
+ if (ValueCell == HCELL_NIL)
+ {
+ /* Couldn't find it, so assume default */
+ DriverNode->ErrorControl = NormalError;
+ }
+ else
+ {
+ /* Otherwise, read whatever the data says */
+ Value = HvGetCell(Hive, ValueCell);
+ ASSERT(Value);
+ ErrorControl = (PULONG)CmpValueToData(Hive, Value, &Length);
+ ASSERT(ErrorControl);
+ DriverNode->ErrorControl = *ErrorControl;
+ }
+
+ /* Next, get the group cell */
+ RtlInitUnicodeString(&UnicodeString, L"group");
+ ValueCell = CmpFindValueByName(Hive, Node, &UnicodeString);
+ if (ValueCell == HCELL_NIL)
+ {
+ /* Couldn't find, so set an empty string */
+ RtlInitEmptyUnicodeString(&DriverNode->Group, NULL, 0);
+ }
+ else
+ {
+ /* Found it, read the group value */
+ Value = HvGetCell(Hive, ValueCell);
+ ASSERT(Value);
+
+ /* Copy it into the node */
+ DriverNode->Group.Buffer = (PWCHAR)CmpValueToData(Hive, Value, &Length);
+ if (!DriverNode->Group.Buffer) return FALSE;
+ DriverNode->Group.Length = Length - sizeof(UNICODE_NULL);
+ DriverNode->Group.MaximumLength = DriverNode->Group.Length;
+ }
+
+ /* Finally, find the tag */
+ RtlInitUnicodeString(&UnicodeString, L"Tag");
+ TagCell = CmpFindValueByName(Hive, Node, &UnicodeString);
+ if (TagCell == HCELL_NIL)
+ {
+ /* No tag, so load last */
+ DriverNode->Tag = -1;
+ }
+ else
+ {
+ /* Otherwise, decode it based on tag order */
+ DriverNode->Tag = CmpFindTagIndex(Hive,
+ TagCell,
+ GroupOrderCell,
+ &DriverNode->Group);
+ }
+
+ /* All done! */
+ return TRUE;
+}
+
+BOOLEAN
+NTAPI
+CmpIsLoadType(IN PHHIVE Hive,
+ IN HCELL_INDEX Cell,
+ IN SERVICE_LOAD_TYPE LoadType)
+{
+ PCM_KEY_NODE Node;
+ HCELL_INDEX ValueCell;
+ UNICODE_STRING ValueString = RTL_CONSTANT_STRING(L"Start");
+ PCM_KEY_VALUE Value;
+ ULONG Length;
+ PLONG Data;
+ ASSERT(Hive->ReleaseCellRoutine == NULL);
+
+ /* Open the start cell */
+ Node = HvGetCell(Hive, Cell);
+ ASSERT(Node);
+ ValueCell = CmpFindValueByName(Hive, Node, &ValueString);
+ if (ValueCell == HCELL_NIL) return FALSE;
+
+ /* Read the start value */
+ Value = HvGetCell(Hive, ValueCell);
+ ASSERT(Value);
+ Data = (PLONG)CmpValueToData(Hive, Value, &Length);
+ ASSERT(Data);
+
+ /* Return if the type matches */
+ return (*Data == LoadType);
+}
+
+BOOLEAN
+NTAPI
+CmpFindDrivers(IN PHHIVE Hive,
+ IN HCELL_INDEX ControlSet,
+ IN SERVICE_LOAD_TYPE LoadType,
+ IN PWCHAR BootFileSystem OPTIONAL,
+ IN PLIST_ENTRY DriverListHead)
+{
+ HCELL_INDEX ServicesCell, ControlCell, GroupOrderCell, DriverCell;
+ UNICODE_STRING Name;
+ ULONG i;
+ WCHAR Buffer[128];
+ UNICODE_STRING UnicodeString, KeyPath;
+ PBOOT_DRIVER_NODE FsNode;
+ PCM_KEY_NODE ControlNode, ServicesNode, Node;
+ ASSERT(Hive->ReleaseCellRoutine == NULL);
+
+ /* Open the control set key */
+ ControlNode = HvGetCell(Hive, ControlSet);
+ ASSERT(ControlNode);
+
+ /* Get services cell */
+ RtlInitUnicodeString(&Name, L"Services");
+ ServicesCell = CmpFindSubKeyByName(Hive, ControlNode, &Name);
+ if (ServicesCell == HCELL_NIL) return FALSE;
+
+ /* Open services key */
+ ServicesNode = HvGetCell(Hive, ServicesCell);
+ ASSERT(ServicesNode);
+
+ /* Get control cell */
+ RtlInitUnicodeString(&Name, L"Control");
+ ControlCell = CmpFindSubKeyByName(Hive, ControlNode, &Name);
+ if (ControlCell == HCELL_NIL) return FALSE;
+
+ /* Get the group order cell and read it */
+ RtlInitUnicodeString(&Name, L"GroupOrderList");
+ Node = HvGetCell(Hive, ControlCell);
+ ASSERT(Node);
+ GroupOrderCell = CmpFindSubKeyByName(Hive, Node, &Name);
+ if (GroupOrderCell == HCELL_NIL) return FALSE;
+
+ /* Build the root registry path */
+ RtlInitEmptyUnicodeString(&KeyPath, Buffer, sizeof(Buffer));
+ RtlAppendUnicodeToString(&KeyPath, L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\");
+
+ /* Find the first subkey (ie: the first driver or service) */
+ i = 0;
+ DriverCell = CmpFindSubKeyByNumber(Hive, ServicesNode, i);
+ while (DriverCell != HCELL_NIL)
+ {
+ /* Make sure it's a driver of this start type */
+ if (CmpIsLoadType(Hive, DriverCell, LoadType))
+ {
+ /* Add it to the list */
+ CmpAddDriverToList(Hive,
+ DriverCell,
+ GroupOrderCell,
+ &KeyPath,
+ DriverListHead);
+
+ }
+
+ /* Try the next subkey */
+ DriverCell = CmpFindSubKeyByNumber(Hive, ServicesNode, ++i);
+ }
+
+ /* Check if we have a boot file system */
+ if (BootFileSystem)
+ {
+ /* Find it */
+ RtlInitUnicodeString(&UnicodeString, BootFileSystem);
+ DriverCell = CmpFindSubKeyByName(Hive, ServicesNode, &UnicodeString);
+ if (DriverCell != HCELL_NIL)
+ {
+ /* Always add it to the list */
+ CmpAddDriverToList(Hive,
+ DriverCell,
+ GroupOrderCell,
+ &KeyPath,
+ DriverListHead);
+
+ /* Mark it as critical so it always loads */
+ FsNode = CONTAINING_RECORD(DriverListHead->Flink,
+ BOOT_DRIVER_NODE,
+ ListEntry.Link);
+ FsNode->ErrorControl = SERVICE_ERROR_CRITICAL;
+ }
+ }
+
+ /* We're done! */
+ return TRUE;
+}
+
+BOOLEAN
+NTAPI
+CmpDoSort(IN PLIST_ENTRY DriverListHead,
+ IN PUNICODE_STRING OrderList)
+{
+ PWCHAR Current, End = NULL;
+ PLIST_ENTRY NextEntry;
+ UNICODE_STRING GroupName;
+ PBOOT_DRIVER_NODE CurrentNode;
+
+ /* We're going from end to start, so get to the last group and keep going */
+ Current = &OrderList->Buffer[OrderList->Length / sizeof(WCHAR)];
+ while (Current > OrderList->Buffer)
+ {
+ /* Scan the current string */
+ do
+ {
+ if (*Current == UNICODE_NULL) End = Current;
+ } while ((*(--Current - 1) != UNICODE_NULL) && (Current != OrderList->Buffer));
+
+ /* This is our cleaned up string for this specific group */
+ ASSERT(End != NULL);
+ GroupName.Length = (End - Current) * sizeof(WCHAR);
+ GroupName.MaximumLength = GroupName.Length;
+ GroupName.Buffer = Current;
+
+ /* Now loop the driver list */
+ NextEntry = DriverListHead->Flink;
+ while (NextEntry != DriverListHead)
+ {
+ /* Get this node */
+ CurrentNode = CONTAINING_RECORD(NextEntry,
+ BOOT_DRIVER_NODE,
+ ListEntry.Link);
+
+ /* Get the next entry now since we'll do a relink */
+ NextEntry = CurrentNode->ListEntry.Link.Flink;
+
+ /* Is there a group name and does it match the current group? */
+ if ((CurrentNode->Group.Buffer) &&
+ (RtlEqualUnicodeString(&GroupName, &CurrentNode->Group, TRUE)))
+ {
+ /* Remove from this location and re-link in the new one */
+ RemoveEntryList(&CurrentNode->ListEntry.Link);
+ InsertHeadList(DriverListHead, &CurrentNode->ListEntry.Link);
+ }
+ }
+
+ /* Move on */
+ Current--;
+ }
+
+ /* All done */
+ return TRUE;
+}
+
+BOOLEAN
+NTAPI
+CmpSortDriverList(IN PHHIVE Hive,
+ IN HCELL_INDEX ControlSet,
+ IN PLIST_ENTRY DriverListHead)
+{
+ HCELL_INDEX Controls, GroupOrder, ListCell;
+ UNICODE_STRING Name, DependList;
+ PCM_KEY_VALUE ListNode;
+ ULONG Length;
+ PCM_KEY_NODE Node;
+ ASSERT(Hive->ReleaseCellRoutine == NULL);
+
+ /* Open the control key */
+ Node = HvGetCell(Hive, ControlSet);
+ ASSERT(Node);
+ RtlInitUnicodeString(&Name, L"Control");
+ Controls = CmpFindSubKeyByName(Hive, Node, &Name);
+ if (Controls == HCELL_NIL) return FALSE;
+
+ /* Open the service group order */
+ Node = HvGetCell(Hive, Controls);
+ ASSERT(Node);
+ RtlInitUnicodeString(&Name, L"ServiceGroupOrder");
+ GroupOrder = CmpFindSubKeyByName(Hive, Node, &Name);
+ if (GroupOrder == HCELL_NIL) return FALSE;
+
+ /* Open the list key */
+ Node = HvGetCell(Hive, GroupOrder);
+ ASSERT(Node);
+ RtlInitUnicodeString(&Name, L"list");
+ ListCell = CmpFindValueByName(Hive, Node, &Name);
+ if (ListCell == HCELL_NIL) return FALSE;
+
+ /* Now read the actual list */
+ ListNode = HvGetCell(Hive, ListCell);
+ ASSERT(ListNode);
+ if (ListNode->Type != REG_MULTI_SZ) return FALSE;
+
+ /* Copy it into a buffer */
+ DependList.Buffer = (PWCHAR)CmpValueToData(Hive, ListNode, &Length);
+ if (!DependList.Buffer) return FALSE;
+ DependList.Length = DependList.MaximumLength = Length - sizeof(UNICODE_NULL);
+
+ /* And start the recurive sort algorithm */
+ return CmpDoSort(DriverListHead, &DependList);
+}
+
+BOOLEAN
+NTAPI
+CmpOrderGroup(IN PBOOT_DRIVER_NODE StartNode,
+ IN PBOOT_DRIVER_NODE EndNode)
+{
+ PBOOT_DRIVER_NODE CurrentNode, PreviousNode;
+ PLIST_ENTRY ListEntry;
+
+ /* Base case, nothing to do */
+ if (StartNode == EndNode) return TRUE;
+
+ /* Loop the nodes */
+ CurrentNode = StartNode;
+ do
+ {
+ /* Save this as the previous node */
+ PreviousNode = CurrentNode;
+
+ /* And move to the next one */
+ ListEntry = CurrentNode->ListEntry.Link.Flink;
+ CurrentNode = CONTAINING_RECORD(ListEntry,
+ BOOT_DRIVER_NODE,
+ ListEntry.Link);
+
+ /* Check if the previous driver had a bigger tag */
+ if (PreviousNode->Tag > CurrentNode->Tag)
+ {
+ /* Check if we need to update the tail */
+ if (CurrentNode == EndNode)
+ {
+ /* Update the tail */
+ ListEntry = CurrentNode->ListEntry.Link.Blink;
+ EndNode = CONTAINING_RECORD(ListEntry,
+ BOOT_DRIVER_NODE,
+ ListEntry.Link);
+ }
+
+ /* Remove this driver since we need to move it */
+ RemoveEntryList(&CurrentNode->ListEntry.Link);
+
+ /* Keep looping until we find a driver with a lower tag than ours */
+ while ((PreviousNode->Tag > CurrentNode->Tag) && (PreviousNode != StartNode))
+ {
+ /* We'll be re-inserted at this spot */
+ ListEntry = PreviousNode->ListEntry.Link.Blink;
+ PreviousNode = CONTAINING_RECORD(ListEntry,
+ BOOT_DRIVER_NODE,
+ ListEntry.Link);
+ }
+
+ /* Do the insert in the new location */
+ InsertTailList(&PreviousNode->ListEntry.Link, &CurrentNode->ListEntry.Link);
+
+ /* Update the head, if needed */
+ if (PreviousNode == StartNode) StartNode = CurrentNode;
+ }
+ } while (CurrentNode != EndNode);
+
+ /* All done */
+ return TRUE;
+}
+
+BOOLEAN
+NTAPI
+CmpResolveDriverDependencies(IN PLIST_ENTRY DriverListHead)
+{
+ PLIST_ENTRY NextEntry;
+ PBOOT_DRIVER_NODE StartNode, EndNode, CurrentNode;
+
+ /* Loop the list */
+ NextEntry = DriverListHead->Flink;
+ while (NextEntry != DriverListHead)
+ {
+ /* Find the first entry */
+ StartNode = CONTAINING_RECORD(NextEntry,
+ BOOT_DRIVER_NODE,
+ ListEntry.Link);
+ do
+ {
+ /* Find the last entry */
+ EndNode = CONTAINING_RECORD(NextEntry,
+ BOOT_DRIVER_NODE,
+ ListEntry.Link);
+
+ /* Get the next entry */
+ NextEntry = NextEntry->Flink;
+ CurrentNode = CONTAINING_RECORD(NextEntry,
+ BOOT_DRIVER_NODE,
+ ListEntry.Link);
+
+ /* If the next entry is back to the top, break out */
+ if (NextEntry == DriverListHead) break;
+
+ /* Otherwise, check if this entry is equal */
+ if (!RtlEqualUnicodeString(&StartNode->Group,
+ &CurrentNode->Group,
+ TRUE))
+ {
+ /* It is, so we've detected a cycle, break out */
+ break;
+ }
+ } while (NextEntry != DriverListHead);
+
+ /* Now we have the correct start and end pointers, so do the sort */
+ CmpOrderGroup(StartNode, EndNode);
+ }
+
+ /* We're done */
+ return TRUE;
+}
+
+/* EOF */
diff --git a/reactos/ntoskrnl/config/cmsysini.c b/reactos/ntoskrnl/config/cmsysini.c
index 0326e88e619..3587efe7326 100644
--- a/reactos/ntoskrnl/config/cmsysini.c
+++ b/reactos/ntoskrnl/config/cmsysini.c
@@ -1,12 +1,13 @@
/*
* PROJECT: ReactOS Kernel
- * LICENSE: GPL - See COPYING in the top level directory
+ * LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: ntoskrnl/config/cmsysini.c
* PURPOSE: Configuration Manager - System Initialization Code
- * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
+ * PROGRAMMERS: ReactOS Portable Systems Group
+ * Alex Ionescu (alex.ionescu@reactos.org)
*/
-/* INCLUDES ******************************************************************/
+/* INCLUDES *******************************************************************/
#include "ntoskrnl.h"
#define NDEBUG
@@ -33,7 +34,7 @@ ULONG CmpTraceLevel = 0;
extern LONG CmpFlushStarveWriters;
extern BOOLEAN CmFirstTime;
-/* FUNCTIONS *****************************************************************/
+/* FUNCTIONS ******************************************************************/
VOID
NTAPI
@@ -1574,6 +1575,162 @@ CmInitSystem1(VOID)
return TRUE;
}
+VOID
+NTAPI
+CmpFreeDriverList(IN PHHIVE Hive,
+ IN PLIST_ENTRY DriverList)
+{
+ PLIST_ENTRY NextEntry, OldEntry;
+ PBOOT_DRIVER_NODE DriverNode;
+ PAGED_CODE();
+
+ /* Parse the current list */
+ NextEntry = DriverList->Flink;
+ while (NextEntry != DriverList)
+ {
+ /* Get the driver node */
+ DriverNode = CONTAINING_RECORD(NextEntry, BOOT_DRIVER_NODE, ListEntry.Link);
+
+ /* Get the next entry now, since we're going to free it later */
+ OldEntry = NextEntry;
+ NextEntry = NextEntry->Flink;
+
+ /* Was there a name? */
+ if (DriverNode->Name.Buffer)
+ {
+ /* Free it */
+ CmpFree(DriverNode->Name.Buffer, DriverNode->Name.Length);
+ }
+
+ /* Was there a registry path? */
+ if (DriverNode->ListEntry.RegistryPath.Buffer)
+ {
+ /* Free it */
+ CmpFree(DriverNode->ListEntry.RegistryPath.Buffer,
+ DriverNode->ListEntry.RegistryPath.MaximumLength);
+ }
+
+ /* Was there a file path? */
+ if (DriverNode->ListEntry.FilePath.Buffer)
+ {
+ /* Free it */
+ CmpFree(DriverNode->ListEntry.FilePath.Buffer,
+ DriverNode->ListEntry.FilePath.MaximumLength);
+ }
+
+ /* Now free the node, and move on */
+ CmpFree(OldEntry, sizeof(BOOT_DRIVER_NODE));
+ }
+}
+
+PUNICODE_STRING*
+NTAPI
+CmGetSystemDriverList(VOID)
+{
+ LIST_ENTRY DriverList;
+ OBJECT_ATTRIBUTES ObjectAttributes;
+ NTSTATUS Status;
+ PCM_KEY_BODY KeyBody;
+ PHHIVE Hive;
+ HCELL_INDEX RootCell, ControlCell;
+ HANDLE KeyHandle;
+ UNICODE_STRING KeyName;
+ PLIST_ENTRY NextEntry;
+ ULONG i;
+ PUNICODE_STRING* ServicePath = NULL;
+ BOOLEAN Success, AutoSelect;
+ PBOOT_DRIVER_LIST_ENTRY DriverEntry;
+ PAGED_CODE();
+
+ /* Initialize the driver list */
+ InitializeListHead(&DriverList);
+
+ /* Open the system hive key */
+ RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\System");
+ InitializeObjectAttributes(&ObjectAttributes,
+ &KeyName,
+ OBJ_CASE_INSENSITIVE,
+ NULL,
+ NULL);
+ Status = NtOpenKey(&KeyHandle, KEY_READ, &ObjectAttributes);
+ if (!NT_SUCCESS(Status)) return NULL;
+
+ /* Reference the key object to get the root hive/cell to access directly */
+ Status = ObReferenceObjectByHandle(KeyHandle,
+ KEY_QUERY_VALUE,
+ CmpKeyObjectType,
+ KernelMode,
+ (PVOID*)&KeyBody,
+ NULL);
+ if (!NT_SUCCESS(Status))
+ {
+ /* Fail */
+ NtClose(KeyHandle);
+ return NULL;
+ }
+
+ /* Do all this under the registry lock */
+ CmpLockRegistryExclusive();
+
+ /* Get the hive and key cell */
+ Hive = KeyBody->KeyControlBlock->KeyHive;
+ RootCell = KeyBody->KeyControlBlock->KeyCell;
+
+ /* Open the current control set key */
+ RtlInitUnicodeString(&KeyName, L"Current");
+ ControlCell = CmpFindControlSet(Hive, RootCell, &KeyName, &AutoSelect);
+ if (ControlCell == HCELL_NIL) goto EndPath;
+
+ /* Find all system drivers */
+ Success = CmpFindDrivers(Hive, ControlCell, SystemLoad, NULL, &DriverList);
+ if (!Success) goto EndPath;
+
+ /* Sort by group/tag */
+ if (!CmpSortDriverList(Hive, ControlCell, &DriverList)) goto EndPath;
+
+ /* Remove circular dependencies (cycles) and sort */
+ if (!CmpResolveDriverDependencies(&DriverList)) goto EndPath;
+
+ /* Loop the list to count drivers */
+ for (i = 0, NextEntry = DriverList.Flink;
+ NextEntry != &DriverList;
+ i++, NextEntry = NextEntry->Flink);
+
+ /* Allocate the array */
+ ServicePath = ExAllocatePool(NonPagedPool, (i + 1) * sizeof(PUNICODE_STRING));
+ if (!ServicePath) KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 2, 1, 0, 0);
+
+ /* Loop the driver list */
+ for (i = 0, NextEntry = DriverList.Flink;
+ NextEntry != &DriverList;
+ i++, NextEntry = NextEntry->Flink)
+ {
+ /* Get the entry */
+ DriverEntry = CONTAINING_RECORD(NextEntry, BOOT_DRIVER_LIST_ENTRY, Link);
+
+ /* Allocate the path for the caller and duplicate the registry path */
+ ServicePath[i] = ExAllocatePool(NonPagedPool, sizeof(UNICODE_STRING));
+ RtlDuplicateUnicodeString(RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE,
+ &DriverEntry->RegistryPath,
+ ServicePath[i]);
+ }
+
+ /* Terminate the list */
+ ServicePath[i] = NULL;
+
+EndPath:
+ /* Free the driver list if we had one */
+ if (!IsListEmpty(&DriverList)) CmpFreeDriverList(Hive, &DriverList);
+
+ /* Unlock the registry */
+ CmpUnlockRegistry();
+
+ /* Close the key handle and dereference the object, then return the path */
+ ObDereferenceObject(KeyBody);
+ NtClose(KeyHandle);
+ return ServicePath;
+}
+
VOID
NTAPI
CmpLockRegistryExclusive(VOID)
@@ -1771,3 +1928,5 @@ CmShutdownSystem(VOID)
if (!CmFirstTime) CmpShutdownWorkers();
CmpDoFlushAll(TRUE);
}
+
+/* EOF */
diff --git a/reactos/ntoskrnl/include/internal/cm.h b/reactos/ntoskrnl/include/internal/cm.h
index 4880dc08026..62f4010f20b 100644
--- a/reactos/ntoskrnl/include/internal/cm.h
+++ b/reactos/ntoskrnl/include/internal/cm.h
@@ -1522,6 +1522,40 @@ CmSetLazyFlushState(
IN BOOLEAN Enable
);
+//
+// Driver List Routines
+//
+PUNICODE_STRING*
+NTAPI
+CmGetSystemDriverList(
+ VOID
+);
+
+BOOLEAN
+NTAPI
+CmpFindDrivers(
+ IN PHHIVE Hive,
+ IN HCELL_INDEX ControlSet,
+ IN SERVICE_LOAD_TYPE LoadType,
+ IN PWSTR BootFileSystem OPTIONAL,
+ IN PLIST_ENTRY DriverListHead
+);
+
+
+BOOLEAN
+NTAPI
+CmpSortDriverList(
+ IN PHHIVE Hive,
+ IN HCELL_INDEX ControlSet,
+ IN PLIST_ENTRY DriverListHead
+);
+
+BOOLEAN
+NTAPI
+CmpResolveDriverDependencies(
+ IN PLIST_ENTRY DriverListHead
+);
+
//
// Global variables accessible from all of Cm
//
diff --git a/reactos/ntoskrnl/io/iomgr/driver.c b/reactos/ntoskrnl/io/iomgr/driver.c
index f00a87d0e09..18202bfd5e4 100644
--- a/reactos/ntoskrnl/io/iomgr/driver.c
+++ b/reactos/ntoskrnl/io/iomgr/driver.c
@@ -200,6 +200,7 @@ IopDisplayLoadingMessage(PUNICODE_STRING ServiceName)
UNICODE_STRING DotSys = RTL_CONSTANT_STRING(L".SYS");
if (ExpInTextModeSetup) return;
+ if (!KeLoaderBlock) return;
RtlUpcaseUnicodeString(ServiceName, ServiceName, FALSE);
snprintf(TextBuffer, sizeof(TextBuffer),
"%s%sSystem32\\Drivers\\%wZ%s\n",
@@ -1070,6 +1071,38 @@ IopInitializeBootDrivers(VOID)
InitializeListHead(&KeLoaderBlock->LoadOrderListHead);
}
+VOID
+FASTCALL
+IopInitializeSystemDrivers(VOID)
+{
+ PUNICODE_STRING *DriverList, *SavedList;
+
+ /* No system drivers on the boot cd */
+ if (KeLoaderBlock->SetupLdrBlock) return;
+
+ /* Get the driver list */
+ SavedList = DriverList = CmGetSystemDriverList();
+ ASSERT(DriverList);
+
+ /* Loop it */
+ while (*DriverList)
+ {
+ /* Load the driver */
+ ZwLoadDriver(*DriverList);
+
+ /* Free the entry */
+ RtlFreeUnicodeString(*DriverList);
+ ExFreePool(*DriverList);
+
+ /* Next entry */
+ InbvIndicateProgress();
+ DriverList++;
+ }
+
+ /* Free the list */
+ ExFreePool(SavedList);
+}
+
/*
* IopUnloadDriver
*
@@ -1791,6 +1824,8 @@ IopLoadUnloadDriver(PLOAD_UNLOAD_PARAMS LoadParams)
cur--;
}
+ IopDisplayLoadingMessage(&ServiceName);
+
/*
* Get service type.
*/
diff --git a/reactos/ntoskrnl/io/iomgr/drvrlist.c b/reactos/ntoskrnl/io/iomgr/drvrlist.c
deleted file mode 100644
index e15aab2a2cd..00000000000
--- a/reactos/ntoskrnl/io/iomgr/drvrlist.c
+++ /dev/null
@@ -1,561 +0,0 @@
-/*
- * PROJECT: ReactOS Kernel
- * LICENSE: GPL - See COPYING in the top level directory
- * FILE: ntoskrnl/io/iomgr/drvrlist.c
- * PURPOSE: Driver List support for Grouping, Tagging, Sorting, etc.
- * PROGRAMMERS:
- */
-
-/* INCLUDES *******************************************************************/
-
-#include
-#define NDEBUG
-#include
-
-typedef struct _SERVICE_GROUP
-{
- LIST_ENTRY GroupListEntry;
- UNICODE_STRING GroupName;
- BOOLEAN ServicesRunning;
- ULONG TagCount;
- PULONG TagArray;
-} SERVICE_GROUP, *PSERVICE_GROUP;
-
-typedef struct _SERVICE
-{
- LIST_ENTRY ServiceListEntry;
- UNICODE_STRING ServiceName;
- UNICODE_STRING RegistryPath;
- UNICODE_STRING ServiceGroup;
- UNICODE_STRING ImagePath;
-
- ULONG Start;
- ULONG Type;
- ULONG ErrorControl;
- ULONG Tag;
-
-/* BOOLEAN ServiceRunning;*/ // needed ??
-} SERVICE, *PSERVICE;
-
-#define TAG_RTLREGISTRY 'vrqR'
-
-/* GLOBALS ********************************************************************/
-
-LIST_ENTRY GroupListHead = {NULL, NULL};
-LIST_ENTRY ServiceListHead = {NULL, NULL};
-extern BOOLEAN NoGuiBoot;
-
-VOID
-FASTCALL
-INIT_FUNCTION
-IopDisplayLoadingMessage(PUNICODE_STRING ServiceName);
-
-/* PRIVATE FUNCTIONS **********************************************************/
-
-static NTSTATUS NTAPI
-IopGetGroupOrderList(PWSTR ValueName,
- ULONG ValueType,
- PVOID ValueData,
- ULONG ValueLength,
- PVOID Context,
- PVOID EntryContext)
-{
- PSERVICE_GROUP Group;
-
- DPRINT("IopGetGroupOrderList(%S, %x, 0x%p, %x, 0x%p, 0x%p)\n",
- ValueName, ValueType, ValueData, ValueLength, Context, EntryContext);
-
- if (ValueType == REG_BINARY &&
- ValueData != NULL &&
- ValueLength >= sizeof(ULONG) &&
- ValueLength >= (*(PULONG)ValueData + 1) * sizeof(ULONG))
- {
- Group = (PSERVICE_GROUP)Context;
- Group->TagCount = ((PULONG)ValueData)[0];
- if (Group->TagCount > 0)
- {
- if (ValueLength >= (Group->TagCount + 1) * sizeof(ULONG))
- {
- Group->TagArray = ExAllocatePool(NonPagedPool, Group->TagCount * sizeof(ULONG));
- if (Group->TagArray == NULL)
- {
- Group->TagCount = 0;
- return STATUS_INSUFFICIENT_RESOURCES;
- }
- memcpy(Group->TagArray, (PULONG)ValueData + 1, Group->TagCount * sizeof(ULONG));
- }
- else
- {
- Group->TagCount = 0;
- return STATUS_UNSUCCESSFUL;
- }
- }
- }
- return STATUS_SUCCESS;
-}
-
-static NTSTATUS NTAPI
-IopCreateGroupListEntry(PWSTR ValueName,
- ULONG ValueType,
- PVOID ValueData,
- ULONG ValueLength,
- PVOID Context,
- PVOID EntryContext)
-{
- PSERVICE_GROUP Group;
- RTL_QUERY_REGISTRY_TABLE QueryTable[2];
- NTSTATUS Status;
-
-
- if (ValueType == REG_SZ)
- {
- DPRINT("GroupName: '%S'\n", (PWCHAR)ValueData);
-
- Group = ExAllocatePool(NonPagedPool,
- sizeof(SERVICE_GROUP));
- if (Group == NULL)
- {
- return(STATUS_INSUFFICIENT_RESOURCES);
- }
-
- RtlZeroMemory(Group, sizeof(SERVICE_GROUP));
-
- if (!RtlCreateUnicodeString(&Group->GroupName, (PWSTR)ValueData))
- {
- ExFreePool(Group);
- return(STATUS_INSUFFICIENT_RESOURCES);
- }
-
- RtlZeroMemory(&QueryTable, sizeof(QueryTable));
- QueryTable[0].Name = (PWSTR)ValueData;
- QueryTable[0].QueryRoutine = IopGetGroupOrderList;
-
- Status = RtlQueryRegistryValues(RTL_REGISTRY_CONTROL,
- L"GroupOrderList",
- QueryTable,
- (PVOID)Group,
- NULL);
- DPRINT("%x %d %S\n", Status, Group->TagCount, (PWSTR)ValueData);
-
- InsertTailList(&GroupListHead,
- &Group->GroupListEntry);
- }
-
- return(STATUS_SUCCESS);
-}
-
-
-static NTSTATUS NTAPI
-IopCreateServiceListEntry(PUNICODE_STRING ServiceName)
-{
- RTL_QUERY_REGISTRY_TABLE QueryTable[7];
- PSERVICE Service;
- NTSTATUS Status;
- ULONG DefaultTag = MAXULONG;
-
- DPRINT("ServiceName: '%wZ'\n", ServiceName);
-
- /* Allocate service entry */
- Service = (PSERVICE)ExAllocatePool(NonPagedPool, sizeof(SERVICE));
- if (Service == NULL)
- {
- DPRINT1("ExAllocatePool() failed\n");
- return(STATUS_INSUFFICIENT_RESOURCES);
- }
- RtlZeroMemory(Service, sizeof(SERVICE));
-
- /* Get service data */
- RtlZeroMemory(&QueryTable,
- sizeof(QueryTable));
-
- QueryTable[0].Name = L"Start";
- QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED;
- QueryTable[0].EntryContext = &Service->Start;
-
- QueryTable[1].Name = L"Type";
- QueryTable[1].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED;
- QueryTable[1].EntryContext = &Service->Type;
-
- QueryTable[2].Name = L"ErrorControl";
- QueryTable[2].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED;
- QueryTable[2].EntryContext = &Service->ErrorControl;
-
- QueryTable[3].Name = L"Group";
- QueryTable[3].Flags = RTL_QUERY_REGISTRY_DIRECT;
- QueryTable[3].EntryContext = &Service->ServiceGroup;
-
- QueryTable[4].Name = L"ImagePath";
- QueryTable[4].Flags = RTL_QUERY_REGISTRY_DIRECT;
- QueryTable[4].EntryContext = &Service->ImagePath;
-
- QueryTable[5].Name = L"Tag";
- QueryTable[5].Flags = RTL_QUERY_REGISTRY_DIRECT;
- QueryTable[5].EntryContext = &Service->Tag;
- QueryTable[5].DefaultData = &DefaultTag;
- QueryTable[5].DefaultType = REG_DWORD;
- QueryTable[5].DefaultLength = sizeof(DefaultTag);
-
- Status = RtlQueryRegistryValues(RTL_REGISTRY_SERVICES,
- ServiceName->Buffer,
- QueryTable,
- NULL,
- NULL);
- if (!NT_SUCCESS(Status) || Service->Start > 1)
- {
- /*
- * If something goes wrong during RtlQueryRegistryValues
- * it'll just drop everything on the floor and return,
- * so you have to check if the buffers were filled.
- * Luckily we zerofilled the Service.
- */
- if (Service->ServiceGroup.Buffer)
- {
- ExFreePoolWithTag(Service->ServiceGroup.Buffer, TAG_RTLREGISTRY);
- }
- if (Service->ImagePath.Buffer)
- {
- ExFreePoolWithTag(Service->ImagePath.Buffer, TAG_RTLREGISTRY);
- }
- ExFreePool(Service);
- return(Status);
- }
-
- /* Copy service name */
- Service->ServiceName.Length = ServiceName->Length;
- Service->ServiceName.MaximumLength = ServiceName->Length + sizeof(WCHAR);
- Service->ServiceName.Buffer = ExAllocatePool(NonPagedPool,
- Service->ServiceName.MaximumLength);
- RtlCopyMemory(Service->ServiceName.Buffer,
- ServiceName->Buffer,
- ServiceName->Length);
- Service->ServiceName.Buffer[ServiceName->Length / sizeof(WCHAR)] = 0;
-
- /* Build registry path */
- Service->RegistryPath.MaximumLength = MAX_PATH * sizeof(WCHAR);
- Service->RegistryPath.Buffer = ExAllocatePool(NonPagedPool,
- MAX_PATH * sizeof(WCHAR));
- wcscpy(Service->RegistryPath.Buffer,
- L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\");
- wcscat(Service->RegistryPath.Buffer,
- Service->ServiceName.Buffer);
- Service->RegistryPath.Length = wcslen(Service->RegistryPath.Buffer) * sizeof(WCHAR);
-
- DPRINT("ServiceName: '%wZ'\n", &Service->ServiceName);
- DPRINT("RegistryPath: '%wZ'\n", &Service->RegistryPath);
- DPRINT("ServiceGroup: '%wZ'\n", &Service->ServiceGroup);
- DPRINT("ImagePath: '%wZ'\n", &Service->ImagePath);
- DPRINT("Start %lx Type %lx Tag %lx ErrorControl %lx\n",
- Service->Start, Service->Type, Service->Tag, Service->ErrorControl);
-
- /* Append service entry */
- InsertTailList(&ServiceListHead,
- &Service->ServiceListEntry);
-
- return(STATUS_SUCCESS);
-}
-
-
-NTSTATUS INIT_FUNCTION
-IoCreateDriverList(VOID)
-{
- RTL_QUERY_REGISTRY_TABLE QueryTable[2];
- PKEY_BASIC_INFORMATION KeyInfo = NULL;
- OBJECT_ATTRIBUTES ObjectAttributes;
- UNICODE_STRING ServicesKeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Services");
- UNICODE_STRING SubKeyName;
- HANDLE KeyHandle;
- NTSTATUS Status;
- ULONG Index;
-
- ULONG KeyInfoLength = 0;
- ULONG ReturnedLength;
-
- DPRINT("IoCreateDriverList() called\n");
-
- /* Initialize basic variables */
- InitializeListHead(&GroupListHead);
- InitializeListHead(&ServiceListHead);
-
- /* Build group order list */
- RtlZeroMemory(&QueryTable,
- sizeof(QueryTable));
-
- QueryTable[0].Name = L"List";
- QueryTable[0].QueryRoutine = IopCreateGroupListEntry;
-
- Status = RtlQueryRegistryValues(RTL_REGISTRY_CONTROL,
- L"ServiceGroupOrder",
- QueryTable,
- NULL,
- NULL);
- if (!NT_SUCCESS(Status))
- return(Status);
-
- /* Enumerate services and create the service list */
- InitializeObjectAttributes(&ObjectAttributes,
- &ServicesKeyName,
- OBJ_CASE_INSENSITIVE,
- NULL,
- NULL);
-
- Status = ZwOpenKey(&KeyHandle,
- KEY_ENUMERATE_SUB_KEYS,
- &ObjectAttributes);
- if (!NT_SUCCESS(Status))
- {
- return(Status);
- }
-
- KeyInfoLength = sizeof(KEY_BASIC_INFORMATION) + MAX_PATH * sizeof(WCHAR);
- KeyInfo = ExAllocatePool(NonPagedPool, KeyInfoLength);
- if (KeyInfo == NULL)
- {
- ZwClose(KeyHandle);
- return(STATUS_INSUFFICIENT_RESOURCES);
- }
-
- Index = 0;
- while (TRUE)
- {
- Status = ZwEnumerateKey(KeyHandle,
- Index,
- KeyBasicInformation,
- KeyInfo,
- KeyInfoLength,
- &ReturnedLength);
- if (NT_SUCCESS(Status))
- {
- if (KeyInfo->NameLength < MAX_PATH * sizeof(WCHAR))
- {
-
- SubKeyName.Length = (USHORT)KeyInfo->NameLength;
- SubKeyName.MaximumLength = (USHORT)KeyInfo->NameLength + sizeof(WCHAR);
- SubKeyName.Buffer = KeyInfo->Name;
- SubKeyName.Buffer[SubKeyName.Length / sizeof(WCHAR)] = 0;
-
- DPRINT("KeyName: '%wZ'\n", &SubKeyName);
- IopCreateServiceListEntry(&SubKeyName);
- }
- }
-
- if (!NT_SUCCESS(Status))
- break;
-
- Index++;
- }
-
- ExFreePool(KeyInfo);
- ZwClose(KeyHandle);
-
- DPRINT("IoCreateDriverList() done\n");
-
- return(STATUS_SUCCESS);
-}
-
-NTSTATUS INIT_FUNCTION
-IoDestroyDriverList(VOID)
-{
- PSERVICE_GROUP CurrentGroup;
- PSERVICE CurrentService;
- PLIST_ENTRY NextEntry, TempEntry;
-
- DPRINT("IoDestroyDriverList() called\n");
-
- /* Destroy the Group List */
- for (NextEntry = GroupListHead.Flink, TempEntry = NextEntry->Flink;
- NextEntry != &GroupListHead;
- NextEntry = TempEntry, TempEntry = NextEntry->Flink)
- {
- /* Get the entry */
- CurrentGroup = CONTAINING_RECORD(NextEntry,
- SERVICE_GROUP,
- GroupListEntry);
-
- /* Remove it from the list */
- RemoveEntryList(&CurrentGroup->GroupListEntry);
-
- /* Free buffers */
- ExFreePool(CurrentGroup->GroupName.Buffer);
- if (CurrentGroup->TagArray)
- ExFreePool(CurrentGroup->TagArray);
- ExFreePool(CurrentGroup);
- }
-
- /* Destroy the Service List */
- for (NextEntry = ServiceListHead.Flink, TempEntry = NextEntry->Flink;
- NextEntry != &ServiceListHead;
- NextEntry = TempEntry, TempEntry = NextEntry->Flink)
- {
- /* Get the entry */
- CurrentService = CONTAINING_RECORD(NextEntry,
- SERVICE,
- ServiceListEntry);
-
- /* Remove it from the list */
- RemoveEntryList(&CurrentService->ServiceListEntry);
-
- /* Free buffers */
- ExFreePool(CurrentService->ServiceName.Buffer);
- ExFreePool(CurrentService->RegistryPath.Buffer);
- if (CurrentService->ServiceGroup.Buffer)
- ExFreePool(CurrentService->ServiceGroup.Buffer);
- if (CurrentService->ImagePath.Buffer)
- ExFreePool(CurrentService->ImagePath.Buffer);
- ExFreePool(CurrentService);
- }
-
- DPRINT("IoDestroyDriverList() done\n");
-
- /* Return success */
- return STATUS_SUCCESS;
-}
-
-static INIT_FUNCTION NTSTATUS
-IopLoadDriver(PSERVICE Service)
-{
- NTSTATUS Status = STATUS_UNSUCCESSFUL;
- PUNICODE_STRING ImagePath = &Service->ImagePath;
- PWCHAR ImageName;
- UNICODE_STRING ImageNameU;
-
- ImageName = wcsrchr(ImagePath->Buffer, L'\\');
- if (!ImageName)
- ImageName = ImagePath->Buffer;
- else
- ImageName++;
-
- RtlInitUnicodeString(&ImageNameU, ImageName);
-
- IopDisplayLoadingMessage(&ImageNameU);
-
- Status = ZwLoadDriver(&Service->RegistryPath);
- IopBootLog(&Service->ImagePath, NT_SUCCESS(Status) ? TRUE : FALSE);
- if (!NT_SUCCESS(Status))
- {
- DPRINT("IopLoadDriver() failed (Status %lx)\n", Status);
-#if 0
- if (Service->ErrorControl == 1)
- {
- /* Log error */
- }
- else if (Service->ErrorControl == 2)
- {
- if (IsLastKnownGood == FALSE)
- {
- /* Boot last known good configuration */
- }
- }
- else if (Service->ErrorControl == 3)
- {
- if (IsLastKnownGood == FALSE)
- {
- /* Boot last known good configuration */
- }
- else
- {
- /* BSOD! */
- }
- }
-#endif
- }
- return Status;
-}
-
-/*
- * IopInitializeSystemDrivers
- *
- * Load drivers marked as system start.
- *
- * Parameters
- * None
- *
- * Return Value
- * None
- */
-VOID
-FASTCALL
-IopInitializeSystemDrivers(VOID)
-{
- PSERVICE_GROUP CurrentGroup;
- PSERVICE CurrentService;
- NTSTATUS Status;
- ULONG i;
- PLIST_ENTRY NextGroupEntry, NextServiceEntry;
-
- DPRINT("IopInitializeSystemDrivers()\n");
-
- /* Start looping */
- for (NextGroupEntry = GroupListHead.Flink;
- NextGroupEntry != &GroupListHead;
- NextGroupEntry = NextGroupEntry->Flink)
- {
- /* Get the entry */
- CurrentGroup = CONTAINING_RECORD(NextGroupEntry,
- SERVICE_GROUP,
- GroupListEntry);
-
- DPRINT("Group: %wZ\n", &CurrentGroup->GroupName);
-
- /* Load all drivers with a valid tag */
- for (i = 0; i < CurrentGroup->TagCount; i++)
- {
- /* Start looping */
- for (NextServiceEntry = ServiceListHead.Flink;
- NextServiceEntry != &ServiceListHead;
- NextServiceEntry = NextServiceEntry->Flink)
- {
- /* Get the entry */
- CurrentService = CONTAINING_RECORD(NextServiceEntry,
- SERVICE,
- ServiceListEntry);
-
- if ((!RtlCompareUnicodeString(&CurrentGroup->GroupName,
- &CurrentService->ServiceGroup,
- TRUE)) &&
- (CurrentService->Start == SERVICE_SYSTEM_START) &&
- (CurrentService->Tag == CurrentGroup->TagArray[i]))
-
- {
- DPRINT(" Path: %wZ\n", &CurrentService->RegistryPath);
- Status = IopLoadDriver(CurrentService);
- InbvIndicateProgress();
- }
- }
- }
-
- /* Load all drivers without a tag or with an invalid tag */
- for (NextServiceEntry = ServiceListHead.Flink;
- NextServiceEntry != &ServiceListHead;
- NextServiceEntry = NextServiceEntry->Flink)
- {
- /* Get the entry */
- CurrentService = CONTAINING_RECORD(NextServiceEntry,
- SERVICE,
- ServiceListEntry);
-
- if ((!RtlCompareUnicodeString(&CurrentGroup->GroupName,
- &CurrentService->ServiceGroup,
- TRUE)) &&
- (CurrentService->Start == SERVICE_SYSTEM_START))
- {
- for (i = 0; i < CurrentGroup->TagCount; i++)
- {
- if (CurrentGroup->TagArray[i] == CurrentService->Tag)
- {
- break;
- }
- }
-
- if (i >= CurrentGroup->TagCount)
- {
- DPRINT(" Path: %wZ\n", &CurrentService->RegistryPath);
- Status = IopLoadDriver(CurrentService);
- InbvIndicateProgress();
- }
-
- }
- }
- }
-
- DPRINT("IopInitializeSystemDrivers() done\n");
-}
diff --git a/reactos/ntoskrnl/io/iomgr/iomgr.c b/reactos/ntoskrnl/io/iomgr/iomgr.c
index c7999660a61..e52f2fe54ab 100644
--- a/reactos/ntoskrnl/io/iomgr/iomgr.c
+++ b/reactos/ntoskrnl/io/iomgr/iomgr.c
@@ -493,9 +493,6 @@ IoInitSystem(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
/* Setup the group cache */
if (!NT_SUCCESS(PiInitCacheGroupInformation())) return FALSE;
- /* Create the group driver list */
- IoCreateDriverList();
-
/* Load boot start drivers */
IopInitializeBootDrivers();
@@ -533,9 +530,6 @@ IoInitSystem(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
IopInitializeSystemDrivers();
PnpSystemInit = TRUE;
- /* Destroy the group driver list */
- IoDestroyDriverList();
-
/* Reinitialize drivers that requested it */
IopReinitializeDrivers();
diff --git a/reactos/ntoskrnl/ntoskrnl-generic.rbuild b/reactos/ntoskrnl/ntoskrnl-generic.rbuild
index b6ed1824217..a349f887312 100644
--- a/reactos/ntoskrnl/ntoskrnl-generic.rbuild
+++ b/reactos/ntoskrnl/ntoskrnl-generic.rbuild
@@ -244,7 +244,6 @@
device.c
deviface.c
driver.c
- drvrlist.c
error.c
file.c
iocomp.c
From d384dbd46a969a288dede53e61cc85ac3ab730fd Mon Sep 17 00:00:00 2001
From: Eric Kohl
Date: Sat, 3 Apr 2010 10:52:17 +0000
Subject: [PATCH 017/261] [NTOSKRNL] - Implement the calculation of access
rights for the MAXIMUM_ALLOWED case.
svn path=/trunk/; revision=46695
---
reactos/ntoskrnl/se/semgr.c | 78 ++++++++++++++++++++++++++++++++-----
1 file changed, 69 insertions(+), 9 deletions(-)
diff --git a/reactos/ntoskrnl/se/semgr.c b/reactos/ntoskrnl/se/semgr.c
index 2ebd18090e8..104c5de6ffd 100644
--- a/reactos/ntoskrnl/se/semgr.c
+++ b/reactos/ntoskrnl/se/semgr.c
@@ -391,6 +391,9 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
LUID_AND_ATTRIBUTES Privilege;
ACCESS_MASK CurrentAccess, AccessMask;
ACCESS_MASK RemainingAccess;
+ ACCESS_MASK TempAccess;
+ ACCESS_MASK TempGrantedAccess = 0;
+ ACCESS_MASK TempDeniedAccess = 0;
PACCESS_TOKEN Token;
ULONG i;
PACL Dacl;
@@ -544,6 +547,69 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
return FALSE;
}
+ /* Determine the MAXIMUM_ALLOWED access rights */
+ if (DesiredAccess & MAXIMUM_ALLOWED)
+ {
+ CurrentAce = (PACE)(Dacl + 1);
+ for (i = 0; i < Dacl->AceCount; i++)
+ {
+ Sid = (PSID)(CurrentAce + 1);
+ if (CurrentAce->Header.AceType == ACCESS_DENIED_ACE_TYPE)
+ {
+ if (SepSidInToken(Token, Sid))
+ {
+ /* Map access rights from the ACE */
+ TempAccess = CurrentAce->AccessMask;
+ RtlMapGenericMask(&TempAccess, GenericMapping);
+
+ /* Deny access rights that have not been granted yet */
+ TempDeniedAccess |= (TempAccess & ~TempGrantedAccess);
+ }
+ }
+ else if (CurrentAce->Header.AceType == ACCESS_ALLOWED_ACE_TYPE)
+ {
+ if (SepSidInToken(Token, Sid))
+ {
+ /* Map access rights from the ACE */
+ TempAccess = CurrentAce->AccessMask;
+ RtlMapGenericMask(&TempAccess, GenericMapping);
+
+ /* Grant access rights that have not been denied yet */
+ TempGrantedAccess |= (TempAccess & ~TempDeniedAccess);
+ }
+ }
+ else
+ {
+ DPRINT1("Unsupported ACE type 0x%lx\n", CurrentAce->Header.AceType);
+ }
+
+ /* Get to the next ACE */
+ CurrentAce = (PACE)((ULONG_PTR)CurrentAce + CurrentAce->Header.AceSize);
+ }
+
+ /* Fail if some rights have not been granted */
+ RemainingAccess &= ~(MAXIMUM_ALLOWED | TempGrantedAccess);
+ if (RemainingAccess != 0)
+ {
+ *GrantedAccess = 0;
+ *AccessStatus = STATUS_ACCESS_DENIED;
+ return FALSE;
+ }
+
+ /* Set granted access right and access status */
+ *GrantedAccess = TempGrantedAccess | PreviouslyGrantedAccess;
+ if (*GrantedAccess != 0)
+ {
+ *AccessStatus = STATUS_SUCCESS;
+ return TRUE;
+ }
+ else
+ {
+ *AccessStatus = STATUS_ACCESS_DENIED;
+ return FALSE;
+ }
+ }
+
/* RULE 4: Grant rights according to the DACL */
CurrentAce = (PACE)(Dacl + 1);
for (i = 0; i < Dacl->AceCount; i++)
@@ -570,7 +636,7 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
}
else
{
- DPRINT1("Unknown Ace type 0x%lx\n", CurrentAce->Header.AceType);
+ DPRINT1("Unsupported ACE type 0x%lx\n", CurrentAce->Header.AceType);
}
CurrentAce = (PACE)((ULONG_PTR)CurrentAce + CurrentAce->Header.AceSize);
}
@@ -580,14 +646,8 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
*GrantedAccess = CurrentAccess & DesiredAccess;
- if (DesiredAccess & MAXIMUM_ALLOWED)
- {
- *GrantedAccess = CurrentAccess;
- *AccessStatus = STATUS_SUCCESS;
- return TRUE;
- }
- else if ((*GrantedAccess & ~VALID_INHERIT_FLAGS) ==
- (DesiredAccess & ~VALID_INHERIT_FLAGS))
+ if ((*GrantedAccess & ~VALID_INHERIT_FLAGS) ==
+ (DesiredAccess & ~VALID_INHERIT_FLAGS))
{
*AccessStatus = STATUS_SUCCESS;
return TRUE;
From e9a0761db974d52575cfc305889dfef9edebe6a7 Mon Sep 17 00:00:00 2001
From: Gregor Schneider
Date: Sat, 3 Apr 2010 17:23:27 +0000
Subject: [PATCH 018/261] [taskmgr] Hide CPU graph options on single CPU
systems See issue #2144 for more details.
svn path=/trunk/; revision=46699
---
reactos/base/applications/taskmgr/taskmgr.c | 32 ++++++++++++++-------
1 file changed, 21 insertions(+), 11 deletions(-)
diff --git a/reactos/base/applications/taskmgr/taskmgr.c b/reactos/base/applications/taskmgr/taskmgr.c
index 3f8bcbd9a4a..c409f808b1f 100644
--- a/reactos/base/applications/taskmgr/taskmgr.c
+++ b/reactos/base/applications/taskmgr/taskmgr.c
@@ -869,6 +869,7 @@ void TaskManager_OnTabWndSelChange(void)
HMENU hViewMenu;
HMENU hSubMenu;
WCHAR szTemp[256];
+ SYSTEM_INFO sysInfo;
hMenu = GetMenu(hMainWnd);
hViewMenu = GetSubMenu(hMenu, 2);
@@ -947,16 +948,28 @@ void TaskManager_OnTabWndSelChange(void)
DeleteMenu(hMenu, 3, MF_BYPOSITION);
DrawMenuBar(hMainWnd);
}
- hSubMenu = CreatePopupMenu();
- LoadStringW(hInst, IDS_MENU_ONEGRAPHALLCPUS, szTemp, 256);
- AppendMenuW(hSubMenu, MF_STRING, ID_VIEW_CPUHISTORY_ONEGRAPHALL, szTemp);
+ GetSystemInfo(&sysInfo);
- LoadStringW(hInst, IDS_MENU_ONEGRAPHPERCPU, szTemp, 256);
- AppendMenuW(hSubMenu, MF_STRING, ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU, szTemp);
+ /* Hide CPU graph options on single CPU systems */
+ if (sysInfo.dwNumberOfProcessors > 1)
+ {
+ hSubMenu = CreatePopupMenu();
- LoadStringW(hInst, IDS_MENU_CPUHISTORY, szTemp, 256);
- AppendMenuW(hViewMenu, MF_STRING|MF_POPUP, (UINT_PTR) hSubMenu, szTemp);
+ LoadStringW(hInst, IDS_MENU_ONEGRAPHALLCPUS, szTemp, 256);
+ AppendMenuW(hSubMenu, MF_STRING, ID_VIEW_CPUHISTORY_ONEGRAPHALL, szTemp);
+
+ LoadStringW(hInst, IDS_MENU_ONEGRAPHPERCPU, szTemp, 256);
+ AppendMenuW(hSubMenu, MF_STRING, ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU, szTemp);
+
+ LoadStringW(hInst, IDS_MENU_CPUHISTORY, szTemp, 256);
+ AppendMenuW(hViewMenu, MF_STRING|MF_POPUP, (UINT_PTR) hSubMenu, szTemp);
+
+ if (TaskManagerSettings.CPUHistory_OneGraphPerCPU)
+ CheckMenuRadioItem(hSubMenu, ID_VIEW_CPUHISTORY_ONEGRAPHALL, ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU, ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU, MF_BYCOMMAND);
+ else
+ CheckMenuRadioItem(hSubMenu, ID_VIEW_CPUHISTORY_ONEGRAPHALL, ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU, ID_VIEW_CPUHISTORY_ONEGRAPHALL, MF_BYCOMMAND);
+ }
LoadStringW(hInst, IDS_MENU_SHOWKERNELTIMES, szTemp, 256);
AppendMenuW(hViewMenu, MF_STRING, ID_VIEW_SHOWKERNELTIMES, szTemp);
@@ -965,10 +978,7 @@ void TaskManager_OnTabWndSelChange(void)
CheckMenuItem(hViewMenu, ID_VIEW_SHOWKERNELTIMES, MF_BYCOMMAND|MF_CHECKED);
else
CheckMenuItem(hViewMenu, ID_VIEW_SHOWKERNELTIMES, MF_BYCOMMAND|MF_UNCHECKED);
- if (TaskManagerSettings.CPUHistory_OneGraphPerCPU)
- CheckMenuRadioItem(hSubMenu, ID_VIEW_CPUHISTORY_ONEGRAPHALL, ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU, ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU, MF_BYCOMMAND);
- else
- CheckMenuRadioItem(hSubMenu, ID_VIEW_CPUHISTORY_ONEGRAPHALL, ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU, ID_VIEW_CPUHISTORY_ONEGRAPHALL, MF_BYCOMMAND);
+
/*
* Give the tab control focus
*/
From eb82a3b915400c6765b20acda649c8bba8b6594d Mon Sep 17 00:00:00 2001
From: Gregor Schneider
Date: Sat, 3 Apr 2010 17:24:10 +0000
Subject: [PATCH 019/261] [cmd] Emit line breaks DOS/Windows style (CRLF),
instead of Linux style (LF only) See issue #4509 for more details.
svn path=/trunk/; revision=46700
---
reactos/base/shell/cmd/console.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/reactos/base/shell/cmd/console.c b/reactos/base/shell/cmd/console.c
index 18541bf389f..8184af747ea 100644
--- a/reactos/base/shell/cmd/console.c
+++ b/reactos/base/shell/cmd/console.c
@@ -166,7 +166,7 @@ VOID ConOutChar (TCHAR c)
VOID ConPuts(LPTSTR szText, DWORD nStdHandle)
{
ConWrite(szText, _tcslen(szText), nStdHandle);
- ConWrite(_T("\n"), 1, nStdHandle);
+ ConWrite(_T("\r\n"), 2, nStdHandle);
}
VOID ConOutResPaging(BOOL NewPage, UINT resID)
From 71d61c9c591aea715413ae7e795ee27cc5cdcb45 Mon Sep 17 00:00:00 2001
From: Aleksey Bragin
Date: Sat, 3 Apr 2010 20:22:32 +0000
Subject: [PATCH 020/261] [NTOSKRNL/CONFIG] - Flusher lock fixes: wrong kind of
lock,total mess (and the wrong kind of lock). Properly fixed throughout
cmapi.c, but still missing in many other places. - Add support for detecting
loading of an already loaded hive. - Start adding calls to CmpReportNotify to
support registry callbacks. - Do work needed to flush notifications for a
deleted node (but CmpFlushNotify not yet implemented). - Add support for
adding each newly loaded hive to the HiveList key in the registry (but
CmpAddHiveToFileList not yet implemented). - Add some ViewLock
acquire/releases where needed. - Load the key in a faster way (Ob vs Zw) -
Add checks everywhere for HvMarkCellDirty success. In future (when log/backup
file is enabled), it can return FALSE (e.g. when we are out of space). -
Change logic in CmpDoFlushAll to only flush a hive if it won't shrink (in the
future, flushing may lead to hive shrinkage for efficiency). - Add SEH2
protection to all CmApis that may deal with user-mode data. - Add
HvTrackCellRef/HvReleaseCellRef for tracking cell references in scenarios
where we might need many GetCell/ReleaseCell calls. For now stubbed to only
work with up to 4 static references. - Properly unlock/free in some failure
paths in some of the CM APIs. - Add some missing HvReleaseCell in paths where
it was missing. - Try to fix hack in enumerate key. - Fix wrong usage of
KeQuerySystemTime. It was called twice to save it in 2 different places.
Instead, there should be only one call, and then duplicate the value across.
- Fix logic in CmpSetValueExistingData/Key.
Tested with winetests and .NET framework 1.1 installation which fully completes.
svn path=/trunk/; revision=46702
---
reactos/lib/cmlib/cmlib.h | 37 +
reactos/lib/cmlib/hivecell.c | 55 +-
reactos/lib/cmlib/hivewrt.c | 8 +
reactos/ntoskrnl/config/cmapi.c | 1730 ++++++++++++++++------------
reactos/ntoskrnl/config/cmhvlist.c | 7 +
reactos/ntoskrnl/config/cminit.c | 8 +-
reactos/ntoskrnl/config/cmkcbncb.c | 59 +
reactos/ntoskrnl/config/cmparse.c | 19 -
8 files changed, 1187 insertions(+), 736 deletions(-)
diff --git a/reactos/lib/cmlib/cmlib.h b/reactos/lib/cmlib/cmlib.h
index fae049507d2..c6823b06a47 100644
--- a/reactos/lib/cmlib/cmlib.h
+++ b/reactos/lib/cmlib/cmlib.h
@@ -198,6 +198,22 @@ typedef struct _CMHIVE
#endif
+typedef struct _HV_HIVE_CELL_PAIR
+{
+ PHHIVE Hive;
+ HCELL_INDEX Cell;
+} HV_HIVE_CELL_PAIR, *PHV_HIVE_CELL_PAIR;
+
+#define STATIC_CELL_PAIR_COUNT 4
+typedef struct _HV_TRACK_CELL_REF
+{
+ USHORT Count;
+ USHORT Max;
+ PHV_HIVE_CELL_PAIR CellArray;
+ HV_HIVE_CELL_PAIR StaticArray[STATIC_CELL_PAIR_COUNT];
+ USHORT StaticCount;
+} HV_TRACK_CELL_REF, *PHV_TRACK_CELL_REF;
+
extern ULONG CmlibTraceLevel;
/*
@@ -272,6 +288,12 @@ HvIsCellDirty(
IN HCELL_INDEX Cell
);
+BOOLEAN
+CMAPI
+HvHiveWillShrink(
+ IN PHHIVE RegistryHive
+);
+
BOOLEAN CMAPI
HvSyncHive(
PHHIVE RegistryHive);
@@ -288,6 +310,21 @@ CmCreateRootNode(
VOID CMAPI
CmPrepareHive(
PHHIVE RegistryHive);
+
+
+BOOLEAN
+CMAPI
+HvTrackCellRef(
+ PHV_TRACK_CELL_REF CellRef,
+ PHHIVE Hive,
+ HCELL_INDEX Cell
+);
+
+VOID
+CMAPI
+HvReleaseFreeCellRefArray(
+ PHV_TRACK_CELL_REF CellRef
+);
/*
* Private functions.
diff --git a/reactos/lib/cmlib/hivecell.c b/reactos/lib/cmlib/hivecell.c
index 994ca98170d..815165182a5 100644
--- a/reactos/lib/cmlib/hivecell.c
+++ b/reactos/lib/cmlib/hivecell.c
@@ -113,7 +113,7 @@ HvMarkCellDirty(
__FUNCTION__, RegistryHive, CellIndex, HoldingLock);
if ((CellIndex & HCELL_TYPE_MASK) >> HCELL_TYPE_SHIFT != Stable)
- return FALSE;
+ return TRUE;
CellBlock = (CellIndex & HCELL_BLOCK_MASK) >> HCELL_BLOCK_SHIFT;
CellLastBlock = ((CellIndex + HV_BLOCK_SIZE - 1) & HCELL_BLOCK_MASK) >> HCELL_BLOCK_SHIFT;
@@ -525,3 +525,56 @@ HvFreeCell(
if (CellType == Stable)
HvMarkCellDirty(RegistryHive, CellIndex, FALSE);
}
+
+BOOLEAN
+CMAPI
+HvTrackCellRef(PHV_TRACK_CELL_REF CellRef,
+ PHHIVE Hive,
+ HCELL_INDEX Cell)
+{
+ /* Sanity checks */
+ ASSERT(CellRef);
+ ASSERT(Hive );
+ ASSERT(Cell != HCELL_NIL);
+
+ /* Less than 4? */
+ if (CellRef->StaticCount < STATIC_CELL_PAIR_COUNT)
+ {
+ /* Add reference */
+ CellRef->StaticArray[CellRef->StaticCount].Hive = Hive;
+ CellRef->StaticArray[CellRef->StaticCount].Cell = Cell;
+ CellRef->StaticCount++;
+ return TRUE;
+ }
+
+ /* FIXME: TODO */
+ DPRINT1("ERROR: Too many references\n");
+ while (TRUE);
+ return FALSE;
+}
+
+VOID
+CMAPI
+HvReleaseFreeCellRefArray(PHV_TRACK_CELL_REF CellRef)
+{
+ ULONG i;
+ ASSERT(CellRef);
+
+ /* Any references? */
+ if (CellRef->StaticCount > 0)
+ {
+ /* Sanity check */
+ ASSERT(CellRef->StaticCount <= STATIC_CELL_PAIR_COUNT);
+
+ /* Loop them */
+ for (i = 0; i < CellRef->StaticCount;i++)
+ {
+ /* Release them */
+ HvReleaseCell(CellRef->StaticArray[i].Hive,
+ CellRef->StaticArray[i].Cell);
+ }
+
+ /* Free again */
+ CellRef->StaticCount = 0;
+ }
+}
\ No newline at end of file
diff --git a/reactos/lib/cmlib/hivewrt.c b/reactos/lib/cmlib/hivewrt.c
index 5cc20cfe503..7ecadff2062 100644
--- a/reactos/lib/cmlib/hivewrt.c
+++ b/reactos/lib/cmlib/hivewrt.c
@@ -265,6 +265,14 @@ HvSyncHive(
return TRUE;
}
+BOOLEAN
+CMAPI
+HvHiveWillShrink(IN PHHIVE RegistryHive)
+{
+ /* No shrinking yet */
+ return FALSE;
+}
+
BOOLEAN CMAPI
HvWriteHive(
PHHIVE RegistryHive)
diff --git a/reactos/ntoskrnl/config/cmapi.c b/reactos/ntoskrnl/config/cmapi.c
index 85f2ed9fe14..538c3e5b560 100644
--- a/reactos/ntoskrnl/config/cmapi.c
+++ b/reactos/ntoskrnl/config/cmapi.c
@@ -14,6 +14,67 @@
/* FUNCTIONS *****************************************************************/
+BOOLEAN
+NTAPI
+CmpIsHiveAlreadyLoaded(IN HANDLE KeyHandle,
+ IN POBJECT_ATTRIBUTES SourceFile,
+ OUT PCMHIVE *CmHive)
+{
+ NTSTATUS Status;
+ PCM_KEY_BODY KeyBody;
+ PCMHIVE Hive;
+ BOOLEAN Loaded = FALSE;
+ PAGED_CODE();
+
+ /* Sanity check */
+ CMP_ASSERT_EXCLUSIVE_REGISTRY_LOCK();
+
+ /* Reference the handle */
+ Status = ObReferenceObjectByHandle(KeyHandle,
+ 0,
+ CmpKeyObjectType,
+ KernelMode,
+ (PVOID)&KeyBody,
+ NULL);
+ if (!NT_SUCCESS(Status)) return Loaded;
+
+ /* Don't touch deleted KCBs */
+ if (KeyBody->KeyControlBlock->Delete) return Loaded;
+
+ Hive = CONTAINING_RECORD(KeyBody->KeyControlBlock->KeyHive, CMHIVE, Hive);
+
+ /* Must be the root key */
+ if (!(KeyBody->KeyControlBlock->Flags & KEY_HIVE_ENTRY) ||
+ !(Hive->FileUserName.Buffer))
+ {
+ /* It isn't */
+ ObDereferenceObject(KeyBody);
+ return Loaded;
+ }
+
+ /* Now compare the name of the file */
+ if (!RtlCompareUnicodeString(&Hive->FileUserName,
+ SourceFile->ObjectName,
+ TRUE))
+ {
+ /* Same file found */
+ Loaded = TRUE;
+ *CmHive = Hive;
+
+ /* If the hive is frozen, not sure what to do */
+ if (Hive->Frozen)
+ {
+ /* FIXME: TODO */
+ DPRINT1("ERROR: Hive is frozen\n");
+ while (TRUE);
+ }
+ }
+
+ /* Dereference and return result */
+ ObDereferenceObject(KeyBody);
+ return Loaded;
+ }
+
BOOLEAN
NTAPI
CmpDoFlushAll(IN BOOLEAN ForceFlush)
@@ -39,16 +100,35 @@ CmpDoFlushAll(IN BOOLEAN ForceFlush)
if (!(Hive->Hive.HiveFlags & HIVE_NOLAZYFLUSH))
{
/* Acquire the flusher lock */
- ExAcquirePushLockExclusive((PVOID)&Hive->FlusherLock);
+ CmpLockHiveFlusherExclusive(Hive);
+
+ /* Check for illegal state */
+ if ((ForceFlush) && (Hive->UseCount))
+ {
+ /* Registry needs to be locked down */
+ CMP_ASSERT_EXCLUSIVE_REGISTRY_LOCK();
+ DPRINT1("FIXME: Hive is damaged and needs fixup\n");
+ while (TRUE);
+ }
+
+ /* Only sync if we are forced to or if it won't cause a hive shrink */
+ if ((ForceFlush) || (!HvHiveWillShrink(&Hive->Hive)))
+ {
+ /* Do the sync */
+ Status = HvSyncHive(&Hive->Hive);
- /* Do the sync */
- Status = HvSyncHive(&Hive->Hive);
-
- /* If something failed - set the flag and continue looping*/
- if (!NT_SUCCESS(Status)) Result = FALSE;
+ /* If something failed - set the flag and continue looping */
+ if (!NT_SUCCESS(Status)) Result = FALSE;
+ }
+ else
+ {
+ /* We won't flush if the hive might shrink */
+ Result = FALSE;
+ CmpForceForceFlush = TRUE;
+ }
/* Release the flusher lock */
- ExReleasePushLock((PVOID)&Hive->FlusherLock);
+ CmpUnlockHiveFlusher(Hive);
}
/* Try the next entry */
@@ -81,10 +161,14 @@ CmpSetValueKeyNew(IN PHHIVE Hive,
{
/* Then make sure it's valid and dirty it */
ASSERT(Parent->ValueList.List != HCELL_NIL);
- HvMarkCellDirty(Hive, Parent->ValueList.List, FALSE);
+ if (!HvMarkCellDirty(Hive, Parent->ValueList.List, FALSE))
+ {
+ /* Fail if we're out of space for log changes */
+ return STATUS_NO_LOG_SPACE;
+ }
}
- /* Allocate avalue cell */
+ /* Allocate a value cell */
ValueCell = HvAllocateCell(Hive,
FIELD_OFFSET(CM_KEY_VALUE, Name) +
CmpNameSize(Hive, ValueName),
@@ -102,16 +186,33 @@ CmpSetValueKeyNew(IN PHHIVE Hive,
/* Set it up and copy the name */
CellData->u.KeyValue.Signature = CM_KEY_VALUE_SIGNATURE;
- CellData->u.KeyValue.Flags = 0;
- CellData->u.KeyValue.Type = Type;
- CellData->u.KeyValue.NameLength = CmpCopyName(Hive,
- CellData->u.KeyValue.Name,
- ValueName);
+ _SEH2_TRY
+ {
+ /* This can crash since the name is coming from user-mode */
+ CellData->u.KeyValue.NameLength = CmpCopyName(Hive,
+ CellData->u.KeyValue.Name,
+ ValueName);
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ /* Fail */
+ DPRINT1("Invalid user data!\n");
+ HvFreeCell(Hive, ValueCell);
+ _SEH2_YIELD(return _SEH2_GetExceptionCode());
+ }
+ _SEH2_END;
+
+ /* Check for compressed name */
if (CellData->u.KeyValue.NameLength < ValueName->Length)
{
/* This is a compressed name */
CellData->u.KeyValue.Flags = VALUE_COMP_NAME;
}
+ else
+ {
+ /* No flags to set */
+ CellData->u.KeyValue.Flags = 0;
+ }
/* Check if this is a normal key */
if (DataSize > CM_KEY_VALUE_SMALL)
@@ -140,6 +241,9 @@ CmpSetValueKeyNew(IN PHHIVE Hive,
CellData->u.KeyValue.DataLength = DataSize + CM_KEY_VALUE_SPECIAL_SIZE;
CellData->u.KeyValue.Data = SmallData;
}
+
+ /* Set the type now */
+ CellData->u.KeyValue.Type = Type;
/* Add this value cell to the child list */
Status = CmpAddValueToList(Hive,
@@ -149,7 +253,12 @@ CmpSetValueKeyNew(IN PHHIVE Hive,
&Parent->ValueList);
/* If we failed, free the entire cell, including the data */
- if (!NT_SUCCESS(Status)) CmpFreeValue(Hive, ValueCell);
+ if (!NT_SUCCESS(Status))
+ {
+ /* Overwrite the status with a known one */
+ CmpFreeValue(Hive, ValueCell);
+ Status = STATUS_INSUFFICIENT_RESOURCES;
+ }
/* Return Status */
return Status;
@@ -170,9 +279,12 @@ CmpSetValueKeyExisting(IN PHHIVE Hive,
PCELL_DATA CellData;
ULONG Length;
BOOLEAN WasSmall, IsSmall;
+
+ /* Registry writes must be blocked */
+ CMP_ASSERT_FLUSH_LOCK(Hive);
/* Mark the old child cell dirty */
- HvMarkCellDirty(Hive, OldChild, FALSE);
+ if (!HvMarkCellDirty(Hive, OldChild, FALSE)) return STATUS_NO_LOG_SPACE;
/* See if this is a small or normal key */
WasSmall = CmpIsKeyValueSmall(&Length, Value->DataLength);
@@ -185,7 +297,7 @@ CmpSetValueKeyExisting(IN PHHIVE Hive,
ASSERT_VALUE_BIG(Hive, DataSize);
/* Mark the old value dirty */
- CmpMarkValueDataDirty(Hive, Value);
+ if (!CmpMarkValueDataDirty(Hive, Value)) return STATUS_NO_LOG_SPACE;
/* Check if we have a small key */
if (IsSmall)
@@ -203,662 +315,58 @@ CmpSetValueKeyExisting(IN PHHIVE Hive,
Value->Type = Type;
return STATUS_SUCCESS;
}
- else
+
+ /* We have a normal key. Was the old cell also normal and had data? */
+ if (!(WasSmall) && (Length > 0))
{
- /* We have a normal key. Was the old cell also normal and had data? */
- if (!(WasSmall) && (Length > 0))
+ /* Get the current data cell and actual data inside it */
+ DataCell = Value->Data;
+ ASSERT(DataCell != HCELL_NIL);
+ CellData = HvGetCell(Hive, DataCell);
+ if (!CellData) return STATUS_INSUFFICIENT_RESOURCES;
+
+ /* Immediately release the cell */
+ HvReleaseCell(Hive, DataCell);
+
+ /* Make sure that the data cell actually has a size */
+ ASSERT(HvGetCellSize(Hive, CellData) > 0);
+
+ /* Check if the previous data cell could fit our new data */
+ if (DataSize <= (ULONG)(HvGetCellSize(Hive, CellData)))
{
- /* Get the current data cell and actual data inside it */
- DataCell = Value->Data;
- ASSERT(DataCell != HCELL_NIL);
- CellData = HvGetCell(Hive, DataCell);
- if (!CellData) return STATUS_INSUFFICIENT_RESOURCES;
-
- /* Immediately release the cell */
- HvReleaseCell(Hive, DataCell);
-
- /* Make sure that the data cell actually has a size */
- ASSERT(HvGetCellSize(Hive, CellData) > 0);
-
- /* Check if the previous data cell could fit our new data */
- if (DataSize <= (ULONG)(HvGetCellSize(Hive, CellData)))
- {
- /* Re-use it then */
- NewCell = DataCell;
- }
- else
- {
- /* Otherwise, re-allocate the current data cell */
- NewCell = HvReallocateCell(Hive, DataCell, DataSize);
- if (NewCell == HCELL_NIL) return STATUS_INSUFFICIENT_RESOURCES;
- }
+ /* Re-use it then */
+ NewCell = DataCell;
}
else
{
- /* This was a small key, or a key with no data, allocate a cell */
- NewCell = HvAllocateCell(Hive, DataSize, StorageType, HCELL_NIL);
+ /* Otherwise, re-allocate the current data cell */
+ NewCell = HvReallocateCell(Hive, DataCell, DataSize);
if (NewCell == HCELL_NIL) return STATUS_INSUFFICIENT_RESOURCES;
}
-
- /* Now get the actual data for our data cell */
- CellData = HvGetCell(Hive, NewCell);
- if (!CellData) ASSERT(FALSE);
-
- /* Release it immediately */
- HvReleaseCell(Hive, NewCell);
-
- /* Copy our data into the data cell's buffer, and set up the value */
- RtlCopyMemory(CellData, Data, DataSize);
- Value->Data = NewCell;
- Value->DataLength = DataSize;
- Value->Type = Type;
-
- /* Return success */
- ASSERT(HvIsCellDirty(Hive, NewCell));
- return STATUS_SUCCESS;
- }
-}
-
-NTSTATUS
-NTAPI
-CmSetValueKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
- IN PUNICODE_STRING ValueName,
- IN ULONG Type,
- IN PVOID Data,
- IN ULONG DataLength)
-{
- PHHIVE Hive;
- PCM_KEY_NODE Parent;
- PCM_KEY_VALUE Value = NULL;
- HCELL_INDEX CurrentChild, Cell;
- NTSTATUS Status;
- BOOLEAN Found, Result;
- ULONG Count, ChildIndex, SmallData, Storage;
- VALUE_SEARCH_RETURN_TYPE SearchResult;
-
- /* Acquire hive lock */
- CmpLockRegistry();
- CmpAcquireKcbLockShared(Kcb);
-
- /* Sanity check */
- ASSERT(sizeof(ULONG) == CM_KEY_VALUE_SMALL);
-
- /* Don't touch deleted KCBs */
-DoAgain:
- if (Kcb->Delete)
- {
- /* Fail */
- Status = STATUS_KEY_DELETED;
- goto Quickie;
- }
-
- /* Don't let anyone mess with symlinks */
- if ((Kcb->Flags & KEY_SYM_LINK) &&
- ((Type != REG_LINK) ||
- !(ValueName) ||
- !(RtlEqualUnicodeString(&CmSymbolicLinkValueName, ValueName, TRUE))))
- {
- /* Invalid modification of a symlink key */
- Status = STATUS_ACCESS_DENIED;
- goto Quickie;
- }
-
- /* Search for the value */
- SearchResult = CmpCompareNewValueDataAgainstKCBCache(Kcb,
- ValueName,
- Type,
- Data,
- DataLength);
- if (SearchResult == SearchNeedExclusiveLock)
- {
- /* Try again with the exclusive lock */
- CmpConvertKcbSharedToExclusive(Kcb);
- goto DoAgain;
- }
- else if (SearchResult == SearchSuccess)
- {
- /* We don't actually need to do anything! */
- Status = STATUS_SUCCESS;
- goto Quickie;
- }
-
- /* We need the exclusive KCB lock now */
- if (!(CmpIsKcbLockedExclusive(Kcb)) && !(CmpTryToConvertKcbSharedToExclusive(Kcb)))
- {
- /* Acquire exclusive lock */
- CmpConvertKcbSharedToExclusive(Kcb);
- }
-
- /* Get pointer to key cell */
- Hive = Kcb->KeyHive;
- Cell = Kcb->KeyCell;
-
- /* Prepare to scan the key node */
- Parent = (PCM_KEY_NODE)HvGetCell(Hive, Cell);
- Count = Parent->ValueList.Count;
- Found = FALSE;
- if (Count > 0)
- {
- /* Try to find the existing name */
- Result = CmpFindNameInList(Hive,
- &Parent->ValueList,
- ValueName,
- &ChildIndex,
- &CurrentChild);
- if (!Result)
- {
- /* Fail */
- Status = STATUS_INSUFFICIENT_RESOURCES;
- goto Quickie;
- }
-
- /* Check if we found something */
- if (CurrentChild != HCELL_NIL)
- {
- /* Get its value */
- Value = (PCM_KEY_VALUE)HvGetCell(Hive, CurrentChild);
- if (!Value)
- {
- /* Fail */
- Status = STATUS_INSUFFICIENT_RESOURCES;
- goto Quickie;
- }
-
- /* Remember that we found it */
- Found = TRUE;
- }
}
else
{
- /* No child list, we'll need to add it */
- ChildIndex = 0;
- }
-
- /* The KCB must be locked exclusive at this point */
- ASSERT((CmpIsKcbLockedExclusive(Kcb) == TRUE) ||
- (CmpTestRegistryLockExclusive() == TRUE));
-
- /* Mark the cell dirty */
- HvMarkCellDirty(Hive, Cell, FALSE);
-
- /* Get the storage type */
- Storage = HvGetCellType(Cell);
-
- /* Check if this is small data */
- SmallData = 0;
- if ((DataLength <= CM_KEY_VALUE_SMALL) && (DataLength > 0))
- {
- /* Copy it */
- RtlCopyMemory(&SmallData, Data, DataLength);
+ /* This was a small key, or a key with no data, allocate a cell */
+ NewCell = HvAllocateCell(Hive, DataSize, StorageType, HCELL_NIL);
+ if (NewCell == HCELL_NIL) return STATUS_INSUFFICIENT_RESOURCES;
}
- /* Check if we didn't find a matching key */
- if (!Found)
- {
- /* Call the internal routine */
- Status = CmpSetValueKeyNew(Hive,
- Parent,
- ValueName,
- ChildIndex,
- Type,
- Data,
- DataLength,
- Storage,
- SmallData);
- }
- else
- {
- /* Call the internal routine */
- Status = CmpSetValueKeyExisting(Hive,
- CurrentChild,
- Value,
- Type,
- Data,
- DataLength,
- Storage,
- SmallData);
- }
+ /* Now get the actual data for our data cell */
+ CellData = HvGetCell(Hive, NewCell);
+ if (!CellData) ASSERT(FALSE);
- /* Check for success */
- if (NT_SUCCESS(Status))
- {
- /* Check if the maximum value name length changed */
- ASSERT(Parent->MaxValueNameLen == Kcb->KcbMaxValueNameLen);
- if (Parent->MaxValueNameLen < ValueName->Length)
- {
- /* Set the new values */
- Parent->MaxValueNameLen = ValueName->Length;
- Kcb->KcbMaxValueNameLen = ValueName->Length;
- }
-
- /* Check if the maximum data length changed */
- ASSERT(Parent->MaxValueDataLen == Kcb->KcbMaxValueDataLen);
- if (Parent->MaxValueDataLen < DataLength)
- {
- /* Update it */
- Parent->MaxValueDataLen = DataLength;
- Kcb->KcbMaxValueDataLen = Parent->MaxValueDataLen;
- }
-
- /* Save the write time */
- KeQuerySystemTime(&Parent->LastWriteTime);
- KeQuerySystemTime(&Kcb->KcbLastWriteTime);
-
- /* Check if the cell is cached */
- if ((Found) && (CMP_IS_CELL_CACHED(Kcb->ValueCache.ValueList)))
- {
- /* Shouldn't happen */
- ASSERT(FALSE);
- }
- else
- {
- /* Cleanup the value cache */
- CmpCleanUpKcbValueCache(Kcb);
+ /* Release it immediately */
+ HvReleaseCell(Hive, NewCell);
- /* Sanity checks */
- ASSERT(!(CMP_IS_CELL_CACHED(Kcb->ValueCache.ValueList)));
- ASSERT(!(Kcb->ExtFlags & CM_KCB_SYM_LINK_FOUND));
-
- /* Set the value cache */
- Kcb->ValueCache.Count = Parent->ValueList.Count;
- Kcb->ValueCache.ValueList = Parent->ValueList.List;
- }
- }
-
-Quickie:
- /* Release the locks */
- CmpReleaseKcbLock(Kcb);
- CmpUnlockRegistry();
- return Status;
-}
+ /* Copy our data into the data cell's buffer, and set up the value */
+ RtlCopyMemory(CellData, Data, DataSize);
+ Value->Data = NewCell;
+ Value->DataLength = DataSize;
+ Value->Type = Type;
-NTSTATUS
-NTAPI
-CmDeleteValueKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
- IN UNICODE_STRING ValueName)
-{
- NTSTATUS Status = STATUS_OBJECT_NAME_NOT_FOUND;
- PHHIVE Hive;
- PCM_KEY_NODE Parent;
- HCELL_INDEX ChildCell, Cell;
- PCHILD_LIST ChildList;
- PCM_KEY_VALUE Value = NULL;
- ULONG ChildIndex;
- BOOLEAN Result;
-
- /* Acquire hive lock */
- CmpLockRegistry();
-
- /* Lock KCB exclusively */
- CmpAcquireKcbLockExclusive(Kcb);
-
- /* Don't touch deleted keys */
- if (Kcb->Delete)
- {
- /* Undo everything */
- CmpReleaseKcbLock(Kcb);
- CmpUnlockRegistry();
- return STATUS_KEY_DELETED;
- }
-
- /* Get the hive and the cell index */
- Hive = Kcb->KeyHive;
- Cell = Kcb->KeyCell;
-
- /* Get the parent key node */
- Parent = (PCM_KEY_NODE)HvGetCell(Hive, Cell);
- if (!Parent)
- {
- /* Fail */
- Status = STATUS_INSUFFICIENT_RESOURCES;
- goto Quickie;
- }
-
- /* Get the value list and check if it has any entries */
- ChildList = &Parent->ValueList;
- if (ChildList->Count)
- {
- /* Try to find this value */
- Result = CmpFindNameInList(Hive,
- ChildList,
- &ValueName,
- &ChildIndex,
- &ChildCell);
- if (!Result)
- {
- /* Fail */
- Status = STATUS_INSUFFICIENT_RESOURCES;
- goto Quickie;
- }
-
- /* Value not found, return error */
- if (ChildCell == HCELL_NIL) goto Quickie;
-
- /* We found the value, mark all relevant cells dirty */
- HvMarkCellDirty(Hive, Cell, FALSE);
- HvMarkCellDirty(Hive, Parent->ValueList.List, FALSE);
- HvMarkCellDirty(Hive, ChildCell, FALSE);
-
- /* Get the key value */
- Value = (PCM_KEY_VALUE)HvGetCell(Hive,ChildCell);
- if (!Value) ASSERT(FALSE);
-
- /* Mark it and all related data as dirty */
- CmpMarkValueDataDirty(Hive, Value);
-
- /* Ssanity checks */
- ASSERT(HvIsCellDirty(Hive, Parent->ValueList.List));
- ASSERT(HvIsCellDirty(Hive, ChildCell));
-
- /* Remove the value from the child list */
- Status = CmpRemoveValueFromList(Hive, ChildIndex, ChildList);
- if(!NT_SUCCESS(Status)) goto Quickie;
-
- /* Remove the value and its data itself */
- if (!CmpFreeValue(Hive, ChildCell))
- {
- /* Failed to free the value, fail */
- Status = STATUS_INSUFFICIENT_RESOURCES;
- goto Quickie;
- }
-
- /* Set the last write time */
- KeQuerySystemTime(&Parent->LastWriteTime);
- KeQuerySystemTime(&Kcb->KcbLastWriteTime);
-
- /* Sanity check */
- ASSERT(Parent->MaxValueNameLen == Kcb->KcbMaxValueNameLen);
- ASSERT(Parent->MaxValueDataLen == Kcb->KcbMaxValueDataLen);
- ASSERT(HvIsCellDirty(Hive, Cell));
-
- /* Check if the value list is empty now */
- if (!Parent->ValueList.Count)
- {
- /* Then clear key node data */
- Parent->MaxValueNameLen = 0;
- Parent->MaxValueDataLen = 0;
- Kcb->KcbMaxValueNameLen = 0;
- Kcb->KcbMaxValueDataLen = 0;
- }
-
- /* Cleanup the value cache */
- CmpCleanUpKcbValueCache(Kcb);
-
- /* Sanity checks */
- ASSERT(!(CMP_IS_CELL_CACHED(Kcb->ValueCache.ValueList)));
- ASSERT(!(Kcb->ExtFlags & CM_KCB_SYM_LINK_FOUND));
-
- /* Set the value cache */
- Kcb->ValueCache.Count = ChildList->Count;
- Kcb->ValueCache.ValueList = ChildList->List;
-
- /* Change default Status to success */
- Status = STATUS_SUCCESS;
- }
-
-Quickie:
- /* Release the parent cell, if any */
- if (Parent) HvReleaseCell(Hive, Cell);
-
- /* Check if we had a value */
- if (Value)
- {
- /* Release the child cell */
- ASSERT(ChildCell != HCELL_NIL);
- HvReleaseCell(Hive, ChildCell);
- }
-
- /* Release locks */
- CmpReleaseKcbLock(Kcb);
- CmpUnlockRegistry();
- return Status;
-}
-
-NTSTATUS
-NTAPI
-CmQueryValueKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
- IN UNICODE_STRING ValueName,
- IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
- IN PVOID KeyValueInformation,
- IN ULONG Length,
- IN PULONG ResultLength)
-{
- NTSTATUS Status;
- PCM_KEY_VALUE ValueData;
- ULONG Index;
- BOOLEAN ValueCached = FALSE;
- PCM_CACHED_VALUE *CachedValue;
- HCELL_INDEX CellToRelease;
- VALUE_SEARCH_RETURN_TYPE Result;
- PHHIVE Hive;
- PAGED_CODE();
-
- /* Acquire hive lock */
- CmpLockRegistry();
-
- /* Lock the KCB shared */
- CmpAcquireKcbLockShared(Kcb);
-
- /* Don't touch deleted keys */
-DoAgain:
- if (Kcb->Delete)
- {
- /* Undo everything */
- CmpReleaseKcbLock(Kcb);
- CmpUnlockRegistry();
- return STATUS_KEY_DELETED;
- }
-
- /* We don't deal with this yet */
- if (Kcb->ExtFlags & CM_KCB_SYM_LINK_FOUND)
- {
- /* Shouldn't happen */
- ASSERT(FALSE);
- }
-
- /* Get the hive */
- Hive = Kcb->KeyHive;
-
- /* Find the key value */
- Result = CmpFindValueByNameFromCache(Kcb,
- &ValueName,
- &CachedValue,
- &Index,
- &ValueData,
- &ValueCached,
- &CellToRelease);
- if (Result == SearchNeedExclusiveLock)
- {
- /* Check if we need an exclusive lock */
- ASSERT(CellToRelease == HCELL_NIL);
- ASSERT(ValueData == NULL);
-
- /* Try with exclusive KCB lock */
- CmpConvertKcbSharedToExclusive(Kcb);
- goto DoAgain;
- }
-
- if (Result == SearchSuccess)
- {
- /* Sanity check */
- ASSERT(ValueData != NULL);
-
- /* Query the information requested */
- Result = CmpQueryKeyValueData(Kcb,
- CachedValue,
- ValueData,
- ValueCached,
- KeyValueInformationClass,
- KeyValueInformation,
- Length,
- ResultLength,
- &Status);
- if (Result == SearchNeedExclusiveLock)
- {
- /* Try with exclusive KCB lock */
- CmpConvertKcbSharedToExclusive(Kcb);
- goto DoAgain;
- }
- }
- else
- {
- /* Failed to find the value */
- Status = STATUS_OBJECT_NAME_NOT_FOUND;
- }
-
- /* If we have a cell to release, do so */
- if (CellToRelease != HCELL_NIL) HvReleaseCell(Hive, CellToRelease);
-
- /* Release locks */
- CmpReleaseKcbLock(Kcb);
- CmpUnlockRegistry();
- return Status;
-}
-
-NTSTATUS
-NTAPI
-CmEnumerateValueKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
- IN ULONG Index,
- IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
- IN PVOID KeyValueInformation,
- IN ULONG Length,
- IN PULONG ResultLength)
-{
- NTSTATUS Status;
- PHHIVE Hive;
- PCM_KEY_NODE Parent;
- HCELL_INDEX CellToRelease = HCELL_NIL, CellToRelease2 = HCELL_NIL;
- VALUE_SEARCH_RETURN_TYPE Result;
- BOOLEAN IndexIsCached, ValueIsCached = FALSE;
- PCELL_DATA CellData;
- PCM_CACHED_VALUE *CachedValue;
- PCM_KEY_VALUE ValueData = NULL;
- PAGED_CODE();
-
- /* Acquire hive lock */
- CmpLockRegistry();
-
- /* Lock the KCB shared */
- CmpAcquireKcbLockShared(Kcb);
-
- /* Don't touch deleted keys */
-DoAgain:
- if (Kcb->Delete)
- {
- /* Undo everything */
- CmpReleaseKcbLock(Kcb);
- CmpUnlockRegistry();
- return STATUS_KEY_DELETED;
- }
-
- /* Get the hive and parent */
- Hive = Kcb->KeyHive;
- Parent = (PCM_KEY_NODE)HvGetCell(Hive, Kcb->KeyCell);
- if (!Parent)
- {
- /* Fail */
- Status = STATUS_INSUFFICIENT_RESOURCES;
- goto Quickie;
- }
-
- /* Make sure the index is valid */
- //if (Index >= Kcb->ValueCache.Count)
- if (Index >= Parent->ValueList.Count)
- {
- /* Release the cell and fail */
- HvReleaseCell(Hive, Kcb->KeyCell);
- Status = STATUS_NO_MORE_ENTRIES;
- goto Quickie;
- }
-
- /* We don't deal with this yet */
- if (Kcb->ExtFlags & CM_KCB_SYM_LINK_FOUND)
- {
- /* Shouldn't happen */
- ASSERT(FALSE);
- }
-
- /* Find the value list */
- Result = CmpGetValueListFromCache(Kcb,
- &CellData,
- &IndexIsCached,
- &CellToRelease);
- if (Result == SearchNeedExclusiveLock)
- {
- /* Check if we need an exclusive lock */
- ASSERT(CellToRelease == HCELL_NIL);
- ASSERT(ValueData == NULL);
-
- /* Try with exclusive KCB lock */
- CmpConvertKcbSharedToExclusive(Kcb);
- goto DoAgain;
- }
- else if (Result != SearchSuccess)
- {
- /* Sanity check */
- ASSERT(CellData == NULL);
-
- /* Release the cell and fail */
- Status = STATUS_INSUFFICIENT_RESOURCES;
- goto Quickie;
- }
-
- /* Now get the key value */
- Result = CmpGetValueKeyFromCache(Kcb,
- CellData,
- Index,
- &CachedValue,
- &ValueData,
- IndexIsCached,
- &ValueIsCached,
- &CellToRelease2);
- if (Result == SearchNeedExclusiveLock)
- {
- /* Try with exclusive KCB lock */
- CmpConvertKcbSharedToExclusive(Kcb);
- goto DoAgain;
- }
- else if (Result != SearchSuccess)
- {
- /* Sanity check */
- ASSERT(ValueData == NULL);
-
- /* Release the cells and fail */
- Status = STATUS_INSUFFICIENT_RESOURCES;
- goto Quickie;
- }
-
- /* Query the information requested */
- Result = CmpQueryKeyValueData(Kcb,
- CachedValue,
- ValueData,
- ValueIsCached,
- KeyValueInformationClass,
- KeyValueInformation,
- Length,
- ResultLength,
- &Status);
- if (Result == SearchNeedExclusiveLock)
- {
- /* Try with exclusive KCB lock */
- CmpConvertKcbSharedToExclusive(Kcb);
- goto DoAgain;
- }
-
-Quickie:
- /* If we have a cell to release, do so */
- if (CellToRelease != HCELL_NIL) HvReleaseCell(Hive, CellToRelease);
-
- /* Release the parent cell */
- HvReleaseCell(Hive, Kcb->KeyCell);
-
- /* If we have a cell to release, do so */
- if (CellToRelease2 != HCELL_NIL) HvReleaseCell(Hive, CellToRelease2);
-
- /* Release locks */
- CmpReleaseKcbLock(Kcb);
- CmpUnlockRegistry();
- return Status;
+ /* Return success */
+ ASSERT(HvIsCellDirty(Hive, NewCell));
+ return STATUS_SUCCESS;
}
NTSTATUS
@@ -1076,6 +584,725 @@ CmpQueryKeyData(IN PHHIVE Hive,
return Status;
}
+NTSTATUS
+NTAPI
+CmSetValueKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
+ IN PUNICODE_STRING ValueName,
+ IN ULONG Type,
+ IN PVOID Data,
+ IN ULONG DataLength)
+{
+ PHHIVE Hive = NULL;
+ PCM_KEY_NODE Parent;
+ PCM_KEY_VALUE Value = NULL;
+ HCELL_INDEX CurrentChild, Cell;
+ NTSTATUS Status;
+ BOOLEAN Found, Result;
+ ULONG Count, ChildIndex, SmallData, Storage;
+ VALUE_SEARCH_RETURN_TYPE SearchResult;
+ BOOLEAN FirstTry = TRUE, FlusherLocked = FALSE;
+ HCELL_INDEX ParentCell = HCELL_NIL, ChildCell = HCELL_NIL;
+
+ /* Acquire hive and KCB lock */
+ CmpLockRegistry();
+ CmpAcquireKcbLockShared(Kcb);
+
+ /* Sanity check */
+ ASSERT(sizeof(ULONG) == CM_KEY_VALUE_SMALL);
+
+ /* Don't touch deleted KCBs */
+DoAgain:
+ if (Kcb->Delete)
+ {
+ /* Fail */
+ Status = STATUS_KEY_DELETED;
+ goto Quickie;
+ }
+
+ /* Don't let anyone mess with symlinks */
+ if ((Kcb->Flags & KEY_SYM_LINK) &&
+ ((Type != REG_LINK) ||
+ !(ValueName) ||
+ !(RtlEqualUnicodeString(&CmSymbolicLinkValueName, ValueName, TRUE))))
+ {
+ /* Invalid modification of a symlink key */
+ Status = STATUS_ACCESS_DENIED;
+ goto Quickie;
+ }
+
+ /* Check if this is the first attempt */
+ if (FirstTry)
+ {
+ /* Search for the value in the cache */
+ SearchResult = CmpCompareNewValueDataAgainstKCBCache(Kcb,
+ ValueName,
+ Type,
+ Data,
+ DataLength);
+ if (SearchResult == SearchNeedExclusiveLock)
+ {
+ /* Try again with the exclusive lock */
+ CmpConvertKcbSharedToExclusive(Kcb);
+ goto DoAgain;
+ }
+ else if (SearchResult == SearchSuccess)
+ {
+ /* We don't actually need to do anything! */
+ Status = STATUS_SUCCESS;
+ goto Quickie;
+ }
+
+ /* We need the exclusive KCB lock now */
+ if (!(CmpIsKcbLockedExclusive(Kcb)) &&
+ !(CmpTryToConvertKcbSharedToExclusive(Kcb)))
+ {
+ /* Acquire exclusive lock */
+ CmpConvertKcbSharedToExclusive(Kcb);
+ }
+
+ /* Cache lookup failed, so don't try it next time */
+ FirstTry = FALSE;
+
+ /* Now grab the flush lock since the key will be modified */
+ ASSERT(FlusherLocked == FALSE);
+ CmpLockHiveFlusherShared((PCMHIVE)Kcb->KeyHive);
+ FlusherLocked = TRUE;
+ goto DoAgain;
+ }
+ else
+ {
+ /* Get pointer to key cell */
+ Hive = Kcb->KeyHive;
+ Cell = Kcb->KeyCell;
+
+ /* Get the parent */
+ Parent = (PCM_KEY_NODE)HvGetCell(Hive, Cell);
+ ASSERT(Parent);
+ ParentCell = Cell;
+
+ /* Prepare to scan the key node */
+ Count = Parent->ValueList.Count;
+ Found = FALSE;
+ if (Count > 0)
+ {
+ /* Try to find the existing name */
+ Result = CmpFindNameInList(Hive,
+ &Parent->ValueList,
+ ValueName,
+ &ChildIndex,
+ &CurrentChild);
+ if (!Result)
+ {
+ /* Fail */
+ Status = STATUS_INSUFFICIENT_RESOURCES;
+ goto Quickie;
+ }
+
+ /* Check if we found something */
+ if (CurrentChild != HCELL_NIL)
+ {
+ /* Release existing child */
+ if (ChildCell != HCELL_NIL)
+ {
+ HvReleaseCell(Hive, ChildCell);
+ ChildCell = HCELL_NIL;
+ }
+
+ /* Get its value */
+ Value = (PCM_KEY_VALUE)HvGetCell(Hive, CurrentChild);
+ if (!Value)
+ {
+ /* Fail */
+ Status = STATUS_INSUFFICIENT_RESOURCES;
+ goto Quickie;
+ }
+
+ /* Remember that we found it */
+ ChildCell = CurrentChild;
+ Found = TRUE;
+ }
+ }
+ else
+ {
+ /* No child list, we'll need to add it */
+ ChildIndex = 0;
+ }
+ }
+
+ /* Should only get here on the second pass */
+ ASSERT(FirstTry == FALSE);
+
+ /* The KCB must be locked exclusive at this point */
+ CMP_ASSERT_KCB_LOCK(Kcb);
+
+ /* Mark the cell dirty */
+ if (!HvMarkCellDirty(Hive, Cell, FALSE))
+ {
+ /* Not enough log space, fail */
+ Status = STATUS_NO_LOG_SPACE;
+ goto Quickie;
+ }
+
+ /* Get the storage type */
+ Storage = HvGetCellType(Cell);
+
+ /* Check if this is small data */
+ SmallData = 0;
+ if ((DataLength <= CM_KEY_VALUE_SMALL) && (DataLength > 0))
+ {
+ /* Need SEH because user data may be invalid */
+ _SEH2_TRY
+ {
+ /* Copy it */
+ RtlCopyMemory(&SmallData, Data, DataLength);
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ /* Return failure code */
+ Status = _SEH2_GetExceptionCode();
+ _SEH2_YIELD(goto Quickie);
+ }
+ _SEH2_END;
+ }
+
+ /* Check if we didn't find a matching key */
+ if (!Found)
+ {
+ /* Call the internal routine */
+ Status = CmpSetValueKeyNew(Hive,
+ Parent,
+ ValueName,
+ ChildIndex,
+ Type,
+ Data,
+ DataLength,
+ Storage,
+ SmallData);
+ }
+ else
+ {
+ /* Call the internal routine */
+ Status = CmpSetValueKeyExisting(Hive,
+ CurrentChild,
+ Value,
+ Type,
+ Data,
+ DataLength,
+ Storage,
+ SmallData);
+ }
+
+ /* Check for success */
+ if (NT_SUCCESS(Status))
+ {
+ /* Check if the maximum value name length changed */
+ ASSERT(Parent->MaxValueNameLen == Kcb->KcbMaxValueNameLen);
+ if (Parent->MaxValueNameLen < ValueName->Length)
+ {
+ /* Set the new values */
+ Parent->MaxValueNameLen = ValueName->Length;
+ Kcb->KcbMaxValueNameLen = ValueName->Length;
+ }
+
+ /* Check if the maximum data length changed */
+ ASSERT(Parent->MaxValueDataLen == Kcb->KcbMaxValueDataLen);
+ if (Parent->MaxValueDataLen < DataLength)
+ {
+ /* Update it */
+ Parent->MaxValueDataLen = DataLength;
+ Kcb->KcbMaxValueDataLen = Parent->MaxValueDataLen;
+ }
+
+ /* Save the write time */
+ KeQuerySystemTime(&Parent->LastWriteTime);
+ Kcb->KcbLastWriteTime = Parent->LastWriteTime;
+
+ /* Check if the cell is cached */
+ if ((Found) && (CMP_IS_CELL_CACHED(Kcb->ValueCache.ValueList)))
+ {
+ /* Shouldn't happen */
+ ASSERT(FALSE);
+ }
+ else
+ {
+ /* Cleanup the value cache */
+ CmpCleanUpKcbValueCache(Kcb);
+
+ /* Sanity checks */
+ ASSERT(!(CMP_IS_CELL_CACHED(Kcb->ValueCache.ValueList)));
+ ASSERT(!(Kcb->ExtFlags & CM_KCB_SYM_LINK_FOUND));
+
+ /* Set the value cache */
+ Kcb->ValueCache.Count = Parent->ValueList.Count;
+ Kcb->ValueCache.ValueList = Parent->ValueList.List;
+ }
+
+ /* Notify registered callbacks */
+ CmpReportNotify(Kcb,
+ Hive,
+ Kcb->KeyCell,
+ REG_NOTIFY_CHANGE_LAST_SET);
+ }
+
+ /* Release the cells */
+Quickie:
+ if ((ParentCell != HCELL_NIL) && (Hive)) HvReleaseCell(Hive, ParentCell);
+ if ((ChildCell != HCELL_NIL) && (Hive)) HvReleaseCell(Hive, ChildCell);
+
+ /* Release the locks */
+ if (FlusherLocked) CmpUnlockHiveFlusher((PCMHIVE)Hive);
+ CmpReleaseKcbLock(Kcb);
+ CmpUnlockRegistry();
+ return Status;
+}
+
+NTSTATUS
+NTAPI
+CmDeleteValueKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
+ IN UNICODE_STRING ValueName)
+{
+ NTSTATUS Status = STATUS_OBJECT_NAME_NOT_FOUND;
+ PHHIVE Hive;
+ PCM_KEY_NODE Parent;
+ HCELL_INDEX ChildCell, Cell;
+ PCHILD_LIST ChildList;
+ PCM_KEY_VALUE Value = NULL;
+ ULONG ChildIndex;
+ BOOLEAN Result;
+
+ /* Acquire hive lock */
+ CmpLockRegistry();
+
+ /* Lock KCB exclusively */
+ CmpAcquireKcbLockExclusive(Kcb);
+
+ /* Don't touch deleted keys */
+ if (Kcb->Delete)
+ {
+ /* Undo everything */
+ CmpReleaseKcbLock(Kcb);
+ CmpUnlockRegistry();
+ return STATUS_KEY_DELETED;
+ }
+
+ /* Get the hive and the cell index */
+ Hive = Kcb->KeyHive;
+ Cell = Kcb->KeyCell;
+
+ /* Lock flushes */
+ CmpLockHiveFlusherShared((PCMHIVE)Hive);
+
+ /* Get the parent key node */
+ Parent = (PCM_KEY_NODE)HvGetCell(Hive, Cell);
+ ASSERT(Parent);
+
+ /* Get the value list and check if it has any entries */
+ ChildList = &Parent->ValueList;
+ if (ChildList->Count)
+ {
+ /* Try to find this value */
+ Result = CmpFindNameInList(Hive,
+ ChildList,
+ &ValueName,
+ &ChildIndex,
+ &ChildCell);
+ if (!Result)
+ {
+ /* Fail */
+ Status = STATUS_INSUFFICIENT_RESOURCES;
+ goto Quickie;
+ }
+
+ /* Value not found, return error */
+ if (ChildCell == HCELL_NIL) goto Quickie;
+
+ /* We found the value, mark all relevant cells dirty */
+ if (!((HvMarkCellDirty(Hive, Cell, FALSE)) &&
+ (HvMarkCellDirty(Hive, Parent->ValueList.List, FALSE)) &&
+ (HvMarkCellDirty(Hive, ChildCell, FALSE))))
+ {
+ /* Not enough log space, fail */
+ Status = STATUS_NO_LOG_SPACE;
+ goto Quickie;
+ }
+
+ /* Get the key value */
+ Value = (PCM_KEY_VALUE)HvGetCell(Hive,ChildCell);
+ ASSERT(Value);
+
+ /* Mark it and all related data as dirty */
+ if (!CmpMarkValueDataDirty(Hive, Value))
+ {
+ /* Not enough log space, fail */
+ Status = STATUS_NO_LOG_SPACE;
+ goto Quickie;
+ }
+
+ /* Ssanity checks */
+ ASSERT(HvIsCellDirty(Hive, Parent->ValueList.List));
+ ASSERT(HvIsCellDirty(Hive, ChildCell));
+
+ /* Remove the value from the child list */
+ Status = CmpRemoveValueFromList(Hive, ChildIndex, ChildList);
+ if (!NT_SUCCESS(Status))
+ {
+ /* Set known error */
+ Status = STATUS_INSUFFICIENT_RESOURCES;
+ goto Quickie;
+ }
+
+ /* Remove the value and its data itself */
+ if (!CmpFreeValue(Hive, ChildCell))
+ {
+ /* Failed to free the value, fail */
+ Status = STATUS_INSUFFICIENT_RESOURCES;
+ goto Quickie;
+ }
+
+ /* Set the last write time */
+ KeQuerySystemTime(&Parent->LastWriteTime);
+ Kcb->KcbLastWriteTime = Parent->LastWriteTime;
+
+ /* Sanity check */
+ ASSERT(Parent->MaxValueNameLen == Kcb->KcbMaxValueNameLen);
+ ASSERT(Parent->MaxValueDataLen == Kcb->KcbMaxValueDataLen);
+ ASSERT(HvIsCellDirty(Hive, Cell));
+
+ /* Check if the value list is empty now */
+ if (!Parent->ValueList.Count)
+ {
+ /* Then clear key node data */
+ Parent->MaxValueNameLen = 0;
+ Parent->MaxValueDataLen = 0;
+ Kcb->KcbMaxValueNameLen = 0;
+ Kcb->KcbMaxValueDataLen = 0;
+ }
+
+ /* Cleanup the value cache */
+ CmpCleanUpKcbValueCache(Kcb);
+
+ /* Sanity checks */
+ ASSERT(!(CMP_IS_CELL_CACHED(Kcb->ValueCache.ValueList)));
+ ASSERT(!(Kcb->ExtFlags & CM_KCB_SYM_LINK_FOUND));
+
+ /* Set the value cache */
+ Kcb->ValueCache.Count = ChildList->Count;
+ Kcb->ValueCache.ValueList = ChildList->List;
+
+ /* Notify registered callbacks */
+ CmpReportNotify(Kcb, Hive, Cell, REG_NOTIFY_CHANGE_LAST_SET);
+
+ /* Change default Status to success */
+ Status = STATUS_SUCCESS;
+ }
+
+Quickie:
+ /* Release the parent cell, if any */
+ if (Parent) HvReleaseCell(Hive, Cell);
+
+ /* Check if we had a value */
+ if (Value)
+ {
+ /* Release the child cell */
+ ASSERT(ChildCell != HCELL_NIL);
+ HvReleaseCell(Hive, ChildCell);
+ }
+
+ /* Release locks */
+ CmpUnlockHiveFlusher((PCMHIVE)Hive);
+ CmpReleaseKcbLock(Kcb);
+ CmpUnlockRegistry();
+ return Status;
+}
+
+NTSTATUS
+NTAPI
+CmQueryValueKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
+ IN UNICODE_STRING ValueName,
+ IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
+ IN PVOID KeyValueInformation,
+ IN ULONG Length,
+ IN PULONG ResultLength)
+{
+ NTSTATUS Status;
+ PCM_KEY_VALUE ValueData;
+ ULONG Index;
+ BOOLEAN ValueCached = FALSE;
+ PCM_CACHED_VALUE *CachedValue;
+ HCELL_INDEX CellToRelease;
+ VALUE_SEARCH_RETURN_TYPE Result;
+ PHHIVE Hive;
+ PAGED_CODE();
+
+ /* Acquire hive lock */
+ CmpLockRegistry();
+
+ /* Lock the KCB shared */
+ CmpAcquireKcbLockShared(Kcb);
+
+ /* Don't touch deleted keys */
+DoAgain:
+ if (Kcb->Delete)
+ {
+ /* Undo everything */
+ CmpReleaseKcbLock(Kcb);
+ CmpUnlockRegistry();
+ return STATUS_KEY_DELETED;
+ }
+
+ /* We don't deal with this yet */
+ if (Kcb->ExtFlags & CM_KCB_SYM_LINK_FOUND)
+ {
+ /* Shouldn't happen */
+ ASSERT(FALSE);
+ }
+
+ /* Get the hive */
+ Hive = Kcb->KeyHive;
+
+ /* Find the key value */
+ Result = CmpFindValueByNameFromCache(Kcb,
+ &ValueName,
+ &CachedValue,
+ &Index,
+ &ValueData,
+ &ValueCached,
+ &CellToRelease);
+ if (Result == SearchNeedExclusiveLock)
+ {
+ /* Check if we need an exclusive lock */
+ ASSERT(CellToRelease == HCELL_NIL);
+ ASSERT(ValueData == NULL);
+
+ /* Try with exclusive KCB lock */
+ CmpConvertKcbSharedToExclusive(Kcb);
+ goto DoAgain;
+ }
+
+ if (Result == SearchSuccess)
+ {
+ /* Sanity check */
+ ASSERT(ValueData != NULL);
+
+ /* User data, protect against exceptions */
+ _SEH2_TRY
+ {
+ /* Query the information requested */
+ Result = CmpQueryKeyValueData(Kcb,
+ CachedValue,
+ ValueData,
+ ValueCached,
+ KeyValueInformationClass,
+ KeyValueInformation,
+ Length,
+ ResultLength,
+ &Status);
+ if (Result == SearchNeedExclusiveLock)
+ {
+ /* Release the value cell */
+ if (CellToRelease != HCELL_NIL)
+ {
+ HvReleaseCell(Hive, CellToRelease);
+ CellToRelease = HCELL_NIL;
+ }
+
+ /* Try with exclusive KCB lock */
+ CmpConvertKcbSharedToExclusive(Kcb);
+ goto DoAgain;
+ }
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = _SEH2_GetExceptionCode();
+ }
+ _SEH2_END;
+ }
+ else
+ {
+ /* Failed to find the value */
+ Status = STATUS_OBJECT_NAME_NOT_FOUND;
+ }
+
+ /* If we have a cell to release, do so */
+ if (CellToRelease != HCELL_NIL) HvReleaseCell(Hive, CellToRelease);
+
+ /* Release locks */
+ CmpReleaseKcbLock(Kcb);
+ CmpUnlockRegistry();
+ return Status;
+}
+
+NTSTATUS
+NTAPI
+CmEnumerateValueKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
+ IN ULONG Index,
+ IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
+ IN PVOID KeyValueInformation,
+ IN ULONG Length,
+ IN PULONG ResultLength)
+{
+ NTSTATUS Status;
+ PHHIVE Hive;
+ PCM_KEY_NODE Parent;
+ HCELL_INDEX CellToRelease = HCELL_NIL, CellToRelease2 = HCELL_NIL;
+ VALUE_SEARCH_RETURN_TYPE Result;
+ BOOLEAN IndexIsCached, ValueIsCached = FALSE;
+ PCELL_DATA CellData;
+ PCM_CACHED_VALUE *CachedValue;
+ PCM_KEY_VALUE ValueData = NULL;
+ PAGED_CODE();
+
+ /* Acquire hive lock */
+ CmpLockRegistry();
+
+ /* Lock the KCB shared */
+ CmpAcquireKcbLockShared(Kcb);
+
+ /* Don't touch deleted keys */
+DoAgain:
+ if (Kcb->Delete)
+ {
+ /* Undo everything */
+ CmpReleaseKcbLock(Kcb);
+ CmpUnlockRegistry();
+ return STATUS_KEY_DELETED;
+ }
+
+ /* Get the hive and parent */
+ Hive = Kcb->KeyHive;
+ Parent = (PCM_KEY_NODE)HvGetCell(Hive, Kcb->KeyCell);
+ ASSERT(Parent);
+
+ /* FIXME: Lack of cache? */
+ if (Kcb->ValueCache.Count != Parent->ValueList.Count)
+ {
+ DPRINT1("HACK: Overriding value cache count\n");
+ Kcb->ValueCache.Count = Parent->ValueList.Count;
+ }
+
+ /* Make sure the index is valid */
+ if (Index >= Kcb->ValueCache.Count)
+ {
+ /* Release the cell and fail */
+ HvReleaseCell(Hive, Kcb->KeyCell);
+ Status = STATUS_NO_MORE_ENTRIES;
+ goto Quickie;
+ }
+
+ /* We don't deal with this yet */
+ if (Kcb->ExtFlags & CM_KCB_SYM_LINK_FOUND)
+ {
+ /* Shouldn't happen */
+ ASSERT(FALSE);
+ }
+
+ /* Find the value list */
+ Result = CmpGetValueListFromCache(Kcb,
+ &CellData,
+ &IndexIsCached,
+ &CellToRelease);
+ if (Result == SearchNeedExclusiveLock)
+ {
+ /* Check if we need an exclusive lock */
+ ASSERT(CellToRelease == HCELL_NIL);
+ HvReleaseCell(Hive, Kcb->KeyCell);
+
+ /* Try with exclusive KCB lock */
+ CmpConvertKcbSharedToExclusive(Kcb);
+ goto DoAgain;
+ }
+ else if (Result != SearchSuccess)
+ {
+ /* Sanity check */
+ ASSERT(CellData == NULL);
+
+ /* Release the cell and fail */
+ Status = STATUS_INSUFFICIENT_RESOURCES;
+ goto Quickie;
+ }
+
+ /* Now get the key value */
+ Result = CmpGetValueKeyFromCache(Kcb,
+ CellData,
+ Index,
+ &CachedValue,
+ &ValueData,
+ IndexIsCached,
+ &ValueIsCached,
+ &CellToRelease2);
+ if (Result == SearchNeedExclusiveLock)
+ {
+ /* Cleanup state */
+ ASSERT(CellToRelease2 == HCELL_NIL);
+ if (CellToRelease)
+ {
+ HvReleaseCell(Hive, CellToRelease);
+ CellToRelease = HCELL_NIL;
+ }
+ HvReleaseCell(Hive, Kcb->KeyCell);
+
+ /* Try with exclusive KCB lock */
+ CmpConvertKcbSharedToExclusive(Kcb);
+ goto DoAgain;
+ }
+ else if (Result != SearchSuccess)
+ {
+ /* Sanity check */
+ ASSERT(ValueData == NULL);
+
+ /* Release the cells and fail */
+ Status = STATUS_INSUFFICIENT_RESOURCES;
+ goto Quickie;
+ }
+
+ /* User data, need SEH */
+ _SEH2_TRY
+ {
+ /* Query the information requested */
+ Result = CmpQueryKeyValueData(Kcb,
+ CachedValue,
+ ValueData,
+ ValueIsCached,
+ KeyValueInformationClass,
+ KeyValueInformation,
+ Length,
+ ResultLength,
+ &Status);
+ if (Result == SearchNeedExclusiveLock)
+ {
+ /* Cleanup state */
+ if (CellToRelease2) HvReleaseCell(Hive, CellToRelease2);
+ HvReleaseCell(Hive, Kcb->KeyCell);
+ if (CellToRelease) HvReleaseCell(Hive, CellToRelease);
+
+ /* Try with exclusive KCB lock */
+ CmpConvertKcbSharedToExclusive(Kcb);
+ goto DoAgain;
+ }
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ /* Get exception code */
+ Status = _SEH2_GetExceptionCode();
+ }
+ _SEH2_END;
+
+Quickie:
+ /* If we have a cell to release, do so */
+ if (CellToRelease != HCELL_NIL) HvReleaseCell(Hive, CellToRelease);
+
+ /* Release the parent cell */
+ HvReleaseCell(Hive, Kcb->KeyCell);
+
+ /* If we have a cell to release, do so */
+ if (CellToRelease2 != HCELL_NIL) HvReleaseCell(Hive, CellToRelease2);
+
+ /* Release locks */
+ CmpReleaseKcbLock(Kcb);
+ CmpUnlockRegistry();
+ return Status;
+}
+
NTSTATUS
NTAPI
CmQueryKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
@@ -1087,6 +1314,7 @@ CmQueryKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
NTSTATUS Status;
PHHIVE Hive;
PCM_KEY_NODE Parent;
+ HV_TRACK_CELL_REF CellReferences = {0};
/* Acquire hive lock */
CmpLockRegistry();
@@ -1094,16 +1322,6 @@ CmQueryKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
/* Lock KCB shared */
CmpAcquireKcbLockShared(Kcb);
- /* Get the hive and parent */
- Hive = Kcb->KeyHive;
- Parent = (PCM_KEY_NODE)HvGetCell(Hive, Kcb->KeyCell);
- if (!Parent)
- {
- /* Fail */
- Status = STATUS_INSUFFICIENT_RESOURCES;
- goto Quickie;
- }
-
/* Don't touch deleted keys */
if (Kcb->Delete)
{
@@ -1120,13 +1338,27 @@ CmQueryKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
case KeyBasicInformation:
case KeyNodeInformation:
- /* Call the internal API */
- Status = CmpQueryKeyData(Hive,
- Parent,
- KeyInformationClass,
- KeyInformation,
- Length,
- ResultLength);
+ /* Get the hive and parent */
+ Hive = Kcb->KeyHive;
+ Parent = (PCM_KEY_NODE)HvGetCell(Hive, Kcb->KeyCell);
+ ASSERT(Parent);
+
+ /* Track cell references */
+ if (!HvTrackCellRef(&CellReferences, Hive, Kcb->KeyCell))
+ {
+ /* Not enough memory to track references */
+ Status = STATUS_INSUFFICIENT_RESOURCES;
+ }
+ else
+ {
+ /* Call the internal API */
+ Status = CmpQueryKeyData(Hive,
+ Parent,
+ KeyInformationClass,
+ KeyInformation,
+ Length,
+ ResultLength);
+ }
break;
/* Unsupported classes for now */
@@ -1149,6 +1381,9 @@ CmQueryKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
}
Quickie:
+ /* Release references */
+ HvReleaseFreeCellRefArray(&CellReferences);
+
/* Release locks */
CmpReleaseKcbLock(Kcb);
CmpUnlockRegistry();
@@ -1168,6 +1403,7 @@ CmEnumerateKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
PHHIVE Hive;
PCM_KEY_NODE Parent, Child;
HCELL_INDEX ChildCell;
+ HV_TRACK_CELL_REF CellReferences = {0};
/* Acquire hive lock */
CmpLockRegistry();
@@ -1179,20 +1415,14 @@ CmEnumerateKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
if (Kcb->Delete)
{
/* Undo everything */
- CmpReleaseKcbLock(Kcb);
- CmpUnlockRegistry();
- return STATUS_KEY_DELETED;
+ Status = STATUS_KEY_DELETED;
+ goto Quickie;
}
/* Get the hive and parent */
Hive = Kcb->KeyHive;
Parent = (PCM_KEY_NODE)HvGetCell(Hive, Kcb->KeyCell);
- if (!Parent)
- {
- /* Fail */
- Status = STATUS_INSUFFICIENT_RESOURCES;
- goto Quickie;
- }
+ ASSERT(Parent);
/* Get the child cell */
ChildCell = CmpFindSubKeyByNumber(Hive, Parent, Index);
@@ -1210,22 +1440,39 @@ CmEnumerateKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
/* Now get the actual child node */
Child = (PCM_KEY_NODE)HvGetCell(Hive, ChildCell);
- if (!Child)
+ ASSERT(Child);
+
+ /* Track references */
+ if (!HvTrackCellRef(&CellReferences, Hive, ChildCell))
{
- /* Fail */
+ /* Can't allocate memory for tracking */
Status = STATUS_INSUFFICIENT_RESOURCES;
goto Quickie;
}
- /* Query the data requested */
- Status = CmpQueryKeyData(Hive,
- Child,
- KeyInformationClass,
- KeyInformation,
- Length,
- ResultLength);
+ /* Data can be user-mode, use SEH */
+ _SEH2_TRY
+ {
+ /* Query the data requested */
+ Status = CmpQueryKeyData(Hive,
+ Child,
+ KeyInformationClass,
+ KeyInformation,
+ Length,
+ ResultLength);
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ /* Fail with exception code */
+ Status = _SEH2_GetExceptionCode();
+ _SEH2_YIELD(goto Quickie);
+ }
+ _SEH2_END;
Quickie:
+ /* Release references */
+ HvReleaseFreeCellRefArray(&CellReferences);
+
/* Release locks */
CmpReleaseKcbLock(Kcb);
CmpUnlockRegistry();
@@ -1271,14 +1518,12 @@ CmDeleteKey(IN PCM_KEY_BODY KeyBody)
Hive = Kcb->KeyHive;
Cell = Kcb->KeyCell;
+ /* Lock flushes */
+ CmpLockHiveFlusherShared((PCMHIVE)Hive);
+
/* Get the key node */
Node = (PCM_KEY_NODE)HvGetCell(Hive, Cell);
- if (!Node)
- {
- /* Fail */
- Status = STATUS_INSUFFICIENT_RESOURCES;
- goto Quickie;
- }
+ ASSERT(Node);
/* Sanity check */
ASSERT(Node->Flags == Kcb->Flags);
@@ -1287,11 +1532,17 @@ CmDeleteKey(IN PCM_KEY_BODY KeyBody)
if (!(Node->SubKeyCounts[Stable] + Node->SubKeyCounts[Volatile]) &&
!(Node->Flags & KEY_NO_DELETE))
{
+ /* Send notification to registered callbacks */
+ CmpReportNotify(Kcb, Hive, Cell, REG_NOTIFY_CHANGE_NAME);
+
/* Get the parent and free the cell */
ParentCell = Node->Parent;
Status = CmpFreeKeyByCell(Hive, Cell, TRUE);
if (NT_SUCCESS(Status))
{
+ /* Flush any notifications */
+ CmpFlushNotifiesOnKeyBodyList(Kcb, FALSE);
+
/* Clean up information we have on the subkey */
CmpCleanUpSubKeyInfo(Kcb->ParentKcb);
@@ -1327,10 +1578,12 @@ CmDeleteKey(IN PCM_KEY_BODY KeyBody)
Status = STATUS_CANNOT_DELETE;
}
-Quickie:
/* Release the cell */
HvReleaseCell(Hive, Cell);
-
+
+ /* Release flush lock */
+ CmpUnlockHiveFlusher((PCMHIVE)Hive);
+
/* Release the KCB locks */
Quickie2:
CmpReleaseTwoKcbLockByKey(Kcb->ConvKey, Kcb->ParentKcb->ConvKey);
@@ -1364,12 +1617,36 @@ CmFlushKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
}
else
{
+ /* Don't touch the hive */
+ CmpLockHiveFlusherExclusive(CmHive);
+ ASSERT(CmHive->ViewLock);
+ KeAcquireGuardedMutex(CmHive->ViewLock);
+ CmHive->ViewLockOwner = KeGetCurrentThread();
+
+ /* Will the hive shrink? */
+ if (HvHiveWillShrink(Hive))
+ {
+ /* I don't believe the current Hv does shrinking */
+ ASSERT(FALSE);
+ }
+ else
+ {
+ /* Now we can release views */
+ ASSERT(CmHive->ViewLock);
+ CMP_ASSERT_EXCLUSIVE_REGISTRY_LOCK_OR_LOADING(CmHive);
+ ASSERT(KeGetCurrentThread() == CmHive->ViewLockOwner);
+ KeReleaseGuardedMutex(CmHive->ViewLock);
+ }
+
/* Flush only this hive */
if (!HvSyncHive(Hive))
{
/* Fail */
Status = STATUS_REGISTRY_IO_FAILED;
}
+
+ /* Release the flush lock */
+ CmpUnlockHiveFlusher((PCMHIVE)Hive);
}
/* Return the status */
@@ -1387,8 +1664,9 @@ CmLoadKey(IN POBJECT_ATTRIBUTES TargetKey,
SECURITY_CLIENT_CONTEXT ClientSecurityContext;
HANDLE KeyHandle;
BOOLEAN Allocate = TRUE;
- PCMHIVE CmHive;
+ PCMHIVE CmHive, LoadedHive;
NTSTATUS Status;
+ CM_PARSE_CONTEXT ParseContext;
/* Check if we have a trust key */
if (KeyBody)
@@ -1415,9 +1693,21 @@ CmLoadKey(IN POBJECT_ATTRIBUTES TargetKey,
}
/* Open the target key */
+#if 0
Status = ZwOpenKey(&KeyHandle, KEY_READ, TargetKey);
+#else
+ RtlZeroMemory(&ParseContext, sizeof(ParseContext));
+ ParseContext.CreateOperation = FALSE;
+ Status = ObOpenObjectByName(TargetKey,
+ CmpKeyObjectType,
+ KernelMode,
+ NULL,
+ KEY_READ,
+ &ParseContext,
+ &KeyHandle);
+#endif
if (!NT_SUCCESS(Status)) KeyHandle = NULL;
-
+
/* Open the hive */
Status = CmpCmdHiveOpen(SourceFile,
&ClientSecurityContext,
@@ -1437,21 +1727,29 @@ CmLoadKey(IN POBJECT_ATTRIBUTES TargetKey,
/* Lock the registry */
CmpLockRegistryExclusive();
- /* FIXME: Check if we are already loaded */
-
+ /* Check if we are already loaded */
+ if (CmpIsHiveAlreadyLoaded(KeyHandle, SourceFile, &LoadedHive))
+ {
+ /* That's okay then */
+ ASSERT(LoadedHive);
+ Status = STATUS_SUCCESS;
+ }
+
/* Release the registry */
CmpUnlockRegistry();
}
/* Close the key handle if we had one */
if (KeyHandle) ZwClose(KeyHandle);
- DPRINT1("Failed: %lx\n", Status);
return Status;
}
/* Lock the registry shared */
CmpLockRegistry();
+ /* Lock loading */
+ ExAcquirePushLockExclusive(&CmpLoadHiveLock);
+
/* Lock the hive to this thread */
CmHive->Hive.HiveFlags |= HIVE_IS_UNLOADING;
CmHive->CreatorOwner = KeGetCurrentThread();
@@ -1467,23 +1765,37 @@ CmLoadKey(IN POBJECT_ATTRIBUTES TargetKey,
TargetKey->SecurityDescriptor);
if (NT_SUCCESS(Status))
{
- /* FIXME: Add to HiveList key */
+ /* Add to HiveList key */
+ CmpAddToHiveFileList(CmHive);
/* Sync the hive if necessary */
if (Allocate)
{
- /* Sync it */
+ /* Sync it under the flusher lock */
+ CmpLockHiveFlusherExclusive(CmHive);
HvSyncHive(&CmHive->Hive);
+ CmpUnlockHiveFlusher(CmHive);
}
/* Release the hive */
CmHive->Hive.HiveFlags &= ~HIVE_IS_UNLOADING;
CmHive->CreatorOwner = NULL;
+
+ /* Allow loads */
+ ExReleasePushLock(&CmpLoadHiveLock);
}
else
{
/* FIXME: TODO */
-
+ ASSERT(FALSE);
+ }
+
+ /* Is this first profile load? */
+ if (!(CmpProfileLoaded) && !(CmpWasSetupBoot))
+ {
+ /* User is now logged on, set quotas */
+ CmpProfileLoaded = TRUE;
+ CmpSetGlobalQuotaAllowed();
}
/* Unlock the registry */
diff --git a/reactos/ntoskrnl/config/cmhvlist.c b/reactos/ntoskrnl/config/cmhvlist.c
index f4e97814bbd..8fb2636f3dc 100644
--- a/reactos/ntoskrnl/config/cmhvlist.c
+++ b/reactos/ntoskrnl/config/cmhvlist.c
@@ -14,4 +14,11 @@
/* FUNCTIONS *****************************************************************/
+NTSTATUS
+NTAPI
+CmpAddToHiveFileList(IN PCMHIVE Hive)
+{
+ return STATUS_SUCCESS;
+}
+
/* EOF */
\ No newline at end of file
diff --git a/reactos/ntoskrnl/config/cminit.c b/reactos/ntoskrnl/config/cminit.c
index 154ba1530b6..be7efc1660f 100644
--- a/reactos/ntoskrnl/config/cminit.c
+++ b/reactos/ntoskrnl/config/cminit.c
@@ -119,12 +119,10 @@ CmpInitializeHive(OUT PCMHIVE *RegistryHive,
if (!Hive->ViewLock) return STATUS_INSUFFICIENT_RESOURCES;
/* Allocate the flush lock */
-#if 0
Hive->FlusherLock = ExAllocatePoolWithTag(NonPagedPool,
sizeof(ERESOURCE),
TAG_CM);
if (!Hive->FlusherLock) return STATUS_INSUFFICIENT_RESOURCES;
-#endif
/* Setup the handles */
Hive->FileHandles[HFILE_TYPE_PRIMARY] = Primary;
@@ -136,7 +134,7 @@ CmpInitializeHive(OUT PCMHIVE *RegistryHive,
Hive->ViewLockOwner = NULL;
/* Initialize the flush lock */
- ExInitializePushLock((PULONG_PTR)&Hive->FlusherLock);
+ ExInitializeResourceLite(Hive->FlusherLock);
/* Setup hive locks */
ExInitializePushLock((PULONG_PTR)&Hive->HiveLock);
@@ -193,9 +191,7 @@ CmpInitializeHive(OUT PCMHIVE *RegistryHive,
{
/* Clear allocations and fail */
ExFreePool(Hive->ViewLock);
-#if 0
ExFreePool(Hive->FlusherLock);
-#endif
ExFreePool(Hive);
return Status;
}
@@ -211,9 +207,7 @@ CmpInitializeHive(OUT PCMHIVE *RegistryHive,
{
/* Free all alocations */
ExFreePool(Hive->ViewLock);
-#if 0
ExFreePool(Hive->FlusherLock);
-#endif
ExFreePool(Hive);
return STATUS_REGISTRY_CORRUPT;
}
diff --git a/reactos/ntoskrnl/config/cmkcbncb.c b/reactos/ntoskrnl/config/cmkcbncb.c
index 5e7060d61c4..a26de07cf1b 100644
--- a/reactos/ntoskrnl/config/cmkcbncb.c
+++ b/reactos/ntoskrnl/config/cmkcbncb.c
@@ -1135,3 +1135,62 @@ DelistKeyBodyFromKCB(IN PCM_KEY_BODY KeyBody,
/* Unlock it it if we did a manual lock */
if (!LockHeld) CmpReleaseKcbLock(KeyBody->KeyControlBlock);
}
+
+VOID
+NTAPI
+CmpFlushNotifiesOnKeyBodyList(IN PCM_KEY_CONTROL_BLOCK Kcb,
+ IN BOOLEAN LockHeld)
+{
+ PLIST_ENTRY NextEntry, ListHead;
+ PCM_KEY_BODY KeyBody;
+
+ /* Sanity check */
+ LockHeld ? CMP_ASSERT_EXCLUSIVE_REGISTRY_LOCK() : CmpIsKcbLockedExclusive(Kcb);
+ while (TRUE)
+ {
+ /* Is the list empty? */
+ ListHead = &Kcb->KeyBodyListHead;
+ if (!IsListEmpty(ListHead))
+ {
+ /* Loop the list */
+ NextEntry = ListHead->Flink;
+ while (NextEntry != ListHead)
+ {
+ /* Get the key body */
+ KeyBody = CONTAINING_RECORD(NextEntry, CM_KEY_BODY, KeyBodyList);
+ ASSERT(KeyBody->Type == '20yk');
+
+ /* Check for notifications */
+ if (KeyBody->NotifyBlock)
+ {
+ /* Is the lock held? */
+ if (LockHeld)
+ {
+ /* Flush it */
+ CmpFlushNotify(KeyBody, LockHeld);
+ ASSERT(KeyBody->NotifyBlock == NULL);
+ continue;
+ }
+
+ /* Lock isn't held, so we need to take a reference */
+ if (ObReferenceObjectSafe(KeyBody))
+ {
+ /* Now we can flush */
+ CmpFlushNotify(KeyBody, LockHeld);
+ ASSERT(KeyBody->NotifyBlock == NULL);
+
+ /* Release the reference we took */
+ ObDereferenceObjectDeferDelete(KeyBody);
+ continue;
+ }
+ }
+
+ /* Try the next entry */
+ NextEntry = NextEntry->Flink;
+ }
+ }
+
+ /* List has been parsed, exit */
+ break;
+ }
+}
diff --git a/reactos/ntoskrnl/config/cmparse.c b/reactos/ntoskrnl/config/cmparse.c
index 42d737908a0..82635445dda 100644
--- a/reactos/ntoskrnl/config/cmparse.c
+++ b/reactos/ntoskrnl/config/cmparse.c
@@ -414,15 +414,6 @@ CmpDoCreate(IN PHHIVE Hive,
LARGE_INTEGER TimeStamp;
PCM_KEY_NODE KeyNode;
- /* Sanity check */
-#if 0
- ASSERT((CmpIsKcbLockedExclusive(ParentKcb) == TRUE) ||
- (CmpTestRegistryLockExclusive() == TRUE));
-#endif
-
- /* Acquire the flusher lock */
- ExAcquirePushLockShared((PVOID)&((PCMHIVE)Hive)->FlusherLock);
-
/* Check if the parent is being deleted */
if (ParentKcb->Delete)
{
@@ -555,7 +546,6 @@ CmpDoCreate(IN PHHIVE Hive,
Exit:
/* Release the flusher lock and return status */
- ExReleasePushLock((PVOID)&((PCMHIVE)Hive)->FlusherLock);
return Status;
}
@@ -747,9 +737,6 @@ CmpCreateLinkNode(IN PHHIVE Hive,
LARGE_INTEGER TimeStamp;
PCM_KEY_NODE KeyNode;
PCM_KEY_CONTROL_BLOCK Kcb = ParentKcb;
-#if 0
- CMP_ASSERT_REGISTRY_LOCK();
-#endif
/* Link nodes only allowed on the master */
if (Hive != &CmiVolatileHive->Hive)
@@ -759,10 +746,6 @@ CmpCreateLinkNode(IN PHHIVE Hive,
return STATUS_ACCESS_DENIED;
}
- /* Acquire the flusher locks */
- ExAcquirePushLockShared((PVOID)&((PCMHIVE)Hive)->FlusherLock);
- ExAcquirePushLockShared((PVOID)&((PCMHIVE)Context->ChildHive.KeyHive)->FlusherLock);
-
/* Check if the parent is being deleted */
if (ParentKcb->Delete)
{
@@ -964,8 +947,6 @@ CmpCreateLinkNode(IN PHHIVE Hive,
Exit:
/* Release the flusher locks and return status */
- ExReleasePushLock((PVOID)&((PCMHIVE)Context->ChildHive.KeyHive)->FlusherLock);
- ExReleasePushLock((PVOID)&((PCMHIVE)Hive)->FlusherLock);
return Status;
}
From 2b4f3854ddcd91129cb8f3a70e5d90b2ffe3393e Mon Sep 17 00:00:00 2001
From: Eric Kohl
Date: Sat, 3 Apr 2010 21:21:52 +0000
Subject: [PATCH 021/261] [NTOSKRNL] - Check access rights according to the
DACL. Granted rights are removed from the remaining rights variable. - Return
success only if there are no more remaining rights. Return failure otherwise.
- Remove outdated code.
svn path=/trunk/; revision=46703
---
reactos/ntoskrnl/se/semgr.c | 73 ++++++++++++++++++++-----------------
1 file changed, 40 insertions(+), 33 deletions(-)
diff --git a/reactos/ntoskrnl/se/semgr.c b/reactos/ntoskrnl/se/semgr.c
index 104c5de6ffd..6792180c5b5 100644
--- a/reactos/ntoskrnl/se/semgr.c
+++ b/reactos/ntoskrnl/se/semgr.c
@@ -389,7 +389,6 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
OUT PNTSTATUS AccessStatus)
{
LUID_AND_ATTRIBUTES Privilege;
- ACCESS_MASK CurrentAccess, AccessMask;
ACCESS_MASK RemainingAccess;
ACCESS_MASK TempAccess;
ACCESS_MASK TempGrantedAccess = 0;
@@ -427,11 +426,9 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
if (PreviouslyGrantedAccess)
RtlMapGenericMask(&PreviouslyGrantedAccess, GenericMapping);
-
- CurrentAccess = PreviouslyGrantedAccess;
+ /* Initialize remaining access rights */
RemainingAccess = DesiredAccess;
-
Token = SubjectSecurityContext->ClientToken ?
SubjectSecurityContext->ClientToken : SubjectSecurityContext->PrimaryToken;
@@ -488,13 +485,11 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
{
*GrantedAccess = DesiredAccess | PreviouslyGrantedAccess;
}
-
+
*AccessStatus = STATUS_SUCCESS;
return TRUE;
}
- CurrentAccess = PreviouslyGrantedAccess;
-
/* RULE 2: Check token for 'take ownership' privilege */
if (DesiredAccess & WRITE_OWNER)
{
@@ -510,7 +505,6 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
/* Adjust access rights */
RemainingAccess &= ~WRITE_OWNER;
PreviouslyGrantedAccess |= WRITE_OWNER;
- CurrentAccess |= WRITE_OWNER;
/* Succeed if there are no more rights to grant */
if (RemainingAccess == 0)
@@ -547,7 +541,7 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
return FALSE;
}
- /* Determine the MAXIMUM_ALLOWED access rights */
+ /* Determine the MAXIMUM_ALLOWED access rights according to the DACL */
if (DesiredAccess & MAXIMUM_ALLOWED)
{
CurrentAce = (PACE)(Dacl + 1);
@@ -583,7 +577,7 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
DPRINT1("Unsupported ACE type 0x%lx\n", CurrentAce->Header.AceType);
}
- /* Get to the next ACE */
+ /* Get the next ACE */
CurrentAce = (PACE)((ULONG_PTR)CurrentAce + CurrentAce->Header.AceSize);
}
@@ -619,48 +613,61 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
{
if (SepSidInToken(Token, Sid))
{
- *GrantedAccess = 0;
- *AccessStatus = STATUS_ACCESS_DENIED;
- return FALSE;
+ /* Map access rights from the ACE */
+ TempAccess = CurrentAce->AccessMask;
+ RtlMapGenericMask(&TempAccess, GenericMapping);
+
+ /* Leave if a remaining right must be denied */
+ if (RemainingAccess & TempAccess)
+ break;
}
}
-
else if (CurrentAce->Header.AceType == ACCESS_ALLOWED_ACE_TYPE)
{
if (SepSidInToken(Token, Sid))
{
- AccessMask = CurrentAce->AccessMask;
- RtlMapGenericMask(&AccessMask, GenericMapping);
- CurrentAccess |= AccessMask;
+ /* Map access rights from the ACE */
+ TempAccess = CurrentAce->AccessMask;
+ RtlMapGenericMask(&TempAccess, GenericMapping);
+
+ /* Remove granted rights */
+ RemainingAccess &= ~TempAccess;
}
}
else
{
DPRINT1("Unsupported ACE type 0x%lx\n", CurrentAce->Header.AceType);
}
+
+ /* Get the next ACE */
CurrentAce = (PACE)((ULONG_PTR)CurrentAce + CurrentAce->Header.AceSize);
}
- DPRINT("CurrentAccess %08lx\n DesiredAccess %08lx\n",
- CurrentAccess, DesiredAccess);
+ DPRINT("DesiredAccess %08lx\nPreviouslyGrantedAccess %08lx\nRemainingAccess %08lx\n",
+ DesiredAccess, PreviouslyGrantedAccess, RemainingAccess);
- *GrantedAccess = CurrentAccess & DesiredAccess;
+ /* Fail if some rights have not been granted */
+ if (RemainingAccess != 0)
+ {
+ *GrantedAccess = 0;
+ *AccessStatus = STATUS_ACCESS_DENIED;
+ return FALSE;
+ }
- if ((*GrantedAccess & ~VALID_INHERIT_FLAGS) ==
- (DesiredAccess & ~VALID_INHERIT_FLAGS))
+ /* Set granted access rights */
+ *GrantedAccess = DesiredAccess | PreviouslyGrantedAccess;
+
+ DPRINT("GrantedAccess %08lx\n", *GrantedAccess);
+
+ /* Fail if no rights have been granted */
+ if (*GrantedAccess == 0)
{
- *AccessStatus = STATUS_SUCCESS;
- return TRUE;
- }
- else
- {
- DPRINT1("HACK: Should deny access for caller: granted 0x%lx, desired 0x%lx (generic mapping %p).\n",
- *GrantedAccess, DesiredAccess, GenericMapping);
- //*AccessStatus = STATUS_ACCESS_DENIED;
- //return FALSE;
- *AccessStatus = STATUS_SUCCESS;
- return TRUE;
+ *AccessStatus = STATUS_ACCESS_DENIED;
+ return FALSE;
}
+
+ *AccessStatus = STATUS_SUCCESS;
+ return TRUE;
}
static PSID
From 05799d4a578f6a06c1e7e2e94d0a7a05d283e22c Mon Sep 17 00:00:00 2001
From: James Tabor
Date: Sat, 3 Apr 2010 22:05:03 +0000
Subject: [PATCH 022/261] [Gdi32] - Adding batch support for ExtSelectClipRgn
and update to the batch object structure.
svn path=/trunk/; revision=46705
---
reactos/dll/win32/gdi32/objects/region.c | 108 +++++++++++++++++++++-
reactos/include/reactos/win32k/ntgdityp.h | 5 +-
2 files changed, 105 insertions(+), 8 deletions(-)
diff --git a/reactos/dll/win32/gdi32/objects/region.c b/reactos/dll/win32/gdi32/objects/region.c
index e1f187ad3d2..3e2b7fe5b65 100644
--- a/reactos/dll/win32/gdi32/objects/region.c
+++ b/reactos/dll/win32/gdi32/objects/region.c
@@ -104,7 +104,6 @@ BOOL
FASTCALL
DeleteRegion( HRGN hRgn )
{
-//#if 0
PRGN_ATTR Rgn_Attr;
if ((GdiGetHandleUserData((HGDIOBJ) hRgn, GDI_OBJECT_TYPE_REGION, (PVOID) &Rgn_Attr)) &&
@@ -128,7 +127,6 @@ DeleteRegion( HRGN hRgn )
}
}
}
-//#endif
return NtGdiDeleteObjectApp((HGDIOBJ) hRgn);
}
@@ -581,8 +579,110 @@ INT
WINAPI
ExtSelectClipRgn( IN HDC hdc, IN HRGN hrgn, IN INT iMode)
{
- /* FIXME some part need be done on user mode size */
- return NtGdiExtSelectClipRgn(hdc,hrgn, iMode);
+ INT Ret;
+ HRGN NewRgn = NULL;
+
+#if 0
+// Handle something other than a normal dc object.
+ if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)
+ {
+ if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC)
+ return MFDRV_ExtSelectClipRgn( hdc, );
+ else
+ {
+ PLDC pLDC = GdiGetLDC(hdc);
+ if ( pLDC )
+ {
+ if (pLDC->iType != LDC_EMFLDC || EMFDRV_ExtSelectClipRgn( hdc, ))
+ return NtGdiExtSelectClipRgn(hdc, );
+ }
+ else
+ SetLastError(ERROR_INVALID_HANDLE);
+ return ERROR;
+ }
+ }
+#endif
+#if 0
+ if ( hrgn )
+ {
+ if ( GetLayout(hdc) & LAYOUT_RTL )
+ {
+ if ( MirrorRgnDC(hdc, hrgn, &NewRgn) )
+ {
+ if ( NewRgn ) hrgn = NewRgn;
+ }
+ }
+ }
+#endif
+ /* Batch handles RGN_COPY only! */
+ if (iMode == RGN_COPY)
+ {
+#if 0
+ PDC_ATTR pDc_Attr;
+ PRGN_ATTR pRgn_Attr = NULL;
+
+ /* hrgn can be NULL unless the RGN_COPY mode is specified. */
+ if (hrgn)
+ GdiGetHandleUserData((HGDIOBJ) hrgn, GDI_OBJECT_TYPE_REGION, (PVOID) &pRgn_Attr);
+
+ if ( GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &pDc_Attr) &&
+ pDc_Attr )
+ {
+ PGDI_TABLE_ENTRY pEntry = GdiHandleTable + GDI_HANDLE_GET_INDEX(hdc);
+ PTEB pTeb = NtCurrentTeb();
+
+ if ( pTeb->Win32ThreadInfo != NULL &&
+ pTeb->GdiTebBatch.HDC == hdc &&
+ !(pDc_Attr->ulDirty_ & DC_DIBSECTION) &&
+ !(pEntry->Flags & GDI_ENTRY_VALIDATE_VIS) )
+ {
+ if (!hrgn ||
+ (hrgn && pRgn_Attr && pRgn_Attr->Flags <= SIMPLEREGION) )
+ {
+ if ((pTeb->GdiTebBatch.Offset + sizeof(GDIBSEXTSELCLPRGN)) <= GDIBATCHBUFSIZE)
+ {
+ PGDIBSEXTSELCLPRGN pgO = (PGDIBSEXTSELCLPRGN)(&pTeb->GdiTebBatch.Buffer[0] +
+ pTeb->GdiTebBatch.Offset);
+ pgO->gbHdr.Cmd = GdiBCExtSelClipRgn;
+ pgO->gbHdr.Size = sizeof(GDIBSEXTSELCLPRGN);
+ pgO->fnMode = iMode;
+
+ if ( hrgn && pRgn_Attr )
+ {
+ Ret = pRgn_Attr->Flags;
+
+ if ( pDc_Attr->VisRectRegion.Rect.left >= pRgn_Attr->Rect.right ||
+ pDc_Attr->VisRectRegion.Rect.top >= pRgn_Attr->Rect.bottom ||
+ pDc_Attr->VisRectRegion.Rect.right <= pRgn_Attr->Rect.left ||
+ pDc_Attr->VisRectRegion.Rect.bottom <= pRgn_Attr->Rect.top )
+ Ret = NULLREGION;
+
+ pgO->left = pRgn_Attr->Rect.left;
+ pgO->top = pRgn_Attr->Rect.top;
+ pgO->right = pRgn_Attr->Rect.right;
+ pgO->bottom = pRgn_Attr->Rect.bottom;
+ }
+ else
+ {
+ Ret = pDc_Attr->VisRectRegion.Flags;
+ pgO->fnMode |= 0x80000000; // Set no hrgn mode.
+ }
+ pTeb->GdiTebBatch.Offset += sizeof(GDIBSEXTSELCLPRGN);
+ pTeb->GdiBatchCount++;
+ if (pTeb->GdiBatchCount >= GDI_BatchLimit) NtGdiFlush();
+ if ( NewRgn ) DeleteObject(NewRgn);
+ return Ret;
+ }
+ }
+ }
+ }
+#endif
+ }
+ Ret = NtGdiExtSelectClipRgn(hdc, hrgn, iMode);
+
+ if ( NewRgn ) DeleteObject(NewRgn);
+
+ return Ret;
}
/*
diff --git a/reactos/include/reactos/win32k/ntgdityp.h b/reactos/include/reactos/win32k/ntgdityp.h
index 2e710ca6bdf..1aedf765dbc 100644
--- a/reactos/include/reactos/win32k/ntgdityp.h
+++ b/reactos/include/reactos/win32k/ntgdityp.h
@@ -523,10 +523,7 @@ typedef struct _GDIBSEXTSELCLPRGN
{
GDIBATCHHDR gbHdr;
int fnMode;
- LONG right;
- LONG bottom;
- LONG left;
- LONG top;
+ RECTL;
} GDIBSEXTSELCLPRGN, *PGDIBSEXTSELCLPRGN;
//
// Use with GdiBCSelObj, GdiBCDelObj and GdiBCDelRgn.
From d6d462f2039416db48768b9dcec7c498f7dc5aa2 Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Sun, 4 Apr 2010 00:00:21 +0000
Subject: [PATCH 023/261] [PCI] - Handle IRP_MN_QUERY_DEVICE_RELATIONS for
TargetDeviceRelation for PCI's child PDOs
svn path=/trunk/; revision=46706
---
reactos/drivers/bus/pci/pdo.c | 30 ++++++++++++++++++++++++++++--
1 file changed, 28 insertions(+), 2 deletions(-)
diff --git a/reactos/drivers/bus/pci/pdo.c b/reactos/drivers/bus/pci/pdo.c
index 27cd878b9c3..6fde92e8311 100644
--- a/reactos/drivers/bus/pci/pdo.c
+++ b/reactos/drivers/bus/pci/pdo.c
@@ -1290,6 +1290,33 @@ PdoWriteConfig(
return STATUS_SUCCESS;
}
+static NTSTATUS
+PdoQueryDeviceRelations(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp,
+ PIO_STACK_LOCATION IrpSp)
+{
+ PDEVICE_RELATIONS DeviceRelations;
+
+ /* We only support TargetDeviceRelation for child PDOs */
+ if (IrpSp->Parameters.QueryDeviceRelations.Type != TargetDeviceRelation)
+ return Irp->IoStatus.Status;
+
+ /* We can do this because we only return 1 PDO for TargetDeviceRelation */
+ DeviceRelations = ExAllocatePool(PagedPool, sizeof(*DeviceRelations));
+ if (!DeviceRelations)
+ return STATUS_INSUFFICIENT_RESOURCES;
+
+ DeviceRelations->Count = 1;
+ DeviceRelations->Objects[0] = DeviceObject;
+
+ /* The PnP manager will remove this when it is done with the PDO */
+ ObReferenceObject(DeviceObject);
+
+ Irp->IoStatus.Information = (ULONG_PTR)DeviceRelations;
+
+ return STATUS_SUCCESS;
+}
static NTSTATUS
PdoSetPower(
@@ -1362,8 +1389,7 @@ PdoPnpControl(
break;
case IRP_MN_QUERY_DEVICE_RELATIONS:
- /* FIXME: Possibly handle for RemovalRelations */
- DPRINT("Unimplemented IRP_MN_QUERY_DEVICE_RELATIONS received\n");
+ Status = PdoQueryDeviceRelations(DeviceObject, Irp, IrpSp);
break;
case IRP_MN_QUERY_DEVICE_TEXT:
From 28971e63f31043bbeff77bd829c65c21da43767f Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Sun, 4 Apr 2010 00:33:19 +0000
Subject: [PATCH 024/261] [NTOSKRNL] - Pass IRPs down to the root PDO if we
don't handle it - Don't complain if we get an IRP that we don't expect. We
are the parent bus driver for the device so we are responsible for completing
those IRPs.
svn path=/trunk/; revision=46707
---
reactos/ntoskrnl/io/pnpmgr/pnproot.c | 74 ++++++++++------------------
1 file changed, 25 insertions(+), 49 deletions(-)
diff --git a/reactos/ntoskrnl/io/pnpmgr/pnproot.c b/reactos/ntoskrnl/io/pnpmgr/pnproot.c
index a5fa2a04f0c..80a1662b791 100644
--- a/reactos/ntoskrnl/io/pnpmgr/pnproot.c
+++ b/reactos/ntoskrnl/io/pnpmgr/pnproot.c
@@ -677,27 +677,26 @@ PnpRootFdoPnpControl(
if (NT_SUCCESS(Status))
DeviceExtension->State = dsStarted;
}
- break;
+
+ Irp->IoStatus.Status = Status;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return Status;
case IRP_MN_STOP_DEVICE:
DPRINT("IRP_MJ_PNP / IRP_MN_STOP_DEVICE\n");
/* Root device cannot be stopped */
- Status = STATUS_NOT_SUPPORTED;
- break;
+ Irp->IoStatus.Status = Status = STATUS_INVALID_DEVICE_REQUEST;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return Status;
default:
DPRINT("IRP_MJ_PNP / Unknown minor function 0x%lx\n", IrpSp->MinorFunction);
- Status = STATUS_NOT_IMPLEMENTED;
break;
}
- if (Status != STATUS_PENDING)
- {
- Irp->IoStatus.Status = Status;
- IoCompleteRequest(Irp, IO_NO_INCREMENT);
- }
-
- return Status;
+ /* Pass this IRP down to the root device PDO */
+ IoSkipCurrentIrpStackLocation(Irp);
+ return IoCallDriver(DeviceExtension->Ldo, Irp);
}
static NTSTATUS
@@ -707,48 +706,25 @@ PdoQueryDeviceRelations(
IN PIO_STACK_LOCATION IrpSp)
{
PDEVICE_RELATIONS Relations;
- DEVICE_RELATION_TYPE RelationType;
NTSTATUS Status = Irp->IoStatus.Status;
- RelationType = IrpSp->Parameters.QueryDeviceRelations.Type;
+ if (IrpSp->Parameters.QueryDeviceRelations.Type != TargetDeviceRelation)
+ return Status;
- switch (RelationType)
+ DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / TargetDeviceRelation\n");
+ Relations = (PDEVICE_RELATIONS)ExAllocatePool(PagedPool, sizeof(DEVICE_RELATIONS));
+ if (!Relations)
{
- /* FIXME: remove */
- case BusRelations:
- {
- if (IoGetAttachedDevice(DeviceObject) != DeviceObject)
- {
- /* We're not alone in the stack */
- DPRINT1("PnP is misbehaving ; don't know how to handle IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n");
- }
- break;
- }
-
- case TargetDeviceRelation:
- {
- DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / TargetDeviceRelation\n");
- Relations = (PDEVICE_RELATIONS)ExAllocatePool(PagedPool, sizeof(DEVICE_RELATIONS));
- if (!Relations)
- {
- DPRINT("ExAllocatePoolWithTag() failed\n");
- Status = STATUS_NO_MEMORY;
- }
- else
- {
- ObReferenceObject(DeviceObject);
- Relations->Count = 1;
- Relations->Objects[0] = DeviceObject;
- Status = STATUS_SUCCESS;
- Irp->IoStatus.Information = (ULONG_PTR)Relations;
- }
- break;
- }
-
- default:
- {
- DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / unknown relation type 0x%lx\n", RelationType);
- }
+ DPRINT("ExAllocatePoolWithTag() failed\n");
+ Status = STATUS_NO_MEMORY;
+ }
+ else
+ {
+ ObReferenceObject(DeviceObject);
+ Relations->Count = 1;
+ Relations->Objects[0] = DeviceObject;
+ Status = STATUS_SUCCESS;
+ Irp->IoStatus.Information = (ULONG_PTR)Relations;
}
return Status;
From e90ce939a6be799d1a54b900ca56c754431a9427 Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Sun, 4 Apr 2010 01:18:41 +0000
Subject: [PATCH 025/261] [NTOSKRNL] - Revert part of r46707 - Remove a hack in
PnpRoot that assembled a CM_RESOURCE_LIST from a
CM_PARTIAL_RESOURCE_DESCRIPTOR but also corrupted proper resource lists (such
as from detected devices in IoReportDetectedDevice) - Add a simple resource
arbiter that finds an unused resource in the range provided in the resource
requirements list. It's not perfect but it's a start. - Start enforcing
resource conflicts - Fix incorrect code that was writing a
CM_PARTIAL_RESOURCE_DESCRIPTOR instead of a CM_RESOURCE_LIST (the hack above
was compensating for this) which result in BootConfig being a
REG_PARTIAL_RESOURCE_DESCRIPTOR type on certain devices and a
REG_RESOURCE_LIST on others - Fix a broken check for no partial resource
descriptors
svn path=/trunk/; revision=46708
---
reactos/ntoskrnl/io/pnpmgr/pnpmgr.c | 748 ++++++++++++++++++---------
reactos/ntoskrnl/io/pnpmgr/pnproot.c | 18 +-
2 files changed, 506 insertions(+), 260 deletions(-)
diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
index 44283968d0c..b6241070fbf 100644
--- a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
+++ b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
@@ -1005,137 +1005,183 @@ IopSetDeviceInstanceData(HANDLE InstanceKey,
}
BOOLEAN
-IopCheckForResourceConflict(
- IN PCM_RESOURCE_LIST ResourceList1,
- IN PCM_RESOURCE_LIST ResourceList2)
+IopCheckResourceDescriptor(
+ IN PCM_PARTIAL_RESOURCE_DESCRIPTOR ResDesc,
+ IN PCM_RESOURCE_LIST ResourceList,
+ IN BOOLEAN Silent,
+ OUT OPTIONAL PCM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDescriptor)
{
- ULONG i1, i2, ii1, ii2;
+ ULONG i, ii;
BOOLEAN Result = FALSE;
- for (i1 = 0; i1 < ResourceList1->Count; i1++)
+ if (ResDesc->ShareDisposition == CmResourceShareShared)
+ return FALSE;
+
+ for (i = 0; i < ResourceList->Count; i++)
{
- PCM_PARTIAL_RESOURCE_LIST ResList1 = &ResourceList1->List[i1].PartialResourceList;
- for (i2 = 0; i2 < ResourceList2->Count; i2++)
+ PCM_PARTIAL_RESOURCE_LIST ResList = &ResourceList->List[i].PartialResourceList;
+ for (ii = 0; ii < ResList->Count; ii++)
{
- PCM_PARTIAL_RESOURCE_LIST ResList2 = &ResourceList2->List[i2].PartialResourceList;
- for (ii1 = 0; ii1 < ResList1->Count; ii1++)
+ PCM_PARTIAL_RESOURCE_DESCRIPTOR ResDesc2 = &ResList->PartialDescriptors[ii];
+
+ /* We don't care about shared resources */
+ if (ResDesc->ShareDisposition == CmResourceShareShared &&
+ ResDesc2->ShareDisposition == CmResourceShareShared)
+ continue;
+
+ /* Make sure we're comparing the same types */
+ if (ResDesc->Type != ResDesc2->Type)
+ continue;
+
+ switch (ResDesc->Type)
{
- PCM_PARTIAL_RESOURCE_DESCRIPTOR ResDesc1 = &ResList1->PartialDescriptors[ii1];
-
- if (ResDesc1->ShareDisposition == CmResourceShareShared)
- continue;
-
- for (ii2 = 0; ii2 < ResList2->Count; ii2++)
- {
- PCM_PARTIAL_RESOURCE_DESCRIPTOR ResDesc2 = &ResList2->PartialDescriptors[ii2];
-
- /* We don't care about shared resources */
- if (ResDesc2->ShareDisposition == CmResourceShareShared)
- continue;
-
- /* Make sure we're comparing the same types */
- if (ResDesc1->Type != ResDesc2->Type)
- continue;
-
- switch (ResDesc1->Type)
- {
- case CmResourceTypeMemory:
- if ((ResDesc1->u.Memory.Start.QuadPart < ResDesc2->u.Memory.Start.QuadPart &&
- ResDesc1->u.Memory.Start.QuadPart + ResDesc1->u.Memory.Length >
- ResDesc2->u.Memory.Start.QuadPart) || (ResDesc2->u.Memory.Start.QuadPart <
- ResDesc1->u.Memory.Start.QuadPart && ResDesc2->u.Memory.Start.QuadPart +
- ResDesc2->u.Memory.Length > ResDesc1->u.Memory.Start.QuadPart))
+ case CmResourceTypeMemory:
+ if ((ResDesc->u.Memory.Start.QuadPart < ResDesc2->u.Memory.Start.QuadPart &&
+ ResDesc->u.Memory.Start.QuadPart + ResDesc->u.Memory.Length >
+ ResDesc2->u.Memory.Start.QuadPart) || (ResDesc2->u.Memory.Start.QuadPart <
+ ResDesc->u.Memory.Start.QuadPart && ResDesc2->u.Memory.Start.QuadPart +
+ ResDesc2->u.Memory.Length > ResDesc->u.Memory.Start.QuadPart))
+ {
+ if (!Silent)
{
DPRINT1("Resource conflict: Memory (0x%x to 0x%x vs. 0x%x to 0x%x)\n",
- ResDesc1->u.Memory.Start.QuadPart, ResDesc1->u.Memory.Start.QuadPart +
- ResDesc1->u.Memory.Length, ResDesc2->u.Memory.Start.QuadPart,
+ ResDesc->u.Memory.Start.QuadPart, ResDesc->u.Memory.Start.QuadPart +
+ ResDesc->u.Memory.Length, ResDesc2->u.Memory.Start.QuadPart,
ResDesc2->u.Memory.Start.QuadPart + ResDesc2->u.Memory.Length);
-
- Result = TRUE;
-
- goto ByeBye;
}
- break;
- case CmResourceTypePort:
- if ((ResDesc1->u.Port.Start.QuadPart < ResDesc2->u.Port.Start.QuadPart &&
- ResDesc1->u.Port.Start.QuadPart + ResDesc1->u.Port.Length >
- ResDesc2->u.Port.Start.QuadPart) || (ResDesc2->u.Port.Start.QuadPart <
- ResDesc1->u.Port.Start.QuadPart && ResDesc2->u.Port.Start.QuadPart +
- ResDesc2->u.Port.Length > ResDesc1->u.Port.Start.QuadPart))
+ Result = TRUE;
+
+ goto ByeBye;
+ }
+ break;
+
+ case CmResourceTypePort:
+ if ((ResDesc->u.Port.Start.QuadPart < ResDesc2->u.Port.Start.QuadPart &&
+ ResDesc->u.Port.Start.QuadPart + ResDesc->u.Port.Length >
+ ResDesc2->u.Port.Start.QuadPart) || (ResDesc2->u.Port.Start.QuadPart <
+ ResDesc->u.Port.Start.QuadPart && ResDesc2->u.Port.Start.QuadPart +
+ ResDesc2->u.Port.Length > ResDesc->u.Port.Start.QuadPart))
+ {
+ if (!Silent)
{
DPRINT1("Resource conflict: Port (0x%x to 0x%x vs. 0x%x to 0x%x)\n",
- ResDesc1->u.Port.Start.QuadPart, ResDesc1->u.Port.Start.QuadPart +
- ResDesc1->u.Port.Length, ResDesc2->u.Port.Start.QuadPart,
+ ResDesc->u.Port.Start.QuadPart, ResDesc->u.Port.Start.QuadPart +
+ ResDesc->u.Port.Length, ResDesc2->u.Port.Start.QuadPart,
ResDesc2->u.Port.Start.QuadPart + ResDesc2->u.Port.Length);
-
- Result = TRUE;
-
- goto ByeBye;
}
- break;
- case CmResourceTypeInterrupt:
- if (ResDesc1->u.Interrupt.Vector == ResDesc2->u.Interrupt.Vector)
+ Result = TRUE;
+
+ goto ByeBye;
+ }
+ break;
+
+ case CmResourceTypeInterrupt:
+ if (ResDesc->u.Interrupt.Vector == ResDesc2->u.Interrupt.Vector)
+ {
+ if (!Silent)
{
- DPRINT1("Resource conflict: IRQ (0x%x 0x%x vs. 0x%x 0x%x)\n",
- ResDesc1->u.Interrupt.Vector, ResDesc1->u.Interrupt.Level,
- ResDesc2->u.Interrupt.Vector, ResDesc2->u.Interrupt.Level);
-
- Result = TRUE;
-
- goto ByeBye;
+ DPRINT1("Resource conflict: IRQ (0x%x 0x%x vs. 0x%x 0x%x)\n",
+ ResDesc->u.Interrupt.Vector, ResDesc->u.Interrupt.Level,
+ ResDesc2->u.Interrupt.Vector, ResDesc2->u.Interrupt.Level);
}
- break;
- case CmResourceTypeBusNumber:
- if ((ResDesc1->u.BusNumber.Start < ResDesc2->u.BusNumber.Start &&
- ResDesc1->u.BusNumber.Start + ResDesc1->u.BusNumber.Length >
- ResDesc2->u.BusNumber.Start) || (ResDesc2->u.BusNumber.Start <
- ResDesc1->u.BusNumber.Start && ResDesc2->u.BusNumber.Start +
- ResDesc2->u.BusNumber.Length > ResDesc1->u.BusNumber.Start))
+ Result = TRUE;
+
+ goto ByeBye;
+ }
+ break;
+
+ case CmResourceTypeBusNumber:
+ if ((ResDesc->u.BusNumber.Start < ResDesc2->u.BusNumber.Start &&
+ ResDesc->u.BusNumber.Start + ResDesc->u.BusNumber.Length >
+ ResDesc2->u.BusNumber.Start) || (ResDesc2->u.BusNumber.Start <
+ ResDesc->u.BusNumber.Start && ResDesc2->u.BusNumber.Start +
+ ResDesc2->u.BusNumber.Length > ResDesc->u.BusNumber.Start))
+ {
+ if (!Silent)
{
- DPRINT1("Resource conflict: Bus number (0x%x to 0x%x vs. 0x%x to 0x%x)\n",
- ResDesc1->u.BusNumber.Start, ResDesc1->u.BusNumber.Start +
- ResDesc1->u.BusNumber.Length, ResDesc2->u.BusNumber.Start,
+ DPRINT1("Resource conflict: Bus number (0x%x to 0x%x vs. 0x%x to 0x%x)\n",
+ ResDesc->u.BusNumber.Start, ResDesc->u.BusNumber.Start +
+ ResDesc->u.BusNumber.Length, ResDesc2->u.BusNumber.Start,
ResDesc2->u.BusNumber.Start + ResDesc2->u.BusNumber.Length);
-
- Result = TRUE;
-
- goto ByeBye;
}
- break;
- case CmResourceTypeDma:
- if (ResDesc1->u.Dma.Channel == ResDesc2->u.Dma.Channel)
- {
+ Result = TRUE;
+
+ goto ByeBye;
+ }
+ break;
+
+ case CmResourceTypeDma:
+ if (ResDesc->u.Dma.Channel == ResDesc2->u.Dma.Channel)
+ {
+ if (!Silent)
+ {
DPRINT1("Resource conflict: Dma (0x%x 0x%x vs. 0x%x 0x%x)\n",
- ResDesc1->u.Dma.Channel, ResDesc1->u.Dma.Port,
+ ResDesc->u.Dma.Channel, ResDesc->u.Dma.Port,
ResDesc2->u.Dma.Channel, ResDesc2->u.Dma.Port);
+ }
- Result = TRUE;
+ Result = TRUE;
- goto ByeBye;
- }
- break;
- }
- }
+ goto ByeBye;
+ }
+ break;
}
}
}
ByeBye:
-#ifdef ENABLE_RESOURCE_CONFLICT_DETECTION
+ if (Result && ConflictingDescriptor)
+ {
+ RtlCopyMemory(ConflictingDescriptor,
+ ResDesc,
+ sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
+ }
+
+ return Result;
+}
+
+
+BOOLEAN
+IopCheckForResourceConflict(
+ IN PCM_RESOURCE_LIST ResourceList1,
+ IN PCM_RESOURCE_LIST ResourceList2,
+ IN BOOLEAN Silent,
+ OUT OPTIONAL PCM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDescriptor)
+{
+ ULONG i, ii;
+ BOOLEAN Result = FALSE;
+
+ for (i = 0; i < ResourceList1->Count; i++)
+ {
+ PCM_PARTIAL_RESOURCE_LIST ResList = &ResourceList1->List[i].PartialResourceList;
+ for (ii = 0; ii < ResList->Count; ii++)
+ {
+ PCM_PARTIAL_RESOURCE_DESCRIPTOR ResDesc = &ResList->PartialDescriptors[ii];
+
+ Result = IopCheckResourceDescriptor(ResDesc,
+ ResourceList2,
+ Silent,
+ ConflictingDescriptor);
+ if (Result) goto ByeBye;
+ }
+ }
+
+
+ByeBye:
+
return Result;
-#else
- return FALSE;
-#endif
}
NTSTATUS
IopDetectResourceConflict(
- IN PCM_RESOURCE_LIST ResourceList)
+ IN PCM_RESOURCE_LIST ResourceList,
+ IN BOOLEAN Silent,
+ OUT OPTIONAL PCM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDescriptor)
{
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName;
@@ -1321,7 +1367,9 @@ IopDetectResourceConflict(
ExFreePool(KeyNameInformation);
if (IopCheckForResourceConflict(ResourceList,
- (PCM_RESOURCE_LIST)KeyValueInformation->Data))
+ (PCM_RESOURCE_LIST)KeyValueInformation->Data,
+ Silent,
+ ConflictingDescriptor))
{
ExFreePool(KeyValueInformation);
Status = STATUS_CONFLICTING_ADDRESSES;
@@ -1346,19 +1394,312 @@ cleanup:
return Status;
}
-
+
+BOOLEAN
+IopCheckDescriptorForConflict(PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDesc, OPTIONAL PCM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDescriptor)
+{
+ CM_RESOURCE_LIST CmList;
+ NTSTATUS Status;
+
+ CmList.Count = 1;
+ CmList.List[0].InterfaceType = InterfaceTypeUndefined;
+ CmList.List[0].BusNumber = 0;
+ CmList.List[0].PartialResourceList.Version = 1;
+ CmList.List[0].PartialResourceList.Revision = 1;
+ CmList.List[0].PartialResourceList.Count = 1;
+ CmList.List[0].PartialResourceList.PartialDescriptors[0] = *CmDesc;
+
+ Status = IopDetectResourceConflict(&CmList, TRUE, ConflictingDescriptor);
+ if (Status == STATUS_CONFLICTING_ADDRESSES)
+ return TRUE;
+
+ return FALSE;
+}
+
+BOOLEAN
+IopFindBusNumberResource(
+ IN PIO_RESOURCE_DESCRIPTOR IoDesc,
+ OUT PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDesc)
+{
+ ULONG Start;
+ CM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDesc;
+
+ ASSERT(IoDesc->Type == CmDesc->Type);
+ ASSERT(IoDesc->Type == CmResourceTypeBusNumber);
+
+ for (Start = IoDesc->u.BusNumber.MinBusNumber;
+ Start < IoDesc->u.BusNumber.MaxBusNumber;
+ Start++)
+ {
+ CmDesc->u.BusNumber.Length = IoDesc->u.BusNumber.Length;
+ CmDesc->u.BusNumber.Start = Start;
+
+ if (IopCheckDescriptorForConflict(CmDesc, &ConflictingDesc))
+ {
+ Start += ConflictingDesc.u.BusNumber.Start + ConflictingDesc.u.BusNumber.Length;
+ }
+ else
+ {
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+BOOLEAN
+IopFindMemoryResource(
+ IN PIO_RESOURCE_DESCRIPTOR IoDesc,
+ OUT PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDesc)
+{
+ ULONGLONG Start;
+ CM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDesc;
+
+ ASSERT(IoDesc->Type == CmDesc->Type);
+ ASSERT(IoDesc->Type == CmResourceTypeMemory);
+
+ for (Start = IoDesc->u.Memory.MinimumAddress.QuadPart;
+ Start < IoDesc->u.Memory.MaximumAddress.QuadPart;
+ Start++)
+ {
+ CmDesc->u.Memory.Length = IoDesc->u.Memory.Length;
+ CmDesc->u.Memory.Start.QuadPart = Start;
+
+ if (IopCheckDescriptorForConflict(CmDesc, &ConflictingDesc))
+ {
+ Start += ConflictingDesc.u.Memory.Start.QuadPart + ConflictingDesc.u.Memory.Length;
+ }
+ else
+ {
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+BOOLEAN
+IopFindPortResource(
+ IN PIO_RESOURCE_DESCRIPTOR IoDesc,
+ OUT PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDesc)
+{
+ ULONGLONG Start;
+ CM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDesc;
+
+ ASSERT(IoDesc->Type == CmDesc->Type);
+ ASSERT(IoDesc->Type == CmResourceTypePort);
+
+ for (Start = IoDesc->u.Port.MinimumAddress.QuadPart;
+ Start < IoDesc->u.Port.MaximumAddress.QuadPart;
+ Start++)
+ {
+ CmDesc->u.Port.Length = IoDesc->u.Port.Length;
+ CmDesc->u.Port.Start.QuadPart = Start;
+
+ if (IopCheckDescriptorForConflict(CmDesc, &ConflictingDesc))
+ {
+ Start += ConflictingDesc.u.Port.Start.QuadPart + ConflictingDesc.u.Port.Length;
+ }
+ else
+ {
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+BOOLEAN
+IopFindDmaResource(
+ IN PIO_RESOURCE_DESCRIPTOR IoDesc,
+ OUT PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDesc)
+{
+ ULONG Channel;
+
+ ASSERT(IoDesc->Type == CmDesc->Type);
+ ASSERT(IoDesc->Type == CmResourceTypeDma);
+
+ for (Channel = IoDesc->u.Dma.MinimumChannel;
+ Channel < IoDesc->u.Dma.MaximumChannel;
+ Channel++)
+ {
+ CmDesc->u.Dma.Channel = Channel;
+ CmDesc->u.Dma.Port = 0;
+
+ if (!IopCheckDescriptorForConflict(CmDesc, NULL))
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+BOOLEAN
+IopFindInterruptResource(
+ IN PIO_RESOURCE_DESCRIPTOR IoDesc,
+ OUT PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDesc)
+{
+ ULONG Vector;
+
+ ASSERT(IoDesc->Type == CmDesc->Type);
+ ASSERT(IoDesc->Type == CmResourceTypeInterrupt);
+
+ for (Vector = IoDesc->u.Interrupt.MinimumVector;
+ Vector < IoDesc->u.Interrupt.MaximumVector;
+ Vector++)
+ {
+ CmDesc->u.Interrupt.Vector = Vector;
+ CmDesc->u.Interrupt.Level = Vector;
+ CmDesc->u.Interrupt.Affinity = (KAFFINITY)-1;
+
+ if (!IopCheckDescriptorForConflict(CmDesc, NULL))
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+NTSTATUS
+IopCreateResourceListFromRequirements(
+ IN PIO_RESOURCE_REQUIREMENTS_LIST RequirementsList,
+ OUT PCM_RESOURCE_LIST *ResourceList)
+{
+ ULONG i, ii, Size;
+ PCM_PARTIAL_RESOURCE_DESCRIPTOR ResDesc;
+
+ Size = FIELD_OFFSET(CM_RESOURCE_LIST, List);
+ for (i = 0; i < RequirementsList->AlternativeLists; i++)
+ {
+ PIO_RESOURCE_LIST ResList = &RequirementsList->List[i];
+ Size += FIELD_OFFSET(CM_FULL_RESOURCE_DESCRIPTOR, PartialResourceList.PartialDescriptors)
+ + ResList->Count * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
+ }
+
+ DPRINT1("Allocating resource list: %d\n", Size);
+ *ResourceList = ExAllocatePool(PagedPool, Size);
+ if (!*ResourceList)
+ return STATUS_INSUFFICIENT_RESOURCES;
+
+ (*ResourceList)->Count = 1;
+ (*ResourceList)->List[0].BusNumber = RequirementsList->BusNumber;
+ (*ResourceList)->List[0].InterfaceType = RequirementsList->InterfaceType;
+ (*ResourceList)->List[0].PartialResourceList.Version = 1;
+ (*ResourceList)->List[0].PartialResourceList.Revision = 1;
+ (*ResourceList)->List[0].PartialResourceList.Count = 0;
+
+ ResDesc = &(*ResourceList)->List[0].PartialResourceList.PartialDescriptors[0];
+
+ for (i = 0; i < RequirementsList->AlternativeLists; i++)
+ {
+ PIO_RESOURCE_LIST ResList = &RequirementsList->List[i];
+ for (ii = 0; ii < ResList->Count; ii++)
+ {
+ PIO_RESOURCE_DESCRIPTOR ReqDesc = &ResList->Descriptors[ii];
+
+ /* FIXME: Handle alternate ranges */
+ if (ReqDesc->Option == IO_RESOURCE_ALTERNATIVE)
+ continue;
+
+ ResDesc->Type = ReqDesc->Type;
+ ResDesc->Flags = ReqDesc->Flags;
+ ResDesc->ShareDisposition = ReqDesc->ShareDisposition;
+
+ switch (ReqDesc->Type)
+ {
+ case CmResourceTypeInterrupt:
+ if (!IopFindInterruptResource(ReqDesc, ResDesc))
+ {
+ DPRINT1("Failed to find an available interrupt resource (0x%x to 0x%x)\n",
+ ReqDesc->u.Interrupt.MinimumVector, ReqDesc->u.Interrupt.MaximumVector);
+
+ if (ReqDesc->Option == 0)
+ {
+ ExFreePool(*ResourceList);
+ return STATUS_CONFLICTING_ADDRESSES;
+ }
+ }
+ break;
+
+ case CmResourceTypePort:
+ if (!IopFindPortResource(ReqDesc, ResDesc))
+ {
+ DPRINT1("Failed to find an available port resource (0x%x to 0x%x length: 0x%x)\n",
+ ReqDesc->u.Port.MinimumAddress.QuadPart, ReqDesc->u.Port.MaximumAddress.QuadPart,
+ ReqDesc->u.Port.Length);
+
+ if (ReqDesc->Option == 0)
+ {
+ ExFreePool(*ResourceList);
+ return STATUS_CONFLICTING_ADDRESSES;
+ }
+ }
+ break;
+
+ case CmResourceTypeMemory:
+ if (!IopFindMemoryResource(ReqDesc, ResDesc))
+ {
+ DPRINT1("Failed to find an available memory resource (0x%x to 0x%x length: 0x%x)\n",
+ ReqDesc->u.Memory.MinimumAddress.QuadPart, ReqDesc->u.Memory.MaximumAddress.QuadPart,
+ ReqDesc->u.Memory.Length);
+
+ if (ReqDesc->Option == 0)
+ {
+ ExFreePool(*ResourceList);
+ return STATUS_CONFLICTING_ADDRESSES;
+ }
+ }
+ break;
+
+ case CmResourceTypeBusNumber:
+ if (!IopFindBusNumberResource(ReqDesc, ResDesc))
+ {
+ DPRINT1("Failed to find an available bus number resource (0x%x to 0x%x length: 0x%x)\n",
+ ReqDesc->u.BusNumber.MinBusNumber, ReqDesc->u.BusNumber.MaxBusNumber,
+ ReqDesc->u.BusNumber.Length);
+
+ if (ReqDesc->Option == 0)
+ {
+ ExFreePool(*ResourceList);
+ return STATUS_CONFLICTING_ADDRESSES;
+ }
+ }
+ break;
+
+ case CmResourceTypeDma:
+ if (!IopFindDmaResource(ReqDesc, ResDesc))
+ {
+ DPRINT1("Failed to find an available dma resource (0x%x to 0x%x)\n",
+ ReqDesc->u.Dma.MinimumChannel, ReqDesc->u.Dma.MaximumChannel);
+
+ if (ReqDesc->Option == 0)
+ {
+ ExFreePool(*ResourceList);
+ return STATUS_CONFLICTING_ADDRESSES;
+ }
+ }
+ break;
+
+ default:
+ DPRINT1("Unsupported resource type: %x\n", ReqDesc->Type);
+ break;
+ }
+
+ (*ResourceList)->List[0].PartialResourceList.Count++;
+ ResDesc++;
+ }
+ }
+
+ return STATUS_SUCCESS;
+}
+
NTSTATUS
IopAssignDeviceResources(
IN PDEVICE_NODE DeviceNode,
OUT ULONG *pRequiredSize)
{
- PIO_RESOURCE_LIST ResourceList;
- PIO_RESOURCE_DESCRIPTOR ResourceDescriptor;
- PCM_PARTIAL_RESOURCE_DESCRIPTOR DescriptorRaw;
PCM_PARTIAL_RESOURCE_LIST pPartialResourceList;
- ULONG NumberOfResources = 0;
ULONG Size;
- ULONG i, j;
+ ULONG i;
+ ULONG j;
NTSTATUS Status;
if (!DeviceNode->BootResources && !DeviceNode->ResourceRequirements)
@@ -1371,7 +1712,7 @@ IopAssignDeviceResources(
/* Fill DeviceNode->ResourceList
* FIXME: the PnP arbiter should go there!
- * Actually, use the BootResources if provided, else the resource list #0
+ * Actually, use the BootResources if provided, else the resource requirements
*/
if (DeviceNode->BootResources)
@@ -1398,161 +1739,38 @@ IopAssignDeviceResources(
}
RtlCopyMemory(DeviceNode->ResourceList, DeviceNode->BootResources, Size);
- Status = IopDetectResourceConflict(DeviceNode->ResourceList);
- if (!NT_SUCCESS(Status))
- goto ByeBye;
-
- *pRequiredSize = Size;
- return STATUS_SUCCESS;
- }
-
- /* Ok, here, we have to use the device requirement list */
- ResourceList = &DeviceNode->ResourceRequirements->List[0];
- if (ResourceList->Version != 1 || ResourceList->Revision != 1)
- {
- Status = STATUS_REVISION_MISMATCH;
- goto ByeBye;
- }
-
- Size = sizeof(CM_RESOURCE_LIST) + ResourceList->Count * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
- DeviceNode->ResourceList = ExAllocatePool(PagedPool, Size);
- if (!DeviceNode->ResourceList)
- {
- Status = STATUS_NO_MEMORY;
- goto ByeBye;
- }
-
- DeviceNode->ResourceList->Count = 1;
- DeviceNode->ResourceList->List[0].InterfaceType = DeviceNode->ResourceRequirements->InterfaceType;
- DeviceNode->ResourceList->List[0].BusNumber = DeviceNode->ResourceRequirements->BusNumber;
- DeviceNode->ResourceList->List[0].PartialResourceList.Version = 1;
- DeviceNode->ResourceList->List[0].PartialResourceList.Revision = 1;
-
- for (i = 0; i < ResourceList->Count; i++)
- {
- ResourceDescriptor = &ResourceList->Descriptors[i];
-
- if (ResourceDescriptor->Option == 0 || ResourceDescriptor->Option == IO_RESOURCE_PREFERRED)
+ Status = IopDetectResourceConflict(DeviceNode->ResourceList, FALSE, NULL);
+ if (NT_SUCCESS(Status) || !DeviceNode->ResourceRequirements)
{
- DescriptorRaw = &DeviceNode->ResourceList->List[0].PartialResourceList.PartialDescriptors[NumberOfResources];
- NumberOfResources++;
+ if (!NT_SUCCESS(Status) && !DeviceNode->ResourceRequirements)
+ {
+ DPRINT1("Using conflicting boot resources because no requirements were supplied!\n");
+ }
- /* Copy ResourceDescriptor to DescriptorRaw and DescriptorTranslated */
- DescriptorRaw->Type = ResourceDescriptor->Type;
- DescriptorRaw->ShareDisposition = ResourceDescriptor->ShareDisposition;
- DescriptorRaw->Flags = ResourceDescriptor->Flags;
- switch (ResourceDescriptor->Type)
- {
- case CmResourceTypePort:
- {
- DescriptorRaw->u.Port.Start = ResourceDescriptor->u.Port.MinimumAddress;
- DescriptorRaw->u.Port.Length = ResourceDescriptor->u.Port.Length;
- break;
- }
- case CmResourceTypeInterrupt:
- {
- INTERFACE_TYPE BusType;
- ULONG SlotNumber;
- ULONG ret;
- UCHAR Irq;
-
- DescriptorRaw->u.Interrupt.Level = 0;
- DescriptorRaw->u.Interrupt.Vector = ResourceDescriptor->u.Interrupt.MinimumVector;
- /* FIXME: HACK: if we have a PCI device, we try
- * to keep the IRQ assigned by the BIOS */
- if (NT_SUCCESS(IoGetDeviceProperty(
- DeviceNode->PhysicalDeviceObject,
- DevicePropertyLegacyBusType,
- sizeof(INTERFACE_TYPE),
- &BusType,
- &ret)) && BusType == PCIBus)
- {
- /* We have a PCI bus */
- if (NT_SUCCESS(IoGetDeviceProperty(
- DeviceNode->PhysicalDeviceObject,
- DevicePropertyAddress,
- sizeof(ULONG),
- &SlotNumber,
- &ret)) && SlotNumber > 0)
- {
- /* We have a good slot number */
- ret = HalGetBusDataByOffset(PCIConfiguration,
- DeviceNode->ResourceRequirements->BusNumber,
- SlotNumber,
- &Irq,
- 0x3c /* PCI_INTERRUPT_LINE */,
- sizeof(UCHAR));
- if (ret != 0 && ret != 2
- && ResourceDescriptor->u.Interrupt.MinimumVector <= Irq
- && ResourceDescriptor->u.Interrupt.MaximumVector >= Irq)
- {
- /* The device already has an assigned IRQ */
- DescriptorRaw->u.Interrupt.Vector = Irq;
- }
- else
- {
- DPRINT1("Trying to assign IRQ 0x%lx to %wZ\n",
- DescriptorRaw->u.Interrupt.Vector,
- &DeviceNode->InstancePath);
- Irq = (UCHAR)DescriptorRaw->u.Interrupt.Vector;
- ret = HalSetBusDataByOffset(PCIConfiguration,
- DeviceNode->ResourceRequirements->BusNumber,
- SlotNumber,
- &Irq,
- 0x3c /* PCI_INTERRUPT_LINE */,
- sizeof(UCHAR));
- if (ret == 0 || ret == 2)
- ASSERT(FALSE);
- }
- }
- }
- break;
- }
- case CmResourceTypeMemory:
- {
- DescriptorRaw->u.Memory.Start = ResourceDescriptor->u.Memory.MinimumAddress;
- DescriptorRaw->u.Memory.Length = ResourceDescriptor->u.Memory.Length;
- break;
- }
- case CmResourceTypeDma:
- {
- DescriptorRaw->u.Dma.Channel = ResourceDescriptor->u.Dma.MinimumChannel;
- DescriptorRaw->u.Dma.Port = 0; /* FIXME */
- DescriptorRaw->u.Dma.Reserved1 = 0;
- break;
- }
- case CmResourceTypeBusNumber:
- {
- DescriptorRaw->u.BusNumber.Start = ResourceDescriptor->u.BusNumber.MinBusNumber;
- DescriptorRaw->u.BusNumber.Length = ResourceDescriptor->u.BusNumber.Length;
- DescriptorRaw->u.BusNumber.Reserved = ResourceDescriptor->u.BusNumber.Reserved;
- break;
- }
- /*CmResourceTypeDevicePrivate:
- case CmResourceTypePcCardConfig:
- case CmResourceTypeMfCardConfig:
- {
- RtlCopyMemory(
- &DescriptorRaw->u.DevicePrivate,
- &ResourceDescriptor->u.DevicePrivate,
- sizeof(ResourceDescriptor->u.DevicePrivate));
- RtlCopyMemory(
- &DescriptorTranslated->u.DevicePrivate,
- &ResourceDescriptor->u.DevicePrivate,
- sizeof(ResourceDescriptor->u.DevicePrivate));
- break;
- }*/
- default:
- DPRINT1("IopAssignDeviceResources(): unknown resource descriptor type 0x%x\n", ResourceDescriptor->Type);
- NumberOfResources--;
- }
+ *pRequiredSize = Size;
+ return STATUS_SUCCESS;
+ }
+ else
+ {
+ DPRINT1("Boot resources for %wZ cause a resource conflict!\n", &DeviceNode->InstancePath);
+ ExFreePool(DeviceNode->ResourceList);
}
-
}
- DeviceNode->ResourceList->List[0].PartialResourceList.Count = NumberOfResources;
+ Status = IopCreateResourceListFromRequirements(DeviceNode->ResourceRequirements,
+ &DeviceNode->ResourceList);
+ if (!NT_SUCCESS(Status))
+ goto ByeBye;
- Status = IopDetectResourceConflict(DeviceNode->ResourceList);
+ Size = FIELD_OFFSET(CM_RESOURCE_LIST, List);
+ for (i = 0; i < DeviceNode->ResourceList->Count; i++)
+ {
+ pPartialResourceList = &DeviceNode->ResourceList->List[i].PartialResourceList;
+ Size += FIELD_OFFSET(CM_FULL_RESOURCE_DESCRIPTOR, PartialResourceList.PartialDescriptors)
+ + pPartialResourceList->Count * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
+ }
+
+ Status = IopDetectResourceConflict(DeviceNode->ResourceList, FALSE, NULL);
if (!NT_SUCCESS(Status))
goto ByeBye;
@@ -2744,6 +2962,8 @@ IopEnumerateDetectedDevices(
PUNICODE_STRING pHardwareId;
ULONG DeviceIndex = 0;
BOOLEAN IsDeviceDesc;
+ PUCHAR CmResourceList;
+ ULONG ListCount;
if (RelativePath)
{
@@ -2858,7 +3078,7 @@ IopEnumerateDetectedDevices(
DPRINT("ExAllocatePool() failed\n");
goto nextdevice;
}
- if (ParentBootResourcesLength == 0)
+ if (ParentBootResourcesLength < sizeof(CM_FULL_RESOURCE_DESCRIPTOR))
{
RtlCopyMemory(BootResources, pValueInformation->Data, pValueInformation->DataLength);
}
@@ -3094,10 +3314,29 @@ IopEnumerateDetectedDevices(
ZwDeleteKey(hLevel2Key);
goto nextdevice;
}
- if (BootResourcesLength > 0)
+ if (BootResourcesLength >= sizeof(CM_FULL_RESOURCE_DESCRIPTOR))
{
+ CmResourceList = ExAllocatePool(PagedPool, BootResourcesLength + sizeof(ULONG));
+ if (!CmResourceList)
+ {
+ ZwClose(hLogConf);
+ ZwDeleteKey(hLevel2Key);
+ goto nextdevice;
+ }
+
+ /* Add the list count (1st member of CM_RESOURCE_LIST) */
+ ListCount = 1;
+ RtlCopyMemory(CmResourceList,
+ &ListCount,
+ sizeof(ULONG));
+
+ /* Now add the actual list (2nd member of CM_RESOURCE_LIST) */
+ RtlCopyMemory(CmResourceList + sizeof(ULONG),
+ BootResources,
+ BootResourcesLength);
+
/* Save boot resources to 'LogConf\BootConfig' */
- Status = ZwSetValueKey(hLogConf, &BootConfigU, 0, REG_FULL_RESOURCE_DESCRIPTOR, BootResources, BootResourcesLength);
+ Status = ZwSetValueKey(hLogConf, &BootConfigU, 0, REG_FULL_RESOURCE_DESCRIPTOR, CmResourceList, BootResourcesLength + sizeof(ULONG));
if (!NT_SUCCESS(Status))
{
DPRINT("ZwSetValueKey() failed with status 0x%08lx\n", Status);
@@ -3110,7 +3349,10 @@ IopEnumerateDetectedDevices(
nextdevice:
if (BootResources && BootResources != ParentBootResources)
+ {
ExFreePool(BootResources);
+ BootResources = NULL;
+ }
if (hLevel2Key)
{
ZwClose(hLevel2Key);
diff --git a/reactos/ntoskrnl/io/pnpmgr/pnproot.c b/reactos/ntoskrnl/io/pnpmgr/pnproot.c
index 80a1662b791..46df601b750 100644
--- a/reactos/ntoskrnl/io/pnpmgr/pnproot.c
+++ b/reactos/ntoskrnl/io/pnpmgr/pnproot.c
@@ -694,9 +694,13 @@ PnpRootFdoPnpControl(
break;
}
- /* Pass this IRP down to the root device PDO */
- IoSkipCurrentIrpStackLocation(Irp);
- return IoCallDriver(DeviceExtension->Ldo, Irp);
+ if (Status != STATUS_PENDING)
+ {
+ Irp->IoStatus.Status = Status;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ }
+
+ return Status;
}
static NTSTATUS
@@ -778,16 +782,16 @@ PdoQueryResources(
/* Copy existing resource requirement list */
ResourceList = ExAllocatePool(
PagedPool,
- FIELD_OFFSET(CM_RESOURCE_LIST, List) + DeviceExtension->DeviceInfo->ResourceListSize);
+ DeviceExtension->DeviceInfo->ResourceListSize);
if (!ResourceList)
return STATUS_NO_MEMORY;
- ResourceList->Count = 1;
RtlCopyMemory(
- &ResourceList->List,
+ ResourceList,
DeviceExtension->DeviceInfo->ResourceList,
DeviceExtension->DeviceInfo->ResourceListSize);
- Irp->IoStatus.Information = (ULONG_PTR)ResourceList;
+
+ Irp->IoStatus.Information = (ULONG_PTR)ResourceList;
}
return STATUS_SUCCESS;
From e0b95b05b03576f0c949213aefc95f65a6911310 Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Sun, 4 Apr 2010 01:34:33 +0000
Subject: [PATCH 026/261] - Remove a leftover debug print
svn path=/trunk/; revision=46709
---
reactos/ntoskrnl/io/pnpmgr/pnpmgr.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
index b6241070fbf..b418dd67e94 100644
--- a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
+++ b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
@@ -1574,7 +1574,6 @@ IopCreateResourceListFromRequirements(
+ ResList->Count * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
}
- DPRINT1("Allocating resource list: %d\n", Size);
*ResourceList = ExAllocatePool(PagedPool, Size);
if (!*ResourceList)
return STATUS_INSUFFICIENT_RESOURCES;
From 93c0c968c0edd066cd272c60a15c46d3a8e87fa2 Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Sun, 4 Apr 2010 02:59:31 +0000
Subject: [PATCH 027/261] [NTOSKRNL] - Remove an unused member from
PNPROOT_DEVICE - Don't build a bogus resource list if no resources are
required - Fixes a crash during resource arbitration because the created
resource requirements list was malformed
svn path=/trunk/; revision=46710
---
reactos/ntoskrnl/io/pnpmgr/pnproot.c | 50 ++++++++++------------------
1 file changed, 18 insertions(+), 32 deletions(-)
diff --git a/reactos/ntoskrnl/io/pnpmgr/pnproot.c b/reactos/ntoskrnl/io/pnpmgr/pnproot.c
index 46df601b750..63a3dd59c70 100644
--- a/reactos/ntoskrnl/io/pnpmgr/pnproot.c
+++ b/reactos/ntoskrnl/io/pnpmgr/pnproot.c
@@ -33,7 +33,6 @@ typedef struct _PNPROOT_DEVICE
UNICODE_STRING DeviceDescription;
// Resource requirement list
PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList;
- ULONG ResourceRequirementsListSize;
// Associated resource list
PCM_RESOURCE_LIST ResourceList;
ULONG ResourceListSize;
@@ -766,18 +765,7 @@ PdoQueryResources(
DeviceExtension = (PPNPROOT_PDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
- if (DeviceExtension->DeviceInfo->ResourceList == NULL)
- {
- /* Create an empty resource list */
- ResourceList = ExAllocatePool(PagedPool, sizeof(CM_RESOURCE_LIST));
- if (!ResourceList)
- return STATUS_NO_MEMORY;
-
- ResourceList->Count = 0;
-
- Irp->IoStatus.Information = (ULONG_PTR)ResourceList;
- }
- else
+ if (DeviceExtension->DeviceInfo->ResourceList)
{
/* Copy existing resource requirement list */
ResourceList = ExAllocatePool(
@@ -792,9 +780,14 @@ PdoQueryResources(
DeviceExtension->DeviceInfo->ResourceListSize);
Irp->IoStatus.Information = (ULONG_PTR)ResourceList;
- }
- return STATUS_SUCCESS;
+ return STATUS_SUCCESS;
+ }
+ else
+ {
+ /* No resources so just return without changing the status */
+ return Irp->IoStatus.Status;
+ }
}
static NTSTATUS
@@ -805,23 +798,10 @@ PdoQueryResourceRequirements(
{
PPNPROOT_PDO_DEVICE_EXTENSION DeviceExtension;
PIO_RESOURCE_REQUIREMENTS_LIST ResourceList;
- ULONG ResourceListSize = FIELD_OFFSET(IO_RESOURCE_REQUIREMENTS_LIST, List);
DeviceExtension = (PPNPROOT_PDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
- if (DeviceExtension->DeviceInfo->ResourceRequirementsList == NULL)
- {
- /* Create an empty resource list */
- ResourceList = ExAllocatePool(PagedPool, ResourceListSize);
- if (!ResourceList)
- return STATUS_NO_MEMORY;
-
- RtlZeroMemory(ResourceList, ResourceListSize);
- ResourceList->ListSize = ResourceListSize;
-
- Irp->IoStatus.Information = (ULONG_PTR)ResourceList;
- }
- else
+ if (DeviceExtension->DeviceInfo->ResourceRequirementsList)
{
/* Copy existing resource requirement list */
ResourceList = ExAllocatePool(PagedPool, DeviceExtension->DeviceInfo->ResourceRequirementsList->ListSize);
@@ -832,10 +812,16 @@ PdoQueryResourceRequirements(
ResourceList,
DeviceExtension->DeviceInfo->ResourceRequirementsList,
DeviceExtension->DeviceInfo->ResourceRequirementsList->ListSize);
- Irp->IoStatus.Information = (ULONG_PTR)ResourceList;
- }
- return STATUS_SUCCESS;
+ Irp->IoStatus.Information = (ULONG_PTR)ResourceList;
+
+ return STATUS_SUCCESS;
+ }
+ else
+ {
+ /* No resource requirements so just return without changing the status */
+ return Irp->IoStatus.Status;
+ }
}
static NTSTATUS
From 38bae887c2e33a8de6e35d091ca62b959f25d030 Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Sun, 4 Apr 2010 04:39:56 +0000
Subject: [PATCH 028/261] [NTOSKRNL] - Don't manually write a device
description for detected devices - Instead, let PnpRoot report it in response
to IRP_MN_QUERY_DEVICE_TEXT
svn path=/trunk/; revision=46711
---
reactos/ntoskrnl/io/pnpmgr/pnpmgr.c | 19 -------------------
1 file changed, 19 deletions(-)
diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
index b418dd67e94..4365dee4d90 100644
--- a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
+++ b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
@@ -2913,7 +2913,6 @@ IopEnumerateDetectedDevices(
IN ULONG ParentBootResourcesLength)
{
UNICODE_STRING IdentifierU = RTL_CONSTANT_STRING(L"Identifier");
- UNICODE_STRING DeviceDescU = RTL_CONSTANT_STRING(L"DeviceDesc");
UNICODE_STRING HardwareIDU = RTL_CONSTANT_STRING(L"HardwareID");
UNICODE_STRING ConfigurationDataU = RTL_CONSTANT_STRING(L"Configuration Data");
UNICODE_STRING BootConfigU = RTL_CONSTANT_STRING(L"BootConfig");
@@ -2960,7 +2959,6 @@ IopEnumerateDetectedDevices(
UNICODE_STRING HardwareIdKey;
PUNICODE_STRING pHardwareId;
ULONG DeviceIndex = 0;
- BOOLEAN IsDeviceDesc;
PUCHAR CmResourceList;
ULONG ListCount;
@@ -3189,31 +3187,26 @@ IopEnumerateDetectedDevices(
{
pHardwareId = &HardwareIdSerial;
DeviceIndex = DeviceIndexSerial++;
- IsDeviceDesc = TRUE;
}
else if (RelativePath && RtlCompareUnicodeString(RelativePath, &IdentifierKeyboard, FALSE) == 0)
{
pHardwareId = &HardwareIdKeyboard;
DeviceIndex = DeviceIndexKeyboard++;
- IsDeviceDesc = FALSE;
}
else if (RelativePath && RtlCompareUnicodeString(RelativePath, &IdentifierMouse, FALSE) == 0)
{
pHardwareId = &HardwareIdMouse;
DeviceIndex = DeviceIndexMouse++;
- IsDeviceDesc = FALSE;
}
else if (RelativePath && RtlCompareUnicodeString(RelativePath, &IdentifierParallel, FALSE) == 0)
{
pHardwareId = &HardwareIdParallel;
DeviceIndex = DeviceIndexParallel++;
- IsDeviceDesc = FALSE;
}
else if (RelativePath && RtlCompareUnicodeString(RelativePath, &IdentifierFloppy, FALSE) == 0)
{
pHardwareId = &HardwareIdFloppy;
DeviceIndex = DeviceIndexFloppy++;
- IsDeviceDesc = FALSE;
}
else if (NT_SUCCESS(Status))
{
@@ -3222,13 +3215,11 @@ IopEnumerateDetectedDevices(
{
pHardwareId = &HardwareIdPci;
DeviceIndex = DeviceIndexPci++;
- IsDeviceDesc = FALSE;
}
else if (RtlCompareUnicodeString(&ValueName, &IdentifierIsa, FALSE) == 0)
{
pHardwareId = &HardwareIdIsa;
DeviceIndex = DeviceIndexIsa++;
- IsDeviceDesc = FALSE;
}
else
{
@@ -3280,16 +3271,6 @@ IopEnumerateDetectedDevices(
goto nextdevice;
}
DPRINT("Found %wZ #%lu (%wZ)\n", &ValueName, DeviceIndex, &HardwareIdKey);
- if (IsDeviceDesc)
- {
- Status = ZwSetValueKey(hLevel2Key, &DeviceDescU, 0, REG_SZ, ValueName.Buffer, ValueName.MaximumLength);
- if (!NT_SUCCESS(Status))
- {
- DPRINT("ZwSetValueKey() failed with status 0x%08lx\n", Status);
- ZwDeleteKey(hLevel2Key);
- goto nextdevice;
- }
- }
Status = ZwSetValueKey(hLevel2Key, &HardwareIDU, 0, REG_MULTI_SZ, pHardwareId->Buffer, pHardwareId->MaximumLength);
if (!NT_SUCCESS(Status))
{
From 141ca81c828cb2371153d4a6221505b61914b716 Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Sun, 4 Apr 2010 05:17:29 +0000
Subject: [PATCH 029/261] [NTOSKRNL] - Fix the type passed to ZwSetValueKey
svn path=/trunk/; revision=46712
---
reactos/ntoskrnl/io/pnpmgr/pnpmgr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
index 4365dee4d90..5d6c13336bc 100644
--- a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
+++ b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
@@ -3316,7 +3316,7 @@ IopEnumerateDetectedDevices(
BootResourcesLength);
/* Save boot resources to 'LogConf\BootConfig' */
- Status = ZwSetValueKey(hLogConf, &BootConfigU, 0, REG_FULL_RESOURCE_DESCRIPTOR, CmResourceList, BootResourcesLength + sizeof(ULONG));
+ Status = ZwSetValueKey(hLogConf, &BootConfigU, 0, REG_RESOURCE_LIST, CmResourceList, BootResourcesLength + sizeof(ULONG));
if (!NT_SUCCESS(Status))
{
DPRINT("ZwSetValueKey() failed with status 0x%08lx\n", Status);
From 2af6abad95a0f249a58ed39ea58425a2667af6aa Mon Sep 17 00:00:00 2001
From: Eric Kohl
Date: Sun, 4 Apr 2010 12:34:53 +0000
Subject: [PATCH 030/261] [NTOSKRNL] Ignore inherit only ACEs in a DACL.
svn path=/trunk/; revision=46714
---
reactos/ntoskrnl/se/semgr.c | 94 ++++++++++++++++++++-----------------
1 file changed, 50 insertions(+), 44 deletions(-)
diff --git a/reactos/ntoskrnl/se/semgr.c b/reactos/ntoskrnl/se/semgr.c
index 6792180c5b5..0cb0da49e07 100644
--- a/reactos/ntoskrnl/se/semgr.c
+++ b/reactos/ntoskrnl/se/semgr.c
@@ -485,7 +485,7 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
{
*GrantedAccess = DesiredAccess | PreviouslyGrantedAccess;
}
-
+
*AccessStatus = STATUS_SUCCESS;
return TRUE;
}
@@ -547,34 +547,37 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
CurrentAce = (PACE)(Dacl + 1);
for (i = 0; i < Dacl->AceCount; i++)
{
- Sid = (PSID)(CurrentAce + 1);
- if (CurrentAce->Header.AceType == ACCESS_DENIED_ACE_TYPE)
+ if (!(CurrentAce->Header.AceFlags & INHERIT_ONLY_ACE))
{
- if (SepSidInToken(Token, Sid))
+ Sid = (PSID)(CurrentAce + 1);
+ if (CurrentAce->Header.AceType == ACCESS_DENIED_ACE_TYPE)
{
- /* Map access rights from the ACE */
- TempAccess = CurrentAce->AccessMask;
- RtlMapGenericMask(&TempAccess, GenericMapping);
+ if (SepSidInToken(Token, Sid))
+ {
+ /* Map access rights from the ACE */
+ TempAccess = CurrentAce->AccessMask;
+ RtlMapGenericMask(&TempAccess, GenericMapping);
- /* Deny access rights that have not been granted yet */
- TempDeniedAccess |= (TempAccess & ~TempGrantedAccess);
+ /* Deny access rights that have not been granted yet */
+ TempDeniedAccess |= (TempAccess & ~TempGrantedAccess);
+ }
}
- }
- else if (CurrentAce->Header.AceType == ACCESS_ALLOWED_ACE_TYPE)
- {
- if (SepSidInToken(Token, Sid))
+ else if (CurrentAce->Header.AceType == ACCESS_ALLOWED_ACE_TYPE)
{
- /* Map access rights from the ACE */
- TempAccess = CurrentAce->AccessMask;
- RtlMapGenericMask(&TempAccess, GenericMapping);
+ if (SepSidInToken(Token, Sid))
+ {
+ /* Map access rights from the ACE */
+ TempAccess = CurrentAce->AccessMask;
+ RtlMapGenericMask(&TempAccess, GenericMapping);
- /* Grant access rights that have not been denied yet */
- TempGrantedAccess |= (TempAccess & ~TempDeniedAccess);
+ /* Grant access rights that have not been denied yet */
+ TempGrantedAccess |= (TempAccess & ~TempDeniedAccess);
+ }
+ }
+ else
+ {
+ DPRINT1("Unsupported ACE type 0x%lx\n", CurrentAce->Header.AceType);
}
- }
- else
- {
- DPRINT1("Unsupported ACE type 0x%lx\n", CurrentAce->Header.AceType);
}
/* Get the next ACE */
@@ -608,35 +611,38 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
CurrentAce = (PACE)(Dacl + 1);
for (i = 0; i < Dacl->AceCount; i++)
{
- Sid = (PSID)(CurrentAce + 1);
- if (CurrentAce->Header.AceType == ACCESS_DENIED_ACE_TYPE)
+ if (!(CurrentAce->Header.AceFlags & INHERIT_ONLY_ACE))
{
- if (SepSidInToken(Token, Sid))
+ Sid = (PSID)(CurrentAce + 1);
+ if (CurrentAce->Header.AceType == ACCESS_DENIED_ACE_TYPE)
{
- /* Map access rights from the ACE */
- TempAccess = CurrentAce->AccessMask;
- RtlMapGenericMask(&TempAccess, GenericMapping);
+ if (SepSidInToken(Token, Sid))
+ {
+ /* Map access rights from the ACE */
+ TempAccess = CurrentAce->AccessMask;
+ RtlMapGenericMask(&TempAccess, GenericMapping);
- /* Leave if a remaining right must be denied */
- if (RemainingAccess & TempAccess)
- break;
+ /* Leave if a remaining right must be denied */
+ if (RemainingAccess & TempAccess)
+ break;
+ }
}
- }
- else if (CurrentAce->Header.AceType == ACCESS_ALLOWED_ACE_TYPE)
- {
- if (SepSidInToken(Token, Sid))
+ else if (CurrentAce->Header.AceType == ACCESS_ALLOWED_ACE_TYPE)
{
- /* Map access rights from the ACE */
- TempAccess = CurrentAce->AccessMask;
- RtlMapGenericMask(&TempAccess, GenericMapping);
+ if (SepSidInToken(Token, Sid))
+ {
+ /* Map access rights from the ACE */
+ TempAccess = CurrentAce->AccessMask;
+ RtlMapGenericMask(&TempAccess, GenericMapping);
- /* Remove granted rights */
- RemainingAccess &= ~TempAccess;
+ /* Remove granted rights */
+ RemainingAccess &= ~TempAccess;
+ }
+ }
+ else
+ {
+ DPRINT1("Unsupported ACE type 0x%lx\n", CurrentAce->Header.AceType);
}
- }
- else
- {
- DPRINT1("Unsupported ACE type 0x%lx\n", CurrentAce->Header.AceType);
}
/* Get the next ACE */
From 917fa8ad1403f5c558ed8e51343bc7fe73f74ea5 Mon Sep 17 00:00:00 2001
From: Aleksey Bragin
Date: Sun, 4 Apr 2010 13:43:56 +0000
Subject: [PATCH 031/261] [UNIATA] - Adjust timings in WaitOnBaseBusy,
WaitForDrq, WaitShortForDrq to match old atapi driver. Thanks Caemyr for
testing and finding optimal values (which are slightly below the values used
in this commit). The proper solution would be to implement adaptive delays
scaling. See issue #4995 for more details.
svn path=/trunk/; revision=46716
---
reactos/drivers/storage/ide/uniata/id_ata.cpp | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/reactos/drivers/storage/ide/uniata/id_ata.cpp b/reactos/drivers/storage/ide/uniata/id_ata.cpp
index 1cace8bd488..fb2bb028e87 100644
--- a/reactos/drivers/storage/ide/uniata/id_ata.cpp
+++ b/reactos/drivers/storage/ide/uniata/id_ata.cpp
@@ -537,10 +537,10 @@ WaitOnBaseBusy(
{
ULONG i;
UCHAR Status;
- for (i=0; i<200; i++) {
+ for (i=0; i<20000; i++) {
GetBaseStatus(chan, Status);
if (Status & IDE_STATUS_BUSY) {
- AtapiStallExecution(10);
+ AtapiStallExecution(150);
continue;
} else {
break;
@@ -640,11 +640,11 @@ WaitForDrq(
for (i=0; i<1000; i++) {
GetStatus(chan, Status);
if (Status & IDE_STATUS_BUSY) {
- AtapiStallExecution(10);
+ AtapiStallExecution(100);
} else if (Status & IDE_STATUS_DRQ) {
break;
} else {
- AtapiStallExecution(10);
+ AtapiStallExecution(200);
}
}
return Status;
@@ -661,11 +661,11 @@ WaitShortForDrq(
for (i=0; i<2; i++) {
GetStatus(chan, Status);
if (Status & IDE_STATUS_BUSY) {
- AtapiStallExecution(10);
+ AtapiStallExecution(100);
} else if (Status & IDE_STATUS_DRQ) {
break;
} else {
- AtapiStallExecution(10);
+ AtapiStallExecution(100);
}
}
return Status;
From 08f73a5234653d09e1021967615dc63a761c4a6e Mon Sep 17 00:00:00 2001
From: Aleksey Bragin
Date: Sun, 4 Apr 2010 13:47:45 +0000
Subject: [PATCH 032/261] - Sync user32 and gdi32 winetests to Wine-1.1.42.
svn path=/trunk/; revision=46717
---
rostests/winetests/user32/combo.c | 2 +-
rostests/winetests/user32/cursoricon.c | 265 ++++++++++++++++++++++++-
rostests/winetests/user32/menu.c | 2 +-
rostests/winetests/user32/msg.c | 8 +-
rostests/winetests/user32/scroll.c | 16 +-
rostests/winetests/user32/win.c | 64 +++++-
6 files changed, 339 insertions(+), 18 deletions(-)
diff --git a/rostests/winetests/user32/combo.c b/rostests/winetests/user32/combo.c
index bee685cb3ea..faf2145b833 100644
--- a/rostests/winetests/user32/combo.c
+++ b/rostests/winetests/user32/combo.c
@@ -461,7 +461,7 @@ static void test_editselection(void)
ok(LOWORD(len)==1, "Unexpected start position for selection %d\n", LOWORD(len));
ok(HIWORD(len)==1, "Unexpected end position for selection %d\n", HIWORD(len));
- /* Now what happens when it gets more focus a second time - it doesnt reselect */
+ /* Now what happens when it gets more focus a second time - it doesn't reselect */
SendMessage(hCombo, WM_SETFOCUS, 0, (LPARAM)hEdit);
len = SendMessage(hCombo, CB_GETEDITSEL, 0,0);
ok(LOWORD(len)==1, "Unexpected start position for selection %d\n", LOWORD(len));
diff --git a/rostests/winetests/user32/cursoricon.c b/rostests/winetests/user32/cursoricon.c
index ff86cd0d1ab..8534875b631 100644
--- a/rostests/winetests/user32/cursoricon.c
+++ b/rostests/winetests/user32/cursoricon.c
@@ -64,6 +64,8 @@ static HANDLE child_process;
#define PROC_INIT (WM_USER+1)
+static BOOL (WINAPI *pGetCursorInfo)(CURSORINFO *);
+
static LRESULT CALLBACK callback_child(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
BOOL ret;
@@ -961,7 +963,7 @@ static HICON create_test_icon(HDC hdc, int width, int height, int bpp,
{
ICONINFO iconInfo;
BITMAPINFO bitmapInfo;
- UINT32 *buffer = NULL;
+ void *buffer = NULL;
UINT32 mask = maskvalue ? 0xFFFFFFFF : 0x00000000;
memset(&bitmapInfo, 0, sizeof(bitmapInfo));
@@ -980,7 +982,7 @@ static HICON create_test_icon(HDC hdc, int width, int height, int bpp,
iconInfo.hbmMask = CreateBitmap( width, height, 1, 1, &mask );
if(!iconInfo.hbmMask) return NULL;
- iconInfo.hbmColor = CreateDIBSection(hdc, &bitmapInfo, DIB_RGB_COLORS, (void**)&buffer, NULL, 0);
+ iconInfo.hbmColor = CreateDIBSection(hdc, &bitmapInfo, DIB_RGB_COLORS, &buffer, NULL, 0);
if(!iconInfo.hbmColor || !buffer)
{
DeleteObject(iconInfo.hbmMask);
@@ -1072,7 +1074,7 @@ static void test_DrawIcon(void)
HDC hdcDst = NULL;
HBITMAP bmpDst = NULL;
HBITMAP bmpOld = NULL;
- UINT32 *bits = 0;
+ void *bits = 0;
hdcDst = CreateCompatibleDC(0);
ok(hdcDst != 0, "CreateCompatibleDC(0) failed to return a valid DC\n");
@@ -1094,7 +1096,7 @@ static void test_DrawIcon(void)
bitmapInfo.bmiHeader.biCompression = BI_RGB;
bitmapInfo.bmiHeader.biSizeImage = sizeof(UINT32);
- bmpDst = CreateDIBSection(hdcDst, &bitmapInfo, DIB_RGB_COLORS, (void**)&bits, NULL, 0);
+ bmpDst = CreateDIBSection(hdcDst, &bitmapInfo, DIB_RGB_COLORS, &bits, NULL, 0);
ok (bmpDst && bits, "CreateDIBSection failed to return a valid bitmap and buffer\n");
if (!bmpDst || !bits)
goto cleanup;
@@ -1156,7 +1158,7 @@ static void test_DrawIconEx(void)
HDC hdcDst = NULL;
HBITMAP bmpDst = NULL;
HBITMAP bmpOld = NULL;
- UINT32 bits = 0;
+ void *bits = 0;
hdcDst = CreateCompatibleDC(0);
ok(hdcDst != 0, "CreateCompatibleDC(0) failed to return a valid DC\n");
@@ -1177,7 +1179,7 @@ static void test_DrawIconEx(void)
bitmapInfo.bmiHeader.biPlanes = 1;
bitmapInfo.bmiHeader.biCompression = BI_RGB;
bitmapInfo.bmiHeader.biSizeImage = sizeof(UINT32);
- bmpDst = CreateDIBSection(hdcDst, &bitmapInfo, DIB_RGB_COLORS, (void**)&bits, NULL, 0);
+ bmpDst = CreateDIBSection(hdcDst, &bitmapInfo, DIB_RGB_COLORS, &bits, NULL, 0);
ok (bmpDst && bits, "CreateDIBSection failed to return a valid bitmap and buffer\n");
if (!bmpDst || !bits)
goto cleanup;
@@ -1308,7 +1310,7 @@ static void test_DrawState(void)
HDC hdcDst = NULL;
HBITMAP bmpDst = NULL;
HBITMAP bmpOld = NULL;
- UINT32 bits = 0;
+ void *bits = 0;
hdcDst = CreateCompatibleDC(0);
ok(hdcDst != 0, "CreateCompatibleDC(0) failed to return a valid DC\n");
@@ -1329,7 +1331,7 @@ static void test_DrawState(void)
bitmapInfo.bmiHeader.biPlanes = 1;
bitmapInfo.bmiHeader.biCompression = BI_RGB;
bitmapInfo.bmiHeader.biSizeImage = sizeof(UINT32);
- bmpDst = CreateDIBSection(hdcDst, &bitmapInfo, DIB_RGB_COLORS, (void**)&bits, NULL, 0);
+ bmpDst = CreateDIBSection(hdcDst, &bitmapInfo, DIB_RGB_COLORS, &bits, NULL, 0);
ok (bmpDst && bits, "CreateDIBSection failed to return a valid bitmap and buffer\n");
if (!bmpDst || !bits)
goto cleanup;
@@ -1353,6 +1355,250 @@ cleanup:
DeleteDC(hdcDst);
}
+static DWORD parent_id;
+
+static DWORD CALLBACK set_cursor_thread( void *arg )
+{
+ HCURSOR ret;
+
+ PeekMessage( 0, 0, 0, 0, PM_NOREMOVE ); /* create a msg queue */
+ if (parent_id)
+ {
+ BOOL ret = AttachThreadInput( GetCurrentThreadId(), parent_id, TRUE );
+ ok( ret, "AttachThreadInput failed\n" );
+ }
+ if (arg) ret = SetCursor( (HCURSOR)arg );
+ else ret = GetCursor();
+ return (DWORD_PTR)ret;
+}
+
+static void test_SetCursor(void)
+{
+ static const BYTE bmp_bits[4096];
+ ICONINFO cursorInfo;
+ HCURSOR cursor, old_cursor, global_cursor = 0;
+ DWORD error, id, result;
+ UINT display_bpp;
+ HDC hdc;
+ HANDLE thread;
+ CURSORINFO info;
+
+ if (pGetCursorInfo)
+ {
+ memset( &info, 0, sizeof(info) );
+ info.cbSize = sizeof(info);
+ if (!pGetCursorInfo( &info ))
+ {
+ win_skip( "GetCursorInfo not working\n" );
+ pGetCursorInfo = NULL;
+ }
+ else global_cursor = info.hCursor;
+ }
+ cursor = GetCursor();
+ thread = CreateThread( NULL, 0, set_cursor_thread, 0, 0, &id );
+ WaitForSingleObject( thread, 1000 );
+ GetExitCodeThread( thread, &result );
+ ok( result == (DWORD_PTR)cursor, "wrong thread cursor %x/%p\n", result, cursor );
+
+ hdc = GetDC(0);
+ display_bpp = GetDeviceCaps(hdc, BITSPIXEL);
+ ReleaseDC(0, hdc);
+
+ cursorInfo.fIcon = FALSE;
+ cursorInfo.xHotspot = 0;
+ cursorInfo.yHotspot = 0;
+ cursorInfo.hbmMask = CreateBitmap(32, 32, 1, 1, bmp_bits);
+ cursorInfo.hbmColor = CreateBitmap(32, 32, 1, display_bpp, bmp_bits);
+
+ cursor = CreateIconIndirect(&cursorInfo);
+ ok(cursor != NULL, "CreateIconIndirect returned %p\n", cursor);
+ old_cursor = SetCursor( cursor );
+
+ if (pGetCursorInfo)
+ {
+ info.cbSize = sizeof(info);
+ ok( pGetCursorInfo( &info ), "GetCursorInfo failed\n" );
+ /* global cursor doesn't change since we don't have a window */
+ ok( info.hCursor == global_cursor || broken(info.hCursor != cursor), /* win9x */
+ "wrong info cursor %p/%p\n", info.hCursor, global_cursor );
+ }
+ thread = CreateThread( NULL, 0, set_cursor_thread, 0, 0, &id );
+ WaitForSingleObject( thread, 1000 );
+ GetExitCodeThread( thread, &result );
+ ok( result == (DWORD_PTR)old_cursor, "wrong thread cursor %x/%p\n", result, old_cursor );
+
+ SetCursor( 0 );
+ ok( GetCursor() == 0, "wrong cursor %p\n", GetCursor() );
+ thread = CreateThread( NULL, 0, set_cursor_thread, 0, 0, &id );
+ WaitForSingleObject( thread, 1000 );
+ GetExitCodeThread( thread, &result );
+ ok( result == (DWORD_PTR)old_cursor, "wrong thread cursor %x/%p\n", result, old_cursor );
+
+ thread = CreateThread( NULL, 0, set_cursor_thread, cursor, 0, &id );
+ WaitForSingleObject( thread, 1000 );
+ GetExitCodeThread( thread, &result );
+ ok( result == (DWORD_PTR)old_cursor, "wrong thread cursor %x/%p\n", result, old_cursor );
+ ok( GetCursor() == 0, "wrong cursor %p/0\n", GetCursor() );
+
+ parent_id = GetCurrentThreadId();
+ thread = CreateThread( NULL, 0, set_cursor_thread, cursor, 0, &id );
+ WaitForSingleObject( thread, 1000 );
+ GetExitCodeThread( thread, &result );
+ ok( result == (DWORD_PTR)old_cursor, "wrong thread cursor %x/%p\n", result, old_cursor );
+ ok( GetCursor() == cursor, "wrong cursor %p/0\n", cursor );
+
+ if (pGetCursorInfo)
+ {
+ info.cbSize = sizeof(info);
+ ok( pGetCursorInfo( &info ), "GetCursorInfo failed\n" );
+ ok( info.hCursor == global_cursor || broken(info.hCursor != cursor), /* win9x */
+ "wrong info cursor %p/%p\n", info.hCursor, global_cursor );
+ }
+ SetCursor( old_cursor );
+ DestroyCursor( cursor );
+
+ SetLastError( 0xdeadbeef );
+ cursor = SetCursor( (HCURSOR)0xbadbad );
+ error = GetLastError();
+ ok( cursor == 0, "wrong cursor %p/0\n", cursor );
+ ok( error == ERROR_INVALID_CURSOR_HANDLE || broken( error == 0xdeadbeef ), /* win9x */
+ "wrong error %u\n", error );
+
+ if (pGetCursorInfo)
+ {
+ info.cbSize = sizeof(info);
+ ok( pGetCursorInfo( &info ), "GetCursorInfo failed\n" );
+ ok( info.hCursor == global_cursor || broken(info.hCursor != cursor), /* win9x */
+ "wrong info cursor %p/%p\n", info.hCursor, global_cursor );
+ }
+}
+
+static HANDLE event_start, event_next;
+
+static DWORD CALLBACK show_cursor_thread( void *arg )
+{
+ DWORD count = (DWORD_PTR)arg;
+ int ret;
+
+ PeekMessage( 0, 0, 0, 0, PM_NOREMOVE ); /* create a msg queue */
+ if (parent_id)
+ {
+ BOOL ret = AttachThreadInput( GetCurrentThreadId(), parent_id, TRUE );
+ ok( ret, "AttachThreadInput failed\n" );
+ }
+ if (!count) ret = ShowCursor( FALSE );
+ else while (count--) ret = ShowCursor( TRUE );
+ SetEvent( event_start );
+ WaitForSingleObject( event_next, 2000 );
+ return ret;
+}
+
+static void test_ShowCursor(void)
+{
+ int count;
+ DWORD id, result;
+ HANDLE thread;
+ CURSORINFO info;
+
+ if (pGetCursorInfo)
+ {
+ memset( &info, 0, sizeof(info) );
+ info.cbSize = sizeof(info);
+ ok( pGetCursorInfo( &info ), "GetCursorInfo failed\n" );
+ ok( info.flags & CURSOR_SHOWING, "cursor not shown in info\n" );
+ }
+
+ event_start = CreateEvent( NULL, FALSE, FALSE, NULL );
+ event_next = CreateEvent( NULL, FALSE, FALSE, NULL );
+
+ count = ShowCursor( TRUE );
+ ok( count == 1, "wrong count %d\n", count );
+ count = ShowCursor( TRUE );
+ ok( count == 2, "wrong count %d\n", count );
+ count = ShowCursor( FALSE );
+ ok( count == 1, "wrong count %d\n", count );
+ count = ShowCursor( FALSE );
+ ok( count == 0, "wrong count %d\n", count );
+ count = ShowCursor( FALSE );
+ ok( count == -1, "wrong count %d\n", count );
+ count = ShowCursor( FALSE );
+ ok( count == -2, "wrong count %d\n", count );
+
+ if (pGetCursorInfo)
+ {
+ info.cbSize = sizeof(info);
+ ok( pGetCursorInfo( &info ), "GetCursorInfo failed\n" );
+ /* global show count is not affected since we don't have a window */
+ ok( info.flags & CURSOR_SHOWING, "cursor not shown in info\n" );
+ }
+
+ parent_id = 0;
+ thread = CreateThread( NULL, 0, show_cursor_thread, NULL, 0, &id );
+ WaitForSingleObject( event_start, 1000 );
+ count = ShowCursor( FALSE );
+ ok( count == -3, "wrong count %d\n", count );
+ SetEvent( event_next );
+ WaitForSingleObject( thread, 1000 );
+ GetExitCodeThread( thread, &result );
+ ok( result == -1, "wrong thread count %d\n", result );
+ count = ShowCursor( FALSE );
+ ok( count == -4, "wrong count %d\n", count );
+
+ thread = CreateThread( NULL, 0, show_cursor_thread, (void *)1, 0, &id );
+ WaitForSingleObject( event_start, 1000 );
+ count = ShowCursor( TRUE );
+ ok( count == -3, "wrong count %d\n", count );
+ SetEvent( event_next );
+ WaitForSingleObject( thread, 1000 );
+ GetExitCodeThread( thread, &result );
+ ok( result == 1, "wrong thread count %d\n", result );
+ count = ShowCursor( TRUE );
+ ok( count == -2, "wrong count %d\n", count );
+
+ parent_id = GetCurrentThreadId();
+ thread = CreateThread( NULL, 0, show_cursor_thread, NULL, 0, &id );
+ WaitForSingleObject( event_start, 1000 );
+ count = ShowCursor( TRUE );
+ ok( count == -2, "wrong count %d\n", count );
+ SetEvent( event_next );
+ WaitForSingleObject( thread, 1000 );
+ GetExitCodeThread( thread, &result );
+ ok( result == -3, "wrong thread count %d\n", result );
+ count = ShowCursor( FALSE );
+ ok( count == -2, "wrong count %d\n", count );
+
+ thread = CreateThread( NULL, 0, show_cursor_thread, (void *)3, 0, &id );
+ WaitForSingleObject( event_start, 1000 );
+ count = ShowCursor( TRUE );
+ ok( count == 2, "wrong count %d\n", count );
+ SetEvent( event_next );
+ WaitForSingleObject( thread, 1000 );
+ GetExitCodeThread( thread, &result );
+ ok( result == 1, "wrong thread count %d\n", result );
+ count = ShowCursor( FALSE );
+ ok( count == -2, "wrong count %d\n", count );
+
+ if (pGetCursorInfo)
+ {
+ info.cbSize = sizeof(info);
+ ok( pGetCursorInfo( &info ), "GetCursorInfo failed\n" );
+ ok( info.flags & CURSOR_SHOWING, "cursor not shown in info\n" );
+ }
+
+ count = ShowCursor( TRUE );
+ ok( count == -1, "wrong count %d\n", count );
+ count = ShowCursor( TRUE );
+ ok( count == 0, "wrong count %d\n", count );
+
+ if (pGetCursorInfo)
+ {
+ info.cbSize = sizeof(info);
+ ok( pGetCursorInfo( &info ), "GetCursorInfo failed\n" );
+ ok( info.flags & CURSOR_SHOWING, "cursor not shown in info\n" );
+ }
+}
+
+
static void test_DestroyCursor(void)
{
static const BYTE bmp_bits[4096];
@@ -1435,6 +1681,7 @@ static void test_DestroyCursor(void)
START_TEST(cursoricon)
{
+ pGetCursorInfo = (void *)GetProcAddress( GetModuleHandleA("user32.dll"), "GetCursorInfo" );
test_argc = winetest_get_mainargs(&test_argv);
if (test_argc >= 3)
@@ -1463,6 +1710,8 @@ START_TEST(cursoricon)
test_DrawIcon();
test_DrawIconEx();
test_DrawState();
+ test_SetCursor();
+ test_ShowCursor();
test_DestroyCursor();
do_parent();
test_child_process();
diff --git a/rostests/winetests/user32/menu.c b/rostests/winetests/user32/menu.c
index 8c49c2d5fdc..761d70c7a2f 100755
--- a/rostests/winetests/user32/menu.c
+++ b/rostests/winetests/user32/menu.c
@@ -3218,7 +3218,7 @@ START_TEST(menu)
test_menu_hilitemenuitem();
test_menu_trackpopupmenu();
-// test_menu_cancelmode();
+ test_menu_cancelmode();
test_menu_maxdepth();
test_menu_circref();
}
diff --git a/rostests/winetests/user32/msg.c b/rostests/winetests/user32/msg.c
index 23e990ee96c..714e57f4bcb 100755
--- a/rostests/winetests/user32/msg.c
+++ b/rostests/winetests/user32/msg.c
@@ -12434,17 +12434,17 @@ START_TEST(msg)
test_quit_message();
test_SetActiveWindow();
-// if (!pTrackMouseEvent)
+ if (!pTrackMouseEvent)
win_skip("TrackMouseEvent is not available\n");
-// else
-// test_TrackMouseEvent();
+ else
+ test_TrackMouseEvent();
test_SetWindowRgn();
test_sys_menu();
test_dialog_messages();
test_nullCallback();
test_dbcs_wm_char();
-// test_menu_messages();
+ test_menu_messages();
test_paintingloop();
test_defwinproc();
test_clipboard_viewers();
diff --git a/rostests/winetests/user32/scroll.c b/rostests/winetests/user32/scroll.c
index 0695639a458..e3f6938129c 100644
--- a/rostests/winetests/user32/scroll.c
+++ b/rostests/winetests/user32/scroll.c
@@ -42,12 +42,25 @@ static LRESULT CALLBACK MyWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
case WM_DESTROY:
PostQuitMessage(0);
break;
-
+ case WM_HSCROLL:
+ case WM_VSCROLL:
+ /* stop tracking */
+ ReleaseCapture();
+ return 0;
default:
return DefWindowProcA(hWnd, msg, wParam, lParam);
}
return 0;
}
+static void scrollbar_test_track(void)
+{
+ /* test that scrollbar tracking is terminated when
+ * the control looses mouse capture */
+ SendMessage( hScroll, WM_LBUTTONDOWN, 0, MAKELPARAM( 1, 1));
+ /* a normal return from the sendmessage */
+ /* not normal for instance by closing the windws */
+ ok( IsWindow( hScroll), "Scrollbar has gone!\n");
+}
static void scrollbar_test1(void)
{
@@ -420,6 +433,7 @@ START_TEST ( scroll )
scrollbar_test2();
scrollbar_test3();
scrollbar_test4();
+ scrollbar_test_track();
/* Some test results vary depending of theming being active or not */
hUxtheme = LoadLibraryA("uxtheme.dll");
diff --git a/rostests/winetests/user32/win.c b/rostests/winetests/user32/win.c
index cc41bae8032..96033a2746c 100644
--- a/rostests/winetests/user32/win.c
+++ b/rostests/winetests/user32/win.c
@@ -2476,10 +2476,39 @@ static void test_SetActiveWindow(HWND hwnd)
check_wnd_state(hwnd, hwnd, hwnd, 0);
}
+struct create_window_thread_params
+{
+ HWND window;
+ HANDLE window_created;
+ HANDLE test_finished;
+};
+
+static DWORD WINAPI create_window_thread(void *param)
+{
+ struct create_window_thread_params *p = param;
+ DWORD res;
+ BOOL ret;
+
+ p->window = CreateWindowA("static", NULL, WS_POPUP | WS_VISIBLE, 0, 0, 0, 0, 0, 0, 0, 0);
+
+ ret = SetEvent(p->window_created);
+ ok(ret, "SetEvent failed, last error %#x.\n", GetLastError());
+
+ res = WaitForSingleObject(p->test_finished, INFINITE);
+ ok(res == WAIT_OBJECT_0, "Wait failed (%#x), last error %#x.\n", res, GetLastError());
+
+ DestroyWindow(p->window);
+ return 0;
+}
+
static void test_SetForegroundWindow(HWND hwnd)
{
+ struct create_window_thread_params thread_params;
+ HANDLE thread;
+ DWORD res, tid;
BOOL ret;
HWND hwnd2;
+ MSG msg;
flush_events( TRUE );
ShowWindow(hwnd, SW_HIDE);
@@ -2552,6 +2581,34 @@ static void test_SetForegroundWindow(HWND hwnd)
DestroyWindow(hwnd2);
check_wnd_state(hwnd, hwnd, hwnd, 0);
+
+ hwnd2 = CreateWindowA("static", NULL, WS_POPUP | WS_VISIBLE, 0, 0, 0, 0, 0, 0, 0, 0);
+ check_wnd_state(hwnd2, hwnd2, hwnd2, 0);
+
+ thread_params.window_created = CreateEvent(NULL, FALSE, FALSE, NULL);
+ ok(!!thread_params.window_created, "CreateEvent failed, last error %#x.\n", GetLastError());
+ thread_params.test_finished = CreateEvent(NULL, FALSE, FALSE, NULL);
+ ok(!!thread_params.test_finished, "CreateEvent failed, last error %#x.\n", GetLastError());
+ thread = CreateThread(NULL, 0, create_window_thread, &thread_params, 0, &tid);
+ ok(!!thread, "Failed to create thread, last error %#x.\n", GetLastError());
+ res = WaitForSingleObject(thread_params.window_created, INFINITE);
+ ok(res == WAIT_OBJECT_0, "Wait failed (%#x), last error %#x.\n", res, GetLastError());
+ check_wnd_state(hwnd2, thread_params.window, hwnd2, 0);
+
+ SetForegroundWindow(hwnd2);
+ check_wnd_state(hwnd2, hwnd2, hwnd2, 0);
+
+ while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
+ if (0) check_wnd_state(hwnd2, hwnd2, hwnd2, 0);
+ todo_wine ok(GetActiveWindow() == hwnd2, "Expected active window %p, got %p.\n", hwnd2, GetActiveWindow());
+ todo_wine ok(GetFocus() == hwnd2, "Expected focus window %p, got %p.\n", hwnd2, GetFocus());
+
+ SetEvent(thread_params.test_finished);
+ WaitForSingleObject(thread, INFINITE);
+ CloseHandle(thread_params.test_finished);
+ CloseHandle(thread_params.window_created);
+ CloseHandle(thread);
+ DestroyWindow(hwnd2);
}
static WNDPROC old_button_proc;
@@ -2953,7 +3010,7 @@ static void test_mouse_input(HWND hwnd)
BOOL ret;
LRESULT res;
- ShowWindow(hwnd, SW_SHOW);
+ ShowWindow(hwnd, SW_SHOWNORMAL);
UpdateWindow(hwnd);
SetWindowPos( hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE );
@@ -5161,6 +5218,7 @@ static void run_NCRedrawLoop(UINT flags)
NULL, NULL, 0, &flags);
ShowWindow(hwnd, SW_SHOW);
UpdateWindow(hwnd);
+ flush_events( FALSE );
while(PeekMessage(&msg, hwnd, 0, 0, PM_REMOVE) != 0)
{
if (msg.message == WM_PAINT) loopcount++;
@@ -5979,7 +6037,7 @@ START_TEST(win)
test_capture_1();
test_capture_2();
test_capture_3(hwndMain, hwndMain2);
-// test_capture_4();
+ test_capture_4();
test_CreateWindow();
test_parent_owner();
@@ -6019,7 +6077,7 @@ START_TEST(win)
test_layered_window();
test_SetForegroundWindow(hwndMain);
-// test_shell_window();
+ test_shell_window();
test_handles( hwndMain );
test_winregion();
From 4525984fb0db81838bc0cf243275f5d232701cbe Mon Sep 17 00:00:00 2001
From: Gregor Schneider
Date: Sun, 4 Apr 2010 14:04:24 +0000
Subject: [PATCH 033/261] [CMD] - Don't prefix double quotation marks during
file completion See issue #4491 for more details.
svn path=/trunk/; revision=46718
---
reactos/base/shell/cmd/filecomp.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/reactos/base/shell/cmd/filecomp.c b/reactos/base/shell/cmd/filecomp.c
index 4ca8b837311..7cb99a72f12 100644
--- a/reactos/base/shell/cmd/filecomp.c
+++ b/reactos/base/shell/cmd/filecomp.c
@@ -703,7 +703,7 @@ VOID CompleteFilename (LPTSTR strIN, BOOL bNext, LPTSTR strOut, UINT cusor)
LastSpace = i;
}
- /* insert the quoation and move things around */
+ /* insert the quotation and move things around */
if(szPrefix[LastSpace + 1] != _T('\"') && LastSpace != -1)
{
memmove ( &szPrefix[LastSpace+1], &szPrefix[LastSpace], (_tcslen(szPrefix)-LastSpace+1) * sizeof(TCHAR) );
@@ -712,14 +712,17 @@ VOID CompleteFilename (LPTSTR strIN, BOOL bNext, LPTSTR strOut, UINT cusor)
{
_tcscat(szPrefix,_T("\""));
}
- szPrefix[LastSpace + 1] = _T('\"');
+ szPrefix[LastSpace + 1] = _T('\"');
}
else if(LastSpace == -1)
{
- _tcscpy(szBaseWord,_T("\""));
- _tcscat(szBaseWord,szPrefix);
- _tcscpy(szPrefix,szBaseWord);
-
+ /* Add quotation only if none exists already */
+ if (szPrefix[0] != _T('\"'))
+ {
+ _tcscpy(szBaseWord,_T("\""));
+ _tcscat(szBaseWord,szPrefix);
+ _tcscpy(szPrefix,szBaseWord);
+ }
}
}
From 2f22a7d7f8ea8ac279fe75ff0f9323cb20037a08 Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Sun, 4 Apr 2010 18:17:51 +0000
Subject: [PATCH 034/261] [NTOSKRNL] - Fix a case where we miss copying back
the IO_STATUS_BLOCK into the UserIosb buffer - Fixes the registry corruption
caused when PnP wrote an invalid resource list (passed back via
UserIosb->Information) to the registry - Hopefully this also fixes a few
other nasty bugs in other areas related to this issue
svn path=/trunk/; revision=46719
---
reactos/ntoskrnl/io/iomgr/irp.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/reactos/ntoskrnl/io/iomgr/irp.c b/reactos/ntoskrnl/io/iomgr/irp.c
index 0863f58907b..e3695e9d2fb 100644
--- a/reactos/ntoskrnl/io/iomgr/irp.c
+++ b/reactos/ntoskrnl/io/iomgr/irp.c
@@ -469,9 +469,6 @@ IopCompleteRequest(IN PKAPC Apc,
/* So we did return with a synch operation, was it the IRP? */
if (Irp->Flags & IRP_SYNCHRONOUS_API)
{
- /* Yes, this IRP was synchronous, so return the I/O Status */
- *Irp->UserIosb = Irp->IoStatus;
-
/* Now check if the user gave an event */
if (Irp->UserEvent)
{
@@ -495,6 +492,22 @@ IopCompleteRequest(IN PKAPC Apc,
}
}
+ /* Check if we have an associated user IOSB */
+ if (Irp->UserIosb)
+ {
+ /* We do, so let's give them the final status */
+ _SEH2_TRY
+ {
+ /* Save the IOSB Information */
+ *Irp->UserIosb = Irp->IoStatus;
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ /* Ignore any error */
+ }
+ _SEH2_END;
+ }
+
/* Now that we got here, we do this for incomplete I/Os as well */
if ((FileObject) && !(Irp->Flags & IRP_CREATE_OPERATION))
{
From 7be442943e1c21ab7b877932b900eb842c6a2084 Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Sun, 4 Apr 2010 18:22:54 +0000
Subject: [PATCH 035/261] - Move the code from my previous commit before
signalling the user event - Sorry for the wasted commit number
svn path=/trunk/; revision=46720
---
reactos/ntoskrnl/io/iomgr/irp.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/reactos/ntoskrnl/io/iomgr/irp.c b/reactos/ntoskrnl/io/iomgr/irp.c
index e3695e9d2fb..21870d5f9cc 100644
--- a/reactos/ntoskrnl/io/iomgr/irp.c
+++ b/reactos/ntoskrnl/io/iomgr/irp.c
@@ -460,6 +460,22 @@ IopCompleteRequest(IN PKAPC Apc,
}
else
{
+ /* Check if we have an associated user IOSB */
+ if (Irp->UserIosb)
+ {
+ /* We do, so let's give them the final status */
+ _SEH2_TRY
+ {
+ /* Save the IOSB Information */
+ *Irp->UserIosb = Irp->IoStatus;
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ /* Ignore any error */
+ }
+ _SEH2_END;
+ }
+
/*
* Either we didn't return from the request, or we did return but this
* request was synchronous.
@@ -492,22 +508,6 @@ IopCompleteRequest(IN PKAPC Apc,
}
}
- /* Check if we have an associated user IOSB */
- if (Irp->UserIosb)
- {
- /* We do, so let's give them the final status */
- _SEH2_TRY
- {
- /* Save the IOSB Information */
- *Irp->UserIosb = Irp->IoStatus;
- }
- _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
- {
- /* Ignore any error */
- }
- _SEH2_END;
- }
-
/* Now that we got here, we do this for incomplete I/Os as well */
if ((FileObject) && !(Irp->Flags & IRP_CREATE_OPERATION))
{
From a842dbcce0a32eb6169eef176a32c5004215fcc3 Mon Sep 17 00:00:00 2001
From: Gregor Schneider
Date: Sun, 4 Apr 2010 18:24:28 +0000
Subject: [PATCH 036/261] [FORMAT] - Bail out when detecting invalid root path,
instead of asking to insert a disk See issue #4067 for more details.
svn path=/trunk/; revision=46721
---
reactos/base/system/format/format.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/reactos/base/system/format/format.c b/reactos/base/system/format/format.c
index 59f9f302a0a..ba9f42b3a05 100755
--- a/reactos/base/system/format/format.c
+++ b/reactos/base/system/format/format.c
@@ -363,6 +363,12 @@ _tmain(int argc, TCHAR *argv[])
PrintWin32Error( szMsg, GetLastError());
return -1;
}
+ else if ( driveType == 1 )
+ {
+ LoadString( GetModuleHandle(NULL), STRING_NO_VOLUME, (LPTSTR) szMsg,RC_STRING_MAX_SIZE);
+ PrintWin32Error( szMsg, GetLastError());
+ return -1;
+ }
if( driveType != DRIVE_FIXED ) {
LoadString( GetModuleHandle(NULL), STRING_INSERT_DISK, (LPTSTR) szMsg,RC_STRING_MAX_SIZE);
From 7988cc7cad0624c1f3d483fcbf4654f232651e5d Mon Sep 17 00:00:00 2001
From: Gregor Schneider
Date: Sun, 4 Apr 2010 18:37:39 +0000
Subject: [PATCH 037/261] [SHELL32] - Add a confirmation dialog for logoff
operation - English and German translation included See issue #1494 for more
details.
svn path=/trunk/; revision=46722
---
reactos/dll/win32/shell32/dialogs.c | 8 +++++---
reactos/dll/win32/shell32/lang/bg-BG.rc | 2 ++
reactos/dll/win32/shell32/lang/ca-ES.rc | 2 ++
reactos/dll/win32/shell32/lang/cs-CZ.rc | 2 ++
reactos/dll/win32/shell32/lang/da-DK.rc | 2 ++
reactos/dll/win32/shell32/lang/de-DE.rc | 2 ++
reactos/dll/win32/shell32/lang/el-GR.rc | 2 ++
reactos/dll/win32/shell32/lang/en-GB.rc | 2 ++
reactos/dll/win32/shell32/lang/en-US.rc | 2 ++
reactos/dll/win32/shell32/lang/es-ES.rc | 2 ++
reactos/dll/win32/shell32/lang/fi-FI.rc | 2 ++
reactos/dll/win32/shell32/lang/fr-FR.rc | 2 ++
reactos/dll/win32/shell32/lang/hu-HU.rc | 2 ++
reactos/dll/win32/shell32/lang/it-IT.rc | 2 ++
reactos/dll/win32/shell32/lang/ja-JP.rc | 2 ++
reactos/dll/win32/shell32/lang/ko-KR.rc | 2 ++
reactos/dll/win32/shell32/lang/nl-NL.rc | 2 ++
reactos/dll/win32/shell32/lang/no-NO.rc | 2 ++
reactos/dll/win32/shell32/lang/pl-PL.rc | 2 ++
reactos/dll/win32/shell32/lang/pt-BR.rc | 2 ++
reactos/dll/win32/shell32/lang/pt-PT.rc | 2 ++
reactos/dll/win32/shell32/lang/ro-RO.rc | 2 ++
reactos/dll/win32/shell32/lang/ru-RU.rc | 2 ++
reactos/dll/win32/shell32/lang/sk-SK.rc | 2 ++
reactos/dll/win32/shell32/lang/sl-SI.rc | 2 ++
reactos/dll/win32/shell32/lang/sv-SE.rc | 2 ++
reactos/dll/win32/shell32/lang/tr-TR.rc | 2 ++
reactos/dll/win32/shell32/lang/uk-UA.rc | 2 ++
reactos/dll/win32/shell32/lang/zh-CN.rc | 2 ++
reactos/dll/win32/shell32/lang/zh-TW.rc | 2 ++
reactos/dll/win32/shell32/shresdef.h | 3 +++
31 files changed, 66 insertions(+), 3 deletions(-)
diff --git a/reactos/dll/win32/shell32/dialogs.c b/reactos/dll/win32/shell32/dialogs.c
index e5aa28f74e8..792ed62be1b 100644
--- a/reactos/dll/win32/shell32/dialogs.c
+++ b/reactos/dll/win32/shell32/dialogs.c
@@ -612,9 +612,11 @@ int WINAPI RestartDialogEx(HWND hWndOwner, LPCWSTR lpwstrReason, DWORD uFlags, D
int WINAPI LogoffWindowsDialog(HWND hWndOwner)
{
- UNIMPLEMENTED;
- ExitWindowsEx(EWX_LOGOFF, 0);
- return 0;
+ if (ConfirmDialog(hWndOwner, IDS_LOGOFF_PROMPT, IDS_LOGOFF_TITLE))
+ {
+ ExitWindowsEx(EWX_LOGOFF, 0);
+ }
+ return 0;
}
/*************************************************************************
diff --git a/reactos/dll/win32/shell32/lang/bg-BG.rc b/reactos/dll/win32/shell32/lang/bg-BG.rc
index fea6d988882..5cda676dd5e 100644
--- a/reactos/dll/win32/shell32/lang/bg-BG.rc
+++ b/reactos/dll/win32/shell32/lang/bg-BG.rc
@@ -666,6 +666,8 @@ BEGIN
IDS_RESTART_PROMPT "Èñêàòå ëè äà ïðåçàïóñíåòå ñèñòåìàòà?"
IDS_SHUTDOWN_TITLE "Èçêëþ÷âàíå"
IDS_SHUTDOWN_PROMPT "Èñêàòå ëè äà èçêëþ÷èòå êîìïþòúðà?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
// shell folder path default values
IDS_PROGRAMS "Ïóñêîâ èçáîðíèê\\Ïðèëîæåíèÿ"
diff --git a/reactos/dll/win32/shell32/lang/ca-ES.rc b/reactos/dll/win32/shell32/lang/ca-ES.rc
index df5cb9e4b24..a26fab0e23f 100644
--- a/reactos/dll/win32/shell32/lang/ca-ES.rc
+++ b/reactos/dll/win32/shell32/lang/ca-ES.rc
@@ -665,6 +665,8 @@ BEGIN
IDS_RESTART_PROMPT "Do you want to restart the system?"
IDS_SHUTDOWN_TITLE "Shutdown"
IDS_SHUTDOWN_PROMPT "Do you want to shutdown?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "Start Menu\\Programs"
diff --git a/reactos/dll/win32/shell32/lang/cs-CZ.rc b/reactos/dll/win32/shell32/lang/cs-CZ.rc
index b08beea99f9..f2652e6a2d4 100644
--- a/reactos/dll/win32/shell32/lang/cs-CZ.rc
+++ b/reactos/dll/win32/shell32/lang/cs-CZ.rc
@@ -666,6 +666,8 @@ BEGIN
IDS_RESTART_PROMPT "Opravdu chcete restartovat systém?"
IDS_SHUTDOWN_TITLE "Vypnout"
IDS_SHUTDOWN_PROMPT "Opravdu chcete vypnout poèítaè?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "Nabídka Start\\Programy"
diff --git a/reactos/dll/win32/shell32/lang/da-DK.rc b/reactos/dll/win32/shell32/lang/da-DK.rc
index 40e1eabce06..b9cf5217235 100644
--- a/reactos/dll/win32/shell32/lang/da-DK.rc
+++ b/reactos/dll/win32/shell32/lang/da-DK.rc
@@ -654,6 +654,8 @@ BEGIN
IDS_RESTART_PROMPT "Ønsker du at Genstarte Systemet?"
IDS_SHUTDOWN_TITLE "Luk Ned"
IDS_SHUTDOWN_PROMPT "Ønsker du at Lukke Ned?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "Start Menu\\Programmer"
diff --git a/reactos/dll/win32/shell32/lang/de-DE.rc b/reactos/dll/win32/shell32/lang/de-DE.rc
index db0fa82a369..09f6559a447 100644
--- a/reactos/dll/win32/shell32/lang/de-DE.rc
+++ b/reactos/dll/win32/shell32/lang/de-DE.rc
@@ -669,6 +669,8 @@ BEGIN
IDS_RESTART_PROMPT "Möchten Sie das System neu starten?"
IDS_SHUTDOWN_TITLE "Herunterfahren"
IDS_SHUTDOWN_PROMPT "Möchten Sie das System herunterfahren?"
+ IDS_LOGOFF_TITLE "Ausloggen"
+ IDS_LOGOFF_PROMPT "Möchten Sie sich ausloggen?"
/* shell folder path default values */
IDS_PROGRAMS "Startmenü\\Programme"
diff --git a/reactos/dll/win32/shell32/lang/el-GR.rc b/reactos/dll/win32/shell32/lang/el-GR.rc
index 6b35ec3f541..0821f013408 100644
--- a/reactos/dll/win32/shell32/lang/el-GR.rc
+++ b/reactos/dll/win32/shell32/lang/el-GR.rc
@@ -666,6 +666,8 @@ BEGIN
IDS_RESTART_PROMPT "Åßóôå óßãïõñïé üôé èÝëåôå íá åðáíåêêéíÞóåôå ôïí õðïëïãéóôÞ óáò;"
IDS_SHUTDOWN_TITLE "Áðåíåñãïðïßçóç"
IDS_SHUTDOWN_PROMPT "Åßóôå óßãïõñïé üôé èÝëåôå íá áðåíåñãïðïéÞóåôå ôïí õðïëïãéóôÞ óáò;"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "Start Menu\\Programs"
diff --git a/reactos/dll/win32/shell32/lang/en-GB.rc b/reactos/dll/win32/shell32/lang/en-GB.rc
index 38203c24077..3dfbfd940df 100644
--- a/reactos/dll/win32/shell32/lang/en-GB.rc
+++ b/reactos/dll/win32/shell32/lang/en-GB.rc
@@ -665,6 +665,8 @@ BEGIN
IDS_RESTART_PROMPT "Do you want to restart the system?"
IDS_SHUTDOWN_TITLE "Shutdown"
IDS_SHUTDOWN_PROMPT "Do you want to shutdown?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "Start Menu\\Programs"
diff --git a/reactos/dll/win32/shell32/lang/en-US.rc b/reactos/dll/win32/shell32/lang/en-US.rc
index 63d38cba154..200c97ae1fb 100644
--- a/reactos/dll/win32/shell32/lang/en-US.rc
+++ b/reactos/dll/win32/shell32/lang/en-US.rc
@@ -665,6 +665,8 @@ BEGIN
IDS_RESTART_PROMPT "Do you want to restart the system?"
IDS_SHUTDOWN_TITLE "Shutdown"
IDS_SHUTDOWN_PROMPT "Do you want to shutdown?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "Start Menu\\Programs"
diff --git a/reactos/dll/win32/shell32/lang/es-ES.rc b/reactos/dll/win32/shell32/lang/es-ES.rc
index 0e20abcf95f..a0dacf6a7a7 100644
--- a/reactos/dll/win32/shell32/lang/es-ES.rc
+++ b/reactos/dll/win32/shell32/lang/es-ES.rc
@@ -668,6 +668,8 @@ BEGIN
IDS_RESTART_PROMPT "¿Desea reiniciar el equipo?"
IDS_SHUTDOWN_TITLE "Apagar"
IDS_SHUTDOWN_PROMPT "¿Desea apagar el equipo?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "Menú Inicio\\Programas"
diff --git a/reactos/dll/win32/shell32/lang/fi-FI.rc b/reactos/dll/win32/shell32/lang/fi-FI.rc
index 2620c2b4277..778576a08fb 100644
--- a/reactos/dll/win32/shell32/lang/fi-FI.rc
+++ b/reactos/dll/win32/shell32/lang/fi-FI.rc
@@ -665,6 +665,8 @@ BEGIN
IDS_RESTART_PROMPT "Haluatko simuloida Windows:n uudelleenkäynnistämistä?"
IDS_SHUTDOWN_TITLE "Sammuta"
IDS_SHUTDOWN_PROMPT "Haluatko lopettaa Wine:n istunnon?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "Käynnistä\\Ohjelmat"
diff --git a/reactos/dll/win32/shell32/lang/fr-FR.rc b/reactos/dll/win32/shell32/lang/fr-FR.rc
index 98cd95fa6f0..3f712a60bbd 100644
--- a/reactos/dll/win32/shell32/lang/fr-FR.rc
+++ b/reactos/dll/win32/shell32/lang/fr-FR.rc
@@ -669,6 +669,8 @@ BEGIN
IDS_RESTART_PROMPT "Voulez-vous redémarrer votre ordinateur ?"
IDS_SHUTDOWN_TITLE "Arrêter"
IDS_SHUTDOWN_PROMPT "Voulez-vous fermer la session ReactOS ?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "Menu Démarrer\\Programmes"
diff --git a/reactos/dll/win32/shell32/lang/hu-HU.rc b/reactos/dll/win32/shell32/lang/hu-HU.rc
index 7016d5021a8..22a26038c7c 100644
--- a/reactos/dll/win32/shell32/lang/hu-HU.rc
+++ b/reactos/dll/win32/shell32/lang/hu-HU.rc
@@ -668,6 +668,8 @@ BEGIN
IDS_RESTART_PROMPT "Újra szeretnéd indítani a rendszert?"
IDS_SHUTDOWN_TITLE "Kikapcsolás"
IDS_SHUTDOWN_PROMPT "Kiakarod kapcsolni számítógépét?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "Start Menu\\Programs"
diff --git a/reactos/dll/win32/shell32/lang/it-IT.rc b/reactos/dll/win32/shell32/lang/it-IT.rc
index 986ecfeeb46..4407298403c 100644
--- a/reactos/dll/win32/shell32/lang/it-IT.rc
+++ b/reactos/dll/win32/shell32/lang/it-IT.rc
@@ -666,6 +666,8 @@ BEGIN
IDS_RESTART_PROMPT "Volete riavviare il sistema?"
IDS_SHUTDOWN_TITLE "Termina sessione"
IDS_SHUTDOWN_PROMPT "Volete terminare la sessione di ReactOS?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "Menu Avvio\\Programmi"
diff --git a/reactos/dll/win32/shell32/lang/ja-JP.rc b/reactos/dll/win32/shell32/lang/ja-JP.rc
index 47c5bfb9923..12f24d34adb 100644
--- a/reactos/dll/win32/shell32/lang/ja-JP.rc
+++ b/reactos/dll/win32/shell32/lang/ja-JP.rc
@@ -665,6 +665,8 @@ BEGIN
IDS_RESTART_PROMPT "ƒVƒXƒeƒ€‚ðÄ‹N“®‚µ‚Ü‚·‚©?"
IDS_SHUTDOWN_TITLE "ƒVƒƒƒbƒgƒ_ƒEƒ“"
IDS_SHUTDOWN_PROMPT "ƒVƒƒƒbƒgƒ_ƒEƒ“‚µ‚Ü‚·‚©?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "ƒXƒ^[ƒg ƒƒjƒ…[\\ƒvƒƒOƒ‰ƒ€"
diff --git a/reactos/dll/win32/shell32/lang/ko-KR.rc b/reactos/dll/win32/shell32/lang/ko-KR.rc
index e9e67b71a4e..9d7ad808fa6 100644
--- a/reactos/dll/win32/shell32/lang/ko-KR.rc
+++ b/reactos/dll/win32/shell32/lang/ko-KR.rc
@@ -665,6 +665,8 @@ BEGIN
IDS_RESTART_PROMPT "Do you want to restart the system?"
IDS_SHUTDOWN_TITLE "Shutdown"
IDS_SHUTDOWN_PROMPT "Do you want to shutdown?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "Start Menu\\Programs"
diff --git a/reactos/dll/win32/shell32/lang/nl-NL.rc b/reactos/dll/win32/shell32/lang/nl-NL.rc
index 5ff6c83a59a..b0e1c919a5f 100644
--- a/reactos/dll/win32/shell32/lang/nl-NL.rc
+++ b/reactos/dll/win32/shell32/lang/nl-NL.rc
@@ -665,6 +665,8 @@ BEGIN
IDS_RESTART_PROMPT "Do you want to restart the system?"
IDS_SHUTDOWN_TITLE "Shutdown"
IDS_SHUTDOWN_PROMPT "Do you want to shutdown?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "Start Menu\\Programs"
diff --git a/reactos/dll/win32/shell32/lang/no-NO.rc b/reactos/dll/win32/shell32/lang/no-NO.rc
index 90dc27d3aa6..43c637f1dcb 100644
--- a/reactos/dll/win32/shell32/lang/no-NO.rc
+++ b/reactos/dll/win32/shell32/lang/no-NO.rc
@@ -668,6 +668,8 @@ BEGIN
IDS_RESTART_PROMPT "Vil du starte datamaskinen på nytt?"
IDS_SHUTDOWN_TITLE "Avslutt"
IDS_SHUTDOWN_PROMPT "Vil du slå av datamaskinen?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "Start-meny\\Programmer"
diff --git a/reactos/dll/win32/shell32/lang/pl-PL.rc b/reactos/dll/win32/shell32/lang/pl-PL.rc
index b6d33a64fd4..a0d3682dc1f 100644
--- a/reactos/dll/win32/shell32/lang/pl-PL.rc
+++ b/reactos/dll/win32/shell32/lang/pl-PL.rc
@@ -672,6 +672,8 @@ BEGIN
IDS_RESTART_PROMPT "Czy chcesz zrestartowaæ system?"
IDS_SHUTDOWN_TITLE "Wy³¹cz"
IDS_SHUTDOWN_PROMPT "Czy chcesz wy³¹czyæ system?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "Menu Start\\Programy"
diff --git a/reactos/dll/win32/shell32/lang/pt-BR.rc b/reactos/dll/win32/shell32/lang/pt-BR.rc
index 048d4c39110..5bcee218b35 100644
--- a/reactos/dll/win32/shell32/lang/pt-BR.rc
+++ b/reactos/dll/win32/shell32/lang/pt-BR.rc
@@ -667,6 +667,8 @@ BEGIN
IDS_RESTART_PROMPT "Você quer simular a reinicialização do Windows?"
IDS_SHUTDOWN_TITLE "Desligar"
IDS_SHUTDOWN_PROMPT "Você quer finalizar a sessão no Wine?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "Menu Iniciar\\Programas"
diff --git a/reactos/dll/win32/shell32/lang/pt-PT.rc b/reactos/dll/win32/shell32/lang/pt-PT.rc
index c20e670e3a2..dbf3fe2453c 100644
--- a/reactos/dll/win32/shell32/lang/pt-PT.rc
+++ b/reactos/dll/win32/shell32/lang/pt-PT.rc
@@ -667,6 +667,8 @@ BEGIN
IDS_RESTART_PROMPT "Deseja simular a reinicialização do Windows?"
IDS_SHUTDOWN_TITLE "Desligar"
IDS_SHUTDOWN_PROMPT "Deseja finalizar esta sessão do Wine?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "Menu Iniciar\\Programas"
diff --git a/reactos/dll/win32/shell32/lang/ro-RO.rc b/reactos/dll/win32/shell32/lang/ro-RO.rc
index 656bc410bc9..efbff8594d2 100644
--- a/reactos/dll/win32/shell32/lang/ro-RO.rc
+++ b/reactos/dll/win32/shell32/lang/ro-RO.rc
@@ -668,6 +668,8 @@ BEGIN
IDS_RESTART_PROMPT "Vreți să reporniți sistemul?"
IDS_SHUTDOWN_TITLE "ÃŽnchidere"
IDS_SHUTDOWN_PROMPT "Vreți să închideți computerul?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "Meniu Start\\Programe"
diff --git a/reactos/dll/win32/shell32/lang/ru-RU.rc b/reactos/dll/win32/shell32/lang/ru-RU.rc
index 7d6e1e1e06e..6c3f488f3eb 100644
--- a/reactos/dll/win32/shell32/lang/ru-RU.rc
+++ b/reactos/dll/win32/shell32/lang/ru-RU.rc
@@ -664,6 +664,8 @@ BEGIN
IDS_RESTART_PROMPT "Âû äåéñòâèòåëüíî õîòèòå ïåðåçàãðóçèòü ReactOS?"
IDS_SHUTDOWN_TITLE "Âûêëþ÷èòü ïèòàíèå"
IDS_SHUTDOWN_PROMPT "Çàêîí÷èòü ðàáîòó ñ ReactOS?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "Ãëàâíîå ìåíþ\\Ïðîãðàììû"
diff --git a/reactos/dll/win32/shell32/lang/sk-SK.rc b/reactos/dll/win32/shell32/lang/sk-SK.rc
index 2ec58ec12ae..e45b141e87f 100644
--- a/reactos/dll/win32/shell32/lang/sk-SK.rc
+++ b/reactos/dll/win32/shell32/lang/sk-SK.rc
@@ -671,6 +671,8 @@ BEGIN
IDS_RESTART_PROMPT "Naozaj chcete reštartova systém?"
IDS_SHUTDOWN_TITLE "Vypnú"
IDS_SHUTDOWN_PROMPT "Naozaj chcete vypnú poèítaè?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "Ponuka Štart\\Programy"
diff --git a/reactos/dll/win32/shell32/lang/sl-SI.rc b/reactos/dll/win32/shell32/lang/sl-SI.rc
index 876be4b4927..5038af1c123 100644
--- a/reactos/dll/win32/shell32/lang/sl-SI.rc
+++ b/reactos/dll/win32/shell32/lang/sl-SI.rc
@@ -665,6 +665,8 @@ BEGIN
IDS_RESTART_PROMPT "Do you want to restart the system?"
IDS_SHUTDOWN_TITLE "Shutdown"
IDS_SHUTDOWN_PROMPT "Do you want to shutdown?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "Start Menu\\Programs"
diff --git a/reactos/dll/win32/shell32/lang/sv-SE.rc b/reactos/dll/win32/shell32/lang/sv-SE.rc
index e7a520f5ba4..08a6f59e70f 100644
--- a/reactos/dll/win32/shell32/lang/sv-SE.rc
+++ b/reactos/dll/win32/shell32/lang/sv-SE.rc
@@ -665,6 +665,8 @@ BEGIN
IDS_RESTART_PROMPT "Do you want to restart the system?"
IDS_SHUTDOWN_TITLE "Shutdown"
IDS_SHUTDOWN_PROMPT "Do you want to shutdown?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "Start Menu\\Programs"
diff --git a/reactos/dll/win32/shell32/lang/tr-TR.rc b/reactos/dll/win32/shell32/lang/tr-TR.rc
index 49a154c3408..3ab92cbb104 100644
--- a/reactos/dll/win32/shell32/lang/tr-TR.rc
+++ b/reactos/dll/win32/shell32/lang/tr-TR.rc
@@ -665,6 +665,8 @@ BEGIN
IDS_RESTART_PROMPT "Do you want to restart the system?"
IDS_SHUTDOWN_TITLE "Oturumu Kapat"
IDS_SHUTDOWN_PROMPT "Do you want to shutdown?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "Start Menu\\Programlar"
diff --git a/reactos/dll/win32/shell32/lang/uk-UA.rc b/reactos/dll/win32/shell32/lang/uk-UA.rc
index 3846965c696..cf2847ed9ab 100644
--- a/reactos/dll/win32/shell32/lang/uk-UA.rc
+++ b/reactos/dll/win32/shell32/lang/uk-UA.rc
@@ -666,6 +666,8 @@ BEGIN
IDS_RESTART_PROMPT "Âè õî÷åòå ïåðåçàâàíòàæèòè ñèñòåìó?"
IDS_SHUTDOWN_TITLE "Âèìêíóòè"
IDS_SHUTDOWN_PROMPT "Âè õî÷åòå âèìêíóòè êîìï'þòåð?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "Start Menu\\Programs"
diff --git a/reactos/dll/win32/shell32/lang/zh-CN.rc b/reactos/dll/win32/shell32/lang/zh-CN.rc
index 5180db558cd..18c4d5439d4 100644
--- a/reactos/dll/win32/shell32/lang/zh-CN.rc
+++ b/reactos/dll/win32/shell32/lang/zh-CN.rc
@@ -654,6 +654,8 @@ BEGIN
IDS_RESTART_PROMPT "ÊÇ·ñÖØÐÂÆô¶¯ÏµÍ³?"
IDS_SHUTDOWN_TITLE "¹Ø»ú"
IDS_SHUTDOWN_PROMPT "ÊÇ·ñ¹Ø±Õϵͳ?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "Start Menu\\Programs"
diff --git a/reactos/dll/win32/shell32/lang/zh-TW.rc b/reactos/dll/win32/shell32/lang/zh-TW.rc
index fc76bf15798..f7c59a2e1ff 100644
--- a/reactos/dll/win32/shell32/lang/zh-TW.rc
+++ b/reactos/dll/win32/shell32/lang/zh-TW.rc
@@ -666,6 +666,8 @@ BEGIN
IDS_RESTART_PROMPT "Do you want to restart the system?"
IDS_SHUTDOWN_TITLE "Shutdown"
IDS_SHUTDOWN_PROMPT "Do you want to shutdown?"
+ IDS_LOGOFF_TITLE "Log Off"
+ IDS_LOGOFF_PROMPT "Do you want to log off?"
/* shell folder path default values */
IDS_PROGRAMS "Start Menu\\Programs"
diff --git a/reactos/dll/win32/shell32/shresdef.h b/reactos/dll/win32/shell32/shresdef.h
index e28efb0e240..981e17ff9ce 100644
--- a/reactos/dll/win32/shell32/shresdef.h
+++ b/reactos/dll/win32/shell32/shresdef.h
@@ -90,6 +90,9 @@
#define IDS_FONTS 76
#define IDS_PRINTERS 77
+#define IDS_LOGOFF_TITLE 78
+#define IDS_LOGOFF_PROMPT 79
+
#define IDS_CREATEFOLDER_DENIED 128
#define IDS_CREATEFOLDER_CAPTION 129
#define IDS_DELETEITEM_CAPTION 130
From 6141336a7894c8c80f30e5dc37029dedf80c21ac Mon Sep 17 00:00:00 2001
From: Johannes Anderwald
Date: Sun, 4 Apr 2010 21:27:07 +0000
Subject: [PATCH 038/261] [KS] - Add hack to IKsClock_DispatchDeviceIoControl -
Store device state before calling SetDeviceState - Partly implement
KsPinGetLeadingEdgeStreamPointer, KsStreamPointerDelete,
KsStreamPointerClone, KsStreamPointerAdvanceOffsets - Implement a worker
routine to dispatch read/write stream requests for pin centric filters - Tv
tuner is now able to transfer MPEG2 TS to user mode, WIP, needs more testing
svn path=/trunk/; revision=46723
---
reactos/drivers/ksfilter/ks/api.c | 4 +-
reactos/drivers/ksfilter/ks/bag.c | 4 +
reactos/drivers/ksfilter/ks/clocks.c | 4 +-
reactos/drivers/ksfilter/ks/driver.c | 4 +
reactos/drivers/ksfilter/ks/filter.c | 2 +
reactos/drivers/ksfilter/ks/pin.c | 349 ++++++++++++++++++++++++---
6 files changed, 331 insertions(+), 36 deletions(-)
diff --git a/reactos/drivers/ksfilter/ks/api.c b/reactos/drivers/ksfilter/ks/api.c
index 8ec11860e02..f1ac9a848db 100644
--- a/reactos/drivers/ksfilter/ks/api.c
+++ b/reactos/drivers/ksfilter/ks/api.c
@@ -94,6 +94,8 @@ KsReleaseDeviceSecurityLock(
{
PKSIDEVICE_HEADER Header = (PKSIDEVICE_HEADER)DevHeader;
+ DPRINT("KsReleaseDevice\n");
+
ExReleaseResourceLite(&Header->SecurityLock);
KeLeaveCriticalRegion();
}
@@ -1623,7 +1625,7 @@ KsAcquireDevice(
IKsDevice *KsDevice;
PKSIDEVICE_HEADER DeviceHeader;
-
+ DPRINT("KsAcquireDevice\n");
DeviceHeader = (PKSIDEVICE_HEADER)CONTAINING_RECORD(Device, KSIDEVICE_HEADER, KsDevice);
/* get device interface*/
diff --git a/reactos/drivers/ksfilter/ks/bag.c b/reactos/drivers/ksfilter/ks/bag.c
index 1b7eec9bc5e..d0b76cc8cd1 100644
--- a/reactos/drivers/ksfilter/ks/bag.c
+++ b/reactos/drivers/ksfilter/ks/bag.c
@@ -89,6 +89,8 @@ KsAddItemToObjectBag(
PKSIOBJECT_BAG Bag;
PKSIOBJECT_BAG_ENTRY BagEntry;
+ DPRINT("KsAddItemToObjectBag\n");
+
/* get real object bag */
Bag = (PKSIOBJECT_BAG)ObjectBag;
@@ -363,6 +365,8 @@ _KsEdit(
PVOID Item;
NTSTATUS Status;
+ DPRINT("_KsEdit\n");
+
/* get real object bag */
Bag = (PKSIOBJECT_BAG)ObjectBag;
diff --git a/reactos/drivers/ksfilter/ks/clocks.c b/reactos/drivers/ksfilter/ks/clocks.c
index 39611935076..f3e7d7acbb8 100644
--- a/reactos/drivers/ksfilter/ks/clocks.c
+++ b/reactos/drivers/ksfilter/ks/clocks.c
@@ -98,10 +98,10 @@ IKsClock_DispatchDeviceIoControl(
{
UNIMPLEMENTED
- Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
+ Irp->IoStatus.Status = STATUS_SUCCESS;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
- return STATUS_NOT_IMPLEMENTED;
+ return STATUS_SUCCESS;
}
NTSTATUS
diff --git a/reactos/drivers/ksfilter/ks/driver.c b/reactos/drivers/ksfilter/ks/driver.c
index 949e1285c54..0b6cf43a96e 100644
--- a/reactos/drivers/ksfilter/ks/driver.c
+++ b/reactos/drivers/ksfilter/ks/driver.c
@@ -39,6 +39,8 @@ KsGetDevice(
{
PKSBASIC_HEADER BasicHeader = (PKSBASIC_HEADER)((ULONG_PTR)Object - sizeof(KSBASIC_HEADER));
+ DPRINT("KsGetDevice\n");
+
ASSERT(BasicHeader->Type == KsObjectTypeFilterFactory || BasicHeader->Type == KsObjectTypeFilter || BasicHeader->Type == KsObjectTypePin);
ASSERT(BasicHeader->KsDevice);
ASSERT(BasicHeader->KsDevice->Started);
@@ -152,6 +154,8 @@ KsInitializeDriver(
PKS_DRIVER_EXTENSION DriverObjectExtension;
NTSTATUS Status = STATUS_SUCCESS;
+ DPRINT("KsInitializeDriver\n");
+
if (Descriptor)
{
Status = IoAllocateDriverObjectExtension(DriverObject, (PVOID)KsInitializeDriver, sizeof(KS_DRIVER_EXTENSION), (PVOID*)&DriverObjectExtension);
diff --git a/reactos/drivers/ksfilter/ks/filter.c b/reactos/drivers/ksfilter/ks/filter.c
index 5c8fe7f463f..2fb69977f58 100644
--- a/reactos/drivers/ksfilter/ks/filter.c
+++ b/reactos/drivers/ksfilter/ks/filter.c
@@ -1572,6 +1572,8 @@ KsGetFilterFromIrp(
PIO_STACK_LOCATION IoStack;
PKSIOBJECT_HEADER ObjectHeader;
+ DPRINT("KsGetFilterFromIrp\n");
+
/* get current irp stack location */
IoStack = IoGetCurrentIrpStackLocation(Irp);
diff --git a/reactos/drivers/ksfilter/ks/pin.c b/reactos/drivers/ksfilter/ks/pin.c
index 70e17e6607a..a4cc63bfbc6 100644
--- a/reactos/drivers/ksfilter/ks/pin.c
+++ b/reactos/drivers/ksfilter/ks/pin.c
@@ -11,13 +11,13 @@
typedef struct _KSISTREAM_POINTER
{
- KSSTREAM_POINTER StreamPointer;
PFNKSSTREAMPOINTER Callback;
PIRP Irp;
KTIMER Timer;
KDPC TimerDpc;
struct _KSISTREAM_POINTER *Next;
-
+ PKSPIN Pin;
+ KSSTREAM_POINTER StreamPointer;
}KSISTREAM_POINTER, *PKSISTREAM_POINTER;
typedef struct
@@ -56,6 +56,12 @@ typedef struct
IKsReferenceClockVtbl * lpVtblReferenceClock;
PKSDEFAULTCLOCK DefaultClock;
+ PKSWORKER PinWorker;
+ WORK_QUEUE_ITEM PinWorkQueueItem;
+ IRP * Irp;
+ KEVENT FrameComplete;
+
+
}IKsPinImpl;
NTSTATUS NTAPI IKsPin_PinStatePropertyHandler(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data);
@@ -283,6 +289,7 @@ IKsPin_PinStatePropertyHandler(
/* set new state */
This->Pin.ClientState = *NewState;
+ This->Pin.DeviceState = *NewState;
/* check if it supported */
Status = This->Pin.Descriptor->Dispatch->SetDeviceState(&This->Pin, *NewState, OldState);
@@ -293,6 +300,7 @@ IKsPin_PinStatePropertyHandler(
{
/* revert to old state */
This->Pin.ClientState = OldState;
+ This->Pin.DeviceState = OldState;
DbgBreakPoint();
}
else
@@ -892,7 +900,7 @@ KsPinAttemptProcessing(
IN BOOLEAN Asynchronous)
{
DPRINT("KsPinAttemptProcessing\n");
-DbgBreakPoint();
+ DbgBreakPoint();
UNIMPLEMENTED
}
@@ -1204,10 +1212,33 @@ KsPinGetLeadingEdgeStreamPointer(
IN PKSPIN Pin,
IN KSSTREAM_POINTER_STATE State)
{
- UNIMPLEMENTED
- DPRINT("KsPinGetLeadingEdgeStreamPointer Pin %p State %x\n", Pin, State);
-DbgBreakPoint();
- return NULL;
+ IKsPinImpl * This;
+
+ This = (IKsPinImpl*)CONTAINING_RECORD(Pin, IKsPinImpl, Pin);
+
+ DPRINT("KsPinGetLeadingEdgeStreamPointer Pin %p State %x Count %lu Remaining %lu\n", Pin, State,
+ This->LeadingEdgeStreamPointer->StreamPointer.Offset->Count,
+ This->LeadingEdgeStreamPointer->StreamPointer.Offset->Remaining);
+
+ /* sanity check */
+ ASSERT(This->LeadingEdgeStreamPointer);
+ ASSERT(State == KSSTREAM_POINTER_STATE_LOCKED);
+
+ if (State == KSSTREAM_POINTER_STATE_LOCKED)
+ {
+ /* do we have an irp packet */
+ if (!This->Irp)
+ {
+ /* run out of packets */
+ return NULL;
+ }
+
+ if (!This->LeadingEdgeStreamPointer->StreamPointer.Offset->Remaining)
+ return NULL;
+ }
+ DPRINT("LeadingEdge %p\n", &This->LeadingEdgeStreamPointer->StreamPointer);
+ This->LeadingEdgeStreamPointer->Pin = &This->Pin;
+ return &This->LeadingEdgeStreamPointer->StreamPointer;
}
/*
@@ -1262,8 +1293,8 @@ KsStreamPointerUnlock(
IN BOOLEAN Eject)
{
UNIMPLEMENTED
- DPRINT("KsStreamPointerUnlock\n");
-DbgBreakPoint();
+ DPRINT("KsStreamPointerUnlock Eject %lu\n", Eject);
+ DbgBreakPoint();
}
/*
@@ -1278,8 +1309,8 @@ KsStreamPointerAdvanceOffsetsAndUnlock(
IN ULONG OutUsed,
IN BOOLEAN Eject)
{
- DPRINT("KsStreamPointerAdvanceOffsets\n");
-DbgBreakPoint();
+ DPRINT("KsStreamPointerAdvanceOffsets InUsed %lu OutUsed %lu Eject %lu\n", InUsed, OutUsed, Eject);
+ DbgBreakPoint();
UNIMPLEMENTED
}
@@ -1294,10 +1325,10 @@ KsStreamPointerDelete(
{
IKsPinImpl * This;
PKSISTREAM_POINTER Cur, Last;
- PKSISTREAM_POINTER Pointer = (PKSISTREAM_POINTER)StreamPointer;
+ PKSISTREAM_POINTER Pointer = (PKSISTREAM_POINTER)CONTAINING_RECORD(StreamPointer, KSISTREAM_POINTER, StreamPointer);
+
+ DPRINT("KsStreamPointerDelete %p\n", Pointer);
- DPRINT("KsStreamPointerDelete\n");
-DbgBreakPoint();
This = (IKsPinImpl*)CONTAINING_RECORD(Pointer->StreamPointer.Pin, IKsPinImpl, Pin);
/* point to first stream pointer */
@@ -1332,7 +1363,7 @@ DbgBreakPoint();
}
/*
- @unimplemented
+ @implemented
*/
KSDDKAPI
NTSTATUS
@@ -1343,14 +1374,57 @@ KsStreamPointerClone(
IN ULONG ContextSize,
OUT PKSSTREAM_POINTER* CloneStreamPointer)
{
- UNIMPLEMENTED
- DPRINT("KsStreamPointerClone\n");
-DbgBreakPoint();
- return STATUS_NOT_IMPLEMENTED;
+ IKsPinImpl * This;
+ PKSISTREAM_POINTER CurFrame;
+ PKSISTREAM_POINTER NewFrame;
+ ULONG RefCount;
+ ULONG Size;
+
+ DPRINT("KsStreamPointerClone StreamPointer %p CancelCallback %p ContextSize %p CloneStreamPointer %p\n", StreamPointer, CancelCallback, ContextSize, CloneStreamPointer);
+
+ /* get stream pointer */
+ CurFrame = (PKSISTREAM_POINTER)CONTAINING_RECORD(StreamPointer, KSISTREAM_POINTER, StreamPointer);
+
+ /* calculate context size */
+ Size = sizeof(KSISTREAM_POINTER) + ContextSize;
+
+ /* allocate new stream pointer */
+ NewFrame = (PKSISTREAM_POINTER)ExAllocatePool(NonPagedPool, Size);
+
+ if (!NewFrame)
+ return STATUS_INSUFFICIENT_RESOURCES;
+
+ /* get current irp stack location */
+ RefCount = (ULONG)CurFrame->Irp->Tail.Overlay.DriverContext[0];
+
+ /* increment reference count */
+ RefCount++;
+ CurFrame->Irp->Tail.Overlay.DriverContext[0] = (PVOID)RefCount;
+
+ /* copy stream pointer */
+ RtlMoveMemory(NewFrame, CurFrame, sizeof(KSISTREAM_POINTER));
+
+ if (ContextSize)
+ NewFrame->StreamPointer.Context = (NewFrame + 1);
+
+ /* locate pin */
+ This = (IKsPinImpl*)CONTAINING_RECORD(CurFrame->Pin, IKsPinImpl, Pin);
+
+ NewFrame->StreamPointer.Pin = &This->Pin;
+
+ ASSERT(NewFrame->StreamPointer.Pin);
+ ASSERT(NewFrame->StreamPointer.Context);
+ ASSERT(NewFrame->StreamPointer.Offset);
+ ASSERT(NewFrame->StreamPointer.StreamHeader);
+
+ /* store result */
+ *CloneStreamPointer = &NewFrame->StreamPointer;
+
+ return STATUS_SUCCESS;
}
/*
- @unimplemented
+ @implemented
*/
KSDDKAPI
NTSTATUS
@@ -1361,8 +1435,58 @@ KsStreamPointerAdvanceOffsets(
IN ULONG OutUsed,
IN BOOLEAN Eject)
{
- UNIMPLEMENTED
- return STATUS_NOT_IMPLEMENTED;
+ PKSISTREAM_POINTER CurFrame;
+ IKsPinImpl * This;
+
+ DPRINT("KsStreamPointerAdvanceOffsets InUsed %lu OutUsed %lu Eject %lu\n", InUsed, OutUsed, Eject);
+
+ /* get stream pointer */
+ CurFrame = (PKSISTREAM_POINTER)CONTAINING_RECORD(StreamPointer, KSISTREAM_POINTER, StreamPointer);
+
+ CurFrame->StreamPointer.OffsetIn.Remaining -= InUsed;
+ CurFrame->StreamPointer.OffsetOut.Remaining -= OutUsed;
+ CurFrame->StreamPointer.OffsetIn.Count -= InUsed;
+ CurFrame->StreamPointer.OffsetOut.Count -= OutUsed;
+ CurFrame->StreamPointer.OffsetIn.Data = (PVOID)((ULONG_PTR)CurFrame->StreamPointer.OffsetIn.Data + InUsed);
+ CurFrame->StreamPointer.OffsetOut.Data = (PVOID)((ULONG_PTR)CurFrame->StreamPointer.OffsetOut.Data + OutUsed);
+
+ if (!CurFrame->StreamPointer.OffsetIn.Remaining)
+ CurFrame->StreamPointer.OffsetIn.Data = NULL;
+
+ if (!CurFrame->StreamPointer.OffsetOut.Remaining)
+ CurFrame->StreamPointer.OffsetOut.Data = NULL;
+
+ /* locate pin */
+ This = (IKsPinImpl*)CONTAINING_RECORD(CurFrame->Pin, IKsPinImpl, Pin);
+
+ if (This->Pin.Descriptor->PinDescriptor.DataFlow == KSPIN_DATAFLOW_IN)
+ {
+ if (CurFrame->StreamPointer.OffsetIn.Remaining == 0)
+ {
+ /* get next mapping */
+ This->Irp = KsRemoveIrpFromCancelableQueue(&This->IrpList, &This->IrpListLock, KsListEntryHead, KsAcquireAndRemoveOnlySingleItem);
+ if (!This->Irp)
+ return STATUS_DEVICE_NOT_READY;
+
+ /* FIXME handle me */
+ ASSERT(0);
+ }
+ }
+ else
+ {
+ if (CurFrame->StreamPointer.OffsetOut.Remaining == 0)
+ {
+ /* get next mapping */
+ This->Irp = KsRemoveIrpFromCancelableQueue(&This->IrpList, &This->IrpListLock, KsListEntryHead, KsAcquireAndRemoveOnlySingleItem);
+ if (!This->Irp)
+ return STATUS_DEVICE_NOT_READY;
+
+ /* FIXME handle me */
+ ASSERT(0);
+ }
+ }
+
+ return STATUS_SUCCESS;
}
/*
@@ -1458,7 +1582,7 @@ KsPinGetFirstCloneStreamPointer(
IKsPinImpl * This;
DPRINT("KsPinGetFirstCloneStreamPointer %p\n", Pin);
-DbgBreakPoint();
+ DbgBreakPoint();
This = (IKsPinImpl*)CONTAINING_RECORD(Pin, IKsPinImpl, Pin);
/* return first cloned stream pointer */
return &This->ClonedStreamPointer->StreamPointer;
@@ -1476,7 +1600,7 @@ KsStreamPointerGetNextClone(
PKSISTREAM_POINTER Pointer = (PKSISTREAM_POINTER)StreamPointer;
DPRINT("KsStreamPointerGetNextClone\n");
-DbgBreakPoint();
+ DbgBreakPoint();
/* is there a another cloned stream pointer */
if (!Pointer->Next)
return NULL;
@@ -1484,7 +1608,101 @@ DbgBreakPoint();
/* return next stream pointer */
return &Pointer->Next->StreamPointer;
}
+
+VOID
+NTAPI
+IKsPin_PinCentricWorker(
+ IN PVOID Parameter)
+{
+ PIO_STACK_LOCATION IoStack;
+ PKSSTREAM_HEADER Header;
+ ULONG NumHeaders;
+ NTSTATUS Status;
+ PIRP Irp;
+ IKsPinImpl * This = (IKsPinImpl*)Parameter;
+
+ DPRINT("IKsPin_PinCentricWorker\n");
+
+ /* sanity checks */
+ ASSERT(This);
+ ASSERT(This->Pin.Descriptor);
+ ASSERT(This->Pin.Descriptor->Dispatch);
+ ASSERT(This->Pin.Descriptor->Dispatch->Process);
+ ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL);
+ ASSERT(!(This->Pin.Descriptor->Flags & KSPIN_FLAG_DISPATCH_LEVEL_PROCESSING));
+ ASSERT(This->LeadingEdgeStreamPointer);
+
+ do
+ {
+ /* do we have an irp packet */
+ if (!This->Irp)
+ {
+ /* fetch new irp packet */
+ This->Irp = KsRemoveIrpFromCancelableQueue(&This->IrpList, &This->IrpListLock, KsListEntryHead, KsAcquireAndRemoveOnlySingleItem);
+
+ if (!This->Irp)
+ {
+ /* reached last packet */
+ break;
+ }
+ }
+
+ /* get current irp stack location */
+ IoStack = IoGetCurrentIrpStackLocation(This->Irp);
+
+ if (This->Irp->RequestorMode == UserMode)
+ This->LeadingEdgeStreamPointer->StreamPointer.StreamHeader = Header = (PKSSTREAM_HEADER)This->Irp->AssociatedIrp.SystemBuffer;
+ else
+ This->LeadingEdgeStreamPointer->StreamPointer.StreamHeader = Header = (PKSSTREAM_HEADER)This->Irp->UserBuffer;
+
+ /* calculate num headers */
+ NumHeaders = IoStack->Parameters.DeviceIoControl.OutputBufferLength / Header->Size;
+
+ /* assume headers of same length */
+ ASSERT(IoStack->Parameters.DeviceIoControl.OutputBufferLength % Header->Size == 0);
+
+ /* FIXME support multiple stream headers */
+ ASSERT(NumHeaders == 1);
+
+ if (This->Irp->RequestorMode == UserMode)
+ {
+ /* prepare header */
+ Header->Data = MmGetSystemAddressForMdlSafe(This->Irp->MdlAddress, NormalPagePriority);
+ }
+
+ /* set up stream pointer */
+ This->LeadingEdgeStreamPointer->Irp = Irp = This->Irp;
+ This->LeadingEdgeStreamPointer->StreamPointer.Context = NULL;
+ This->LeadingEdgeStreamPointer->StreamPointer.Pin = &This->Pin;
+ This->LeadingEdgeStreamPointer->StreamPointer.OffsetOut.Count = max(Header->DataUsed, Header->FrameExtent);
+ This->LeadingEdgeStreamPointer->StreamPointer.OffsetOut.Data = Header->Data;
+ This->LeadingEdgeStreamPointer->StreamPointer.OffsetOut.Count = max(Header->DataUsed, Header->FrameExtent);
+ This->LeadingEdgeStreamPointer->StreamPointer.OffsetOut.Remaining = max(Header->DataUsed, Header->FrameExtent);
+ This->LeadingEdgeStreamPointer->Pin = &This->Pin;
+
+ DPRINT("IKsPin_PinCentricWorker calling Pin Process Routine\n");
+
+ Status = This->Pin.Descriptor->Dispatch->Process(&This->Pin);
+ DPRINT("IKsPin_PinCentricWorker Status %lx, Count %lu Remaining %lu\n", Status,
+ This->LeadingEdgeStreamPointer->StreamPointer.Offset->Count,
+ This->LeadingEdgeStreamPointer->StreamPointer.Offset->Remaining);
+
+ ASSERT(Status != STATUS_PENDING);
+
+ // HACK complete irp
+ Irp->IoStatus.Information = max(Header->DataUsed, Header->FrameExtent);
+ Irp->IoStatus.Status = Status;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ KsDecrementCountedWorker(This->PinWorker);
+
+
+ break;
+
+ }while(TRUE);
+}
+
NTSTATUS
+NTAPI
IKsPin_DispatchKsStream(
PDEVICE_OBJECT DeviceObject,
PIRP Irp,
@@ -1492,6 +1710,7 @@ IKsPin_DispatchKsStream(
{
PKSPROCESSPIN_INDEXENTRY ProcessPinIndex;
PKSFILTER Filter;
+ PIO_STACK_LOCATION IoStack;
NTSTATUS Status = STATUS_SUCCESS;
DPRINT("IKsPin_DispatchKsStream\n");
@@ -1499,18 +1718,41 @@ IKsPin_DispatchKsStream(
/* FIXME handle reset states */
ASSERT(This->Pin.ResetState == KSRESET_END);
- /* mark irp as pending */
- IoMarkIrpPending(Irp);
+ /* get current stack location */
+ IoStack = IoGetCurrentIrpStackLocation(Irp);
- /* add irp to cancelable queue */
- KsAddIrpToCancelableQueue(&This->IrpList, &This->IrpListLock, Irp, KsListEntryTail, NULL /* FIXME */);
+ if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_WRITE_STREAM)
+ Status = KsProbeStreamIrp(Irp, KSSTREAM_WRITE | KSPROBE_ALLOCATEMDL | KSPROBE_PROBEANDLOCK | KSPROBE_SYSTEMADDRESS, This->Pin.StreamHeaderSize);
+ else
+ Status = KsProbeStreamIrp(Irp, KSSTREAM_READ | KSPROBE_ALLOCATEMDL | KSPROBE_PROBEANDLOCK | KSPROBE_SYSTEMADDRESS, This->Pin.StreamHeaderSize);
+
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("KsProbeStreamIrp failed with %x\n", Status);
+
+ Irp->IoStatus.Status = Status;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return Status;
+ }
if (This->Pin.Descriptor->Dispatch->Process)
{
/* it is a pin centric avstream */
- ASSERT(0);
- //Status = This->Pin.Descriptor->Dispatch->Process(&This->Pin);
- /* TODO */
+
+ /* mark irp as pending */
+ IoMarkIrpPending(Irp);
+
+ /* add irp to cancelable queue */
+ KsAddIrpToCancelableQueue(&This->IrpList, &This->IrpListLock, Irp, KsListEntryTail, NULL /* FIXME */);
+
+ /* sanity checks */
+ ASSERT(!(This->Pin.Descriptor->Flags & KSPIN_FLAG_DISPATCH_LEVEL_PROCESSING));
+ ASSERT(This->PinWorker);
+
+ /* start the processing loop */
+ KsIncrementCountedWorker(This->PinWorker);
+
+ Status = STATUS_PENDING;
}
else
{
@@ -1534,9 +1776,17 @@ IKsPin_DispatchKsStream(
return STATUS_UNSUCCESSFUL;
}
+ /* mark irp as pending */
+ IoMarkIrpPending(Irp);
+
+ /* add irp to cancelable queue */
+ KsAddIrpToCancelableQueue(&This->IrpList, &This->IrpListLock, Irp, KsListEntryTail, NULL /* FIXME */);
+
+
Status = Filter->Descriptor->Dispatch->Process(Filter, ProcessPinIndex);
DPRINT("IKsPin_DispatchKsStream FilterCentric: Status %lx \n", Status);
+
}
return Status;
@@ -2037,6 +2287,41 @@ KspCreatePin(
return Status;
}
}
+ else if (Descriptor->Dispatch && Descriptor->Dispatch->Process)
+ {
+ /* pin centric processing filter */
+
+ /* allocate leading stream pointer */
+ Status = _KsEdit(This->Pin.Bag, (PVOID*)&This->LeadingEdgeStreamPointer, sizeof(KSISTREAM_POINTER), sizeof(KSISTREAM_POINTER), 0);
+
+ /* FIXME cleanup */
+ ASSERT(Status == STATUS_SUCCESS);
+
+ /* FIXME cleanup */
+ ASSERT(Status == STATUS_SUCCESS);
+
+ /* setup stream pointer offset */
+ This->LeadingEdgeStreamPointer->StreamPointer.Offset = &This->LeadingEdgeStreamPointer->StreamPointer.OffsetOut;
+
+ /* initialize work item */
+ ExInitializeWorkItem(&This->PinWorkQueueItem, IKsPin_PinCentricWorker, (PVOID)This);
+
+ /* allocate counted work item */
+ Status = KsRegisterCountedWorker(HyperCriticalWorkQueue, &This->PinWorkQueueItem, &This->PinWorker);
+
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT("Failed to register Worker %lx\n", Status);
+ KsFreeObjectBag((KSOBJECT_BAG)This->Pin.Bag);
+ KsFreeObjectHeader(&This->ObjectHeader);
+ FreeItem(This);
+ FreeItem(CreateItem);
+ return Status;
+ }
+
+ KeInitializeEvent(&This->FrameComplete, NotificationEvent, FALSE);
+
+ }
/* FIXME add pin instance to filter instance */
@@ -2045,7 +2330,6 @@ KspCreatePin(
{
Status = Descriptor->Dispatch->SetDataFormat(&This->Pin, NULL, NULL, This->Pin.ConnectionFormat, NULL);
DPRINT("KspCreatePin SetDataFormat %lx\n", Status);
- DbgBreakPoint();
}
@@ -2058,7 +2342,6 @@ KspCreatePin(
}
-
DPRINT("KspCreatePin Status %lx\n", Status);
if (!NT_SUCCESS(Status) && Status != STATUS_PENDING)
From dfb82f3856967a4394e5e8ab1814c750f15734f0 Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Sun, 4 Apr 2010 21:43:51 +0000
Subject: [PATCH 039/261] [NTOSKRNL] - Revert r46720 and fix the issue properly
svn path=/trunk/; revision=46724
---
reactos/ntoskrnl/io/iomgr/irp.c | 19 +++----------------
reactos/ntoskrnl/io/pnpmgr/pnpmgr.c | 5 ++++-
2 files changed, 7 insertions(+), 17 deletions(-)
diff --git a/reactos/ntoskrnl/io/iomgr/irp.c b/reactos/ntoskrnl/io/iomgr/irp.c
index 21870d5f9cc..0863f58907b 100644
--- a/reactos/ntoskrnl/io/iomgr/irp.c
+++ b/reactos/ntoskrnl/io/iomgr/irp.c
@@ -460,22 +460,6 @@ IopCompleteRequest(IN PKAPC Apc,
}
else
{
- /* Check if we have an associated user IOSB */
- if (Irp->UserIosb)
- {
- /* We do, so let's give them the final status */
- _SEH2_TRY
- {
- /* Save the IOSB Information */
- *Irp->UserIosb = Irp->IoStatus;
- }
- _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
- {
- /* Ignore any error */
- }
- _SEH2_END;
- }
-
/*
* Either we didn't return from the request, or we did return but this
* request was synchronous.
@@ -485,6 +469,9 @@ IopCompleteRequest(IN PKAPC Apc,
/* So we did return with a synch operation, was it the IRP? */
if (Irp->Flags & IRP_SYNCHRONOUS_API)
{
+ /* Yes, this IRP was synchronous, so return the I/O Status */
+ *Irp->UserIosb = Irp->IoStatus;
+
/* Now check if the user gave an event */
if (Irp->UserEvent)
{
diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
index 5d6c13336bc..0213d04d13e 100644
--- a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
+++ b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
@@ -163,7 +163,10 @@ IopStartDevice(
DPRINT("IopInitiatePnpIrp(IRP_MN_FILTER_RESOURCE_REQUIREMENTS) failed\n");
return Status;
}
- DeviceNode->ResourceRequirements = (PIO_RESOURCE_REQUIREMENTS_LIST)IoStatusBlock.Information;
+ else if (NT_SUCCESS(Status))
+ {
+ DeviceNode->ResourceRequirements = (PIO_RESOURCE_REQUIREMENTS_LIST)IoStatusBlock.Information;
+ }
Status = IopAssignDeviceResources(DeviceNode, &RequiredLength);
if (NT_SUCCESS(Status))
From 215581f39f161e60ff2e888c3e0012a538c8b468 Mon Sep 17 00:00:00 2001
From: Christoph von Wittich
Date: Mon, 5 Apr 2010 09:29:01 +0000
Subject: [PATCH 040/261] [crypt32] sync crypt32 to wine 1.1.42
svn path=/trunk/; revision=46727
---
reactos/dll/win32/crypt32/base64.c | 54 ++++++++++--------------------
1 file changed, 17 insertions(+), 37 deletions(-)
diff --git a/reactos/dll/win32/crypt32/base64.c b/reactos/dll/win32/crypt32/base64.c
index 4a6504a488e..7a23dd9a111 100644
--- a/reactos/dll/win32/crypt32/base64.c
+++ b/reactos/dll/win32/crypt32/base64.c
@@ -99,8 +99,7 @@ static LONG encodeBase64A(const BYTE *in_buf, int in_len, LPCSTR sep,
TRACE("bytes is %d, pad bytes is %d\n", bytes, pad_bytes);
needed = bytes + pad_bytes + 1;
- if (sep)
- needed += (needed / 64 + 1) * strlen(sep);
+ needed += (needed / 64 + 1) * strlen(sep);
if (needed > *out_len)
{
@@ -117,7 +116,7 @@ static LONG encodeBase64A(const BYTE *in_buf, int in_len, LPCSTR sep,
i = 0;
while (div > 0)
{
- if (sep && i && i % 64 == 0)
+ if (i && i % 64 == 0)
{
strcpy(ptr, sep);
ptr += strlen(sep);
@@ -163,8 +162,7 @@ static LONG encodeBase64A(const BYTE *in_buf, int in_len, LPCSTR sep,
*ptr++ = '=';
break;
}
- if (sep)
- strcpy(ptr, sep);
+ strcpy(ptr, sep);
return ERROR_SUCCESS;
}
@@ -180,7 +178,7 @@ static BOOL BinaryToBase64A(const BYTE *pbBinary,
if (dwFlags & CRYPT_STRING_NOCR)
sep = lf;
else if (dwFlags & CRYPT_STRING_NOCRLF)
- sep = NULL;
+ sep = "";
else
sep = crlf;
switch (dwFlags & 0x0fffffff)
@@ -204,8 +202,6 @@ static BOOL BinaryToBase64A(const BYTE *pbBinary,
charsNeeded = 0;
encodeBase64A(pbBinary, cbBinary, sep, NULL, &charsNeeded);
- if (sep)
- charsNeeded += strlen(sep);
if (header)
charsNeeded += strlen(header) + strlen(sep);
if (trailer)
@@ -219,11 +215,8 @@ static BOOL BinaryToBase64A(const BYTE *pbBinary,
{
strcpy(ptr, header);
ptr += strlen(ptr);
- if (sep)
- {
- strcpy(ptr, sep);
- ptr += strlen(sep);
- }
+ strcpy(ptr, sep);
+ ptr += strlen(sep);
}
encodeBase64A(pbBinary, cbBinary, sep, ptr, &size);
ptr += size - 1;
@@ -231,11 +224,8 @@ static BOOL BinaryToBase64A(const BYTE *pbBinary,
{
strcpy(ptr, trailer);
ptr += strlen(ptr);
- if (sep)
- {
- strcpy(ptr, sep);
- ptr += strlen(sep);
- }
+ strcpy(ptr, sep);
+ ptr += strlen(sep);
}
*pcchString = charsNeeded - 1;
}
@@ -304,8 +294,7 @@ static LONG encodeBase64W(const BYTE *in_buf, int in_len, LPCWSTR sep,
TRACE("bytes is %d, pad bytes is %d\n", bytes, pad_bytes);
needed = bytes + pad_bytes + 1;
- if (sep)
- needed += (needed / 64 + 1) * strlenW(sep);
+ needed += (needed / 64 + 1) * strlenW(sep);
if (needed > *out_len)
{
@@ -322,7 +311,7 @@ static LONG encodeBase64W(const BYTE *in_buf, int in_len, LPCWSTR sep,
i = 0;
while (div > 0)
{
- if (sep && i && i % 64 == 0)
+ if (i && i % 64 == 0)
{
strcpyW(ptr, sep);
ptr += strlenW(sep);
@@ -368,8 +357,7 @@ static LONG encodeBase64W(const BYTE *in_buf, int in_len, LPCWSTR sep,
*ptr++ = '=';
break;
}
- if (sep)
- strcpyW(ptr, sep);
+ strcpyW(ptr, sep);
return ERROR_SUCCESS;
}
@@ -377,7 +365,7 @@ static LONG encodeBase64W(const BYTE *in_buf, int in_len, LPCWSTR sep,
static BOOL BinaryToBase64W(const BYTE *pbBinary,
DWORD cbBinary, DWORD dwFlags, LPWSTR pszString, DWORD *pcchString)
{
- static const WCHAR crlf[] = { '\r','\n',0 }, lf[] = { '\n',0 };
+ static const WCHAR crlf[] = { '\r','\n',0 }, lf[] = { '\n',0 }, empty[] = {0};
BOOL ret = TRUE;
LPCWSTR header = NULL, trailer = NULL, sep;
DWORD charsNeeded;
@@ -385,7 +373,7 @@ static BOOL BinaryToBase64W(const BYTE *pbBinary,
if (dwFlags & CRYPT_STRING_NOCR)
sep = lf;
else if (dwFlags & CRYPT_STRING_NOCRLF)
- sep = NULL;
+ sep = empty;
else
sep = crlf;
switch (dwFlags & 0x0fffffff)
@@ -409,8 +397,6 @@ static BOOL BinaryToBase64W(const BYTE *pbBinary,
charsNeeded = 0;
encodeBase64W(pbBinary, cbBinary, sep, NULL, &charsNeeded);
- if (sep)
- charsNeeded += strlenW(sep);
if (header)
charsNeeded += strlenW(header) + strlenW(sep);
if (trailer)
@@ -424,11 +410,8 @@ static BOOL BinaryToBase64W(const BYTE *pbBinary,
{
strcpyW(ptr, header);
ptr += strlenW(ptr);
- if (sep)
- {
- strcpyW(ptr, sep);
- ptr += strlenW(sep);
- }
+ strcpyW(ptr, sep);
+ ptr += strlenW(sep);
}
encodeBase64W(pbBinary, cbBinary, sep, ptr, &size);
ptr += size - 1;
@@ -436,11 +419,8 @@ static BOOL BinaryToBase64W(const BYTE *pbBinary,
{
strcpyW(ptr, trailer);
ptr += strlenW(ptr);
- if (sep)
- {
- strcpyW(ptr, sep);
- ptr += strlenW(sep);
- }
+ strcpyW(ptr, sep);
+ ptr += strlenW(sep);
}
*pcchString = charsNeeded - 1;
}
From c174a972b499efd7f8e88d57a3189ffab467c645 Mon Sep 17 00:00:00 2001
From: Christoph von Wittich
Date: Mon, 5 Apr 2010 09:39:06 +0000
Subject: [PATCH 041/261] [mscoree] sync mscoree to wine 1.1.42
svn path=/trunk/; revision=46728
---
reactos/dll/win32/mscoree/mscoree.spec | 2 +-
reactos/dll/win32/mscoree/mscoree_main.c | 33 +++++++++++++++++++++---
2 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/reactos/dll/win32/mscoree/mscoree.spec b/reactos/dll/win32/mscoree/mscoree.spec
index 9365f189b51..8e25cec2b7d 100644
--- a/reactos/dll/win32/mscoree/mscoree.spec
+++ b/reactos/dll/win32/mscoree/mscoree.spec
@@ -7,7 +7,7 @@
@ stub CallFunctionShim
@ stub CloseCtrs
-@ stub ClrCreateManagedInstance
+@ stdcall ClrCreateManagedInstance(wstr ptr ptr)
@ stub CoEEShutDownCOM
@ stdcall CoInitializeCor(long)
@ stub CoInitializeEE
diff --git a/reactos/dll/win32/mscoree/mscoree_main.c b/reactos/dll/win32/mscoree/mscoree_main.c
index dcdc91a5cc1..5b20c854c2e 100644
--- a/reactos/dll/win32/mscoree/mscoree_main.c
+++ b/reactos/dll/win32/mscoree/mscoree_main.c
@@ -91,9 +91,9 @@ HRESULT WINAPI CorBindToRuntimeHost(LPCWSTR pwszVersion, LPCWSTR pwszBuildFlavor
{
WCHAR *mono_exe;
- FIXME("(%s, %s, %s, %p, %d, %p, %p, %p): semi-stub!\n", debugstr_w(pwszVersion),
+ FIXME("(%s, %s, %s, %p, %d, %s, %s, %p): semi-stub!\n", debugstr_w(pwszVersion),
debugstr_w(pwszBuildFlavor), debugstr_w(pwszHostConfigFile), pReserved,
- startupFlags, rclsid, riid, ppv);
+ startupFlags, debugstr_guid(rclsid), debugstr_guid(riid), ppv);
if (!(mono_exe = get_mono_exe()))
{
@@ -144,6 +144,11 @@ __int32 WINAPI _CorExeMain(void)
PROCESS_INFORMATION pi;
WCHAR *mono_exe, *cmd_line;
DWORD size, exit_code;
+ static const WCHAR WINE_MONO_TRACE[]={'W','I','N','E','_','M','O','N','O','_','T','R','A','C','E',0};
+ static const WCHAR trace_switch_start[]={'"','-','-','t','r','a','c','e','=',0};
+ static const WCHAR trace_switch_end[]={'"',' ',0};
+ int trace_size;
+ WCHAR trace_setting[256];
if (!(mono_exe = get_mono_exe()))
{
@@ -151,7 +156,13 @@ __int32 WINAPI _CorExeMain(void)
return -1;
}
+ trace_size = GetEnvironmentVariableW(WINE_MONO_TRACE, trace_setting, sizeof(trace_setting)/sizeof(WCHAR));
+
size = (lstrlenW(mono_exe) + lstrlenW(GetCommandLineW()) + 1) * sizeof(WCHAR);
+
+ if (trace_size)
+ size += (trace_size + lstrlenW(trace_switch_start) + lstrlenW(trace_switch_end)) * sizeof(WCHAR);
+
if (!(cmd_line = HeapAlloc(GetProcessHeap(), 0, size)))
{
HeapFree(GetProcessHeap(), 0, mono_exe);
@@ -160,6 +171,14 @@ __int32 WINAPI _CorExeMain(void)
lstrcpyW(cmd_line, mono_exe);
HeapFree(GetProcessHeap(), 0, mono_exe);
+
+ if (trace_size)
+ {
+ lstrcatW(cmd_line, trace_switch_start);
+ lstrcatW(cmd_line, trace_setting);
+ lstrcatW(cmd_line, trace_switch_end);
+ }
+
lstrcatW(cmd_line, GetCommandLineW());
TRACE("new command line: %s\n", debugstr_w(cmd_line));
@@ -271,7 +290,7 @@ HRESULT WINAPI CoInitializeCor(DWORD fFlags)
HRESULT WINAPI GetAssemblyMDImport(LPCWSTR szFileName, REFIID riid, IUnknown **ppIUnk)
{
- FIXME("(%p %s, %p, %p): stub\n", szFileName, debugstr_w(szFileName), riid, *ppIUnk);
+ FIXME("(%p %s, %s, %p): stub\n", szFileName, debugstr_w(szFileName), debugstr_guid(riid), *ppIUnk);
return ERROR_CALL_NOT_IMPLEMENTED;
}
@@ -324,6 +343,12 @@ HRESULT WINAPI CorBindToCurrentRuntime(LPCWSTR filename, REFCLSID rclsid, REFIID
return E_NOTIMPL;
}
+STDAPI ClrCreateManagedInstance(LPCWSTR pTypeName, REFIID riid, void **ppObject)
+{
+ FIXME("(%s,%s,%p)\n", debugstr_w(pTypeName), debugstr_guid(riid), ppObject);
+ return E_NOTIMPL;
+}
+
BOOL WINAPI StrongNameSignatureVerification(LPCWSTR filename, DWORD inFlags, DWORD* pOutFlags)
{
FIXME("(%s, 0x%X, %p): stub\n", debugstr_w(filename), inFlags, pOutFlags);
@@ -338,7 +363,7 @@ BOOL WINAPI StrongNameSignatureVerificationEx(LPCWSTR filename, BOOL forceVerifi
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
{
- FIXME("(%p, %p, %p): stub\n", rclsid, riid, ppv);
+ FIXME("(%s, %s, %p): stub\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
if(!ppv)
return E_INVALIDARG;
From 59929a1790e384d4e08ba76b0128c8faa4021737 Mon Sep 17 00:00:00 2001
From: Christoph von Wittich
Date: Mon, 5 Apr 2010 09:40:24 +0000
Subject: [PATCH 042/261] [qedit] sync qedit to wine 1.1.42
svn path=/trunk/; revision=46729
---
reactos/dll/directx/qedit/samplegrabber.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/reactos/dll/directx/qedit/samplegrabber.c b/reactos/dll/directx/qedit/samplegrabber.c
index 1875c51c49e..78a7306e10e 100644
--- a/reactos/dll/directx/qedit/samplegrabber.c
+++ b/reactos/dll/directx/qedit/samplegrabber.c
@@ -854,7 +854,7 @@ SampleGrabber_ISampleGrabber_GetCurrentBuffer(ISampleGrabber *iface, LONG *bufSi
static HRESULT WINAPI
SampleGrabber_ISampleGrabber_GetCurrentSample(ISampleGrabber *iface, IMediaSample **sample)
{
- /* MS doesn't implement it either, noone should call it */
+ /* MS doesn't implement it either, no one should call it */
WARN("(%p): not implemented\n", sample);
return E_NOTIMPL;
}
@@ -1264,7 +1264,7 @@ SampleGrabber_IPin_EnumMediaTypes(IPin *iface, IEnumMediaTypes **mtypes)
TRACE("(%p)->(%p)\n", This, mtypes);
if (!mtypes)
return E_POINTER;
- *mtypes = mediaenum_create(This->sg->pin_in.pair ? &This->sg->mtype : (const AM_MEDIA_TYPE *)NULL);
+ *mtypes = mediaenum_create(This->sg->pin_in.pair ? &This->sg->mtype : NULL);
return *mtypes ? S_OK : E_OUTOFMEMORY;
}
From 56ab20eda40f98ac622df3700e418c563ca814a6 Mon Sep 17 00:00:00 2001
From: Christoph von Wittich
Date: Mon, 5 Apr 2010 09:44:43 +0000
Subject: [PATCH 043/261] [quartz] sync quartz to wine 1.1.42
svn path=/trunk/; revision=46730
---
reactos/dll/directx/quartz/avidec.c | 2 +-
reactos/dll/directx/quartz/avisplit.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/reactos/dll/directx/quartz/avidec.c b/reactos/dll/directx/quartz/avidec.c
index 68b1908d6e6..8469bbc9f29 100644
--- a/reactos/dll/directx/quartz/avidec.c
+++ b/reactos/dll/directx/quartz/avidec.c
@@ -203,7 +203,7 @@ static HRESULT AVIDec_ConnectInput(InputPin *pin, const AM_MEDIA_TYPE * pmt)
bmi = &format2->bmiHeader;
else
goto failed;
- TRACE("Fourcc: %s\n", debugstr_an((char *)&pmt->subtype.Data1, 4));
+ TRACE("Fourcc: %s\n", debugstr_an((const char *)&pmt->subtype.Data1, 4));
This->hvid = ICLocate(pmt->majortype.Data1, pmt->subtype.Data1, bmi, NULL, ICMODE_DECOMPRESS);
if (This->hvid)
diff --git a/reactos/dll/directx/quartz/avisplit.c b/reactos/dll/directx/quartz/avisplit.c
index faa844b4848..42ec2ae2b34 100644
--- a/reactos/dll/directx/quartz/avisplit.c
+++ b/reactos/dll/directx/quartz/avisplit.c
@@ -692,7 +692,7 @@ static HRESULT AVISplitter_ProcessStreamList(AVISplitterImpl * This, const BYTE
amt.formattype = FORMAT_WaveFormatEx;
break;
default:
- FIXME("fccType %.4s not handled yet\n", (char *)&pStrHdr->fccType);
+ FIXME("fccType %.4s not handled yet\n", (const char *)&pStrHdr->fccType);
amt.formattype = FORMAT_None;
}
amt.majortype = MEDIATYPE_Video;
@@ -793,7 +793,7 @@ static HRESULT AVISplitter_ProcessStreamList(AVISplitterImpl * This, const BYTE
TRACE("bIndexSubType: %hd\n", pIndex->bIndexSubType);
TRACE("bIndexType: %hd\n", pIndex->bIndexType);
TRACE("nEntriesInUse: %u\n", pIndex->nEntriesInUse);
- TRACE("dwChunkId: %.4s\n", (char *)&pIndex->dwChunkId);
+ TRACE("dwChunkId: %.4s\n", (const char *)&pIndex->dwChunkId);
if (pIndex->dwReserved[0])
TRACE("dwReserved[0]: %u\n", pIndex->dwReserved[0]);
if (pIndex->dwReserved[2])
From 817ca6d3d7ea4e505e56ee4098ca3ee96b6ceafb Mon Sep 17 00:00:00 2001
From: Gregor Schneider
Date: Mon, 5 Apr 2010 09:51:49 +0000
Subject: [PATCH 044/261] =?UTF-8?q?[SHELL]=20-=20Updated=20Spanish=20trans?=
=?UTF-8?q?lation=20by=20Javier=20Fernand=C3=A9z=20See=20issue=20#1494=20f?=
=?UTF-8?q?or=20more=20details.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
svn path=/trunk/; revision=46731
---
reactos/dll/win32/shell32/lang/es-ES.rc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/reactos/dll/win32/shell32/lang/es-ES.rc b/reactos/dll/win32/shell32/lang/es-ES.rc
index a0dacf6a7a7..8704146f23c 100644
--- a/reactos/dll/win32/shell32/lang/es-ES.rc
+++ b/reactos/dll/win32/shell32/lang/es-ES.rc
@@ -668,8 +668,8 @@ BEGIN
IDS_RESTART_PROMPT "¿Desea reiniciar el equipo?"
IDS_SHUTDOWN_TITLE "Apagar"
IDS_SHUTDOWN_PROMPT "¿Desea apagar el equipo?"
- IDS_LOGOFF_TITLE "Log Off"
- IDS_LOGOFF_PROMPT "Do you want to log off?"
+ IDS_LOGOFF_TITLE "Cerrar sesión"
+ IDS_LOGOFF_PROMPT "¿Desea cerrar la sesión?"
/* shell folder path default values */
IDS_PROGRAMS "Menú Inicio\\Programas"
From 222e4f03b92c18f0e6cd9ed41295396ae397b813 Mon Sep 17 00:00:00 2001
From: Michael Martin
Date: Mon, 5 Apr 2010 12:23:30 +0000
Subject: [PATCH 045/261] [usb/usbehci] - Modify UsbDevice structure to hold
all the device's configurations vice only the active one. - Change code to
handle new UsbDevice structure and data. - Add missing Status assignment for
IOCTLs get device handle and get hub count. - When checking port status in
deffered routine continue looping through the ports if the device is not high
speed. - Implement direct call functions InitializeUsbDevice,
QueryDeviceInformation and GetControllerInformation. - Fix incorrect return
type for direct call function GetUSBDIVersion. - Remove no longer needed
structures from usbiffn.h as they are now in usbbusif.h and hubbusif.h. -
Code based on XEN PV Drivers by James Harper.
svn path=/trunk/; revision=46735
---
reactos/drivers/usb/usbehci/fdo.c | 7 +-
reactos/drivers/usb/usbehci/irp.c | 63 ++++++++-----
reactos/drivers/usb/usbehci/pdo.c | 70 ++++++++++++---
reactos/drivers/usb/usbehci/usbehci.h | 41 +++++++--
reactos/drivers/usb/usbehci/usbiffn.c | 123 ++++++++++++++++++++++++--
reactos/drivers/usb/usbehci/usbiffn.h | 72 +--------------
6 files changed, 258 insertions(+), 118 deletions(-)
diff --git a/reactos/drivers/usb/usbehci/fdo.c b/reactos/drivers/usb/usbehci/fdo.c
index b1ec5503cb6..b85ab4fefc2 100644
--- a/reactos/drivers/usb/usbehci/fdo.c
+++ b/reactos/drivers/usb/usbehci/fdo.c
@@ -83,11 +83,11 @@ EhciDefferedRoutine(PKDPC Dpc, PVOID DeferredContext, PVOID SystemArgument1, PVO
DPRINT1("Releasing ownership to companion host controller!\n");
/* Release ownership to companion host controller */
WRITE_REGISTER_ULONG((PULONG) ((Base + EHCI_PORTSC) + (4 * i)), 0x4000);
+ continue;
}
}
KeStallExecutionProcessor(30);
- DPRINT("port tmp %x\n", tmp);
/* As per USB 2.0 Specs, 9.1.2. Reset the port and clear the status change */
tmp |= 0x100 | 0x02;
@@ -545,6 +545,7 @@ StartDevice(PDEVICE_OBJECT DeviceObject, PCM_PARTIAL_RESOURCE_LIST raw, PCM_PART
StartEhci(DeviceObject);
FdoDeviceExtension->DeviceState = DEVICESTARTED;
+
return STATUS_SUCCESS;
}
@@ -814,7 +815,6 @@ AddDevice(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT Pdo)
IoDetachDevice(FdoDeviceExtension->LowerDevice);
IoDeleteSymbolicLink(&SymLinkName);
IoDeleteDevice(Fdo);
-
return STATUS_UNSUCCESSFUL;
}
@@ -840,11 +840,14 @@ AddDevice(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT Pdo)
if (!NT_SUCCESS(Status))
{
DPRINT1("Unable to register device interface!\n");
+ ASSERT(FALSE);
}
else
{
Status = IoSetDeviceInterfaceState(&InterfaceSymLinkName, TRUE);
DPRINT1("SetInterfaceState %x\n", Status);
+ if (!NT_SUCCESS(Status))
+ ASSERT(FALSE);
}
Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
diff --git a/reactos/drivers/usb/usbehci/irp.c b/reactos/drivers/usb/usbehci/irp.c
index 06d7c50ab08..54b3b9738d2 100644
--- a/reactos/drivers/usb/usbehci/irp.c
+++ b/reactos/drivers/usb/usbehci/irp.c
@@ -101,7 +101,7 @@ CompletePendingURBRequest(PPDO_DEVICE_EXTENSION DeviceExtension)
DPRINT1("--->TransferBufferLength %x\n",Urb->UrbBulkOrInterruptTransfer.TransferBufferLength);
DPRINT1("--->TransferBuffer %x\n",Urb->UrbBulkOrInterruptTransfer.TransferBuffer);
DPRINT1("--->PipeHandle %x\n",Urb->UrbBulkOrInterruptTransfer.PipeHandle);
- DPRINT1("---->(PVOID)&UsbDevice->EndPointDescriptor %x\n", (PVOID)&UsbDevice->EndPointDescriptor);
+ DPRINT1("---->(PVOID)&UsbDevice->EndPointDescriptor %x\n", (PVOID)&UsbDevice->ActiveInterface->EndPoints[0]->EndPointDescriptor);
DPRINT1("--->TransferFlags %x\n", Urb->UrbBulkOrInterruptTransfer.TransferFlags);
RtlZeroMemory(Urb->UrbBulkOrInterruptTransfer.TransferBuffer, Urb->UrbBulkOrInterruptTransfer.TransferBufferLength);
@@ -142,6 +142,7 @@ CompletePendingURBRequest(PPDO_DEVICE_EXTENSION DeviceExtension)
DPRINT1("Uknown identifier\n");
Urb->UrbHeader.Status = USBD_STATUS_INVALID_URB_FUNCTION;
Status = STATUS_UNSUCCESSFUL;
+ ASSERT(FALSE);
}
break;
}
@@ -164,19 +165,39 @@ CompletePendingURBRequest(PPDO_DEVICE_EXTENSION DeviceExtension)
}
case USB_CONFIGURATION_DESCRIPTOR_TYPE:
{
- DPRINT1("USB CONFIG DESC\n");
- ULONG FullDescriptorLength = sizeof(USB_CONFIGURATION_DESCRIPTOR) +
- sizeof(USB_INTERFACE_DESCRIPTOR) +
- sizeof(USB_ENDPOINT_DESCRIPTOR);
+ PUCHAR BufPtr;
+ LONG i, j;
- if (Urb->UrbControlDescriptorRequest.TransferBufferLength >= FullDescriptorLength)
+ DPRINT1("USB CONFIG DESC\n");
+
+ if (Urb->UrbControlDescriptorRequest.TransferBufferLength >= UsbDevice->ActiveConfig->ConfigurationDescriptor.wTotalLength)
{
- Urb->UrbControlDescriptorRequest.TransferBufferLength = FullDescriptorLength;
+ Urb->UrbControlDescriptorRequest.TransferBufferLength = UsbDevice->ActiveConfig->ConfigurationDescriptor.wTotalLength;
+ }
+ else
+ {
+ DPRINT1("Buffer to small!!!\n");
+ ASSERT(FALSE);
+ }
+
+ BufPtr = (PUCHAR)Urb->UrbControlDescriptorRequest.TransferBuffer;
+
+ /* Copy the Configuration Descriptor */
+ RtlCopyMemory(BufPtr, &UsbDevice->ActiveConfig->ConfigurationDescriptor, sizeof(USB_CONFIGURATION_DESCRIPTOR));
+ BufPtr += sizeof(USB_CONFIGURATION_DESCRIPTOR);
+ for (i = 0; i < UsbDevice->ActiveConfig->ConfigurationDescriptor.bNumInterfaces; i++)
+ {
+ /* Copy the Interface Descriptor */
+ RtlCopyMemory(BufPtr, &UsbDevice->ActiveConfig->Interfaces[i]->InterfaceDescriptor, sizeof(USB_INTERFACE_DESCRIPTOR));
+ BufPtr += sizeof(USB_INTERFACE_DESCRIPTOR);
+ for (j = 0; j < UsbDevice->ActiveConfig->Interfaces[i]->InterfaceDescriptor.bNumEndpoints; j++)
+ {
+ /* Copy the EndPoint Descriptor */
+ RtlCopyMemory(BufPtr, &UsbDevice->ActiveConfig->Interfaces[i]->EndPoints[j]->EndPointDescriptor, sizeof(USB_ENDPOINT_DESCRIPTOR));
+ BufPtr += sizeof(USB_ENDPOINT_DESCRIPTOR);
+ }
}
- RtlCopyMemory(Urb->UrbControlDescriptorRequest.TransferBuffer,
- &UsbDevice->ConfigurationDescriptor,
- Urb->UrbControlDescriptorRequest.TransferBufferLength);
break;
}
case USB_STRING_DESCRIPTOR_TYPE:
@@ -213,7 +234,7 @@ CompletePendingURBRequest(PPDO_DEVICE_EXTENSION DeviceExtension)
DPRINT(" MaxPower = %d\n", Urb->UrbSelectConfiguration.ConfigurationDescriptor->MaxPower);
- Urb->UrbSelectConfiguration.ConfigurationHandle = (PVOID)&DeviceExtension->UsbDevices[0]->ConfigurationDescriptor;
+ Urb->UrbSelectConfiguration.ConfigurationHandle = (PVOID)&DeviceExtension->UsbDevices[0]->ActiveConfig->ConfigurationDescriptor;
DPRINT("ConfigHandle %x\n", Urb->UrbSelectConfiguration.ConfigurationHandle);
InterfaceInfo = &Urb->UrbSelectConfiguration.Interface;
@@ -229,10 +250,10 @@ CompletePendingURBRequest(PPDO_DEVICE_EXTENSION DeviceExtension)
DPRINT(" Reserved = %02x\n", (ULONG)InterfaceInfo->Reserved);
DPRINT(" InterfaceHandle = %p\n", InterfaceInfo->InterfaceHandle);
DPRINT(" NumberOfPipes = %d\n", InterfaceInfo->NumberOfPipes);
- InterfaceInfo->InterfaceHandle = (PVOID)&UsbDevice->InterfaceDescriptor;
- InterfaceInfo->Class = UsbDevice->InterfaceDescriptor.bInterfaceClass;
- InterfaceInfo->SubClass = UsbDevice->InterfaceDescriptor.bInterfaceSubClass;
- InterfaceInfo->Protocol = UsbDevice->InterfaceDescriptor.bInterfaceProtocol;
+ InterfaceInfo->InterfaceHandle = (PVOID)&UsbDevice->ActiveInterface->InterfaceDescriptor;
+ InterfaceInfo->Class = UsbDevice->ActiveInterface->InterfaceDescriptor.bInterfaceClass;
+ InterfaceInfo->SubClass = UsbDevice->ActiveInterface->InterfaceDescriptor.bInterfaceSubClass;
+ InterfaceInfo->Protocol = UsbDevice->ActiveInterface->InterfaceDescriptor.bInterfaceProtocol;
InterfaceInfo->Reserved = 0;
for (pCount = 0; pCount < InterfaceInfo->NumberOfPipes; pCount++)
@@ -245,11 +266,11 @@ CompletePendingURBRequest(PPDO_DEVICE_EXTENSION DeviceExtension)
DPRINT(" PipeHandle = %x\n", InterfaceInfo->Pipes[pCount].PipeHandle);
DPRINT(" MaximumTransferSize = %d\n", InterfaceInfo->Pipes[pCount].MaximumTransferSize);
DPRINT(" PipeFlags = %08x\n", InterfaceInfo->Pipes[pCount].PipeFlags);
- InterfaceInfo->Pipes[pCount].MaximumPacketSize = UsbDevice->EndPointDescriptor.wMaxPacketSize;
- InterfaceInfo->Pipes[pCount].EndpointAddress = UsbDevice->EndPointDescriptor.bEndpointAddress;
- InterfaceInfo->Pipes[pCount].Interval = UsbDevice->EndPointDescriptor.bInterval;
+ InterfaceInfo->Pipes[pCount].MaximumPacketSize = UsbDevice->ActiveInterface->EndPoints[pCount]->EndPointDescriptor.wMaxPacketSize;
+ InterfaceInfo->Pipes[pCount].EndpointAddress = UsbDevice->ActiveInterface->EndPoints[pCount]->EndPointDescriptor.bEndpointAddress;
+ InterfaceInfo->Pipes[pCount].Interval = UsbDevice->ActiveInterface->EndPoints[pCount]->EndPointDescriptor.bInterval;
InterfaceInfo->Pipes[pCount].PipeType = UsbdPipeTypeInterrupt;
- InterfaceInfo->Pipes[pCount].PipeHandle = (PVOID)&UsbDevice->EndPointDescriptor;
+ InterfaceInfo->Pipes[pCount].PipeHandle = (PVOID)&UsbDevice->ActiveInterface->EndPoints[pCount]->EndPointDescriptor;
if (InterfaceInfo->Pipes[pCount].MaximumTransferSize == 0)
InterfaceInfo->Pipes[pCount].MaximumTransferSize = 4096;
/* InterfaceInfo->Pipes[j].PipeFlags = 0; */
@@ -315,6 +336,7 @@ CompletePendingURBRequest(PPDO_DEVICE_EXTENSION DeviceExtension)
break;
}
case USB_DEVICE_CLASS_RESERVED:
+ DPRINT1("Reserved!!!\n");
case USB_DEVICE_CLASS_HUB:
{
PUSB_HUB_DESCRIPTOR UsbHubDescr = Urb->UrbControlVendorClassRequest.TransferBuffer;
@@ -328,7 +350,7 @@ CompletePendingURBRequest(PPDO_DEVICE_EXTENSION DeviceExtension)
/* FIXME: Handle this correctly */
UsbHubDescr->bDescriptorLength = sizeof(USB_HUB_DESCRIPTOR);
UsbHubDescr->bDescriptorType = 0x29;
- return;
+ break;
}
DPRINT1("USB_DEVICE_CLASS_HUB request\n");
UsbHubDescr->bDescriptorLength = sizeof(USB_HUB_DESCRIPTOR);
@@ -425,7 +447,6 @@ CompletePendingURBRequest(PPDO_DEVICE_EXTENSION DeviceExtension)
case USB_REQUEST_SET_ADDRESS:
{
DPRINT1("USB_REQUEST_SET_ADDRESS\n");
- ASSERT(FALSE);
break;
}
case USB_REQUEST_GET_DESCRIPTOR:
diff --git a/reactos/drivers/usb/usbehci/pdo.c b/reactos/drivers/usb/usbehci/pdo.c
index 6a0d735e851..84073a11fa0 100644
--- a/reactos/drivers/usb/usbehci/pdo.c
+++ b/reactos/drivers/usb/usbehci/pdo.c
@@ -11,8 +11,10 @@
#define NDEBUG
#include "usbehci.h"
-#include
+#include
+#include
#include "usbiffn.h"
+#include
#include
#include
@@ -51,8 +53,11 @@ const UCHAR ROOTHUB2_CONFIGURATION_DESCRIPTOR [] =
6: Self-powered,
5: Remote wakeup,
4..0: reserved */
- 0x00, /* MaxPower; */
+ 0x00 /* MaxPower; */
+};
+const UCHAR ROOTHUB2_INTERFACE_DESCRIPTOR [] =
+{
/* one interface */
0x09, /* bLength: Interface; */
0x04, /* bDescriptorType; Interface */
@@ -62,8 +67,11 @@ const UCHAR ROOTHUB2_CONFIGURATION_DESCRIPTOR [] =
0x09, /* bInterfaceClass; HUB_CLASSCODE */
0x01, /* bInterfaceSubClass; */
0x00, /* bInterfaceProtocol: */
- 0x00, /* iInterface; */
+ 0x00 /* iInterface; */
+};
+const UCHAR ROOTHUB2_ENDPOINT_DESCRIPTOR [] =
+{
/* one endpoint (status change endpoint) */
0x07, /* bLength; */
0x05, /* bDescriptorType; Endpoint */
@@ -87,7 +95,6 @@ UrbWorkerThread(PVOID Context)
DPRINT1("Thread terminated\n");
}
-/* FIXME: Do something better */
PVOID InternalCreateUsbDevice(UCHAR DeviceNumber, ULONG Port, PUSB_DEVICE Parent, BOOLEAN Hub)
{
PUSB_DEVICE UsbDevicePointer = NULL;
@@ -98,6 +105,8 @@ PVOID InternalCreateUsbDevice(UCHAR DeviceNumber, ULONG Port, PUSB_DEVICE Parent
return NULL;
}
+ RtlZeroMemory(UsbDevicePointer, sizeof(USB_DEVICE));
+
if ((Hub) && (!Parent))
{
DPRINT1("This is the root hub\n");
@@ -176,21 +185,27 @@ PdoDispatchInternalDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
if (Stack->Parameters.Others.Argument1)
{
/* Return the root hubs devicehandle */
+ DPRINT1("Returning RootHub Handle %x\n", PdoDeviceExtension->UsbDevices[0]);
*(PVOID *)Stack->Parameters.Others.Argument1 = (PVOID)PdoDeviceExtension->UsbDevices[0];
+ Status = STATUS_SUCCESS;
}
else
Status = STATUS_INVALID_DEVICE_REQUEST;
+
break;
+
}
case IOCTL_INTERNAL_USB_GET_HUB_COUNT:
{
DPRINT1("IOCTL_INTERNAL_USB_GET_HUB_COUNT %x\n", IOCTL_INTERNAL_USB_GET_HUB_COUNT);
+ ASSERT(Stack->Parameters.Others.Argument1 != NULL);
if (Stack->Parameters.Others.Argument1)
{
/* FIXME: Determine the number of hubs between the usb device and root hub */
- /* For now return 1, the root hub */
- *(PVOID *)Stack->Parameters.Others.Argument1 = (PVOID)1;
+ DPRINT1("RootHubCount %x\n", *(PULONG)Stack->Parameters.Others.Argument1);
+ *(PULONG)Stack->Parameters.Others.Argument1 = 0;
}
+ Status = STATUS_SUCCESS;
break;
}
case IOCTL_INTERNAL_USB_GET_HUB_NAME:
@@ -220,7 +235,7 @@ PdoDispatchInternalDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
if (Stack->Parameters.Others.Argument1)
*(PVOID *)Stack->Parameters.Others.Argument1 = FdoDeviceExtension->Pdo;
if (Stack->Parameters.Others.Argument2)
- *(PVOID *)Stack->Parameters.Others.Argument2 = IoGetAttachedDevice(FdoDeviceExtension->DeviceObject);
+ *(PVOID *)Stack->Parameters.Others.Argument2 = IoGetAttachedDeviceReference(FdoDeviceExtension->DeviceObject);
Information = 0;
Status = STATUS_SUCCESS;
@@ -275,6 +290,7 @@ PdoQueryId(PDEVICE_OBJECT DeviceObject, PIRP Irp, ULONG_PTR* Information)
SourceString.Length = SourceString.MaximumLength = Index * sizeof(WCHAR);
SourceString.Buffer = Buffer;
break;
+
}
case BusQueryCompatibleIDs:
{
@@ -375,10 +391,44 @@ PdoDispatchPnp(
RootHubDevice->DeviceDescriptor.idVendor = FdoDeviceExtension->VendorId;
RootHubDevice->DeviceDescriptor.idProduct = FdoDeviceExtension->DeviceId;
- RtlCopyMemory(&RootHubDevice->ConfigurationDescriptor,
+ RootHubDevice->Configs = ExAllocatePoolWithTag(NonPagedPool,
+ sizeof(PVOID) * RootHubDevice->DeviceDescriptor.bNumConfigurations,
+ USB_POOL_TAG);
+
+ RootHubDevice->Configs[0] = ExAllocatePoolWithTag(NonPagedPool,
+ sizeof(USB_CONFIGURATION) + sizeof(PVOID) * ROOTHUB2_CONFIGURATION_DESCRIPTOR[5],
+ USB_POOL_TAG);
+
+ RootHubDevice->Configs[0]->Interfaces[0] = ExAllocatePoolWithTag(NonPagedPool,
+ sizeof(USB_INTERFACE) + sizeof(PVOID) * ROOTHUB2_INTERFACE_DESCRIPTOR[3],
+ USB_POOL_TAG);
+
+ RootHubDevice->Configs[0]->Interfaces[0]->EndPoints[0] = ExAllocatePoolWithTag(NonPagedPool,
+ sizeof(USB_ENDPOINT),
+ USB_POOL_TAG);
+
+ DPRINT1("before: ActiveConfig %x\n", RootHubDevice->ActiveConfig);
+ RootHubDevice->ActiveConfig = RootHubDevice->Configs[0];
+ DPRINT1("after: ActiveConfig %x\n", RootHubDevice->ActiveConfig);
+
+ DPRINT1("before: ActiveConfig->Interfaces[0] %x\n", RootHubDevice->ActiveConfig->Interfaces[0]);
+ RootHubDevice->ActiveInterface = RootHubDevice->ActiveConfig->Interfaces[0];
+
+
+ RtlCopyMemory(&RootHubDevice->ActiveConfig->ConfigurationDescriptor,
ROOTHUB2_CONFIGURATION_DESCRIPTOR,
sizeof(ROOTHUB2_CONFIGURATION_DESCRIPTOR));
+ RtlCopyMemory(&RootHubDevice->ActiveConfig->Interfaces[0]->InterfaceDescriptor,
+ ROOTHUB2_INTERFACE_DESCRIPTOR,
+ sizeof(ROOTHUB2_INTERFACE_DESCRIPTOR));
+
+ RtlCopyMemory(&RootHubDevice->ActiveConfig->Interfaces[0]->EndPoints[0]->EndPointDescriptor,
+ ROOTHUB2_ENDPOINT_DESCRIPTOR,
+ sizeof(ROOTHUB2_ENDPOINT_DESCRIPTOR));
+ RootHubDevice->DeviceSpeed = UsbHighSpeed;
+ RootHubDevice->DeviceType = Usb20Device;
+
PdoDeviceExtension->UsbDevices[0] = RootHubDevice;
/* Create a thread to handle the URB's */
@@ -397,14 +447,15 @@ PdoDispatchPnp(
if (!NT_SUCCESS(Status))
{
DPRINT1("Failed to register interface\n");
+ ASSERT(FALSE);
}
else
{
Status = IoSetDeviceInterfaceState(&InterfaceSymLinkName, TRUE);
DPRINT1("Set interface state %x\n", Status);
+ if (!NT_SUCCESS(Status)) ASSERT(FALSE);
}
-
Status = STATUS_SUCCESS;
break;
}
@@ -593,4 +644,3 @@ PdoDispatchPnp(
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
}
-
diff --git a/reactos/drivers/usb/usbehci/usbehci.h b/reactos/drivers/usb/usbehci/usbehci.h
index 13bfabb3657..6d6a570ce98 100644
--- a/reactos/drivers/usb/usbehci/usbehci.h
+++ b/reactos/drivers/usb/usbehci/usbehci.h
@@ -5,10 +5,12 @@
#include
#define NDEBUG
#include
-#include "usbiffn.h"
+#include
#include
#include
+#define USB_POOL_TAG (ULONG)'UsbR'
+
#define DEVICEINTIALIZED 0x01
#define DEVICESTARTED 0x02
#define DEVICEBUSY 0x04
@@ -196,21 +198,46 @@ typedef struct _EHCI_SETUP_FORMAT
typedef struct _STRING_DESCRIPTOR
{
- UCHAR bLength; /* Size of this descriptor in bytes */
+ UCHAR bLength; /* Size of this descriptor in bytes */
UCHAR bDescriptorType; /* STRING Descriptor Type */
- UCHAR bString[0]; /* UNICODE encoded string */
+ UCHAR bString[0]; /* UNICODE encoded string */
} STRING_DESCRIPTOR, *PSTRING_DESCRIPTOR;
+typedef struct _USB_ENDPOINT
+{
+ ULONG Flags;
+ LIST_ENTRY UrbList;
+ struct _USB_INTERFACE *Interface;
+ USB_ENDPOINT_DESCRIPTOR EndPointDescriptor;
+} USB_ENDPOINT, *PUSB_ENDPOINT;
+
+typedef struct _USB_INTERFACE
+{
+ struct _USB_CONFIGURATION *Config;
+ USB_INTERFACE_DESCRIPTOR InterfaceDescriptor;
+ USB_ENDPOINT *EndPoints[];
+} USB_INTERFACE, *PUSB_INTERFACE;
+
+typedef struct _USB_CONFIGURATION
+{
+ struct _USB_DEVICE *Device;
+ USB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor;
+ USB_INTERFACE *Interfaces[];
+} USB_CONFIGURATION, *PUSB_CONFIGURATION;
+
typedef struct _USB_DEVICE
{
UCHAR Address;
ULONG Port;
PVOID ParentDevice;
BOOLEAN IsHub;
+ USB_DEVICE_SPEED DeviceSpeed;
+ USB_DEVICE_TYPE DeviceType;
USB_DEVICE_DESCRIPTOR DeviceDescriptor;
- USB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor;
- USB_INTERFACE_DESCRIPTOR InterfaceDescriptor;
- USB_ENDPOINT_DESCRIPTOR EndPointDescriptor;
+ USB_CONFIGURATION *ActiveConfig;
+ USB_INTERFACE *ActiveInterface;
+ USB_CONFIGURATION **Configs;
+
} USB_DEVICE, *PUSB_DEVICE;
/* USBCMD register 32 bits */
@@ -382,7 +409,7 @@ typedef struct _PDO_DEVICE_EXTENSION
ULONG ChildDeviceCount;
BOOLEAN HaltUrbHandling;
PVOID CallbackContext;
- PRH_INIT_CALLBACK CallbackRoutine;
+ RH_INIT_CALLBACK *CallbackRoutine;
ULONG NumberOfPorts;
EHCIPORTS Ports[32];
} PDO_DEVICE_EXTENSION, *PPDO_DEVICE_EXTENSION;
diff --git a/reactos/drivers/usb/usbehci/usbiffn.c b/reactos/drivers/usb/usbehci/usbiffn.c
index 47fefb610b3..e30aa305e7a 100644
--- a/reactos/drivers/usb/usbehci/usbiffn.c
+++ b/reactos/drivers/usb/usbehci/usbiffn.c
@@ -7,12 +7,33 @@
* Michael Martin
*/
-/* usbbusif.h and hubbusif.h need to be imported */
#include "usbehci.h"
-#include "usbiffn.h"
-#define NDEBUG
+#include
+#include
+#define NDEBUG
#include
+BOOLEAN
+IsHandleValid(PVOID BusContext,
+ PUSB_DEVICE_HANDLE DeviceHandle)
+{
+ PPDO_DEVICE_EXTENSION PdoDeviceExtension;
+ LONG i;
+
+ PdoDeviceExtension = (PPDO_DEVICE_EXTENSION) BusContext;
+
+ if (!DeviceHandle)
+ return FALSE;
+
+ for (i = 0; i < 128; i++)
+ {
+ if (PdoDeviceExtension->UsbDevices[i] == DeviceHandle)
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
VOID
USB_BUSIFFN
InterfaceReference(PVOID BusContext)
@@ -44,8 +65,21 @@ NTSTATUS
USB_BUSIFFN
InitializeUsbDevice(PVOID BusContext, PUSB_DEVICE_HANDLE DeviceHandle)
{
+ PPDO_DEVICE_EXTENSION PdoDeviceExtension;
+ LONG i;
DPRINT1("InitializeUsbDevice called\n");
- return STATUS_SUCCESS;
+
+ PdoDeviceExtension = (PPDO_DEVICE_EXTENSION)((PDEVICE_OBJECT)BusContext)->DeviceExtension;
+ /* Find the device handle */
+ for (i = 0; i < PdoDeviceExtension->ChildDeviceCount; i++)
+ {
+ if (DeviceHandle == PdoDeviceExtension->UsbDevices[i])
+ {
+ DPRINT1("Device Handle Found!\n");
+ return STATUS_SUCCESS;
+ }
+ }
+ return STATUS_DEVICE_DATA_ERROR;
}
NTSTATUS
@@ -93,7 +127,52 @@ QueryDeviceInformation(PVOID BusContext,
ULONG DeviceInformationBufferLength,
PULONG LengthReturned)
{
- DPRINT1("QueryDeviceInformation called\n");
+ PUSB_DEVICE_INFORMATION_0 DeviceInfo = DeviceInformationBuffer;
+ PUSB_DEVICE UsbDevice = (PUSB_DEVICE) DeviceHandle;
+ ULONG SizeNeeded;
+ LONG i;
+
+ DPRINT1("QueryDeviceInformation (%x, %x, %x, %d, %x\n", BusContext, DeviceHandle, DeviceInformationBuffer, DeviceInformationBufferLength, LengthReturned);
+
+ /* Search for a valid usb device in this BusContext */
+ if (!IsHandleValid(BusContext, DeviceHandle))
+ {
+ DPRINT1("Not a valid DeviceHandle\n");
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ SizeNeeded = FIELD_OFFSET(USB_DEVICE_INFORMATION_0, PipeList[UsbDevice->ActiveInterface->InterfaceDescriptor.bNumEndpoints]);
+ *LengthReturned = SizeNeeded;
+
+ DeviceInfo->ActualLength = SizeNeeded;
+
+ if (DeviceInformationBufferLength < SizeNeeded)
+ {
+ DPRINT1("Buffer to small\n");
+ return STATUS_BUFFER_TOO_SMALL;
+ }
+
+ if (DeviceInfo->InformationLevel != 0)
+ {
+ DPRINT1("Invalid Param\n");
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ DeviceInfo->PortNumber = UsbDevice->Port;
+ DeviceInfo->HubAddress = 1;
+ DeviceInfo->DeviceAddress = UsbDevice->Address;
+ DeviceInfo->DeviceSpeed = UsbDevice->DeviceSpeed;
+ DeviceInfo->DeviceType = UsbDevice->DeviceType;
+ DeviceInfo->CurrentConfigurationValue = UsbDevice->ActiveConfig->ConfigurationDescriptor.bConfigurationValue;
+ DeviceInfo->NumberOfOpenPipes = UsbDevice->ActiveInterface->InterfaceDescriptor.bNumEndpoints;
+
+ RtlCopyMemory(&DeviceInfo->DeviceDescriptor, &UsbDevice->DeviceDescriptor, sizeof(USB_DEVICE_DESCRIPTOR));
+
+ for (i = 0; i < UsbDevice->ActiveInterface->InterfaceDescriptor.bNumEndpoints; i++)
+ {
+ RtlCopyMemory(&DeviceInfo->PipeList[i].EndpointDescriptor, &UsbDevice->ActiveInterface->EndPoints[i]->EndPointDescriptor, sizeof(USB_ENDPOINT_DESCRIPTOR));
+ }
+
return STATUS_SUCCESS;
}
@@ -104,7 +183,29 @@ GetControllerInformation(PVOID BusContext,
ULONG ControllerInformationBufferLength,
PULONG LengthReturned)
{
+ PUSB_CONTROLLER_INFORMATION_0 ControllerInfo;
+
DPRINT1("GetControllerInformation called\n");
+ ControllerInfo = ControllerInformationBuffer;
+
+ if (ControllerInformationBufferLength < sizeof(USB_CONTROLLER_INFORMATION_0))
+ {
+ DPRINT1("Buffer to small\n");
+ return STATUS_BUFFER_TOO_SMALL;
+ }
+
+ if (ControllerInfo->InformationLevel != 0)
+ {
+ DPRINT1("InformationLevel other than 0 not supported\n");
+ return STATUS_NOT_SUPPORTED;
+ }
+
+ ControllerInfo->ActualLength = sizeof(USB_CONTROLLER_INFORMATION_0);
+ ControllerInfo->SelectiveSuspendEnabled = FALSE;
+ ControllerInfo->IsHighSpeedController = TRUE;
+
+ *LengthReturned = ControllerInfo->ActualLength;
+
return STATUS_SUCCESS;
}
@@ -113,7 +214,7 @@ USB_BUSIFFN
ControllerSelectiveSuspend(PVOID BusContext, BOOLEAN Enable)
{
DPRINT1("ControllerSelectiveSuspend called\n");
- return STATUS_SUCCESS;
+ return STATUS_NOT_SUPPORTED;
}
NTSTATUS
@@ -162,6 +263,12 @@ GetRootHubSymbolicName(PVOID BusContext,
PULONG HubSymNameActualLength)
{
DPRINT1("GetRootHubSymbolicName called\n");
+
+ if (HubSymNameBufferLength < 20)
+ return STATUS_UNSUCCESSFUL;
+ //RtlStringCbCopy(HubSymNameBuffer, HubSymNameBufferLength, L"ROOT_HUB20");
+ *HubSymNameActualLength = 20;
+
return STATUS_SUCCESS;
}
@@ -211,12 +318,12 @@ SetDeviceHandleData(PVOID BusContext, PVOID DeviceHandle, PDEVICE_OBJECT UsbDevi
/* USB_BUS_INTERFACE_USBDI_V2 Functions */
-NTSTATUS
+VOID
USB_BUSIFFN
GetUSBDIVersion(PVOID BusContext, PUSBD_VERSION_INFORMATION VersionInformation, PULONG HcdCapabilites)
{
DPRINT1("GetUSBDIVersion called\n");
- return STATUS_SUCCESS;
+ return;
}
NTSTATUS
diff --git a/reactos/drivers/usb/usbehci/usbiffn.h b/reactos/drivers/usb/usbehci/usbiffn.h
index e9c2de469be..47f86219b64 100644
--- a/reactos/drivers/usb/usbehci/usbiffn.h
+++ b/reactos/drivers/usb/usbehci/usbiffn.h
@@ -1,77 +1,9 @@
#pragma once
-#define USB_BUSIFFN __stdcall
#include
#include
#include
-
-/* usbbusif.h and hubbusif.h need to be imported */
-typedef PVOID PUSB_DEVICE_HANDLE;
-
-typedef
-VOID
-USB_BUSIFFN
-RH_INIT_CALLBACK (PVOID CallBackContext);
-
-typedef RH_INIT_CALLBACK *PRH_INIT_CALLBACK;
-
-typedef struct _USB_EXTPORT_INFORMATION_0
-{
- ULONG PhysicalPortNumber;
- ULONG PortLabelNumber;
- USHORT VidOverride;
- USHORT PidOverride;
- ULONG PortAttributes;
-} USB_EXTPORT_INFORMATION_0, *PUSB_EXTPORT_INFORMATION;
-
-typedef struct _USB_EXTHUB_INFORMATION_0
-{
- ULONG InformationLevel;
- ULONG NumberOfPorts;
- USB_EXTPORT_INFORMATION_0 Port[255];
-} USB_EXTHUB_INFORMATION_0, *PUSB_EXTHUB_INFORMATION_0;
-
-typedef struct _USB_BUS_INTERFACE_USBDI_V2
-{
- USHORT Size;
- USHORT Version;
- PVOID BusContext;
- PINTERFACE_REFERENCE InterfaceReference;
- PINTERFACE_DEREFERENCE InterfaceDereference;
-
- PVOID GetUSBDIVersion;
- PVOID QueryBusTime;
- PVOID SubmitIsoOutUrb;
- PVOID QueryBusInformation;
- PVOID IsDeviceHighSpeed;
- PVOID EnumLogEntry;
-} USB_BUS_INTERFACE_USBDI_V2, *PUSB_BUS_INTERFACE_USBDI_V2;
-
-typedef struct _USB_BUS_INTERFACE_HUB_V5
-{
- USHORT Size;
- USHORT Version;
- PVOID BusContext;
- PINTERFACE_REFERENCE InterfaceReference;
- PINTERFACE_DEREFERENCE InterfaceDereference;
-
- PVOID CreateUsbDevice;
- PVOID InitializeUsbDevice;
- PVOID GetUsbDescriptors;
- PVOID RemoveUsbDevice;
- PVOID RestoreUsbDevice;
- PVOID GetPortHackFlags;
- PVOID QueryDeviceInformation;
- PVOID GetControllerInformation;
- PVOID ControllerSelectiveSuspend;
- PVOID GetExtendedHubInformation;
- PVOID GetRootHubSymbolicName;
- PVOID GetDeviceBusContext;
- PVOID Initialize20Hub;
- PVOID RootHubInitNotification;
- PVOID FlushTransfers;
- PVOID SetDeviceHandleData;
-} USB_BUS_INTERFACE_HUB_V5, *PUSB_BUS_INTERFACE_HUB_V5;
+#include
VOID
USB_BUSIFFN
@@ -167,7 +99,7 @@ VOID
USB_BUSIFFN
SetDeviceHandleData(PVOID BusContext, PVOID DeviceHandle, PDEVICE_OBJECT UsbDevicePdo);
-NTSTATUS
+VOID
USB_BUSIFFN
GetUSBDIVersion(PVOID BusContext, PUSBD_VERSION_INFORMATION VersionInformation, PULONG HcdCapabilites);
From 931c1f37768384e60c99194d4fdd38b17e1c1f8c Mon Sep 17 00:00:00 2001
From: Michael Martin
Date: Mon, 5 Apr 2010 12:46:05 +0000
Subject: [PATCH 046/261] [DDK] - Add missing include.
svn path=/trunk/; revision=46736
---
reactos/include/ddk/hubbusif.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/reactos/include/ddk/hubbusif.h b/reactos/include/ddk/hubbusif.h
index e03f19edbb8..6a186e1cbb7 100644
--- a/reactos/include/ddk/hubbusif.h
+++ b/reactos/include/ddk/hubbusif.h
@@ -1,5 +1,7 @@
#pragma once
+#include "usbdi.h"
+
#if (NTDDI_VERSION >= NTDDI_WINXP)
typedef PVOID PUSB_DEVICE_HANDLE;
From 60ff1b6f8044d19fad16f72d5ceffdf0a566e284 Mon Sep 17 00:00:00 2001
From: Daniel Reimer
Date: Mon, 5 Apr 2010 12:55:00 +0000
Subject: [PATCH 047/261] Fix typo in FDC.inf.
svn path=/trunk/; revision=46737
---
reactos/media/inf/fdc.inf | Bin 6338 -> 6336 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
diff --git a/reactos/media/inf/fdc.inf b/reactos/media/inf/fdc.inf
index 0da85d2785ad4848302a6a0956602d12dbacd468..445f38e096bb6445350c90fe71719544c6d3a8ec 100644
GIT binary patch
delta 16
XcmX?Pc))Oj9M|MuTwW?Wr-06HWE#{d8T
From 939ddddd64ce7f5bc64791bc89a6b100f19eb3bd Mon Sep 17 00:00:00 2001
From: Michael Martin
Date: Mon, 5 Apr 2010 12:56:09 +0000
Subject: [PATCH 048/261] [DDK] - Remove PUSB_DEVICE_HANDLE as its not used in
this header. Its defined in hubbusif.
svn path=/trunk/; revision=46738
---
reactos/include/ddk/usbbusif.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/reactos/include/ddk/usbbusif.h b/reactos/include/ddk/usbbusif.h
index 0483738b18a..33d529ccee0 100644
--- a/reactos/include/ddk/usbbusif.h
+++ b/reactos/include/ddk/usbbusif.h
@@ -6,8 +6,6 @@
#if (NTDDI_VERSION >= NTDDI_WINXP)
-typedef PVOID PUSB_DEVICE_HANDLE;
-
typedef NTSTATUS
(USB_BUSIFFN *PUSB_BUSIFFN_SUBMIT_ISO_OUT_URB) (
IN PVOID,
From cf01e4674e66ec3108d5239ef143568fb1a03954 Mon Sep 17 00:00:00 2001
From: Gregor Schneider
Date: Mon, 5 Apr 2010 16:00:49 +0000
Subject: [PATCH 049/261] [SHELL32] - Updated polish translation by Olaf Siejka
See issue #1494 for more details.
svn path=/trunk/; revision=46739
---
reactos/dll/win32/shell32/lang/pl-PL.rc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/reactos/dll/win32/shell32/lang/pl-PL.rc b/reactos/dll/win32/shell32/lang/pl-PL.rc
index a0d3682dc1f..fef5815d4aa 100644
--- a/reactos/dll/win32/shell32/lang/pl-PL.rc
+++ b/reactos/dll/win32/shell32/lang/pl-PL.rc
@@ -17,7 +17,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* ReactOS shell32 fork translation updated by Caemyr -
- * - Olaf Siejka (Jan,Mar,Apr,Jul, Aug 2008)
+ * - Olaf Siejka (Jan,Mar,Apr,Jul, Aug 2008; Apr, 2010)
* Use ReactOS forum PM or IRC to contact me
* http://www.reactos.org
* IRC: irc.freenode.net #reactos-pl;
@@ -672,8 +672,8 @@ BEGIN
IDS_RESTART_PROMPT "Czy chcesz zrestartowaæ system?"
IDS_SHUTDOWN_TITLE "Wy³¹cz"
IDS_SHUTDOWN_PROMPT "Czy chcesz wy³¹czyæ system?"
- IDS_LOGOFF_TITLE "Log Off"
- IDS_LOGOFF_PROMPT "Do you want to log off?"
+ IDS_LOGOFF_TITLE "Wyloguj"
+ IDS_LOGOFF_PROMPT "Czy chcesz siê wylogowaæ z systemu?"
/* shell folder path default values */
IDS_PROGRAMS "Menu Start\\Programy"
From c96838e3504859e314a38b27287484000bce0c0a Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Mon, 5 Apr 2010 23:35:44 +0000
Subject: [PATCH 050/261] [INF] - Fix the class GUID so devices appear in the
correct category in device manager - Remove trailing spaces on some device
descriptions - Remove the "(UniATA)" at the end of some device descriptions
svn path=/trunk/; revision=46740
---
reactos/media/inf/hdc.inf | Bin 83820 -> 83158 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
diff --git a/reactos/media/inf/hdc.inf b/reactos/media/inf/hdc.inf
index 0ad794cce9eec2109a08f06ae35af2cccd77b767..a3fd5a9b0d2ee4c8bdb10e6ed137c266c3c5638e 100644
GIT binary patch
delta 4153
zcmZu!eQZJ4V?`Gq)=nU!yzsH4dAz|2gu^@1Xde0m|!Z3DVR7kuTFN3Zzx@7qv-B$(vep5K}{VFW$m%{n}6~Y>SOD2)g
zRQTsxQYfQo(4LE7*`g31tL(p?iwx%=HLezvw>LrY-6X^N)9=~Lp+WqJ3ika$NFUKb
zIl>CgY;0%PUkzd*1ASr09yPelF$1vnXrdImdVCPf_ce$dtCfD_AB*#G%CxyJdOXZ=
z@wg7!13KDfNi61ZObzTBgLC`d7dbFn{~c@#9u&OTi83#AqK)fi!v?g6HLjB!tb%hV
zL{5dU$RjyeFL^o~8Wb^(se)3=)~`TE-Vd8TaM!`?9vJ+f%(LoTp3Qa4i5i^C3%@y0
zhXoO~HVwM}TqFGkoQsHjTw8pi$ff&3QIoDo8eI5LXmm}&L;shBJeG}zD#odg%J!%w
z<}p7OxiW6wZ8igLek@{glWe}e{!;-scv8&Ea<4um_K}U_lReOT%3X^F>B(&073e?J
zP+F_s{*JA?L5E#7p4u}_jKZKbr3Aq|^E8jN8|+HT%(FZx#_m76*bQtxR~q`KGYwq*
zS)OTkg9aVbj7k%v8g&@_t5{sB(EzKF7rFZrv9?Sjudxdmd;UYbWR<3qpD+P0?VUcSSyH=Vav(8#15GQu;nv4k72rdXeOSi3JxSa+GV
zg8|vgtlhDF=LH}(AFq=yYoHVTuI(JRHB0P=#1Oly7~c;U`Iwi03H#ysmJkXA!6|xR
z-@jO23!=BUT3nFnRt0txlP=J}`YItnw$+0CS1}i;5c_(S0Qs-ix%>d6{#{ZE!1V-1#qsZ(05hN;9Tn{TZgX6dq25IgRR$P;$4d@$XvHz#f@4)?OLS5p&OFw+}tb$
zZsKB}#I3qg3(Ia*!Kxc!;YcnDz?moUg_Vwh|5Z3bw`5kVq`!AT{`(qq;y)JB^=&=Z
z>271Iu6;Q|1jbb=FLw|b9(;QhT^N%9Td(yU0eFcS582nZ%-9
zBS|%ldR+Nb!lD@uX%(zgLZ!wCB6q;(hG=w~LZZCovTHOt
zq>!5&6xLW3oI-#EXfl8wbF4Q}gYF3s(a}s$`B7OgOgqL9c6VcwtyN)Hg{!$_wc5)8
zWvg$Uv?}+KCYMWpdas`M9%>q7G2=5-1@-Ik>BKXgGsrYy&8`n|i*p}oaCu(H
zZct$0PX^=p=;`~&Z%Zzk4U!g2oZq5B=-Q}K`+jM;8p3HZ8-qP{M4>O#5wpaj%6Otu
zD^w<0Fz^#z3Y(KKbb~vgm!*1%ji$FlaF%Cyq?4Og=YJCeI6>elEz)
zgO6^g=ZDivxjFT`mk!pG`COm%PWLavwC#JOk8Pw}YV
zOU*6yceE;Sev5HOkC(2FlDT|JuHgR_Q^5OfGVd=hl~ylppIqiW>jumK--`xSrVyR(
zv9a4({V*a5*%vitX3fkkwX}VTtSI_xVPIRRr$OEm+)&)^f!uZvO*RnLgfb}KAS=u{
zg{~?ZpGq9=#~XxgOc1i$71}h7Cnvxj7bu|8-3HdKFcrHmISsGQmg!hLjH2o3gnd#3
zA>ZliX_T{|W-YY86v7fHbax}C@_TG6pAsu?)2$B?_BG2lO^1rtK&8tbCILAAw#mL*
zI?EhKT>spUUoPcPycQnjSqL%qC^$?+kWeHFeNXYrU88Y)reNAJmb{lPd4%+qgxDL`
z%>3fyurN9>lWZyz@WFHFYmcJb+AO~g@JI4HI`z#Wt2qgaYk>1EUXWS*9)2fC3$x_X
zxhJm&*pKIhoZC5@^oRr5^1{X6n{(P*WH=Bw0=~j3(0y|&Dp9vWE+GAwLh?-%ehgHMRe=~-*&n2xDurL>2
qduJZmhC+TiG>@#{gV;Q5td994RzmQ?ukl8BoF5R6=i6J=!~PEiIeeV}
delta 4288
zcmZu!4^Wfm8P97Yr5fW$NMlSO1hfd4e}JM*6$4tYM>~q1bN&-7V)oTEK=_Pm}$Vg8|rVe70_N`rIMbCzam*H$S8=epY3bWTQ`dbrWq>RwuqnqQMjSI+X?1F^_t}yX@w?bW7}w#36iw&hTJkd5{g9r{Y6~>9P1KM*8Zy|%u^H_fG`zFDnyiW=GogAE$GF=z
z{^?gEBTnSahsFL*rvS5;>nhB4aGjWOfj$!2IL7j#1ZGMyDt8S>P>+
zn4qe|mq5+X(xJBQgn-2Y1#d6XxUj_v2j5<(c>#+JKFhE{^rQuroJfbdlj`uC5Vm+E
z8tYVt=LGkOWr-*&G-cYgC)GanE96MQ)@N6(W
z!jsqCJ+tl4ks_Y7?ruLcjL(PAUoL3gn-2EeZQI|uCI}k-Ya#4CwM4Tzvt7{mxdnPp
zrNO|vCa8PYp)pmiREB%uNY81WCAL~mFD5JFtQWq@aX`&`LCrhz-U7`kJ0r(+*1Idu
z2wi7Xc#9F
zo!dmud4J<)pM1_c|B}T0(CJb84g8&_qVJp^s=Rk0RI%Ty_TcL;V+|oq{oEy6HGU&x
zeJHDt*Ycr`n*(}`1$z43q|P`y83Lt7*c+e?bIA^uPvoVbp5ptV9rs0_D7jag1{X?b
z``(o|T$)A546RD*Ke$W13-eUYp>yk}q$*pc8KIeYUdQDh$rpioXSCxZo>|VpUT`4k
zr9tO_+`z;|r)4E$arG48goZLZbbYMuEHyYjT`e&9u_q;EZ!A?~3Z`h(M6sX)nu9iI
zyu!U#eBy=t#~dl%)yw=!Gu|@82rI8}hZUdr;o246r)-61+7o&|3|&=m+7DW%Av>67
zk>vB~9Pp_hn(y+8h}SvZdaM}wl!wmNs?T)mTEdD~CL?H@&QA4Ab2JY(Wr-Y!1+B1m
z4$qzfmg_}oPdVUz+(QQ_y=+5vc;h;6R6fStk6Yo(>pWkoXMyUuj)d;;U{Ys+ODRn7
zizH(PWylEIzu;}FW?>|pENq76q2(#0=LUOy!;_)w2Fb|sLRDP1+)ojTjO5-p3Vhij2GtKs?)3s39IR8
zBh>$AsfI_MrW59t8+yJp!L7q;EiY8p=xB+iyOco8@Xj4oHyI-TT_t(8jIj7CK9qTU
z>}{J*Z^_pMP;#5r0)}sUVcTuyhi|_spME&@HT${WpnUqF`WZX*k`Ft+NrR$0JkcDr
z{tnk*YxzR%O63=S%RJXQ@U7lM=zqGUEXtBf`*&Qs;ybR8(e8w-AIQzHJ5SIRf%6^`
zg%JN?8pfv!A1di0efN1m0V)xA&4u9+A`k0?pjs*zA$5lkyvQ7ljgN^EjEoYaFfN1<
zH;)i>uj(=SrPdNcKi
zom4}L4_a9)_hU`Hhf7$n?qMNsG}@yz^$HBt7cp)=dhKD+%HL3U^VZZ`VdH9(!pw%4whnzOV3`4jvU>7L5(Rzvs;IX;q(g*Y;g-Z@?^n1xygEi
z>m{Y&zFe7FHs82GHmhJBwMs!1d4luOM=1{F$-Hbs@I^Zhit|dpNA(q4nx)6lh#DR0
z$Tv?EJaSSN!;lWrIhg<(H)+ask0d}0IfVhe!UYBDUMrv;Vq1*(R)LsH35E+~PWjd}J+FXyD}4nx;=tA%
zk&e+q@tU>`8a7y9U@PH8vJU0W-7{Ixk;?O$4dHDQA-tV`jTkXBS=eDjn@!_T@rXq!
zK56aP>Jf7iyf={t6|W%Dn?m|hNT0|9(<|~S#u}fn;-F91^)zn3JWI586bSBc>Ft=X
z-!B|`ud$sLbOq$-S&WSVL3h16j@V9LGH6P%pw(1~Xp3BRiOVp_>dO~8oG{<3ANUT#$h`n9_&9BSl99>|jH>@?RqQ64?XO?&bo1AnGwpWNX
zPPd`J@O{Gy61WW|hJgGlG~^k^7)HUS{h1i56jkF`^bAQ>7%B`4=s!gOw*B
Date: Tue, 6 Apr 2010 00:00:00 +0000
Subject: [PATCH 051/261] - Add -fms-extensions for arm build - Add
_NT_TIB_KPCR to compensate for a missing NT_TIB (hackfix) - add
KERNEL_STACK_SIZE & co for arm - Add missing KeGetCurrentThread prototype for
arm - define INTERLOCKED_RESULT for X86 only - Add _CONTEXT and
_EXCEPTION_RECORD forward declarations
svn path=/trunk/; revision=46741
---
reactos/ReactOS-arm.rbuild | 1 +
reactos/include/ddk/ntddk.h | 3 ++-
reactos/include/psdk/ntdef.h | 3 +++
reactos/include/reactos/arm/armddk.h | 30 ++++++++++++++++++++++++----
reactos/include/xdk/exfuncs.h | 3 ++-
5 files changed, 34 insertions(+), 6 deletions(-)
diff --git a/reactos/ReactOS-arm.rbuild b/reactos/ReactOS-arm.rbuild
index 777a1aa2cc3..6d7abe77d6e 100644
--- a/reactos/ReactOS-arm.rbuild
+++ b/reactos/ReactOS-arm.rbuild
@@ -28,6 +28,7 @@
-ftracer
+ -fms-extensions
-Wno-attributes
-U_UNICODE
-UUNICODE
diff --git a/reactos/include/ddk/ntddk.h b/reactos/include/ddk/ntddk.h
index 88aa183ea45..fdd99d9f7ef 100644
--- a/reactos/include/ddk/ntddk.h
+++ b/reactos/include/ddk/ntddk.h
@@ -3303,13 +3303,14 @@ ExFreeToZone(
#define ExIsResourceAcquired ExIsResourceAcquiredSharedLite
#define ExReleaseResourceForThread ExReleaseResourceForThreadLite
+#ifdef _X86_
+
typedef enum _INTERLOCKED_RESULT {
ResultNegative = RESULT_NEGATIVE,
ResultZero = RESULT_ZERO,
ResultPositive = RESULT_POSITIVE
} INTERLOCKED_RESULT;
-#ifdef _X86_
NTKERNELAPI
INTERLOCKED_RESULT
FASTCALL
diff --git a/reactos/include/psdk/ntdef.h b/reactos/include/psdk/ntdef.h
index fdc365085b2..18107cdcbcc 100644
--- a/reactos/include/psdk/ntdef.h
+++ b/reactos/include/psdk/ntdef.h
@@ -565,6 +565,9 @@ typedef struct _PROCESSOR_NUMBER {
UCHAR Reserved;
} PROCESSOR_NUMBER, *PPROCESSOR_NUMBER;
+struct _CONTEXT;
+struct _EXCEPTION_RECORD;
+
typedef EXCEPTION_DISPOSITION
(NTAPI *PEXCEPTION_ROUTINE)(
IN struct _EXCEPTION_RECORD *ExceptionRecord,
diff --git a/reactos/include/reactos/arm/armddk.h b/reactos/include/reactos/arm/armddk.h
index 68262c2b9d7..82e6d9fdd72 100644
--- a/reactos/include/reactos/arm/armddk.h
+++ b/reactos/include/reactos/arm/armddk.h
@@ -54,13 +54,16 @@ extern ULONG_PTR MmUserProbeAddress;
//
#define MAXIMUM_VECTOR 16
+#define KERNEL_STACK_SIZE 12288
+#define KERNEL_LARGE_STACK_SIZE 61440
+#define KERNEL_LARGE_STACK_COMMIT 12288
//
// Used to contain PFNs and PFN counts
//
-typedef ULONG PFN_COUNT;
-typedef ULONG PFN_NUMBER, *PPFN_NUMBER;
-typedef LONG SPFN_NUMBER, *PSPFN_NUMBER;
+//typedef ULONG PFN_COUNT;
+//typedef ULONG PFN_NUMBER, *PPFN_NUMBER;
+//typedef LONG SPFN_NUMBER, *PSPFN_NUMBER;
//
// Stub
@@ -124,11 +127,25 @@ typedef struct _CONTEXT {
#ifdef _WINNT_H
#define KIRQL ULONG
#endif
+
+typedef struct _NT_TIB_KPCR {
+ struct _EXCEPTION_REGISTRATION_RECORD *ExceptionList;
+ PVOID StackBase;
+ PVOID StackLimit;
+ PVOID SubSystemTib;
+ _ANONYMOUS_UNION union {
+ PVOID FiberData;
+ ULONG Version;
+ } DUMMYUNIONNAME;
+ PVOID ArbitraryUserPointer;
+ struct _NT_TIB_KPCR *Self;
+} NT_TIB_KPCR,*PNT_TIB_KPCR;
+
typedef struct _KPCR
{
union
{
- NT_TIB NtTib;
+ NT_TIB_KPCR NtTib;
struct
{
struct _EXCEPTION_REGISTRATION_RECORD *Used_ExceptionList; // Unused
@@ -167,6 +184,11 @@ struct _TEB* NtCurrentTeb(VOID)
return (struct _TEB*)USERPCR->Used_Self;
}
+NTSYSAPI
+PKTHREAD
+NTAPI
+KeGetCurrentThread(VOID);
+
#ifndef _WINNT_H
//
// IRQL Support on ARM is similar to MIPS/ALPHA
diff --git a/reactos/include/xdk/exfuncs.h b/reactos/include/xdk/exfuncs.h
index 46a5387733a..2879e1d4e16 100644
--- a/reactos/include/xdk/exfuncs.h
+++ b/reactos/include/xdk/exfuncs.h
@@ -67,13 +67,14 @@ ExFreeToZone(
#define ExIsResourceAcquired ExIsResourceAcquiredSharedLite
#define ExReleaseResourceForThread ExReleaseResourceForThreadLite
+#ifdef _X86_
+
typedef enum _INTERLOCKED_RESULT {
ResultNegative = RESULT_NEGATIVE,
ResultZero = RESULT_ZERO,
ResultPositive = RESULT_POSITIVE
} INTERLOCKED_RESULT;
-#ifdef _X86_
NTKERNELAPI
INTERLOCKED_RESULT
FASTCALL
From 93be8ad5abc8e1107611295ed18d1a56ccab4b9e Mon Sep 17 00:00:00 2001
From: Timo Kreuzer
Date: Tue, 6 Apr 2010 00:10:46 +0000
Subject: [PATCH 052/261] remove scsiport from arm build
svn path=/trunk/; revision=46742
---
reactos/drivers/storage/directory.rbuild | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/reactos/drivers/storage/directory.rbuild b/reactos/drivers/storage/directory.rbuild
index c0c43724a9e..d72619494d2 100644
--- a/reactos/drivers/storage/directory.rbuild
+++ b/reactos/drivers/storage/directory.rbuild
@@ -13,7 +13,9 @@
-
-
-
+
+
+
+
+
From ce7c240a5e377c1598b3649afdd82d38fb6457bb Mon Sep 17 00:00:00 2001
From: Timo Kreuzer
Date: Tue, 6 Apr 2010 00:19:48 +0000
Subject: [PATCH 053/261] Compile scsiport.c for freeldr only on x86 builds
svn path=/trunk/; revision=46743
---
reactos/boot/freeldr/freeldr/freeldr_base.rbuild | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/reactos/boot/freeldr/freeldr/freeldr_base.rbuild b/reactos/boot/freeldr/freeldr/freeldr_base.rbuild
index c8c2ab113c1..a8b784baf9b 100644
--- a/reactos/boot/freeldr/freeldr/freeldr_base.rbuild
+++ b/reactos/boot/freeldr/freeldr/freeldr_base.rbuild
@@ -23,7 +23,9 @@
disk.c
partition.c
ramdisk.c
- scsiport.c
+
+ scsiport.c
+
ext2.c
From a2ac545098657ac91a1b237e0874acb1a74d4fbb Mon Sep 17 00:00:00 2001
From: Timo Kreuzer
Date: Tue, 6 Apr 2010 00:20:53 +0000
Subject: [PATCH 054/261] revert r46742
svn path=/trunk/; revision=46744
---
reactos/drivers/storage/directory.rbuild | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/reactos/drivers/storage/directory.rbuild b/reactos/drivers/storage/directory.rbuild
index d72619494d2..c0c43724a9e 100644
--- a/reactos/drivers/storage/directory.rbuild
+++ b/reactos/drivers/storage/directory.rbuild
@@ -13,9 +13,7 @@
-
-
-
-
-
+
+
+
From 2d1579957b2fb81f21c0c5ca2e4767f8f4fbab47 Mon Sep 17 00:00:00 2001
From: Michael Martin
Date: Tue, 6 Apr 2010 13:23:33 +0000
Subject: [PATCH 055/261] [DDK] - A better fix for r46738. Patch by Amine
Khaidi.
svn path=/trunk/; revision=46747
---
reactos/include/ddk/hubbusif.h | 4 ++++
reactos/include/ddk/usbbusif.h | 6 ++++++
2 files changed, 10 insertions(+)
diff --git a/reactos/include/ddk/hubbusif.h b/reactos/include/ddk/hubbusif.h
index 6a186e1cbb7..cf97c5cf64f 100644
--- a/reactos/include/ddk/hubbusif.h
+++ b/reactos/include/ddk/hubbusif.h
@@ -1,10 +1,14 @@
#pragma once
+#define _HUBBUSIF_
+
#include "usbdi.h"
#if (NTDDI_VERSION >= NTDDI_WINXP)
+#if !defined(_USBBUSIF_)
typedef PVOID PUSB_DEVICE_HANDLE;
+#endif
typedef struct _ROOTHUB_PDO_EXTENSION {
ULONG Signature;
diff --git a/reactos/include/ddk/usbbusif.h b/reactos/include/ddk/usbbusif.h
index 33d529ccee0..3d1c1f3a337 100644
--- a/reactos/include/ddk/usbbusif.h
+++ b/reactos/include/ddk/usbbusif.h
@@ -1,11 +1,17 @@
#pragma once
+#define _USBBUSIF_
+
#ifndef USB_BUSIFFN
#define USB_BUSIFFN __stdcall
#endif
#if (NTDDI_VERSION >= NTDDI_WINXP)
+#if !defined(_USBBUSIF_)
+typedef PVOID PUSB_DEVICE_HANDLE;
+#endif
+
typedef NTSTATUS
(USB_BUSIFFN *PUSB_BUSIFFN_SUBMIT_ISO_OUT_URB) (
IN PVOID,
From f9e0e0d0b33302012fa861fd757fef2b867aeada Mon Sep 17 00:00:00 2001
From: Johannes Anderwald
Date: Tue, 6 Apr 2010 14:00:02 +0000
Subject: [PATCH 056/261] [NTOS] - Device interface strings are null terminated
svn path=/trunk/; revision=46748
---
reactos/ntoskrnl/io/iomgr/deviface.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/reactos/ntoskrnl/io/iomgr/deviface.c b/reactos/ntoskrnl/io/iomgr/deviface.c
index d5b2246f31f..114e308c4a8 100644
--- a/reactos/ntoskrnl/io/iomgr/deviface.c
+++ b/reactos/ntoskrnl/io/iomgr/deviface.c
@@ -661,12 +661,6 @@ IoGetDeviceInterfaces(IN CONST GUID *InterfaceClassGuid,
DPRINT("RtlAppendUnicodeStringToString() failed with status 0x%08lx\n", Status);
goto cleanup;
}
- /* RtlAppendUnicodeStringToString added a NULL at the end of the
- * destination string, but didn't increase the Length field.
- * Do it for it.
- */
- ReturnBuffer.Length += sizeof(WCHAR);
-
NextReferenceString:
ExFreePool(ReferenceBi);
ReferenceBi = NULL;
From 35ac4e1e9235dc60e67de6cc98485afa31e5714d Mon Sep 17 00:00:00 2001
From: Johannes Anderwald
Date: Tue, 6 Apr 2010 14:32:35 +0000
Subject: [PATCH 057/261] [KSPROXY] - Implement sending multiple media samples
to tv tuner at once in order to avoid the kernel irp queue running out
svn path=/trunk/; revision=46749
---
reactos/dll/directx/ksproxy/allocator.cpp | 1 +
reactos/dll/directx/ksproxy/output_pin.cpp | 68 ++++++++++++++++++----
2 files changed, 59 insertions(+), 10 deletions(-)
diff --git a/reactos/dll/directx/ksproxy/allocator.cpp b/reactos/dll/directx/ksproxy/allocator.cpp
index e7c4b1f2436..8229bd2f56e 100644
--- a/reactos/dll/directx/ksproxy/allocator.cpp
+++ b/reactos/dll/directx/ksproxy/allocator.cpp
@@ -357,6 +357,7 @@ CKsAllocator::GetBuffer(
if (!m_FreeList.empty())
{
+ OutputDebugStringW(L"CKsAllocator::GetBuffer HACK\n");
Sample = m_FreeList.top();
m_FreeList.pop();
}
diff --git a/reactos/dll/directx/ksproxy/output_pin.cpp b/reactos/dll/directx/ksproxy/output_pin.cpp
index f9f37725c53..bee119303ae 100644
--- a/reactos/dll/directx/ksproxy/output_pin.cpp
+++ b/reactos/dll/directx/ksproxy/output_pin.cpp
@@ -2383,17 +2383,48 @@ COutputPin::IoProcessRoutine()
IMediaSample *Sample;
LONG SampleCount;
HRESULT hr;
- PKSSTREAM_SEGMENT StreamSegment;
+ PKSSTREAM_SEGMENT * StreamSegment;
HANDLE hEvent;
- IMediaSample * Samples[1];
+ IMediaSample ** Samples;
+ LONG NumHandles;
+ DWORD dwStatus;
#ifdef KSPROXY_TRACE
WCHAR Buffer[200];
#endif
+ NumHandles = m_Properties.cBuffers / 2;
+
+ if (!NumHandles)
+ NumHandles = 8;
+
+ assert(NumHandles);
+
+ //allocate stream segment array
+ StreamSegment = (PKSSTREAM_SEGMENT*)CoTaskMemAlloc(sizeof(PKSSTREAM_SEGMENT) * NumHandles);
+ if (!StreamSegment)
+ {
+ OutputDebugStringW(L"COutputPin::IoProcessRoutine out of memory\n");
+ return E_FAIL;
+ }
+
+ // allocate handle array
+ Samples = (IMediaSample**)CoTaskMemAlloc(sizeof(IMediaSample*) * NumHandles);
+ if (!Samples)
+ {
+ OutputDebugStringW(L"COutputPin::IoProcessRoutine out of memory\n");
+ return E_FAIL;
+ }
+
+ // zero handles array
+ ZeroMemory(StreamSegment, sizeof(PKSSTREAM_SEGMENT) * NumHandles);
+ ZeroMemory(Samples, sizeof(IMediaSample*) * NumHandles);
+
// first wait for the start event to signal
WaitForSingleObject(m_hStartEvent, INFINITE);
+ m_IoCount = 0;
+
assert(m_InterfaceHandler);
do
{
@@ -2418,14 +2449,14 @@ COutputPin::IoProcessRoutine()
// fill buffer
SampleCount = 1;
- Samples[0] = Sample;
+ Samples[m_IoCount] = Sample;
Sample->SetTime(NULL, NULL);
hr = m_InterfaceHandler->KsProcessMediaSamples(NULL, /* FIXME */
- Samples,
+ &Samples[m_IoCount],
&SampleCount,
KsIoOperation_Read,
- &StreamSegment);
+ &StreamSegment[m_IoCount]);
if (FAILED(hr) || !StreamSegment)
{
#ifdef KSPROXY_TRACE
@@ -2435,14 +2466,26 @@ COutputPin::IoProcessRoutine()
break;
}
- // get completion event
- hEvent = StreamSegment->CompletionEvent;
+ // interface handle should increment pending i/o count
+ assert(m_IoCount >= 1);
+
+ swprintf(Buffer, L"COutputPin::IoProcessRoutine m_IoCount %lu NumHandles %lu\n", m_IoCount, NumHandles);
+ OutputDebugStringW(Buffer);
+
+ if (m_IoCount != NumHandles)
+ continue;
+
+ // get completion handle
+ hEvent = StreamSegment[0]->CompletionEvent;
// wait for i/o completion
- WaitForSingleObject(hEvent, INFINITE);
+ dwStatus = WaitForSingleObject(hEvent, INFINITE);
+
+ swprintf(Buffer, L"COutputPin::IoProcessRoutine dwStatus %lx Error %lx NumHandles %lu\n", dwStatus, GetLastError(), NumHandles);
+ OutputDebugStringW(Buffer);
// perform completion
- m_InterfaceHandler->KsCompleteIo(StreamSegment);
+ m_InterfaceHandler->KsCompleteIo(StreamSegment[0]);
// close completion event
CloseHandle(hEvent);
@@ -2452,7 +2495,7 @@ COutputPin::IoProcessRoutine()
assert(m_MemInputPin);
// now deliver the sample
- hr = m_MemInputPin->Receive(Sample);
+ hr = m_MemInputPin->Receive(Samples[0]);
#ifdef KSPROXY_TRACE
swprintf(Buffer, L"COutputPin::IoProcessRoutine PinName %s IMemInputPin::Receive hr %lx Sample %p m_MemAllocator %p\n", m_PinName, hr, Sample, m_MemAllocator);
@@ -2464,6 +2507,11 @@ COutputPin::IoProcessRoutine()
Sample = NULL;
}
+
+ //circular stream segment array
+ RtlMoveMemory(StreamSegment, &StreamSegment[1], sizeof(PKSSTREAM_SEGMENT) * (NumHandles - 1));
+ RtlMoveMemory(Samples, &Samples[1], sizeof(IMediaSample*) * (NumHandles - 1));
+
}while(TRUE);
// signal end of i/o thread
From 9b8546277a133f184b77d7de86272f2d080c343a Mon Sep 17 00:00:00 2001
From: Johannes Anderwald
Date: Tue, 6 Apr 2010 15:08:16 +0000
Subject: [PATCH 058/261] [MSDVBNP] - Dynamically register DVB network provider
categories
svn path=/trunk/; revision=46750
---
reactos/dll/directx/msdvbnp/msdvbnp.cpp | 53 +++++++++++++++++++++++--
reactos/dll/directx/msdvbnp/precomp.h | 1 +
2 files changed, 51 insertions(+), 3 deletions(-)
diff --git a/reactos/dll/directx/msdvbnp/msdvbnp.cpp b/reactos/dll/directx/msdvbnp/msdvbnp.cpp
index b67f232e13f..170408d522c 100644
--- a/reactos/dll/directx/msdvbnp/msdvbnp.cpp
+++ b/reactos/dll/directx/msdvbnp/msdvbnp.cpp
@@ -9,10 +9,14 @@
#include "precomp.h"
+#ifndef _MSC_VER
+const GUID KSCATEGORY_BDA_NETWORK_PROVIDER = {0x71985f4b, 0x1ca1, 0x11d3, {0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0}};
+#endif
+
static INTERFACE_TABLE InterfaceTable[] =
{
- {&CLSID_DVBTNetworkProvider, CNetworkProvider_fnConstructor},
- {NULL, NULL}
+ {&CLSID_DVBTNetworkProvider, CNetworkProvider_fnConstructor, L"ReactOS DVBT Network Provider"},
+ {NULL, NULL, NULL}
};
extern "C"
@@ -53,8 +57,19 @@ DllUnregisterServer(void)
HRESULT hr = S_OK;
HKEY hClass;
+
+ hr = StringFromCLSID(KSCATEGORY_BDA_NETWORK_PROVIDER, &pStr);
+ if (FAILED(hr))
+ return hr;
+
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"CLSID", 0, KEY_SET_VALUE, &hClass) != ERROR_SUCCESS)
+ {
+ CoTaskMemFree(pStr);
return E_FAIL;
+ }
+
+ RegDeleteKeyW(hClass, pStr);
+ CoTaskMemFree(pStr);
do
{
@@ -80,12 +95,35 @@ DllRegisterServer(void)
ULONG Index = 0;
LPOLESTR pStr;
HRESULT hr = S_OK;
- HKEY hClass, hKey, hSubKey;
+ HKEY hClass, hKey, hSubKey, hProvider, hInstance;
static LPCWSTR ModuleName = L"msdvbnp.ax";
static LPCWSTR ThreadingModel = L"Both";
+ hr = StringFromCLSID(KSCATEGORY_BDA_NETWORK_PROVIDER, &pStr);
+ if (FAILED(hr))
+ return hr;
+
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"CLSID", 0, KEY_WRITE, &hClass) != ERROR_SUCCESS)
+ {
+ CoTaskMemFree(pStr);
return E_FAIL;
+ }
+
+ if (RegCreateKeyExW(hClass, pStr, 0, NULL, 0, KEY_WRITE, NULL, &hProvider, NULL) != ERROR_SUCCESS)
+ {
+ RegCloseKey(hClass);
+ CoTaskMemFree(pStr);
+ return E_FAIL;
+ }
+
+ CoTaskMemFree(pStr);
+
+ if (RegCreateKeyExW(hProvider, L"Instance", 0, NULL, 0, KEY_WRITE, NULL, &hInstance, NULL) != ERROR_SUCCESS)
+ {
+ RegCloseKey(hClass);
+ return E_FAIL;
+ }
+ RegCloseKey(hProvider);
do
{
@@ -104,11 +142,20 @@ DllRegisterServer(void)
RegCloseKey(hKey);
}
+ if (RegCreateKeyExW(hInstance, InterfaceTable[Index].ProviderName, 0, 0, 0, KEY_WRITE, NULL, &hKey, 0) == ERROR_SUCCESS)
+ {
+ //FIXME filterdata
+ RegSetValueExW(hKey, L"FriendlyName", 0, REG_SZ, (const BYTE*)InterfaceTable[Index].ProviderName, (wcslen(InterfaceTable[Index].ProviderName) + 1) * sizeof(WCHAR));
+ RegSetValueExW(hKey, L"CLSID", 0, REG_SZ, (const BYTE*)pStr, (wcslen(pStr)+1) * sizeof(WCHAR));
+ RegCloseKey(hKey);
+ }
+
CoTaskMemFree(pStr);
Index++;
}while(InterfaceTable[Index].lpfnCI != 0);
RegCloseKey(hClass);
+ RegCloseKey(hInstance);
return hr;
}
diff --git a/reactos/dll/directx/msdvbnp/precomp.h b/reactos/dll/directx/msdvbnp/precomp.h
index c9abe7ac000..828cfb47202 100644
--- a/reactos/dll/directx/msdvbnp/precomp.h
+++ b/reactos/dll/directx/msdvbnp/precomp.h
@@ -28,6 +28,7 @@ typedef struct
{
const GUID* riid;
LPFNCREATEINSTANCE lpfnCI;
+ LPCWSTR ProviderName;
} INTERFACE_TABLE;
/* classfactory.cpp */
From 716555b739539bd1afa05bdedf3acc58b15157c0 Mon Sep 17 00:00:00 2001
From: Johannes Anderwald
Date: Tue, 6 Apr 2010 15:47:15 +0000
Subject: [PATCH 059/261] [MSDVBNP] - Register BDA Filter components
svn path=/trunk/; revision=46751
---
reactos/dll/directx/msdvbnp/msdvbnp.cpp | 38 ++++++++++++++++++++++++-
1 file changed, 37 insertions(+), 1 deletion(-)
diff --git a/reactos/dll/directx/msdvbnp/msdvbnp.cpp b/reactos/dll/directx/msdvbnp/msdvbnp.cpp
index 170408d522c..9b7f24517d6 100644
--- a/reactos/dll/directx/msdvbnp/msdvbnp.cpp
+++ b/reactos/dll/directx/msdvbnp/msdvbnp.cpp
@@ -86,6 +86,24 @@ DllUnregisterServer(void)
return hr;
}
+VOID
+RegisterBDAComponent(
+ HKEY hFilter,
+ LPCWSTR ComponentClsid,
+ LPCWSTR ComponentName)
+{
+ HKEY hComp;
+
+ // create network provider filter key
+ if (RegCreateKeyExW(hFilter, ComponentClsid, 0, NULL, 0, KEY_WRITE, NULL, &hComp, NULL) == ERROR_SUCCESS)
+ {
+ // store class id
+ RegSetValueExW(hComp, L"CLSID", 0, REG_SZ, (const BYTE*)ComponentClsid, (wcslen(ComponentClsid)+1) * sizeof(WCHAR));
+ RegSetValueExW(hComp, L"FriendlyName", 0, REG_SZ, (const BYTE*)ComponentName, (wcslen(ComponentName)+1) * sizeof(WCHAR));
+ RegCloseKey(hComp);
+ }
+}
+
extern "C"
KSDDKAPI
HRESULT
@@ -95,7 +113,7 @@ DllRegisterServer(void)
ULONG Index = 0;
LPOLESTR pStr;
HRESULT hr = S_OK;
- HKEY hClass, hKey, hSubKey, hProvider, hInstance;
+ HKEY hClass, hKey, hSubKey, hProvider, hInstance, hFilter;
static LPCWSTR ModuleName = L"msdvbnp.ax";
static LPCWSTR ThreadingModel = L"Both";
@@ -125,6 +143,21 @@ DllRegisterServer(void)
}
RegCloseKey(hProvider);
+ /* open active movie filter category key */
+ if (RegCreateKeyExW(hClass, L"{da4e3da0-d07d-11d0-bd50-00a0c911ce86}\\Instance", 0, NULL, 0, KEY_WRITE, NULL, &hFilter, NULL) != ERROR_SUCCESS)
+ {
+ RegCloseKey(hClass);
+ RegCloseKey(hInstance);
+ return E_FAIL;
+ }
+
+ RegisterBDAComponent(hFilter, L"{71985F4A-1CA1-11d3-9CC8-00C04F7971E0}", L"BDA Playback Filter");
+ RegisterBDAComponent(hFilter, L"{71985F4B-1CA1-11D3-9CC8-00C04F7971E0}", L"BDA Network Providerss");
+ RegisterBDAComponent(hFilter, L"{71985F48-1CA1-11d3-9CC8-00C04F7971E0}", L"BDA Source Filter");
+ RegisterBDAComponent(hFilter, L"{A2E3074F-6C3D-11D3-B653-00C04F79498E}", L"BDA Transport Information Renderers");
+ RegisterBDAComponent(hFilter, L"{FD0A5AF4-B41D-11d2-9C95-00C04F7971E0}", L"BDA Receiver Component");
+ RegCloseKey(hKey);
+
do
{
hr = StringFromCLSID(*InterfaceTable[Index].riid, &pStr);
@@ -150,6 +183,9 @@ DllRegisterServer(void)
RegCloseKey(hKey);
}
+
+
+
CoTaskMemFree(pStr);
Index++;
}while(InterfaceTable[Index].lpfnCI != 0);
From 06ad53455edffc7814bb236b67d8726c8e3e27be Mon Sep 17 00:00:00 2001
From: Gregor Schneider
Date: Tue, 6 Apr 2010 18:51:13 +0000
Subject: [PATCH 060/261] [SHELL32] - Updated Italian translation by Gabriel
Ilardi See issue #1494 for more details.
svn path=/trunk/; revision=46754
---
reactos/dll/win32/shell32/lang/it-IT.rc | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/reactos/dll/win32/shell32/lang/it-IT.rc b/reactos/dll/win32/shell32/lang/it-IT.rc
index 4407298403c..9ad6e53377e 100644
--- a/reactos/dll/win32/shell32/lang/it-IT.rc
+++ b/reactos/dll/win32/shell32/lang/it-IT.rc
@@ -434,8 +434,8 @@ STYLE DS_SHELLFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUPWIND
CAPTION "Conferma della sovrascrittura dei file"
FONT 8, "MS Shell Dlg"
BEGIN
- DEFPUSHBUTTON "&Si", IDYES, 20, 122, 60, 14
- PUSHBUTTON "Si &tutti", 12807, 85, 122, 60, 14
+ DEFPUSHBUTTON "&Sì", IDYES, 20, 122, 60, 14
+ PUSHBUTTON "Sì &tutti", 12807, 85, 122, 60, 14
PUSHBUTTON "&No", IDNO, 150, 122, 60, 14
PUSHBUTTON "Annulla", IDCANCEL, 215, 122, 60, 14
ICON 146, -1, 11, 10, 21, 20, SS_REALSIZECONTROL
@@ -555,13 +555,13 @@ BEGIN
LTEXT "&File system", -1, 7, 35, 170, 9
COMBOBOX 28677, 7, 46, 170, 200, CBS_DROPDOWNLIST | WS_VSCROLL | NOT WS_TABSTOP
CONTROL "", 28678, "MSCTLS_PROGRESS32", 0, 7, 181, 170, 8
- LTEXT "Dimensione dell'unità di &Allocazione", -1, 7, 64, 170, 9
+ LTEXT "Dimensione dell'unità di &allocazione", -1, 7, 64, 170, 9
COMBOBOX 28680, 7, 75, 170, 200, CBS_DROPDOWNLIST | WS_VSCROLL | NOT WS_TABSTOP
LTEXT "&Etichetta del Volume", -1, 7, 93, 170, 9
EDITTEXT 28679, 7, 103, 170, 13, ES_AUTOHSCROLL
- GROUPBOX "Opzioni di &Formattazione", 4610, 7, 121, 170, 49
+ GROUPBOX "Opzioni di &formattazione", 4610, 7, 121, 170, 49
AUTOCHECKBOX "Formattazione &rapida", 28674, 16, 135, 155, 10
- AUTOCHECKBOX "Abilita la &Compressione", 28675, 16, 152, 155, 10
+ AUTOCHECKBOX "Abilita la &compressione", 28675, 16, 152, 155, 10
END
CHKDSK_DLG DIALOGEX 50, 50, 194, 120
@@ -645,7 +645,7 @@ BEGIN
IDS_CREATEFOLDER_DENIED "Impossibile creare la cartella: Accesso negato."
IDS_CREATEFOLDER_CAPTION "Errore durante la creazione della cartella"
- IDS_DELETEITEM_CAPTION "Confermare la cancallazione del file"
+ IDS_DELETEITEM_CAPTION "Confermare la cancellazione del file"
IDS_DELETEFOLDER_CAPTION "Confermare la cancellazione della cartella"
IDS_DELETEITEM_TEXT "Sei sicuro di voler cancellare '%1'?"
IDS_DELETEMULTIPLE_TEXT "Sei sicuro di voler cancellare questi %1 elementi?"
@@ -664,10 +664,10 @@ BEGIN
/* message box strings */
IDS_RESTART_TITLE "Riavvia"
IDS_RESTART_PROMPT "Volete riavviare il sistema?"
- IDS_SHUTDOWN_TITLE "Termina sessione"
- IDS_SHUTDOWN_PROMPT "Volete terminare la sessione di ReactOS?"
- IDS_LOGOFF_TITLE "Log Off"
- IDS_LOGOFF_PROMPT "Do you want to log off?"
+ IDS_SHUTDOWN_TITLE "Arresta sistema"
+ IDS_SHUTDOWN_PROMPT "Volete arrestare il sistema?"
+ IDS_LOGOFF_TITLE "Disconnetti"
+ IDS_LOGOFF_PROMPT "Volete disconnettervi?"
/* shell folder path default values */
IDS_PROGRAMS "Menu Avvio\\Programmi"
From 01f84db1d4671b24e00ba93503d552fb96cb007f Mon Sep 17 00:00:00 2001
From: James Tabor
Date: Wed, 7 Apr 2010 00:46:16 +0000
Subject: [PATCH 061/261] [Win32k|Gdi32] - Enable font batch and fixed setting
brush origion. Use the new delete object functions in win32k.
svn path=/trunk/; revision=46758
---
reactos/dll/win32/gdi32/objects/dc.c | 4 +-
.../subsystems/win32/win32k/include/coord.h | 4 +-
.../subsystems/win32/win32k/include/gdiobj.h | 3 +
.../subsystems/win32/win32k/objects/brush.c | 1 +
.../subsystems/win32/win32k/objects/coord.c | 10 +++
.../subsystems/win32/win32k/objects/dclife.c | 30 ++------
.../subsystems/win32/win32k/objects/font.c | 68 ++++++++++++-------
.../win32/win32k/objects/gdibatch.c | 33 +++++++--
8 files changed, 98 insertions(+), 55 deletions(-)
diff --git a/reactos/dll/win32/gdi32/objects/dc.c b/reactos/dll/win32/gdi32/objects/dc.c
index 2d90f60cdac..34c31148bb3 100644
--- a/reactos/dll/win32/gdi32/objects/dc.c
+++ b/reactos/dll/win32/gdi32/objects/dc.c
@@ -1540,7 +1540,7 @@ SelectObject(HDC hDC,
PDC_ATTR pDc_Attr;
HGDIOBJ hOldObj = NULL;
UINT uType;
-// PTEB pTeb;
+ PTEB pTeb;
if(!GdiGetHandleUserData(hDC, GDI_OBJECT_TYPE_DC, (PVOID)&pDc_Attr))
{
@@ -1582,7 +1582,6 @@ SelectObject(HDC hDC,
case GDI_OBJECT_TYPE_FONT:
hOldObj = pDc_Attr->hlfntNew;
if (hOldObj == hGdiObj) return hOldObj;
-#if 0
pDc_Attr->ulDirty_ &= ~SLOW_WIDTHS;
pDc_Attr->ulDirty_ |= DIRTY_CHARSET;
pDc_Attr->hlfntNew = hGdiObj;
@@ -1604,7 +1603,6 @@ SelectObject(HDC hDC,
if (pTeb->GdiBatchCount >= GDI_BatchLimit) NtGdiFlush();
return hOldObj;
}
-#endif
// default for select object font
return NtGdiSelectFont(hDC, hGdiObj);
diff --git a/reactos/subsystems/win32/win32k/include/coord.h b/reactos/subsystems/win32/win32k/include/coord.h
index c241b9eb9b6..83f3a355eaa 100644
--- a/reactos/subsystems/win32/win32k/include/coord.h
+++ b/reactos/subsystems/win32/win32k/include/coord.h
@@ -18,4 +18,6 @@ IntGdiModifyWorldTransform(PDC pDc,
DWORD Mode);
VOID FASTCALL IntMirrorWindowOrg(PDC);
-void FASTCALL IntFixIsotropicMapping(PDC dc);
+void FASTCALL IntFixIsotropicMapping(PDC);
+LONG FASTCALL IntCalcFillOrigin(PDC);
+PPOINTL FASTCALL IntptlBrushOrigin(PDC pdc,LONG,LONG);
\ No newline at end of file
diff --git a/reactos/subsystems/win32/win32k/include/gdiobj.h b/reactos/subsystems/win32/win32k/include/gdiobj.h
index 50ed2e6163f..6b9a7fd8aa8 100644
--- a/reactos/subsystems/win32/win32k/include/gdiobj.h
+++ b/reactos/subsystems/win32/win32k/include/gdiobj.h
@@ -131,3 +131,6 @@ GDIOBJ_IncrementShareCount(POBJ Object)
#endif
INT FASTCALL GreGetObjectOwner(HGDIOBJ, GDIOBJTYPE);
+
+#define GDIOBJ_GetKernelObj(Handle) \
+ ((PGDI_TABLE_ENTRY)&GdiHandleTable->Entries[GDI_HANDLE_GET_INDEX(Handle)])->KernelData
diff --git a/reactos/subsystems/win32/win32k/objects/brush.c b/reactos/subsystems/win32/win32k/objects/brush.c
index 6e827fa7bae..f45f6fbcdd4 100644
--- a/reactos/subsystems/win32/win32k/objects/brush.c
+++ b/reactos/subsystems/win32/win32k/objects/brush.c
@@ -709,6 +709,7 @@ NtGdiSetBrushOrg(HDC hDC, INT XOrg, INT YOrg, LPPOINT Point)
pdcattr->ptlBrushOrigin.x = XOrg;
pdcattr->ptlBrushOrigin.y = YOrg;
+ IntptlBrushOrigin(dc, XOrg, YOrg );
DC_UnlockDc(dc);
return TRUE;
diff --git a/reactos/subsystems/win32/win32k/objects/coord.c b/reactos/subsystems/win32/win32k/objects/coord.c
index 6b80f1d463e..0ae25bcc10d 100644
--- a/reactos/subsystems/win32/win32k/objects/coord.c
+++ b/reactos/subsystems/win32/win32k/objects/coord.c
@@ -1133,6 +1133,16 @@ IntCalcFillOrigin(PDC pdc)
return pdc->ptlFillOrigin.y;
}
+PPOINTL
+FASTCALL
+IntptlBrushOrigin(PDC pdc, LONG x, LONG y )
+{
+ pdc->dclevel.ptlBrushOrigin.x = x;
+ pdc->dclevel.ptlBrushOrigin.y = y;
+ IntCalcFillOrigin(pdc);
+ return &pdc->dclevel.ptlBrushOrigin;
+}
+
VOID
APIENTRY
GdiSetDCOrg(HDC hDC, LONG Left, LONG Top, PRECTL prc)
diff --git a/reactos/subsystems/win32/win32k/objects/dclife.c b/reactos/subsystems/win32/win32k/objects/dclife.c
index c64139c9426..1fe51886b2a 100644
--- a/reactos/subsystems/win32/win32k/objects/dclife.c
+++ b/reactos/subsystems/win32/win32k/objects/dclife.c
@@ -119,6 +119,8 @@ DC_AllocDC(PUNICODE_STRING Driver)
pdcattr->hlfntNew = NtGdiGetStockObject(SYSTEM_FONT);
TextIntRealizeFont(pdcattr->hlfntNew,NULL);
+ NewDC->hlfntCur = pdcattr->hlfntNew;
+ NewDC->dclevel.plfnt = GDIOBJ_GetKernelObj(pdcattr->hlfntNew);
NewDC->dclevel.hpal = NtGdiGetStockObject(DEFAULT_PALETTE);
NewDC->dclevel.ppal = PALETTE_ShareLockPalette(NewDC->dclevel.hpal);
@@ -762,34 +764,16 @@ NtGdiCreateCompatibleDC(HDC hDC)
BOOL
APIENTRY
NtGdiDeleteObjectApp(HANDLE DCHandle)
-{
- /* Complete all pending operations */
- NtGdiFlushUserBatch();
-
- if (GDI_HANDLE_IS_STOCKOBJ(DCHandle)) return TRUE;
-
- if (GDI_HANDLE_GET_TYPE(DCHandle) != GDI_OBJECT_TYPE_DC)
- return GreDeleteObject((HGDIOBJ) DCHandle);
-
- if (IsObjectDead((HGDIOBJ)DCHandle)) return TRUE;
-
- if (!GDIOBJ_OwnedByCurrentProcess(DCHandle))
- {
- SetLastWin32Error(ERROR_INVALID_HANDLE);
- return FALSE;
- }
-
- return IntGdiDeleteDC(DCHandle, FALSE);
-}
-
-BOOL
-APIENTRY
-NewNtGdiDeleteObjectApp(HANDLE DCHandle)
{
GDIOBJTYPE ObjType;
+ /* Complete all pending operations */
+ NtGdiFlushUserBatch();
+
if (GDI_HANDLE_IS_STOCKOBJ(DCHandle)) return TRUE;
+ if (IsObjectDead((HGDIOBJ)DCHandle)) return TRUE;
+
ObjType = GDI_HANDLE_GET_TYPE(DCHandle) >> GDI_ENTRY_UPPER_SHIFT;
if (GreGetObjectOwner( DCHandle, ObjType))
diff --git a/reactos/subsystems/win32/win32k/objects/font.c b/reactos/subsystems/win32/win32k/objects/font.c
index 41a75cdb43f..6127d835f42 100644
--- a/reactos/subsystems/win32/win32k/objects/font.c
+++ b/reactos/subsystems/win32/win32k/objects/font.c
@@ -251,6 +251,49 @@ RealizeFontInit(HFONT hFont)
return pTextObj;
}
+HFONT
+FASTCALL
+GreSelectFont( HDC hDC, HFONT hFont)
+{
+ PDC pdc;
+ PDC_ATTR pdcattr;
+ PTEXTOBJ pOrgFnt, pNewFnt = NULL;
+ HFONT hOrgFont = NULL;
+
+ if (!hDC || !hFont) return NULL;
+
+ pdc = DC_LockDc(hDC);
+ if (!pdc)
+ {
+ return NULL;
+ }
+
+ if (NT_SUCCESS(TextIntRealizeFont((HFONT)hFont,NULL)))
+ {
+ /* LFONTOBJ use share and locking. */
+ pNewFnt = TEXTOBJ_LockText(hFont);
+ pdcattr = pdc->pdcattr;
+ pOrgFnt = pdc->dclevel.plfnt;
+ if (pOrgFnt)
+ {
+ hOrgFont = pOrgFnt->BaseObject.hHmgr;
+ }
+ else
+ {
+ hOrgFont = pdcattr->hlfntNew;
+ }
+ pdc->dclevel.plfnt = pNewFnt;
+ pdc->hlfntCur = hFont;
+ pdcattr->hlfntNew = hFont;
+ pdcattr->ulDirty_ |= DIRTY_CHARSET;
+ pdcattr->ulDirty_ &= ~SLOW_WIDTHS;
+ }
+
+ if (pNewFnt) TEXTOBJ_UnlockText(pNewFnt);
+ DC_UnlockDc(pdc);
+ return hOrgFont;
+}
+
/** Functions ******************************************************************/
INT
@@ -933,30 +976,7 @@ NtGdiSelectFont(
IN HDC hDC,
IN HFONT hFont)
{
- PDC pDC;
- PDC_ATTR pdcattr;
- HFONT hOrgFont = NULL;
-
- if (hDC == NULL || hFont == NULL) return NULL;
-
- pDC = DC_LockDc(hDC);
- if (!pDC)
- {
- return NULL;
- }
-
- pdcattr = pDC->pdcattr;
-
- /* FIXME: what if not successful? */
- if(NT_SUCCESS(TextIntRealizeFont((HFONT)hFont,NULL)))
- {
- hOrgFont = pdcattr->hlfntNew;
- pdcattr->hlfntNew = hFont;
- }
-
- DC_UnlockDc(pDC);
-
- return hOrgFont;
+ return GreSelectFont(hDC, hFont);
}
diff --git a/reactos/subsystems/win32/win32k/objects/gdibatch.c b/reactos/subsystems/win32/win32k/objects/gdibatch.c
index b958ad4835d..ac174e971fb 100644
--- a/reactos/subsystems/win32/win32k/objects/gdibatch.c
+++ b/reactos/subsystems/win32/win32k/objects/gdibatch.c
@@ -106,9 +106,10 @@ GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr)
case GdiBCSetBrushOrg:
{
PGDIBSSETBRHORG pgSBO;
- if(!dc) break;
+ if (!dc) break;
pgSBO = (PGDIBSSETBRHORG) pHdr;
pdcattr->ptlBrushOrigin = pgSBO->ptlBrushOrigin;
+ IntptlBrushOrigin(dc, pgSBO->ptlBrushOrigin.x, pgSBO->ptlBrushOrigin.y);
break;
}
case GdiBCExtSelClipRgn:
@@ -116,10 +117,34 @@ GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr)
case GdiBCSelObj:
{
PGDIBSOBJECT pgO;
- if(!dc) break;
+ PTEXTOBJ pOrgFnt, pNewFnt = NULL;
+ HFONT hOrgFont = NULL;
+
+ if (!dc) break;
pgO = (PGDIBSOBJECT) pHdr;
- TextIntRealizeFont((HFONT) pgO->hgdiobj, NULL);
- pdcattr->ulDirty_ &= ~(DIRTY_CHARSET);
+
+ if (NT_SUCCESS(TextIntRealizeFont((HFONT)pgO->hgdiobj,NULL)))
+ {
+ /* LFONTOBJ use share and locking. */
+ pNewFnt = TEXTOBJ_LockText(pgO->hgdiobj);
+
+ pOrgFnt = dc->dclevel.plfnt;
+ if (pOrgFnt)
+ {
+ hOrgFont = pOrgFnt->BaseObject.hHmgr;
+ }
+ else
+ {
+ hOrgFont = pdcattr->hlfntNew;
+ }
+ dc->dclevel.plfnt = pNewFnt;
+ dc->hlfntCur = pgO->hgdiobj;
+ pdcattr->hlfntNew = pgO->hgdiobj;
+ pdcattr->ulDirty_ |= DIRTY_CHARSET;
+ pdcattr->ulDirty_ &= ~SLOW_WIDTHS;
+ }
+ if (pNewFnt) TEXTOBJ_UnlockText(pNewFnt);
+ break;
}
case GdiBCDelRgn:
DPRINT("Delete Region Object!\n");
From 56eef6c56de9ac40f5d53291cf4bf22104d90dc2 Mon Sep 17 00:00:00 2001
From: Michael Martin
Date: Wed, 7 Apr 2010 10:25:36 +0000
Subject: [PATCH 062/261] [usb/usbehci] - Check the Interface GUID instead of
only the version and size. - Handle up to USB_BUS_INTERFACE_USBDI_V2 and
USB_BUS_INTERFACE_HUB_V5. Driver gets further in win2k. - Basic
implementation of Direct Call Function CreateUsbDevice. - Fix
GetRootHubSymbolicName to return RootHub20. - Change return status to not
supported for functions not implemented yet.
svn path=/trunk/; revision=46760
---
reactos/drivers/usb/usbehci/pdo.c | 155 ++++++++++++++++++--------
reactos/drivers/usb/usbehci/usbiffn.c | 30 +++--
2 files changed, 126 insertions(+), 59 deletions(-)
diff --git a/reactos/drivers/usb/usbehci/pdo.c b/reactos/drivers/usb/usbehci/pdo.c
index 84073a11fa0..2d251d66e87 100644
--- a/reactos/drivers/usb/usbehci/pdo.c
+++ b/reactos/drivers/usb/usbehci/pdo.c
@@ -17,6 +17,7 @@
#include
#include
#include
+#include
/* Lifted from Linux with slight changes */
const UCHAR ROOTHUB2_DEVICE_DESCRIPTOR [] =
@@ -98,7 +99,8 @@ UrbWorkerThread(PVOID Context)
PVOID InternalCreateUsbDevice(UCHAR DeviceNumber, ULONG Port, PUSB_DEVICE Parent, BOOLEAN Hub)
{
PUSB_DEVICE UsbDevicePointer = NULL;
- UsbDevicePointer = ExAllocatePool(NonPagedPool, sizeof(USB_DEVICE));
+ UsbDevicePointer = ExAllocatePoolWithTag(NonPagedPool, sizeof(USB_DEVICE), USB_POOL_TAG);
+
if (!UsbDevicePointer)
{
DPRINT1("Out of memory\n");
@@ -538,75 +540,132 @@ PdoDispatchPnp(
case IRP_MN_QUERY_INTERFACE:
{
UNICODE_STRING GuidString;
+ UNICODE_STRING InterfacMatchString;
PUSB_BUS_INTERFACE_HUB_V5 InterfaceHub;
PUSB_BUS_INTERFACE_USBDI_V2 InterfaceDI;
PPDO_DEVICE_EXTENSION PdoDeviceExtension;
PFDO_DEVICE_EXTENSION FdoDeviceExtension;
+ NTSTATUS CompareStatus;
PdoDeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
FdoDeviceExtension = (PFDO_DEVICE_EXTENSION)PdoDeviceExtension->ControllerFdo->DeviceExtension;
- Status = RtlStringFromGUID(Stack->Parameters.QueryInterface.InterfaceType, &GuidString);
- if (!NT_SUCCESS(Status))
+ /* Assume success */
+ Status = STATUS_SUCCESS;
+ Information = 0;
+
+ CompareStatus = RtlStringFromGUID(Stack->Parameters.QueryInterface.InterfaceType, &GuidString);
+ if (!NT_SUCCESS(CompareStatus))
{
DPRINT1("Failed to create string from GUID!\n");
}
+
DPRINT1("Interface GUID requested %wZ\n", &GuidString);
DPRINT1("QueryInterface.Size %x\n", Stack->Parameters.QueryInterface.Size);
DPRINT1("QueryInterface.Version %x\n", Stack->Parameters.QueryInterface.Version);
- Status = STATUS_SUCCESS;
- Information = 0;
-
- /* FIXME: Check the actual Guid */
- if (Stack->Parameters.QueryInterface.Size == sizeof(USB_BUS_INTERFACE_USBDI_V2) && (Stack->Parameters.QueryInterface.Version == 2))
+ CompareStatus = RtlStringFromGUID(&USB_BUS_INTERFACE_HUB_GUID, &InterfacMatchString);
+ if (!NT_SUCCESS(CompareStatus))
{
- InterfaceDI = (PUSB_BUS_INTERFACE_USBDI_V2) Stack->Parameters.QueryInterface.Interface;
- InterfaceDI->Size = sizeof(USB_BUS_INTERFACE_USBDI_V2);
- InterfaceDI->Version = 2;
- InterfaceDI->BusContext = PdoDeviceExtension->DeviceObject;
- InterfaceDI->InterfaceReference = (PINTERFACE_REFERENCE)InterfaceReference;
- InterfaceDI->InterfaceDereference = (PINTERFACE_DEREFERENCE)InterfaceDereference;
- InterfaceDI->GetUSBDIVersion = GetUSBDIVersion;
- InterfaceDI->QueryBusTime = QueryBusTime;
- InterfaceDI->SubmitIsoOutUrb = SubmitIsoOutUrb;
- InterfaceDI->QueryBusInformation = QueryBusInformation;
- InterfaceDI->IsDeviceHighSpeed = IsDeviceHighSpeed;
- InterfaceDI->EnumLogEntry = EnumLogEntry;
+ DPRINT1("Failed to create string from GUID!\n");
}
- /* FIXME: Check the actual Guid */
- else if (Stack->Parameters.QueryInterface.Size == sizeof(USB_BUS_INTERFACE_HUB_V5) &&
- (Stack->Parameters.QueryInterface.Version == 5))
+
+ CompareStatus = RtlCompareUnicodeString(&InterfacMatchString, &GuidString, TRUE);
+
+ if (NT_SUCCESS(CompareStatus))
{
InterfaceHub = (PUSB_BUS_INTERFACE_HUB_V5)Stack->Parameters.QueryInterface.Interface;
- InterfaceHub->Version = 5;
- InterfaceHub->Size = sizeof(USB_BUS_INTERFACE_HUB_V5);
- InterfaceHub->BusContext = PdoDeviceExtension->DeviceObject;
- InterfaceHub->InterfaceReference = (PINTERFACE_REFERENCE)InterfaceReference;
- InterfaceHub->InterfaceDereference = (PINTERFACE_DEREFERENCE)InterfaceDereference;
- InterfaceHub->CreateUsbDevice = CreateUsbDevice;
- InterfaceHub->InitializeUsbDevice = InitializeUsbDevice;
- InterfaceHub->GetUsbDescriptors = GetUsbDescriptors;
- InterfaceHub->RemoveUsbDevice = RemoveUsbDevice;
- InterfaceHub->RestoreUsbDevice = RestoreUsbDevice;
- InterfaceHub->GetPortHackFlags = GetPortHackFlags;
- InterfaceHub->QueryDeviceInformation = QueryDeviceInformation;
- InterfaceHub->GetControllerInformation = GetControllerInformation;
- InterfaceHub->ControllerSelectiveSuspend = ControllerSelectiveSuspend;
- InterfaceHub->GetExtendedHubInformation = GetExtendedHubInformation;
- InterfaceHub->GetRootHubSymbolicName = GetRootHubSymbolicName;
- InterfaceHub->GetDeviceBusContext = GetDeviceBusContext;
- InterfaceHub->Initialize20Hub = Initialize20Hub;
- InterfaceHub->RootHubInitNotification = RootHubInitNotification;
- InterfaceHub->FlushTransfers = FlushTransfers;
- InterfaceHub->SetDeviceHandleData = SetDeviceHandleData;
+ InterfaceHub->Version = Stack->Parameters.QueryInterface.Version;
+ if (Stack->Parameters.QueryInterface.Version >= 0)
+ {
+ InterfaceHub->Size = Stack->Parameters.QueryInterface.Size;
+ InterfaceHub->BusContext = PdoDeviceExtension->DeviceObject;
+ InterfaceHub->InterfaceReference = (PINTERFACE_REFERENCE)InterfaceReference;
+ InterfaceHub->InterfaceDereference = (PINTERFACE_DEREFERENCE)InterfaceDereference;
+ }
+ if (Stack->Parameters.QueryInterface.Version >= 1)
+ {
+ InterfaceHub->CreateUsbDevice = CreateUsbDevice;
+ InterfaceHub->InitializeUsbDevice = InitializeUsbDevice;
+ InterfaceHub->GetUsbDescriptors = GetUsbDescriptors;
+ InterfaceHub->RemoveUsbDevice = RemoveUsbDevice;
+ InterfaceHub->RestoreUsbDevice = RestoreUsbDevice;
+ InterfaceHub->GetPortHackFlags = GetPortHackFlags;
+ InterfaceHub->QueryDeviceInformation = QueryDeviceInformation;
+ }
+ if (Stack->Parameters.QueryInterface.Version >= 2)
+ {
+ InterfaceHub->GetControllerInformation = GetControllerInformation;
+ InterfaceHub->ControllerSelectiveSuspend = ControllerSelectiveSuspend;
+ InterfaceHub->GetExtendedHubInformation = GetExtendedHubInformation;
+ InterfaceHub->GetRootHubSymbolicName = GetRootHubSymbolicName;
+ InterfaceHub->GetDeviceBusContext = GetDeviceBusContext;
+ InterfaceHub->Initialize20Hub = Initialize20Hub;
+
+ }
+ if (Stack->Parameters.QueryInterface.Version >= 3)
+ {
+ InterfaceHub->RootHubInitNotification = RootHubInitNotification;
+ }
+ if (Stack->Parameters.QueryInterface.Version >= 4)
+ {
+ InterfaceHub->FlushTransfers = FlushTransfers;
+ }
+ if (Stack->Parameters.QueryInterface.Version >= 5)
+ {
+ InterfaceHub->SetDeviceHandleData = SetDeviceHandleData;
+ }
+ if (Stack->Parameters.QueryInterface.Version >= 6)
+ {
+ DPRINT1("Unknown version!\n");
+ }
+ break;
}
- else
+
+ CompareStatus = RtlStringFromGUID(&USB_BUS_INTERFACE_USBDI_GUID, &InterfacMatchString);
+ if (!NT_SUCCESS(CompareStatus))
{
- DPRINT1("Not Supported\n");
- Status = Irp->IoStatus.Status;
- Information = Irp->IoStatus.Information;
+ DPRINT1("Failed to create string from GUID!\n");
}
+
+ CompareStatus = RtlCompareUnicodeString(&InterfacMatchString, &GuidString, TRUE);
+
+ if (NT_SUCCESS(CompareStatus))
+ {
+ InterfaceDI = (PUSB_BUS_INTERFACE_USBDI_V2) Stack->Parameters.QueryInterface.Interface;
+ InterfaceDI->Version = Stack->Parameters.QueryInterface.Version;
+ if (Stack->Parameters.QueryInterface.Version >= 0)
+ {
+ //InterfaceDI->Size = sizeof(USB_BUS_INTERFACE_USBDI_V2);
+ InterfaceDI->Size = Stack->Parameters.QueryInterface.Size;
+ InterfaceDI->BusContext = PdoDeviceExtension->DeviceObject;
+ InterfaceDI->InterfaceReference = (PINTERFACE_REFERENCE)InterfaceReference;
+ InterfaceDI->InterfaceDereference = (PINTERFACE_DEREFERENCE)InterfaceDereference;
+ InterfaceDI->GetUSBDIVersion = GetUSBDIVersion;
+ InterfaceDI->QueryBusTime = QueryBusTime;
+ InterfaceDI->SubmitIsoOutUrb = SubmitIsoOutUrb;
+ InterfaceDI->QueryBusInformation = QueryBusInformation;
+ }
+ if (Stack->Parameters.QueryInterface.Version >= 1)
+ {
+ InterfaceDI->IsDeviceHighSpeed = IsDeviceHighSpeed;
+ }
+ if (Stack->Parameters.QueryInterface.Version >= 2)
+ {
+ InterfaceDI->EnumLogEntry = EnumLogEntry;
+ }
+
+ if (Stack->Parameters.QueryInterface.Version >= 3)
+ {
+ DPRINT1("Not Supported!\n");
+ }
+ break;
+ }
+
+ DPRINT1("Not Supported\n");
+ Status = Irp->IoStatus.Status;
+ Information = Irp->IoStatus.Information;
+
break;
}
case IRP_MN_QUERY_BUS_INFORMATION:
diff --git a/reactos/drivers/usb/usbehci/usbiffn.c b/reactos/drivers/usb/usbehci/usbiffn.c
index e30aa305e7a..77d4b0f70b6 100644
--- a/reactos/drivers/usb/usbehci/usbiffn.c
+++ b/reactos/drivers/usb/usbehci/usbiffn.c
@@ -58,6 +58,10 @@ CreateUsbDevice(PVOID BusContext,
USHORT PortStatus, USHORT PortNumber)
{
DPRINT1("CreateUsbDevice called\n");
+ DPRINT1("PortStatus %x\n", PortStatus);
+ DPRINT1("PortNumber %x\n", PortNumber);
+ *NewDevice = ExAllocatePoolWithTag(NonPagedPool, sizeof(USB_DEVICE), USB_POOL_TAG);
+
return STATUS_SUCCESS;
}
@@ -100,7 +104,7 @@ USB_BUSIFFN
RemoveUsbDevice(PVOID BusContext, PUSB_DEVICE_HANDLE DeviceHandle, ULONG Flags)
{
DPRINT1("RemoveUsbDevice called\n");
- return STATUS_SUCCESS;
+ return STATUS_NOT_SUPPORTED;
}
NTSTATUS
@@ -108,7 +112,7 @@ USB_BUSIFFN
RestoreUsbDevice(PVOID BusContext, PUSB_DEVICE_HANDLE OldDeviceHandle, PUSB_DEVICE_HANDLE NewDeviceHandle)
{
DPRINT1("RestoreUsbDevice called\n");
- return STATUS_SUCCESS;
+ return STATUS_NOT_SUPPORTED;
}
NTSTATUS
@@ -116,7 +120,7 @@ USB_BUSIFFN
GetPortHackFlags(PVOID BusContext, PULONG Flags)
{
DPRINT1("GetPortHackFlags called\n");
- return STATUS_SUCCESS;
+ return STATUS_NOT_SUPPORTED;
}
NTSTATUS
@@ -172,7 +176,6 @@ QueryDeviceInformation(PVOID BusContext,
{
RtlCopyMemory(&DeviceInfo->PipeList[i].EndpointDescriptor, &UsbDevice->ActiveInterface->EndPoints[i]->EndPointDescriptor, sizeof(USB_ENDPOINT_DESCRIPTOR));
}
-
return STATUS_SUCCESS;
}
@@ -230,7 +233,7 @@ GetExtendedHubInformation(PVOID BusContext,
PPDO_DEVICE_EXTENSION PdoDeviceExtension = (PPDO_DEVICE_EXTENSION)((PDEVICE_OBJECT)BusContext)->DeviceExtension;
PFDO_DEVICE_EXTENSION FdoDeviceExntension = (PFDO_DEVICE_EXTENSION)PdoDeviceExtension->ControllerFdo->DeviceExtension;
LONG i;
-
+ DPRINT1("GetExtendedHubInformation\n");
/* Set the default return value */
*LengthReturned = 0;
/* Caller must have set InformationLevel to 0 */
@@ -266,7 +269,7 @@ GetRootHubSymbolicName(PVOID BusContext,
if (HubSymNameBufferLength < 20)
return STATUS_UNSUCCESSFUL;
- //RtlStringCbCopy(HubSymNameBuffer, HubSymNameBufferLength, L"ROOT_HUB20");
+ RtlCopyMemory(HubSymNameBuffer, L"ROOT_HUB20", HubSymNameBufferLength);
*HubSymNameActualLength = 20;
return STATUS_SUCCESS;
@@ -284,7 +287,12 @@ NTSTATUS
USB_BUSIFFN
Initialize20Hub(PVOID BusContext, PUSB_DEVICE_HANDLE HubDeviceHandle, ULONG TtCount)
{
- DPRINT1("Initialize20Hub called\n");
+ DPRINT1("Initialize20Hub called, HubDeviceHandle: %x\n", HubDeviceHandle);
+
+ /* FIXME: */
+ /* Create the Irp Queue for SCE */
+ /* Should queue be created for each device or each enpoint??? */
+
return STATUS_SUCCESS;
}
@@ -331,7 +339,7 @@ USB_BUSIFFN
QueryBusTime(PVOID BusContext, PULONG CurrentFrame)
{
DPRINT1("QueryBusTime called\n");
- return STATUS_SUCCESS;
+ return STATUS_NOT_SUPPORTED;
}
NTSTATUS
@@ -339,7 +347,7 @@ USB_BUSIFFN
SubmitIsoOutUrb(PVOID BusContext, PURB Urb)
{
DPRINT1("SubmitIsoOutUrb called\n");
- return STATUS_SUCCESS;
+ return STATUS_NOT_SUPPORTED;
}
NTSTATUS
@@ -351,7 +359,7 @@ QueryBusInformation(PVOID BusContext,
PULONG BusInformationActualLength)
{
DPRINT1("QueryBusInformation called\n");
- return STATUS_SUCCESS;
+ return STATUS_NOT_SUPPORTED;
}
BOOLEAN
@@ -367,6 +375,6 @@ USB_BUSIFFN
EnumLogEntry(PVOID BusContext, ULONG DriverTag, ULONG EnumTag, ULONG P1, ULONG P2)
{
DPRINT1("EnumLogEntry called\n");
- return STATUS_SUCCESS;
+ return STATUS_NOT_SUPPORTED;
}
From f1c016d7cd95288fc0d2dfce845597dee0d39130 Mon Sep 17 00:00:00 2001
From: Michael Martin
Date: Wed, 7 Apr 2010 11:09:36 +0000
Subject: [PATCH 063/261] [usb/usbehci] - Instead of converting GUID to
UNICODE_STRING and comparing, use IsEqualGUIDAligned. Thanks Ged. - Remove a
unneeded header.
svn path=/trunk/; revision=46761
---
reactos/drivers/usb/usbehci/pdo.c | 33 +++++++------------------------
1 file changed, 7 insertions(+), 26 deletions(-)
diff --git a/reactos/drivers/usb/usbehci/pdo.c b/reactos/drivers/usb/usbehci/pdo.c
index 2d251d66e87..d38ca6fb608 100644
--- a/reactos/drivers/usb/usbehci/pdo.c
+++ b/reactos/drivers/usb/usbehci/pdo.c
@@ -17,7 +17,6 @@
#include
#include
#include
-#include
/* Lifted from Linux with slight changes */
const UCHAR ROOTHUB2_DEVICE_DESCRIPTOR [] =
@@ -540,22 +539,16 @@ PdoDispatchPnp(
case IRP_MN_QUERY_INTERFACE:
{
UNICODE_STRING GuidString;
- UNICODE_STRING InterfacMatchString;
PUSB_BUS_INTERFACE_HUB_V5 InterfaceHub;
PUSB_BUS_INTERFACE_USBDI_V2 InterfaceDI;
PPDO_DEVICE_EXTENSION PdoDeviceExtension;
PFDO_DEVICE_EXTENSION FdoDeviceExtension;
- NTSTATUS CompareStatus;
PdoDeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
FdoDeviceExtension = (PFDO_DEVICE_EXTENSION)PdoDeviceExtension->ControllerFdo->DeviceExtension;
- /* Assume success */
- Status = STATUS_SUCCESS;
- Information = 0;
-
- CompareStatus = RtlStringFromGUID(Stack->Parameters.QueryInterface.InterfaceType, &GuidString);
- if (!NT_SUCCESS(CompareStatus))
+ Status = RtlStringFromGUID(Stack->Parameters.QueryInterface.InterfaceType, &GuidString);
+ if (!NT_SUCCESS(Status))
{
DPRINT1("Failed to create string from GUID!\n");
}
@@ -564,15 +557,11 @@ PdoDispatchPnp(
DPRINT1("QueryInterface.Size %x\n", Stack->Parameters.QueryInterface.Size);
DPRINT1("QueryInterface.Version %x\n", Stack->Parameters.QueryInterface.Version);
- CompareStatus = RtlStringFromGUID(&USB_BUS_INTERFACE_HUB_GUID, &InterfacMatchString);
- if (!NT_SUCCESS(CompareStatus))
- {
- DPRINT1("Failed to create string from GUID!\n");
- }
+ /* Assume success */
+ Status = STATUS_SUCCESS;
+ Information = 0;
- CompareStatus = RtlCompareUnicodeString(&InterfacMatchString, &GuidString, TRUE);
-
- if (NT_SUCCESS(CompareStatus))
+ if (IsEqualGUIDAligned(Stack->Parameters.QueryInterface.InterfaceType, &USB_BUS_INTERFACE_HUB_GUID))
{
InterfaceHub = (PUSB_BUS_INTERFACE_HUB_V5)Stack->Parameters.QueryInterface.Interface;
InterfaceHub->Version = Stack->Parameters.QueryInterface.Version;
@@ -622,15 +611,7 @@ PdoDispatchPnp(
break;
}
- CompareStatus = RtlStringFromGUID(&USB_BUS_INTERFACE_USBDI_GUID, &InterfacMatchString);
- if (!NT_SUCCESS(CompareStatus))
- {
- DPRINT1("Failed to create string from GUID!\n");
- }
-
- CompareStatus = RtlCompareUnicodeString(&InterfacMatchString, &GuidString, TRUE);
-
- if (NT_SUCCESS(CompareStatus))
+ if (IsEqualGUIDAligned(Stack->Parameters.QueryInterface.InterfaceType, &USB_BUS_INTERFACE_USBDI_GUID))
{
InterfaceDI = (PUSB_BUS_INTERFACE_USBDI_V2) Stack->Parameters.QueryInterface.Interface;
InterfaceDI->Version = Stack->Parameters.QueryInterface.Version;
From 779a3240ded67c81656124df1f883f1343341dd2 Mon Sep 17 00:00:00 2001
From: Daniel Reimer
Date: Wed, 7 Apr 2010 14:35:04 +0000
Subject: [PATCH 064/261] Update all rapps entries.
svn path=/trunk/; revision=46762
---
.../base/applications/rapps/rapps/firefox3.txt | 16 ++++++++--------
.../base/applications/rapps/rapps/mirandaim.txt | 4 ++--
.../base/applications/rapps/rapps/openttd.txt | 6 +++---
reactos/base/applications/rapps/rapps/scite.txt | 4 ++--
.../base/applications/rapps/rapps/scummvm.txt | 6 +++---
.../base/applications/rapps/rapps/seamonkey.txt | 16 ++++++++--------
.../applications/rapps/rapps/thunderbird.txt | 14 +++++++-------
7 files changed, 33 insertions(+), 33 deletions(-)
diff --git a/reactos/base/applications/rapps/rapps/firefox3.txt b/reactos/base/applications/rapps/rapps/firefox3.txt
index e6051802e00..e9313b7677a 100644
--- a/reactos/base/applications/rapps/rapps/firefox3.txt
+++ b/reactos/base/applications/rapps/rapps/firefox3.txt
@@ -2,41 +2,41 @@
[Section]
Name = Mozilla Firefox 3.0
-Version = 3.0.18
+Version = 3.0.19
Licence = MPL/GPL/LGPL
Description = The most popular and one of the best free Web Browsers out there.
Size = 7.2M
Category = 5
URLSite = http://www.mozilla.com/en-US/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-3.0/win32/en-US/Firefox%20Setup%203.0.18.exe
+URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real/win32/en-US/Firefox%20Setup%203.0.19.exe
CDPath = none
[Section.0407]
Description = Der populärste und einer der besten freien Webbrowser.
Size = 7.0M
URLSite = http://www.mozilla-europe.org/de/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-3.0/win32/de/Firefox%20Setup%203.0.18.exe
+URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real/win32/de/Firefox%20Setup%203.0.19.exe
[Section.040a]
Description = El más popular y uno de los mejores navegadores web gratuitos que hay.
Size = 7.0M
URLSite = http://www.mozilla-europe.org/es/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-3.0/win32/es-ES/Firefox%20Setup%203.0.18.exe
+URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real/win32/es-ES/Firefox%20Setup%203.0.19.exe
[Section.0414]
Description = Mest populære og best også gratis nettleserene der ute.
-Size = 6.9M
+Size = 7.0M
URLSite = http://www.mozilla-europe.org/no/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-3.0/win32/nb-NO/Firefox%20Setup%203.0.18.exe
+URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real/win32/nb-NO/Firefox%20Setup%203.0.19.exe
[Section.0415]
Description = Najpopularniejsza i jedna z najlepszych darmowych przeglÄ…darek internetowych.
Size = 7.8M
URLSite = http://www.mozilla-europe.org/pl/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-3.0/win32/pl/Firefox%20Setup%203.0.18.exe
+URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real/win32/pl/Firefox%20Setup%203.0.19.exe
[Section.0419]
Description = Один из Ñамых популÑрных и лучших беÑплатных браузеров.
Size = 7.4M
URLSite = http://www.mozilla-europe.org/ru/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-3.0/win32/ru/Firefox%20Setup%203.0.18.exe
+URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real/win32/ru/Firefox%20Setup%203.0.19.exe
diff --git a/reactos/base/applications/rapps/rapps/mirandaim.txt b/reactos/base/applications/rapps/rapps/mirandaim.txt
index 0fff6a4ea04..db0b17f1ab6 100644
--- a/reactos/base/applications/rapps/rapps/mirandaim.txt
+++ b/reactos/base/applications/rapps/rapps/mirandaim.txt
@@ -2,13 +2,13 @@
[Section]
Name = Miranda IM
-Version = 0.8.18
+Version = 0.8.19
Licence = GPL
Description = Open source multiprotocol instant messaging application - May not work completely.
Size = 1.6MB
Category = 5
URLSite = http://www.miranda-im.org/
-URLDownload = http://miranda.googlecode.com/files/miranda-im-v0.8.18-unicode.exe
+URLDownload = http://miranda.googlecode.com/files/miranda-im-v0.8.19-unicode.exe
CDPath = none
[Section.0407]
diff --git a/reactos/base/applications/rapps/rapps/openttd.txt b/reactos/base/applications/rapps/rapps/openttd.txt
index dfc94a95e43..2e70160c846 100644
--- a/reactos/base/applications/rapps/rapps/openttd.txt
+++ b/reactos/base/applications/rapps/rapps/openttd.txt
@@ -2,13 +2,13 @@
[Section]
Name = OpenTTD
-Version = 0.7.5
+Version = 1.0.0
Licence = GPL v2
Description = Open Source clone of the "Transport Tycoon Deluxe" game engine. You need a copy of Transport Tycoon.
-Size = 2.9MB
+Size = 3.5MB
Category = 4
URLSite = http://www.openttd.org/
-URLDownload = http://binaries.openttd.org/releases/0.7.5/openttd-0.7.5-windows-win32.exe
+URLDownload = http://binaries.openttd.org/releases/1.0.0/openttd-1.0.0-windows-win32.exe
CDPath = none
[Section.0407]
diff --git a/reactos/base/applications/rapps/rapps/scite.txt b/reactos/base/applications/rapps/rapps/scite.txt
index fc3d9d50cca..1f8208b2153 100644
--- a/reactos/base/applications/rapps/rapps/scite.txt
+++ b/reactos/base/applications/rapps/rapps/scite.txt
@@ -2,13 +2,13 @@
[Section]
Name = SciTE
-Version = 2.03
+Version = 2.10
Licence = Freeware
Description = SciTE is a SCIntilla based Text Editor. Originally built to demonstrate Scintilla, it has grown to be a generally useful editor with facilities for building and running programs.
Size = 0.6M
Category = 7
URLSite = http://www.scintilla.org/
-URLDownload = http://ovh.dl.sourceforge.net/sourceforge/scintilla/Sc203.exe
+URLDownload = http://ovh.dl.sourceforge.net/sourceforge/scintilla/Sc210.exe
CDPath = none
[Section.0407]
diff --git a/reactos/base/applications/rapps/rapps/scummvm.txt b/reactos/base/applications/rapps/rapps/scummvm.txt
index 6365b1c1b63..ebe7b348a50 100644
--- a/reactos/base/applications/rapps/rapps/scummvm.txt
+++ b/reactos/base/applications/rapps/rapps/scummvm.txt
@@ -2,13 +2,13 @@
[Section]
Name = ScummVM
-Version = 1.0.0
+Version = 1.1.0
Licence = GPL
Description = Sam and Max, Day of the Tentacle, etc on ReactOS.
-Size = 3.1MB
+Size = 3.4MB
Category = 4
URLSite = http://scummvm.org/
-URLDownload = http://dfn.dl.sourceforge.net/project/scummvm/scummvm/1.0.0/scummvm-1.0.0-win32.exe
+URLDownload = http://dfn.dl.sourceforge.net/project/scummvm/scummvm/1.1.0/scummvm-1.1.0-win32.exe
CDPath = none
[Section.0407]
diff --git a/reactos/base/applications/rapps/rapps/seamonkey.txt b/reactos/base/applications/rapps/rapps/seamonkey.txt
index 9c980d30b65..55d3be87f2f 100644
--- a/reactos/base/applications/rapps/rapps/seamonkey.txt
+++ b/reactos/base/applications/rapps/rapps/seamonkey.txt
@@ -2,31 +2,31 @@
[Section]
Name = Mozilla SeaMonkey
-Version = 2.0.3
+Version = 2.0.4
Licence = MPL/GPL/LGPL
Description = Mozilla Suite is alive. This is the one and only Browser, Mail, Chat, and Composer bundle you will ever need.
-Size = 10.0MB
+Size = 10.1MB
Category = 5
URLSite = http://www.seamonkey-project.org/
-URLDownload = http://ftp.df.lth.se/mozilla/seamonkey/releases/2.0.3/win32/en-US/SeaMonkey%20Setup%202.0.3.exe
+URLDownload = http://ftp.df.lth.se/mozilla/seamonkey/releases/2.0.4/win32/en-US/SeaMonkey%20Setup%202.0.4.exe
CDPath = none
[Section.0407]
Description = Mozilla Suite lebt. Dies ist das einzige Browser-, Mail-, Chat- and Composerwerkzeug-Bundle welches Sie benötigen.
-Size = 10.1MB
-URLDownload = http://ftp.df.lth.se/mozilla/seamonkey/releases/2.0.3/win32/de/SeaMonkey%20Setup%202.0.3.exe
+Size = 10.0MB
+URLDownload = http://ftp.df.lth.se/mozilla/seamonkey/releases/2.0.4/win32/de/SeaMonkey%20Setup%202.0.4.exe
[Section.040a]
Description = La suite de Mozilla está viva. Es el primero y único navegador web, gestor de correo, lector de noticias, Chat y editor HTML que necesitarás.
Size = 10.0MB
-URLDownload = http://ftp.df.lth.se/mozilla/seamonkey/releases/2.0.3/win32/es-ES/SeaMonkey%20Setup%202.0.3.exe
+URLDownload = http://ftp.df.lth.se/mozilla/seamonkey/releases/2.0.4/win32/es-ES/SeaMonkey%20Setup%202.0.4.exe
[Section.0415]
Description = Pakiet Mozilla żyje. W zestawie: przeglądarka, klient poczty, IRC oraz Edytor HTML - wszystko, czego potrzebujesz.
Size = 10.8MB
-URLDownload = http://ftp.df.lth.se/mozilla/seamonkey/releases/2.0.3/win32/pl/SeaMonkey%20Setup%202.0.3.exe
+URLDownload = http://ftp.df.lth.se/mozilla/seamonkey/releases/2.0.4/win32/pl/SeaMonkey%20Setup%202.0.4.exe
[Section.0419]
Description = Продолжение Mozilla Suite. Включает браузер, почтовый клиент, IRC-клиент и HTML-редактор.
Size = 10.4MB
-URLDownload = http://ftp.df.lth.se/mozilla/seamonkey/releases/2.0.3/win32/ru/SeaMonkey%20Setup%202.0.3.exe
+URLDownload = http://ftp.df.lth.se/mozilla/seamonkey/releases/2.0.4/win32/ru/SeaMonkey%20Setup%202.0.4.exe
diff --git a/reactos/base/applications/rapps/rapps/thunderbird.txt b/reactos/base/applications/rapps/rapps/thunderbird.txt
index 9f0cd328d89..a9e837cd7e0 100644
--- a/reactos/base/applications/rapps/rapps/thunderbird.txt
+++ b/reactos/base/applications/rapps/rapps/thunderbird.txt
@@ -2,35 +2,35 @@
[Section]
Name = Mozilla Thunderbird
-Version = 3.0.3
+Version = 3.0.4
Licence = MPL/GPL/LGPL
Description = The most popular and one of the best free Mail Clients out there.
Size = 8.6M
Category = 5
URLSite = http://www.mozilla-europe.org/en/products/thunderbird/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/3.0.3/win32/en-US/Thunderbird%20Setup%203.0.3.exe
+URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/3.0.4/win32/en-US/Thunderbird%20Setup%203.0.4.exe
CDPath = none
[Section.0407]
Description = Der populärste und einer der besten freien Mail-Clients.
-Size = 8.4M
+Size = 8.5M
URLSite = http://www.mozilla-europe.org/de/products/thunderbird/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/3.0.3/win32/de/Thunderbird%20Setup%203.0.3.exe
+URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/3.0.4/win32/de/Thunderbird%20Setup%203.0.4.exe
[Section.040a]
Description = El más popular y uno de los mejores clientes mail que hay.
Size = 8.4M
URLSite = http://www.mozilla-europe.org/es/products/thunderbird/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/3.0.3/win32/es-ES/Thunderbird%20Setup%203.0.3.exe
+URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/3.0.4/win32/es-ES/Thunderbird%20Setup%203.0.4.exe
[Section.0415]
Description = Najpopularniejszy i jeden z najlepszych darmowych klientów poczty.
Size = 9.3M
URLSite = http://www.mozilla-europe.org/pl/products/thunderbird/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/3.0.3/win32/pl/Thunderbird%20Setup%203.0.3.exe
+URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/3.0.4/win32/pl/Thunderbird%20Setup%203.0.4.exe
[Section.0419]
Description = Один из Ñамых популÑрных и лучших беÑплатных почтовых клиентов.
Size = 8.8M
URLSite = http://www.mozilla-europe.org/ru/products/thunderbird/
-URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/3.0.3/win32/ru/Thunderbird%20Setup%203.0.3.exe
+URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/3.0.4/win32/ru/Thunderbird%20Setup%203.0.4.exe
From 2052c57785e55f9136cc56b01d197d4d9c82ef9c Mon Sep 17 00:00:00 2001
From: Gregor Schneider
Date: Wed, 7 Apr 2010 17:41:38 +0000
Subject: [PATCH 065/261] [SHELL32] - Portuguese translation by Manuel Silva
See issue #1494 for more details.
svn path=/trunk/; revision=46764
---
reactos/dll/win32/shell32/lang/pt-PT.rc | 575 ++++++++++++------------
1 file changed, 288 insertions(+), 287 deletions(-)
diff --git a/reactos/dll/win32/shell32/lang/pt-PT.rc b/reactos/dll/win32/shell32/lang/pt-PT.rc
index dbf3fe2453c..0660e3b481d 100644
--- a/reactos/dll/win32/shell32/lang/pt-PT.rc
+++ b/reactos/dll/win32/shell32/lang/pt-PT.rc
@@ -2,6 +2,7 @@
* Copyright 1998 Juergen Schmied
* Copyright 2003 Marcelo Duarte
* Copyright 2006-2007 Américo José Melo
+ * Copyright 2010 Manuel D V Silva
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -66,27 +67,27 @@ MENU_SHV_FILE MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
- MENUITEM "E&xplore", FCIDM_SHVIEW_EXPLORE
- MENUITEM "&Open", FCIDM_SHVIEW_OPEN
+ MENUITEM "E&xplorador", FCIDM_SHVIEW_EXPLORE
+ MENUITEM "&Abrir", FCIDM_SHVIEW_OPEN
MENUITEM SEPARATOR
- MENUITEM "C&ut", FCIDM_SHVIEW_CUT
- MENUITEM "&Copy", FCIDM_SHVIEW_COPY
+ MENUITEM "C&ortar", FCIDM_SHVIEW_CUT
+ MENUITEM "&Copiar", FCIDM_SHVIEW_COPY
MENUITEM SEPARATOR
- MENUITEM "Create &Link", FCIDM_SHVIEW_CREATELINK
- MENUITEM "&Delete", FCIDM_SHVIEW_DELETE
- MENUITEM "&Rename", FCIDM_SHVIEW_RENAME
+ MENUITEM "Criar &Link", FCIDM_SHVIEW_CREATELINK
+ MENUITEM "&Apagar", FCIDM_SHVIEW_DELETE
+ MENUITEM "&Renomear", FCIDM_SHVIEW_RENAME
MENUITEM SEPARATOR
- MENUITEM "&Properties", FCIDM_SHVIEW_PROPERTIES
+ MENUITEM "&Propriadades", FCIDM_SHVIEW_PROPERTIES
END
END
SHBRSFORFOLDER_MSGBOX DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 15, 40, 188, 192
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
-CAPTION "Browse for Folder"
+CAPTION "Procurar Pastas"
FONT 8, "MS Shell Dlg"
BEGIN
DEFPUSHBUTTON "OK", 1, 60, 175, 60, 15, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
- PUSHBUTTON "Cancel", 2, 125, 175, 60, 15, WS_GROUP | WS_TABSTOP
+ PUSHBUTTON "Cancelar", 2, 125, 175, 60, 15, WS_GROUP | WS_TABSTOP
LTEXT "", IDD_TITLE, 4, 4, 180, 12
LTEXT "", IDD_STATUS, 4, 25, 180, 12
CONTROL "", IDD_TREEVIEW, "SysTreeView32", TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | WS_BORDER | WS_TABSTOP, 4, 40, 180, 120
@@ -94,28 +95,28 @@ END
SHNEWBRSFORFOLDER_MSGBOX DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 15, 40, 218, 196
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
-CAPTION "Browse for Folder"
+CAPTION "Procurar Pastas"
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "", IDD_TITLE, 10, 8, 198, 24
LTEXT "", IDD_STATUS, 10, 25, 198, 12
- LTEXT "Folder:", IDD_FOLDER, 10, 152, 40, 12
+ LTEXT "Pasta:", IDD_FOLDER, 10, 152, 40, 12
CONTROL "", IDD_TREEVIEW, "SysTreeView32", TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | WS_BORDER | WS_TABSTOP, 12, 38, 194, 105
EDITTEXT IDD_FOLDERTEXT, 46, 150, 160, 14, WS_BORDER | WS_GROUP | WS_TABSTOP
- PUSHBUTTON "&Make New Folder", IDD_MAKENEWFOLDER, 12, 174, 77, 14, WS_GROUP | WS_TABSTOP
+ PUSHBUTTON "&Criar Nova Pasta", IDD_MAKENEWFOLDER, 12, 174, 77, 14, WS_GROUP | WS_TABSTOP
DEFPUSHBUTTON "OK", IDOK, 102, 174, 50, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
- PUSHBUTTON "Cancel", IDCANCEL, 156, 174, 50, 14, WS_GROUP | WS_TABSTOP
+ PUSHBUTTON "Cancelar", IDCANCEL, 156, 174, 50, 14, WS_GROUP | WS_TABSTOP
END
SHELL_YESTOALL_MSGBOX DIALOGEX 200, 100, 280, 90
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-CAPTION "Message"
+CAPTION "Mensagem"
FONT 8, "MS Shell Dlg"
BEGIN
- DEFPUSHBUTTON "&Yes", IDYES, 34, 69, 53, 14, WS_GROUP | WS_TABSTOP
- PUSHBUTTON "Yes to &all", IDD_YESTOALL, 92, 69, 65, 14, WS_GROUP | WS_TABSTOP
- PUSHBUTTON "&No", IDNO, 162, 69, 53, 14, WS_GROUP | WS_TABSTOP
- PUSHBUTTON "&Cancel", IDCANCEL, 220, 69, 53, 14, WS_GROUP | WS_TABSTOP
+ DEFPUSHBUTTON "&Sim", IDYES, 34, 69, 53, 14, WS_GROUP | WS_TABSTOP
+ PUSHBUTTON "Sim para &todos", IDD_YESTOALL, 92, 69, 65, 14, WS_GROUP | WS_TABSTOP
+ PUSHBUTTON "&Não", IDNO, 162, 69, 53, 14, WS_GROUP | WS_TABSTOP
+ PUSHBUTTON "&Cancelar", IDCANCEL, 220, 69, 53, 14, WS_GROUP | WS_TABSTOP
ICON "", IDD_ICON, 10, 10, 16, 16
LTEXT "", IDD_MESSAGE, 40, 10, 238, 52, 0
END
@@ -127,14 +128,14 @@ FONT 8, "MS Shell Dlg"
BEGIN
ICON "", IDC_SHELL_ABOUT_ICON, 7, 55, 21, 20
LTEXT "", IDC_SHELL_ABOUT_APPNAME, 35, 55, 200, 10
- LTEXT "Version " KERNEL_VERSION_STR " (" KERNEL_VERSION_BUILD_STR ")", IDC_STATIC, 35, 65, 235, 10
+ LTEXT "Versão " KERNEL_VERSION_STR " (" KERNEL_VERSION_BUILD_STR ")", IDC_STATIC, 35, 65, 235, 10
LTEXT REACTOS_DEFAULT_STR_LEGAL_COPYRIGHT, IDC_STATIC, 35, 75, 210, 10
LTEXT "", IDC_SHELL_ABOUT_OTHERSTUFF, 35, 90, 180, 20
- LTEXT "This ReactOS version is registered to:", IDC_STATIC, 35, 115, 180, 10
+ LTEXT "Esta versão do ReactOS é registado a:", IDC_STATIC, 35, 115, 180, 10
LTEXT "", IDC_SHELL_ABOUT_REG_USERNAME, 45, 125, 180, 10
LTEXT "", IDC_SHELL_ABOUT_REG_ORGNAME, 45, 135, 180, 10
LTEXT "", IDC_STATIC, 35, 147, 235, 1, SS_ETCHEDHORZ
- LTEXT "Installed physical memory:", IDC_STATIC, 35, 152, 130, 10
+ LTEXT "Memória física instalada:", IDC_STATIC, 35, 152, 130, 10
LTEXT "", IDC_SHELL_ABOUT_PHYSMEM, 167, 152, 88, 10
DEFPUSHBUTTON "OK", IDOK, 220, 178, 50, 14
@@ -155,7 +156,7 @@ CAPTION ""
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
- LTEXT "Digite o nome do programa, pasta, documento, ou endereço Internet, que o Wine irá abrí-lo.", 12289, 36, 11, 182, 18
+ LTEXT "Digite o nome do programa, pasta, documento, ou endereço Internet, que o ReactOS irá abrí-lo.", 12289, 36, 11, 182, 18
LTEXT "&Abrir:", 12305, 7, 39, 24, 10
CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP
@@ -165,156 +166,156 @@ END
SHELL_GENERAL_SHORTCUT_DLG DIALOGEX 0, 0, 235, 215
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
-CAPTION "Shortcut"
+CAPTION "Atalho"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
ICON "", 14000, 10, 4, 30, 30, WS_VISIBLE
- LTEXT "Target type:", 14004, 8, 38, 64, 10
+ LTEXT "Tipo de destino:", 14004, 8, 38, 64, 10
LTEXT "", 14005, 78, 38, 142, 10
- LTEXT "Target location:", 14006, 8, 58, 64, 10
+ LTEXT "Localização do destino:", 14006, 8, 58, 64, 10
LTEXT "", 14007, 79, 58, 141, 10
- LTEXT "Target:", 14008, 8, 77, 45, 10
+ LTEXT "Destino:", 14008, 8, 77, 45, 10
EDITTEXT 14009, 79, 75, 150, 14, ES_AUTOHSCROLL
- LTEXT "&Start in:", 14010, 8, 96, 57, 10
+ LTEXT "&Iniciar em:", 14010, 8, 96, 57, 10
EDITTEXT 14011, 79, 94, 150, 14, ES_AUTOHSCROLL
- LTEXT "Shortcut &key:", 14014, 8, 115, 57, 10
+ LTEXT "&Tecla de Atalho:", 14014, 8, 115, 57, 10
EDITTEXT 14015, 79, 112, 150, 14, ES_LEFT
- LTEXT "Run:", 14016, 8, 134, 57, 10
+ LTEXT "Executar:", 14016, 8, 134, 57, 10
EDITTEXT 14017, 79, 131, 150, 14, ES_AUTOHSCROLL
- LTEXT "C&omment:", 14018, 8, 152, 57, 10
+ LTEXT "C&omemntário:", 14018, 8, 152, 57, 10
EDITTEXT 14019, 79, 149, 150, 14, ES_AUTOHSCROLL
- PUSHBUTTON "&Find Target...", 14020, 9, 172, 70, 14, ES_LEFT
- PUSHBUTTON "&Change Icon...", 14021, 84, 172, 70, 14, ES_LEFT
- PUSHBUTTON "A&dvanced...", 14022, 159, 172, 70, 14, ES_LEFT
+ PUSHBUTTON "&Localizar Destino...", 14020, 9, 172, 70, 14, ES_LEFT
+ PUSHBUTTON "&Trocar Icon...", 14021, 84, 172, 70, 14, ES_LEFT
+ PUSHBUTTON "A&vançado...", 14022, 159, 172, 70, 14, ES_LEFT
END
SHELL_EXTENDED_SHORTCUT_DLG DIALOGEX 0, 0, 230, 150
STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
-CAPTION "Extended Properties"
+CAPTION "Propriedades Avançadas"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
- LTEXT "Choose the advanced properties you want for this shortcut.", -1, 5, 30, 210, 10
- CHECKBOX "Run with different credentials", 14000, 25, 50, 150, 10
- LTEXT "This option can allow you to run the this shortcut as another user, or continue as yourself while protecting your computer and data from unauthorized program activity.", -1, 50, 60, 175, 40
- CHECKBOX "Run in seperate memory space", 14001, 25, 100, 90, 10, WS_DISABLED
+ LTEXT "Escolha as propriedades avançadas que quer para este atalho.", -1, 5, 30, 210, 10
+ CHECKBOX "Executar com diferentes credenciais", 14000, 25, 50, 150, 10
+ LTEXT "Esta opção permite executar este atalho como outro utilizador, ou continue com a sua conta enquanto protege o seu computador e dados contra actividade de programas não autorizados.", -1, 50, 60, 175, 40
+ CHECKBOX "Executar num espaço de memória separada", 14001, 25, 100, 90, 10, WS_DISABLED
PUSHBUTTON "OK", 1, 63, 124, 50, 15, WS_VISIBLE
- PUSHBUTTON "Abort", 2, 120, 124, 50, 15, WS_VISIBLE
+ PUSHBUTTON "Abortar", 2, 120, 124, 50, 15, WS_VISIBLE
END
SHELL_FOLDER_GENERAL_DLG DIALOGEX 0, 0, 240, 205
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
-CAPTION "General"
+CAPTION "Geral"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
ICON "", 14000, 10, 3, 30, 30, WS_VISIBLE
EDITTEXT 14001, 70, 9, 158, 14, ES_LEFT | ES_READONLY
- LTEXT "Type of file:", 14004, 8, 35, 50, 10
- LTEXT "Folder", 14005, 68, 35, 160, 10
- LTEXT "Location:", 14006, 8, 53, 50, 10
+ LTEXT "Tipo de ficheiro:", 14004, 8, 35, 50, 10
+ LTEXT "Pasta", 14005, 68, 35, 160, 10
+ LTEXT "Localização:", 14006, 8, 53, 50, 10
LTEXT "", 14007, 68, 53, 315, 10
- LTEXT "Size:", 14008, 8, 72, 45, 10
+ LTEXT "Tamanho:", 14008, 8, 72, 45, 10
LTEXT "", 14009, 68, 72, 315, 10
- LTEXT "Contains:", 14010, 8, 93, 45, 10
+ LTEXT "Contém:", 14010, 8, 93, 45, 10
LTEXT "", 14011, 68, 93, 160, 10
- LTEXT "Created:", 14014, 8, 118, 45, 10
+ LTEXT "Criado:", 14014, 8, 118, 45, 10
LTEXT "", 14015, 68, 118, 160, 10
- AUTOCHECKBOX "&Read-only", 14021, 45, 150, 67, 10
- AUTOCHECKBOX "&Hidden", 14022, 126, 150, 50, 10
+ AUTOCHECKBOX "&Sómente de Leitura", 14021, 45, 150, 67, 10
+ AUTOCHECKBOX "&Escondido", 14022, 126, 150, 50, 10
END
SHELL_FILE_GENERAL_DLG DIALOGEX 0, 0, 240, 205
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
-CAPTION "General"
+CAPTION "geral"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
ICON "", 14000, 10, 3, 30, 30, WS_VISIBLE
EDITTEXT 14001, 70, 9, 158, 14, ES_LEFT | ES_READONLY
- LTEXT "Type of file:", 14004, 8, 35, 50, 10
- LTEXT "File", 14005, 68, 35, 160, 10
- LTEXT "Opens with:", 14006, 8, 53, 50, 10
+ LTEXT "Tipo de Ficheiro:", 14004, 8, 35, 50, 10
+ LTEXT "Ficheiro", 14005, 68, 35, 160, 10
+ LTEXT "Abre com::", 14006, 8, 53, 50, 10
LTEXT "", 14007, 68, 53, 160, 10
- LTEXT "Location:", 14008, 8, 72, 45, 10
+ LTEXT "Localização:", 14008, 8, 72, 45, 10
LTEXT "", 14009, 68, 72, 315, 10
- LTEXT "Size:", 14010, 8, 93, 45, 10
+ LTEXT "Tamanho:", 14010, 8, 93, 45, 10
LTEXT "", 14011, 68, 93, 160, 10
- LTEXT "Created:", 14014, 8, 118, 45, 10
+ LTEXT "Criado:", 14014, 8, 118, 45, 10
LTEXT "", 14015, 68, 118, 160, 10
- LTEXT "Modified:", 14016, 8, 140, 45, 10
+ LTEXT "Modificado:", 14016, 8, 140, 45, 10
LTEXT "", 14017, 68, 140, 160, 10
- LTEXT "Accessed:", 14018, 8, 160, 45, 10
+ LTEXT "Acedido:", 14018, 8, 160, 45, 10
LTEXT "", 14019, 68, 160, 160, 10
- LTEXT "Attributes:", 14020, 8, 189, 45, 10
- CHECKBOX "&Read-only", 14021, 58, 189, 67, 10
- CHECKBOX "&Hidden", 14022, 126, 189, 50, 10
- CHECKBOX "&Archive", 14023, 181, 189, 49, 10
+ LTEXT "propriedades:", 14020, 8, 189, 45, 10
+ CHECKBOX "&Somente de Leitura", 14021, 58, 189, 67, 10
+ CHECKBOX "&Oculto", 14022, 126, 189, 50, 10
+ CHECKBOX "&Arquivo", 14023, 181, 189, 49, 10
END
SHELL_FILE_VERSION_DLG DIALOGEX 0, 0, 235, 215
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
-CAPTION "Version"
+CAPTION "Versão"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
- LTEXT "File version: ", 14000, 10, 10, 55, 10
+ LTEXT "Versão do Ficheiro: ", 14000, 10, 10, 55, 10
LTEXT "", 14001, 77, 10, 152, 10
- LTEXT "Description: ", 14002, 10, 27, 45, 10
+ LTEXT "Descrição: ", 14002, 10, 27, 45, 10
LTEXT "", 14003, 77, 27, 152, 10
LTEXT "Copyright: ", 14004, 10, 46, 66, 10
LTEXT "", 14005, 77, 46, 152, 10
- GROUPBOX "Other version information: ", 14006, 6, 70, 222, 115
- LTEXT "Item name: ", 14007, 13, 82, 50, 10
- LTEXT "Value: ", 14008, 112, 82, 45, 10
+ GROUPBOX "Outras informações da versão: ", 14006, 6, 70, 222, 115
+ LTEXT "Nome do Item: ", 14007, 13, 82, 50, 10
+ LTEXT "Valor: ", 14008, 112, 82, 45, 10
LISTBOX 14009, 12, 94, 94, 83, LBS_STANDARD | WS_TABSTOP | LBS_NOTIFY
EDITTEXT 14010, 112, 93, 109, 83, ES_LEFT | WS_BORDER | WS_VSCROLL | WS_GROUP | ES_MULTILINE | ES_READONLY
END
DRIVE_GENERAL_DLG DIALOGEX 0, 0, 240, 230
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
-CAPTION "General"
+CAPTION "Geral"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
EDITTEXT 14000, 40, 20, 190, 14, ES_LEFT|WS_BORDER|WS_GROUP
- LTEXT "Type:", -1, 15, 55, 40, 10
+ LTEXT "Tipo:", -1, 15, 55, 40, 10
LTEXT "", 14001, 110, 55, 100, 10
- LTEXT "File system:", -1, 15, 70, 100, 10
+ LTEXT "Sistema de Ficheiros:", -1, 15, 70, 100, 10
LTEXT "", 14002, 110, 70, 100, 10
CONTROL "", 14013, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 5, 90, 10, 10
- LTEXT "Used space:", -1, 25, 90, 120, 10
+ LTEXT "Espaço utilizado:", -1, 25, 90, 120, 10
LTEXT "", 14003, 110, 90, 120, 10
LTEXT "", 14004, 200, 90, 40, 10
CONTROL "", 14014, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 5, 105, 10, 10
- LTEXT "Free space:", -1, 25, 105, 70, 10
+ LTEXT "Espaço livre:", -1, 25, 105, 70, 10
LTEXT "", 14005, 110, 105, 120, 10
LTEXT "", 14006, 200, 105, 40, 10
- LTEXT "Capacity:", -1, 25, 125, 80, 10
+ LTEXT "Capacidade:", -1, 25, 125, 80, 10
LTEXT "", 14007, 110, 125, 120, 10
LTEXT "", 14008, 200, 125, 40, 10
CONTROL "", 14015, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 20, 140, 200, 20
- LTEXT "Drive %s", 14009, 100, 170, 40, 10
- PUSHBUTTON "Disk Cleanup", 14010, 180, 175, 50, 15, WS_TABSTOP
- CHECKBOX "Compress drive to save disk space", 14011, 15, 205, 180, 10, WS_DISABLED
- CHECKBOX "Allow Indexing Service to index this disk for fast file searching", 14012, 15, 220, 200, 10, WS_DISABLED
+ LTEXT "Disco %s", 14009, 100, 170, 40, 10
+ PUSHBUTTON "Limpeza do Disco", 14010, 180, 175, 50, 15, WS_TABSTOP
+ CHECKBOX "Comprimir unidade para libertar espaço no disco", 14011, 15, 205, 180, 10, WS_DISABLED
+ CHECKBOX "permitir indexar este disco para acelerar a procura de ficheiros", 14012, 15, 220, 200, 10, WS_DISABLED
END
DRIVE_EXTRA_DLG DIALOGEX 0, 0, 240, 230
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
-CAPTION "Tools"
+CAPTION "Ferramentas"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
- GROUPBOX "Error-checking", -1, 5, 5, 230, 60
- LTEXT "This option will check the volume for\nerrors.", -1, 40, 25, 160, 20
- PUSHBUTTON "Check Now...", 14000, 130, 45, 90, 15, WS_TABSTOP
- GROUPBOX "Defragmentation", -1, 5, 65, 230, 60
- LTEXT "This option will defragment files on the volume", -1, 40, 85, 160, 20
- PUSHBUTTON "Defragment Now...", 14001, 130, 105, 90, 15, WS_TABSTOP
- GROUPBOX "Backup", -1, 5, 130, 230, 60
- LTEXT "This option will back up files on the volume.", -1, 40, 150, 160, 20
- PUSHBUTTON "Backup Now...", 14002, 130, 170, 90, 15, WS_TABSTOP
+ GROUPBOX "Verificar por erros...", -1, 5, 5, 230, 60
+ LTEXT "Esta opção vai verificar o volume por erros.", -1, 40, 25, 160, 20
+ PUSHBUTTON "Verificar agora...", 14000, 130, 45, 90, 15, WS_TABSTOP
+ GROUPBOX "Desfragmentação", -1, 5, 65, 230, 60
+ LTEXT "Esta opção vai desfragmentar os ficheiros no volume", -1, 40, 85, 160, 20
+ PUSHBUTTON "Defragmentar Agora...", 14001, 130, 105, 90, 15, WS_TABSTOP
+ GROUPBOX "Cópia de segurança", -1, 5, 130, 230, 60
+ LTEXT "Esta opção vai criar os ficheiros do volume.", -1, 40, 150, 160, 20
+ PUSHBUTTON "Executar Cópia de Segurança...", 14002, 130, 170, 90, 15, WS_TABSTOP
END
DRIVE_HARDWARE_DLG DIALOGEX 0, 0, 240, 230
@@ -326,151 +327,151 @@ END
RUN_AS_DIALOG DIALOGEX 0, 0, 240, 190
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
-CAPTION "Run As"
+CAPTION "Executar Como..."
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
- LTEXT "Which user account do you want to use to run this program?", -1, 10, 20, 220, 20
- CHECKBOX "Current User %s", 14000, 10, 45, 150, 10
- LTEXT "Protect my computer and data from unauthorized program activity", -1, 25, 57, 200, 10, WS_DISABLED
- CHECKBOX "This option can prevent computer viruses from harming your computer or personal data, but selecting it might cause the program to function improperly.", 14001, 25, 68, 200, 30, WS_DISABLED | BS_MULTILINE
- CHECKBOX "The following user:", 14002, 10, 100, 90, 10
- LTEXT "User name:", -1, 20, 118, 54, 10
+ LTEXT "Que conta de utilizador quer utilizar para executar este programa?", -1, 10, 20, 220, 20
+ CHECKBOX "Utilizador actual %s", 14000, 10, 45, 150, 10
+ LTEXT "Proteger o meu computador e dados de actividade de programas não autoridados.", -1, 25, 57, 200, 10, WS_DISABLED
+ CHECKBOX "Esta opção pode prevenir a acção de virus no computador,mas seleccionando-a pode levar a que alguns programas funcionem incorrectamente.", 14001, 25, 68, 200, 30, WS_DISABLED | BS_MULTILINE
+ CHECKBOX "O seguinte utilizador:", 14002, 10, 100, 90, 10
+ LTEXT "Nome do utilizador:", -1, 20, 118, 54, 10
COMBOBOX 14003, 75, 115, 100, 15, CBS_DROPDOWNLIST | WS_VSCROLL | WS_VISIBLE | WS_TABSTOP
PUSHBUTTON "...", 14004, 180, 115, 30, 14, WS_TABSTOP
- LTEXT "Password:", -1, 20, 143, 53, 10
+ LTEXT "Palavra-passe:", -1, 20, 143, 53, 10
EDITTEXT 14005, 74, 140, 100, 14, ES_LEFT | WS_BORDER | WS_GROUP
PUSHBUTTON "...", 14006, 180, 140, 30, 14, WS_TABSTOP
PUSHBUTTON "OK", 14007, 57, 170, 60, 14, WS_TABSTOP
- PUSHBUTTON "Cancel", 14008, 122, 170, 60, 14, WS_TABSTOP
+ PUSHBUTTON "Cancelar", 14008, 122, 170, 60, 14, WS_TABSTOP
END
BITBUCKET_PROPERTIES_DLG DIALOGEX 0, 0, 240, 190
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
-CAPTION "Recycle Bin Properties"
+CAPTION "propriedades da Reciclagem"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
CONTROL "", 14000, "SysListView32", LVS_REPORT | LVS_SHAREIMAGELISTS | WS_BORDER | WS_TABSTOP, 10, 10, 220, 50
- GROUPBOX "Settings for selected location", -1, 10, 72, 220, 70
- RADIOBUTTON "&Custom size:", 14001, 20, 90, 80, 10, WS_TABSTOP
+ GROUPBOX "propriedades para as localizações seleccionadas", -1, 10, 72, 220, 70
+ RADIOBUTTON "&Tamanho personalizado:", 14001, 20, 90, 80, 10, WS_TABSTOP
EDITTEXT 14002, 106, 87, 50, 14, WS_TABSTOP | ES_NUMBER
- LTEXT "M&aximum size(MB):", -1, 20, 105, 70, 10
- RADIOBUTTON "Do not move files to the &Recycle Bin. Remove files immediately when deleted.", 14003, 20, 117, 170, 20, BS_MULTILINE | WS_TABSTOP
- AUTOCHECKBOX "&Display delete confirmation dialog", 14004, 20, 155, 140, 10, WS_TABSTOP
+ LTEXT "Tamanho M&áximo(MB):", -1, 20, 105, 70, 10
+ RADIOBUTTON "Não mover os ficheiros para a &Reciclagem. Apagá-los definitivamente.", 14003, 20, 117, 170, 20, BS_MULTILINE | WS_TABSTOP
+ AUTOCHECKBOX "&Mostrar ecrân de confirmação de eliminação", 14004, 20, 155, 140, 10, WS_TABSTOP
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
-CAPTION "Open With"
+CAPTION "Abre com..."
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
ICON IDI_SHELL_OPEN_WITH, -1, 8, 12, 21, 20
- LTEXT "Choose the program you want to use to open this file:", -1, 44, 12, 211, 10
- LTEXT "File: ", 14001, 44, 25, 188, 10
- GROUPBOX "&Programs", -1, 7, 42, 249, 187
+ LTEXT "Escolha o programa que quer utilizar para abrir este ficheiro:", -1, 44, 12, 211, 10
+ LTEXT "Ficheiro: ", 14001, 44, 25, 188, 10
+ GROUPBOX "&Programas", -1, 7, 42, 249, 187
LISTBOX 14002, 16 ,57, 230, 130, LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP, WS_EX_STATICEDGE
- AUTOCHECKBOX "&Always use the selected program to open this kind of file", 14003, 20, 193, 225, 10
- PUSHBUTTON "&Browse...", 14004, 198, 207, 50, 14
+ AUTOCHECKBOX "&Utilizar sempre o programa seleccionado para abrir este tipo de ficheiros", 14003, 20, 193, 225, 10
+ PUSHBUTTON "&Seleccione...", 14004, 198, 207, 50, 14
PUSHBUTTON "OK", 14005, 150, 236, 50, 14
- PUSHBUTTON "Cancel", 14006, 206, 236, 50, 14
+ PUSHBUTTON "Cancelar", 14006, 206, 236, 50, 14
END
FOLDER_OPTIONS_GENERAL_DLG DIALOGEX 0, 0, 264, 256
STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
-CAPTION "General"
+CAPTION "Geral"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
- GROUPBOX "Tasks", -1, 7, 10, 249, 45
+ GROUPBOX "Tarefas", -1, 7, 10, 249, 45
ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL
- AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP | WS_GROUP
- AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP | WS_GROUP
- GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP
+ AUTORADIOBUTTON "Mostrar tarefas comuns nas &pastas", 14001, 40, 25, 120, 10, WS_TABSTOP | WS_GROUP
+ AUTORADIOBUTTON "Utilizar pastas class&icas ReactOS", 14002, 40, 37, 120, 10, WS_TABSTOP | WS_GROUP
+ GROUPBOX "Procurar pastas", -1, 7, 60, 249, 45, WS_TABSTOP
ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL
- AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP | WS_GROUP
- AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP | WS_GROUP
- GROUPBOX "Click items as follows", -1, 7, 110, 249, 60
+ AUTORADIOBUTTON "Abrir cada pasta na &mesma janela", 14004, 40, 70, 140, 10, WS_TABSTOP | WS_GROUP
+ AUTORADIOBUTTON "Abrir cada pasta na sua &janela", 14005, 40, 82, 140, 10, WS_TABSTOP | WS_GROUP
+ GROUPBOX "Seleccione a seguinte opção", -1, 7, 110, 249, 60
ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL
- AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP | WS_GROUP
- AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP | WS_GROUP
- AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP | WS_GROUP
- AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP | WS_GROUP
- PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP
+ AUTORADIOBUTTON "&Click simples para abrir um item", 14007, 40, 120, 170, 10, WS_TABSTOP | WS_GROUP
+ AUTORADIOBUTTON "Sublinhar os títulos dos ícones mantendo o aspecto do &browser", 14008, 50, 132, 170, 10, WS_TABSTOP | WS_GROUP
+ AUTORADIOBUTTON "Sublinhar os títulos dos ícones apenas quando &aponto para eles", 14009, 50, 144, 170, 10, WS_TABSTOP | WS_GROUP
+ AUTORADIOBUTTON "&Duplo-click para abrir um item (um click para seleccionar)", 14010, 40, 156, 170, 10, WS_TABSTOP | WS_GROUP
+ PUSHBUTTON "&Restaurar valores por defeito", 14011, 180, 180, 60, 14, WS_TABSTOP
END
FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256
STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
-CAPTION "View"
+CAPTION "Ver"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
-GROUPBOX "Folder views", -1, 7, 10, 249, 60
+GROUPBOX "Vistas das Pastas", -1, 7, 10, 249, 60
//ICON
-LTEXT "You can apply the view(such as Details or Tiles) that\nyou are using for this folder to all folders.", -1, 60, 20, 180, 20
-PUSHBUTTON "Apply to A&ll Folders", 14001, 60, 50, 80, 14, WS_TABSTOP
-PUSHBUTTON "&Reset All Folders", 14002, 150, 50, 80, 14, WS_TABSTOP
-LTEXT "Advanced settings:", -1, 7, 80, 100, 10
+LTEXT "Pode aplicar a vista (como detalhes ou títulos) que\nestá a usar para esta pasta para todas as pastas.", -1, 60, 20, 180, 20
+PUSHBUTTON "Applicar a T&odas as Pastas", 14001, 60, 50, 80, 14, WS_TABSTOP
+PUSHBUTTON "&Reiniciar todas as Pastas", 14002, 150, 50, 80, 14, WS_TABSTOP
+LTEXT "Definições avançadas:", -1, 7, 80, 100, 10
CONTROL "", 14003, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS | WS_BORDER | WS_TABSTOP, 7, 90, 249, 120
-PUSHBUTTON "Restore &Defaults", 14004, 180, 210, 80, 14, WS_TABSTOP
+PUSHBUTTON "Restaurar valores por &Defeito", 14004, 180, 210, 80, 14, WS_TABSTOP
END
FOLDER_OPTIONS_FILETYPES_DLG DIALOGEX 0, 0, 264, 256
STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
-CAPTION "File Types"
+CAPTION "Tipos de Ficheiros"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
-LTEXT "Registered file &types:", -1, 7, 10, 70, 10
+LTEXT "&Tipos de ficheiros registados:", -1, 7, 10, 70, 10
CONTROL "", 14000, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHAREIMAGELISTS | WS_BORDER | WS_TABSTOP, 7, 20, 249, 80
-PUSHBUTTON "&New", 14001, 120, 110, 50, 14, WS_TABSTOP
-PUSHBUTTON "&Delete", 14002, 180, 110, 50, 14, WS_TABSTOP
-GROUPBOX "Details for '%s' extension", 14003, 7, 130, 249, 70
-LTEXT "Opens with:", -1, 12, 140, 40, 10
+PUSHBUTTON "&Novo", 14001, 120, 110, 50, 14, WS_TABSTOP
+PUSHBUTTON "&Apagar", 14002, 180, 110, 50, 14, WS_TABSTOP
+GROUPBOX "Detalhes para '%s' extensão", 14003, 7, 130, 249, 70
+LTEXT "Abre com:", -1, 12, 140, 40, 10
//ICON
-LTEXT "Appname", 14005, 100, 140, 40, 10
-PUSHBUTTON "&Change...", 14006, 180, 140, 50, 14, WS_TABSTOP
-LTEXT "Files with extension '%s' are of type '%s'. To\nchange settings that affect all '%s' files, click\nAdvanced.", 14007, 12, 155, 160, 30
-PUSHBUTTON "Ad&vanced", 14008, 180, 175, 50, 14, WS_TABSTOP
+LTEXT "Appnome", 14005, 100, 140, 40, 10
+PUSHBUTTON "&Mudar...", 14006, 180, 140, 50, 14, WS_TABSTOP
+LTEXT "Ficheiros com extensão '%s' são do tipo '%s'. Para\nmudar definições que afectam todos '%s' ficheiros, click\nAvançado.", 14007, 12, 155, 160, 30
+PUSHBUTTON "A&vançado", 14008, 180, 175, 50, 14, WS_TABSTOP
END
CONFIRM_FILE_REPLACE_DLG DIALOGEX 0, 0, 282, 143
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
-CAPTION "Confirm File Replace"
+CAPTION "Confirmar Substituição de Ficheiros"
FONT 8, "MS Shell Dlg"
BEGIN
- DEFPUSHBUTTON "&Yes", IDYES, 20, 122, 60, 14
- PUSHBUTTON "Yes to &All", 12807, 85, 122, 60, 14
- PUSHBUTTON "&No", IDNO, 150, 122, 60, 14
- PUSHBUTTON "Cancel", IDCANCEL, 215, 122, 60, 14
+ DEFPUSHBUTTON "&Sim", IDYES, 20, 122, 60, 14
+ PUSHBUTTON "Sim para &Todos", 12807, 85, 122, 60, 14
+ PUSHBUTTON "&Não", IDNO, 150, 122, 60, 14
+ PUSHBUTTON "Cancelar", IDCANCEL, 215, 122, 60, 14
ICON 146, -1, 11, 10, 21, 20, SS_REALSIZECONTROL
- LTEXT "This folder already contains a file named '%2'.", 12291, 44, 10, 231, 22, SS_NOPREFIX
- LTEXT "This folder already contains a read-only file named '%2'.", 12292, 41, 10, 222, 22, SS_NOPREFIX
- LTEXT "This folder already contains a system file named '%2'.", 12293, 41, 10, 222, 22, SS_NOPREFIX
- LTEXT "Would you like to replace the existing file", -1, 44, 35, 228, 10, SS_NOPREFIX
- LTEXT "(unknown date and size)", 12302, 79, 51, 198, 20, SS_NOPREFIX
+ LTEXT "Esta pasta já contém um ficheiro com o nome '%2'.", 12291, 44, 10, 231, 22, SS_NOPREFIX
+ LTEXT "Esta pasta já contém um ficheiro sómente de leitura com o nome '%2'.", 12292, 41, 10, 222, 22, SS_NOPREFIX
+ LTEXT "Esta pasta já contém um ficheiro de sistema com o nome '%2'.", 12293, 41, 10, 222, 22, SS_NOPREFIX
+ LTEXT "pretende substituir o ficheiro existente", -1, 44, 35, 228, 10, SS_NOPREFIX
+ LTEXT "(data e tamanho desconhecido)", 12302, 79, 51, 198, 20, SS_NOPREFIX
ICON "", 12300, 50, 49, 21, 20, SS_REALSIZECONTROL
- LTEXT "with this one?", -1, 44, 75, 228, 10, SS_NOPREFIX
- LTEXT "(unknown date and size)", 12303, 79, 91, 198, 20, SS_NOPREFIX
+ LTEXT "por este?", -1, 44, 75, 228, 10, SS_NOPREFIX
+ LTEXT "(data e tamanho desconhecido)", 12303, 79, 91, 198, 20, SS_NOPREFIX
ICON "", 12301, 50, 89, 21, 20, SS_REALSIZECONTROL
END
LOGOFF_DLG DIALOGEX 0, 0, 190, 60
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
-CAPTION "Log Off ReactOS"
+CAPTION "Terminar sessão ReactOS"
FONT 8, "MS Shell Dlg"
BEGIN
ICON 45, 14344, 10, 10, 21, 20, SS_REALSIZECONTROL
- LTEXT "Are you sure you want to log off?", -1, 43, 11, 140, 22
- DEFPUSHBUTTON "&Log Off", IDOK, 57, 40, 60, 14
- PUSHBUTTON "Cancel", IDCANCEL, 122, 40, 60, 14
+ LTEXT "Tem a certeza que quer terminar a sessão?", -1, 43, 11, 140, 22
+ DEFPUSHBUTTON "&Terminar a sessão", IDOK, 57, 40, 60, 14
+ PUSHBUTTON "Cancelar", IDCANCEL, 122, 40, 60, 14
END
DISCONNECT_DLG DIALOGEX 0, 0, 190, 60
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
-CAPTION "Disconnect ReactOS"
+CAPTION "Encerrar ReactOS"
FONT 8, "MS Shell Dlg"
BEGIN
ICON 49, 14346, 10, 10, 21, 20, SS_REALSIZECONTROL
- LTEXT "Are you sure you want to disconnect?", -1, 49, 12, 137, 23
- DEFPUSHBUTTON "&Disconnect", IDOK, 57, 40, 60, 14
- PUSHBUTTON "Cancel", IDCANCEL, 123, 40, 60, 14
+ LTEXT "Tem a certeza que quer encerrar?", -1, 49, 12, 137, 23
+ DEFPUSHBUTTON "&Encerrar", IDOK, 57, 40, 60, 14
+ PUSHBUTTON "Cancelar", IDCANCEL, 123, 40, 60, 14
END
AUTOPLAY1_DLG DIALOGEX 0, 0, 227, 218
@@ -478,42 +479,42 @@ STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUPWINDOW | WS_VISIBLE | WS_CLIPSIBLIN
CAPTION "AutoPlay"
FONT 8, "MS Shell Dlg"
BEGIN
- LTEXT "&Select a content type, then choose an action for ReactOS to perform automatically when that type is used in this device:", 1000, 7, 7, 215, 20
+ LTEXT "&Seleccione o tipo de conteúdo, depois escolha uma acção para o RactOS executar automáticamente quando este tipo for usado neste dispositivo:", 1000, 7, 7, 215, 20
CONTROL "", 1001, "COMBOBOXEX32", WS_TABSTOP | 0x00000043, 7, 27, 212, 200
- GROUPBOX "Actions", -1, 7, 45, 212, 146
- AUTORADIOBUTTON "Select an action to &perform:", 1005, 14, 54, 202, 10, WS_GROUP
+ GROUPBOX "Acções", -1, 7, 45, 212, 146
+ AUTORADIOBUTTON "Seleccione uma acção para &executar:", 1005, 14, 54, 202, 10, WS_GROUP
CONTROL "LIST2", 1002, "SYSLISTVIEW32", WS_BORDER | WS_TABSTOP | 0x0000C04D, 22, 66, 192, 107
- AUTORADIOBUTTON "Prompt me each time to &choose an action", 1006, 14, 177, 202, 10
- PUSHBUTTON "&Restore Defaults", 1008, 108, 197, 110, 14, WS_DISABLED
+ AUTORADIOBUTTON "pergunte-me sempre para escolher uma &acção", 1006, 14, 177, 202, 10
+ PUSHBUTTON "&Restaurar valores por defeito", 1008, 108, 197, 110, 14, WS_DISABLED
END
MIXED_CONTENT1_DLG DIALOGEX 0, 0, 227, 207
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CAPTION
-CAPTION "Mixed Content"
+CAPTION "Conteúdos mistos"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", 1000, 5, 7, 21, 20
- LTEXT "This disk or device contains more than one type of content.", 1001, 32, 7, 191, 20
- LTEXT "What do you want ReactOS to do?", 1002, 32, 31, 188, 8
+ LTEXT "Este disco ou dispositivo contém mais de um tipo de conteúdo.", 1001, 32, 7, 191, 20
+ LTEXT "O que pretende que o ReactOS faça?", 1002, 32, 31, 188, 8
CONTROL "", 1003, "SYSLISTVIEW32", WS_BORDER | WS_TABSTOP | 0x0000C04D, 32, 43, 188, 139
DEFPUSHBUTTON "OK", IDOK, 96, 186, 60, 14
- PUSHBUTTON "Cancel", IDCANCEL, 160, 186, 60, 14
+ PUSHBUTTON "Cancelar", IDCANCEL, 160, 186, 60, 14
END
MIXED_CONTENT2_DLG DIALOGEX 0, 0, 227, 206
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CAPTION
-CAPTION "Mixed Content"
+CAPTION "Conteúdo misto"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", 1000, 5, 7, 21, 20
- LTEXT "ReactOS can perform the same action each time you insert a disk or connect a device with this kind of file:", 1001, 30, 7, 193, 20
+ LTEXT "ReactOS pode executar a mesma acção de cada vez que inserir um disco ou um dispositivo com este tipo de ficheiro:", 1001, 30, 7, 193, 20
ICON "", 1005, 32, 27, 11, 10, SS_REALSIZECONTROL
EDITTEXT 1006, 49, 28, 177, 14, ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
- LTEXT "What do you want ReactOS to do?", 1002, 32, 41, 190, 8
+ LTEXT "O que pretende que o ReactOS faça?", 1002, 32, 41, 190, 8
CONTROL "", 1003, "SYSLISTVIEW32", WS_BORDER | WS_TABSTOP | 0x0000C04D, 32, 55, 188, 112
- AUTOCHECKBOX "Always do the selected action.", 1004, 32, 171, 190, 10
+ AUTOCHECKBOX "Executar sempre a acção seleccionada.", 1004, 32, 171, 190, 10
DEFPUSHBUTTON "OK", IDOK, 96, 185, 60, 14
- PUSHBUTTON "Cancel", IDCANCEL, 160, 185, 60, 14
+ PUSHBUTTON "Cancelar", IDCANCEL, 160, 185, 60, 14
END
AUTOPLAY2_DLG DIALOGEX 0, 0, 227, 181
@@ -522,75 +523,75 @@ CAPTION "Autoplay"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", 1000, 5, 7, 21, 20
- LTEXT "ReactOS can perform the same action each time you connect this device.", 1001, 32, 7, 190, 22
- LTEXT "&What do you want ReactOS to do?", 1002, 32, 31, 190, 8
+ LTEXT "ReactOS pode executar sempre mesma acção de cada vez que inserir um disco ou um dispositivo.", 1001, 32, 7, 190, 22
+ LTEXT "&O que pretende que o ReactOS faça?", 1002, 32, 31, 190, 8
CONTROL "", 1003, "SYSLISTVIEW32", WS_BORDER | WS_TABSTOP | 0x0000C04D, 32, 43, 187, 96
- AUTOCHECKBOX "&Always perform the selected action", 1004, 32, 143, 190, 8
+ AUTOCHECKBOX "&Executar sempre a acção seleccionada", 1004, 32, 143, 190, 8
DEFPUSHBUTTON "OK", IDOK, 94, 160, 60, 14
- PUSHBUTTON "Cancel", IDCANCEL, 159, 160, 60, 14
+ PUSHBUTTON "Cancelar", IDCANCEL, 159, 160, 60, 14
END
SHUTDOWN_DLG DIALOGEX 0, 0, 211, 103
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
-CAPTION "Shut Down ReactOS"
+CAPTION "Encerrar ReactOS"
FONT 8, "MS Shell Dlg"
BEGIN
ICON 8240, -1, 6, 6, 21, 20, SS_REALSIZECONTROL | WS_GROUP
- LTEXT "What do you want the computer to do?", -1, 39, 7, 167, 10
+ LTEXT "O que pretende aue o computador faça?", -1, 39, 7, 167, 10
COMBOBOX 8224, 39, 20, 165, 200, CBS_DROPDOWNLIST | WS_VSCROLL
- LTEXT "Maintains your session, keeping the computer running on low power with data still in memory. The computer wakes up when you press a key or move the mouse.", 8225, 39, 40, 167, 37
+ LTEXT "Manter a sessão, deixando o computador a correr em baixa energia. O computador arranca quando tocar numa tecla ou mover o rato.", 8225, 39, 40, 167, 37
DEFPUSHBUTTON "OK", 1, 7, 82, 60, 14, WS_GROUP
- PUSHBUTTON "Cancel", IDCANCEL, 75, 82, 60, 14
- PUSHBUTTON "&Help", IDHELP, 144, 82, 60, 14
+ PUSHBUTTON "Cancelar", IDCANCEL, 75, 82, 60, 14
+ PUSHBUTTON "&Ajuda", IDHELP, 144, 82, 60, 14
END
FORMAT_DLG DIALOGEX 50, 50, 184, 218
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
-CAPTION "Format"
+CAPTION "Formatar"
FONT 8, "MS Shell Dlg"
BEGIN
- DEFPUSHBUTTON "&Start", IDOK, 53, 198, 60, 14
- PUSHBUTTON "&Close", IDCANCEL, 118, 198, 60, 14
- LTEXT "Ca&pacity:", -1, 7, 6, 169, 9
+ DEFPUSHBUTTON "&Iniciar", IDOK, 53, 198, 60, 14
+ PUSHBUTTON "&Fechar", IDCANCEL, 118, 198, 60, 14
+ LTEXT "Ca&pacidade:", -1, 7, 6, 169, 9
COMBOBOX 28673, 7, 17, 170, 200, CBS_DROPDOWNLIST | WS_VSCROLL | NOT WS_TABSTOP
- LTEXT "&File system", -1, 7, 35, 170, 9
+ LTEXT "&Sistema de Ficheiros", -1, 7, 35, 170, 9
COMBOBOX 28677, 7, 46, 170, 200, CBS_DROPDOWNLIST | WS_VSCROLL | NOT WS_TABSTOP
CONTROL "", 28678, "MSCTLS_PROGRESS32", 0, 7, 181, 170, 8
- LTEXT "&Allocation unit size", -1, 7, 64, 170, 9
+ LTEXT "&Tamanho da unidade de alocação", -1, 7, 64, 170, 9
COMBOBOX 28680, 7, 75, 170, 200, CBS_DROPDOWNLIST | WS_VSCROLL | NOT WS_TABSTOP
- LTEXT "Volume &label", -1, 7, 93, 170, 9
+ LTEXT "&Nome do Volume ", -1, 7, 93, 170, 9
EDITTEXT 28679, 7, 103, 170, 13, ES_AUTOHSCROLL
- GROUPBOX "Format &options", 4610, 7, 121, 170, 49
- AUTOCHECKBOX "&Quick Format", 28674, 16, 135, 155, 10
- AUTOCHECKBOX "&Enable Compression", 28675, 16, 152, 155, 10
+ GROUPBOX "&Opções", 4610, 7, 121, 170, 49
+ AUTOCHECKBOX "Formatação &Rápida", 28674, 16, 135, 155, 10
+ AUTOCHECKBOX "&Permitir Compressão", 28675, 16, 152, 155, 10
END
CHKDSK_DLG DIALOGEX 50, 50, 194, 120
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
-CAPTION "Check Disk"
+CAPTION "Verificar Disco"
FONT 8, "MS Shell Dlg"
BEGIN
- DEFPUSHBUTTON "Start", IDOK, 53, 100, 60, 14
- GROUPBOX "Check disk options", -1, 7, 6, 179, 50
- PUSHBUTTON "Cancel", IDCANCEL, 118, 100, 60, 14
- AUTOCHECKBOX "Automatically fix file system errors", 14000, 16, 15, 155, 10
- AUTOCHECKBOX "&Scan for and attempt recovery of bad sectors", 14001, 16, 30, 165, 10
+ DEFPUSHBUTTON "Iniciar", IDOK, 53, 100, 60, 14
+ GROUPBOX "Opções verificação do disco", -1, 7, 6, 179, 50
+ PUSHBUTTON "Cancelar", IDCANCEL, 118, 100, 60, 14
+ AUTOCHECKBOX "Reparar automáticamente erros nos ficheiros do sistema", 14000, 16, 15, 155, 10
+ AUTOCHECKBOX "&Procurar e tentar reparar sectores danificados", 14001, 16, 30, 165, 10
CONTROL "", 14002, "MSCTLS_PROGRESS32", 16, 7, 60, 170, 8
LTEXT "", 14003, 60, 80, 170, 10
END
IDD_PICK_ICON_DIALOG DIALOGEX 0, 0, 237, 204
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
-CAPTION "Change Icon"
+CAPTION "Trocar Icone"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
- LTEXT "Filename:", -1, 7, 14, 208, 10
- PUSHBUTTON "Browse...",IDC_BUTTON_PATH, 148, 24,67,14
+ LTEXT "Nome do ficheiro:", -1, 7, 14, 208, 10
+ PUSHBUTTON "procurar...",IDC_BUTTON_PATH, 148, 24,67,14
EDITTEXT IDC_EDIT_PATH, 6, 24, 135, 15, ES_AUTOHSCROLL
LTEXT "Icons:", -1, 7, 47, 208, 10
LISTBOX IDC_PICKICON_LIST,7,57,208,119,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_MULTICOLUMN | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP,WS_EX_STATICEDGE
DEFPUSHBUTTON "OK",IDOK, 107, 181,50, 14
- PUSHBUTTON "Cancel",IDCANCEL, 167, 181, 50, 14
+ PUSHBUTTON "Cancelar",IDCANCEL, 167, 181, 50, 14
END
STRINGTABLE DISCARDABLE
@@ -600,32 +601,32 @@ BEGIN
IDS_SHV_COLUMN2 "Tamanho"
IDS_SHV_COLUMN3 "Tipo"
IDS_SHV_COLUMN4 "Modificado"
- IDS_SHV_COLUMN5 "Atributos"
+ IDS_SHV_COLUMN5 "propriedades"
IDS_SHV_COLUMN6 "Tamanho"
IDS_SHV_COLUMN7 "Disponível"
IDS_SHV_COLUMN8 "Nome"
IDS_SHV_COLUMN9 "Comentários"
IDS_SHV_COLUMN10 "Dono"
IDS_SHV_COLUMN11 "Grupo"
- IDS_SHV_COLUMN12 "Filename"
- IDS_SHV_COLUMN13 "Category"
- IDS_SHV_COLUMN_DELFROM "Original location"
- IDS_SHV_COLUMN_DELDATE "Date deleted"
- IDS_SHV_COLUMN_FONTTYPE "Fonttype"
- IDS_SHV_COLUMN_WORKGROUP "Workgroup"
- IDS_SHV_NETWORKLOCATION "Network Location"
- IDS_SHV_COLUMN_DOCUMENTS "Documents"
- IDS_SHV_COLUMN_STATUS "Status"
- IDS_SHV_COLUMN_COMMENTS "Comments"
- IDS_SHV_COLUMN_LOCATION "Location"
- IDS_SHV_COLUMN_MODEL "Model"
+ IDS_SHV_COLUMN12 "Nome do ficheiro"
+ IDS_SHV_COLUMN13 "Categoria"
+ IDS_SHV_COLUMN_DELFROM "Localização original"
+ IDS_SHV_COLUMN_DELDATE "Data da eliminação"
+ IDS_SHV_COLUMN_FONTTYPE "Tipo de letra"
+ IDS_SHV_COLUMN_WORKGROUP "Grupo de trabalho"
+ IDS_SHV_NETWORKLOCATION "localizações na rede"
+ IDS_SHV_COLUMN_DOCUMENTS "Documentos"
+ IDS_SHV_COLUMN_STATUS "Estado"
+ IDS_SHV_COLUMN_COMMENTS "Commentários"
+ IDS_SHV_COLUMN_LOCATION "Localização"
+ IDS_SHV_COLUMN_MODEL "Modelo"
/* special folders */
IDS_DESKTOP "Ambiente de trabalho"
IDS_MYCOMPUTER "O Meu Computador"
- IDS_RECYCLEBIN_FOLDER_NAME "Trash"
- IDS_CONTROLPANEL "Control Panel"
- IDS_ADMINISTRATIVETOOLS "Administrative Tools"
+ IDS_RECYCLEBIN_FOLDER_NAME "Reciclagem"
+ IDS_CONTROLPANEL "Painel de Controlo"
+ IDS_ADMINISTRATIVETOOLS "Ferramentas Administrativas"
/* context menus */
IDS_VIEW_LARGE "Ícones &grandes"
@@ -634,15 +635,15 @@ BEGIN
IDS_VIEW_DETAILS "&Detalhes"
IDS_SELECT "Seleccionar"
IDS_OPEN "Abrir"
- IDS_CREATELINK "Create &Link"
- IDS_COPY "Copy"
- IDS_DELETE "Delete"
- IDS_PROPERTIES "Properties"
- IDS_CUT "Cut"
- IDS_RESTORE "Restore"
- IDS_FORMATDRIVE "Format..."
- IDS_RENAME "Rename"
- IDS_INSERT "Insert"
+ IDS_CREATELINK "Criar &Atalho"
+ IDS_COPY "Copiar"
+ IDS_DELETE "Apagar"
+ IDS_PROPERTIES "Propriedades"
+ IDS_CUT "Cortar"
+ IDS_RESTORE "Restaurar"
+ IDS_FORMATDRIVE "Formatar..."
+ IDS_RENAME "Renaomear"
+ IDS_INSERT "Inserir"
IDS_CREATEFOLDER_DENIED "Não é possível criar nova pasta: Permissão negada."
IDS_CREATEFOLDER_CAPTION "Erro durante a criação da nova pasta"
@@ -650,25 +651,25 @@ BEGIN
IDS_DELETEFOLDER_CAPTION "Confirmar exclusão da pasta"
IDS_DELETEITEM_TEXT "Tem certeza que deseja excluir '%1'?"
IDS_DELETEMULTIPLE_TEXT "Tem certeza que deseja excluir estes %1 itens?"
- IDS_DELETESELECTED_TEXT "Are you sure you want to delete the selected item(s)?"
- IDS_TRASHITEM_TEXT "Are you sure that you want to send '%1' to the Trash?"
- IDS_TRASHFOLDER_TEXT "Are you sure that you want to send '%1' and all its content to the Trash?"
- IDS_TRASHMULTIPLE_TEXT "Are you sure that you want to send these %1 items to the Trash?"
- IDS_CANTTRASH_TEXT "The item '%1' can't be sent to Trash. Do you want to delete it instead?"
- IDS_OVERWRITEFILE_TEXT "This folder already contains a file called '%1'.\n\nDo you want to replace it?"
+ IDS_DELETESELECTED_TEXT "Tem a certeza que quer eliminar os item(s) seleccionado(s)?"
+ IDS_TRASHITEM_TEXT "Tem a certeza que quer enviar '%1' para a reciclagem?"
+ IDS_TRASHFOLDER_TEXT "Tem a certeza que quer enviar '%1' e todo o seu conteúdo para a reciclagem?"
+ IDS_TRASHMULTIPLE_TEXT "Tem a certeza que quer enviar este '%1' item para a reciclagem?"
+ IDS_CANTTRASH_TEXT "O item '%1' não pode ser enviado para a reciclagem. Em vez disso pretende eliminá-lo?"
+ IDS_OVERWRITEFILE_TEXT "Esta pasta já contém um ficheiro com o nome '%1'.\n\npretende substituí-lo?"
IDS_OVERWRITEFILE_CAPTION "Confirmar substituição de ficheiro"
- IDS_OVERWRITEFOLDER_TEXT "This folder already contains a folder named '%1'.\n\n"\
- "If the files in the destination folder have the same names as files in the\n"\
- "selected folder they will be replaced. Do you still want to move or copy\n"\
- "the folder?"
+ IDS_OVERWRITEFOLDER_TEXT "Esta pasta já contém uma pasta com o nome '%1'.\n\n"\
+ "Se os ficheiros na pasta de destino tiverem o mesmo nome dos ficheiros na\n"\
+ "pasta seleccionada, serão substituídos. Ainda assim pretende mover ou copiar\n"\
+ "a pasta?"
/* message box strings */
IDS_RESTART_TITLE "Reiniciar"
IDS_RESTART_PROMPT "Deseja simular a reinicialização do Windows?"
IDS_SHUTDOWN_TITLE "Desligar"
- IDS_SHUTDOWN_PROMPT "Deseja finalizar esta sessão do Wine?"
- IDS_LOGOFF_TITLE "Log Off"
- IDS_LOGOFF_PROMPT "Do you want to log off?"
+ IDS_SHUTDOWN_PROMPT "Deseja finalizar esta sessão do ReactOS?"
+ IDS_LOGOFF_TITLE "Terminar a sessão"
+ IDS_LOGOFF_PROMPT "Pretende terminar a sessão?"
/* shell folder path default values */
IDS_PROGRAMS "Menu Iniciar\\Programas"
@@ -681,12 +682,12 @@ BEGIN
IDS_MYMUSIC "As Minhas Músicas"
IDS_MYVIDEO "Os Meus Vídeos"
IDS_DESKTOPDIRECTORY "Ambiente de Trabalho"
- IDS_NETHOOD "NetHood"
+ IDS_NETHOOD "Visinhança na rede"
IDS_TEMPLATES "Modelos"
- IDS_APPDATA "Application Data"
+ IDS_APPDATA "Dados de Aplicação"
IDS_PRINTHOOD "PrintHood"
- IDS_LOCAL_APPDATA "Definições locais\\Application Data"
- IDS_INTERNET_CACHE "Definições locais\\Temporary Internet Files"
+ IDS_LOCAL_APPDATA "Definições locais\\Dados de Aplicação"
+ IDS_INTERNET_CACHE "Definições locais\\Ficheiros Temporários da Internet"
IDS_COOKIES "Cookies"
IDS_HISTORY "Definições locais\\Histórico"
IDS_PROGRAM_FILES "Programas"
@@ -697,60 +698,60 @@ BEGIN
IDS_COMMON_MUSIC "Os Meus Documentos\\As Minhas Músicas"
IDS_COMMON_PICTURES "Os Meus Documentos\\As Minhas Imagens"
IDS_COMMON_VIDEO "Os Meus Documentos\\Os Meus Vídeos"
- IDS_CDBURN_AREA "Definições locais\\Application Data\\Microsoft\\CD Burning"
- IDS_NETWORKPLACE "My Network Places"
+ IDS_CDBURN_AREA "Definições locais\\Dados de Aplicação\\Microsoft\\CD Burning"
+ IDS_NETWORKPLACE "Os Meus Locais da Rede"
- IDS_NEWFOLDER "New Folder"
+ IDS_NEWFOLDER "Nova Pasta"
- IDS_DRIVE_FIXED "Local Disk"
+ IDS_DRIVE_FIXED "Disco Local"
IDS_DRIVE_CDROM "CDROM"
- IDS_DRIVE_NETWORK "Network Disk"
+ IDS_DRIVE_NETWORK "Disco de Rede"
- IDS_OPEN_WITH "Open With"
- IDS_OPEN_WITH_CHOOSE "Choose Program..."
+ IDS_OPEN_WITH "Abre com..."
+ IDS_OPEN_WITH_CHOOSE "Escolha Programa..."
- IDS_SHELL_ABOUT_AUTHORS "&Authors"
- IDS_SHELL_ABOUT_BACK "< &Back"
+ IDS_SHELL_ABOUT_AUTHORS "&Autores"
+ IDS_SHELL_ABOUT_BACK "< &Trás"
FCIDM_SHVIEW_NEW "Novo"
FCIDM_SHVIEW_NEWFOLDER "&Pasta"
FCIDM_SHVIEW_NEWLINK "&Atalho"
- IDS_FOLDER_OPTIONS "Folder Options"
- IDS_RECYCLEBIN_LOCATION "Recycle Bin Location"
- IDS_RECYCLEBIN_DISKSPACE "Space Available"
- IDS_EMPTY_BITBUCKET "Empty Recycle Bin"
- IDS_PICK_ICON_TITLE "Choose Icon"
- IDS_PICK_ICON_FILTER "Icon Files(*.ico, *.icl, *.exe, *.dll)\0*.ico;*.icl;*.exe;*.dll\0"
- IDS_OPEN_WITH_FILTER "Executable Files\0*.exe\0"
- IDS_DIRECTORY "Folder"
- IDS_VIRTUAL_DRIVER "Virtual Device Driver"
+ IDS_FOLDER_OPTIONS "Opções das Pastas"
+ IDS_RECYCLEBIN_LOCATION "Localização da Reciclagem"
+ IDS_RECYCLEBIN_DISKSPACE "Espaço Disponível"
+ IDS_EMPTY_BITBUCKET "Esvaziar Reciclagem"
+ IDS_PICK_ICON_TITLE "Escolha Ícone"
+ IDS_PICK_ICON_FILTER "Ficheiros de Ícones(*.ico, *.icl, *.exe, *.dll)\0*.ico;*.icl;*.exe;*.dll\0"
+ IDS_OPEN_WITH_FILTER "Ficheiros Executáveis\0*.exe\0"
+ IDS_DIRECTORY "Pasta"
+ IDS_VIRTUAL_DRIVER "Driver de Dispositivo Virtual"
IDS_BAT_FILE "ReactOS Batch File"
IDS_CMD_FILE "ReactOS Command Script"
- IDS_COM_FILE "Dos Application"
- IDS_CPL_FILE "Control Panel Item"
+ IDS_COM_FILE "Aplicação Dos"
+ IDS_CPL_FILE "Item do Painel de Controle"
IDS_CUR_FILE "Cursor"
- IDS_DLL_FILE "Application Extension"
- IDS_DRV_FILE "Device Driver"
- IDS_EXE_FILE "Application"
- IDS_FON_FILE "Font file"
- IDS_TTF_FILE "TrueType Font file"
- IDS_HLP_FILE "Help File"
- IDS_INI_FILE "Configuration Settings"
- IDS_LNK_FILE "Shortcut"
- IDS_SYS_FILE "System file"
+ IDS_DLL_FILE "Extensão da Aplicação"
+ IDS_DRV_FILE "Driver do Dispositivo"
+ IDS_EXE_FILE "Aplicação"
+ IDS_FON_FILE "Ficheiro de tipo de letra"
+ IDS_TTF_FILE "Tipo de letra TrueType"
+ IDS_HLP_FILE "Ficheiro de Ajuda"
+ IDS_INI_FILE "Definições"
+ IDS_LNK_FILE "Atalho"
+ IDS_SYS_FILE "Ficheiro de Sistema"
- IDS_OPEN_VERB "Open"
- IDS_RUNAS_VERB "Run as "
- IDS_EDIT_VERB "Edit"
- IDS_FIND_VERB "Find"
- IDS_PRINT_VERB "Print"
- IDS_PLAY_VERB "Play"
- IDS_PREVIEW_VERB "Preview"
+ IDS_OPEN_VERB "Abrir"
+ IDS_RUNAS_VERB "Executar como "
+ IDS_EDIT_VERB "Editar"
+ IDS_FIND_VERB "Procurar"
+ IDS_PRINT_VERB "Imprimir"
+ IDS_PLAY_VERB "Reproduzir"
+ IDS_PREVIEW_VERB "Previzualizar"
- IDS_FILE_FOLDER "%u Files, %u Folders"
- IDS_PRINTERS "Printers"
- IDS_FONTS "Fonts"
- IDS_INSTALLNEWFONT "Install New Font..."
+ IDS_FILE_FOLDER "%u Ficheiros, %u Pastas"
+ IDS_PRINTERS "Impressoras"
+ IDS_FONTS "Tipos de Letras"
+ IDS_INSTALLNEWFONT "Instalar novo tipo de letra..."
- IDS_DEFAULT_CLUSTER_SIZE "Default allocation size"
- IDS_COPY_OF "Copy of"
+ IDS_DEFAULT_CLUSTER_SIZE "Tamanho da unidade de atribuição"
+ IDS_COPY_OF "Cópia de"
END
From b800febcd75e3d0485c18ea634ea33a77bc8fd72 Mon Sep 17 00:00:00 2001
From: Gregor Schneider
Date: Wed, 7 Apr 2010 17:42:43 +0000
Subject: [PATCH 066/261] [SHELL] Increase field width in German resources so
the drive text can fit
svn path=/trunk/; revision=46765
---
reactos/dll/win32/shell32/lang/de-DE.rc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/reactos/dll/win32/shell32/lang/de-DE.rc b/reactos/dll/win32/shell32/lang/de-DE.rc
index 09f6559a447..94523084c8a 100644
--- a/reactos/dll/win32/shell32/lang/de-DE.rc
+++ b/reactos/dll/win32/shell32/lang/de-DE.rc
@@ -296,7 +296,7 @@ BEGIN
CONTROL "", 14015, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 20, 140, 200, 20
- LTEXT "Laufwerk %s", 14009, 100, 170, 40, 10
+ LTEXT "Laufwerk %s", 14009, 100, 170, 50, 10
PUSHBUTTON "Bereinigen", 14010, 180, 175, 50, 15, WS_TABSTOP
CHECKBOX "Laufwerk komprimieren, um Speicherplatz zu sparen", 14011, 15, 205, 180, 10, WS_DISABLED
CHECKBOX "Laufwerk für schnelle Dateisuche indizieren", 14012, 15, 220, 165, 10, WS_DISABLED
From 2d3b57377f8dc422b89c905caa38e46ef88690fd Mon Sep 17 00:00:00 2001
From: Gregor Schneider
Date: Wed, 7 Apr 2010 19:11:56 +0000
Subject: [PATCH 067/261] [SHELL32] - Change "open with" dialog type to allow
aborting, add code to handle WM_DESTROY messages - Change full blue selection
color to standard background blue, set selection background non white
correctly - Adjust German resource fields to make texts fit See issue #4226
for more details.
svn path=/trunk/; revision=46766
---
reactos/dll/win32/shell32/lang/bg-BG.rc | 2 +-
reactos/dll/win32/shell32/lang/ca-ES.rc | 2 +-
reactos/dll/win32/shell32/lang/cs-CZ.rc | 2 +-
reactos/dll/win32/shell32/lang/da-DK.rc | 2 +-
reactos/dll/win32/shell32/lang/de-DE.rc | 8 ++++----
reactos/dll/win32/shell32/lang/el-GR.rc | 2 +-
reactos/dll/win32/shell32/lang/en-GB.rc | 2 +-
reactos/dll/win32/shell32/lang/en-US.rc | 2 +-
reactos/dll/win32/shell32/lang/es-ES.rc | 2 +-
reactos/dll/win32/shell32/lang/fi-FI.rc | 2 +-
reactos/dll/win32/shell32/lang/fr-FR.rc | 2 +-
reactos/dll/win32/shell32/lang/hu-HU.rc | 2 +-
reactos/dll/win32/shell32/lang/it-IT.rc | 2 +-
reactos/dll/win32/shell32/lang/ja-JP.rc | 2 +-
reactos/dll/win32/shell32/lang/ko-KR.rc | 2 +-
reactos/dll/win32/shell32/lang/nl-NL.rc | 2 +-
reactos/dll/win32/shell32/lang/no-NO.rc | 2 +-
reactos/dll/win32/shell32/lang/pl-PL.rc | 2 +-
reactos/dll/win32/shell32/lang/pt-BR.rc | 2 +-
reactos/dll/win32/shell32/lang/pt-PT.rc | 2 +-
reactos/dll/win32/shell32/lang/ro-RO.rc | 2 +-
reactos/dll/win32/shell32/lang/ru-RU.rc | 2 +-
reactos/dll/win32/shell32/lang/sk-SK.rc | 2 +-
reactos/dll/win32/shell32/lang/sl-SI.rc | 2 +-
reactos/dll/win32/shell32/lang/sv-SE.rc | 2 +-
reactos/dll/win32/shell32/lang/tr-TR.rc | 2 +-
reactos/dll/win32/shell32/lang/uk-UA.rc | 2 +-
reactos/dll/win32/shell32/lang/zh-CN.rc | 2 +-
reactos/dll/win32/shell32/lang/zh-TW.rc | 2 +-
reactos/dll/win32/shell32/she_ocmenu.c | 10 +++++++---
30 files changed, 39 insertions(+), 35 deletions(-)
diff --git a/reactos/dll/win32/shell32/lang/bg-BG.rc b/reactos/dll/win32/shell32/lang/bg-BG.rc
index 5cda676dd5e..63fe6968565 100644
--- a/reactos/dll/win32/shell32/lang/bg-BG.rc
+++ b/reactos/dll/win32/shell32/lang/bg-BG.rc
@@ -357,7 +357,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Îòâàðÿíå ñ"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/ca-ES.rc b/reactos/dll/win32/shell32/lang/ca-ES.rc
index a26fab0e23f..567cbc1533b 100644
--- a/reactos/dll/win32/shell32/lang/ca-ES.rc
+++ b/reactos/dll/win32/shell32/lang/ca-ES.rc
@@ -358,7 +358,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Open With"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/cs-CZ.rc b/reactos/dll/win32/shell32/lang/cs-CZ.rc
index f2652e6a2d4..8b8383f23b4 100644
--- a/reactos/dll/win32/shell32/lang/cs-CZ.rc
+++ b/reactos/dll/win32/shell32/lang/cs-CZ.rc
@@ -360,7 +360,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Otevøít v..."
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/da-DK.rc b/reactos/dll/win32/shell32/lang/da-DK.rc
index b9cf5217235..baa177f4631 100644
--- a/reactos/dll/win32/shell32/lang/da-DK.rc
+++ b/reactos/dll/win32/shell32/lang/da-DK.rc
@@ -347,7 +347,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Open With"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/de-DE.rc b/reactos/dll/win32/shell32/lang/de-DE.rc
index 94523084c8a..a07af8785d3 100644
--- a/reactos/dll/win32/shell32/lang/de-DE.rc
+++ b/reactos/dll/win32/shell32/lang/de-DE.rc
@@ -361,17 +361,17 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Öffnen mit"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
ICON IDI_SHELL_OPEN_WITH, -1, 8, 12, 21, 20
- LTEXT "Wählen Sie das Programm, das zum Öffnen dieser Datei verwendet werden soll:", -1, 44, 12, 211, 10
- LTEXT "Datei: ", 14001, 44, 25, 188, 10
+ LTEXT "Wählen Sie das Programm, das zum Öffnen dieser Datei verwendet werden soll:", -1, 44, 12, 211, 18
+ LTEXT "Datei: ", 14001, 44, 30, 188, 10
GROUPBOX "&Programme", -1, 7, 42, 249, 187
LISTBOX 14002, 16 ,57, 230, 130, LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP, WS_EX_STATICEDGE
AUTOCHECKBOX "&Dateityp &immer mit dem ausgewählten Programm öffnen", 14003, 20, 193, 225, 10
- PUSHBUTTON "&Durchsuchen..", 14004, 198, 207, 50, 14
+ PUSHBUTTON "&Durchsuchen...", 14004, 188, 207, 60, 14
PUSHBUTTON "OK", 14005, 150, 236, 50, 14
PUSHBUTTON "Abbrechen", 14006, 206, 236, 50, 14
END
diff --git a/reactos/dll/win32/shell32/lang/el-GR.rc b/reactos/dll/win32/shell32/lang/el-GR.rc
index 0821f013408..4a18d144671 100644
--- a/reactos/dll/win32/shell32/lang/el-GR.rc
+++ b/reactos/dll/win32/shell32/lang/el-GR.rc
@@ -358,7 +358,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "¢íïéãìá ìå"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/en-GB.rc b/reactos/dll/win32/shell32/lang/en-GB.rc
index 3dfbfd940df..e25cedd5e08 100644
--- a/reactos/dll/win32/shell32/lang/en-GB.rc
+++ b/reactos/dll/win32/shell32/lang/en-GB.rc
@@ -358,7 +358,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Open With"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/en-US.rc b/reactos/dll/win32/shell32/lang/en-US.rc
index 200c97ae1fb..b24ed529a28 100644
--- a/reactos/dll/win32/shell32/lang/en-US.rc
+++ b/reactos/dll/win32/shell32/lang/en-US.rc
@@ -358,7 +358,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Open With"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/es-ES.rc b/reactos/dll/win32/shell32/lang/es-ES.rc
index 8704146f23c..8bbf95ef8c8 100644
--- a/reactos/dll/win32/shell32/lang/es-ES.rc
+++ b/reactos/dll/win32/shell32/lang/es-ES.rc
@@ -361,7 +361,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 284, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Abrir con"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/fi-FI.rc b/reactos/dll/win32/shell32/lang/fi-FI.rc
index 778576a08fb..d34a695da49 100644
--- a/reactos/dll/win32/shell32/lang/fi-FI.rc
+++ b/reactos/dll/win32/shell32/lang/fi-FI.rc
@@ -358,7 +358,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Open With"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/fr-FR.rc b/reactos/dll/win32/shell32/lang/fr-FR.rc
index 3f712a60bbd..ae5b34b4973 100644
--- a/reactos/dll/win32/shell32/lang/fr-FR.rc
+++ b/reactos/dll/win32/shell32/lang/fr-FR.rc
@@ -362,7 +362,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Ouvrir avec"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/hu-HU.rc b/reactos/dll/win32/shell32/lang/hu-HU.rc
index 22a26038c7c..79964671b28 100644
--- a/reactos/dll/win32/shell32/lang/hu-HU.rc
+++ b/reactos/dll/win32/shell32/lang/hu-HU.rc
@@ -361,7 +361,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Open With"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/it-IT.rc b/reactos/dll/win32/shell32/lang/it-IT.rc
index 9ad6e53377e..ba31b5a98ac 100644
--- a/reactos/dll/win32/shell32/lang/it-IT.rc
+++ b/reactos/dll/win32/shell32/lang/it-IT.rc
@@ -359,7 +359,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Apri con"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/ja-JP.rc b/reactos/dll/win32/shell32/lang/ja-JP.rc
index 12f24d34adb..3b083005517 100644
--- a/reactos/dll/win32/shell32/lang/ja-JP.rc
+++ b/reactos/dll/win32/shell32/lang/ja-JP.rc
@@ -358,7 +358,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "ŠJ‚ƒvƒƒOƒ‰ƒ€"
FONT 9, "MS UI Gothic", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/ko-KR.rc b/reactos/dll/win32/shell32/lang/ko-KR.rc
index 9d7ad808fa6..96f8656e3eb 100644
--- a/reactos/dll/win32/shell32/lang/ko-KR.rc
+++ b/reactos/dll/win32/shell32/lang/ko-KR.rc
@@ -358,7 +358,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Open With"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/nl-NL.rc b/reactos/dll/win32/shell32/lang/nl-NL.rc
index b0e1c919a5f..95c4465e1f5 100644
--- a/reactos/dll/win32/shell32/lang/nl-NL.rc
+++ b/reactos/dll/win32/shell32/lang/nl-NL.rc
@@ -358,7 +358,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Open With"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/no-NO.rc b/reactos/dll/win32/shell32/lang/no-NO.rc
index 43c637f1dcb..e659e3f8175 100644
--- a/reactos/dll/win32/shell32/lang/no-NO.rc
+++ b/reactos/dll/win32/shell32/lang/no-NO.rc
@@ -359,7 +359,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Åpne med"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/pl-PL.rc b/reactos/dll/win32/shell32/lang/pl-PL.rc
index fef5815d4aa..7ef8add35dc 100644
--- a/reactos/dll/win32/shell32/lang/pl-PL.rc
+++ b/reactos/dll/win32/shell32/lang/pl-PL.rc
@@ -365,7 +365,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Otwórz za pomoc¹"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/pt-BR.rc b/reactos/dll/win32/shell32/lang/pt-BR.rc
index 5bcee218b35..a2d235b4883 100644
--- a/reactos/dll/win32/shell32/lang/pt-BR.rc
+++ b/reactos/dll/win32/shell32/lang/pt-BR.rc
@@ -360,7 +360,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Open With"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/pt-PT.rc b/reactos/dll/win32/shell32/lang/pt-PT.rc
index 0660e3b481d..34f98f578cb 100644
--- a/reactos/dll/win32/shell32/lang/pt-PT.rc
+++ b/reactos/dll/win32/shell32/lang/pt-PT.rc
@@ -361,7 +361,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Abre com..."
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/ro-RO.rc b/reactos/dll/win32/shell32/lang/ro-RO.rc
index efbff8594d2..a479927320e 100644
--- a/reactos/dll/win32/shell32/lang/ro-RO.rc
+++ b/reactos/dll/win32/shell32/lang/ro-RO.rc
@@ -361,7 +361,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Open With"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/ru-RU.rc b/reactos/dll/win32/shell32/lang/ru-RU.rc
index 6c3f488f3eb..d1c3b42f31b 100644
--- a/reactos/dll/win32/shell32/lang/ru-RU.rc
+++ b/reactos/dll/win32/shell32/lang/ru-RU.rc
@@ -358,7 +358,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Âûáîð ïðîãðàììû"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/sk-SK.rc b/reactos/dll/win32/shell32/lang/sk-SK.rc
index e45b141e87f..24867f74690 100644
--- a/reactos/dll/win32/shell32/lang/sk-SK.rc
+++ b/reactos/dll/win32/shell32/lang/sk-SK.rc
@@ -364,7 +364,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Otvori v programe"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/sl-SI.rc b/reactos/dll/win32/shell32/lang/sl-SI.rc
index 5038af1c123..3d33693efcd 100644
--- a/reactos/dll/win32/shell32/lang/sl-SI.rc
+++ b/reactos/dll/win32/shell32/lang/sl-SI.rc
@@ -358,7 +358,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Open With"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/sv-SE.rc b/reactos/dll/win32/shell32/lang/sv-SE.rc
index 08a6f59e70f..1bc2f6fa121 100644
--- a/reactos/dll/win32/shell32/lang/sv-SE.rc
+++ b/reactos/dll/win32/shell32/lang/sv-SE.rc
@@ -358,7 +358,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Open With"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/tr-TR.rc b/reactos/dll/win32/shell32/lang/tr-TR.rc
index 3ab92cbb104..0ec3378ff17 100644
--- a/reactos/dll/win32/shell32/lang/tr-TR.rc
+++ b/reactos/dll/win32/shell32/lang/tr-TR.rc
@@ -358,7 +358,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Open With"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/uk-UA.rc b/reactos/dll/win32/shell32/lang/uk-UA.rc
index cf2847ed9ab..620bd261f0b 100644
--- a/reactos/dll/win32/shell32/lang/uk-UA.rc
+++ b/reactos/dll/win32/shell32/lang/uk-UA.rc
@@ -359,7 +359,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Âèá³ð ïðîãðàìè"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/zh-CN.rc b/reactos/dll/win32/shell32/lang/zh-CN.rc
index 18c4d5439d4..152903feb42 100644
--- a/reactos/dll/win32/shell32/lang/zh-CN.rc
+++ b/reactos/dll/win32/shell32/lang/zh-CN.rc
@@ -347,7 +347,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Open With"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/lang/zh-TW.rc b/reactos/dll/win32/shell32/lang/zh-TW.rc
index f7c59a2e1ff..feb21894ceb 100644
--- a/reactos/dll/win32/shell32/lang/zh-TW.rc
+++ b/reactos/dll/win32/shell32/lang/zh-TW.rc
@@ -359,7 +359,7 @@ BEGIN
END
OPEN_WITH_PROGRAMM_DLG DIALOGEX 0, 0, 264, 256
-STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
CAPTION "Open With"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
diff --git a/reactos/dll/win32/shell32/she_ocmenu.c b/reactos/dll/win32/shell32/she_ocmenu.c
index dc66376cdea..216c6265fbf 100644
--- a/reactos/dll/win32/shell32/she_ocmenu.c
+++ b/reactos/dll/win32/shell32/she_ocmenu.c
@@ -719,12 +719,12 @@ static INT_PTR CALLBACK OpenWithProgrammDlg(HWND hwndDlg, UINT uMsg, WPARAM wPar
if (lpdis->itemID == index)
{
- /* paint focused item with blue background */
+ /* paint focused item with standard background colour */
HBRUSH hBrush;
- hBrush = CreateSolidBrush(RGB(0, 0, 255));
+ hBrush = CreateSolidBrush(RGB(46, 104, 160));
FillRect(lpdis->hDC, &lpdis->rcItem, hBrush);
DeleteObject(hBrush);
- preBkColor = SetBkColor(lpdis->hDC, RGB(255, 255, 255));
+ preBkColor = SetBkColor(lpdis->hDC, RGB(46, 104, 160));
}
else
{
@@ -756,6 +756,10 @@ static INT_PTR CALLBACK OpenWithProgrammDlg(HWND hwndDlg, UINT uMsg, WPARAM wPar
break;
}
break;
+ case WM_DESTROY:
+ FreeListItems(hwndDlg);
+ EndDialog(hwndDlg, 0);
+ return TRUE;
default:
break;
}
From da1fa61cf0a6d6a7406b2ba4c6883e71bbe241d6 Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Wed, 7 Apr 2010 20:18:44 +0000
Subject: [PATCH 068/261] [PCI] - Fix a crash that occurs when a device is
started which requires no resources
svn path=/trunk/; revision=46767
---
reactos/drivers/bus/pci/pdo.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/reactos/drivers/bus/pci/pdo.c b/reactos/drivers/bus/pci/pdo.c
index 6fde92e8311..266b95d6a97 100644
--- a/reactos/drivers/bus/pci/pdo.c
+++ b/reactos/drivers/bus/pci/pdo.c
@@ -1199,6 +1199,9 @@ PdoStartDevice(
PPDO_DEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
UCHAR Irq;
+ if (!RawResList)
+ return STATUS_SUCCESS;
+
/* TODO: Assign the other resources we get to the card */
for (i = 0; i < RawResList->Count; i++)
From d9face83c693cb5e3fad155df8609d9c13316061 Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Wed, 7 Apr 2010 20:19:29 +0000
Subject: [PATCH 069/261] [ISAPNP] - Rewrite the ISAPnP driver based off
EtherBoot source - TODO: Resource stuff
svn path=/trunk/; revision=46768
---
reactos/drivers/bus/isapnp/fdo.c | 141 ++
reactos/drivers/bus/isapnp/hardware.c | 579 +++++++
reactos/drivers/bus/isapnp/isapnp.c | 1810 ++--------------------
reactos/drivers/bus/isapnp/isapnp.h | 383 +----
reactos/drivers/bus/isapnp/isapnp.rbuild | 4 +
reactos/drivers/bus/isapnp/isapnphw.h | 106 ++
reactos/drivers/bus/isapnp/pdo.c | 83 +
7 files changed, 1115 insertions(+), 1991 deletions(-)
create mode 100644 reactos/drivers/bus/isapnp/fdo.c
create mode 100644 reactos/drivers/bus/isapnp/hardware.c
create mode 100644 reactos/drivers/bus/isapnp/isapnphw.h
create mode 100644 reactos/drivers/bus/isapnp/pdo.c
diff --git a/reactos/drivers/bus/isapnp/fdo.c b/reactos/drivers/bus/isapnp/fdo.c
new file mode 100644
index 00000000000..51a0f4bccaf
--- /dev/null
+++ b/reactos/drivers/bus/isapnp/fdo.c
@@ -0,0 +1,141 @@
+/*
+ * PROJECT: ReactOS ISA PnP Bus driver
+ * FILE: fdo.c
+ * PURPOSE: FDO-specific code
+ * PROGRAMMERS: Cameron Gutman (cameron.gutman@reactos.org)
+ */
+#include
+
+#define NDEBUG
+#include
+
+NTSTATUS
+NTAPI
+IsaFdoStartDevice(
+ IN PISAPNP_FDO_EXTENSION FdoExt,
+ IN PIRP Irp,
+ IN PIO_STACK_LOCATION IrpSp)
+{
+ NTSTATUS Status;
+ KIRQL OldIrql;
+
+ KeAcquireSpinLock(&FdoExt->Lock, &OldIrql);
+
+ Status = IsaHwDetectReadDataPort(FdoExt);
+ if (!NT_SUCCESS(Status))
+ {
+ KeReleaseSpinLock(&FdoExt->Lock, OldIrql);
+ return Status;
+ }
+
+ FdoExt->Common.State = dsStarted;
+
+ KeReleaseSpinLock(&FdoExt->Lock, OldIrql);
+
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS
+NTAPI
+IsaFdoQueryDeviceRelations(
+ IN PISAPNP_FDO_EXTENSION FdoExt,
+ IN PIRP Irp,
+ IN PIO_STACK_LOCATION IrpSp)
+{
+ NTSTATUS Status;
+ PLIST_ENTRY CurrentEntry;
+ PISAPNP_LOGICAL_DEVICE IsaDevice;
+ PDEVICE_RELATIONS DeviceRelations;
+ KIRQL OldIrql;
+ ULONG i = 0;
+
+ if (IrpSp->Parameters.QueryDeviceRelations.Type != BusRelations)
+ return Irp->IoStatus.Status;
+
+ KeAcquireSpinLock(&FdoExt->Lock, &OldIrql);
+
+ Status = IsaHwFillDeviceList(FdoExt);
+ if (!NT_SUCCESS(Status))
+ {
+ KeReleaseSpinLock(&FdoExt->Lock, OldIrql);
+ return Status;
+ }
+
+ DeviceRelations = ExAllocatePool(NonPagedPool,
+ sizeof(DEVICE_RELATIONS) + sizeof(DEVICE_OBJECT) * (FdoExt->DeviceCount - 1));
+ if (!DeviceRelations)
+ {
+ KeReleaseSpinLock(&FdoExt->Lock, OldIrql);
+ return STATUS_INSUFFICIENT_RESOURCES;
+ }
+
+ CurrentEntry = FdoExt->DeviceListHead.Flink;
+ while (CurrentEntry != &FdoExt->DeviceListHead)
+ {
+ IsaDevice = CONTAINING_RECORD(CurrentEntry, ISAPNP_LOGICAL_DEVICE, ListEntry);
+
+ DeviceRelations->Objects[i++] = IsaDevice->Common.Self;
+
+ ObReferenceObject(IsaDevice->Common.Self);
+
+ CurrentEntry = CurrentEntry->Flink;
+ }
+
+ DeviceRelations->Count = FdoExt->DeviceCount;
+
+ KeReleaseSpinLock(&FdoExt->Lock, OldIrql);
+
+ Irp->IoStatus.Information = (ULONG_PTR)DeviceRelations;
+
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS
+NTAPI
+IsaFdoPnp(
+ IN PISAPNP_FDO_EXTENSION FdoExt,
+ IN PIRP Irp,
+ IN PIO_STACK_LOCATION IrpSp)
+{
+ NTSTATUS Status = Irp->IoStatus.Status;
+
+ switch (IrpSp->MinorFunction)
+ {
+ case IRP_MN_START_DEVICE:
+ Status = IsaForwardIrpSynchronous(FdoExt, Irp);
+
+ if (NT_SUCCESS(Status))
+ Status = IsaFdoStartDevice(FdoExt, Irp, IrpSp);
+
+ Irp->IoStatus.Status = Status;
+
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return Status;
+
+ case IRP_MN_STOP_DEVICE:
+ FdoExt->Common.State = dsStopped;
+
+ Status = STATUS_SUCCESS;
+ break;
+
+ case IRP_MN_QUERY_DEVICE_RELATIONS:
+ Status = IsaFdoQueryDeviceRelations(FdoExt, Irp, IrpSp);
+
+ Irp->IoStatus.Status = Status;
+
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return Status;
+
+ case IRP_MN_FILTER_RESOURCE_REQUIREMENTS:
+ DPRINT("IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n");
+ break;
+
+ default:
+ DPRINT1("Unknown PnP code: %x\n", IrpSp->MinorFunction);
+ break;
+ }
+
+ IoSkipCurrentIrpStackLocation(Irp);
+
+ return IoCallDriver(FdoExt->Ldo, Irp);
+}
diff --git a/reactos/drivers/bus/isapnp/hardware.c b/reactos/drivers/bus/isapnp/hardware.c
new file mode 100644
index 00000000000..67a903948f8
--- /dev/null
+++ b/reactos/drivers/bus/isapnp/hardware.c
@@ -0,0 +1,579 @@
+/*
+ * PROJECT: ReactOS ISA PnP Bus driver
+ * FILE: hardware.c
+ * PURPOSE: Hardware support code
+ * PROGRAMMERS: Cameron Gutman (cameron.gutman@reactos.org)
+ */
+#include
+#include
+
+#define NDEBUG
+#include
+
+static
+inline
+VOID
+WriteAddress(USHORT Address)
+{
+ WRITE_PORT_UCHAR((PUCHAR)ISAPNP_ADDRESS, Address);
+}
+
+static
+inline
+VOID
+WriteData(USHORT Data)
+{
+ WRITE_PORT_UCHAR((PUCHAR)ISAPNP_WRITE_DATA, Data);
+}
+
+static
+inline
+UCHAR
+ReadData(PUCHAR ReadDataPort)
+{
+ return READ_PORT_UCHAR(ReadDataPort);
+}
+
+static
+inline
+VOID
+WriteByte(USHORT Address, USHORT Value)
+{
+ WriteAddress(Address);
+ WriteData(Value);
+}
+
+static
+inline
+UCHAR
+ReadByte(PUCHAR ReadDataPort, USHORT Address)
+{
+ WriteAddress(Address);
+ return ReadData(ReadDataPort);
+}
+
+static
+inline
+USHORT
+ReadWord(PUCHAR ReadDataPort, USHORT Address)
+{
+ return ((ReadByte(ReadDataPort, Address) << 8) |
+ (ReadByte(ReadDataPort, Address + 1)));
+}
+
+static
+inline
+VOID
+SetReadDataPort(PUCHAR ReadDataPort)
+{
+ WriteByte(ISAPNP_READPORT, ((ULONG_PTR)ReadDataPort >> 2));
+}
+
+static
+inline
+VOID
+EnterIsolationState(VOID)
+{
+ WriteAddress(ISAPNP_SERIALISOLATION);
+}
+
+static
+inline
+VOID
+WaitForKey(VOID)
+{
+ WriteByte(ISAPNP_CONFIGCONTROL, ISAPNP_CONFIG_WAIT_FOR_KEY);
+}
+
+static
+inline
+VOID
+ResetCsn(VOID)
+{
+ WriteByte(ISAPNP_CONFIGCONTROL, ISAPNP_CONFIG_RESET_CSN);
+}
+
+static
+inline
+VOID
+Wake(USHORT Csn)
+{
+ WriteByte(ISAPNP_WAKE, Csn);
+}
+
+static
+inline
+USHORT
+ReadResourceData(PUCHAR ReadDataPort)
+{
+ return ReadByte(ReadDataPort, ISAPNP_RESOURCEDATA);
+}
+
+static
+inline
+USHORT
+ReadStatus(PUCHAR ReadDataPort)
+{
+ return ReadByte(ReadDataPort, ISAPNP_STATUS);
+}
+
+static
+inline
+VOID
+WriteCsn(USHORT Csn)
+{
+ WriteByte(ISAPNP_CARDSELECTNUMBER, Csn);
+}
+
+static
+inline
+VOID
+WriteLogicalDeviceNumber(USHORT LogDev)
+{
+ WriteByte(ISAPNP_LOGICALDEVICENUMBER, LogDev);
+}
+
+static
+inline
+VOID
+ActivateDevice(USHORT LogDev)
+{
+ WriteLogicalDeviceNumber(LogDev);
+ WriteByte(ISAPNP_ACTIVATE, 1);
+}
+
+static
+inline
+VOID
+DeactivateDevice(USHORT LogDev)
+{
+ WriteLogicalDeviceNumber(LogDev);
+ WriteByte(ISAPNP_ACTIVATE, 0);
+}
+
+static
+inline
+USHORT
+ReadIoBase(PUCHAR ReadDataPort, USHORT Index)
+{
+ return ReadWord(ReadDataPort, ISAPNP_IOBASE(Index));
+}
+
+static
+inline
+USHORT
+ReadIrqNo(PUCHAR ReadDataPort, USHORT Index)
+{
+ return ReadByte(ReadDataPort, ISAPNP_IRQNO(Index));
+}
+
+static
+inline
+VOID
+HwDelay(VOID)
+{
+ KeStallExecutionProcessor(1000);
+}
+
+static
+inline
+USHORT
+NextLFSR(USHORT Lfsr, USHORT InputBit)
+{
+ ULONG NextLfsr = Lfsr >> 1;
+
+ NextLfsr |= (((Lfsr ^ NextLfsr) ^ InputBit)) << 7;
+
+ return NextLfsr;
+}
+
+static
+VOID
+SendKey(VOID)
+{
+ USHORT i, Lfsr;
+
+ HwDelay();
+ WriteAddress(0x00);
+ WriteAddress(0x00);
+
+ Lfsr = ISAPNP_LFSR_SEED;
+ for (i = 0; i < 32; i++)
+ {
+ WriteAddress(Lfsr);
+ Lfsr = NextLFSR(Lfsr, 0);
+ }
+}
+
+static
+USHORT
+PeekByte(PUCHAR ReadDataPort)
+{
+ USHORT i;
+
+ for (i = 0; i < 20; i++)
+ {
+ if (ReadStatus(ReadDataPort) & 0x01)
+ return ReadResourceData(ReadDataPort);
+
+ HwDelay();
+ }
+
+ return 0xFF;
+}
+
+static
+VOID
+Peek(PUCHAR ReadDataPort, PVOID Buffer, ULONG Length)
+{
+ USHORT i, byte;
+
+ for (i = 0; i < Length; i++)
+ {
+ byte = PeekByte(ReadDataPort);
+ if (Buffer)
+ *((PUCHAR)Buffer + i) = byte;
+ }
+}
+
+static
+USHORT
+IsaPnpChecksum(PISAPNP_IDENTIFIER Identifier)
+{
+ USHORT i,j, Lfsr, Byte;
+
+ Lfsr = ISAPNP_LFSR_SEED;
+ for (i = 0; i < 8; i++)
+ {
+ Byte = *(((PUCHAR)Identifier) + i);
+ for (j = 0; j < 8; j++)
+ {
+ Lfsr = NextLFSR(Lfsr, Byte);
+ Byte >>= 1;
+ }
+ }
+
+ return Lfsr;
+}
+
+static
+BOOLEAN
+FindTag(PUCHAR ReadDataPort, USHORT WantedTag, PVOID Buffer, ULONG Length)
+{
+ USHORT Tag, TagLen;
+
+ do
+ {
+ Tag = PeekByte(ReadDataPort);
+ if (ISAPNP_IS_SMALL_TAG(Tag))
+ {
+ TagLen = ISAPNP_SMALL_TAG_LEN(Tag);
+ Tag = ISAPNP_SMALL_TAG_NAME(Tag);
+ }
+ else
+ {
+ TagLen = PeekByte(ReadDataPort) + (PeekByte(ReadDataPort) << 8);
+ Tag = ISAPNP_LARGE_TAG_NAME(Tag);
+ }
+
+ if (Tag == WantedTag)
+ {
+ if (Length > TagLen)
+ Length = TagLen;
+
+ Peek(ReadDataPort, Buffer, Length);
+
+ return TRUE;
+ }
+ else
+ {
+ Peek(ReadDataPort, NULL, Length);
+ }
+ } while (Tag != ISAPNP_TAG_END);
+
+ return FALSE;
+}
+
+static
+BOOLEAN
+FindLogDevId(PUCHAR ReadDataPort, USHORT LogDev, PISAPNP_LOGDEVID LogDeviceId)
+{
+ USHORT i;
+
+ for (i = 0; i <= LogDev; i++)
+ {
+ if (!FindTag(ReadDataPort, ISAPNP_TAG_LOGDEVID, LogDeviceId, sizeof(*LogDeviceId)))
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static
+INT
+TryIsolate(PUCHAR ReadDataPort)
+{
+ ISAPNP_IDENTIFIER Identifier;
+ USHORT i, j;
+ BOOLEAN Seen55aa, SeenLife;
+ INT Csn = 0;
+ USHORT Byte, Data;
+
+ DPRINT("Setting read data port: 0x%x\n", ReadDataPort);
+
+ WaitForKey();
+ SendKey();
+
+ ResetCsn();
+ HwDelay();
+ HwDelay();
+
+ WaitForKey();
+ SendKey();
+ Wake(0x00);
+
+ SetReadDataPort(ReadDataPort);
+ HwDelay();
+
+ while (TRUE)
+ {
+ EnterIsolationState();
+ HwDelay();
+
+ RtlZeroMemory(&Identifier, sizeof(Identifier));
+
+ Seen55aa = SeenLife = FALSE;
+ for (i = 0; i < 9; i++)
+ {
+ Byte = 0;
+ for (j = 0; j < 8; j++)
+ {
+ Data = ReadData(ReadDataPort);
+ HwDelay();
+ Data = ((Data << 8) | ReadData(ReadDataPort));
+ HwDelay();
+ Data >>= 1;
+
+ if (Data != 0xFFFF)
+ {
+ SeenLife = TRUE;
+ if (Data == 0x55AA)
+ {
+ Byte |= 0x80;
+ Seen55aa = TRUE;
+ }
+ }
+ }
+ *(((PUCHAR)&Identifier) + i) = Byte;
+ }
+
+ if (!Seen55aa)
+ {
+ if (Csn)
+ {
+ DPRINT("Found no more cards\n");
+ }
+ else
+ {
+ if (SeenLife)
+ {
+ DPRINT("Saw life but no cards, trying new read port\n");
+ Csn = -1;
+ }
+ else
+ {
+ DPRINT("Saw no sign of life, abandoning isolation\n");
+ }
+ }
+ break;
+ }
+
+ if (Identifier.Checksum != IsaPnpChecksum(&Identifier))
+ {
+ DPRINT("Bad checksum, trying next read data port\n");
+ Csn = -1;
+ break;
+ }
+
+ Csn++;
+
+ WriteCsn(Csn);
+ HwDelay();
+
+ Wake(0x00);
+ HwDelay();
+ }
+
+ WaitForKey();
+
+ if (Csn > 0)
+ {
+ DPRINT("Found %d cards at read port 0x%x\n", Csn, ReadDataPort);
+ }
+
+ return Csn;
+}
+
+static
+PUCHAR
+Isolate(VOID)
+{
+ PUCHAR ReadPort;
+
+ for (ReadPort = (PUCHAR)ISAPNP_READ_PORT_START;
+ (ULONG_PTR)ReadPort <= ISAPNP_READ_PORT_MAX;
+ ReadPort += ISAPNP_READ_PORT_STEP)
+ {
+ /* Avoid the NE2000 probe space */
+ if ((ULONG_PTR)ReadPort >= 0x280 &&
+ (ULONG_PTR)ReadPort <= 0x380)
+ continue;
+
+ if (TryIsolate(ReadPort) > 0)
+ return ReadPort;
+ }
+
+ return 0;
+}
+
+VOID
+DeviceActivation(PISAPNP_LOGICAL_DEVICE IsaDevice,
+ BOOLEAN Activate)
+{
+ WaitForKey();
+ SendKey();
+ Wake(IsaDevice->CSN);
+
+ if (Activate)
+ ActivateDevice(IsaDevice->LDN);
+ else
+ DeactivateDevice(IsaDevice->LDN);
+
+ HwDelay();
+
+ WaitForKey();
+}
+
+NTSTATUS
+ProbeIsaPnpBus(PISAPNP_FDO_EXTENSION FdoExt)
+{
+ PISAPNP_LOGICAL_DEVICE LogDevice;
+ ISAPNP_IDENTIFIER Identifier;
+ ISAPNP_LOGDEVID LogDevId;
+ USHORT Csn;
+ USHORT LogDev;
+ PDEVICE_OBJECT Pdo;
+ NTSTATUS Status;
+
+ ASSERT(FdoExt->ReadDataPort);
+
+ for (Csn = 1; Csn <= 0xFF; Csn++)
+ {
+ for (LogDev = 0; LogDev <= 0xFF; LogDev++)
+ {
+ Status = IoCreateDevice(FdoExt->Common.Self->DriverObject,
+ sizeof(ISAPNP_LOGICAL_DEVICE),
+ NULL,
+ FILE_DEVICE_CONTROLLER,
+ FILE_DEVICE_SECURE_OPEN,
+ FALSE,
+ &Pdo);
+ if (!NT_SUCCESS(Status))
+ return Status;
+
+ Pdo->Flags |= DO_BUS_ENUMERATED_DEVICE;
+
+ LogDevice = Pdo->DeviceExtension;
+
+ RtlZeroMemory(LogDevice, sizeof(ISAPNP_LOGICAL_DEVICE));
+
+ LogDevice->Common.Self = Pdo;
+ LogDevice->Common.IsFdo = FALSE;
+ LogDevice->Common.State = dsStopped;
+
+ LogDevice->CSN = Csn;
+ LogDevice->LDN = LogDev;
+
+ WaitForKey();
+ SendKey();
+ Wake(Csn);
+
+ Peek(FdoExt->ReadDataPort, &Identifier, sizeof(Identifier));
+
+ if (Identifier.VendorId & 0x80)
+ {
+ IoDeleteDevice(LogDevice->Common.Self);
+ return STATUS_SUCCESS;
+ }
+
+ if (!FindLogDevId(FdoExt->ReadDataPort, LogDev, &LogDevId))
+ break;
+
+ WriteLogicalDeviceNumber(LogDev);
+
+ LogDevice->VendorId = LogDevId.VendorId;
+ LogDevice->ProdId = LogDevId.ProdId;
+ LogDevice->IoAddr = ReadIoBase(FdoExt->ReadDataPort, 0);
+ LogDevice->IrqNo = ReadIrqNo(FdoExt->ReadDataPort, 0);
+
+ DPRINT1("Detected ISA PnP device - VID: 0x%x PID: 0x%x IoBase: 0x%x IRQ:0x%x\n",
+ LogDevice->VendorId, LogDevice->ProdId, LogDevice->IoAddr, LogDevice->IrqNo);
+
+ WaitForKey();
+
+ Pdo->Flags &= ~DO_DEVICE_INITIALIZING;
+
+ InsertTailList(&FdoExt->DeviceListHead, &LogDevice->ListEntry);
+ FdoExt->DeviceCount++;
+ }
+ }
+
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS
+NTAPI
+IsaHwDetectReadDataPort(
+ IN PISAPNP_FDO_EXTENSION FdoExt)
+{
+ FdoExt->ReadDataPort = Isolate();
+ if (!FdoExt->ReadDataPort)
+ {
+ DPRINT1("No read data port found\n");
+ return STATUS_UNSUCCESSFUL;
+ }
+
+ DPRINT1("Detected read data port at 0x%x\n", FdoExt->ReadDataPort);
+
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS
+NTAPI
+IsaHwActivateDevice(
+ IN PISAPNP_LOGICAL_DEVICE LogicalDevice)
+{
+ DeviceActivation(LogicalDevice,
+ TRUE);
+
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS
+NTAPI
+IsaHwDeactivateDevice(
+ IN PISAPNP_LOGICAL_DEVICE LogicalDevice)
+{
+ DeviceActivation(LogicalDevice,
+ FALSE);
+
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS
+NTAPI
+IsaHwFillDeviceList(
+ IN PISAPNP_FDO_EXTENSION FdoExt)
+{
+ return ProbeIsaPnpBus(FdoExt);
+}
diff --git a/reactos/drivers/bus/isapnp/isapnp.c b/reactos/drivers/bus/isapnp/isapnp.c
index 37262c3aa87..594b5a90541 100644
--- a/reactos/drivers/bus/isapnp/isapnp.c
+++ b/reactos/drivers/bus/isapnp/isapnp.c
@@ -1,1729 +1,183 @@
-/* $Id$
- *
+/*
* PROJECT: ReactOS ISA PnP Bus driver
* FILE: isapnp.c
* PURPOSE: Driver entry
- * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
- * NOTE: Parts adapted from linux ISA PnP driver
- * UPDATE HISTORY:
- * 01-05-2001 CSH Created
+ * PROGRAMMERS: Cameron Gutman (cameron.gutman@reactos.org)
*/
#include
-#ifndef NDEBUG
#define NDEBUG
-#endif
#include
-
-#ifdef ALLOC_PRAGMA
-
-// Make the initialization routines discardable, so that they
-// don't waste space
-
-#pragma alloc_text(init, DriverEntry)
-
-
-#endif /* ALLOC_PRAGMA */
-
-
-PUCHAR IsaPnPReadPort;
-
-
-#define UCHAR2USHORT(v0, v1) \
- ((v1 << 8) | v0)
-
-#define UCHAR2ULONG(v0, v1, v2, v3) \
- ((UCHAR2USHORT(v2, v3) << 16) | UCHAR2USHORT(v0, v1))
-
-
-#ifndef NDEBUG
-
-struct
-{
- PCH Name;
-} SmallTags[] = {
- {"Unknown Small Tag"},
- {"ISAPNP_SRIN_VERSION"},
- {"ISAPNP_SRIN_LDEVICE_ID"},
- {"ISAPNP_SRIN_CDEVICE_ID"},
- {"ISAPNP_SRIN_IRQ_FORMAT"},
- {"ISAPNP_SRIN_DMA_FORMAT"},
- {"ISAPNP_SRIN_START_DFUNCTION"},
- {"ISAPNP_SRIN_END_DFUNCTION"},
- {"ISAPNP_SRIN_IO_DESCRIPTOR"},
- {"ISAPNP_SRIN_FL_IO_DESCRIPOTOR"},
- {"Reserved Small Tag"},
- {"Reserved Small Tag"},
- {"Reserved Small Tag"},
- {"Reserved Small Tag"},
- {"ISAPNP_SRIN_VENDOR_DEFINED"},
- {"ISAPNP_SRIN_END_TAG"}
-};
-
-struct
-{
- PCH Name;
-} LargeTags[] = {
- {"Unknown Large Tag"},
- {"ISAPNP_LRIN_MEMORY_RANGE"},
- {"ISAPNP_LRIN_ID_STRING_ANSI"},
- {"ISAPNP_LRIN_ID_STRING_UNICODE"},
- {"ISAPNP_LRIN_VENDOR_DEFINED"},
- {"ISAPNP_LRIN_MEMORY_RANGE32"},
- {"ISAPNP_LRIN_FL_MEMORY_RANGE32"}
-};
-
-PCSZ TagName(ULONG Tag, BOOLEAN Small)
-{
- if (Small && (Tag <= ISAPNP_SRIN_END_TAG)) {
- return SmallTags[Tag].Name;
- } else if (Tag <= ISAPNP_LRIN_FL_MEMORY_RANGE32){
- return LargeTags[Tag].Name;
- }
-
- return NULL;
-}
-
-#endif
-
-static __inline VOID WriteData(UCHAR Value)
-{
- WRITE_PORT_UCHAR((PUCHAR)ISAPNP_WRITE_PORT, Value);
-}
-
-static __inline VOID WriteAddress(UCHAR Value)
-{
- WRITE_PORT_UCHAR((PUCHAR)ISAPNP_ADDRESS_PORT, Value);
- KeStallExecutionProcessor(20);
-}
-
-static __inline UCHAR ReadData(VOID)
-{
- return READ_PORT_UCHAR(IsaPnPReadPort);
-}
-
-static UCHAR ReadUchar(UCHAR Index)
-{
- WriteAddress(Index);
- return ReadData();
-}
-
-#if 0
-static USHORT ReadUshort(UCHAR Index)
-{
- USHORT Value;
-
- Value = ReadUchar(Index);
- Value = (Value << 8) + ReadUchar(Index + 1);
- return Value;
-}
-
-static ULONG ReadUlong(UCHAR Index)
-{
- ULONG Value;
-
- Value = ReadUchar(Index);
- Value = (Value << 8) + ReadUchar(Index + 1);
- Value = (Value << 8) + ReadUchar(Index + 2);
- Value = (Value << 8) + ReadUchar(Index + 3);
- return Value;
-}
-#endif
-
-static VOID WriteUchar(UCHAR Index, UCHAR Value)
-{
- WriteAddress(Index);
- WriteData(Value);
-}
-
-#if 0
-static VOID WriteUshort(UCHAR Index, USHORT Value)
-{
- WriteUchar(Index, Value >> 8);
- WriteUchar(Index + 1, Value);
-}
-
-static VOID WriteUlong(UCHAR Index, ULONG Value)
-{
- WriteUchar(Index, Value >> 24);
- WriteUchar(Index + 1, Value >> 16);
- WriteUchar(Index + 2, Value >> 8);
- WriteUchar(Index + 3, Value);
-}
-#endif
-
-static __inline VOID SetReadDataPort(ULONG_PTR Port)
-{
- IsaPnPReadPort = (PUCHAR)Port;
- WriteUchar(0x00, (UCHAR) (Port >> 2));
- KeStallExecutionProcessor(100);
-}
-
-static VOID SendKey(VOID)
-{
- ULONG i;
- UCHAR msb;
- UCHAR code;
-
- /* FIXME: Is there something better? */
- KeStallExecutionProcessor(1000);
- WriteAddress(0x00);
- WriteAddress(0x00);
-
- code = 0x6a;
- WriteAddress(code);
- for (i = 1; i < 32; i++) {
- msb = ((code & 0x01) ^ ((code & 0x02) >> 1)) << 7;
- code = (code >> 1) | msb;
- WriteAddress(code);
- }
-}
-
-/* Place all PnP cards in wait-for-key state */
-static VOID SendWait(VOID)
-{
- WriteUchar(0x02, 0x02);
-}
-
-static VOID SendWake(UCHAR csn)
-{
- WriteUchar(ISAPNP_CARD_WAKECSN, csn);
-}
-
-#if 0
-static VOID SelectLogicalDevice(UCHAR LogicalDevice)
-{
- WriteUchar(ISAPNP_CARD_LOG_DEVICE_NUM, LogicalDevice);
-}
-
-static VOID ActivateLogicalDevice(UCHAR LogicalDevice)
-{
- SelectLogicalDevice(LogicalDevice);
- WriteUchar(ISAPNP_CONTROL_ACTIVATE, 0x1);
- KeStallExecutionProcessor(250);
-}
-
-static VOID DeactivateLogicalDevice(UCHAR LogicalDevice)
-{
- SelectLogicalDevice(LogicalDevice);
- WriteUchar(ISAPNP_CONTROL_ACTIVATE, 0x0);
- KeStallExecutionProcessor(500);
-}
-#endif
-
-#define READ_DATA_PORT_STEP 32 /* Minimum is 4 */
-
-static ULONG_PTR FindNextReadPort(VOID)
-{
- ULONG_PTR Port;
-
-
-
- Port = (ULONG_PTR)IsaPnPReadPort;
-
- while (TRUE) {
-
- Port += READ_DATA_PORT_STEP;
-
-
-
- if (Port > ISAPNP_MAX_READ_PORT)
-
- {
-
- return 0;
-
- }
-
-
-
- /*
-
- * We cannot use NE2000 probe spaces for
-
- * ISAPnP or we will lock up machines
-
- */
-
- if ((Port < 0x280) || (Port > 0x380))
-
- {
-
- return Port;
-
- }
-
- }
-
-}
-
-static BOOLEAN IsolateReadDataPortSelect(VOID)
-{
- ULONG_PTR Port;
-
- SendWait();
- SendKey();
-
- /* Control: reset CSN and conditionally everything else too */
- WriteUchar(0x02, 0x05);
- KeStallExecutionProcessor(2000);
-
- SendWait();
- SendKey();
- SendWake(0x00);
-
- Port = FindNextReadPort();
- if (Port == 0) {
- SendWait();
- return FALSE;
- }
-
- SetReadDataPort(Port);
- KeStallExecutionProcessor(1000);
- WriteAddress(0x01);
- KeStallExecutionProcessor(1000);
- return TRUE;
-}
-
-/*
- * Isolate (assign uniqued CSN) to all ISA PnP devices
- */
-static ULONG IsolatePnPCards(VOID)
-{
- UCHAR checksum = 0x6a;
- UCHAR chksum = 0x00;
- UCHAR bit = 0x00;
- ULONG data;
- ULONG csn = 0;
- ULONG i;
- ULONG iteration = 1;
-
- DPRINT("Called\n");
-
- IsaPnPReadPort = (PUCHAR)(ISAPNP_MIN_READ_PORT - READ_DATA_PORT_STEP);
- if (!IsolateReadDataPortSelect()) {
- DPRINT("Could not set read data port\n");
- return 0;
- }
-
- while (TRUE) {
- for (i = 1; i <= 64; i++) {
- data = ReadData() << 8;
- KeStallExecutionProcessor(250);
- data = data | ReadData();
- KeStallExecutionProcessor(250);
- if (data == 0x55aa)
- bit = 0x01;
- checksum = ((((checksum ^ (checksum >> 1)) & 0x01) ^ bit) << 7) | (checksum >> 1);
- bit = 0x00;
- }
- for (i = 65; i <= 72; i++) {
- data = ReadData() << 8;
- KeStallExecutionProcessor(250);
- data = data | ReadData();
- KeStallExecutionProcessor(250);
- if (data == 0x55aa)
- chksum |= (1 << (i - 65));
- }
- if ((checksum != 0x00) && (checksum == chksum)) {
- csn++;
-
- WriteUchar(0x06, (UCHAR) csn);
- KeStallExecutionProcessor(250);
- iteration++;
- SendWake(0x00);
- SetReadDataPort((ULONG_PTR)IsaPnPReadPort);
- KeStallExecutionProcessor(1000);
- WriteAddress(0x01);
- KeStallExecutionProcessor(1000);
- goto next;
- }
- if (iteration == 1) {
- if (!IsolateReadDataPortSelect()) {
- DPRINT("Could not set read data port\n");
- return 0;
- }
- } else if (iteration > 1) {
- break;
- }
-next:
- checksum = 0x6a;
- chksum = 0x00;
- bit = 0x00;
- }
- SendWait();
- return csn;
-}
-
-
-static VOID Peek(PUCHAR Data, ULONG Count)
-{
- ULONG i, j;
- UCHAR d = 0;
-
- for (i = 1; i <= Count; i++) {
- for (j = 0; j < 20; j++) {
- d = ReadUchar(0x05);
- if (d & 0x1)
- break;
- KeStallExecutionProcessor(100);
- }
- if (!(d & 0x1)) {
- if (Data != NULL)
- *Data++ = 0xff;
- continue;
- }
- d = ReadUchar(0x04); /* PRESDI */
- if (Data != NULL)
- *Data++ = d;
- }
-}
-
-
-/*
- * Skip specified number of bytes from stream
- */
-static VOID Skip(ULONG Count)
-{
- Peek(NULL, Count);
-}
-
-
-/*
- * Read one tag from stream
- */
-static BOOLEAN ReadTag(PUCHAR Type,
- PUSHORT Size,
- PBOOLEAN Small)
-{
- UCHAR tag, tmp[2];
-
- Peek(&tag, 1);
- if (tag == 0) {
- /* Invalid tag */
- DPRINT("Invalid tag with value 0\n");
-#ifndef NDEBUG
- for (;;);
-#endif
- return FALSE;
- }
-
- if (tag & ISAPNP_RESOURCE_ITEM_TYPE) {
- /* Large resource item */
- *Type = (tag & 0x7f);
- Peek(tmp, 2);
- *Size = UCHAR2USHORT(tmp[0], tmp[1]);
- *Small = FALSE;
-#ifndef NDEBUG
- if (*Type > ISAPNP_LRIN_FL_MEMORY_RANGE32) {
- DPRINT("Invalid large tag with value 0x%X\n", *Type);
- for (;;);
- }
-#endif
- } else {
- /* Small resource item */
- *Type = (tag >> 3) & 0x0f;
- *Size = tag & 0x07;
- *Small = TRUE;
-#ifndef NDEBUG
- if (*Type > ISAPNP_SRIN_END_TAG) {
- DPRINT("Invalid small tag with value 0x%X\n", *Type);
- for (;;);
- }
-#endif
- }
-#if 0
- DPRINT("Tag = 0x%X, Type = 0x%X, Size = %d (%s)\n",
- tag, *Type, *Size, TagName(*Type, *Small));
-#endif
- /* Probably invalid data */
- if ((*Type == 0xff) && (*Size == 0xffff)) {
- DPRINT("Invalid data (Type 0x%X Size 0x%X)\n", *Type, *Size);
- for (;;);
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * Parse ANSI name for ISA PnP logical device
- */
-static NTSTATUS ParseAnsiName(PUNICODE_STRING Name, PUSHORT Size)
-{
- ANSI_STRING AnsiString;
- UCHAR Buffer[256];
- USHORT size1;
-
- size1 = (*Size >= sizeof(Buffer)) ? (sizeof(Buffer) - 1) : *Size;
-
- Peek(Buffer, size1);
- Buffer[size1] = '\0';
- *Size -= size1;
-
- /* Clean whitespace from end of string */
- while ((size1 > 0) && (Buffer[--size1] == ' '))
- Buffer[size1] = '\0';
-
- DPRINT("ANSI name: %s\n", Buffer);
-
- RtlInitAnsiString(&AnsiString, (PCSZ)&Buffer);
- return RtlAnsiStringToUnicodeString(Name, &AnsiString, TRUE);
-}
-
-
-/*
- * Add a resource list to the
- * resource lists of a logical device
- */
-static NTSTATUS AddResourceList(
- PISAPNP_LOGICAL_DEVICE LogicalDevice,
- ULONG Priority,
- PISAPNP_CONFIGURATION_LIST *NewList)
-{
- PISAPNP_CONFIGURATION_LIST List;
-
- DPRINT("Adding resource list for logical device %d on card %d (Priority %d)\n",
- LogicalDevice->Number,
- LogicalDevice->Card->CardId,
- Priority);
-
- List = (PISAPNP_CONFIGURATION_LIST)
- ExAllocatePoolWithTag(PagedPool, sizeof(ISAPNP_CONFIGURATION_LIST), TAG_ISAPNP);
- if (!List)
- return STATUS_INSUFFICIENT_RESOURCES;
-
- RtlZeroMemory(List, sizeof(ISAPNP_CONFIGURATION_LIST));
-
- List->Priority = Priority;
-
- InitializeListHead(&List->ListHead);
-
- InsertTailList(&LogicalDevice->Configuration, &List->ListEntry);
-
- *NewList = List;
-
- return STATUS_SUCCESS;
-}
-
-
-/*
- * Add a resource entry to the
- * resource list of a logical device
- */
-static NTSTATUS AddResourceDescriptor(
- PISAPNP_LOGICAL_DEVICE LogicalDevice,
- ULONG Priority,
- ULONG Option,
- PISAPNP_DESCRIPTOR *Descriptor)
-{
- PLIST_ENTRY CurrentEntry;
- PISAPNP_CONFIGURATION_LIST List;
- PISAPNP_DESCRIPTOR d;
- NTSTATUS Status;
-
- DPRINT("Adding resource descriptor for logical device %d on card %d (%d of %d)\n",
- LogicalDevice->Number,
- LogicalDevice->Card->CardId,
- LogicalDevice->CurrentDescriptorCount,
- LogicalDevice->DescriptorCount);
-
- d = (PISAPNP_DESCRIPTOR)
- ExAllocatePoolWithTag(PagedPool, sizeof(ISAPNP_DESCRIPTOR), TAG_ISAPNP);
- if (!d)
- return STATUS_NO_MEMORY;
-
- RtlZeroMemory(d, sizeof(ISAPNP_DESCRIPTOR));
-
- d->Descriptor.Option = (UCHAR) Option;
-
- *Descriptor = d;
-
- CurrentEntry = LogicalDevice->Configuration.Flink;
- while (CurrentEntry != &LogicalDevice->Configuration) {
- List = CONTAINING_RECORD(
- CurrentEntry, ISAPNP_CONFIGURATION_LIST, ListEntry);
-
- if (List->Priority == Priority) {
-
- LogicalDevice->ConfigurationSize += sizeof(IO_RESOURCE_DESCRIPTOR);
- InsertTailList(&List->ListHead, &d->ListEntry);
- LogicalDevice->CurrentDescriptorCount++;
- if (LogicalDevice->DescriptorCount <
- LogicalDevice->CurrentDescriptorCount) {
- LogicalDevice->DescriptorCount =
- LogicalDevice->CurrentDescriptorCount;
- }
-
- return STATUS_SUCCESS;
- }
- CurrentEntry = CurrentEntry->Flink;
- }
-
- Status = AddResourceList(LogicalDevice, Priority, &List);
- if (NT_SUCCESS(Status)) {
- LogicalDevice->ConfigurationSize += sizeof(IO_RESOURCE_LIST);
- LogicalDevice->CurrentDescriptorCount = 0;
- InsertTailList(&List->ListHead, &d->ListEntry);
- }
-
- return Status;
-}
-
-
-/*
- * Add IRQ resource to resources list
- */
-static NTSTATUS AddIrqResource(
- PISAPNP_LOGICAL_DEVICE LogicalDevice,
- ULONG Size,
- ULONG Priority,
- ULONG Option)
-{
- PISAPNP_DESCRIPTOR Descriptor;
- UCHAR tmp[3];
- ULONG irq, i, last = 0;
- BOOLEAN found;
- NTSTATUS Status;
-
- Peek(tmp, Size);
-
- irq = UCHAR2USHORT(tmp[0], tmp[0]);
-
- DPRINT("IRQ bitmask: 0x%X\n", irq);
-
- found = FALSE;
- for (i = 0; i < 16; i++) {
- if (!found && (irq & (1 << i))) {
- last = i;
- found = TRUE;
- }
-
- if ((found && !(irq & (1 << i))) || (irq & (1 << i) && (i == 15))) {
- Status = AddResourceDescriptor(LogicalDevice,
- Priority, Option, &Descriptor);
- if (!NT_SUCCESS(Status))
- return Status;
- Descriptor->Descriptor.Type = CmResourceTypeInterrupt;
- Descriptor->Descriptor.ShareDisposition = CmResourceShareDeviceExclusive;
- Descriptor->Descriptor.u.Interrupt.MinimumVector = last;
-
- if ((irq & (1 << i)) && (i == 15))
- Descriptor->Descriptor.u.Interrupt.MaximumVector = i;
- else
- Descriptor->Descriptor.u.Interrupt.MaximumVector = i - 1;
-
- DPRINT("Found IRQ range %d - %d for logical device %d on card %d\n",
- Descriptor->Descriptor.u.Interrupt.MinimumVector,
- Descriptor->Descriptor.u.Interrupt.MaximumVector,
- LogicalDevice->Number,
- LogicalDevice->Card->CardId);
-
- found = FALSE;
- }
- }
-
- return STATUS_SUCCESS;
-}
-
-/*
- * Add DMA resource to resources list
- */
-static NTSTATUS AddDmaResource(
- PISAPNP_LOGICAL_DEVICE LogicalDevice,
- ULONG Size,
- ULONG Priority,
- ULONG Option)
-{
- PISAPNP_DESCRIPTOR Descriptor;
- UCHAR tmp[2];
- ULONG dma, flags, i, last = 0;
- BOOLEAN found;
- NTSTATUS Status;
-
- Peek(tmp, Size);
-
- dma = tmp[0];
- flags = tmp[1];
-
- DPRINT("DMA bitmask: 0x%X\n", dma);
-
- found = FALSE;
- for (i = 0; i < 8; i++) {
- if (!found && (dma & (1 << i))) {
- last = i;
- found = TRUE;
- }
-
- if ((found && !(dma & (1 << i))) || (dma & (1 << i) && (i == 15))) {
- Status = AddResourceDescriptor(LogicalDevice,
- Priority, Option, &Descriptor);
- if (!NT_SUCCESS(Status))
- return Status;
- Descriptor->Descriptor.Type = CmResourceTypeDma;
- Descriptor->Descriptor.ShareDisposition = CmResourceShareDeviceExclusive;
- Descriptor->Descriptor.u.Dma.MinimumChannel = last;
-
- if ((dma & (1 << i)) && (i == 15))
- Descriptor->Descriptor.u.Dma.MaximumChannel = i;
- else
- Descriptor->Descriptor.u.Dma.MaximumChannel = i - 1;
-
- /* FIXME: Parse flags */
-
- DPRINT("Found DMA range %d - %d for logical device %d on card %d\n",
- Descriptor->Descriptor.u.Dma.MinimumChannel,
- Descriptor->Descriptor.u.Dma.MaximumChannel,
- LogicalDevice->Number,
- LogicalDevice->Card->CardId);
-
- found = FALSE;
- }
- }
-
- return STATUS_SUCCESS;
-}
-
-/*
- * Add port resource to resources list
- */
-static NTSTATUS AddIOPortResource(
- PISAPNP_LOGICAL_DEVICE LogicalDevice,
- ULONG Size,
- ULONG Priority,
- ULONG Option)
-{
-#if 0
- DPRINT("I/O port: size 0x%X\n", Size);
- Skip(Size);
-#else
- PISAPNP_DESCRIPTOR Descriptor;
- UCHAR tmp[7];
- NTSTATUS Status;
-
- Peek(tmp, Size);
-
- Status = AddResourceDescriptor(LogicalDevice,
- Priority, Option, &Descriptor);
- if (!NT_SUCCESS(Status))
- return Status;
- Descriptor->Descriptor.Type = CmResourceTypePort;
- Descriptor->Descriptor.ShareDisposition = CmResourceShareDeviceExclusive;
- Descriptor->Descriptor.u.Port.Length = tmp[6];
- /* FIXME: Parse flags */
- Descriptor->Descriptor.u.Port.Alignment = 0;
- Descriptor->Descriptor.u.Port.MinimumAddress.QuadPart = UCHAR2USHORT(tmp[1], tmp[2]);
- Descriptor->Descriptor.u.Port.MaximumAddress.QuadPart = UCHAR2USHORT(tmp[4], tmp[4]);
-
- DPRINT("Found I/O port range 0x%X - 0x%X for logical device %d on card %d\n",
- Descriptor->Descriptor.u.Port.MinimumAddress,
- Descriptor->Descriptor.u.Port.MaximumAddress,
- LogicalDevice->Number,
- LogicalDevice->Card->CardId);
-#endif
- return STATUS_SUCCESS;
-}
-
-/*
- * Add fixed port resource to resources list
- */
-static NTSTATUS AddFixedIOPortResource(
- PISAPNP_LOGICAL_DEVICE LogicalDevice,
- ULONG Size,
- ULONG Priority,
- ULONG Option)
-{
-#if 0
- DPRINT("Fixed I/O port: size 0x%X\n", Size);
- Skip(Size);
-#else
- PISAPNP_DESCRIPTOR Descriptor;
- UCHAR tmp[3];
- NTSTATUS Status;
-
- Peek(tmp, Size);
-
- Status = AddResourceDescriptor(LogicalDevice,
- Priority, Option, &Descriptor);
- if (!NT_SUCCESS(Status))
- return Status;
- Descriptor->Descriptor.Type = CmResourceTypePort;
- Descriptor->Descriptor.ShareDisposition = CmResourceShareDeviceExclusive;
- Descriptor->Descriptor.u.Port.Length = tmp[2];
- Descriptor->Descriptor.u.Port.Alignment = 0;
- Descriptor->Descriptor.u.Port.MinimumAddress.QuadPart = UCHAR2USHORT(tmp[0], tmp[1]);
- Descriptor->Descriptor.u.Port.MaximumAddress.QuadPart = UCHAR2USHORT(tmp[0], tmp[1]);
-
- DPRINT("Found fixed I/O port range 0x%X - 0x%X for logical device %d on card %d\n",
- Descriptor->Descriptor.u.Port.MinimumAddress,
- Descriptor->Descriptor.u.Port.MaximumAddress,
- LogicalDevice->Number,
- LogicalDevice->Card->CardId);
-#endif
- return STATUS_SUCCESS;
-}
-
-/*
- * Add memory resource to resources list
- */
-static NTSTATUS AddMemoryResource(
- PISAPNP_LOGICAL_DEVICE LogicalDevice,
- ULONG Size,
- ULONG Priority,
- ULONG Option)
-{
-#if 0
- DPRINT("Memory range: size 0x%X\n", Size);
- Skip(Size);
-#else
- PISAPNP_DESCRIPTOR Descriptor;
- UCHAR tmp[9];
- NTSTATUS Status;
-
- Peek(tmp, Size);
-
- Status = AddResourceDescriptor(LogicalDevice,
- Priority, Option, &Descriptor);
- if (!NT_SUCCESS(Status))
- return Status;
- Descriptor->Descriptor.Type = CmResourceTypeMemory;
- Descriptor->Descriptor.ShareDisposition = CmResourceShareDeviceExclusive;
- Descriptor->Descriptor.u.Memory.Length = UCHAR2USHORT(tmp[7], tmp[8]) << 8;
- Descriptor->Descriptor.u.Memory.Alignment = UCHAR2USHORT(tmp[5], tmp[6]);
- Descriptor->Descriptor.u.Memory.MinimumAddress.QuadPart = UCHAR2USHORT(tmp[1], tmp[2]) << 8;
- Descriptor->Descriptor.u.Memory.MaximumAddress.QuadPart = UCHAR2USHORT(tmp[3], tmp[4]) << 8;
-
- DPRINT("Found memory range 0x%X - 0x%X for logical device %d on card %d\n",
- Descriptor->Descriptor.u.Memory.MinimumAddress,
- Descriptor->Descriptor.u.Memory.MaximumAddress,
- LogicalDevice->Number,
- LogicalDevice->Card->CardId);
-#endif
- return STATUS_SUCCESS;
-}
-
-/*
- * Add 32-bit memory resource to resources list
- */
-static NTSTATUS AddMemory32Resource(
- PISAPNP_LOGICAL_DEVICE LogicalDevice,
- ULONG Size,
- ULONG Priority,
- ULONG Option)
-{
-#if 0
- DPRINT("Memory32 range: size 0x%X\n", Size);
- Skip(Size);
-#else
- PISAPNP_DESCRIPTOR Descriptor;
- UCHAR tmp[17];
- NTSTATUS Status;
-
- Peek(tmp, Size);
-
- Status = AddResourceDescriptor(LogicalDevice,
- Priority, Option, &Descriptor);
- if (!NT_SUCCESS(Status))
- return Status;
- Descriptor->Descriptor.Type = CmResourceTypeMemory;
- Descriptor->Descriptor.ShareDisposition = CmResourceShareDeviceExclusive;
- Descriptor->Descriptor.u.Memory.Length =
- UCHAR2ULONG(tmp[13], tmp[14], tmp[15], tmp[16]);
- Descriptor->Descriptor.u.Memory.Alignment =
- UCHAR2ULONG(tmp[9], tmp[10], tmp[11], tmp[12]);
- Descriptor->Descriptor.u.Memory.MinimumAddress.QuadPart =
- UCHAR2ULONG(tmp[1], tmp[2], tmp[3], tmp[4]);
- Descriptor->Descriptor.u.Memory.MaximumAddress.QuadPart =
- UCHAR2ULONG(tmp[5], tmp[6], tmp[7], tmp[8]);
-
- DPRINT("Found memory32 range 0x%X - 0x%X for logical device %d on card %d\n",
- Descriptor->Descriptor.u.Memory.MinimumAddress,
- Descriptor->Descriptor.u.Memory.MaximumAddress,
- LogicalDevice->Number,
- LogicalDevice->Card->CardId);
-#endif
- return STATUS_SUCCESS;
-}
-
-/*
- * Add 32-bit fixed memory resource to resources list
- */
-static NTSTATUS AddFixedMemory32Resource(
- PISAPNP_LOGICAL_DEVICE LogicalDevice,
- ULONG Size,
- ULONG Priority,
- ULONG Option)
-{
-#if 0
- DPRINT("Memory32 range: size 0x%X\n", Size);
- Skip(Size);
-#else
- PISAPNP_DESCRIPTOR Descriptor;
- UCHAR tmp[17];
- NTSTATUS Status;
-
- Peek(tmp, Size);
-
- Status = AddResourceDescriptor(LogicalDevice,
- Priority, Option, &Descriptor);
- if (!NT_SUCCESS(Status))
- return Status;
- Descriptor->Descriptor.Type = CmResourceTypeMemory;
- Descriptor->Descriptor.ShareDisposition = CmResourceShareDeviceExclusive;
- Descriptor->Descriptor.u.Memory.Length =
- UCHAR2ULONG(tmp[9], tmp[10], tmp[11], tmp[12]);
- Descriptor->Descriptor.u.Memory.Alignment =
- UCHAR2ULONG(tmp[5], tmp[6], tmp[7], tmp[8]);
- Descriptor->Descriptor.u.Memory.MinimumAddress.QuadPart =
- UCHAR2ULONG(tmp[1], tmp[2], tmp[3], tmp[4]);
- Descriptor->Descriptor.u.Memory.MaximumAddress.QuadPart =
- UCHAR2ULONG(tmp[1], tmp[2], tmp[3], tmp[4]);
-
- DPRINT("Found fixed memory32 range 0x%X - 0x%X for logical device %d on card %d\n",
- Descriptor->Descriptor.u.Memory.MinimumAddress,
- Descriptor->Descriptor.u.Memory.MaximumAddress,
- LogicalDevice->Number,
- LogicalDevice->Card->CardId);
-#endif
- return STATUS_SUCCESS;
-}
-
-
-/*
- * Parse logical device tag
- */
-static PISAPNP_LOGICAL_DEVICE ParseLogicalDevice(
- PISAPNP_DEVICE_EXTENSION DeviceExtension,
- PISAPNP_CARD Card,
- ULONG Size,
- USHORT Number)
-{
- UCHAR tmp[6];
- PISAPNP_LOGICAL_DEVICE LogicalDevice;
-
- DPRINT("Card %d Number %d\n", Card->CardId, Number);
-
- Peek(tmp, Size);
-
- LogicalDevice = (PISAPNP_LOGICAL_DEVICE)ExAllocatePoolWithTag(
- PagedPool, sizeof(ISAPNP_LOGICAL_DEVICE), TAG_ISAPNP);
- if (!LogicalDevice)
- return NULL;
-
- RtlZeroMemory(LogicalDevice, sizeof(ISAPNP_LOGICAL_DEVICE));
-
- LogicalDevice->Number = Number;
- LogicalDevice->VendorId = UCHAR2USHORT(tmp[0], tmp[1]);
- LogicalDevice->DeviceId = UCHAR2USHORT(tmp[2], tmp[3]);
- LogicalDevice->Regs = tmp[4];
- LogicalDevice->Card = Card;
- if (Size > 5)
- LogicalDevice->Regs |= tmp[5] << 8;
-
- InitializeListHead(&LogicalDevice->Configuration);
-
- ExInterlockedInsertTailList(&Card->LogicalDevices,
- &LogicalDevice->CardListEntry,
- &Card->LogicalDevicesLock);
-
- ExInterlockedInsertTailList(&DeviceExtension->DeviceListHead,
- &LogicalDevice->DeviceListEntry,
- &DeviceExtension->GlobalListLock);
-
- DeviceExtension->DeviceListCount++;
-
- return LogicalDevice;
-}
-
-
-/*
- * Parse resource map for logical device
- */
-static BOOLEAN CreateLogicalDevice(PISAPNP_DEVICE_EXTENSION DeviceExtension,
- PISAPNP_CARD Card, USHORT Size)
-{
- ULONG number = 0, skip = 0, compat = 0;
- UCHAR type, tmp[17];
- PISAPNP_LOGICAL_DEVICE LogicalDevice;
- BOOLEAN Small;
- ULONG Priority = 0;
- ULONG Option = IO_RESOURCE_REQUIRED;
-
- DPRINT("Card %d Size %d\n", Card->CardId, Size);
-
- LogicalDevice = ParseLogicalDevice(DeviceExtension, Card, Size, (USHORT) number++);
- if (!LogicalDevice)
- return FALSE;
-
- while (TRUE) {
- if (!ReadTag(&type, &Size, &Small))
- return FALSE;
-
- if (skip && !(Small && ((type == ISAPNP_SRIN_LDEVICE_ID)
- || (type == ISAPNP_SRIN_END_TAG))))
- goto skip;
-
- if (Small) {
- switch (type) {
- case ISAPNP_SRIN_LDEVICE_ID:
- if ((Size >= 5) && (Size <= 6)) {
- LogicalDevice = ParseLogicalDevice(
- DeviceExtension, Card, Size, (USHORT)number++);
- if (!LogicalDevice)
- return FALSE;
- Size = 0;
- skip = 0;
- } else {
- skip = 1;
- }
- Priority = 0;
- Option = IO_RESOURCE_REQUIRED;
- compat = 0;
- break;
-
- case ISAPNP_SRIN_CDEVICE_ID:
- if ((Size == 4) && (compat < MAX_COMPATIBLE_ID)) {
- Peek(tmp, 4);
- LogicalDevice->CVendorId[compat] = UCHAR2USHORT(tmp[0], tmp[1]);
- LogicalDevice->CDeviceId[compat] = UCHAR2USHORT(tmp[2], tmp[3]);
- compat++;
- Size = 0;
- }
- break;
-
- case ISAPNP_SRIN_IRQ_FORMAT:
- if ((Size < 2) || (Size > 3))
- goto skip;
- AddIrqResource(LogicalDevice, Size, Priority, Option);
- Size = 0;
- break;
-
- case ISAPNP_SRIN_DMA_FORMAT:
- if (Size != 2)
- goto skip;
- AddDmaResource(LogicalDevice, Size, Priority, Option);
- Size = 0;
- break;
-
- case ISAPNP_SRIN_START_DFUNCTION:
- if (Size > 1)
- goto skip;
-
- if (Size > 0) {
- Peek(tmp, Size);
- Priority = tmp[0];
- Size = 0;
- /* FIXME: Maybe use IO_RESOURCE_PREFERRED for some */
- Option = IO_RESOURCE_ALTERNATIVE;
- } else {
- Priority = 0;
- Option = IO_RESOURCE_ALTERNATIVE;
- }
-
- DPRINT(" Start priority %d \n", Priority);
-
- LogicalDevice->CurrentDescriptorCount = 0;
-
- break;
-
- case ISAPNP_SRIN_END_DFUNCTION:
-
- DPRINT(" End priority %d \n", Priority);
-
- if (Size != 0)
- goto skip;
- Priority = 0;
- Option = IO_RESOURCE_REQUIRED;
- LogicalDevice->CurrentDescriptorCount = 0;
- break;
-
- case ISAPNP_SRIN_IO_DESCRIPTOR:
- if (Size != 7)
- goto skip;
- AddIOPortResource(LogicalDevice, Size, Priority, Option);
- Size = 0;
- break;
-
- case ISAPNP_SRIN_FL_IO_DESCRIPOTOR:
- if (Size != 3)
- goto skip;
- AddFixedIOPortResource(LogicalDevice, Size, Priority, Option);
- Size = 0;
- break;
-
- case ISAPNP_SRIN_VENDOR_DEFINED:
- break;
-
- case ISAPNP_SRIN_END_TAG:
- if (Size > 0)
- Skip(Size);
- return FALSE;
-
- default:
- DPRINT("Ignoring small tag of type 0x%X for logical device %d on card %d\n",
- type, LogicalDevice->Number, Card->CardId);
- }
- } else {
- switch (type) {
- case ISAPNP_LRIN_MEMORY_RANGE:
- if (Size != 9)
- goto skip;
- AddMemoryResource(LogicalDevice, Size, Priority, Option);
- Size = 0;
- break;
-
- case ISAPNP_LRIN_ID_STRING_ANSI:
- ParseAnsiName(&LogicalDevice->Name, &Size);
- break;
-
- case ISAPNP_LRIN_ID_STRING_UNICODE:
- break;
-
- case ISAPNP_LRIN_VENDOR_DEFINED:
- break;
-
- case ISAPNP_LRIN_MEMORY_RANGE32:
- if (Size != 17)
- goto skip;
- AddMemory32Resource(LogicalDevice, Size, Priority, Option);
- Size = 0;
- break;
-
- case ISAPNP_LRIN_FL_MEMORY_RANGE32:
- if (Size != 17)
- goto skip;
- AddFixedMemory32Resource(LogicalDevice, Size, Priority, Option);
- Size = 0;
- break;
-
- default:
- DPRINT("Ignoring large tag of type 0x%X for logical device %d on card %d\n",
- type, LogicalDevice->Number, Card->CardId);
- }
- }
-skip:
- if (Size > 0)
- Skip(Size);
- }
-
- return TRUE;
-}
-
-
-/*
- * Parse resource map for ISA PnP card
- */
-static BOOLEAN ParseResourceMap(PISAPNP_DEVICE_EXTENSION DeviceExtension,
- PISAPNP_CARD Card)
-{
- UCHAR type, tmp[17];
- USHORT size;
- BOOLEAN Small;
-
- DPRINT("Card %d\n", Card->CardId);
-
- while (TRUE) {
- if (!ReadTag(&type, &size, &Small))
- return FALSE;
-
- if (Small) {
- switch (type) {
- case ISAPNP_SRIN_VERSION:
- if (size != 2)
- goto skip;
- Peek(tmp, 2);
- Card->PNPVersion = tmp[0];
- Card->ProductVersion = tmp[1];
- size = 0;
- break;
-
- case ISAPNP_SRIN_LDEVICE_ID:
- if ((size >= 5) && (size <= 6)) {
- if (!CreateLogicalDevice(DeviceExtension, Card, size))
- return FALSE;
- size = 0;
- }
- break;
-
- case ISAPNP_SRIN_CDEVICE_ID:
- /* FIXME: Parse compatible IDs */
- break;
-
- case ISAPNP_SRIN_END_TAG:
- if (size > 0)
- Skip(size);
- return TRUE;
-
- default:
- DPRINT("Ignoring small tag Type 0x%X for Card %d\n", type, Card->CardId);
- }
- } else {
- switch (type) {
- case ISAPNP_LRIN_ID_STRING_ANSI:
- ParseAnsiName(&Card->Name, &size);
- break;
-
- default:
- DPRINT("Ignoring large tag Type 0x%X for Card %d\n",
- type, Card->CardId);
- }
- }
-skip:
- if (size > 0)
- Skip(size);
- }
-
- return TRUE;
-}
-
-
-/*
- * Compute ISA PnP checksum for first eight bytes
- */
-static UCHAR Checksum(PUCHAR data)
-{
- ULONG i, j;
- UCHAR checksum = 0x6a, bit, b;
-
- for (i = 0; i < 8; i++) {
- b = data[i];
- for (j = 0; j < 8; j++) {
- bit = 0;
- if (b & (1 << j))
- bit = 1;
- checksum = ((((checksum ^ (checksum >> 1)) &
- 0x01) ^ bit) << 7) | (checksum >> 1);
- }
- }
- return checksum;
-}
-
-
-/*
- * Build a resource list for a logical ISA PnP device
- */
-static NTSTATUS BuildResourceList(PISAPNP_LOGICAL_DEVICE LogicalDevice,
- PIO_RESOURCE_LIST DestinationList,
- ULONG Priority)
-{
- PLIST_ENTRY CurrentEntry, Entry;
- PISAPNP_CONFIGURATION_LIST List;
- PISAPNP_DESCRIPTOR Descriptor;
- ULONG i;
-
- if (IsListEmpty(&LogicalDevice->Configuration))
- return STATUS_NOT_FOUND;
-
- CurrentEntry = LogicalDevice->Configuration.Flink;
- while (CurrentEntry != &LogicalDevice->Configuration) {
- List = CONTAINING_RECORD(
- CurrentEntry, ISAPNP_CONFIGURATION_LIST, ListEntry);
-
- if (List->Priority == Priority) {
-
- DPRINT("Logical device %d DestinationList %p\n",
- LogicalDevice->Number,
- DestinationList);
-
- DestinationList->Version = 1;
- DestinationList->Revision = 1;
- DestinationList->Count = LogicalDevice->DescriptorCount;
-
- i = 0;
- Entry = List->ListHead.Flink;
- while (Entry != &List->ListHead) {
- Descriptor = CONTAINING_RECORD(
- Entry, ISAPNP_DESCRIPTOR, ListEntry);
-
- DPRINT("Logical device %d Destination %p(%d)\n",
- LogicalDevice->Number,
- &DestinationList->Descriptors[i],
- i);
-
- RtlCopyMemory(&DestinationList->Descriptors[i],
- &Descriptor->Descriptor,
- sizeof(IO_RESOURCE_DESCRIPTOR));
-
- i++;
-
- Entry = Entry->Flink;
- }
-
- RemoveEntryList(&List->ListEntry);
-
- ExFreePool(List);
-
- return STATUS_SUCCESS;
- }
-
- CurrentEntry = CurrentEntry->Flink;
- }
-
- return STATUS_UNSUCCESSFUL;
-}
-
-
-/*
- * Build resource lists for a logical ISA PnP device
- */
-static NTSTATUS BuildResourceLists(PISAPNP_LOGICAL_DEVICE LogicalDevice)
-{
- ULONG ListSize;
- ULONG Priority;
- ULONG SingleListSize;
- PIO_RESOURCE_LIST p;
- NTSTATUS Status;
-
- ListSize = sizeof(IO_RESOURCE_REQUIREMENTS_LIST)
- - sizeof(IO_RESOURCE_LIST)
- + LogicalDevice->ConfigurationSize;
-
- DPRINT("Logical device %d ListSize 0x%X ConfigurationSize 0x%X DescriptorCount %d\n",
- LogicalDevice->Number, ListSize,
- LogicalDevice->ConfigurationSize,
- LogicalDevice->DescriptorCount);
-
- LogicalDevice->ResourceLists =
- (PIO_RESOURCE_REQUIREMENTS_LIST)ExAllocatePoolWithTag(
- PagedPool, ListSize, TAG_ISAPNP);
- if (!LogicalDevice->ResourceLists)
- return STATUS_INSUFFICIENT_RESOURCES;
-
- RtlZeroMemory(LogicalDevice->ResourceLists, ListSize);
-
- SingleListSize = sizeof(IO_RESOURCE_LIST) +
- (LogicalDevice->DescriptorCount - 1) *
- sizeof(IO_RESOURCE_DESCRIPTOR);
-
- DPRINT("SingleListSize %d\n", SingleListSize);
-
- Priority = 0;
- p = &LogicalDevice->ResourceLists->List[0];
- do {
- Status = BuildResourceList(LogicalDevice, p, Priority);
- if (NT_SUCCESS(Status)) {
- p = (PIO_RESOURCE_LIST)((ULONG_PTR)p + SingleListSize);
- Priority++;
- }
- } while (Status != STATUS_NOT_FOUND);
-
- LogicalDevice->ResourceLists->ListSize = ListSize;
- LogicalDevice->ResourceLists->AlternativeLists = Priority + 1;
-
- return STATUS_SUCCESS;
-}
-
-
-/*
- * Build resource lists for a ISA PnP card
- */
-static NTSTATUS BuildResourceListsForCard(PISAPNP_CARD Card)
-{
- PISAPNP_LOGICAL_DEVICE LogicalDevice;
- PLIST_ENTRY CurrentEntry;
- NTSTATUS Status;
-
- CurrentEntry = Card->LogicalDevices.Flink;
- while (CurrentEntry != &Card->LogicalDevices) {
- LogicalDevice = CONTAINING_RECORD(
- CurrentEntry, ISAPNP_LOGICAL_DEVICE, CardListEntry);
- Status = BuildResourceLists(LogicalDevice);
- if (!NT_SUCCESS(Status))
- return Status;
- CurrentEntry = CurrentEntry->Flink;
- }
-
- return STATUS_SUCCESS;
-}
-
-
-/*
- * Build resource lists for all present ISA PnP cards
- */
-static NTSTATUS BuildResourceListsForAll(
- PISAPNP_DEVICE_EXTENSION DeviceExtension)
-{
- PLIST_ENTRY CurrentEntry;
- PISAPNP_CARD Card;
- NTSTATUS Status;
-
- CurrentEntry = DeviceExtension->CardListHead.Flink;
- while (CurrentEntry != &DeviceExtension->CardListHead) {
- Card = CONTAINING_RECORD(
- CurrentEntry, ISAPNP_CARD, ListEntry);
- Status = BuildResourceListsForCard(Card);
- if (!NT_SUCCESS(Status))
- return Status;
- CurrentEntry = CurrentEntry->Flink;
- }
-
- return STATUS_SUCCESS;
-}
-
-
-/*
- * Build device list for all present ISA PnP cards
- */
-static NTSTATUS BuildDeviceList(PISAPNP_DEVICE_EXTENSION DeviceExtension)
-{
- ULONG csn;
- UCHAR header[9], checksum;
- PISAPNP_CARD Card;
-
- DPRINT("Called\n");
-
- SendWait();
- SendKey();
- for (csn = 1; csn <= 10; csn++) {
- SendWake((UCHAR)csn);
- Peek(header, 9);
- checksum = Checksum(header);
-
- if (checksum == 0x00 || checksum != header[8]) /* Invalid CSN */
- continue;
-
- DPRINT("VENDOR: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
- header[0], header[1], header[2], header[3],
- header[4], header[5], header[6], header[7], header[8]);
-
- Card = (PISAPNP_CARD)ExAllocatePoolWithTag(
- PagedPool, sizeof(ISAPNP_CARD), TAG_ISAPNP);
- if (!Card)
- return STATUS_INSUFFICIENT_RESOURCES;
-
- RtlZeroMemory(Card, sizeof(ISAPNP_CARD));
-
- Card->CardId = (USHORT) csn;
- Card->VendorId = (header[1] << 8) | header[0];
- Card->DeviceId = (header[3] << 8) | header[2];
- Card->Serial = (header[7] << 24) | (header[6] << 16) | (header[5] << 8) | header[4];
-
- InitializeListHead(&Card->LogicalDevices);
- KeInitializeSpinLock(&Card->LogicalDevicesLock);
-
- ParseResourceMap(DeviceExtension, Card);
-
- ExInterlockedInsertTailList(&DeviceExtension->CardListHead,
- &Card->ListEntry,
- &DeviceExtension->GlobalListLock);
- }
-
- return STATUS_SUCCESS;
-}
-
-
-static NTSTATUS
-ISAPNPQueryBusRelations(
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp,
- PIO_STACK_LOCATION IrpSp)
-{
- PISAPNP_DEVICE_EXTENSION DeviceExtension;
- PISAPNP_LOGICAL_DEVICE LogicalDevice;
- PDEVICE_RELATIONS Relations;
- PLIST_ENTRY CurrentEntry;
- NTSTATUS Status = STATUS_SUCCESS;
- ULONG Size;
- ULONG i;
-
- DPRINT("Called\n");
-
- DeviceExtension = (PISAPNP_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
-
- if (Irp->IoStatus.Information) {
- /* FIXME: Another bus driver has already created a DEVICE_RELATIONS
- structure so we must merge this structure with our own */
- }
-
- Size = sizeof(DEVICE_RELATIONS) + sizeof(Relations->Objects) *
- (DeviceExtension->DeviceListCount - 1);
- Relations = (PDEVICE_RELATIONS)ExAllocatePoolWithTag(PagedPool, Size, TAG_ISAPNP);
- if (!Relations)
- return STATUS_INSUFFICIENT_RESOURCES;
-
- Relations->Count = DeviceExtension->DeviceListCount;
-
- i = 0;
- CurrentEntry = DeviceExtension->DeviceListHead.Flink;
- while (CurrentEntry != &DeviceExtension->DeviceListHead) {
- LogicalDevice = CONTAINING_RECORD(
- CurrentEntry, ISAPNP_LOGICAL_DEVICE, DeviceListEntry);
-
- if (!LogicalDevice->Pdo) {
- /* Create a physical device object for the
- device as it does not already have one */
- Status = IoCreateDevice(DeviceObject->DriverObject, 0,
- NULL, FILE_DEVICE_CONTROLLER, 0, FALSE, &LogicalDevice->Pdo);
- if (!NT_SUCCESS(Status)) {
- DPRINT("IoCreateDevice() failed with status 0x%X\n", Status);
- ExFreePool(Relations);
- return Status;
- }
-
- LogicalDevice->Pdo->Flags |= DO_BUS_ENUMERATED_DEVICE;
- }
-
- /* Reference the physical device object. The PnP manager
- will dereference it again when it is no longer needed */
- ObReferenceObject(LogicalDevice->Pdo);
-
- Relations->Objects[i] = LogicalDevice->Pdo;
-
- i++;
-
- CurrentEntry = CurrentEntry->Flink;
- }
-
- Irp->IoStatus.Information = (ULONG_PTR)Relations;
-
- return Status;
-}
-
-
-static NTSTATUS
-ISAPNPQueryDeviceRelations(
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp,
- PIO_STACK_LOCATION IrpSp)
-{
- PISAPNP_DEVICE_EXTENSION DeviceExtension;
- NTSTATUS Status;
-
- DPRINT("Called\n");
-
- DeviceExtension = (PISAPNP_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
-
- if (DeviceExtension->State == dsStopped)
- return STATUS_UNSUCCESSFUL;
-
- switch (IrpSp->Parameters.QueryDeviceRelations.Type) {
- case BusRelations:
- Status = ISAPNPQueryBusRelations(DeviceObject, Irp, IrpSp);
- break;
-
- default:
- Status = STATUS_NOT_IMPLEMENTED;
- }
-
- return Status;
-}
-
-
-static NTSTATUS
-ISAPNPStartDevice(
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp,
- PIO_STACK_LOCATION IrpSp)
-{
- PISAPNP_DEVICE_EXTENSION DeviceExtension;
- NTSTATUS Status;
- ULONG NumCards;
-
- DPRINT("Called\n");
-
- DeviceExtension = (PISAPNP_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
-
- if (DeviceExtension->State == dsStarted)
- return STATUS_SUCCESS;
-
- NumCards = IsolatePnPCards();
-
- DPRINT("Number of ISA PnP cards found: %d\n", NumCards);
-
- Status = BuildDeviceList(DeviceExtension);
- if (!NT_SUCCESS(Status)) {
- DPRINT("BuildDeviceList() failed with status 0x%X\n", Status);
- return Status;
- }
-
- Status = BuildResourceListsForAll(DeviceExtension);
- if (!NT_SUCCESS(Status)) {
- DPRINT("BuildResourceListsForAll() failed with status 0x%X\n", Status);
- return Status;
- }
-
- DeviceExtension->State = dsStarted;
-
- return STATUS_SUCCESS;
-}
-
-
-static NTSTATUS
-ISAPNPStopDevice(
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp,
- PIO_STACK_LOCATION IrpSp)
-{
- PISAPNP_DEVICE_EXTENSION DeviceExtension;
-
- DPRINT("Called\n");
-
- DeviceExtension = (PISAPNP_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
-
- if (DeviceExtension->State != dsStopped) {
- /* FIXME: Stop device */
- DeviceExtension->State = dsStopped;
- }
-
- return STATUS_SUCCESS;
-}
-
-
-static DRIVER_DISPATCH ISAPNPDispatchOpenClose;
-static NTSTATUS
+static
+NTSTATUS
NTAPI
-ISAPNPDispatchOpenClose(
+ForwardIrpCompletion(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp,
+ IN PVOID Context)
+{
+ if (Irp->PendingReturned)
+ KeSetEvent((PKEVENT)Context, IO_NO_INCREMENT, FALSE);
+
+ return STATUS_MORE_PROCESSING_REQUIRED;
+}
+
+NTSTATUS
+NTAPI
+IsaForwardIrpSynchronous(
+ IN PISAPNP_FDO_EXTENSION FdoExt,
+ IN PIRP Irp)
+{
+ KEVENT Event;
+ NTSTATUS Status;
+
+ KeInitializeEvent(&Event, NotificationEvent, FALSE);
+ IoCopyCurrentIrpStackLocationToNext(Irp);
+
+ IoSetCompletionRoutine(Irp, ForwardIrpCompletion, &Event, TRUE, TRUE, TRUE);
+
+ Status = IoCallDriver(FdoExt->Ldo, Irp);
+ if (Status == STATUS_PENDING)
+ {
+ Status = KeWaitForSingleObject(&Event, Suspended, KernelMode, FALSE, NULL);
+ if (NT_SUCCESS(Status))
+ Status = Irp->IoStatus.Status;
+ }
+
+ return Status;
+}
+
+
+static
+NTSTATUS
+NTAPI
+IsaCreateClose(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
- DPRINT("Called\n");
-
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = FILE_OPENED;
+
+ DPRINT("%s(%p, %p)\n", __FUNCTION__, DeviceObject, Irp);
+
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_SUCCESS;
}
-static DRIVER_DISPATCH ISAPNPDispatchReadWrite;
-static NTSTATUS
+static
+NTSTATUS
NTAPI
-ISAPNPDispatchReadWrite(
- IN PDEVICE_OBJECT PhysicalDeviceObject,
+IsaIoctl(
+ IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
- DPRINT("Called\n");
+ PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp);
+ NTSTATUS Status;
- Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
- Irp->IoStatus.Information = 0;
+ DPRINT("%s(%p, %p)\n", __FUNCTION__, DeviceObject, Irp);
+
+ switch (IrpSp->Parameters.DeviceIoControl.IoControlCode)
+ {
+ default:
+ DPRINT1("Unknown ioctl code: %x\n", IrpSp->Parameters.DeviceIoControl.IoControlCode);
+ Status = STATUS_NOT_SUPPORTED;
+ break;
+ }
+
+ Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
- return STATUS_UNSUCCESSFUL;
+ return Status;
}
-static DRIVER_DISPATCH ISAPNPDispatchDeviceControl;
-static NTSTATUS
+static
+NTSTATUS
NTAPI
-ISAPNPDispatchDeviceControl(
+IsaReadWrite(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
- PIO_STACK_LOCATION IrpSp;
- NTSTATUS Status;
-
- DPRINT("Called\n");
+ DPRINT("%s(%p, %p)\n", __FUNCTION__, DeviceObject, Irp);
+ Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
Irp->IoStatus.Information = 0;
- IrpSp = IoGetCurrentIrpStackLocation(Irp);
- switch (IrpSp->Parameters.DeviceIoControl.IoControlCode) {
- default:
- DPRINT("Unknown IOCTL 0x%X\n", IrpSp->MinorFunction);
- Status = STATUS_NOT_IMPLEMENTED;
- break;
- }
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
- if (Status != STATUS_PENDING) {
- Irp->IoStatus.Status = Status;
- IoCompleteRequest(Irp, IO_NO_INCREMENT);
- }
-
- DPRINT("Leaving. Status 0x%X\n", Status);
-
- return Status;
+ return STATUS_NOT_SUPPORTED;
}
-static DRIVER_DISPATCH ISAPNPControl;
-static NTSTATUS
+static
+NTSTATUS
NTAPI
-ISAPNPControl(
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp)
-{
- PIO_STACK_LOCATION IrpSp;
- NTSTATUS Status;
-
- DPRINT("Called\n");
-
- IrpSp = IoGetCurrentIrpStackLocation(Irp);
- switch (IrpSp->MinorFunction) {
- case IRP_MN_QUERY_DEVICE_RELATIONS:
- Status = ISAPNPQueryDeviceRelations(DeviceObject, Irp, IrpSp);
- break;
-
- case IRP_MN_START_DEVICE:
- Status = ISAPNPStartDevice(DeviceObject, Irp, IrpSp);
- break;
-
- case IRP_MN_STOP_DEVICE:
- Status = ISAPNPStopDevice(DeviceObject, Irp, IrpSp);
- break;
-
- case IRP_MN_FILTER_RESOURCE_REQUIREMENTS:
- /* Nothing to do here */
- DPRINT("IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n");
- Status = Irp->IoStatus.Status;
- break;
-
- default:
- DPRINT("Unknown IOCTL 0x%X\n", IrpSp->MinorFunction);
- Status = STATUS_NOT_IMPLEMENTED;
- break;
- }
-
- if (Status != STATUS_PENDING) {
- Irp->IoStatus.Status = Status;
- IoCompleteRequest(Irp, IO_NO_INCREMENT);
- }
-
- DPRINT("Leaving. Status 0x%X\n", Status);
-
- return Status;
-}
-
-
-static NTSTATUS
-NTAPI
-ISAPNPAddDevice(
+IsaAddDevice(
IN PDRIVER_OBJECT DriverObject,
IN PDEVICE_OBJECT PhysicalDeviceObject)
{
- PISAPNP_DEVICE_EXTENSION DeviceExtension;
PDEVICE_OBJECT Fdo;
+ PISAPNP_FDO_EXTENSION FdoExt;
NTSTATUS Status;
- DPRINT("Called\n");
+ DPRINT("%s(%p, %p)\n", __FUNCTION__, DriverObject, PhysicalDeviceObject);
- Status = IoCreateDevice(DriverObject, sizeof(ISAPNP_DEVICE_EXTENSION),
- NULL, FILE_DEVICE_BUS_EXTENDER, FILE_DEVICE_SECURE_OPEN, TRUE, &Fdo);
- if (!NT_SUCCESS(Status)) {
- DPRINT("IoCreateDevice() failed with status 0x%X\n", Status);
- return Status;
+ Status = IoCreateDevice(DriverObject,
+ sizeof(*FdoExt),
+ NULL,
+ FILE_DEVICE_BUS_EXTENDER,
+ FILE_DEVICE_SECURE_OPEN,
+ TRUE,
+ &Fdo);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("Failed to create FDO (0x%x)\n", Status);
+ return Status;
}
- DeviceExtension = (PISAPNP_DEVICE_EXTENSION)Fdo->DeviceExtension;
+ FdoExt = Fdo->DeviceExtension;
+ RtlZeroMemory(FdoExt, sizeof(*FdoExt));
- DeviceExtension->Pdo = PhysicalDeviceObject;
+ FdoExt->Common.Self = Fdo;
+ FdoExt->Common.IsFdo = TRUE;
+ FdoExt->Common.State = dsStopped;
+ FdoExt->Pdo = PhysicalDeviceObject;
+ FdoExt->Ldo = IoAttachDeviceToDeviceStack(Fdo,
+ PhysicalDeviceObject);
- DeviceExtension->Ldo =
- IoAttachDeviceToDeviceStack(Fdo, PhysicalDeviceObject);
-
- InitializeListHead(&DeviceExtension->CardListHead);
- InitializeListHead(&DeviceExtension->DeviceListHead);
- DeviceExtension->DeviceListCount = 0;
- KeInitializeSpinLock(&DeviceExtension->GlobalListLock);
-
- DeviceExtension->State = dsStopped;
+ InitializeListHead(&FdoExt->DeviceListHead);
+ KeInitializeSpinLock(&FdoExt->Lock);
Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
- DPRINT("Done AddDevice\n");
-
return STATUS_SUCCESS;
}
+static
+NTSTATUS
+NTAPI
+IsaPnp(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp)
+{
+ PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp);
+ PISAPNP_COMMON_EXTENSION DevExt = DeviceObject->DeviceExtension;
+
+ DPRINT("%s(%p, %p)\n", __FUNCTION__, DeviceObject, Irp);
+
+ if (DevExt->IsFdo)
+ {
+ return IsaFdoPnp((PISAPNP_FDO_EXTENSION)DevExt,
+ Irp,
+ IrpSp);
+ }
+ else
+ {
+ return IsaPdoPnp((PISAPNP_LOGICAL_DEVICE)DevExt,
+ Irp,
+ IrpSp);
+ }
+}
NTSTATUS
NTAPI
@@ -1731,15 +185,15 @@ DriverEntry(
IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPath)
{
- DbgPrint("ISA Plug and Play Bus Driver\n");
+ DPRINT("%s(%p, %wZ)\n", __FUNCTION__, DriverObject, RegistryPath);
- DriverObject->MajorFunction[IRP_MJ_CREATE] = ISAPNPDispatchOpenClose;
- DriverObject->MajorFunction[IRP_MJ_CLOSE] = ISAPNPDispatchOpenClose;
- DriverObject->MajorFunction[IRP_MJ_READ] = ISAPNPDispatchReadWrite;
- DriverObject->MajorFunction[IRP_MJ_WRITE] = ISAPNPDispatchReadWrite;
- DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = ISAPNPDispatchDeviceControl;
- DriverObject->MajorFunction[IRP_MJ_PNP] = ISAPNPControl;
- DriverObject->DriverExtension->AddDevice = ISAPNPAddDevice;
+ DriverObject->MajorFunction[IRP_MJ_CREATE] = IsaCreateClose;
+ DriverObject->MajorFunction[IRP_MJ_CLOSE] = IsaCreateClose;
+ DriverObject->MajorFunction[IRP_MJ_READ] = IsaReadWrite;
+ DriverObject->MajorFunction[IRP_MJ_WRITE] = IsaReadWrite;
+ DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = IsaIoctl;
+ DriverObject->MajorFunction[IRP_MJ_PNP] = IsaPnp;
+ DriverObject->DriverExtension->AddDevice = IsaAddDevice;
return STATUS_SUCCESS;
}
diff --git a/reactos/drivers/bus/isapnp/isapnp.h b/reactos/drivers/bus/isapnp/isapnp.h
index 59697b9848e..85fcb7887f4 100644
--- a/reactos/drivers/bus/isapnp/isapnp.h
+++ b/reactos/drivers/bus/isapnp/isapnp.h
@@ -1,6 +1,6 @@
#pragma once
-#include
+#include
#ifdef __cplusplus
extern "C" {
@@ -8,331 +8,88 @@ extern "C" {
#define TAG_ISAPNP 'PNPI'
-#define IO_RESOURCE_REQUIRED 0x00 //ROS Extension
-
-#define ISAPNP_ADDRESS_PORT 0x0279 // ADDRESS (W)
-#define ISAPNP_WRITE_PORT 0x0A79 // WRITE_DATA (W)
-#define ISAPNP_MIN_READ_PORT 0x0203 // READ_DATA (R)
-#define ISAPNP_MAX_READ_PORT 0x03FF // READ_DATA (R)
-
-// Card control registers
-#define ISAPNP_CARD_READ_DATA_PORT 0x00 // Set READ_DATA port
-#define ISAPNP_CARD_ISOLATION 0x01 // Isolation
-#define ISAPNP_CARD_CONFIG_COTROL 0x02 // Configuration control
-#define ISAPNP_CARD_WAKECSN 0x03 // Wake[CSN]
-#define ISAPNP_CARD_RESOUCE_DATA 0x04 // Resource data port
-#define ISAPNP_CARD_STATUS 0x05 // Status port
-#define ISAPNP_CARD_CSN 0x06 // Card Select Number port
-#define ISAPNP_CARD_LOG_DEVICE_NUM 0x07 // Logical Device Number
-#define ISAPNP_CARD_RESERVED 0x08 // Card level reserved
-#define ISAPNP_CARD_VENDOR_DEFINED 0x20 // Vendor defined
-
-// Logical device control registers
-#define ISAPNP_CONTROL_ACTIVATE 0x30 // Activate logical device
-#define ISAPNP_CONTROL_IO_RANGE_CHECK 0x31 // I/O range conflict check
-#define ISAPNP_CONTROL_LDC_RESERVED 0x32 // Logical Device Control reserved
-#define ISAPNP_CONTROL_LDCV_RESERVED 0x38 // Logical Device Control Vendor reserved
-
-// Logical device configuration registers
-#define ISAPNP_CONFIG_MEMORY_BASE2 0x00 // Memory base address bits 23-16
-#define ISAPNP_CONFIG_MEMORY_BASE1 0x01 // Memory base address bits 15-8
-#define ISAPNP_CONFIG_MEMORY_CONTROL 0x02 // Memory control
-#define ISAPNP_CONFIG_MEMORY_LIMIT2 0x03 // Memory limit bits 23-16
-#define ISAPNP_CONFIG_MEMORY_LIMIT1 0x04 // Memory limit bits 15-8
-
-#define ISAPNP_CONFIG_MEMORY_DESC0 0x40 // Memory descriptor 0
-#define ISAPNP_CONFIG_MEMORY_DESC1 0x48 // Memory descriptor 1
-#define ISAPNP_CONFIG_MEMORY_DESC2 0x50 // Memory descriptor 2
-#define ISAPNP_CONFIG_MEMORY_DESC3 0x58 // Memory descriptor 3
-
-#define ISAPNP_CONFIG_MEMORY32_BASE3 0x00 // 32-bit memory base address bits 31-24
-#define ISAPNP_CONFIG_MEMORY32_BASE2 0x01 // 32-bit memory base address bits 23-16
-#define ISAPNP_CONFIG_MEMORY32_BASE1 0x01 // 32-bit memory base address bits 15-8
-#define ISAPNP_CONFIG_MEMORY32_CONTROL 0x02 // 32-bit memory control
-#define ISAPNP_CONFIG_MEMORY32_LIMIT3 0x03 // 32-bit memory limit bits 31-24
-#define ISAPNP_CONFIG_MEMORY32_LIMIT2 0x04 // 32-bit memory limit bits 23-16
-#define ISAPNP_CONFIG_MEMORY32_LIMIT1 0x05 // 32-bit memory limit bits 15-8
-
-#define ISAPNP_CONFIG_MEMORY32_DESC0 0x76 // 32-bit memory descriptor 0
-#define ISAPNP_CONFIG_MEMORY32_DESC1 0x80 // 32-bit memory descriptor 1
-#define ISAPNP_CONFIG_MEMORY32_DESC2 0x90 // 32-bit memory descriptor 2
-#define ISAPNP_CONFIG_MEMORY32_DESC3 0xA0 // 32-bit memory descriptor 3
-
-#define ISAPNP_CONFIG_IO_BASE1 0x00 // I/O port base address bits 15-8
-#define ISAPNP_CONFIG_IO_BASE0 0x01 // I/O port base address bits 7-0
-
-#define ISAPNP_CONFIG_IO_DESC0 0x60 // I/O port descriptor 0
-#define ISAPNP_CONFIG_IO_DESC1 0x62 // I/O port descriptor 1
-#define ISAPNP_CONFIG_IO_DESC2 0x64 // I/O port descriptor 2
-#define ISAPNP_CONFIG_IO_DESC3 0x66 // I/O port descriptor 3
-#define ISAPNP_CONFIG_IO_DESC4 0x68 // I/O port descriptor 4
-#define ISAPNP_CONFIG_IO_DESC5 0x6A // I/O port descriptor 5
-#define ISAPNP_CONFIG_IO_DESC6 0x6C // I/O port descriptor 6
-#define ISAPNP_CONFIG_IO_DESC7 0x6E // I/O port descriptor 7
-
-#define ISAPNP_CONFIG_IRQ_LEVEL0 0x70 // Interupt level for descriptor 0
-#define ISAPNP_CONFIG_IRQ_TYPE0 0x71 // Type level for descriptor 0
-#define ISAPNP_CONFIG_IRQ_LEVEL1 0x72 // Interupt level for descriptor 1
-#define ISAPNP_CONFIG_IRQ_TYPE1 0x73 // Type level for descriptor 1
-
-#define ISAPNP_CONFIG_DMA_CHANNEL0 0x74 // DMA channel for descriptor 0
-#define ISAPNP_CONFIG_DMA_CHANNEL1 0x75 // DMA channel for descriptor 1
-
-
-typedef struct _PNPISA_SERIAL_ID
-{
- UCHAR VendorId[4]; // Vendor Identifier
- UCHAR SerialId[4]; // Serial number
- UCHAR Checksum; // Checksum
-} PNPISA_SERIAL_ID, *PPNPISA_SERIAL_ID;
-
-
-#define ISAPNP_RES_PRIORITY_PREFERRED 0
-#define ISAPNP_RES_PRIORITY_ACCEPTABLE 1
-#define ISAPNP_RES_PRIORITY_FUNCTIONAL 2
-#define ISAPNP_RES_PRIORITY_INVALID 65535
-
-
-#define ISAPNP_RESOURCE_ITEM_TYPE 0x80 // 0 = small, 1 = large
-
-// Small Resource Item Names (SRINs)
-#define ISAPNP_SRIN_VERSION 0x1 // PnP version number
-#define ISAPNP_SRIN_LDEVICE_ID 0x2 // Logical device id
-#define ISAPNP_SRIN_CDEVICE_ID 0x3 // Compatible device id
-#define ISAPNP_SRIN_IRQ_FORMAT 0x4 // IRQ format
-#define ISAPNP_SRIN_DMA_FORMAT 0x5 // DMA format
-#define ISAPNP_SRIN_START_DFUNCTION 0x6 // Start dependant function
-#define ISAPNP_SRIN_END_DFUNCTION 0x7 // End dependant function
-#define ISAPNP_SRIN_IO_DESCRIPTOR 0x8 // I/O port descriptor
-#define ISAPNP_SRIN_FL_IO_DESCRIPOTOR 0x9 // Fixed location I/O port descriptor
-#define ISAPNP_SRIN_VENDOR_DEFINED 0xE // Vendor defined
-#define ISAPNP_SRIN_END_TAG 0xF // End tag
-
-typedef struct _ISAPNP_SRI_VERSION
-{
- UCHAR Header;
- UCHAR Version; // Packed BCD format version number
- UCHAR VendorVersion; // Vendor specific version number
-} ISAPNP_SRI_VERSION, *PISAPNP_SRI_VERSION;
-
-typedef struct _ISAPNP_SRI_LDEVICE_ID
-{
- UCHAR Header;
- USHORT DeviceId; // Logical device id
- USHORT VendorId; // Manufacturer id
- UCHAR Flags; // Flags
-} ISAPNP_SRI_LDEVICE_ID, *PISAPNP_SRI_LDEVICE_ID;
-
-typedef struct _ISAPNP_SRI_CDEVICE_ID
-{
- UCHAR Header;
- USHORT DeviceId; // Logical device id
- USHORT VendorId; // Manufacturer id
-} ISAPNP_SRI_CDEVICE_ID, *PISAPNP_SRI_CDEVICE_ID;
-
-typedef struct _ISAPNP_SRI_IRQ_FORMAT
-{
- UCHAR Header;
- USHORT Mask; // IRQ mask (bit 0 = irq 0, etc.)
- UCHAR Information; // IRQ information
-} ISAPNP_SRI_IRQ_FORMAT, *PISAPNP_SRI_IRQ_FORMAT;
-
-typedef struct _ISAPNP_SRI_DMA_FORMAT
-{
- UCHAR Header;
- USHORT Mask; // DMA channel mask (bit 0 = channel 0, etc.)
- UCHAR Information; // DMA information
-} ISAPNP_SRI_DMA_FORMAT, *PISAPNP_SRI_DMA_FORMAT;
-
-typedef struct _ISAPNP_SRI_START_DFUNCTION
-{
- UCHAR Header;
-} ISAPNP_SRI_START_DFUNCTION, *PISAPNP_SRI_START_DFUNCTION;
-
-typedef struct _ISAPNP_SRI_END_DFUNCTION
-{
- UCHAR Header;
-} ISAPNP_SRI_END_DFUNCTION, *PISAPNP_SRI_END_DFUNCTION;
-
-typedef struct _ISAPNP_SRI_IO_DESCRIPTOR
-{
- UCHAR Header;
- UCHAR Information; // Information
- USHORT RangeMinBase; // Minimum base address
- USHORT RangeMaxBase; // Maximum base address
- UCHAR Alignment; // Base alignment
- UCHAR RangeLength; // Length of range
-} ISAPNP_SRI_IO_DESCRIPTOR, *PISAPNP_SRI_IO_DESCRIPTOR;
-
-typedef struct _ISAPNP_SRI_FL_IO_DESCRIPTOR
-{
- UCHAR Header;
- USHORT RangeBase; // Range base address
- UCHAR RangeLength; // Length of range
-} ISAPNP_SRI_FL_IO_DESCRIPTOR, *PISAPNP_SRI_FL_IO_DESCRIPTOR;
-
-typedef struct _PISAPNP_SRI_VENDOR_DEFINED
-{
- UCHAR Header;
- UCHAR Reserved[0]; // Vendor defined
-} ISAPNP_SRI_VENDOR_DEFINED, *PISAPNP_SRI_VENDOR_DEFINED;
-
-typedef struct _ISAPNP_SRI_END_TAG
-{
- UCHAR Header;
- UCHAR Checksum; // Checksum
-} ISAPNP_SRI_END_TAG, *PISAPNP_SRI_END_TAG;
-
-
-typedef struct _ISAPNP_LRI
-{
- UCHAR Header;
- USHORT Length; // Length of data items
-} ISAPNP_LRI, *PISAPNP_LRI;
-
-// Large Resource Item Names (LRINs)
-#define ISAPNP_LRIN_MEMORY_RANGE 0x1 // Memory range descriptor
-#define ISAPNP_LRIN_ID_STRING_ANSI 0x2 // Identifier string (ANSI)
-#define ISAPNP_LRIN_ID_STRING_UNICODE 0x3 // Identifier string (UNICODE)
-#define ISAPNP_LRIN_VENDOR_DEFINED 0x4 // Vendor defined
-#define ISAPNP_LRIN_MEMORY_RANGE32 0x5 // 32-bit memory range descriptor
-#define ISAPNP_LRIN_FL_MEMORY_RANGE32 0x6 // 32-bit fixed location memory range descriptor
-
-typedef struct _ISAPNP_LRI_MEMORY_RANGE
-{
- UCHAR Header;
- USHORT Length; // Length of data items
- UCHAR Information; // Information
- USHORT RangeMinBase; // Minimum base address
- USHORT RangeMaxBase; // Maximum base address
- USHORT Alignment; // Base alignment
- USHORT RangeLength; // Length of range
-} ISAPNP_LRI_MEMORY_RANGE, *PISAPNP_LRI_MEMORY_RANGE;
-
-typedef struct _ISAPNP_LRI_ID_STRING_ANSI
-{
- UCHAR Header;
- USHORT Length; // Length of data items
- UCHAR String[0]; // Identifier string
-} ISAPNP_LRI_ID_STRING_ANSI, *PISAPNP_LRI_ID_STRING_ANSI;
-
-typedef struct _ISAPNP_LRI_ID_STRING_UNICODE
-{
- UCHAR Header;
- USHORT Length; // Length of data items
- USHORT CountryId; // Country identifier
- USHORT String[0]; // Identifier string
-} ISAPNP_LRI_ID_STRING_UNICODE, *PISAPNP_LRI_ID_STRING_UNICODE;
-
-typedef struct _PISAPNP_LRI_VENDOR_DEFINED
-{
- UCHAR Header;
- USHORT Length; // Length of data items
- UCHAR Reserved[0]; // Vendor defined
-} ISAPNP_LRI_VENDOR_DEFINED, *PISAPNP_LRI_VENDOR_DEFINED;
-
-typedef struct _ISAPNP_LRI_MEMORY_RANGE32
-{
- UCHAR Header;
- USHORT Length; // Length of data items
- UCHAR Information; // Information
- ULONG RangeMinBase; // Minimum base address
- ULONG RangeMaxBase; // Maximum base address
- ULONG Alignment; // Base alignment
- ULONG RangeLength; // Length of range
-} ISAPNP_LRI_MEMORY_RANGE32, *PISAPNP_LRI_MEMORY_RANGE32;
-
-typedef struct _ISAPNP_LRI_FL_MEMORY_RANGE32
-{
- UCHAR Header;
- USHORT Length; // Length of data items
- UCHAR Information; // Information
- ULONG RangeMinBase; // Minimum base address
- ULONG RangeMaxBase; // Maximum base address
- ULONG RangeLength; // Length of range
-} ISAPNP_LRI_FL_MEMORY_RANGE32, *PISAPNP_LRI_FL_MEMORY_RANGE32;
-
-typedef struct _ISAPNP_CARD
-{
- LIST_ENTRY ListEntry;
- USHORT CardId;
- USHORT VendorId;
- USHORT DeviceId;
- ULONG Serial;
- UCHAR PNPVersion;
- UCHAR ProductVersion;
- UNICODE_STRING Name;
- LIST_ENTRY LogicalDevices;
- KSPIN_LOCK LogicalDevicesLock;
-} ISAPNP_CARD, *PISAPNP_CARD;
-
-
-typedef struct _ISAPNP_DESCRIPTOR
-{
- LIST_ENTRY ListEntry;
- IO_RESOURCE_DESCRIPTOR Descriptor;
-} ISAPNP_DESCRIPTOR, *PISAPNP_DESCRIPTOR;
-
-typedef struct _ISAPNP_CONFIGURATION_LIST
-{
- LIST_ENTRY ListEntry;
- ULONG Priority;
- LIST_ENTRY ListHead;
-} ISAPNP_CONFIGURATION_LIST, *PISAPNP_CONFIGURATION_LIST;
-
-
-#define MAX_COMPATIBLE_ID 32
-
-typedef struct _ISAPNP_LOGICAL_DEVICE
-{
- LIST_ENTRY CardListEntry;
- LIST_ENTRY DeviceListEntry;
- USHORT Number;
- USHORT VendorId;
- USHORT DeviceId;
- USHORT CVendorId[MAX_COMPATIBLE_ID];
- USHORT CDeviceId[MAX_COMPATIBLE_ID];
- USHORT Regs;
- PISAPNP_CARD Card;
- UNICODE_STRING Name;
- PDEVICE_OBJECT Pdo;
- PIO_RESOURCE_REQUIREMENTS_LIST ResourceLists;
- LIST_ENTRY Configuration;
- ULONG ConfigurationSize;
- ULONG DescriptorCount;
- ULONG CurrentDescriptorCount;
-} ISAPNP_LOGICAL_DEVICE, *PISAPNP_LOGICAL_DEVICE;
-
-
typedef enum {
dsStopped,
dsStarted
} ISAPNP_DEVICE_STATE;
-typedef struct _ISAPNP_DEVICE_EXTENSION
-{
- // Physical Device Object
- PDEVICE_OBJECT Pdo;
- // Lower device object
- PDEVICE_OBJECT Ldo;
- // List of ISA PnP cards managed by this driver
- LIST_ENTRY CardListHead;
- // List of devices managed by this driver
- LIST_ENTRY DeviceListHead;
- // Number of devices managed by this driver
- ULONG DeviceListCount;
- // Spinlock for the linked lists
- KSPIN_LOCK GlobalListLock;
- // Current state of the driver
+typedef struct _ISAPNP_COMMON_EXTENSION {
+ PDEVICE_OBJECT Self;
+ BOOLEAN IsFdo;
ISAPNP_DEVICE_STATE State;
-} ISAPNP_DEVICE_EXTENSION, *PISAPNP_DEVICE_EXTENSION;
+} ISAPNP_COMMON_EXTENSION, *PISAPNP_COMMON_EXTENSION;
+typedef struct _ISAPNP_FDO_EXTENSION {
+ ISAPNP_COMMON_EXTENSION Common;
+ PDEVICE_OBJECT Ldo;
+ PDEVICE_OBJECT Pdo;
+ LIST_ENTRY DeviceListHead;
+ ULONG DeviceCount;
+ PUCHAR ReadDataPort;
+ KSPIN_LOCK Lock;
+} ISAPNP_FDO_EXTENSION, *PISAPNP_FDO_EXTENSION;
+
+typedef struct _ISAPNP_LOGICAL_DEVICE {
+ ISAPNP_COMMON_EXTENSION Common;
+ USHORT VendorId;
+ USHORT ProdId;
+ USHORT IoAddr;
+ UCHAR IrqNo;
+ UCHAR CSN;
+ UCHAR LDN;
+ LIST_ENTRY ListEntry;
+} ISAPNP_LOGICAL_DEVICE, *PISAPNP_LOGICAL_DEVICE;
+
+/* isapnp.c */
NTSTATUS
NTAPI
DriverEntry(
IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPath);
+NTSTATUS
+NTAPI
+IsaForwardIrpSynchronous(
+ IN PISAPNP_FDO_EXTENSION FdoExt,
+ IN PIRP Irp);
+
+/* fdo.c */
+NTSTATUS
+NTAPI
+IsaFdoPnp(
+ IN PISAPNP_FDO_EXTENSION FdoExt,
+ IN PIRP Irp,
+ IN PIO_STACK_LOCATION IrpSp);
+
+/* pdo.c */
+NTSTATUS
+NTAPI
+IsaPdoPnp(
+ IN PISAPNP_LOGICAL_DEVICE LogDev,
+ IN PIRP Irp,
+ IN PIO_STACK_LOCATION IrpSp);
+
+/* hardware.c */
+NTSTATUS
+NTAPI
+IsaHwDetectReadDataPort(
+ IN PISAPNP_FDO_EXTENSION FdoExt);
+
+NTSTATUS
+NTAPI
+IsaHwFillDeviceList(
+ IN PISAPNP_FDO_EXTENSION FdoExt);
+
+NTSTATUS
+NTAPI
+IsaHwDeactivateDevice(
+ IN PISAPNP_LOGICAL_DEVICE LogicalDevice);
+
+NTSTATUS
+NTAPI
+IsaHwActivateDevice(
+ IN PISAPNP_LOGICAL_DEVICE LogicalDevice);
+
#ifdef __cplusplus
}
#endif
diff --git a/reactos/drivers/bus/isapnp/isapnp.rbuild b/reactos/drivers/bus/isapnp/isapnp.rbuild
index b0b7919d927..bc8a96acaf7 100644
--- a/reactos/drivers/bus/isapnp/isapnp.rbuild
+++ b/reactos/drivers/bus/isapnp/isapnp.rbuild
@@ -1,9 +1,13 @@
+
.
ntoskrnl
hal
isapnp.c
+ pdo.c
+ fdo.c
+ hardware.c
isapnp.rc
diff --git a/reactos/drivers/bus/isapnp/isapnphw.h b/reactos/drivers/bus/isapnp/isapnphw.h
new file mode 100644
index 00000000000..aec87191fe5
--- /dev/null
+++ b/reactos/drivers/bus/isapnp/isapnphw.h
@@ -0,0 +1,106 @@
+#pragma once
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ISAPNP_ADDRESS 0x279
+#define ISAPNP_WRITE_DATA 0xA79
+
+#define ISAPNP_READ_PORT_MIN 0x203
+#define ISAPNP_READ_PORT_START 0x213
+#define ISAPNP_READ_PORT_MAX 0x3FF
+#define ISAPNP_READ_PORT_STEP 0x10
+
+#define ISAPNP_CSN_MIN 0x01
+#define ISAPNP_CSN_MAX 0x0F
+
+#define ISAPNP_READPORT 0x00
+#define ISAPNP_SERIALISOLATION 0x01
+#define ISAPNP_CONFIGCONTROL 0x02
+#define ISAPNP_WAKE 0x03
+#define ISAPNP_RESOURCEDATA 0x04
+#define ISAPNP_STATUS 0x05
+#define ISAPNP_CARDSELECTNUMBER 0x06
+#define ISAPNP_LOGICALDEVICENUMBER 0x07
+
+#define ISAPNP_ACTIVATE 0x30
+#define ISAPNP_IORANGECHECK 0x31
+
+#define ISAPNP_IOBASE(n) (0x60 + ((n)*2))
+#define ISAPNP_IRQNO(n) (0x70 + ((n)*2))
+#define ISAPNP_IRQTYPE(n) (0x71 + ((n) * 2))
+
+#define ISAPNP_CONFIG_RESET (1 << 0)
+#define ISAPNP_CONFIG_WAIT_FOR_KEY (1 << 1)
+#define ISAPNP_CONFIG_RESET_CSN (1 << 2)
+
+#define ISAPNP_LFSR_SEED 0x6A
+
+#define ISAPNP_IS_SMALL_TAG(t) (!((t) & 0x80))
+#define ISAPNP_SMALL_TAG_NAME(t) (((t) >> 3) & 0xF)
+#define ISAPNP_SMALL_TAG_LEN(t) (((t) & 0x7))
+#define ISAPNP_TAG_PNPVERNO 0x01
+#define ISAPNP_TAG_LOGDEVID 0x02
+#define ISAPNP_TAG_COMPATDEVID 0x03
+#define ISAPNP_TAG_IRQ 0x04
+#define ISAPNP_TAG_DMA 0x05
+#define ISAPNP_TAG_STARTDEP 0x06
+#define ISAPNP_TAG_ENDDEP 0x07
+#define ISAPNP_TAG_IOPORT 0x08
+#define ISAPNP_TAG_FIXEDIO 0x09
+#define ISAPNP_TAG_RSVDSHORTA 0x0A
+#define ISAPNP_TAG_RSVDSHORTB 0x0B
+#define ISAPNP_TAG_RSVDSHORTC 0x0C
+#define ISAPNP_TAG_RSVDSHORTD 0x0D
+#define ISAPNP_TAG_VENDORSHORT 0x0E
+#define ISAPNP_TAG_END 0x0F
+
+#define ISAPNP_IS_LARGE_TAG(t) (((t) & 0x80))
+#define ISAPNP_LARGE_TAG_NAME(t) (t)
+#define ISAPNP_TAG_MEMRANGE 0x81
+#define ISAPNP_TAG_ANSISTR 0x82
+#define ISAPNP_TAG_UNICODESTR 0x83
+#define ISAPNP_TAG_VENDORLONG 0x84
+#define ISAPNP_TAG_MEM32RANGE 0x85
+#define ISAPNP_TAG_FIXEDMEM32RANGE 0x86
+#define ISAPNP_TAG_RSVDLONG0 0xF0
+#define ISAPNP_TAG_RSVDLONG1 0xF1
+#define ISAPNP_TAG_RSVDLONG2 0xF2
+#define ISAPNP_TAG_RSVDLONG3 0xF3
+#define ISAPNP_TAG_RSVDLONG4 0xF4
+#define ISAPNP_TAG_RSVDLONG5 0xF5
+#define ISAPNP_TAG_RSVDLONG6 0xF6
+#define ISAPNP_TAG_RSVDLONG7 0xF7
+#define ISAPNP_TAG_RSVDLONG8 0xF8
+#define ISAPNP_TAG_RSVDLONG9 0xF9
+#define ISAPNP_TAG_RSVDLONGA 0xFA
+#define ISAPNP_TAG_RSVDLONGB 0xFB
+#define ISAPNP_TAG_RSVDLONGC 0xFC
+#define ISAPNP_TAG_RSVDLONGD 0xFD
+#define ISAPNP_TAG_RSVDLONGE 0xFE
+#define ISAPNP_TAG_RSVDLONGF 0xFF
+#define ISAPNP_TAG_PSEUDO_NEWBOARD 0x100
+
+typedef struct _ISAPNP_IDENTIFIER {
+ USHORT VendorId;
+ USHORT ProdId;
+ ULONG Serial;
+ UCHAR Checksum;
+} ISAPNP_IDENTIFIER, *PISAPNP_IDENTIFIER;
+
+typedef struct _ISAPNP_LOGDEVID {
+ USHORT VendorId;
+ USHORT ProdId;
+ USHORT Flags;
+} ISAPNP_LOGDEVID, *PISAPNP_LOGDEVID;
+
+typedef struct _ISAPNP_DEVICEID {
+ CHAR* Name;
+ USHORT VendorId;
+ USHORT ProdId;
+} ISAPNP_DEVICEID, *PISAPNP_DEVICEID;
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/reactos/drivers/bus/isapnp/pdo.c b/reactos/drivers/bus/isapnp/pdo.c
new file mode 100644
index 00000000000..0292f20f0f4
--- /dev/null
+++ b/reactos/drivers/bus/isapnp/pdo.c
@@ -0,0 +1,83 @@
+/*
+ * PROJECT: ReactOS ISA PnP Bus driver
+ * FILE: pdo.c
+ * PURPOSE: PDO-specific code
+ * PROGRAMMERS: Cameron Gutman (cameron.gutman@reactos.org)
+ */
+#include
+
+#define NDEBUG
+#include
+
+NTSTATUS
+NTAPI
+IsaPdoQueryDeviceRelations(
+ IN PISAPNP_LOGICAL_DEVICE LogDev,
+ IN PIRP Irp,
+ IN PIO_STACK_LOCATION IrpSp)
+{
+ PDEVICE_RELATIONS DeviceRelations;
+
+ if (IrpSp->Parameters.QueryDeviceRelations.Type != TargetDeviceRelation)
+ return Irp->IoStatus.Status;
+
+ DeviceRelations = ExAllocatePool(PagedPool, sizeof(*DeviceRelations));
+ if (!DeviceRelations)
+ return STATUS_INSUFFICIENT_RESOURCES;
+
+ DeviceRelations->Count = 1;
+ DeviceRelations->Objects[0] = LogDev->Common.Self;
+ ObReferenceObject(LogDev->Common.Self);
+
+ Irp->IoStatus.Information = (ULONG_PTR)DeviceRelations;
+
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS
+NTAPI
+IsaPdoPnp(
+ IN PISAPNP_LOGICAL_DEVICE LogDev,
+ IN PIRP Irp,
+ IN PIO_STACK_LOCATION IrpSp)
+{
+ NTSTATUS Status = Irp->IoStatus.Status;
+
+ switch (IrpSp->MinorFunction)
+ {
+ case IRP_MN_START_DEVICE:
+ Status = IsaHwActivateDevice(LogDev);
+
+ if (NT_SUCCESS(Status))
+ LogDev->Common.State = dsStarted;
+ break;
+
+ case IRP_MN_STOP_DEVICE:
+ Status = IsaHwDeactivateDevice(LogDev);
+
+ if (NT_SUCCESS(Status))
+ LogDev->Common.State = dsStopped;
+ break;
+
+ case IRP_MN_QUERY_DEVICE_RELATIONS:
+ Status = IsaPdoQueryDeviceRelations(LogDev, Irp, IrpSp);
+ break;
+
+ case IRP_MN_QUERY_RESOURCES:
+ DPRINT1("IRP_MN_QUERY_RESOURCES is UNIMPLEMENTED!\n");
+ break;
+
+ case IRP_MN_QUERY_RESOURCE_REQUIREMENTS:
+ DPRINT1("IRP_MN_QUERY_RESOURCE_REQUIREMENTS is UNIMPLEMENTED!\n");
+ break;
+
+ default:
+ DPRINT1("Unknown PnP code: %x\n", IrpSp->MinorFunction);
+ break;
+ }
+
+ Irp->IoStatus.Status = Status;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+
+ return Status;
+}
From 2f488e47553d1173a56ebea14fae2e8f99efdecf Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Wed, 7 Apr 2010 20:20:22 +0000
Subject: [PATCH 070/261] [INF] - Reenable isapnp
svn path=/trunk/; revision=46769
---
reactos/media/inf/machine.inf | Bin 45620 -> 45566 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
diff --git a/reactos/media/inf/machine.inf b/reactos/media/inf/machine.inf
index ecc90375e8d1de8d54b6cc66e14fa58f09e17e72..ce3f8658bd0285b1ad9b8532e5acf16a8fb95ffb 100644
GIT binary patch
delta 31
ncmdn;gz4X7rVT10lO2SlCOe1(O+Fybw)vb$%3PNJ|F{?c)P@YN
delta 35
rcmezOm}$!srVT10jMkIwg`_9ji3Ckn5s{i4C8V@@nn=oACN2g5>ZA)u
From b270d2cf888a2b24764f09c2cbc7a73639790593 Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Wed, 7 Apr 2010 20:37:13 +0000
Subject: [PATCH 071/261] [HAL] - Remove an unnecessary hack now that PnP
manager doesn't suck (as much ;))
svn path=/trunk/; revision=46770
---
reactos/hal/halx86/generic/acpi/halpnpdd.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/reactos/hal/halx86/generic/acpi/halpnpdd.c b/reactos/hal/halx86/generic/acpi/halpnpdd.c
index ca85188bcaf..8617b20f1fc 100644
--- a/reactos/hal/halx86/generic/acpi/halpnpdd.c
+++ b/reactos/hal/halx86/generic/acpi/halpnpdd.c
@@ -848,9 +848,6 @@ HalpDriverEntry(IN PDRIVER_OBJECT DriverObject,
/* Now add us */
if (NT_SUCCESS(Status)) Status = HalpAddDevice(DriverObject, TargetDevice);
-
- /* Force re-enumeration??? */
- IoInvalidateDeviceRelations(TargetDevice, 0);
/* Return to kernel */
return Status;
From 8cc9a982b587dd26e24bc5976c3012c2d253a13e Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Wed, 7 Apr 2010 21:04:41 +0000
Subject: [PATCH 072/261] [RAMDISK] - Remove another unnecessary hack
svn path=/trunk/; revision=46771
---
reactos/drivers/storage/class/ramdisk/ramdisk.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/reactos/drivers/storage/class/ramdisk/ramdisk.c b/reactos/drivers/storage/class/ramdisk/ramdisk.c
index 1ebe19664c8..6a353bc264e 100644
--- a/reactos/drivers/storage/class/ramdisk/ramdisk.c
+++ b/reactos/drivers/storage/class/ramdisk/ramdisk.c
@@ -2422,18 +2422,7 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject,
0,
&PhysicalDeviceObject);
if (NT_SUCCESS(Status))
- {
- //
- // ReactOS Fix
- // The ReactOS Plug and Play Manager is broken and does not create
- // the required keys when reporting a detected device.
- // We hack around this ourselves.
- //
- RtlCreateUnicodeString(&((PEXTENDED_DEVOBJ_EXTENSION)
- PhysicalDeviceObject->DeviceObjectExtension)
- ->DeviceNode->InstancePath,
- L"Root\\UNKNOWN\\0000");
-
+ {
//
// Create the device object
//
From 07e1066306e216ebadc4ae1a9af8e79f7af86b97 Mon Sep 17 00:00:00 2001
From: Johannes Anderwald
Date: Wed, 7 Apr 2010 21:45:25 +0000
Subject: [PATCH 073/261] [KS] - Implement IKsDevice::GetAdapterObject,
IKsDevice::ArbitrateAdapterChannel - Store device interface guid in the
symbolic link list entry, which is used by KsFilterFactoryUpdateCacheData -
Implement KsFilterFactoryUpdateCacheData, which is used to dynamically
propagate format / medium changes to directshow components - Move stream
pointer preparation to an own function, which is called by
KsPinGetLeadingEdgeStreamPointer / KsStreamPointerClone /
KsStreamPointerAdvanceOffsets - Fix locating correct offset in
KsStreamPointerScheduleTimeout, KsStreamPointerCancelTimeout,
KsStreamPointerGetNextClone - Further BDA support is on hold until ReactOS
supports s/g in hal
svn path=/trunk/; revision=46774
---
reactos/drivers/ksfilter/ks/device.c | 46 +-
reactos/drivers/ksfilter/ks/deviceinterface.c | 4 +
reactos/drivers/ksfilter/ks/filterfactory.c | 248 ++++++++++-
reactos/drivers/ksfilter/ks/ksiface.h | 6 +-
reactos/drivers/ksfilter/ks/kstypes.h | 51 +++
reactos/drivers/ksfilter/ks/pin.c | 419 ++++++++++++------
reactos/drivers/ksfilter/ks/priv.h | 6 +-
7 files changed, 623 insertions(+), 157 deletions(-)
diff --git a/reactos/drivers/ksfilter/ks/device.c b/reactos/drivers/ksfilter/ks/device.c
index cf1d3f73216..982b717e7c8 100644
--- a/reactos/drivers/ksfilter/ks/device.c
+++ b/reactos/drivers/ksfilter/ks/device.c
@@ -112,14 +112,15 @@ NTSTATUS
NTAPI
IKsDevice_fnGetAdapterObject(
IN IKsDevice * iface,
- IN PADAPTER_OBJECT Object,
+ IN PADAPTER_OBJECT * Object,
IN PULONG Unknown1,
IN PULONG Unknown2)
{
- //PKSIDEVICE_HEADER This = (PKSIDEVICE_HEADER)CONTAINING_RECORD(iface, KSIDEVICE_HEADER, lpVtblIKsDevice);
+ PKSIDEVICE_HEADER This = (PKSIDEVICE_HEADER)CONTAINING_RECORD(iface, KSIDEVICE_HEADER, lpVtblIKsDevice);
- UNIMPLEMENTED
- return STATUS_NOT_IMPLEMENTED;
+ *Object = This->AdapterObject;
+
+ return STATUS_SUCCESS;
}
@@ -169,15 +170,24 @@ NTSTATUS
NTAPI
IKsDevice_fnArbitrateAdapterChannel(
IN IKsDevice * iface,
- IN ULONG ControlCode,
- IN IO_ALLOCATION_ACTION Action,
+ IN ULONG NumberOfMapRegisters,
+ IN PDRIVER_CONTROL ExecutionRoutine,
IN PVOID Context)
{
- //PKSIDEVICE_HEADER This = (PKSIDEVICE_HEADER)CONTAINING_RECORD(iface, KSIDEVICE_HEADER, lpVtblIKsDevice);
+ PKSIDEVICE_HEADER This = (PKSIDEVICE_HEADER)CONTAINING_RECORD(iface, KSIDEVICE_HEADER, lpVtblIKsDevice);
+ NTSTATUS Status;
- UNIMPLEMENTED
- return STATUS_NOT_IMPLEMENTED;
+ DPRINT("IKsDevice_fnArbitrateAdapterChannel NumberOfMapRegisters %lu ExecutionRoutine %p Context %p Irql %lu\n", NumberOfMapRegisters, ExecutionRoutine, Context, KeGetCurrentIrql());
+ /* sanity check */
+ ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL);
+ ASSERT(This->AdapterObject);
+
+ /* allocate adapter channel */
+ Status = IoAllocateAdapterChannel(This->AdapterObject, This->KsDevice.FunctionalDeviceObject, NumberOfMapRegisters, ExecutionRoutine, Context);
+
+ /* done */
+ return Status;
}
NTSTATUS
@@ -518,7 +528,6 @@ IKsDevice_Pnp(
Status = KspForwardIrpSynchronous(DeviceObject, Irp);
DPRINT1("IRP_MN_QUERY_INTERFACE Next Device: Status %x\n", Status);
-
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
@@ -687,6 +696,23 @@ KsInitializeDevice(
DPRINT("DeviceHeader %p\n", DeviceExtension->DeviceHeader);
+ if (Descriptor && Descriptor->Dispatch)
+ {
+ DPRINT("Descriptor Add %p\n", Descriptor->Dispatch->Add);
+ DPRINT("Descriptor Start %p\n", Descriptor->Dispatch->Start);
+ DPRINT("Descriptor PostStart %p\n", Descriptor->Dispatch->PostStart);
+ DPRINT("Descriptor QueryStop %p\n", Descriptor->Dispatch->QueryStop);
+ DPRINT("Descriptor CancelStop %p\n", Descriptor->Dispatch->CancelStop);
+ DPRINT("Descriptor Stop %p\n", Descriptor->Dispatch->Stop);
+ DPRINT("Descriptor QueryRemove %p\n", Descriptor->Dispatch->QueryRemove);
+ DPRINT("Descriptor CancelRemove %p\n", Descriptor->Dispatch->CancelRemove);
+ DPRINT("Descriptor Remove %p\n", Descriptor->Dispatch->Remove);
+ DPRINT("Descriptor QueryCapabilities %p\n", Descriptor->Dispatch->QueryCapabilities);
+ DPRINT("Descriptor SurpriseRemoval %p\n", Descriptor->Dispatch->SurpriseRemoval);
+ DPRINT("Descriptor QueryPower %p\n", Descriptor->Dispatch->QueryPower);
+ DPRINT("Descriptor SetPower %p\n", Descriptor->Dispatch->SetPower);
+ DPRINT("Descriptor QueryInterface %p\n", Descriptor->Dispatch->QueryInterface);
+ }
/* check for success */
if (!NT_SUCCESS(Status))
diff --git a/reactos/drivers/ksfilter/ks/deviceinterface.c b/reactos/drivers/ksfilter/ks/deviceinterface.c
index cd0ffe274bb..c1fdff8470b 100644
--- a/reactos/drivers/ksfilter/ks/deviceinterface.c
+++ b/reactos/drivers/ksfilter/ks/deviceinterface.c
@@ -90,6 +90,10 @@ KspRegisterDeviceInterfaces(
/* return result */
return Status;
}
+
+ /* copy device class */
+ RtlMoveMemory(&SymEntry->DeviceInterfaceClass, &Categories[Index], sizeof(CLSID));
+
/* insert symbolic link entry */
InsertTailList(SymbolicLinkList, &SymEntry->Entry);
}
diff --git a/reactos/drivers/ksfilter/ks/filterfactory.c b/reactos/drivers/ksfilter/ks/filterfactory.c
index 18b2147b679..0e15bb76f3c 100644
--- a/reactos/drivers/ksfilter/ks/filterfactory.c
+++ b/reactos/drivers/ksfilter/ks/filterfactory.c
@@ -469,19 +469,261 @@ KsFilterFactoryAddCreateItem(
return KsAllocateObjectCreateItem((KSDEVICE_HEADER)Factory->DeviceHeader, &CreateItem, TRUE, IKsFilterFactory_ItemFreeCb);
}
+ULONG
+KspCacheAddData(
+ PKSPCACHE_DESCRIPTOR Descriptor,
+ LPCVOID Data,
+ ULONG Length)
+{
+ ULONG Index;
+
+ for(Index = 0; Index < Descriptor->DataOffset; Index++)
+ {
+ if (RtlCompareMemory(Descriptor->DataCache, Data, Length) == Length)
+ {
+ if (Index + Length > Descriptor->DataOffset)
+ {
+ /* adjust used space */
+ Descriptor->DataOffset = Index + Length;
+ /* return absolute offset */
+ return Descriptor->DataLength + Index;
+ }
+ }
+ }
+
+ /* sanity check */
+ ASSERT(Descriptor->DataOffset + Length < Descriptor->DataLength);
+
+ /* copy to data blob */
+ RtlMoveMemory((Descriptor->DataCache + Descriptor->DataOffset), Data, Length);
+
+ /* backup offset */
+ Index = Descriptor->DataOffset;
+
+ /* adjust used space */
+ Descriptor->DataOffset += Length;
+
+ /* return absolute offset */
+ return Descriptor->DataLength + Index;
+}
+
/*
@implemented
*/
KSDDKAPI
NTSTATUS
NTAPI
-KsFilterFactoryUpdateCacheData (
+KsFilterFactoryUpdateCacheData(
IN PKSFILTERFACTORY FilterFactory,
IN const KSFILTER_DESCRIPTOR* FilterDescriptor OPTIONAL)
{
- UNIMPLEMENTED
+ KSPCACHE_DESCRIPTOR Descriptor;
+ PKSPCACHE_FILTER_HEADER FilterHeader;
+ UNICODE_STRING FilterData = RTL_CONSTANT_STRING(L"FilterData");
+ PKSPCACHE_PIN_HEADER PinHeader;
+ ULONG Index, SubIndex;
+ PLIST_ENTRY Entry;
+ PSYMBOLIC_LINK_ENTRY SymEntry;
+ BOOLEAN Found;
+ HKEY hKey;
+ NTSTATUS Status = STATUS_SUCCESS;
+
+ IKsFilterFactoryImpl * Factory = (IKsFilterFactoryImpl*)CONTAINING_RECORD(FilterFactory, IKsFilterFactoryImpl, FilterFactory);
+
DPRINT("KsFilterFactoryUpdateCacheData %p\n", FilterDescriptor);
- return STATUS_SUCCESS;
+ if (!FilterDescriptor)
+ FilterDescriptor = Factory->FilterFactory.FilterDescriptor;
+
+ ASSERT(FilterDescriptor);
+
+ /* initialize cache descriptor */
+ RtlZeroMemory(&Descriptor, sizeof(KSPCACHE_DESCRIPTOR));
+
+ /* calculate filter data size */
+ Descriptor.FilterLength = sizeof(KSPCACHE_FILTER_HEADER);
+
+ /* FIXME support variable size pin descriptors */
+ ASSERT(FilterDescriptor->PinDescriptorSize == sizeof(KSPIN_DESCRIPTOR_EX));
+
+ for(Index = 0; Index < FilterDescriptor->PinDescriptorsCount; Index++)
+ {
+ /* add filter descriptor */
+ Descriptor.FilterLength += sizeof(KSPCACHE_PIN_HEADER);
+
+ if (FilterDescriptor->PinDescriptors[Index].PinDescriptor.Category)
+ {
+ /* add extra ULONG for offset to category */
+ Descriptor.FilterLength += sizeof(ULONG);
+
+ /* add size for clsid */
+ Descriptor.DataLength += sizeof(CLSID);
+ }
+
+ /* add space for formats */
+ Descriptor.FilterLength += FilterDescriptor->PinDescriptors[Index].PinDescriptor.DataRangesCount * sizeof(KSPCACHE_DATARANGE);
+
+ /* add space for MajorFormat / MinorFormat */
+ Descriptor.DataLength += FilterDescriptor->PinDescriptors[Index].PinDescriptor.DataRangesCount * sizeof(CLSID) * 2;
+
+ /* add space for mediums */
+ Descriptor.FilterLength += FilterDescriptor->PinDescriptors[Index].PinDescriptor.MediumsCount * sizeof(ULONG);
+
+ /* add space for the data */
+ Descriptor.DataLength += FilterDescriptor->PinDescriptors[Index].PinDescriptor.MediumsCount * sizeof(KSPCACHE_MEDIUM);
+ }
+
+ /* now allocate the space */
+ Descriptor.FilterData = (PUCHAR)AllocateItem(NonPagedPool, Descriptor.DataLength + Descriptor.FilterLength);
+ if (!Descriptor.FilterData)
+ {
+ /* no memory */
+ return STATUS_INSUFFICIENT_RESOURCES;
+ }
+
+ /* initialize data cache */
+ Descriptor.DataCache = (PUCHAR)((ULONG_PTR)Descriptor.FilterData + Descriptor.FilterLength);
+
+ /* setup filter header */
+ FilterHeader = (PKSPCACHE_FILTER_HEADER)Descriptor.FilterData;
+
+ FilterHeader->dwVersion = 2;
+ FilterHeader->dwMerit = MERIT_DO_NOT_USE;
+ FilterHeader->dwUnused = 0;
+ FilterHeader->dwPins = FilterDescriptor->PinDescriptorsCount;
+
+ Descriptor.FilterOffset = sizeof(KSPCACHE_FILTER_HEADER);
+
+ /* write pin headers */
+ for(Index = 0; Index < FilterDescriptor->PinDescriptorsCount; Index++)
+ {
+ /* get offset to pin */
+ PinHeader = (PKSPCACHE_PIN_HEADER)((ULONG_PTR)Descriptor.FilterData + Descriptor.FilterOffset);
+
+ /* write pin header */
+ PinHeader->Signature = 0x33697030 + Index;
+ PinHeader->Flags = 0;
+ PinHeader->Instances = FilterDescriptor->PinDescriptors[Index].InstancesPossible;
+ if (PinHeader->Instances > 1)
+ PinHeader->Flags |= REG_PINFLAG_B_MANY;
+
+
+ PinHeader->MediaTypes = FilterDescriptor->PinDescriptors[Index].PinDescriptor.DataRangesCount;
+ PinHeader->Mediums = FilterDescriptor->PinDescriptors[Index].PinDescriptor.MediumsCount;
+ PinHeader->Category = (FilterDescriptor->PinDescriptors[Index].PinDescriptor.Category ? TRUE : FALSE);
+
+ Descriptor.FilterOffset += sizeof(KSPCACHE_PIN_HEADER);
+
+ if (PinHeader->Category)
+ {
+ /* get category offset */
+ PULONG Category = (PULONG)(PinHeader + 1);
+
+ /* write category offset */
+ *Category = KspCacheAddData(&Descriptor, FilterDescriptor->PinDescriptors[Index].PinDescriptor.Category, sizeof(CLSID));
+
+ /* adjust offset */
+ Descriptor.FilterOffset += sizeof(ULONG);
+ }
+
+ /* add dataranges */
+ for(SubIndex = 0; SubIndex < FilterDescriptor->PinDescriptors[Index].PinDescriptor.DataRangesCount; SubIndex++)
+ {
+ /* get datarange offset */
+ PKSPCACHE_DATARANGE DataRange = (PKSPCACHE_DATARANGE)((ULONG_PTR)Descriptor.FilterData + Descriptor.FilterOffset);
+
+ /* initialize data range */
+ DataRange->Signature = 0x33797430 + SubIndex;
+ DataRange->dwUnused = 0;
+ DataRange->OffsetMajor = KspCacheAddData(&Descriptor, &FilterDescriptor->PinDescriptors[Index].PinDescriptor.DataRanges[SubIndex]->MajorFormat, sizeof(CLSID));
+ DataRange->OffsetMinor = KspCacheAddData(&Descriptor, &FilterDescriptor->PinDescriptors[Index].PinDescriptor.DataRanges[SubIndex]->SubFormat, sizeof(CLSID));
+
+ /* adjust offset */
+ Descriptor.FilterOffset += sizeof(KSPCACHE_DATARANGE);
+ }
+
+ /* add mediums */
+ for(SubIndex = 0; SubIndex < FilterDescriptor->PinDescriptors[Index].PinDescriptor.MediumsCount; SubIndex++)
+ {
+ KSPCACHE_MEDIUM Medium;
+ PULONG MediumOffset;
+
+ /* get pin medium offset */
+ MediumOffset = (PULONG)((ULONG_PTR)Descriptor.FilterData + Descriptor.FilterOffset);
+
+ /* copy medium guid */
+ RtlMoveMemory(&Medium.Medium, &FilterDescriptor->PinDescriptors[Index].PinDescriptor.Mediums[SubIndex].Set, sizeof(GUID));
+ Medium.dw1 = FilterDescriptor->PinDescriptors[Index].PinDescriptor.Mediums[SubIndex].Id; /* FIXME verify */
+ Medium.dw2 = 0;
+
+ *MediumOffset = KspCacheAddData(&Descriptor, &Medium, sizeof(KSPCACHE_MEDIUM));
+
+ /* adjust offset */
+ Descriptor.FilterOffset += sizeof(ULONG);
+ }
+ }
+
+ /* sanity checks */
+ ASSERT(Descriptor.FilterOffset == Descriptor.FilterLength);
+ ASSERT(Descriptor.DataOffset <= Descriptor.DataLength);
+
+
+ /* now go through all entries and update 'FilterData' key */
+ for(Index = 0; Index < FilterDescriptor->CategoriesCount; Index++)
+ {
+ /* get first entry */
+ Entry = Factory->SymbolicLinkList.Flink;
+
+ /* set status to not found */
+ Found = FALSE;
+ /* loop list until the the current category is found */
+ while(Entry != &Factory->SymbolicLinkList)
+ {
+ /* fetch symbolic link entry */
+ SymEntry = (PSYMBOLIC_LINK_ENTRY)CONTAINING_RECORD(Entry, SYMBOLIC_LINK_ENTRY, Entry);
+
+ if (IsEqualGUIDAligned(&SymEntry->DeviceInterfaceClass, &FilterDescriptor->Categories[Index]))
+ {
+ /* found category */
+ Found = TRUE;
+ break;
+ }
+
+ /* move to next entry */
+ Entry = Entry->Flink;
+ }
+
+ if (!Found)
+ {
+ /* filter category is not present */
+ Status = STATUS_INVALID_PARAMETER;
+ break;
+ }
+
+ /* now open device interface */
+ Status = IoOpenDeviceInterfaceRegistryKey(&SymEntry->SymbolicLink, KEY_WRITE, &hKey);
+ if (!NT_SUCCESS(Status))
+ {
+ /* failed to open interface key */
+ break;
+ }
+
+ /* update filterdata key */
+ Status = ZwSetValueKey(hKey, &FilterData, 0, REG_BINARY, Descriptor.FilterData, Descriptor.FilterLength + Descriptor.DataOffset);
+
+ /* close filterdata key */
+ ZwClose(hKey);
+
+ if (!NT_SUCCESS(Status))
+ {
+ /* failed to set key value */
+ break;
+ }
+ }
+ /* free filter data */
+ FreeItem(Descriptor.FilterData);
+
+ /* done */
+ return Status;
}
diff --git a/reactos/drivers/ksfilter/ks/ksiface.h b/reactos/drivers/ksfilter/ks/ksiface.h
index ffea3ed8a7c..0977886beaf 100644
--- a/reactos/drivers/ksfilter/ks/ksiface.h
+++ b/reactos/drivers/ksfilter/ks/ksiface.h
@@ -282,7 +282,7 @@ DECLARE_INTERFACE_(IKsDevice, IUnknown)
STDMETHOD_(NTSTATUS,ReleaseDevice)(THIS) PURE;
STDMETHOD_(NTSTATUS, GetAdapterObject)(THIS_
- IN PADAPTER_OBJECT Object,
+ IN PADAPTER_OBJECT * Object,
IN PULONG Unknown1,
IN PULONG Unknown2) PURE;
@@ -300,8 +300,8 @@ DECLARE_INTERFACE_(IKsDevice, IUnknown)
IN KSSTATE NewState)PURE;
STDMETHOD_(NTSTATUS, ArbitrateAdapterChannel)(THIS_
- IN ULONG ControlCode,
- IN IO_ALLOCATION_ACTION Action,
+ IN ULONG NumberOfMapRegisters,
+ IN PDRIVER_CONTROL ExecutionRoutine,
IN PVOID Context)PURE;
STDMETHOD_(NTSTATUS, CheckIoCapability)(THIS_
diff --git a/reactos/drivers/ksfilter/ks/kstypes.h b/reactos/drivers/ksfilter/ks/kstypes.h
index d5c7588fda1..51b365aaaad 100644
--- a/reactos/drivers/ksfilter/ks/kstypes.h
+++ b/reactos/drivers/ksfilter/ks/kstypes.h
@@ -108,6 +108,8 @@ typedef struct
LIST_ENTRY PowerDispatchList;
LIST_ENTRY ObjectBags;
+ PADAPTER_OBJECT AdapterObject;
+
}KSIDEVICE_HEADER, *PKSIDEVICE_HEADER;
typedef struct
@@ -120,6 +122,7 @@ typedef struct
{
LIST_ENTRY Entry;
UNICODE_STRING SymbolicLink;
+ CLSID DeviceInterfaceClass;
}SYMBOLIC_LINK_ENTRY, *PSYMBOLIC_LINK_ENTRY;
typedef struct
@@ -157,3 +160,51 @@ typedef struct
WCHAR BusIdentifier[1];
}BUS_ENUM_DEVICE_EXTENSION, *PBUS_ENUM_DEVICE_EXTENSION;
+
+typedef struct
+{
+ PUCHAR FilterData;
+ ULONG FilterLength;
+ ULONG FilterOffset;
+
+ PUCHAR DataCache;
+ ULONG DataLength;
+ ULONG DataOffset;
+
+}KSPCACHE_DESCRIPTOR, *PKSPCACHE_DESCRIPTOR;
+
+typedef struct
+{
+ DWORD dwVersion;
+ DWORD dwMerit;
+ DWORD dwPins;
+ DWORD dwUnused;
+}KSPCACHE_FILTER_HEADER, *PKSPCACHE_FILTER_HEADER;
+
+typedef struct
+{
+ ULONG Signature;
+ ULONG Flags;
+ ULONG Instances;
+ ULONG MediaTypes;
+ ULONG Mediums;
+ DWORD Category;
+}KSPCACHE_PIN_HEADER, *PKSPCACHE_PIN_HEADER;
+
+
+typedef struct
+{
+ ULONG Signature;
+ ULONG dwUnused;
+ ULONG OffsetMajor;
+ ULONG OffsetMinor;
+}KSPCACHE_DATARANGE, *PKSPCACHE_DATARANGE;
+
+
+typedef struct
+{
+ CLSID Medium;
+ ULONG dw1;
+ ULONG dw2;
+}KSPCACHE_MEDIUM;
+
diff --git a/reactos/drivers/ksfilter/ks/pin.c b/reactos/drivers/ksfilter/ks/pin.c
index a4cc63bfbc6..0612fc74b9c 100644
--- a/reactos/drivers/ksfilter/ks/pin.c
+++ b/reactos/drivers/ksfilter/ks/pin.c
@@ -17,6 +17,9 @@ typedef struct _KSISTREAM_POINTER
KDPC TimerDpc;
struct _KSISTREAM_POINTER *Next;
PKSPIN Pin;
+ PVOID Data;
+ ULONG Offset;
+ ULONG Length;
KSSTREAM_POINTER StreamPointer;
}KSISTREAM_POINTER, *PKSISTREAM_POINTER;
@@ -40,10 +43,11 @@ typedef struct
LIST_ENTRY IrpList;
KSPIN_LOCK IrpListLock;
+ volatile LONG IrpCount;
PKSISTREAM_POINTER ClonedStreamPointer;
- PKSISTREAM_POINTER LeadingEdgeStreamPointer;
- PKSISTREAM_POINTER TrailingStreamPointer;
+ KSISTREAM_POINTER LeadingEdgeStreamPointer;
+ KSISTREAM_POINTER TrailingStreamPointer;
PFNKSPINPOWER Sleep;
PFNKSPINPOWER Wake;
@@ -58,9 +62,11 @@ typedef struct
PKSWORKER PinWorker;
WORK_QUEUE_ITEM PinWorkQueueItem;
- IRP * Irp;
KEVENT FrameComplete;
-
+ ULONG FrameSize;
+ ULONG NumFrames;
+ PDMA_ADAPTER Dma;
+ ULONG MapRegisters;
}IKsPinImpl;
@@ -1202,6 +1208,84 @@ KsProcessPinUpdate(
return FALSE;
}
+NTSTATUS
+IKsPin_PrepareStreamHeader(
+ IN IKsPinImpl * This,
+ IN PKSISTREAM_POINTER StreamPointer)
+{
+ PKSSTREAM_HEADER Header;
+ ULONG Length;
+
+ /* grab new irp */
+ StreamPointer->Irp = KsRemoveIrpFromCancelableQueue(&This->IrpList, &This->IrpListLock, KsListEntryHead, KsAcquireAndRemoveOnlySingleItem);
+ if (!StreamPointer->Irp)
+ {
+ /* run out of mappings */
+ DPRINT("OutOfMappings\n");
+ return STATUS_DEVICE_NOT_READY;
+ }
+
+ InterlockedDecrement(&This->IrpCount);
+
+ /* get stream header */
+ if (StreamPointer->Irp->RequestorMode == UserMode)
+ Header = (PKSSTREAM_HEADER)StreamPointer->Irp->AssociatedIrp.SystemBuffer;
+ else
+ Header = (PKSSTREAM_HEADER)StreamPointer->Irp->UserBuffer;
+
+ /* initialize stream pointer */
+ StreamPointer->Callback = NULL;
+ StreamPointer->Length = max(Header->DataUsed, Header->FrameExtent);
+ StreamPointer->Next = NULL;
+ StreamPointer->Offset = 0;
+ StreamPointer->Pin = &This->Pin;
+ StreamPointer->Data = Header->Data;
+
+ StreamPointer->StreamPointer.Context = NULL;
+ StreamPointer->StreamPointer.Pin = &This->Pin;
+ StreamPointer->StreamPointer.StreamHeader = Header;
+
+ if (This->Pin.Descriptor->PinDescriptor.DataFlow == KSPIN_DATAFLOW_IN)
+ StreamPointer->StreamPointer.Offset = &StreamPointer->StreamPointer.OffsetIn;
+ else
+ StreamPointer->StreamPointer.Offset = &StreamPointer->StreamPointer.OffsetOut;
+
+ StreamPointer->StreamPointer.Offset->Alignment = 0;
+ StreamPointer->StreamPointer.Offset->Count = 0;
+ StreamPointer->StreamPointer.Offset->Data = NULL;
+ StreamPointer->StreamPointer.Offset->Remaining = 0;
+
+ ASSERT(StreamPointer->StreamPointer.Offset->Remaining == 0);
+
+ //StreamPointer->Offset += StreamPointer->StreamPointer.Offset->Count;
+
+ ASSERT(StreamPointer->Length > StreamPointer->Offset);
+ ASSERT(StreamPointer->StreamPointer.StreamHeader);
+ ASSERT(This->FrameSize);
+
+ /* calculate length */
+ /* TODO split into frames */
+ Length = StreamPointer->Length;
+
+ /* FIXME */
+ ASSERT(Length);
+
+ StreamPointer->StreamPointer.Offset->Alignment = 0;
+ StreamPointer->StreamPointer.Context = NULL;
+ StreamPointer->StreamPointer.Pin = &This->Pin;
+ StreamPointer->StreamPointer.Offset->Count = Length;
+ StreamPointer->StreamPointer.Offset->Remaining = Length;
+ StreamPointer->StreamPointer.Offset->Data = (PVOID)((ULONG_PTR)StreamPointer->Data + StreamPointer->Offset);
+ StreamPointer->StreamPointer.StreamHeader->FrameExtent = Length;
+ if (StreamPointer->StreamPointer.StreamHeader->DataUsed)
+ StreamPointer->StreamPointer.StreamHeader->DataUsed = Length;
+
+ StreamPointer->StreamPointer.StreamHeader->Data = StreamPointer->StreamPointer.Offset->Data;
+
+ return STATUS_SUCCESS;
+}
+
+
/*
@unimplemented
*/
@@ -1213,32 +1297,30 @@ KsPinGetLeadingEdgeStreamPointer(
IN KSSTREAM_POINTER_STATE State)
{
IKsPinImpl * This;
+ NTSTATUS Status;
This = (IKsPinImpl*)CONTAINING_RECORD(Pin, IKsPinImpl, Pin);
- DPRINT("KsPinGetLeadingEdgeStreamPointer Pin %p State %x Count %lu Remaining %lu\n", Pin, State,
- This->LeadingEdgeStreamPointer->StreamPointer.Offset->Count,
- This->LeadingEdgeStreamPointer->StreamPointer.Offset->Remaining);
+ DPRINT("KsPinGetLeadingEdgeStreamPointer Pin %p State %x Count %lu Remaining %lu\n", Pin, State,
+ This->LeadingEdgeStreamPointer.Length,
+ This->LeadingEdgeStreamPointer.Offset);
/* sanity check */
- ASSERT(This->LeadingEdgeStreamPointer);
ASSERT(State == KSSTREAM_POINTER_STATE_LOCKED);
if (State == KSSTREAM_POINTER_STATE_LOCKED)
{
- /* do we have an irp packet */
- if (!This->Irp)
+ if (!This->LeadingEdgeStreamPointer.Irp || This->LeadingEdgeStreamPointer.StreamPointer.Offset->Remaining == 0)
{
- /* run out of packets */
- return NULL;
+ Status = IKsPin_PrepareStreamHeader(This, &This->LeadingEdgeStreamPointer);
+ if (!NT_SUCCESS(Status))
+ return NULL;
}
- if (!This->LeadingEdgeStreamPointer->StreamPointer.Offset->Remaining)
- return NULL;
- }
- DPRINT("LeadingEdge %p\n", &This->LeadingEdgeStreamPointer->StreamPointer);
- This->LeadingEdgeStreamPointer->Pin = &This->Pin;
- return &This->LeadingEdgeStreamPointer->StreamPointer;
+ DPRINT("KsPinGetLeadingEdgeStreamPointer NewOffset %lu TotalLength %lu\n", This->LeadingEdgeStreamPointer.Offset, This->LeadingEdgeStreamPointer.Length);
+ }
+
+ return &This->LeadingEdgeStreamPointer.StreamPointer;
}
/*
@@ -1293,7 +1375,7 @@ KsStreamPointerUnlock(
IN BOOLEAN Eject)
{
UNIMPLEMENTED
- DPRINT("KsStreamPointerUnlock Eject %lu\n", Eject);
+ DPRINT("KsStreamPointerUnlock StreamPointer %pEject %lu\n", StreamPointer, Eject);
DbgBreakPoint();
}
@@ -1328,7 +1410,7 @@ KsStreamPointerDelete(
PKSISTREAM_POINTER Pointer = (PKSISTREAM_POINTER)CONTAINING_RECORD(StreamPointer, KSISTREAM_POINTER, StreamPointer);
DPRINT("KsStreamPointerDelete %p\n", Pointer);
-
+DbgBreakPoint();
This = (IKsPinImpl*)CONTAINING_RECORD(Pointer->StreamPointer.Pin, IKsPinImpl, Pin);
/* point to first stream pointer */
@@ -1378,6 +1460,7 @@ KsStreamPointerClone(
PKSISTREAM_POINTER CurFrame;
PKSISTREAM_POINTER NewFrame;
ULONG RefCount;
+ NTSTATUS Status;
ULONG Size;
DPRINT("KsStreamPointerClone StreamPointer %p CancelCallback %p ContextSize %p CloneStreamPointer %p\n", StreamPointer, CancelCallback, ContextSize, CloneStreamPointer);
@@ -1404,11 +1487,30 @@ KsStreamPointerClone(
/* copy stream pointer */
RtlMoveMemory(NewFrame, CurFrame, sizeof(KSISTREAM_POINTER));
+ /* locate pin */
+ This = (IKsPinImpl*)CONTAINING_RECORD(CurFrame->Pin, IKsPinImpl, Pin);
+
+ /* prepare stream header in case required */
+ if (CurFrame->StreamPointer.Offset->Remaining == 0)
+ {
+ Status = IKsPin_PrepareStreamHeader(This, NewFrame);
+ if (!NT_SUCCESS(Status))
+ {
+ FreeItem(NewFrame);
+ return STATUS_DEVICE_NOT_READY;
+ }
+ }
+
if (ContextSize)
NewFrame->StreamPointer.Context = (NewFrame + 1);
- /* locate pin */
- This = (IKsPinImpl*)CONTAINING_RECORD(CurFrame->Pin, IKsPinImpl, Pin);
+
+ if (This->Pin.Descriptor->PinDescriptor.DataFlow == KSPIN_DATAFLOW_IN)
+ NewFrame->StreamPointer.Offset = &NewFrame->StreamPointer.OffsetIn;
+ else
+ NewFrame->StreamPointer.Offset = &NewFrame->StreamPointer.OffsetOut;
+
+
NewFrame->StreamPointer.Pin = &This->Pin;
@@ -1420,6 +1522,8 @@ KsStreamPointerClone(
/* store result */
*CloneStreamPointer = &NewFrame->StreamPointer;
+ DPRINT("KsStreamPointerClone CloneStreamPointer %p\n", *CloneStreamPointer);
+
return STATUS_SUCCESS;
}
@@ -1437,52 +1541,46 @@ KsStreamPointerAdvanceOffsets(
{
PKSISTREAM_POINTER CurFrame;
IKsPinImpl * This;
+ NTSTATUS Status;
- DPRINT("KsStreamPointerAdvanceOffsets InUsed %lu OutUsed %lu Eject %lu\n", InUsed, OutUsed, Eject);
+ DPRINT("KsStreamPointerAdvanceOffsets StreamPointer %p InUsed %lu OutUsed %lu Eject %lu\n", StreamPointer, InUsed, OutUsed, Eject);
/* get stream pointer */
CurFrame = (PKSISTREAM_POINTER)CONTAINING_RECORD(StreamPointer, KSISTREAM_POINTER, StreamPointer);
- CurFrame->StreamPointer.OffsetIn.Remaining -= InUsed;
- CurFrame->StreamPointer.OffsetOut.Remaining -= OutUsed;
- CurFrame->StreamPointer.OffsetIn.Count -= InUsed;
- CurFrame->StreamPointer.OffsetOut.Count -= OutUsed;
- CurFrame->StreamPointer.OffsetIn.Data = (PVOID)((ULONG_PTR)CurFrame->StreamPointer.OffsetIn.Data + InUsed);
- CurFrame->StreamPointer.OffsetOut.Data = (PVOID)((ULONG_PTR)CurFrame->StreamPointer.OffsetOut.Data + OutUsed);
-
- if (!CurFrame->StreamPointer.OffsetIn.Remaining)
- CurFrame->StreamPointer.OffsetIn.Data = NULL;
-
- if (!CurFrame->StreamPointer.OffsetOut.Remaining)
- CurFrame->StreamPointer.OffsetOut.Data = NULL;
-
/* locate pin */
This = (IKsPinImpl*)CONTAINING_RECORD(CurFrame->Pin, IKsPinImpl, Pin);
+ /* TODO */
+ ASSERT(InUsed == 0);
+ ASSERT(Eject == 0);
+ ASSERT(OutUsed);
+
+ DPRINT("KsStreamPointerAdvanceOffsets Offset %lu Length %lu NewOffset %lu Remaining %lu LeadingEdge %p DataUsed %lu\n", CurFrame->Offset, CurFrame->Length, CurFrame->Offset + OutUsed,
+CurFrame->StreamPointer.OffsetOut.Remaining, &This->LeadingEdgeStreamPointer.StreamPointer, CurFrame->StreamPointer.StreamHeader->DataUsed);
+DbgBreakPoint();
+
if (This->Pin.Descriptor->PinDescriptor.DataFlow == KSPIN_DATAFLOW_IN)
{
- if (CurFrame->StreamPointer.OffsetIn.Remaining == 0)
- {
- /* get next mapping */
- This->Irp = KsRemoveIrpFromCancelableQueue(&This->IrpList, &This->IrpListLock, KsListEntryHead, KsAcquireAndRemoveOnlySingleItem);
- if (!This->Irp)
- return STATUS_DEVICE_NOT_READY;
-
- /* FIXME handle me */
- ASSERT(0);
- }
+ ASSERT(CurFrame->StreamPointer.OffsetIn.Remaining >= InUsed);
+ CurFrame->StreamPointer.OffsetIn.Remaining -= InUsed;
+ CurFrame->StreamPointer.OffsetIn.Data = (PVOID)((ULONG_PTR)CurFrame->StreamPointer.OffsetIn.Data + InUsed);
}
else
{
- if (CurFrame->StreamPointer.OffsetOut.Remaining == 0)
+ if (!CurFrame->StreamPointer.OffsetOut.Remaining)
{
- /* get next mapping */
- This->Irp = KsRemoveIrpFromCancelableQueue(&This->IrpList, &This->IrpListLock, KsListEntryHead, KsAcquireAndRemoveOnlySingleItem);
- if (!This->Irp)
+ Status = IKsPin_PrepareStreamHeader(This, CurFrame);
+ if (!NT_SUCCESS(Status))
+ {
return STATUS_DEVICE_NOT_READY;
-
- /* FIXME handle me */
- ASSERT(0);
+ }
+ }
+ else
+ {
+ ASSERT(CurFrame->StreamPointer.OffsetOut.Remaining >= OutUsed);
+ CurFrame->StreamPointer.OffsetOut.Remaining -= OutUsed;
+ CurFrame->StreamPointer.OffsetOut.Data = (PVOID)((ULONG_PTR)CurFrame->StreamPointer.OffsetOut.Data + OutUsed);
}
}
@@ -1499,6 +1597,7 @@ KsStreamPointerAdvance(
IN PKSSTREAM_POINTER StreamPointer)
{
UNIMPLEMENTED
+ DbgBreakPoint();
return STATUS_NOT_IMPLEMENTED;
}
@@ -1542,7 +1641,10 @@ KsStreamPointerScheduleTimeout(
IN ULONGLONG Interval)
{
LARGE_INTEGER DueTime;
- PKSISTREAM_POINTER Pointer = (PKSISTREAM_POINTER)StreamPointer;
+ PKSISTREAM_POINTER Pointer;
+
+ /* get stream pointer */
+ Pointer = (PKSISTREAM_POINTER)CONTAINING_RECORD(StreamPointer, KSISTREAM_POINTER, StreamPointer);
/* setup timer callback */
Pointer->Callback = Callback;
@@ -1564,7 +1666,10 @@ NTAPI
KsStreamPointerCancelTimeout(
IN PKSSTREAM_POINTER StreamPointer)
{
- PKSISTREAM_POINTER Pointer = (PKSISTREAM_POINTER)StreamPointer;
+ PKSISTREAM_POINTER Pointer;
+
+ /* get stream pointer */
+ Pointer = (PKSISTREAM_POINTER)CONTAINING_RECORD(StreamPointer, KSISTREAM_POINTER, StreamPointer);
KeCancelTimer(&Pointer->Timer);
@@ -1582,7 +1687,7 @@ KsPinGetFirstCloneStreamPointer(
IKsPinImpl * This;
DPRINT("KsPinGetFirstCloneStreamPointer %p\n", Pin);
- DbgBreakPoint();
+DbgBreakPoint();
This = (IKsPinImpl*)CONTAINING_RECORD(Pin, IKsPinImpl, Pin);
/* return first cloned stream pointer */
return &This->ClonedStreamPointer->StreamPointer;
@@ -1597,10 +1702,14 @@ NTAPI
KsStreamPointerGetNextClone(
IN PKSSTREAM_POINTER StreamPointer)
{
- PKSISTREAM_POINTER Pointer = (PKSISTREAM_POINTER)StreamPointer;
+ PKSISTREAM_POINTER Pointer;
DPRINT("KsStreamPointerGetNextClone\n");
- DbgBreakPoint();
+DbgBreakPoint();
+ /* get stream pointer */
+ Pointer = (PKSISTREAM_POINTER)CONTAINING_RECORD(StreamPointer, KSISTREAM_POINTER, StreamPointer);
+
+
/* is there a another cloned stream pointer */
if (!Pointer->Next)
return NULL;
@@ -1614,11 +1723,7 @@ NTAPI
IKsPin_PinCentricWorker(
IN PVOID Parameter)
{
- PIO_STACK_LOCATION IoStack;
- PKSSTREAM_HEADER Header;
- ULONG NumHeaders;
NTSTATUS Status;
- PIRP Irp;
IKsPinImpl * This = (IKsPinImpl*)Parameter;
DPRINT("IKsPin_PinCentricWorker\n");
@@ -1630,77 +1735,22 @@ IKsPin_PinCentricWorker(
ASSERT(This->Pin.Descriptor->Dispatch->Process);
ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL);
ASSERT(!(This->Pin.Descriptor->Flags & KSPIN_FLAG_DISPATCH_LEVEL_PROCESSING));
- ASSERT(This->LeadingEdgeStreamPointer);
+ ASSERT(!(This->Pin.Descriptor->Flags & KSPIN_FLAG_GENERATE_MAPPINGS));
do
{
- /* do we have an irp packet */
- if (!This->Irp)
- {
- /* fetch new irp packet */
- This->Irp = KsRemoveIrpFromCancelableQueue(&This->IrpList, &This->IrpListLock, KsListEntryHead, KsAcquireAndRemoveOnlySingleItem);
-
- if (!This->Irp)
- {
- /* reached last packet */
- break;
- }
- }
-
- /* get current irp stack location */
- IoStack = IoGetCurrentIrpStackLocation(This->Irp);
-
- if (This->Irp->RequestorMode == UserMode)
- This->LeadingEdgeStreamPointer->StreamPointer.StreamHeader = Header = (PKSSTREAM_HEADER)This->Irp->AssociatedIrp.SystemBuffer;
- else
- This->LeadingEdgeStreamPointer->StreamPointer.StreamHeader = Header = (PKSSTREAM_HEADER)This->Irp->UserBuffer;
-
- /* calculate num headers */
- NumHeaders = IoStack->Parameters.DeviceIoControl.OutputBufferLength / Header->Size;
-
- /* assume headers of same length */
- ASSERT(IoStack->Parameters.DeviceIoControl.OutputBufferLength % Header->Size == 0);
-
- /* FIXME support multiple stream headers */
- ASSERT(NumHeaders == 1);
-
- if (This->Irp->RequestorMode == UserMode)
- {
- /* prepare header */
- Header->Data = MmGetSystemAddressForMdlSafe(This->Irp->MdlAddress, NormalPagePriority);
- }
-
- /* set up stream pointer */
- This->LeadingEdgeStreamPointer->Irp = Irp = This->Irp;
- This->LeadingEdgeStreamPointer->StreamPointer.Context = NULL;
- This->LeadingEdgeStreamPointer->StreamPointer.Pin = &This->Pin;
- This->LeadingEdgeStreamPointer->StreamPointer.OffsetOut.Count = max(Header->DataUsed, Header->FrameExtent);
- This->LeadingEdgeStreamPointer->StreamPointer.OffsetOut.Data = Header->Data;
- This->LeadingEdgeStreamPointer->StreamPointer.OffsetOut.Count = max(Header->DataUsed, Header->FrameExtent);
- This->LeadingEdgeStreamPointer->StreamPointer.OffsetOut.Remaining = max(Header->DataUsed, Header->FrameExtent);
- This->LeadingEdgeStreamPointer->Pin = &This->Pin;
-
DPRINT("IKsPin_PinCentricWorker calling Pin Process Routine\n");
- Status = This->Pin.Descriptor->Dispatch->Process(&This->Pin);
- DPRINT("IKsPin_PinCentricWorker Status %lx, Count %lu Remaining %lu\n", Status,
- This->LeadingEdgeStreamPointer->StreamPointer.Offset->Count,
- This->LeadingEdgeStreamPointer->StreamPointer.Offset->Remaining);
-
- ASSERT(Status != STATUS_PENDING);
-
- // HACK complete irp
- Irp->IoStatus.Information = max(Header->DataUsed, Header->FrameExtent);
- Irp->IoStatus.Status = Status;
- IoCompleteRequest(Irp, IO_NO_INCREMENT);
- KsDecrementCountedWorker(This->PinWorker);
-
-
+ Status = This->Pin.Descriptor->Dispatch->Process(&This->Pin);
+ DPRINT("IKsPin_PinCentricWorker Status %lx, Offset %lu Length %lu\n", Status,
+ This->LeadingEdgeStreamPointer.Offset,
+ This->LeadingEdgeStreamPointer.Length);
break;
- }while(TRUE);
+ }while(This->IrpCount);
}
+
NTSTATUS
NTAPI
IKsPin_DispatchKsStream(
@@ -1709,6 +1759,8 @@ IKsPin_DispatchKsStream(
IKsPinImpl * This)
{
PKSPROCESSPIN_INDEXENTRY ProcessPinIndex;
+ PKSSTREAM_HEADER Header;
+ ULONG NumHeaders;
PKSFILTER Filter;
PIO_STACK_LOCATION IoStack;
NTSTATUS Status = STATUS_SUCCESS;
@@ -1721,6 +1773,7 @@ IKsPin_DispatchKsStream(
/* get current stack location */
IoStack = IoGetCurrentIrpStackLocation(Irp);
+ /* probe stream pointer */
if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_WRITE_STREAM)
Status = KsProbeStreamIrp(Irp, KSSTREAM_WRITE | KSPROBE_ALLOCATEMDL | KSPROBE_PROBEANDLOCK | KSPROBE_SYSTEMADDRESS, This->Pin.StreamHeaderSize);
else
@@ -1735,6 +1788,46 @@ IKsPin_DispatchKsStream(
return Status;
}
+ if (Irp->RequestorMode == UserMode)
+ Header = (PKSSTREAM_HEADER)Irp->AssociatedIrp.SystemBuffer;
+ else
+ Header = (PKSSTREAM_HEADER)Irp->UserBuffer;
+
+ if (!Header)
+ {
+ DPRINT("NoHeader Canceling Irp %p\n", Irp);
+ Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return Status;
+ }
+
+ /* calculate num headers */
+ NumHeaders = IoStack->Parameters.DeviceIoControl.OutputBufferLength / Header->Size;
+
+ /* assume headers of same length */
+ ASSERT(IoStack->Parameters.DeviceIoControl.OutputBufferLength % Header->Size == 0);
+
+ /* FIXME support multiple stream headers */
+ ASSERT(NumHeaders == 1);
+
+ if (Irp->RequestorMode == UserMode)
+ {
+ /* prepare header */
+ ASSERT(Irp->MdlAddress);
+ Header->Data = MmGetSystemAddressForMdlSafe(Irp->MdlAddress, NormalPagePriority);
+
+ if (!Header->Data)
+ {
+ DPRINT("NoHeader->Data Canceling Irp %p\n", Irp);
+ Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return Status;
+ }
+
+ }
+
+
+
if (This->Pin.Descriptor->Dispatch->Process)
{
/* it is a pin centric avstream */
@@ -1749,6 +1842,10 @@ IKsPin_DispatchKsStream(
ASSERT(!(This->Pin.Descriptor->Flags & KSPIN_FLAG_DISPATCH_LEVEL_PROCESSING));
ASSERT(This->PinWorker);
+ InterlockedIncrement(&This->IrpCount);
+
+ DPRINT("IKsPin_DispatchKsStream IrpCount %lu\n", This->IrpCount);
+
/* start the processing loop */
KsIncrementCountedWorker(This->PinWorker);
@@ -1782,7 +1879,6 @@ IKsPin_DispatchKsStream(
/* add irp to cancelable queue */
KsAddIrpToCancelableQueue(&This->IrpList, &This->IrpListLock, Irp, KsListEntryTail, NULL /* FIXME */);
-
Status = Filter->Descriptor->Dispatch->Process(Filter, ProcessPinIndex);
DPRINT("IKsPin_DispatchKsStream FilterCentric: Status %lx \n", Status);
@@ -2110,6 +2206,9 @@ KspCreatePin(
NTSTATUS Status;
PKSDATAFORMAT DataFormat;
PKSBASIC_HEADER BasicHeader;
+ ULONG Index;
+ ULONG FrameSize = 0;
+ ULONG NumFrames = 0;
/* sanity checks */
ASSERT(Descriptor->Dispatch);
@@ -2119,6 +2218,52 @@ KspCreatePin(
//Output Pin: KSPIN_FLAG_PROCESS_IN_RUN_STATE_ONLY
//Input Pin: KSPIN_FLAG_FIXED_FORMAT|KSPIN_FLAG_DO_NOT_USE_STANDARD_TRANSPORT|KSPIN_FLAG_FRAMES_NOT_REQUIRED_FOR_PROCESSING
+
+ if (Descriptor->AllocatorFraming)
+ {
+ DPRINT("KspCreatePin Dataflow %lu\n", Descriptor->PinDescriptor.DataFlow);
+ DPRINT("KspCreatePin CountItems %lu\n", Descriptor->AllocatorFraming->CountItems);
+ DPRINT("KspCreatePin PinFlags %lx\n", Descriptor->AllocatorFraming->PinFlags);
+ DPRINT("KspCreatePin OutputCompression RatioNumerator %lu RatioDenominator %lu RatioConstantMargin %lu\n", Descriptor->AllocatorFraming->OutputCompression.RatioNumerator,
+ Descriptor->AllocatorFraming->OutputCompression.RatioDenominator, Descriptor->AllocatorFraming->OutputCompression.RatioConstantMargin);
+ DPRINT("KspCreatePin PinWeight %lx\n", Descriptor->AllocatorFraming->PinWeight);
+
+ for(Index = 0; Index < Descriptor->AllocatorFraming->CountItems; Index++)
+ {
+ DPRINT("KspCreatePin Index %lu MemoryFlags %lx\n", Index, Descriptor->AllocatorFraming->FramingItem[Index].MemoryFlags);
+ DPRINT("KspCreatePin Index %lu BusFlags %lx\n", Index, Descriptor->AllocatorFraming->FramingItem[Index].BusFlags);
+ DPRINT("KspCreatePin Index %lu Flags %lx\n", Index, Descriptor->AllocatorFraming->FramingItem[Index].Flags);
+ DPRINT("KspCreatePin Index %lu Frames %lu\n", Index, Descriptor->AllocatorFraming->FramingItem[Index].Frames);
+ DPRINT("KspCreatePin Index %lu FileAlignment %lx\n", Index, Descriptor->AllocatorFraming->FramingItem[Index].FileAlignment);
+ DPRINT("KspCreatePin Index %lu MemoryTypeWeight %lx\n", Index, Descriptor->AllocatorFraming->FramingItem[Index].MemoryTypeWeight);
+ DPRINT("KspCreatePin Index %lu PhysicalRange MinFrameSize %lu MaxFrameSize %lu Stepping %lu\n", Index, Descriptor->AllocatorFraming->FramingItem[Index].PhysicalRange.MinFrameSize,
+ Descriptor->AllocatorFraming->FramingItem[Index].PhysicalRange.MaxFrameSize,
+ Descriptor->AllocatorFraming->FramingItem[Index].PhysicalRange.Stepping);
+
+ DPRINT("KspCreatePin Index %lu FramingRange MinFrameSize %lu MaxFrameSize %lu Stepping %lu InPlaceWeight %lu NotInPlaceWeight %lu\n",
+ Index,
+ Descriptor->AllocatorFraming->FramingItem[Index].FramingRange.Range.MinFrameSize,
+ Descriptor->AllocatorFraming->FramingItem[Index].FramingRange.Range.MaxFrameSize,
+ Descriptor->AllocatorFraming->FramingItem[Index].FramingRange.Range.Stepping,
+ Descriptor->AllocatorFraming->FramingItem[Index].FramingRange.InPlaceWeight,
+ Descriptor->AllocatorFraming->FramingItem[Index].FramingRange.NotInPlaceWeight);
+
+ FrameSize = Descriptor->AllocatorFraming->FramingItem[Index].FramingRange.Range.MaxFrameSize;
+ NumFrames = Descriptor->AllocatorFraming->FramingItem[Index].Frames;
+ }
+ }
+
+ if (!FrameSize)
+ {
+ /* default to 50 * 188 (MPEG2 TS packet size) */
+ FrameSize = 9400;
+ }
+
+ if (!NumFrames)
+ {
+ NumFrames = 8;
+ }
+
/* get current irp stack */
IoStack = IoGetCurrentIrpStackLocation(Irp);
@@ -2158,12 +2303,13 @@ KspCreatePin(
This->BasicHeader.ControlMutex = BasicHeader->ControlMutex;
ASSERT(This->BasicHeader.ControlMutex);
-
InitializeListHead(&This->BasicHeader.EventList);
KeInitializeSpinLock(&This->BasicHeader.EventListLock);
/* initialize pin */
This->lpVtbl = &vt_IKsPin;
+ This->FrameSize = FrameSize;
+ This->NumFrames = NumFrames;
This->lpVtblReferenceClock = &vt_ReferenceClock;
This->ref = 1;
This->FileObject = IoStack->FileObject;
@@ -2172,7 +2318,6 @@ KspCreatePin(
InitializeListHead(&This->IrpList);
KeInitializeSpinLock(&This->IrpListLock);
-
/* allocate object bag */
This->Pin.Bag = AllocateItem(NonPagedPool, sizeof(KSIOBJECT_BAG));
if (!This->Pin.Bag)
@@ -2270,7 +2415,7 @@ KspCreatePin(
This->ProcessPin.Flags = 0;
This->ProcessPin.InPlaceCounterpart = NULL;
This->ProcessPin.Pin = &This->Pin;
- This->ProcessPin.StreamPointer = (PKSSTREAM_POINTER)This->LeadingEdgeStreamPointer;
+ This->ProcessPin.StreamPointer = (PKSSTREAM_POINTER)&This->LeadingEdgeStreamPointer.StreamPointer;
This->ProcessPin.Terminate = FALSE;
Status = Filter->lpVtbl->AddProcessPin(Filter, &This->ProcessPin);
@@ -2291,18 +2436,6 @@ KspCreatePin(
{
/* pin centric processing filter */
- /* allocate leading stream pointer */
- Status = _KsEdit(This->Pin.Bag, (PVOID*)&This->LeadingEdgeStreamPointer, sizeof(KSISTREAM_POINTER), sizeof(KSISTREAM_POINTER), 0);
-
- /* FIXME cleanup */
- ASSERT(Status == STATUS_SUCCESS);
-
- /* FIXME cleanup */
- ASSERT(Status == STATUS_SUCCESS);
-
- /* setup stream pointer offset */
- This->LeadingEdgeStreamPointer->StreamPointer.Offset = &This->LeadingEdgeStreamPointer->StreamPointer.OffsetOut;
-
/* initialize work item */
ExInitializeWorkItem(&This->PinWorkQueueItem, IKsPin_PinCentricWorker, (PVOID)This);
@@ -2319,6 +2452,12 @@ KspCreatePin(
return Status;
}
+ if (This->Pin.Descriptor->PinDescriptor.DataFlow == KSPIN_DATAFLOW_IN)
+ This->LeadingEdgeStreamPointer.StreamPointer.Offset = &This->LeadingEdgeStreamPointer.StreamPointer.OffsetIn;
+ else
+ This->LeadingEdgeStreamPointer.StreamPointer.Offset = &This->LeadingEdgeStreamPointer.StreamPointer.OffsetOut;
+
+
KeInitializeEvent(&This->FrameComplete, NotificationEvent, FALSE);
}
diff --git a/reactos/drivers/ksfilter/ks/priv.h b/reactos/drivers/ksfilter/ks/priv.h
index 86ea4ebba64..eb38f882021 100644
--- a/reactos/drivers/ksfilter/ks/priv.h
+++ b/reactos/drivers/ksfilter/ks/priv.h
@@ -4,7 +4,8 @@
#include
#include
-#define NDEBUG
+//#define NDEBUG
+#define YDEBUG
#include
#include
#include
@@ -16,8 +17,11 @@
#include "kstypes.h"
#include "ksiface.h"
+#include "ksmedia.h"
#define TAG_DEVICE_HEADER 'KSDH'
+#define REG_PINFLAG_B_MANY 0x4 /* strmif.h */
+#define MERIT_DO_NOT_USE 0x200000 /* dshow.h */
#define DEFINE_KSPROPERTY_PINPROPOSEDATAFORMAT(PinSet,\
PropGeneral, PropInstances, PropIntersection)\
From 5fcb03c68d2b70f4249a2aa28a9f35cb6a62e582 Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Wed, 7 Apr 2010 23:03:59 +0000
Subject: [PATCH 074/261] [ISAPNP] - Fix a typo
svn path=/trunk/; revision=46775
---
reactos/drivers/bus/isapnp/hardware.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/reactos/drivers/bus/isapnp/hardware.c b/reactos/drivers/bus/isapnp/hardware.c
index 67a903948f8..99e5d44aa33 100644
--- a/reactos/drivers/bus/isapnp/hardware.c
+++ b/reactos/drivers/bus/isapnp/hardware.c
@@ -352,7 +352,7 @@ TryIsolate(PUCHAR ReadDataPort)
HwDelay();
Data = ((Data << 8) | ReadData(ReadDataPort));
HwDelay();
- Data >>= 1;
+ Byte >>= 1;
if (Data != 0xFFFF)
{
From ba87c15658070e6ae7f871602b662ad5c7d9499d Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Thu, 8 Apr 2010 02:18:27 +0000
Subject: [PATCH 075/261] [TXTSETUP.SIF] - Add PnP information for isapnp
[REACTOS.DFF] - Remove isapnp
svn path=/trunk/; revision=46776
---
reactos/boot/bootdata/packages/reactos.dff | 2 --
reactos/boot/bootdata/txtsetup.sif | 6 +++++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/reactos/boot/bootdata/packages/reactos.dff b/reactos/boot/bootdata/packages/reactos.dff
index 895b3fc2fb5..a4d4de2a79b 100644
--- a/reactos/boot/bootdata/packages/reactos.dff
+++ b/reactos/boot/bootdata/packages/reactos.dff
@@ -489,8 +489,6 @@ drivers\base\nmidebug\nmidebug.sys 2
drivers\battery\battc\battc.sys 2
-drivers\bus\isapnp\isapnp.sys 2
-
drivers\bus\acpi\cmbatt\cmbatt.sys 2
drivers\bus\acpi\compbatt\compbatt.sys 2
diff --git a/reactos/boot/bootdata/txtsetup.sif b/reactos/boot/bootdata/txtsetup.sif
index 870c0d26951..4da20f331da 100644
--- a/reactos/boot/bootdata/txtsetup.sif
+++ b/reactos/boot/bootdata/txtsetup.sif
@@ -22,6 +22,7 @@ c_1252.nls=,,,,,,,,,,,,2
cdfs.sys=,,,,,,x,,,,,,4
cdrom.sys=,,,,,,x,,,,,,4
class2.sys=,,,,,,x,,,,,,4
+isapnp.sys=,,,,,,,,,,,,4
kdcom.dll=,,,,,,,,,,,,2
disk.sys=,,,,,,x,,,,,,4
floppy.sys=,,,,,,x,,,,,,4
@@ -36,13 +37,16 @@ ramdisk.sys=,,,,,,x,,,,,,4
ext2.sys=,,,,,,x,,,,,,4
[HardwareIdsDatabase]
-*PNP0C08 = acpi
+*PNP0A00 = isapnp
*PNP0A03 = pci
+*PNP0C08 = acpi
+PCI\CC_0601 = isapnp
PCI\CC_0604 = pci
[BootBusExtenders.Load]
acpi = acpi.sys
pci = pci.sys
+isapnp = isapnp.sys
[Cabinets]
Cabinet=reactos.cab
From fc4cd6d714ed91677c44a315320fffadd5668a85 Mon Sep 17 00:00:00 2001
From: Johannes Anderwald
Date: Thu, 8 Apr 2010 08:38:50 +0000
Subject: [PATCH 076/261] [KS] - Disable debugging traces
svn path=/trunk/; revision=46777
---
reactos/drivers/ksfilter/ks/priv.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/reactos/drivers/ksfilter/ks/priv.h b/reactos/drivers/ksfilter/ks/priv.h
index eb38f882021..ec5976be238 100644
--- a/reactos/drivers/ksfilter/ks/priv.h
+++ b/reactos/drivers/ksfilter/ks/priv.h
@@ -4,8 +4,8 @@
#include
#include
-//#define NDEBUG
-#define YDEBUG
+#define NDEBUG
+//#define YDEBUG
#include
#include
#include
From 169a95782aabd182d08d8734ae99599beeeae771 Mon Sep 17 00:00:00 2001
From: Aleksey Bragin
Date: Thu, 8 Apr 2010 09:39:24 +0000
Subject: [PATCH 077/261] [DRIVERS/GREEN] - Includes cleanup, fix NDK
inclusion.
svn path=/trunk/; revision=46779
---
rosapps/drivers/green/green.h | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/rosapps/drivers/green/green.h b/rosapps/drivers/green/green.h
index 4e32131ab35..5c3f1b20084 100644
--- a/rosapps/drivers/green/green.h
+++ b/rosapps/drivers/green/green.h
@@ -1,7 +1,6 @@
-#include
+#include
#include
-#include
-#include
+#include
#include
#define WINBASEAPI
typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES;
From 0d672ad7cde4e542305d72b4412ddf30a24996b6 Mon Sep 17 00:00:00 2001
From: Johannes Anderwald
Date: Thu, 8 Apr 2010 20:14:38 +0000
Subject: [PATCH 078/261] [KS] - Fix tons of bugs in KsMergeAutomationTable -
Implement removing instantiated filter from filter factory when filter is
about to be closed - Fix a memory corrupion bug in KspHandleDataIntersection
svn path=/trunk/; revision=46780
---
reactos/drivers/ksfilter/ks/api.c | 53 +++++++++++------
reactos/drivers/ksfilter/ks/filter.c | 88 ++++++++++++++++++++++++++--
2 files changed, 118 insertions(+), 23 deletions(-)
diff --git a/reactos/drivers/ksfilter/ks/api.c b/reactos/drivers/ksfilter/ks/api.c
index f1ac9a848db..2fae3669083 100644
--- a/reactos/drivers/ksfilter/ks/api.c
+++ b/reactos/drivers/ksfilter/ks/api.c
@@ -2096,8 +2096,15 @@ KspCountMethodSets(
if (!AutomationTableB)
return AutomationTableA->MethodSetsCount;
- /* sanity check */
- ASSERT(AutomationTableA->MethodItemSize == AutomationTableB->MethodItemSize);
+
+ DPRINT("AutomationTableA MethodItemSize %lu MethodSetsCount %lu\n", AutomationTableA->MethodItemSize, AutomationTableA->MethodSetsCount);
+ DPRINT("AutomationTableB MethodItemSize %lu MethodSetsCount %lu\n", AutomationTableB->MethodItemSize, AutomationTableB->MethodSetsCount);
+
+ if (AutomationTableA->MethodItemSize && AutomationTableB->MethodItemSize)
+ {
+ /* sanity check */
+ ASSERT(AutomationTableA->MethodItemSize == AutomationTableB->MethodItemSize);
+ }
/* now iterate all property sets and compare their guids */
Count = AutomationTableA->MethodSetsCount;
@@ -2138,8 +2145,14 @@ KspCountEventSets(
if (!AutomationTableB)
return AutomationTableA->EventSetsCount;
- /* sanity check */
- ASSERT(AutomationTableA->EventItemSize == AutomationTableB->EventItemSize);
+ DPRINT("AutomationTableA EventItemSize %lu EventSetsCount %lu\n", AutomationTableA->EventItemSize, AutomationTableA->EventSetsCount);
+ DPRINT("AutomationTableB EventItemSize %lu EventSetsCount %lu\n", AutomationTableB->EventItemSize, AutomationTableB->EventSetsCount);
+
+ if (AutomationTableA->EventItemSize && AutomationTableB->EventItemSize)
+ {
+ /* sanity check */
+ ASSERT(AutomationTableA->EventItemSize == AutomationTableB->EventItemSize);
+ }
/* now iterate all Event sets and compare their guids */
Count = AutomationTableA->EventSetsCount;
@@ -2182,6 +2195,8 @@ KspCountPropertySets(
return AutomationTableA->PropertySetsCount;
/* sanity check */
+ DPRINT("AutomationTableA EventItemSize %lu PropertySetsCount %lu\n", AutomationTableA->PropertyItemSize, AutomationTableA->PropertySetsCount);
+ DPRINT("AutomationTableB EventItemSize %lu PropertySetsCount %lu\n", AutomationTableB->PropertyItemSize, AutomationTableB->PropertySetsCount);
ASSERT(AutomationTableA->PropertyItemSize == AutomationTableB->PropertyItemSize);
/* now iterate all property sets and compare their guids */
@@ -2221,18 +2236,18 @@ KspCopyMethodSets(
if (!AutomationTableA)
{
/* copy of property set */
- RtlMoveMemory((PVOID)Table->MethodSets, AutomationTableB->MethodSets, Table->MethodItemSize * AutomationTableB->MethodSetsCount);
+ RtlMoveMemory((PVOID)Table->MethodSets, AutomationTableB->MethodSets, sizeof(KSMETHOD_SET) * AutomationTableB->MethodSetsCount);
return STATUS_SUCCESS;
}
else if (!AutomationTableB)
{
/* copy of property set */
- RtlMoveMemory((PVOID)Table->MethodSets, AutomationTableA->MethodSets, Table->MethodItemSize * AutomationTableA->MethodSetsCount);
+ RtlMoveMemory((PVOID)Table->MethodSets, AutomationTableA->MethodSets, sizeof(KSMETHOD_SET) * AutomationTableA->MethodSetsCount);
return STATUS_SUCCESS;
}
/* first copy all property items from dominant table */
- RtlMoveMemory((PVOID)Table->MethodSets, AutomationTableA->MethodSets, Table->MethodItemSize * AutomationTableA->MethodSetsCount);
+ RtlMoveMemory((PVOID)Table->MethodSets, AutomationTableA->MethodSets, sizeof(KSMETHOD_SET) * AutomationTableA->MethodSetsCount);
/* set counter */
Count = AutomationTableA->MethodSetsCount;
@@ -2255,7 +2270,7 @@ KspCopyMethodSets(
if (!bFound)
{
/* copy new property item set */
- RtlMoveMemory((PVOID)&Table->MethodSets[Count], &AutomationTableB->MethodSets[Index], Table->MethodItemSize);
+ RtlMoveMemory((PVOID)&Table->MethodSets[Count], &AutomationTableB->MethodSets[Index], sizeof(KSMETHOD_SET));
Count++;
}
}
@@ -2276,18 +2291,18 @@ KspCopyPropertySets(
if (!AutomationTableA)
{
/* copy of property set */
- RtlMoveMemory((PVOID)Table->PropertySets, AutomationTableB->PropertySets, Table->PropertyItemSize * AutomationTableB->PropertySetsCount);
+ RtlMoveMemory((PVOID)Table->PropertySets, AutomationTableB->PropertySets, sizeof(KSPROPERTY_SET) * AutomationTableB->PropertySetsCount);
return STATUS_SUCCESS;
}
else if (!AutomationTableB)
{
/* copy of property set */
- RtlMoveMemory((PVOID)Table->PropertySets, AutomationTableA->PropertySets, Table->PropertyItemSize * AutomationTableA->PropertySetsCount);
+ RtlMoveMemory((PVOID)Table->PropertySets, AutomationTableA->PropertySets, sizeof(KSPROPERTY_SET) * AutomationTableA->PropertySetsCount);
return STATUS_SUCCESS;
}
/* first copy all property items from dominant table */
- RtlMoveMemory((PVOID)Table->PropertySets, AutomationTableA->PropertySets, Table->PropertyItemSize * AutomationTableA->PropertySetsCount);
+ RtlMoveMemory((PVOID)Table->PropertySets, AutomationTableA->PropertySets, sizeof(KSPROPERTY_SET) * AutomationTableA->PropertySetsCount);
/* set counter */
Count = AutomationTableA->PropertySetsCount;
@@ -2310,7 +2325,7 @@ KspCopyPropertySets(
if (!bFound)
{
/* copy new property item set */
- RtlMoveMemory((PVOID)&Table->PropertySets[Count], &AutomationTableB->PropertySets[Index], Table->PropertyItemSize);
+ RtlMoveMemory((PVOID)&Table->PropertySets[Count], &AutomationTableB->PropertySets[Index], sizeof(KSPROPERTY_SET));
Count++;
}
}
@@ -2330,18 +2345,18 @@ KspCopyEventSets(
if (!AutomationTableA)
{
/* copy of Event set */
- RtlMoveMemory((PVOID)Table->EventSets, AutomationTableB->EventSets, Table->EventItemSize * AutomationTableB->EventSetsCount);
+ RtlMoveMemory((PVOID)Table->EventSets, AutomationTableB->EventSets, sizeof(KSEVENT_SET) * AutomationTableB->EventSetsCount);
return STATUS_SUCCESS;
}
else if (!AutomationTableB)
{
/* copy of Event set */
- RtlMoveMemory((PVOID)Table->EventSets, AutomationTableA->EventSets, Table->EventItemSize * AutomationTableA->EventSetsCount);
+ RtlMoveMemory((PVOID)Table->EventSets, AutomationTableA->EventSets, sizeof(KSEVENT_SET) * AutomationTableA->EventSetsCount);
return STATUS_SUCCESS;
}
/* first copy all Event items from dominant table */
- RtlMoveMemory((PVOID)Table->EventSets, AutomationTableA->EventSets, Table->EventItemSize * AutomationTableA->EventSetsCount);
+ RtlMoveMemory((PVOID)Table->EventSets, AutomationTableA->EventSets, sizeof(KSEVENT_SET) * AutomationTableA->EventSetsCount);
/* set counter */
Count = AutomationTableA->EventSetsCount;
@@ -2364,7 +2379,7 @@ KspCopyEventSets(
if (!bFound)
{
/* copy new Event item set */
- RtlMoveMemory((PVOID)&Table->EventSets[Count], &AutomationTableB->EventSets[Index], Table->EventItemSize);
+ RtlMoveMemory((PVOID)&Table->EventSets[Count], &AutomationTableB->EventSets[Index], sizeof(KSEVENT_SET));
Count++;
}
}
@@ -2428,7 +2443,7 @@ KsMergeAutomationTables(
}
/* now allocate the property sets */
- Table->PropertySets = AllocateItem(NonPagedPool, Table->PropertyItemSize * Table->PropertySetsCount);
+ Table->PropertySets = AllocateItem(NonPagedPool, sizeof(KSPROPERTY_SET) * Table->PropertySetsCount);
if (!Table->PropertySets)
{
@@ -2471,7 +2486,7 @@ KsMergeAutomationTables(
}
/* now allocate the property sets */
- Table->MethodSets = AllocateItem(NonPagedPool, Table->MethodItemSize * Table->MethodSetsCount);
+ Table->MethodSets = AllocateItem(NonPagedPool, sizeof(KSMETHOD_SET) * Table->MethodSetsCount);
if (!Table->MethodSets)
{
@@ -2514,7 +2529,7 @@ KsMergeAutomationTables(
}
/* now allocate the property sets */
- Table->EventSets = AllocateItem(NonPagedPool, Table->EventItemSize * Table->EventSetsCount);
+ Table->EventSets = AllocateItem(NonPagedPool, sizeof(KSEVENT_SET) * Table->EventSetsCount);
if (!Table->EventSets)
{
diff --git a/reactos/drivers/ksfilter/ks/filter.c b/reactos/drivers/ksfilter/ks/filter.c
index 2fb69977f58..0013770396b 100644
--- a/reactos/drivers/ksfilter/ks/filter.c
+++ b/reactos/drivers/ksfilter/ks/filter.c
@@ -44,6 +44,11 @@ const GUID IID_IKsFilter = {0x3ef6ee44L, 0x0D41, 0x11d2, {0xbe, 0xDA, 0x00, 0xc
const GUID KSPROPSETID_Topology = {0x720D4AC0L, 0x7533, 0x11D0, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}};
const GUID KSPROPSETID_Pin = {0x8C134960L, 0x51AD, 0x11CF, {0x87, 0x8A, 0x94, 0xF8, 0x01, 0xC1, 0x00, 0x00}};
+VOID
+IKsFilter_RemoveFilterFromFilterFactory(
+ IKsFilterImpl * This,
+ PKSFILTERFACTORY FilterFactory);
+
DEFINE_KSPROPERTY_TOPOLOGYSET(IKsFilterTopologySet, KspTopologyPropertyHandler);
DEFINE_KSPROPERTY_PINPROPOSEDATAFORMAT(IKsFilterPinSet, KspPinPropertyHandler, KspPinPropertyHandler, KspPinPropertyHandler);
@@ -506,8 +511,8 @@ IKsFilter_DispatchClose(
/* complete irp */
IoCompleteRequest(Irp, IO_NO_INCREMENT);
- /* FIXME remove our instance from the filter factory */
- ASSERT(0);
+ /* remove our instance from the filter factory */
+ IKsFilter_RemoveFilterFromFilterFactory(This, This->Factory);
/* free object header */
KsFreeObjectHeader(This->ObjectHeader);
@@ -605,6 +610,9 @@ KspHandleDataIntersection(
MultipleItem = (PKSMULTIPLE_ITEM)(Pin + 1);
DataRange = (PKSDATARANGE)(MultipleItem + 1);
+ /* FIXME make sure its 64 bit aligned */
+ ASSERT(((ULONG_PTR)DataRange & 0x3F) == 0);
+
if (!This->Factory->FilterDescriptor || !This->PinDescriptorCount)
{
/* no filter / pin descriptor */
@@ -632,7 +640,7 @@ KspHandleDataIntersection(
Irp,
Pin,
DataRange,
- (PKSDATAFORMAT)This->Factory->FilterDescriptor->PinDescriptors[Pin->PinId].PinDescriptor.DataRanges,
+ (PKSDATAFORMAT)This->PinDescriptorsEx[Pin->PinId].PinDescriptor.DataRanges,
DataLength,
Data,
&Length);
@@ -643,6 +651,8 @@ KspHandleDataIntersection(
break;
}
DataRange = UlongToPtr(PtrToUlong(DataRange) + DataRange->FormatSize);
+ /* FIXME make sure its 64 bit aligned */
+ ASSERT(((ULONG_PTR)DataRange & 0x3F) == 0);
}
IoStatus->Status = Status;
@@ -718,6 +728,8 @@ IKsFilter_DispatchDeviceIoControl(
IKsFilterImpl * This;
NTSTATUS Status;
PKSFILTER FilterInstance;
+ UNICODE_STRING GuidString;
+ PKSPROPERTY Property;
/* obtain filter from object header */
Status = IKsFilter_GetFilterFromIrp(Irp, &Filter);
@@ -730,6 +742,14 @@ IKsFilter_DispatchDeviceIoControl(
/* current irp stack */
IoStack = IoGetCurrentIrpStackLocation(Irp);
+ /* property was not handled */
+ Property = (PKSPROPERTY)IoStack->Parameters.DeviceIoControl.Type3InputBuffer;
+
+ RtlStringFromGUID(&Property->Set, &GuidString);
+ DPRINT("IKsFilter_DispatchDeviceIoControl property Set |%S| Id %u Flags %x\n", GuidString.Buffer, Property->Id, Property->Flags);
+ RtlFreeUnicodeString(&GuidString);
+
+
if (IoStack->Parameters.DeviceIoControl.IoControlCode != IOCTL_KS_PROPERTY)
{
UNIMPLEMENTED;
@@ -1126,12 +1146,72 @@ IKsFilter_AttachFilterToFilterFactory(
/* found last entry */
break;
}
- }while(FilterFactory);
+ }while(TRUE);
/* attach filter factory */
BasicHeader->Next.Filter = &This->Filter;
}
+VOID
+IKsFilter_RemoveFilterFromFilterFactory(
+ IKsFilterImpl * This,
+ PKSFILTERFACTORY FilterFactory)
+{
+ PKSBASIC_HEADER BasicHeader;
+ PKSFILTER Filter, LastFilter;
+
+ /* get filter factory basic header */
+ BasicHeader = (PKSBASIC_HEADER)((ULONG_PTR)FilterFactory - sizeof(KSBASIC_HEADER));
+
+ /* sanity check */
+ ASSERT(BasicHeader->Type == KsObjectTypeFilterFactory);
+ ASSERT(BasicHeader->FirstChild.Filter != NULL);
+
+
+ /* set to first entry */
+ Filter = BasicHeader->FirstChild.Filter;
+ LastFilter = NULL;
+
+ do
+ {
+ if (Filter == &This->Filter)
+ {
+ if (LastFilter)
+ {
+ /* get basic header */
+ BasicHeader = (PKSBASIC_HEADER)((ULONG_PTR)LastFilter - sizeof(KSBASIC_HEADER));
+ /* remove filter instance */
+ BasicHeader->Next.Filter = This->Header.Next.Filter;
+ break;
+ }
+ else
+ {
+ /* remove filter instance */
+ BasicHeader->FirstChild.Filter = This->Header.Next.Filter;
+ break;
+ }
+ }
+
+ /* get basic header */
+ BasicHeader = (PKSBASIC_HEADER)((ULONG_PTR)Filter - sizeof(KSBASIC_HEADER));
+ /* sanity check */
+ ASSERT(BasicHeader->Type == KsObjectTypeFilter);
+
+ LastFilter = Filter;
+ if (BasicHeader->Next.Filter)
+ {
+ /* iterate to next filter factory */
+ Filter = BasicHeader->Next.Filter;
+ }
+ else
+ {
+ /* filter is not in list */
+ ASSERT(0);
+ break;
+ }
+ }while(TRUE);
+}
+
NTSTATUS
NTAPI
KspCreateFilter(
From d20419ee58c835285303162d9aba689a1aadec0c Mon Sep 17 00:00:00 2001
From: Gregor Schneider
Date: Thu, 8 Apr 2010 21:25:02 +0000
Subject: [PATCH 079/261] [SHELL32] Add missing format specifier, switch
parameters as advertised
svn path=/trunk/; revision=46781
---
reactos/dll/win32/shell32/fprop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/reactos/dll/win32/shell32/fprop.c b/reactos/dll/win32/shell32/fprop.c
index 529854ea494..4d9345c469b 100644
--- a/reactos/dll/win32/shell32/fprop.c
+++ b/reactos/dll/win32/shell32/fprop.c
@@ -114,7 +114,7 @@ SH_FileGeneralSetFileType(HWND hwndDlg, WCHAR *filext)
{
/* the file extension is unknown, so default to string "FileExtension File" */
SendMessageW(hDlgCtrl, WM_GETTEXT, (WPARAM)MAX_PATH, (LPARAM)value);
- swprintf(name, value, &filext[1]);
+ swprintf(name, L"%s %s", &filext[1], value);
SendMessageW(hDlgCtrl, WM_SETTEXT, (WPARAM)NULL, (LPARAM)name);
return TRUE;
}
From 13478858b7bbe719db913ce7d56365a264106347 Mon Sep 17 00:00:00 2001
From: Gregor Schneider
Date: Thu, 8 Apr 2010 22:10:45 +0000
Subject: [PATCH 080/261] [TASKMGR] - Don't try to query a performance index
when switching from application to process tab - Query a process index
instead: "go to process" works now
svn path=/trunk/; revision=46782
---
reactos/base/applications/taskmgr/applpage.c | 5 ++--
reactos/base/applications/taskmgr/perfdata.c | 21 ----------------
reactos/base/applications/taskmgr/procpage.c | 25 +++++++++++++++++++-
3 files changed, 26 insertions(+), 25 deletions(-)
diff --git a/reactos/base/applications/taskmgr/applpage.c b/reactos/base/applications/taskmgr/applpage.c
index 3ef6ee9394d..355c3aea51a 100644
--- a/reactos/base/applications/taskmgr/applpage.c
+++ b/reactos/base/applications/taskmgr/applpage.c
@@ -49,7 +49,7 @@ void ApplicationPageOnNotify(WPARAM wParam, LPARAM lParam);
void ApplicationPageShowContextMenu1(void);
void ApplicationPageShowContextMenu2(void);
int CALLBACK ApplicationPageCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
-int PerfGetIndexByProcessId(DWORD dwProcessId);
+int ProcGetIndexByProcessId(DWORD dwProcessId);
#if 0
void SwitchToThisWindow (
@@ -878,7 +878,6 @@ void ApplicationPage_OnGotoProcess(void)
LPAPPLICATION_PAGE_LIST_ITEM pAPLI = NULL;
LV_ITEM item;
int i;
- /* NMHDR nmhdr; */
for (i=0; iIndex) == dwProcessId)
+ {
+ return i;
+ }
+ }
+ return 0;
+}
+
DWORD GetSelectedProcessId(void)
{
int Index;
@@ -427,7 +448,9 @@ void UpdateProcesses()
pData = (LPPROCESS_PAGE_LIST_ITEM)item.lParam;
if (!ProcessRunning(pData->ProcessId))
{
- (void)ListView_DeleteItem(hProcessPageListCtrl, i);
+ MessageBox(NULL, L"Processs is dead", L"HM?", MB_OK);
+ if (ListView_DeleteItem(hProcessPageListCtrl, i) == FALSE)
+ MessageBox(NULL, L"Deletion failed", L"HM!", MB_OK);
HeapFree(GetProcessHeap(), 0, pData);
}
}
From 56b61004517b9081ea470042d6fbbcec618918f3 Mon Sep 17 00:00:00 2001
From: Gregor Schneider
Date: Thu, 8 Apr 2010 22:21:17 +0000
Subject: [PATCH 081/261] [TASKMGR] Remove temp debug output related to another
problem
svn path=/trunk/; revision=46783
---
reactos/base/applications/taskmgr/procpage.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/reactos/base/applications/taskmgr/procpage.c b/reactos/base/applications/taskmgr/procpage.c
index df98949a12f..efcaa922e5f 100644
--- a/reactos/base/applications/taskmgr/procpage.c
+++ b/reactos/base/applications/taskmgr/procpage.c
@@ -448,9 +448,7 @@ void UpdateProcesses()
pData = (LPPROCESS_PAGE_LIST_ITEM)item.lParam;
if (!ProcessRunning(pData->ProcessId))
{
- MessageBox(NULL, L"Processs is dead", L"HM?", MB_OK);
- if (ListView_DeleteItem(hProcessPageListCtrl, i) == FALSE)
- MessageBox(NULL, L"Deletion failed", L"HM!", MB_OK);
+ (void)ListView_DeleteItem(hProcessPageListCtrl, i);
HeapFree(GetProcessHeap(), 0, pData);
}
}
From cbbd840d2ab0e282a215b90f882cd9697b2aef10 Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Fri, 9 Apr 2010 01:10:34 +0000
Subject: [PATCH 082/261] [NTOSKRNL] - Write the assigned resources to the
registry
svn path=/trunk/; revision=46784
---
reactos/ntoskrnl/io/pnpmgr/pnpmgr.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
index 0213d04d13e..93e30dc3729 100644
--- a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
+++ b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
@@ -246,6 +246,13 @@ IopStartDevice(
RtlInitUnicodeString(&KeyName, L"ActiveService");
Status = ZwSetValueKey(ControlHandle, &KeyName, 0, REG_SZ, DeviceNode->ServiceName.Buffer, DeviceNode->ServiceName.Length);
+ if (NT_SUCCESS(Status) && DeviceNode->ResourceList)
+ {
+ RtlInitUnicodeString(&KeyName, L"AllocConfig");
+ Status = ZwSetValueKey(ControlHandle, &KeyName, 0, REG_RESOURCE_LIST,
+ DeviceNode->ResourceList, CM_RESOURCE_LIST_SIZE(DeviceNode->ResourceList));
+ }
+
if (NT_SUCCESS(Status))
IopDeviceNodeSetFlag(DeviceNode, DNF_STARTED);
From 190d0acef749f8be35a934b71c0bbaf326c1ba34 Mon Sep 17 00:00:00 2001
From: Giannis Adamopoulos
Date: Fri, 9 Apr 2010 11:14:56 +0000
Subject: [PATCH 083/261] asm.h: fix definition of HEX macro
svn path=/trunk/; revision=46786
---
reactos/include/reactos/asm.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/reactos/include/reactos/asm.h b/reactos/include/reactos/asm.h
index 30afca482a0..f60a37c79ef 100644
--- a/reactos/include/reactos/asm.h
+++ b/reactos/include/reactos/asm.h
@@ -73,7 +73,7 @@ ENDM
.altmacro
/* Hex numbers need to be in 0x1AB format */
-#define HEX(x) 0x##x
+#define HEX(y) 0x##y
/* Macro values need to be marked */
#define VAL(x) \x
From 1528c1220de93a8e1153828d8177396aa05df439 Mon Sep 17 00:00:00 2001
From: Johannes Anderwald
Date: Fri, 9 Apr 2010 18:31:53 +0000
Subject: [PATCH 084/261] [KS] - Return status success from unimplemented
IKsClock_DispatchClose - Implement handling of
KSPROPERTY_PIN_CONSTRAINEDDATARANGES property - Forward unhandled irps to
lower device object - Fix asserts in KspHandleDataIntersection. The function
is still a grotesk hack - Simply handling of property requests by merging
filter properties into filter descriptor - Implement KsMethodHandler,
KsMethodHandlerWithAllocator, KsFastMethodHandler - Fix a bug in
KsPinGetFirstCloneStreamPointer - Implement handling of KSPROPSETID_Topology
(KspTopologyHandler)
svn path=/trunk/; revision=46794
---
reactos/drivers/ksfilter/ks/api.c | 4 +-
reactos/drivers/ksfilter/ks/clocks.c | 6 +-
reactos/drivers/ksfilter/ks/connectivity.c | 56 +++-
reactos/drivers/ksfilter/ks/device.c | 6 +-
reactos/drivers/ksfilter/ks/filter.c | 145 ++++++++---
reactos/drivers/ksfilter/ks/irp.c | 2 +
reactos/drivers/ksfilter/ks/ksfunc.h | 9 +
reactos/drivers/ksfilter/ks/methods.c | 282 ++++++++++++++++++++-
reactos/drivers/ksfilter/ks/pin.c | 27 +-
reactos/drivers/ksfilter/ks/topology.c | 10 -
10 files changed, 465 insertions(+), 82 deletions(-)
diff --git a/reactos/drivers/ksfilter/ks/api.c b/reactos/drivers/ksfilter/ks/api.c
index 2fae3669083..6c0d8813772 100644
--- a/reactos/drivers/ksfilter/ks/api.c
+++ b/reactos/drivers/ksfilter/ks/api.c
@@ -2195,8 +2195,8 @@ KspCountPropertySets(
return AutomationTableA->PropertySetsCount;
/* sanity check */
- DPRINT("AutomationTableA EventItemSize %lu PropertySetsCount %lu\n", AutomationTableA->PropertyItemSize, AutomationTableA->PropertySetsCount);
- DPRINT("AutomationTableB EventItemSize %lu PropertySetsCount %lu\n", AutomationTableB->PropertyItemSize, AutomationTableB->PropertySetsCount);
+ DPRINT("AutomationTableA PropertyItemSize %lu PropertySetsCount %lu\n", AutomationTableA->PropertyItemSize, AutomationTableA->PropertySetsCount);
+ DPRINT("AutomationTableB PropertyItemSize %lu PropertySetsCount %lu\n", AutomationTableB->PropertyItemSize, AutomationTableB->PropertySetsCount);
ASSERT(AutomationTableA->PropertyItemSize == AutomationTableB->PropertyItemSize);
/* now iterate all property sets and compare their guids */
diff --git a/reactos/drivers/ksfilter/ks/clocks.c b/reactos/drivers/ksfilter/ks/clocks.c
index f3e7d7acbb8..2e7ff0e2a39 100644
--- a/reactos/drivers/ksfilter/ks/clocks.c
+++ b/reactos/drivers/ksfilter/ks/clocks.c
@@ -112,14 +112,12 @@ IKsClock_DispatchClose(
{
UNIMPLEMENTED
- Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
+ Irp->IoStatus.Status = STATUS_SUCCESS;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
- return STATUS_NOT_IMPLEMENTED;
+ return STATUS_SUCCESS;
}
-
-
static KSDISPATCH_TABLE DispatchTable =
{
IKsClock_DispatchDeviceIoControl,
diff --git a/reactos/drivers/ksfilter/ks/connectivity.c b/reactos/drivers/ksfilter/ks/connectivity.c
index 7c9b8226de2..ea75428632a 100644
--- a/reactos/drivers/ksfilter/ks/connectivity.c
+++ b/reactos/drivers/ksfilter/ks/connectivity.c
@@ -287,11 +287,13 @@ KsPinPropertyHandler(
PKSDATAFORMAT_WAVEFORMATEX WaveFormatIn;
PKEY_VALUE_PARTIAL_INFORMATION KeyInfo;
NTSTATUS Status = STATUS_NOT_SUPPORTED;
+ ULONG Count;
+ const PKSDATARANGE* DataRanges;
IoStack = IoGetCurrentIrpStackLocation(Irp);
Buffer = Irp->UserBuffer;
- DPRINT("KsPinPropertyHandler Irp %p Property %p Data %p DescriptorsCount %u Descriptor %p OutputLength %u Id %u\n", Irp, Property, Data, DescriptorsCount, Descriptor, IoStack->Parameters.DeviceIoControl.OutputBufferLength, Property->Id);
+ //DPRINT("KsPinPropertyHandler Irp %p Property %p Data %p DescriptorsCount %u Descriptor %p OutputLength %u Id %u\n", Irp, Property, Data, DescriptorsCount, Descriptor, IoStack->Parameters.DeviceIoControl.OutputBufferLength, Property->Id);
switch(Property->Id)
{
@@ -322,6 +324,7 @@ KsPinPropertyHandler(
break;
case KSPROPERTY_PIN_DATARANGES:
+ case KSPROPERTY_PIN_CONSTRAINEDDATARANGES:
Pin = (KSP_PIN*)Property;
if (Pin->PinId >= DescriptorsCount)
{
@@ -330,9 +333,20 @@ KsPinPropertyHandler(
break;
}
Size = sizeof(KSMULTIPLE_ITEM);
- for (Index = 0; Index < Descriptor[Pin->PinId].DataRangesCount; Index++)
+ if (Property->Id == KSPROPERTY_PIN_DATARANGES || Descriptor[Pin->PinId].ConstrainedDataRangesCount == 0)
{
- Size += Descriptor[Pin->PinId].DataRanges[Index]->FormatSize;
+ DataRanges = Descriptor[Pin->PinId].DataRanges;
+ Count = Descriptor[Pin->PinId].DataRangesCount;
+ }
+ else
+ {
+ DataRanges = Descriptor[Pin->PinId].ConstrainedDataRanges;
+ Count = Descriptor[Pin->PinId].ConstrainedDataRangesCount;
+ }
+
+ for (Index = 0; Index < Count; Index++)
+ {
+ Size += ((DataRanges[Index]->FormatSize + 0x7) & ~0x7);
}
if (IoStack->Parameters.DeviceIoControl.OutputBufferLength == 0)
@@ -354,16 +368,9 @@ KsPinPropertyHandler(
break;
}
- if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(KSMULTIPLE_ITEM))
- {
- /* buffer too small */
- Status = STATUS_BUFFER_TOO_SMALL;
- break;
- }
-
/* store descriptor size */
Item->Size = Size;
- Item->Count = Descriptor[Pin->PinId].DataRangesCount;
+ Item->Count = Count;
if (IoStack->Parameters.DeviceIoControl.OutputBufferLength == sizeof(KSMULTIPLE_ITEM))
{
@@ -374,10 +381,29 @@ KsPinPropertyHandler(
/* now copy all dataranges */
Data = (PUCHAR)(Item +1);
- for (Index = 0; Index < Descriptor[Pin->PinId].DataRangesCount; Index++)
+
+ /* alignment assert */
+ ASSERT(((ULONG_PTR)Data & 0x7) == 0);
+
+ for (Index = 0; Index < Count; Index++)
{
- RtlMoveMemory(Data, Descriptor[Pin->PinId].DataRanges[Index], Descriptor[Pin->PinId].DataRanges[Index]->FormatSize);
- Data = ((PUCHAR)Data + Descriptor[Pin->PinId].DataRanges[Index]->FormatSize);
+ UNICODE_STRING GuidString;
+ /* convert the guid to string */
+ RtlStringFromGUID(&DataRanges[Index]->MajorFormat, &GuidString);
+ DPRINT("Index %lu MajorFormat %S\n", Index, GuidString.Buffer);
+ RtlStringFromGUID(&DataRanges[Index]->SubFormat, &GuidString);
+ DPRINT("Index %lu SubFormat %S\n", Index, GuidString.Buffer);
+ RtlStringFromGUID(&DataRanges[Index]->Specifier, &GuidString);
+ DPRINT("Index %lu Specifier %S\n", Index, GuidString.Buffer);
+ RtlStringFromGUID(&DataRanges[Index]->Specifier, &GuidString);
+ DPRINT("Index %lu FormatSize %lu Flags %lu SampleSize %lu Reserved %lu KSDATAFORMAT %lu\n", Index,
+ DataRanges[Index]->FormatSize, DataRanges[Index]->Flags, DataRanges[Index]->SampleSize, DataRanges[Index]->Reserved, sizeof(KSDATAFORMAT));
+
+ RtlMoveMemory(Data, DataRanges[Index], DataRanges[Index]->FormatSize);
+ Data = ((PUCHAR)Data + DataRanges[Index]->FormatSize);
+ /* alignment assert */
+ ASSERT(((ULONG_PTR)Data & 0x7) == 0);
+ Data = (PVOID)(((ULONG_PTR)Data + 0x7) & ~0x7);
}
Status = STATUS_SUCCESS;
@@ -442,7 +468,9 @@ KsPinPropertyHandler(
break;
}
+ //DPRINT("Pin %lu Communication %lu\n", Pin->PinId, Descriptor[Pin->PinId].Communication);
*((KSPIN_COMMUNICATION*)Buffer) = Descriptor[Pin->PinId].Communication;
+
Status = STATUS_SUCCESS;
Irp->IoStatus.Information = Size;
break;
diff --git a/reactos/drivers/ksfilter/ks/device.c b/reactos/drivers/ksfilter/ks/device.c
index 982b717e7c8..084728f3c89 100644
--- a/reactos/drivers/ksfilter/ks/device.c
+++ b/reactos/drivers/ksfilter/ks/device.c
@@ -567,8 +567,12 @@ IKsDevice_Pnp(
}
default:
DPRINT1("unhandled function %u\n", IoStack->MinorFunction);
+ /* pass the irp down the driver stack */
+ Status = KspForwardIrpSynchronous(DeviceObject, Irp);
+
+ Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
- return STATUS_NOT_SUPPORTED;
+ return Status;
}
}
diff --git a/reactos/drivers/ksfilter/ks/filter.c b/reactos/drivers/ksfilter/ks/filter.c
index 0013770396b..d5af650d417 100644
--- a/reactos/drivers/ksfilter/ks/filter.c
+++ b/reactos/drivers/ksfilter/ks/filter.c
@@ -611,7 +611,7 @@ KspHandleDataIntersection(
DataRange = (PKSDATARANGE)(MultipleItem + 1);
/* FIXME make sure its 64 bit aligned */
- ASSERT(((ULONG_PTR)DataRange & 0x3F) == 0);
+ ASSERT(((ULONG_PTR)DataRange & 0x7) == 0);
if (!This->Factory->FilterDescriptor || !This->PinDescriptorCount)
{
@@ -635,30 +635,64 @@ KspHandleDataIntersection(
for(Index = 0; Index < MultipleItem->Count; Index++)
{
+ UNICODE_STRING MajorFormat, SubFormat, Specifier;
+ /* convert the guid to string */
+ RtlStringFromGUID(&DataRange->MajorFormat, &MajorFormat);
+ RtlStringFromGUID(&DataRange->SubFormat, &SubFormat);
+ RtlStringFromGUID(&DataRange->Specifier, &Specifier);
+
+ DPRINT("Index %lu MajorFormat %S SubFormat %S Specifier %S FormatSize %lu SampleSize %lu Align %lu Flags %lx Reserved %lx DataLength %lu\n", Index, MajorFormat.Buffer, SubFormat.Buffer, Specifier.Buffer,
+ DataRange->FormatSize, DataRange->SampleSize, DataRange->Alignment, DataRange->Flags, DataRange->Reserved, DataLength);
+
+ /* FIXME implement KsPinDataIntersectionEx */
/* Call miniport's properitary handler */
- Status = This->PinDescriptorsEx[Pin->PinId].IntersectHandler(NULL, /* context */
+ Status = This->PinDescriptorsEx[Pin->PinId].IntersectHandler(&This->Filter,
Irp,
Pin,
DataRange,
- (PKSDATAFORMAT)This->PinDescriptorsEx[Pin->PinId].PinDescriptor.DataRanges,
+ This->PinDescriptorsEx[Pin->PinId].PinDescriptor.DataRanges[0], /* HACK */
DataLength,
Data,
&Length);
- if (Status == STATUS_SUCCESS || Status == STATUS_BUFFER_OVERFLOW)
+ if (Status == STATUS_SUCCESS || Status == STATUS_BUFFER_OVERFLOW || Status == STATUS_BUFFER_TOO_SMALL)
{
+ ASSERT(Length);
IoStatus->Information = Length;
+ if (Status != STATUS_SUCCESS)
+ Status = STATUS_MORE_ENTRIES;
break;
}
+
DataRange = UlongToPtr(PtrToUlong(DataRange) + DataRange->FormatSize);
/* FIXME make sure its 64 bit aligned */
- ASSERT(((ULONG_PTR)DataRange & 0x3F) == 0);
+ ASSERT(((ULONG_PTR)DataRange & 0x7) == 0);
}
IoStatus->Status = Status;
return Status;
}
+NTSTATUS
+NTAPI
+KspTopologyPropertyHandler(
+ IN PIRP Irp,
+ IN PKSIDENTIFIER Request,
+ IN OUT PVOID Data)
+{
+ IKsFilterImpl * This;
+
+ /* get filter implementation */
+ This = (IKsFilterImpl*)KSPROPERTY_ITEM_IRP_STORAGE(Irp);
+
+ /* sanity check */
+ ASSERT(This);
+
+ return KsTopologyPropertyHandler(Irp, Request, Data, &This->Topology);
+
+}
+
+
NTSTATUS
NTAPI
KspPinPropertyHandler(
@@ -673,6 +707,9 @@ KspPinPropertyHandler(
/* get filter implementation */
This = (IKsFilterImpl*)KSPROPERTY_ITEM_IRP_STORAGE(Irp);
+ /* sanity check */
+ ASSERT(This);
+
/* get current stack location */
IoStack = IoGetCurrentIrpStackLocation(Irp);
@@ -686,7 +723,7 @@ KspPinPropertyHandler(
case KSPROPERTY_PIN_COMMUNICATION:
case KSPROPERTY_PIN_CATEGORY:
case KSPROPERTY_PIN_NAME:
- case KSPROPERTY_PIN_PROPOSEDATAFORMAT:
+ case KSPROPERTY_PIN_CONSTRAINEDDATARANGES:
Status = KsPinPropertyHandler(Irp, Request, Data, This->PinDescriptorCount, This->PinDescriptors);
break;
case KSPROPERTY_PIN_GLOBALCINSTANCES:
@@ -702,16 +739,11 @@ KspPinPropertyHandler(
case KSPROPERTY_PIN_DATAINTERSECTION:
Status = KspHandleDataIntersection(Irp, &Irp->IoStatus, Request, Data, IoStack->Parameters.DeviceIoControl.OutputBufferLength, This);
break;
- case KSPROPERTY_PIN_PHYSICALCONNECTION:
- case KSPROPERTY_PIN_CONSTRAINEDDATARANGES:
- UNIMPLEMENTED
- Status = STATUS_NOT_IMPLEMENTED;
- break;
default:
UNIMPLEMENTED
- Status = STATUS_UNSUCCESSFUL;
+ Status = STATUS_NOT_FOUND;
}
- DPRINT("KspPinPropertyHandler Pins %lu Request->Id %lu Status %lx\n", This->PinDescriptorCount, Request->Id, Status);
+ //DPRINT("KspPinPropertyHandler Pins %lu Request->Id %lu Status %lx\n", This->PinDescriptorCount, Request->Id, Status);
return Status;
@@ -730,6 +762,7 @@ IKsFilter_DispatchDeviceIoControl(
PKSFILTER FilterInstance;
UNICODE_STRING GuidString;
PKSPROPERTY Property;
+ ULONG SetCount = 0;
/* obtain filter from object header */
Status = IKsFilter_GetFilterFromIrp(Irp, &Filter);
@@ -742,47 +775,70 @@ IKsFilter_DispatchDeviceIoControl(
/* current irp stack */
IoStack = IoGetCurrentIrpStackLocation(Irp);
- /* property was not handled */
+ /* get property from input buffer */
Property = (PKSPROPERTY)IoStack->Parameters.DeviceIoControl.Type3InputBuffer;
+ /* sanity check */
+ ASSERT(IoStack->Parameters.DeviceIoControl.InputBufferLength >= sizeof(KSIDENTIFIER));
+
+ /* get filter instance */
+ FilterInstance = Filter->lpVtbl->GetStruct(Filter);
+
RtlStringFromGUID(&Property->Set, &GuidString);
DPRINT("IKsFilter_DispatchDeviceIoControl property Set |%S| Id %u Flags %x\n", GuidString.Buffer, Property->Id, Property->Flags);
RtlFreeUnicodeString(&GuidString);
-
- if (IoStack->Parameters.DeviceIoControl.IoControlCode != IOCTL_KS_PROPERTY)
+ if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_METHOD)
{
- UNIMPLEMENTED;
+ const KSMETHOD_SET *MethodSet = NULL;
+ ULONG MethodItemSize = 0;
- /* release filter interface */
- Filter->lpVtbl->Release(Filter);
+ /* check if the driver supports method sets */
+ if (FilterInstance->Descriptor->AutomationTable && FilterInstance->Descriptor->AutomationTable->MethodSetsCount)
+ {
+ SetCount = FilterInstance->Descriptor->AutomationTable->MethodSetsCount;
+ MethodSet = FilterInstance->Descriptor->AutomationTable->MethodSets;
+ MethodItemSize = FilterInstance->Descriptor->AutomationTable->MethodItemSize;
+ }
- /* complete and forget irp */
- Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
- IoCompleteRequest(Irp, IO_NO_INCREMENT);
- return STATUS_NOT_IMPLEMENTED;
+ /* call method set handler */
+ Status = KspMethodHandlerWithAllocator(Irp, SetCount, MethodSet, NULL, MethodItemSize);
}
-
- /* call property handler supported by ks */
- KSPROPERTY_ITEM_IRP_STORAGE(Irp) = (KSPROPERTY_ITEM*)This;
- Status = KspPropertyHandler(Irp, 2, FilterPropertySet, NULL, sizeof(KSPROPERTY_ITEM));
-
- if (Status == STATUS_NOT_FOUND)
+ else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_PROPERTY)
{
- /* get filter instance */
- FilterInstance = Filter->lpVtbl->GetStruct(Filter);
+ const KSPROPERTY_SET *PropertySet = NULL;
+ ULONG PropertyItemSize = 0;
- /* check if the driver supports property sets */
+ /* check if the driver supports method sets */
if (FilterInstance->Descriptor->AutomationTable && FilterInstance->Descriptor->AutomationTable->PropertySetsCount)
{
- /* call driver's filter property handler */
- Status = KspPropertyHandler(Irp,
- FilterInstance->Descriptor->AutomationTable->PropertySetsCount,
- FilterInstance->Descriptor->AutomationTable->PropertySets,
- NULL,
- FilterInstance->Descriptor->AutomationTable->PropertyItemSize);
+ SetCount = FilterInstance->Descriptor->AutomationTable->PropertySetsCount;
+ PropertySet = FilterInstance->Descriptor->AutomationTable->PropertySets;
+ PropertyItemSize = FilterInstance->Descriptor->AutomationTable->PropertyItemSize;
}
+
+ /* needed for our property handlers */
+ KSPROPERTY_ITEM_IRP_STORAGE(Irp) = (KSPROPERTY_ITEM*)This;
+
+ /* call property handler */
+ Status = KspPropertyHandler(Irp, SetCount, PropertySet, NULL, PropertyItemSize);
}
+ else
+ {
+ /* sanity check */
+ ASSERT(IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_ENABLE_EVENT ||
+ IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_DISABLE_EVENT);
+
+ Status = STATUS_NOT_FOUND;
+ UNIMPLEMENTED;
+ }
+
+ RtlStringFromGUID(&Property->Set, &GuidString);
+ DPRINT("IKsFilter_DispatchDeviceIoControl property Set |%S| Id %u Flags %x Status %lx ResultLength %lu\n", GuidString.Buffer, Property->Id, Property->Flags, Status, Irp->IoStatus.Information);
+ RtlFreeUnicodeString(&GuidString);
+
+ /* release filter */
+ Filter->lpVtbl->Release(Filter);
if (Status != STATUS_PENDING)
{
@@ -953,6 +1009,7 @@ IKsFilter_CopyFilterDescriptor(
const KSFILTER_DESCRIPTOR* FilterDescriptor)
{
NTSTATUS Status;
+ KSAUTOMATION_TABLE AutomationTable;
This->Filter.Descriptor = AllocateItem(NonPagedPool, sizeof(KSFILTER_DESCRIPTOR));
if (!This->Filter.Descriptor)
@@ -969,6 +1026,17 @@ IKsFilter_CopyFilterDescriptor(
/* copy filter descriptor fields */
RtlMoveMemory((PVOID)This->Filter.Descriptor, FilterDescriptor, sizeof(KSFILTER_DESCRIPTOR));
+ /* zero automation table */
+ RtlZeroMemory(&AutomationTable, sizeof(KSAUTOMATION_TABLE));
+
+ /* setup filter property sets */
+ AutomationTable.PropertyItemSize = sizeof(KSPROPERTY_ITEM);
+ AutomationTable.PropertySetsCount = 2;
+ AutomationTable.PropertySets = FilterPropertySet;
+
+ /* merge filter automation table */
+ Status = KsMergeAutomationTables((PKSAUTOMATION_TABLE*)&This->Filter.Descriptor->AutomationTable, (PKSAUTOMATION_TABLE)FilterDescriptor->AutomationTable, &AutomationTable, This->Filter.Bag);
+
return Status;
}
@@ -1303,7 +1371,6 @@ KspCreateFilter(
This->lpVtbl = &vt_IKsFilter;
This->lpVtblKsControl = &vt_IKsControl;
- This->Filter.Descriptor = Factory->FilterDescriptor;
This->Factory = Factory;
This->FilterFactory = iface;
This->FileObject = IoStack->FileObject;
diff --git a/reactos/drivers/ksfilter/ks/irp.c b/reactos/drivers/ksfilter/ks/irp.c
index e50490aad58..332be5cc389 100644
--- a/reactos/drivers/ksfilter/ks/irp.c
+++ b/reactos/drivers/ksfilter/ks/irp.c
@@ -1720,9 +1720,11 @@ FindMatchingCreateItem(
PLIST_ENTRY Entry;
PCREATE_ITEM_ENTRY CreateItemEntry;
+#ifndef MS_KSUSER
/* remove '\' slash */
Buffer++;
BufferSize -= sizeof(WCHAR);
+#endif
/* point to first entry */
Entry = ListHead->Flink;
diff --git a/reactos/drivers/ksfilter/ks/ksfunc.h b/reactos/drivers/ksfilter/ks/ksfunc.h
index 8d0836af7d7..64e2582c4d4 100644
--- a/reactos/drivers/ksfilter/ks/ksfunc.h
+++ b/reactos/drivers/ksfilter/ks/ksfunc.h
@@ -156,3 +156,12 @@ KspSetFilterFactoriesState(
IN PKSIDEVICE_HEADER DeviceHeader,
IN BOOLEAN NewState);
+NTSTATUS
+NTAPI
+KspMethodHandlerWithAllocator(
+ IN PIRP Irp,
+ IN ULONG MethodSetsCount,
+ IN const KSMETHOD_SET *MethodSet,
+ IN PFNKSALLOCATOR Allocator OPTIONAL,
+ IN ULONG MethodItemSize OPTIONAL);
+
diff --git a/reactos/drivers/ksfilter/ks/methods.c b/reactos/drivers/ksfilter/ks/methods.c
index 512371a6a29..eed17bd13e5 100644
--- a/reactos/drivers/ksfilter/ks/methods.c
+++ b/reactos/drivers/ksfilter/ks/methods.c
@@ -8,8 +8,186 @@
#include "priv.h"
+NTSTATUS
+FindMethodHandler(
+ IN PIO_STATUS_BLOCK IoStatus,
+ IN const KSMETHOD_SET* MethodSet,
+ IN ULONG MethodSetCount,
+ IN PKSMETHOD Method,
+ IN ULONG InputBufferLength,
+ IN ULONG OutputBufferLength,
+ OUT PVOID OutputBuffer,
+ OUT PFNKSHANDLER *MethodHandler,
+ OUT PKSMETHOD_SET * Set)
+{
+ ULONG Index, ItemIndex;
+
+ /* TODO */
+ ASSERT((Method->Flags & KSMETHOD_TYPE_SETSUPPORT) == 0);
+
+ for(Index = 0; Index < MethodSetCount; Index++)
+ {
+ ASSERT(MethodSet[Index].Set);
+
+ if (IsEqualGUIDAligned(&Method->Set, MethodSet[Index].Set))
+ {
+ for(ItemIndex = 0; ItemIndex < MethodSet[Index].MethodsCount; ItemIndex++)
+ {
+ if (MethodSet[Index].MethodItem[ItemIndex].MethodId == Method->Id)
+ {
+ if (MethodSet[Index].MethodItem[ItemIndex].MinMethod > InputBufferLength)
+ {
+ /* too small input buffer */
+ IoStatus->Information = MethodSet[Index].MethodItem[ItemIndex].MinMethod;
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ if (MethodSet[Index].MethodItem[ItemIndex].MinData > OutputBufferLength)
+ {
+ /* too small output buffer */
+ IoStatus->Information = MethodSet[Index].MethodItem[ItemIndex].MinData;
+ return STATUS_MORE_ENTRIES;
+ }
+ if (Method->Flags & KSMETHOD_TYPE_BASICSUPPORT)
+ {
+ PULONG Flags;
+ PKSPROPERTY_DESCRIPTION Description;
+
+ if (sizeof(ULONG) > OutputBufferLength)
+ {
+ /* too small buffer */
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ /* get output buffer */
+ Flags = (PULONG)OutputBuffer;
+
+ /* set flags flags */
+ *Flags = MethodSet[Index].MethodItem[ItemIndex].Flags;
+
+ IoStatus->Information = sizeof(ULONG);
+
+ if (OutputBufferLength >= sizeof(KSPROPERTY_DESCRIPTION))
+ {
+ /* get output buffer */
+ Description = (PKSPROPERTY_DESCRIPTION)OutputBuffer;
+
+ /* store result */
+ Description->DescriptionSize = sizeof(KSPROPERTY_DESCRIPTION);
+ Description->PropTypeSet.Set = KSPROPTYPESETID_General;
+ Description->PropTypeSet.Id = 0;
+ Description->PropTypeSet.Flags = 0;
+ Description->MembersListCount = 0;
+ Description->Reserved = 0;
+
+ IoStatus->Information = sizeof(KSPROPERTY_DESCRIPTION);
+ }
+ return STATUS_SUCCESS;
+ }
+ *MethodHandler = MethodSet[Index].MethodItem[ItemIndex].MethodHandler;
+ *Set = (PKSMETHOD_SET)&MethodSet[Index];
+ return STATUS_SUCCESS;
+ }
+ }
+ }
+ }
+ return STATUS_NOT_FOUND;
+}
+
+NTSTATUS
+NTAPI
+KspMethodHandlerWithAllocator(
+ IN PIRP Irp,
+ IN ULONG MethodSetsCount,
+ IN const KSMETHOD_SET *MethodSet,
+ IN PFNKSALLOCATOR Allocator OPTIONAL,
+ IN ULONG MethodItemSize OPTIONAL)
+{
+ PKSMETHOD Method;
+ PKSMETHOD_SET Set;
+ PIO_STACK_LOCATION IoStack;
+ NTSTATUS Status;
+ PFNKSHANDLER MethodHandler = NULL;
+ ULONG Index;
+ LPGUID Guid;
+
+ /* get current irp stack */
+ IoStack = IoGetCurrentIrpStackLocation(Irp);
+
+ /* check if inputbuffer at least holds KSMETHOD item */
+ if (IoStack->Parameters.DeviceIoControl.InputBufferLength < sizeof(KSMETHOD))
+ {
+ /* invalid parameter */
+ Irp->IoStatus.Information = sizeof(KSPROPERTY);
+ return STATUS_INVALID_BUFFER_SIZE;
+ }
+
+ /* FIXME probe the input / output buffer if from user mode */
+
+ /* get input property request */
+ Method = (PKSMETHOD)IoStack->Parameters.DeviceIoControl.Type3InputBuffer;
+
+// DPRINT("KspMethodHandlerWithAllocator Irp %p PropertySetsCount %u PropertySet %p Allocator %p PropertyItemSize %u ExpectedPropertyItemSize %u\n", Irp, PropertySetsCount, PropertySet, Allocator, PropertyItemSize, sizeof(KSPROPERTY_ITEM));
+
+ /* sanity check */
+ ASSERT(MethodItemSize == 0 || MethodItemSize == sizeof(KSMETHOD_ITEM));
+
+ /* find the method handler */
+ Status = FindMethodHandler(&Irp->IoStatus, MethodSet, MethodSetsCount, Method, IoStack->Parameters.DeviceIoControl.InputBufferLength, IoStack->Parameters.DeviceIoControl.OutputBufferLength, Irp->UserBuffer, &MethodHandler, &Set);
+
+ if (NT_SUCCESS(Status) && MethodHandler)
+ {
+ /* call method handler */
+ KSMETHOD_SET_IRP_STORAGE(Irp) = Set;
+ Status = MethodHandler(Irp, Method, Irp->UserBuffer);
+
+ if (Status == STATUS_BUFFER_TOO_SMALL)
+ {
+ /* output buffer is too small */
+ if (Allocator)
+ {
+ /* allocate the requested amount */
+ Status = Allocator(Irp, Irp->IoStatus.Information, FALSE);
+
+ /* check if the block was allocated */
+ if (!NT_SUCCESS(Status))
+ {
+ /* no memory */
+ return STATUS_INSUFFICIENT_RESOURCES;
+ }
+
+ /* re-call method handler */
+ Status = MethodHandler(Irp, Method, Irp->UserBuffer);
+ }
+ }
+ }
+ else if (IsEqualGUIDAligned(&Method->Set, &GUID_NULL) && Method->Id == 0 && Method->Flags == KSMETHOD_TYPE_SETSUPPORT)
+ {
+ // store output size
+ Irp->IoStatus.Information = sizeof(GUID) * MethodSetsCount;
+ if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(GUID) * MethodSetsCount)
+ {
+ // buffer too small
+ return STATUS_MORE_ENTRIES;
+ }
+
+ // get output buffer
+ Guid = (LPGUID)Irp->UserBuffer;
+
+ // copy property guids from property sets
+ for(Index = 0; Index < MethodSetsCount; Index++)
+ {
+ RtlMoveMemory(&Guid[Index], MethodSet[Index].Set, sizeof(GUID));
+ }
+ return STATUS_SUCCESS;
+ }
+
+ /* done */
+ return Status;
+}
+
/*
- @unimplemented
+ @implemented
*/
KSDDKAPI
NTSTATUS
@@ -19,12 +197,11 @@ KsMethodHandler(
IN ULONG MethodSetsCount,
IN PKSMETHOD_SET MethodSet)
{
- UNIMPLEMENTED;
- return STATUS_UNSUCCESSFUL;
+ return KspMethodHandlerWithAllocator(Irp, MethodSetsCount, MethodSet, NULL, 0);
}
/*
- @unimplemented
+ @implemented
*/
KSDDKAPI
NTSTATUS
@@ -36,12 +213,39 @@ KsMethodHandlerWithAllocator(
IN PFNKSALLOCATOR Allocator OPTIONAL,
IN ULONG MethodItemSize OPTIONAL)
{
- UNIMPLEMENTED;
- return STATUS_UNSUCCESSFUL;
+ return KspMethodHandlerWithAllocator(Irp, MethodSetsCount, MethodSet, Allocator, MethodItemSize);
}
+
+NTSTATUS
+FindFastMethodHandler(
+ IN ULONG FastIoCount,
+ IN const KSFASTMETHOD_ITEM * FastIoTable,
+ IN PKSMETHOD MethodId,
+ OUT PFNKSFASTHANDLER * FastPropertyHandler)
+{
+ ULONG Index;
+
+ /* iterate through all items */
+ for(Index = 0; Index < FastIoCount; Index++)
+ {
+ if (MethodId->Id == FastIoTable[Index].MethodId)
+ {
+ if (FastIoTable[Index].MethodSupported)
+ {
+ *FastPropertyHandler = FastIoTable[Index].MethodHandler;
+ return STATUS_SUCCESS;
+ }
+ }
+
+ }
+ /* no fast property handler found */
+ return STATUS_NOT_FOUND;
+}
+
+
/*
- @unimplemented
+ @implemented
*/
KSDDKAPI
BOOLEAN
@@ -56,6 +260,68 @@ KsFastMethodHandler(
IN ULONG MethodSetsCount,
IN const KSMETHOD_SET* MethodSet)
{
- UNIMPLEMENTED;
+ KSMETHOD MethodRequest;
+ KPROCESSOR_MODE Mode;
+ NTSTATUS Status = STATUS_SUCCESS;
+ ULONG Index;
+ PFNKSFASTHANDLER FastMethodHandler;
+
+ if (MethodLength < sizeof(KSPROPERTY))
+ {
+ /* invalid request */
+ return FALSE;
+ }
+
+ /* get previous mode */
+ Mode = ExGetPreviousMode();
+
+ if (Mode == KernelMode)
+ {
+ /* just copy it */
+ RtlMoveMemory(&MethodRequest, Method, sizeof(KSMETHOD));
+ }
+ else
+ {
+ /* need to probe the buffer */
+ _SEH2_TRY
+ {
+ ProbeForRead(Method, sizeof(KSPROPERTY), sizeof(UCHAR));
+ RtlMoveMemory(&MethodRequest, Method, sizeof(KSMETHOD));
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ /* Exception, get the error code */
+ Status = _SEH2_GetExceptionCode();
+ }_SEH2_END;
+
+ if (!NT_SUCCESS(Status))
+ return FALSE;
+ }
+
+ /* are there any property sets provided */
+ if (MethodSetsCount)
+ {
+ /* iterate through all property sets count */
+ Index = 0;
+ do
+ {
+ /* does the property id match */
+ if (IsEqualGUIDAligned(MethodSet[Index].Set, &MethodRequest.Set))
+ {
+ /* try to find a fast property handler */
+ Status = FindFastMethodHandler(MethodSet[Index].FastIoCount, MethodSet[Index].FastIoTable, &MethodRequest, &FastMethodHandler);
+
+ if (NT_SUCCESS(Status))
+ {
+ /* call fast property handler */
+ ASSERT(MethodLength == sizeof(KSMETHOD)); /* FIXME check if property length is bigger -> copy params */
+ ASSERT(Mode == KernelMode); /* FIXME need to probe usermode output buffer */
+ return FastMethodHandler(FileObject, &MethodRequest, sizeof(KSMETHOD), Data, DataLength, IoStatus);
+ }
+ }
+ /* move to next item */
+ Index++;
+ }while(Index < MethodSetsCount);
+ }
return FALSE;
}
diff --git a/reactos/drivers/ksfilter/ks/pin.c b/reactos/drivers/ksfilter/ks/pin.c
index 0612fc74b9c..682d25e916d 100644
--- a/reactos/drivers/ksfilter/ks/pin.c
+++ b/reactos/drivers/ksfilter/ks/pin.c
@@ -21,6 +21,7 @@ typedef struct _KSISTREAM_POINTER
ULONG Offset;
ULONG Length;
KSSTREAM_POINTER StreamPointer;
+ KSPIN_LOCK Lock;
}KSISTREAM_POINTER, *PKSISTREAM_POINTER;
typedef struct
@@ -307,6 +308,7 @@ IKsPin_PinStatePropertyHandler(
/* revert to old state */
This->Pin.ClientState = OldState;
This->Pin.DeviceState = OldState;
+ DPRINT("IKsPin_PinStatePropertyHandler failed to set state %lx Result %lx\n", *NewState, Status);
DbgBreakPoint();
}
else
@@ -429,6 +431,7 @@ IKsPin_fnQueryInterface(
_InterlockedIncrement(&This->ref);
return STATUS_SUCCESS;
}
+DPRINT("IKsPin_fnQueryInterface\n");
DbgBreakPoint();
return STATUS_UNSUCCESSFUL;
}
@@ -674,6 +677,9 @@ IKsReferenceClock_fnGetTime(
IKsPinImpl * This = (IKsPinImpl*)CONTAINING_RECORD(iface, IKsPinImpl, lpVtblReferenceClock);
+
+ DPRINT1("IKsReferenceClock_fnGetTime\n");
+
if (!This->ClockFileObject || !This->ClockTable.GetTime)
{
Result = 0;
@@ -695,6 +701,9 @@ IKsReferenceClock_fnGetPhysicalTime(
IKsPinImpl * This = (IKsPinImpl*)CONTAINING_RECORD(iface, IKsPinImpl, lpVtblReferenceClock);
+ DPRINT1("IKsReferenceClock_fnGetPhysicalTime\n");
+
+
if (!This->ClockFileObject || !This->ClockTable.GetPhysicalTime)
{
Result = 0;
@@ -718,6 +727,8 @@ IKsReferenceClock_fnGetCorrelatedTime(
IKsPinImpl * This = (IKsPinImpl*)CONTAINING_RECORD(iface, IKsPinImpl, lpVtblReferenceClock);
+ DPRINT1("IKsReferenceClock_fnGetCorrelatedTime\n");
+
if (!This->ClockFileObject || !This->ClockTable.GetCorrelatedTime)
{
Result = 0;
@@ -741,6 +752,8 @@ IKsReferenceClock_fnGetCorrelatedPhysicalTime(
IKsPinImpl * This = (IKsPinImpl*)CONTAINING_RECORD(iface, IKsPinImpl, lpVtblReferenceClock);
+ DPRINT1("IKsReferenceClock_fnGetCorrelatedPhysicalTime\n");
+
if (!This->ClockFileObject || !This->ClockTable.GetCorrelatedPhysicalTime)
{
Result = 0;
@@ -1226,6 +1239,7 @@ IKsPin_PrepareStreamHeader(
}
InterlockedDecrement(&This->IrpCount);
+ KsDecrementCountedWorker(This->PinWorker);
/* get stream header */
if (StreamPointer->Irp->RequestorMode == UserMode)
@@ -1374,9 +1388,11 @@ KsStreamPointerUnlock(
IN PKSSTREAM_POINTER StreamPointer,
IN BOOLEAN Eject)
{
- UNIMPLEMENTED
+ PKSISTREAM_POINTER Pointer = (PKSISTREAM_POINTER)CONTAINING_RECORD(StreamPointer, KSISTREAM_POINTER, StreamPointer);
+
DPRINT("KsStreamPointerUnlock StreamPointer %pEject %lu\n", StreamPointer, Eject);
- DbgBreakPoint();
+
+ Pointer->Irp = NULL;
}
/*
@@ -1687,8 +1703,12 @@ KsPinGetFirstCloneStreamPointer(
IKsPinImpl * This;
DPRINT("KsPinGetFirstCloneStreamPointer %p\n", Pin);
-DbgBreakPoint();
+
This = (IKsPinImpl*)CONTAINING_RECORD(Pin, IKsPinImpl, Pin);
+
+ if (!This->ClonedStreamPointer)
+ return NULL;
+
/* return first cloned stream pointer */
return &This->ClonedStreamPointer->StreamPointer;
}
@@ -1709,7 +1729,6 @@ DbgBreakPoint();
/* get stream pointer */
Pointer = (PKSISTREAM_POINTER)CONTAINING_RECORD(StreamPointer, KSISTREAM_POINTER, StreamPointer);
-
/* is there a another cloned stream pointer */
if (!Pointer->Next)
return NULL;
diff --git a/reactos/drivers/ksfilter/ks/topology.c b/reactos/drivers/ksfilter/ks/topology.c
index 87eb1e97c98..cc4a88880e7 100644
--- a/reactos/drivers/ksfilter/ks/topology.c
+++ b/reactos/drivers/ksfilter/ks/topology.c
@@ -270,13 +270,3 @@ KsTopologyPropertyHandler(
return Status;
}
-NTSTATUS
-NTAPI
-KspTopologyPropertyHandler(
- IN PIRP Irp,
- IN PKSIDENTIFIER Request,
- IN OUT PVOID Data)
-{
-
- return STATUS_NOT_IMPLEMENTED;
-}
From 7bfc8fa8eaf6b41efe61e8a41cbd501f953cea45 Mon Sep 17 00:00:00 2001
From: Timo Kreuzer
Date: Fri, 9 Apr 2010 21:10:13 +0000
Subject: [PATCH 085/261] [NTOSKRNL] Fix msvc versions of
Ke386GetGlobalDescriptorTable and Ke386SetGlobalDescriptorTable. Patch by
Jose Catena.
See issue #5071 for more details.
svn path=/trunk/; revision=46797
---
.../ntoskrnl/include/internal/i386/intrin_i.h | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/reactos/ntoskrnl/include/internal/i386/intrin_i.h b/reactos/ntoskrnl/include/internal/i386/intrin_i.h
index a78497b1871..94501841149 100644
--- a/reactos/ntoskrnl/include/internal/i386/intrin_i.h
+++ b/reactos/ntoskrnl/include/internal/i386/intrin_i.h
@@ -136,17 +136,27 @@ Ke386FnInit(VOID)
FORCEINLINE
VOID
-Ke386GetGlobalDescriptorTable(OUT PVOID Descriptor)
+__sgdt(OUT PVOID Descriptor)
{
- __asm sgdt [Descriptor];
+ __asm
+ {
+ mov eax, Descriptor
+ sgdt [eax]
+ }
}
+#define Ke386GetGlobalDescriptorTable __sgdt
FORCEINLINE
VOID
-Ke386SetGlobalDescriptorTable(IN PVOID Descriptor)
+__lgdt(IN PVOID Descriptor)
{
- __asm lgdt [Descriptor];
+ __asm
+ {
+ mov eax, Descriptor
+ lgdt [eax]
+ }
}
+#define Ke386SetGlobalDescriptorTable __lgdt
FORCEINLINE
USHORT
From aca1c8384f27eee35c4e0d7f516d5cb17fbba726 Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Fri, 9 Apr 2010 21:11:32 +0000
Subject: [PATCH 086/261] [NTOSKRNL] - Create registry values for legacy
drivers - Handle raw devices properly - Don't set DNF_STARTED before actually
calling IopStartDevice - Don't set DNF_STARTED for legacy drivers inside
IopCreateDeviceNode - Fixes missing entries in Device Manager for raw devices
svn path=/trunk/; revision=46798
---
reactos/ntoskrnl/io/pnpmgr/pnpmgr.c | 115 ++++++++++++++++++++++------
1 file changed, 90 insertions(+), 25 deletions(-)
diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
index 93e30dc3729..14969fb18db 100644
--- a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
+++ b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
@@ -414,7 +414,10 @@ IopCreateDeviceNode(PDEVICE_NODE ParentNode,
UNICODE_STRING FullServiceName;
UNICODE_STRING LegacyPrefix = RTL_CONSTANT_STRING(L"LEGACY_");
UNICODE_STRING UnknownDeviceName = RTL_CONSTANT_STRING(L"UNKNOWN");
- HANDLE TempHandle;
+ UNICODE_STRING KeyName, ClassName, ClassGUID;
+ PUNICODE_STRING ServiceName1;
+ ULONG LegacyValue;
+ HANDLE InstanceHandle;
DPRINT("ParentNode 0x%p PhysicalDeviceObject 0x%p ServiceName %wZ\n",
ParentNode, PhysicalDeviceObject, ServiceName);
@@ -428,11 +431,13 @@ IopCreateDeviceNode(PDEVICE_NODE ParentNode,
RtlZeroMemory(Node, sizeof(DEVICE_NODE));
if (!ServiceName)
- ServiceName = &UnknownDeviceName;
+ ServiceName1 = &UnknownDeviceName;
+ else
+ ServiceName1 = ServiceName;
if (!PhysicalDeviceObject)
{
- FullServiceName.MaximumLength = LegacyPrefix.Length + ServiceName->Length;
+ FullServiceName.MaximumLength = LegacyPrefix.Length + ServiceName1->Length;
FullServiceName.Length = 0;
FullServiceName.Buffer = ExAllocatePool(PagedPool, FullServiceName.MaximumLength);
if (!FullServiceName.Buffer)
@@ -442,7 +447,7 @@ IopCreateDeviceNode(PDEVICE_NODE ParentNode,
}
RtlAppendUnicodeStringToString(&FullServiceName, &LegacyPrefix);
- RtlAppendUnicodeStringToString(&FullServiceName, ServiceName);
+ RtlAppendUnicodeStringToString(&FullServiceName, ServiceName1);
Status = PnpRootCreateDevice(&FullServiceName, &PhysicalDeviceObject, &Node->InstancePath);
if (!NT_SUCCESS(Status))
@@ -453,14 +458,67 @@ IopCreateDeviceNode(PDEVICE_NODE ParentNode,
}
/* Create the device key for legacy drivers */
- Status = IopCreateDeviceKeyPath(&Node->InstancePath, &TempHandle);
- if (NT_SUCCESS(Status))
- ZwClose(TempHandle);
+ Status = IopCreateDeviceKeyPath(&Node->InstancePath, &InstanceHandle);
+ if (!NT_SUCCESS(Status))
+ {
+ ZwClose(InstanceHandle);
+ ExFreePool(Node);
+ ExFreePool(FullServiceName.Buffer);
+ return Status;
+ }
+ Node->ServiceName.Buffer = ExAllocatePool(PagedPool, ServiceName1->Length);
+ if (!Node->ServiceName.Buffer)
+ {
+ ZwClose(InstanceHandle);
+ ExFreePool(Node);
+ ExFreePool(FullServiceName.Buffer);
+ return Status;
+ }
+
+ Node->ServiceName.MaximumLength = ServiceName1->Length;
+ Node->ServiceName.Length = 0;
+
+ RtlAppendUnicodeStringToString(&Node->ServiceName, ServiceName1);
+
+ if (ServiceName)
+ {
+ RtlInitUnicodeString(&KeyName, L"Service");
+ Status = ZwSetValueKey(InstanceHandle, &KeyName, 0, REG_SZ, ServiceName->Buffer, ServiceName->Length);
+ }
+
+ if (NT_SUCCESS(Status))
+ {
+ RtlInitUnicodeString(&KeyName, L"Legacy");
+
+ LegacyValue = 1;
+ Status = ZwSetValueKey(InstanceHandle, &KeyName, 0, REG_DWORD, &LegacyValue, sizeof(LegacyValue));
+ if (NT_SUCCESS(Status))
+ {
+ RtlInitUnicodeString(&KeyName, L"Class");
+
+ RtlInitUnicodeString(&ClassName, L"LegacyDriver");
+ Status = ZwSetValueKey(InstanceHandle, &KeyName, 0, REG_SZ, ClassName.Buffer, ClassName.Length);
+ if (NT_SUCCESS(Status))
+ {
+ RtlInitUnicodeString(&KeyName, L"ClassGUID");
+
+ RtlInitUnicodeString(&ClassGUID, L"{8ECC055D-047F-11D1-A537-0000F8753ED1}");
+ Status = ZwSetValueKey(InstanceHandle, &KeyName, 0, REG_SZ, ClassGUID.Buffer, ClassGUID.Length);
+ }
+ }
+ }
+
+ ZwClose(InstanceHandle);
ExFreePool(FullServiceName.Buffer);
+ if (!NT_SUCCESS(Status))
+ {
+ ExFreePool(Node);
+ return Status;
+ }
+
/* This is for drivers passed on the command line to ntoskrnl.exe */
- IopDeviceNodeSetFlag(Node, DNF_STARTED);
IopDeviceNodeSetFlag(Node, DNF_LEGACY_DRIVER);
}
@@ -2710,14 +2768,8 @@ IopActionConfigureChildServices(PDEVICE_NODE DeviceNode,
DPRINT1("%wZ is using parent bus driver (%wZ)\n", &DeviceNode->InstancePath, &ParentDeviceNode->ServiceName);
DeviceNode->ServiceName.Length = 0;
- DeviceNode->ServiceName.MaximumLength = ParentDeviceNode->ServiceName.MaximumLength;
- DeviceNode->ServiceName.Buffer = ExAllocatePool(PagedPool, DeviceNode->ServiceName.MaximumLength);
- if (!DeviceNode->ServiceName.Buffer)
- return STATUS_SUCCESS;
-
- RtlCopyUnicodeString(&DeviceNode->ServiceName, &ParentDeviceNode->ServiceName);
-
- IopDeviceNodeSetFlag(DeviceNode, DNF_LEGACY_DRIVER);
+ DeviceNode->ServiceName.MaximumLength = 0;
+ DeviceNode->ServiceName.Buffer = NULL;
}
else if (ClassGUID.Length != 0)
{
@@ -2796,10 +2848,23 @@ IopActionInitChildServices(PDEVICE_NODE DeviceNode,
return STATUS_UNSUCCESSFUL;
}
#endif
+ if (IopDeviceNodeHasFlag(DeviceNode, DNF_STARTED) ||
+ IopDeviceNodeHasFlag(DeviceNode, DNF_ADDED) ||
+ IopDeviceNodeHasFlag(DeviceNode, DNF_DISABLED))
+ return STATUS_SUCCESS;
- if (!IopDeviceNodeHasFlag(DeviceNode, DNF_DISABLED) &&
- !IopDeviceNodeHasFlag(DeviceNode, DNF_ADDED) &&
- !IopDeviceNodeHasFlag(DeviceNode, DNF_STARTED))
+ if (DeviceNode->ServiceName.Buffer == NULL)
+ {
+ /* We don't need to worry about loading the driver because we're
+ * being driven in raw mode so our parent must be loaded to get here */
+ Status = IopStartDevice(DeviceNode);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("IopStartDevice(%wZ) failed with status 0x%08x\n",
+ &DeviceNode->InstancePath, Status);
+ }
+ }
+ else
{
PLDR_DATA_TABLE_ENTRY ModuleObject;
PDRIVER_OBJECT DriverObject;
@@ -2844,6 +2909,7 @@ IopActionInitChildServices(PDEVICE_NODE DeviceNode,
{
/* Attach lower level filter drivers. */
IopAttachFilterDrivers(DeviceNode, TRUE);
+
/* Initialize the function driver for the device node */
Status = IopInitializeDevice(DeviceNode, DriverObject);
@@ -2851,9 +2917,13 @@ IopActionInitChildServices(PDEVICE_NODE DeviceNode,
{
/* Attach upper level filter drivers. */
IopAttachFilterDrivers(DeviceNode, FALSE);
- IopDeviceNodeSetFlag(DeviceNode, DNF_STARTED);
Status = IopStartDevice(DeviceNode);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("IopStartDevice(%wZ) failed with status 0x%08x\n",
+ &DeviceNode->InstancePath, Status);
+ }
}
else
{
@@ -2876,11 +2946,6 @@ IopActionInitChildServices(PDEVICE_NODE DeviceNode,
}
}
}
- else
- {
- DPRINT("Device %wZ is disabled or already initialized\n",
- &DeviceNode->InstancePath);
- }
return STATUS_SUCCESS;
}
From f3683186aa6f551568e54e3bc6f70089ca9b0a5b Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Sat, 10 Apr 2010 04:11:45 +0000
Subject: [PATCH 087/261] [NTOSKRNL] - Cache the next instance value in the the
registry so we don't have to go searching for an unused instance number every
time we add a new device
svn path=/trunk/; revision=46808
---
reactos/ntoskrnl/io/pnpmgr/pnproot.c | 90 +++++++++++++++++++++++-----
1 file changed, 75 insertions(+), 15 deletions(-)
diff --git a/reactos/ntoskrnl/io/pnpmgr/pnproot.c b/reactos/ntoskrnl/io/pnpmgr/pnproot.c
index 63a3dd59c70..7a62ed23ca8 100644
--- a/reactos/ntoskrnl/io/pnpmgr/pnproot.c
+++ b/reactos/ntoskrnl/io/pnpmgr/pnproot.c
@@ -139,29 +139,19 @@ PnpRootCreateDevice(
WCHAR InstancePath[5];
PPNPROOT_DEVICE Device = NULL;
NTSTATUS Status;
- ULONG i;
UNICODE_STRING PathSep = RTL_CONSTANT_STRING(L"\\");
+ ULONG NextInstance;
+ UNICODE_STRING EnumKeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\" REGSTR_PATH_SYSTEMENUM);
+ HANDLE EnumHandle, DeviceKeyHandle = INVALID_HANDLE_VALUE;
+ RTL_QUERY_REGISTRY_TABLE QueryTable[2];
+ OBJECT_ATTRIBUTES ObjectAttributes;
DeviceExtension = PnpRootDeviceObject->DeviceExtension;
KeAcquireGuardedMutex(&DeviceExtension->DeviceListLock);
DPRINT("Creating a PnP root device for service '%wZ'\n", ServiceName);
- /* Search for a free instance ID */
_snwprintf(DevicePath, sizeof(DevicePath) / sizeof(WCHAR), L"%s\\%wZ", REGSTR_KEY_ROOTENUM, ServiceName);
- for (i = 0; i < 9999; i++)
- {
- _snwprintf(InstancePath, sizeof(InstancePath) / sizeof(WCHAR), L"%04lu", i);
- Status = LocateChildDevice(DeviceExtension, DevicePath, InstancePath, &Device);
- if (Status == STATUS_NO_SUCH_DEVICE)
- break;
- }
- if (i == 9999)
- {
- DPRINT1("Too much legacy devices reported for service '%wZ'\n", ServiceName);
- Status = STATUS_INSUFFICIENT_RESOURCES;
- goto cleanup;
- }
/* Initialize a PNPROOT_DEVICE structure */
Device = ExAllocatePoolWithTag(PagedPool, sizeof(PNPROOT_DEVICE), TAG_PNP_ROOT);
@@ -177,6 +167,74 @@ PnpRootCreateDevice(
Status = STATUS_NO_MEMORY;
goto cleanup;
}
+
+ Status = IopOpenRegistryKeyEx(&EnumHandle, NULL, &EnumKeyName, KEY_READ);
+ if (NT_SUCCESS(Status))
+ {
+ InitializeObjectAttributes(&ObjectAttributes, &Device->DeviceID, OBJ_CASE_INSENSITIVE, EnumHandle, NULL);
+ Status = ZwCreateKey(&DeviceKeyHandle, KEY_SET_VALUE, &ObjectAttributes, 0, NULL, 0, NULL);
+ ZwClose(EnumHandle);
+ }
+
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("Failed to open registry key\n");
+ goto cleanup;
+ }
+
+tryagain:
+ RtlZeroMemory(QueryTable, sizeof(QueryTable));
+ QueryTable[0].Name = L"NextInstance";
+ QueryTable[0].EntryContext = &NextInstance;
+ QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED;
+
+ Status = RtlQueryRegistryValues(RTL_REGISTRY_HANDLE,
+ (PWSTR)DeviceKeyHandle,
+ QueryTable,
+ NULL,
+ NULL);
+ if (!NT_SUCCESS(Status))
+ {
+ for (NextInstance = 0; NextInstance <= 9999; NextInstance++)
+ {
+ _snwprintf(InstancePath, sizeof(InstancePath) / sizeof(WCHAR), L"%04lu", NextInstance);
+ Status = LocateChildDevice(DeviceExtension, DevicePath, InstancePath, &Device);
+ if (Status == STATUS_NO_SUCH_DEVICE)
+ break;
+ }
+
+ if (NextInstance > 9999)
+ {
+ DPRINT1("Too many legacy devices reported for service '%wZ'\n", ServiceName);
+ Status = STATUS_INSUFFICIENT_RESOURCES;
+ goto cleanup;
+ }
+ }
+
+ _snwprintf(InstancePath, sizeof(InstancePath) / sizeof(WCHAR), L"%04lu", NextInstance);
+ Status = LocateChildDevice(DeviceExtension, DevicePath, InstancePath, &Device);
+ if (Status != STATUS_NO_SUCH_DEVICE || NextInstance > 9999)
+ {
+ DPRINT1("NextInstance value is corrupt! (%d)\n", NextInstance);
+ RtlDeleteRegistryValue(RTL_REGISTRY_HANDLE,
+ (PWSTR)DeviceKeyHandle,
+ L"NextInstance");
+ goto tryagain;
+ }
+
+ NextInstance++;
+ Status = RtlWriteRegistryValue(RTL_REGISTRY_HANDLE,
+ (PWSTR)DeviceKeyHandle,
+ L"NextInstance",
+ REG_DWORD,
+ &NextInstance,
+ sizeof(NextInstance));
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("Failed to write new NextInstance value! (0x%x)\n", Status);
+ goto cleanup;
+ }
+
if (!RtlCreateUnicodeString(&Device->InstanceID, InstancePath))
{
Status = STATUS_NO_MEMORY;
@@ -243,6 +301,8 @@ cleanup:
RtlFreeUnicodeString(&Device->InstanceID);
ExFreePoolWithTag(Device, TAG_PNP_ROOT);
}
+ if (DeviceKeyHandle != INVALID_HANDLE_VALUE)
+ ZwClose(DeviceKeyHandle);
return Status;
}
From 109f0d331ada723a53b9d4ae27b1a71298302bb3 Mon Sep 17 00:00:00 2001
From: Giannis Adamopoulos
Date: Sat, 10 Apr 2010 09:14:18 +0000
Subject: [PATCH 088/261] [rbuild] MSVC backend: - Fix compilation when using
paths with spaces - Fix spec and pspec rules to generate correctly the def
and stubs file - Group auto-generated files together - Rename some user
macros to more appropriate names - Some cleanup
svn path=/trunk/; revision=46809
---
.../tools/rbuild/backend/msvc/projmaker.cpp | 14 +++
.../rbuild/backend/msvc/s_as_mscpp.rules | 2 +-
reactos/tools/rbuild/backend/msvc/spec.rules | 30 +++---
.../tools/rbuild/backend/msvc/vcprojmaker.cpp | 99 +++++++++----------
.../rbuild/backend/msvc/vspropsmaker.cpp | 38 ++++---
5 files changed, 95 insertions(+), 88 deletions(-)
diff --git a/reactos/tools/rbuild/backend/msvc/projmaker.cpp b/reactos/tools/rbuild/backend/msvc/projmaker.cpp
index efcfd2fb1f5..89bf13bb5ef 100644
--- a/reactos/tools/rbuild/backend/msvc/projmaker.cpp
+++ b/reactos/tools/rbuild/backend/msvc/projmaker.cpp
@@ -69,6 +69,20 @@ void
ProjMaker::_generate_user_configuration()
{
#if 0
+ string computername;
+ string username;
+ string vcproj_file_user = "";
+
+ if (getenv ( "USERNAME" ) != NULL)
+ username = getenv ( "USERNAME" );
+ if (getenv ( "COMPUTERNAME" ) != NULL)
+ computername = getenv ( "COMPUTERNAME" );
+ else if (getenv ( "HOSTNAME" ) != NULL)
+ computername = getenv ( "HOSTNAME" );
+
+ if ((computername != "") && (username != ""))
+ vcproj_file_user = vcproj_file + "." + computername + "." + username + ".user";
+
/* User configuration file */
if (vcproj_file_user != "")
{
diff --git a/reactos/tools/rbuild/backend/msvc/s_as_mscpp.rules b/reactos/tools/rbuild/backend/msvc/s_as_mscpp.rules
index d61a5247496..ec4a41b742c 100644
--- a/reactos/tools/rbuild/backend/msvc/s_as_mscpp.rules
+++ b/reactos/tools/rbuild/backend/msvc/s_as_mscpp.rules
@@ -7,7 +7,7 @@
+
@@ -37,18 +44,11 @@
Switch="/I "[value]""
Delimited="true"
/>
-
diff --git a/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp b/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp
index 582601b3a77..ecd04e0d22b 100644
--- a/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp
+++ b/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp
@@ -90,11 +90,11 @@ VCProjMaker::_get_file_path( FileLocation* file, std::string relative_path)
}
else if(file->directory == IntermediateDirectory)
{
- return std::string("$(obj)\\") + file->relative_path;
+ return std::string("$(RootIntDir)\\") + file->relative_path;
}
else if(file->directory == OutputDirectory)
{
- return std::string("$(out)\\") + file->relative_path;
+ return std::string("$(RootOutDir)\\") + file->relative_path;
}
return std::string("");
@@ -107,51 +107,30 @@ VCProjMaker::_generate_proj_file ( const Module& module )
{
size_t i;
- string computername;
- string username;
-
// make sure the containers are empty
header_files.clear();
includes.clear();
libraries.clear();
common_defines.clear();
- if (getenv ( "USERNAME" ) != NULL)
- username = getenv ( "USERNAME" );
- if (getenv ( "COMPUTERNAME" ) != NULL)
- computername = getenv ( "COMPUTERNAME" );
- else if (getenv ( "HOSTNAME" ) != NULL)
- computername = getenv ( "HOSTNAME" );
-
- string vcproj_file_user = "";
-
- if ((computername != "") && (username != ""))
- vcproj_file_user = vcproj_file + "." + computername + "." + username + ".user";
-
printf ( "Creating MSVC project: '%s'\n", vcproj_file.c_str() );
string path_basedir = module.GetPathToBaseDir ();
- string vcdir;
-
-
- if ( configuration.UseVSVersionInPath )
- {
- vcdir = DEF_SSEP + _get_vc_dir();
- }
bool include_idl = false;
- vector source_files, resource_files;
- vector ifs_list;
+ vector source_files, resource_files, generated_files;
- const IfableData& data = module.non_if_data/**ifs_list.back()*/;
+ const IfableData& data = module.non_if_data;
const vector& files = data.files;
for ( i = 0; i < files.size(); i++ )
{
string path = _get_file_path(&files[i]->file, module.output->relative_path);
string file = path + std::string("\\") + files[i]->file.name;
- if ( !stricmp ( Right(file,3).c_str(), ".rc" ) )
+ if (files[i]->file.directory != SourceDirectory)
+ generated_files.push_back ( file );
+ else if ( !stricmp ( Right(file,3).c_str(), ".rc" ) )
resource_files.push_back ( file );
else if ( !stricmp ( Right(file,2).c_str(), ".h" ) )
header_files.push_back ( file );
@@ -176,7 +155,7 @@ VCProjMaker::_generate_proj_file ( const Module& module )
const vector& libs = data.libraries;
for ( i = 0; i < libs.size(); i++ )
{
- string libpath = "$(out)\\" + libs[i]->importedModule->output->relative_path + "\\" + _get_vc_dir() + "\\$(ConfigurationName)\\" + libs[i]->name + ".lib";
+ string libpath = "$(RootOutDir)\\" + libs[i]->importedModule->output->relative_path + "\\" + _get_vc_dir() + "\\$(ConfigurationName)\\" + libs[i]->name + ".lib";
libraries.push_back ( libpath );
}
const vector& defs = data.defines;
@@ -197,10 +176,20 @@ VCProjMaker::_generate_proj_file ( const Module& module )
baseaddr = prop.value;
}
- if(module.IsSpecDefinitionFile())
+ if(module.importLibrary)
{
- std::string path = _get_file_path(module.importLibrary->source, module.output->relative_path);
- source_files.push_back ( path + std::string("\\") + module.importLibrary->source->name );
+ std::string ImportLibraryPath = _get_file_path(module.importLibrary->source, module.output->relative_path);
+
+ switch (module.IsSpecDefinitionFile())
+ {
+ case PSpec:
+ generated_files.push_back("$(IntDir)\\" + ReplaceExtension(module.importLibrary->source->name,".spec"));
+ case Spec:
+ generated_files.push_back("$(IntDir)\\" + ReplaceExtension(module.importLibrary->source->name,".stubs.c"));
+ generated_files.push_back("$(IntDir)\\" + ReplaceExtension(module.importLibrary->source->name,".def"));
+ default:
+ source_files.push_back(ImportLibraryPath + std::string("\\") + module.importLibrary->source->name);
+ }
}
fprintf ( OUT, "\r\n" );
@@ -263,6 +252,19 @@ VCProjMaker::_generate_proj_file ( const Module& module )
// Write out the project files
fprintf ( OUT, "\t\r\n" );
+ // Generated files
+ fprintf ( OUT, "\t\t\r\n" );
+ for( i = 0; i < generated_files.size(); i++)
+ {
+ string source_file = DosSeparator(generated_files[i]);
+
+ fprintf ( OUT, "\t\t\t\r\n", source_file.c_str() );
+ fprintf ( OUT, "\t\t\t\r\n");
+ }
+ fprintf ( OUT, "\t\t\r\n" );
+
// Source files
fprintf ( OUT, "\t\t\r\n" );
+ fprintf ( OUT, "%s\t\tName=\"%s|Win32\"\r\n", indent_tab.c_str(),config.name.c_str() );
+ fprintf ( OUT, "%s\t\tExcludedFromBuild=\"true\"\r\n",indent_tab.c_str());
+ fprintf ( OUT, ">\r\n" );
+#if 0
fprintf ( OUT, "%s\t\t\r\n", indent_tab.c_str() );
}
+#endif
fprintf ( OUT, "%s\t\r\n", indent_tab.c_str() );
}
//}
@@ -430,6 +434,11 @@ void VCProjMaker::_generate_standard_configuration( const Module& module,
string intermediatedir = "";
string importLib;
+ if ( configuration.UseVSVersionInPath )
+ {
+ vcdir = DEF_SSEP + _get_vc_dir();
+ }
+
if(module.IsSpecDefinitionFile())
{
importLib = "$(IntDir)\\$(ProjectName).def";
@@ -456,23 +465,18 @@ void VCProjMaker::_generate_standard_configuration( const Module& module,
else
CfgType = ConfigUnknown;
- if ( configuration.UseVSVersionInPath )
- {
- vcdir = DEF_SSEP + _get_vc_dir();
- }
-
fprintf ( OUT, "\t\trelative_path.c_str (), vcdir.c_str () );
- fprintf ( OUT, "\t\t\tIntermediateDirectory=\"$(obj)\\%s%s\\$(ConfigurationName)\"\r\n", module.output->relative_path.c_str (), vcdir.c_str () );
+ fprintf ( OUT, "\t\t\tOutputDirectory=\"$(RootOutDir)\\%s%s\\$(ConfigurationName)\"\r\n", module.output->relative_path.c_str (), vcdir.c_str () );
+ fprintf ( OUT, "\t\t\tIntermediateDirectory=\"$(RootIntDir)\\%s%s\\$(ConfigurationName)\"\r\n", module.output->relative_path.c_str (), vcdir.c_str () );
}
else
{
- fprintf ( OUT, "\t\t\tOutputDirectory=\"$(out)\\%s%s\"\r\n", module.output->relative_path.c_str (), vcdir.c_str () );
- fprintf ( OUT, "\t\t\tIntermediateDirectory=\"$(obj)\\%s%s\"\r\n", module.output->relative_path.c_str (), vcdir.c_str () );
+ fprintf ( OUT, "\t\t\tOutputDirectory=\"$(RootOutDir)\\%s%s\"\r\n", module.output->relative_path.c_str (), vcdir.c_str () );
+ fprintf ( OUT, "\t\t\tIntermediateDirectory=\"$(RootIntDir)\\%s%s\"\r\n", module.output->relative_path.c_str (), vcdir.c_str () );
}
fprintf ( OUT, "\t\t\tConfigurationType=\"%d\"\r\n", CfgType );
@@ -751,8 +755,6 @@ VCProjMaker::_generate_makefile_configuration( const Module& module, const MSVCC
string outdir;
string intdir;
- string vcdir;
-
if ( intenv == "obj-i386" )
intdir = path_basedir + "obj-i386"; /* append relative dir from project dir */
@@ -764,11 +766,6 @@ VCProjMaker::_generate_makefile_configuration( const Module& module, const MSVCC
else
outdir = outenv;
- if ( configuration.UseVSVersionInPath )
- {
- vcdir = DEF_SSEP + _get_vc_dir();
- }
-
fprintf ( OUT, "\t\t& incs = data.includes;
for ( i = 0; i < incs.size(); i++ )
{
- if ((strncmp(incs[i]->directory->relative_path.c_str(), "include\\crt", 11 ) ||
- strncmp(incs[i]->directory->relative_path.c_str(), "include\\ddk", 11 ) ||
- strncmp(incs[i]->directory->relative_path.c_str(), "include\\GL", 10 ) ||
- strncmp(incs[i]->directory->relative_path.c_str(), "include\\psdk", 12 ) ||
- strncmp(incs[i]->directory->relative_path.c_str(), "include\\reactos\\wine", 20 )) &&
+ if ((incs[i]->directory->relative_path == "include\\crt" ||
+ incs[i]->directory->relative_path == "include\\ddk" ||
+ incs[i]->directory->relative_path == "include\\GL" ||
+ incs[i]->directory->relative_path == "include\\psdk") &&
! use_ros_headers)
{
continue;
}
if(incs[i]->directory->directory == SourceDirectory)
- fprintf ( OUT, ""$(src)\\");
+ fprintf ( OUT, "$(RootSrcDir)\\");
else if (incs[i]->directory->directory == IntermediateDirectory)
- fprintf ( OUT, ""$(obj)\\");
+ fprintf ( OUT, "$(RootIntDir)\\");
else if (incs[i]->directory->directory == OutputDirectory)
- fprintf ( OUT, ""$(out)\\");
+ fprintf ( OUT, "$(RootOutDir)\\");
else
continue;
fprintf ( OUT, incs[i]->directory->relative_path.c_str());
- fprintf ( OUT, "" ; ");
+ fprintf ( OUT, " ; ");
}
- fprintf ( OUT, ""$(obj)\\include" ; ");
- fprintf ( OUT, ""$(obj)\\include\\reactos" ; ");
+ fprintf ( OUT, "$(RootIntDir)\\include ; ");
+ fprintf ( OUT, "$(RootIntDir)\\include\\reactos ; ");
if ( !use_ros_headers )
{
@@ -180,9 +179,9 @@ PropsMaker::_generate_global_includes()
if (getenv ( "BASEDIR" ) != NULL)
{
string WdkBase = getenv ( "BASEDIR" );
- fprintf ( OUT, ""%s\\inc\\api" ; ", WdkBase.c_str());
- fprintf ( OUT, ""%s\\inc\\crt" ; ", WdkBase.c_str());
- fprintf ( OUT, ""%s\\inc\\ddk" ; ", WdkBase.c_str());
+ fprintf ( OUT, "%s\\inc\\api ; ", WdkBase.c_str());
+ fprintf ( OUT, "%s\\inc\\crt ; ", WdkBase.c_str());
+ fprintf ( OUT, "%s\\inc\\ddk ; ", WdkBase.c_str());
}
}
fprintf ( OUT, "\"\r\n");
@@ -193,9 +192,6 @@ PropsMaker::_generate_global_includes()
void
PropsMaker::_generate_global_definitions()
{
-
- string global_defines = "";
-
fprintf ( OUT, "\t
Date: Sat, 10 Apr 2010 11:44:57 +0000
Subject: [PATCH 089/261] Enable old access check code until the bug that keeps
the device installer from working has been fixed.
svn path=/trunk/; revision=46811
---
reactos/ntoskrnl/se/semgr.c | 51 +++++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/reactos/ntoskrnl/se/semgr.c b/reactos/ntoskrnl/se/semgr.c
index 0cb0da49e07..de374473139 100644
--- a/reactos/ntoskrnl/se/semgr.c
+++ b/reactos/ntoskrnl/se/semgr.c
@@ -377,6 +377,9 @@ SeSetSecurityAccessMask(IN SECURITY_INFORMATION SecurityInformation,
}
}
+
+#define OLD_ACCESS_CHECK
+
BOOLEAN NTAPI
SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
IN PSECURITY_SUBJECT_CONTEXT SubjectSecurityContext,
@@ -389,6 +392,9 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
OUT PNTSTATUS AccessStatus)
{
LUID_AND_ATTRIBUTES Privilege;
+#ifdef OLD_ACCESS_CHECK
+ ACCESS_MASK CurrentAccess, AccessMask;
+#endif
ACCESS_MASK RemainingAccess;
ACCESS_MASK TempAccess;
ACCESS_MASK TempGrantedAccess = 0;
@@ -426,6 +432,9 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
if (PreviouslyGrantedAccess)
RtlMapGenericMask(&PreviouslyGrantedAccess, GenericMapping);
+#ifdef OLD_ACCESS_CHECK
+ CurrentAccess = PreviouslyGrantedAccess;
+#endif
/* Initialize remaining access rights */
RemainingAccess = DesiredAccess;
@@ -490,6 +499,10 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
return TRUE;
}
+#ifdef OLD_ACCESS_CHECK
+ CurrentAccess = PreviouslyGrantedAccess;
+#endif
+
/* RULE 2: Check token for 'take ownership' privilege */
if (DesiredAccess & WRITE_OWNER)
{
@@ -505,6 +518,9 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
/* Adjust access rights */
RemainingAccess &= ~WRITE_OWNER;
PreviouslyGrantedAccess |= WRITE_OWNER;
+#ifdef OLD_ACCESS_CHECK
+ CurrentAccess |= WRITE_OWNER;
+#endif
/* Succeed if there are no more rights to grant */
if (RemainingAccess == 0)
@@ -618,6 +634,11 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
{
if (SepSidInToken(Token, Sid))
{
+#ifdef OLD_ACCESS_CHECK
+ *GrantedAccess = 0;
+ *AccessStatus = STATUS_ACCESS_DENIED;
+ return FALSE;
+#else
/* Map access rights from the ACE */
TempAccess = CurrentAce->AccessMask;
RtlMapGenericMask(&TempAccess, GenericMapping);
@@ -625,18 +646,25 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
/* Leave if a remaining right must be denied */
if (RemainingAccess & TempAccess)
break;
+#endif
}
}
else if (CurrentAce->Header.AceType == ACCESS_ALLOWED_ACE_TYPE)
{
if (SepSidInToken(Token, Sid))
{
+#ifdef OLD_ACCESS_CHECK
+ AccessMask = CurrentAce->AccessMask;
+ RtlMapGenericMask(&AccessMask, GenericMapping);
+ CurrentAccess |= AccessMask;
+#else
/* Map access rights from the ACE */
TempAccess = CurrentAce->AccessMask;
RtlMapGenericMask(&TempAccess, GenericMapping);
/* Remove granted rights */
RemainingAccess &= ~TempAccess;
+#endif
}
}
else
@@ -649,6 +677,28 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
CurrentAce = (PACE)((ULONG_PTR)CurrentAce + CurrentAce->Header.AceSize);
}
+#ifdef OLD_ACCESS_CHECK
+ DPRINT("CurrentAccess %08lx\n DesiredAccess %08lx\n",
+ CurrentAccess, DesiredAccess);
+
+ *GrantedAccess = CurrentAccess & DesiredAccess;
+
+ if ((*GrantedAccess & ~VALID_INHERIT_FLAGS) ==
+ (DesiredAccess & ~VALID_INHERIT_FLAGS))
+ {
+ *AccessStatus = STATUS_SUCCESS;
+ return TRUE;
+ }
+ else
+ {
+ DPRINT1("HACK: Should deny access for caller: granted 0x%lx, desired 0x%lx (generic mapping %p).\n",
+ *GrantedAccess, DesiredAccess, GenericMapping);
+ //*AccessStatus = STATUS_ACCESS_DENIED;
+ //return FALSE;
+ *AccessStatus = STATUS_SUCCESS;
+ return TRUE;
+ }
+#else
DPRINT("DesiredAccess %08lx\nPreviouslyGrantedAccess %08lx\nRemainingAccess %08lx\n",
DesiredAccess, PreviouslyGrantedAccess, RemainingAccess);
@@ -674,6 +724,7 @@ SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
*AccessStatus = STATUS_SUCCESS;
return TRUE;
+#endif
}
static PSID
From 66425524eaaa22108c5773c305042abf81c0b1fa Mon Sep 17 00:00:00 2001
From: Gregor Schneider
Date: Sat, 10 Apr 2010 12:49:41 +0000
Subject: [PATCH 090/261] [TASKMGR] - Add routine to query process index from
performance data - Remove process page index caching, query the index using
the new routine - Fixes "ghost processes" in the task manager, which were
shown due to data access with invalid indexes - Some changes for improved
performance: use local process id's where suitable, only start checking for
new processes if the item performance data and listview counts differ See
issue #4661 for more details.
svn path=/trunk/; revision=46812
---
reactos/base/applications/taskmgr/perfdata.c | 23 ++++
reactos/base/applications/taskmgr/procpage.c | 127 ++++++++++---------
2 files changed, 91 insertions(+), 59 deletions(-)
diff --git a/reactos/base/applications/taskmgr/perfdata.c b/reactos/base/applications/taskmgr/perfdata.c
index 92c01672c6f..eab5dac00e5 100644
--- a/reactos/base/applications/taskmgr/perfdata.c
+++ b/reactos/base/applications/taskmgr/perfdata.c
@@ -356,6 +356,29 @@ ClearInfo:
LeaveCriticalSection(&PerfDataCriticalSection);
}
+ULONG PerfDataGetProcessIndex(ULONG pid)
+{
+ ULONG idx;
+
+ EnterCriticalSection(&PerfDataCriticalSection);
+
+ for (idx = 0; idx < ProcessCount; idx++)
+ {
+ if (PtrToUlong(pPerfData[idx].ProcessId) == pid)
+ {
+ break;
+ }
+ }
+
+ LeaveCriticalSection(&PerfDataCriticalSection);
+
+ if (idx == ProcessCount)
+ {
+ return -1;
+ }
+ return idx;
+}
+
ULONG PerfDataGetProcessCount(void)
{
return ProcessCount;
diff --git a/reactos/base/applications/taskmgr/procpage.c b/reactos/base/applications/taskmgr/procpage.c
index efcaa922e5f..42bf5949ea7 100644
--- a/reactos/base/applications/taskmgr/procpage.c
+++ b/reactos/base/applications/taskmgr/procpage.c
@@ -28,7 +28,6 @@
typedef struct
{
- ULONG Index;
ULONG ProcessId;
} PROCESS_PAGE_LIST_ITEM, *LPPROCESS_PAGE_LIST_ITEM;
@@ -67,7 +66,7 @@ int ProcGetIndexByProcessId(DWORD dwProcessId)
item.iItem = i;
(void)ListView_GetItem(hProcessPageListCtrl, &item);
pData = (LPPROCESS_PAGE_LIST_ITEM)item.lParam;
- if (PerfDataGetProcessId(pData->Index) == dwProcessId)
+ if (pData->ProcessId == dwProcessId)
{
return i;
}
@@ -92,7 +91,7 @@ DWORD GetSelectedProcessId(void)
(void)ListView_GetItem(hProcessPageListCtrl, &lvitem);
if (lvitem.lParam)
- return PerfDataGetProcessId(((LPPROCESS_PAGE_LIST_ITEM)lvitem.lParam)->Index);
+ return ((LPPROCESS_PAGE_LIST_ITEM)lvitem.lParam)->ProcessId;
}
return 0;
@@ -240,7 +239,7 @@ void ProcessPageOnNotify(WPARAM wParam, LPARAM lParam)
break;
pData = (LPPROCESS_PAGE_LIST_ITEM)pnmdi->item.lParam;
- Index = pData->Index;
+ Index = PerfDataGetProcessIndex(pData->ProcessId);
ColumnIndex = pnmdi->item.iSubItem;
PerfDataGetText(Index, ColumnIndex, pnmdi->item.pszText, pnmdi->item.cchTextMax);
@@ -435,7 +434,7 @@ void UpdateProcesses()
{
int i;
ULONG l;
- LV_ITEM item;
+ LV_ITEM item;
LPPROCESS_PAGE_LIST_ITEM pData;
/* Remove old processes */
@@ -452,10 +451,17 @@ void UpdateProcesses()
HeapFree(GetProcessHeap(), 0, pData);
}
}
- for (l = 0; l < PerfDataGetProcessCount(); l++)
+
+ /* Check for difference in listview process and performance process counts */
+ if (ListView_GetItemCount(hProcessPageListCtrl) != PerfDataGetProcessCount())
{
- AddProcess(l);
+ /* Add new processes by checking against the current items */
+ for (l = 0; l < PerfDataGetProcessCount(); l++)
+ {
+ AddProcess(l);
+ }
}
+
if (TaskManagerSettings.SortColumn != -1)
{
(void)ListView_SortItems(hProcessPageListCtrl, ProcessPageCompareFunc, NULL);
@@ -503,7 +509,7 @@ void AddProcess(ULONG Index)
item.iItem = i;
(void)ListView_GetItem(hProcessPageListCtrl, &item);
pData = (LPPROCESS_PAGE_LIST_ITEM)item.lParam;
- if (PerfDataGetProcessId(pData->Index) == pid)
+ if (pData->ProcessId == pid)
{
bAlreadyInList = TRUE;
break;
@@ -512,7 +518,6 @@ void AddProcess(ULONG Index)
if (!bAlreadyInList) /* Add */
{
pData = (LPPROCESS_PAGE_LIST_ITEM)HeapAlloc(GetProcessHeap(), 0, sizeof(PROCESS_PAGE_LIST_ITEM));
- pData->Index = Index;
pData->ProcessId = pid;
/* Add the item to the list */
@@ -707,6 +712,8 @@ int CALLBACK ProcessPageCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lPara
int ret = 0;
LPPROCESS_PAGE_LIST_ITEM Param1;
LPPROCESS_PAGE_LIST_ITEM Param2;
+ ULONG IndexParam1;
+ ULONG IndexParam2;
WCHAR text1[260];
WCHAR text2[260];
ULONG l1;
@@ -725,165 +732,167 @@ int CALLBACK ProcessPageCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lPara
Param1 = (LPPROCESS_PAGE_LIST_ITEM)lParam2;
Param2 = (LPPROCESS_PAGE_LIST_ITEM)lParam1;
}
+ IndexParam1 = PerfDataGetProcessIndex(Param1->ProcessId);
+ IndexParam2 = PerfDataGetProcessIndex(Param2->ProcessId);
if (TaskManagerSettings.SortColumn == COLUMN_IMAGENAME)
{
- PerfDataGetImageName(Param1->Index, text1, sizeof (text1) / sizeof (*text1));
- PerfDataGetImageName(Param2->Index, text2, sizeof (text2) / sizeof (*text2));
+ PerfDataGetImageName(IndexParam1, text1, sizeof (text1) / sizeof (*text1));
+ PerfDataGetImageName(IndexParam2, text2, sizeof (text2) / sizeof (*text2));
ret = _wcsicmp(text1, text2);
}
else if (TaskManagerSettings.SortColumn == COLUMN_PID)
{
- l1 = PerfDataGetProcessId(Param1->Index);
- l2 = PerfDataGetProcessId(Param2->Index);
+ l1 = Param1->ProcessId;
+ l2 = Param2->ProcessId;
ret = CMP(l1, l2);
}
else if (TaskManagerSettings.SortColumn == COLUMN_USERNAME)
{
- PerfDataGetUserName(Param1->Index, text1, sizeof (text1) / sizeof (*text1));
- PerfDataGetUserName(Param2->Index, text2, sizeof (text2) / sizeof (*text2));
+ PerfDataGetUserName(IndexParam1, text1, sizeof (text1) / sizeof (*text1));
+ PerfDataGetUserName(IndexParam2, text2, sizeof (text2) / sizeof (*text2));
ret = _wcsicmp(text1, text2);
}
else if (TaskManagerSettings.SortColumn == COLUMN_SESSIONID)
{
- l1 = PerfDataGetSessionId(Param1->Index);
- l2 = PerfDataGetSessionId(Param2->Index);
+ l1 = PerfDataGetSessionId(IndexParam1);
+ l2 = PerfDataGetSessionId(IndexParam2);
ret = CMP(l1, l2);
}
else if (TaskManagerSettings.SortColumn == COLUMN_CPUUSAGE)
{
- l1 = PerfDataGetCPUUsage(Param1->Index);
- l2 = PerfDataGetCPUUsage(Param2->Index);
+ l1 = PerfDataGetCPUUsage(IndexParam1);
+ l2 = PerfDataGetCPUUsage(IndexParam2);
ret = CMP(l1, l2);
}
else if (TaskManagerSettings.SortColumn == COLUMN_CPUTIME)
{
- time1 = PerfDataGetCPUTime(Param1->Index);
- time2 = PerfDataGetCPUTime(Param2->Index);
+ time1 = PerfDataGetCPUTime(IndexParam1);
+ time2 = PerfDataGetCPUTime(IndexParam2);
ret = largeintcmp(time1, time2);
}
else if (TaskManagerSettings.SortColumn == COLUMN_MEMORYUSAGE)
{
- l1 = PerfDataGetWorkingSetSizeBytes(Param1->Index);
- l2 = PerfDataGetWorkingSetSizeBytes(Param2->Index);
+ l1 = PerfDataGetWorkingSetSizeBytes(IndexParam1);
+ l2 = PerfDataGetWorkingSetSizeBytes(IndexParam2);
ret = CMP(l1, l2);
}
else if (TaskManagerSettings.SortColumn == COLUMN_PEAKMEMORYUSAGE)
{
- l1 = PerfDataGetPeakWorkingSetSizeBytes(Param1->Index);
- l2 = PerfDataGetPeakWorkingSetSizeBytes(Param2->Index);
+ l1 = PerfDataGetPeakWorkingSetSizeBytes(IndexParam1);
+ l2 = PerfDataGetPeakWorkingSetSizeBytes(IndexParam2);
ret = CMP(l1, l2);
}
else if (TaskManagerSettings.SortColumn == COLUMN_MEMORYUSAGEDELTA)
{
- l1 = PerfDataGetWorkingSetSizeDelta(Param1->Index);
- l2 = PerfDataGetWorkingSetSizeDelta(Param2->Index);
+ l1 = PerfDataGetWorkingSetSizeDelta(IndexParam1);
+ l2 = PerfDataGetWorkingSetSizeDelta(IndexParam2);
ret = CMP(l1, l2);
}
else if (TaskManagerSettings.SortColumn == COLUMN_PAGEFAULTS)
{
- l1 = PerfDataGetPageFaultCount(Param1->Index);
- l2 = PerfDataGetPageFaultCount(Param2->Index);
+ l1 = PerfDataGetPageFaultCount(IndexParam1);
+ l2 = PerfDataGetPageFaultCount(IndexParam2);
ret = CMP(l1, l2);
}
else if (TaskManagerSettings.SortColumn == COLUMN_PAGEFAULTSDELTA)
{
- l1 = PerfDataGetPageFaultCountDelta(Param1->Index);
- l2 = PerfDataGetPageFaultCountDelta(Param2->Index);
+ l1 = PerfDataGetPageFaultCountDelta(IndexParam1);
+ l2 = PerfDataGetPageFaultCountDelta(IndexParam2);
ret = CMP(l1, l2);
}
else if (TaskManagerSettings.SortColumn == COLUMN_VIRTUALMEMORYSIZE)
{
- l1 = PerfDataGetVirtualMemorySizeBytes(Param1->Index);
- l2 = PerfDataGetVirtualMemorySizeBytes(Param2->Index);
+ l1 = PerfDataGetVirtualMemorySizeBytes(IndexParam1);
+ l2 = PerfDataGetVirtualMemorySizeBytes(IndexParam2);
ret = CMP(l1, l2);
}
else if (TaskManagerSettings.SortColumn == COLUMN_PAGEDPOOL)
{
- l1 = PerfDataGetPagedPoolUsagePages(Param1->Index);
- l2 = PerfDataGetPagedPoolUsagePages(Param2->Index);
+ l1 = PerfDataGetPagedPoolUsagePages(IndexParam1);
+ l2 = PerfDataGetPagedPoolUsagePages(IndexParam2);
ret = CMP(l1, l2);
}
else if (TaskManagerSettings.SortColumn == COLUMN_NONPAGEDPOOL)
{
- l1 = PerfDataGetNonPagedPoolUsagePages(Param1->Index);
- l2 = PerfDataGetNonPagedPoolUsagePages(Param2->Index);
+ l1 = PerfDataGetNonPagedPoolUsagePages(IndexParam1);
+ l2 = PerfDataGetNonPagedPoolUsagePages(IndexParam2);
ret = CMP(l1, l2);
}
else if (TaskManagerSettings.SortColumn == COLUMN_BASEPRIORITY)
{
- l1 = PerfDataGetBasePriority(Param1->Index);
- l2 = PerfDataGetBasePriority(Param2->Index);
+ l1 = PerfDataGetBasePriority(IndexParam1);
+ l2 = PerfDataGetBasePriority(IndexParam2);
ret = CMP(l1, l2);
}
else if (TaskManagerSettings.SortColumn == COLUMN_HANDLECOUNT)
{
- l1 = PerfDataGetHandleCount(Param1->Index);
- l2 = PerfDataGetHandleCount(Param2->Index);
+ l1 = PerfDataGetHandleCount(IndexParam1);
+ l2 = PerfDataGetHandleCount(IndexParam2);
ret = CMP(l1, l2);
}
else if (TaskManagerSettings.SortColumn == COLUMN_THREADCOUNT)
{
- l1 = PerfDataGetThreadCount(Param1->Index);
- l2 = PerfDataGetThreadCount(Param2->Index);
+ l1 = PerfDataGetThreadCount(IndexParam1);
+ l2 = PerfDataGetThreadCount(IndexParam2);
ret = CMP(l1, l2);
}
else if (TaskManagerSettings.SortColumn == COLUMN_USEROBJECTS)
{
- l1 = PerfDataGetUSERObjectCount(Param1->Index);
- l2 = PerfDataGetUSERObjectCount(Param2->Index);
+ l1 = PerfDataGetUSERObjectCount(IndexParam1);
+ l2 = PerfDataGetUSERObjectCount(IndexParam2);
ret = CMP(l1, l2);
}
else if (TaskManagerSettings.SortColumn == COLUMN_GDIOBJECTS)
{
- l1 = PerfDataGetGDIObjectCount(Param1->Index);
- l2 = PerfDataGetGDIObjectCount(Param2->Index);
+ l1 = PerfDataGetGDIObjectCount(IndexParam1);
+ l2 = PerfDataGetGDIObjectCount(IndexParam2);
ret = CMP(l1, l2);
}
else if (TaskManagerSettings.SortColumn == COLUMN_IOREADS)
{
- PerfDataGetIOCounters(Param1->Index, &iocounters1);
- PerfDataGetIOCounters(Param2->Index, &iocounters2);
+ PerfDataGetIOCounters(IndexParam1, &iocounters1);
+ PerfDataGetIOCounters(IndexParam2, &iocounters2);
ull1 = iocounters1.ReadOperationCount;
ull2 = iocounters2.ReadOperationCount;
ret = CMP(ull1, ull2);
}
else if (TaskManagerSettings.SortColumn == COLUMN_IOWRITES)
{
- PerfDataGetIOCounters(Param1->Index, &iocounters1);
- PerfDataGetIOCounters(Param2->Index, &iocounters2);
+ PerfDataGetIOCounters(IndexParam1, &iocounters1);
+ PerfDataGetIOCounters(IndexParam2, &iocounters2);
ull1 = iocounters1.WriteOperationCount;
ull2 = iocounters2.WriteOperationCount;
ret = CMP(ull1, ull2);
}
else if (TaskManagerSettings.SortColumn == COLUMN_IOOTHER)
{
- PerfDataGetIOCounters(Param1->Index, &iocounters1);
- PerfDataGetIOCounters(Param2->Index, &iocounters2);
+ PerfDataGetIOCounters(IndexParam1, &iocounters1);
+ PerfDataGetIOCounters(IndexParam2, &iocounters2);
ull1 = iocounters1.OtherOperationCount;
ull2 = iocounters2.OtherOperationCount;
ret = CMP(ull1, ull2);
}
else if (TaskManagerSettings.SortColumn == COLUMN_IOREADBYTES)
{
- PerfDataGetIOCounters(Param1->Index, &iocounters1);
- PerfDataGetIOCounters(Param2->Index, &iocounters2);
+ PerfDataGetIOCounters(IndexParam1, &iocounters1);
+ PerfDataGetIOCounters(IndexParam2, &iocounters2);
ull1 = iocounters1.ReadTransferCount;
ull2 = iocounters2.ReadTransferCount;
ret = CMP(ull1, ull2);
}
else if (TaskManagerSettings.SortColumn == COLUMN_IOWRITEBYTES)
{
- PerfDataGetIOCounters(Param1->Index, &iocounters1);
- PerfDataGetIOCounters(Param2->Index, &iocounters2);
+ PerfDataGetIOCounters(IndexParam1, &iocounters1);
+ PerfDataGetIOCounters(IndexParam2, &iocounters2);
ull1 = iocounters1.WriteTransferCount;
ull2 = iocounters2.WriteTransferCount;
ret = CMP(ull1, ull2);
}
else if (TaskManagerSettings.SortColumn == COLUMN_IOOTHERBYTES)
{
- PerfDataGetIOCounters(Param1->Index, &iocounters1);
- PerfDataGetIOCounters(Param2->Index, &iocounters2);
+ PerfDataGetIOCounters(IndexParam1, &iocounters1);
+ PerfDataGetIOCounters(IndexParam2, &iocounters2);
ull1 = iocounters1.OtherTransferCount;
ull2 = iocounters2.OtherTransferCount;
ret = CMP(ull1, ull2);
From 6fb8027ffd2eaae57bb5ca85125c2ec8d21acb26 Mon Sep 17 00:00:00 2001
From: Sylvain Petreolle
Date: Sat, 10 Apr 2010 14:12:54 +0000
Subject: [PATCH 091/261] Add declaration for PerfDataGetProcessIndex. Fixes
taskmgr build without compilation units.
svn path=/trunk/; revision=46813
---
reactos/base/applications/taskmgr/perfdata.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/reactos/base/applications/taskmgr/perfdata.h b/reactos/base/applications/taskmgr/perfdata.h
index 00c2d6dc21a..6bb7005ceaa 100644
--- a/reactos/base/applications/taskmgr/perfdata.h
+++ b/reactos/base/applications/taskmgr/perfdata.h
@@ -60,6 +60,7 @@ void PerfDataUninitialize(void);
void PerfDataRefresh(void);
BOOL PerfDataGet(ULONG Index, PPERFDATA *lppData);
+ULONG PerfDataGetProcessIndex(ULONG pid);
ULONG PerfDataGetProcessCount(void);
ULONG PerfDataGetProcessorUsage(void);
ULONG PerfDataGetProcessorSystemUsage(void);
From 7759232bf57d6921853389e244c466232b742ed4 Mon Sep 17 00:00:00 2001
From: Gregor Schneider
Date: Sat, 10 Apr 2010 14:58:31 +0000
Subject: [PATCH 092/261] [SHELL32] Handle WM_CLOSE instead of WM_DESTROY to
close the dialog
See issue #4226 for more details.
svn path=/trunk/; revision=46814
---
reactos/dll/win32/shell32/she_ocmenu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/reactos/dll/win32/shell32/she_ocmenu.c b/reactos/dll/win32/shell32/she_ocmenu.c
index 216c6265fbf..1b6adec94aa 100644
--- a/reactos/dll/win32/shell32/she_ocmenu.c
+++ b/reactos/dll/win32/shell32/she_ocmenu.c
@@ -756,7 +756,7 @@ static INT_PTR CALLBACK OpenWithProgrammDlg(HWND hwndDlg, UINT uMsg, WPARAM wPar
break;
}
break;
- case WM_DESTROY:
+ case WM_CLOSE:
FreeListItems(hwndDlg);
EndDialog(hwndDlg, 0);
return TRUE;
From eea4d66908aa0a5d93800b021c5e811b6a02fb72 Mon Sep 17 00:00:00 2001
From: Gregor Schneider
Date: Sat, 10 Apr 2010 15:51:31 +0000
Subject: [PATCH 093/261] [TASKMGR] - Implement a SID to user name cache, patch
by Timo Kreuzer with some changes by me See issue #4844 for more details.
svn path=/trunk/; revision=46816
---
reactos/base/applications/taskmgr/perfdata.c | 74 +++++++++++++++++++-
1 file changed, 73 insertions(+), 1 deletion(-)
diff --git a/reactos/base/applications/taskmgr/perfdata.c b/reactos/base/applications/taskmgr/perfdata.c
index eab5dac00e5..a1095e5acd6 100644
--- a/reactos/base/applications/taskmgr/perfdata.c
+++ b/reactos/base/applications/taskmgr/perfdata.c
@@ -40,6 +40,15 @@ SYSTEM_HANDLE_INFORMATION SystemHandleInfo;
PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION SystemProcessorTimeInfo = NULL;
PSID SystemUserSid = NULL;
+typedef struct _SIDTOUSERNAME
+{
+ LIST_ENTRY List;
+ LPWSTR pszName;
+ BYTE Data[0];
+} SIDTOUSERNAME, *PSIDTOUSERNAME;
+
+static LIST_ENTRY SidToUserNameHead = {&SidToUserNameHead, &SidToUserNameHead};
+
BOOL PerfDataInitialize(void)
{
SID_IDENTIFIER_AUTHORITY NtSidAuthority = {SECURITY_NT_AUTHORITY};
@@ -63,6 +72,8 @@ BOOL PerfDataInitialize(void)
void PerfDataUninitialize(void)
{
+ PLIST_ENTRY pCur;
+ PSIDTOUSERNAME pEntry;
if (pPerfData != NULL)
HeapFree(GetProcessHeap(), 0, pPerfData);
@@ -74,6 +85,15 @@ void PerfDataUninitialize(void)
FreeSid(SystemUserSid);
SystemUserSid = NULL;
}
+
+ /* Free user names cache list */
+ pCur = SidToUserNameHead.Flink;
+ while (pCur != &SidToUserNameHead)
+ {
+ pEntry = CONTAINING_RECORD(pCur, SIDTOUSERNAME, List);
+ pCur = pCur->Flink;
+ HeapFree(GetProcessHeap(), 0, pEntry);
+ }
}
static void SidToUserName(PSID Sid, LPWSTR szBuffer, DWORD BufferSize)
@@ -86,6 +106,56 @@ static void SidToUserName(PSID Sid, LPWSTR szBuffer, DWORD BufferSize)
LookupAccountSidW(NULL, Sid, szBuffer, &BufferSize, szDomainNameUnused, &DomainNameLen, &Use);
}
+VOID
+WINAPI
+CachedGetUserFromSid(
+ PSID pSid,
+ LPWSTR pUserName,
+ PULONG pcwcUserName)
+{
+ PLIST_ENTRY pCur;
+ PSIDTOUSERNAME pEntry;
+ ULONG cbSid, cwcUserName;
+
+ cwcUserName = *pcwcUserName;
+
+ /* Walk through the list */
+ for(pCur = SidToUserNameHead.Flink;
+ pCur != &SidToUserNameHead;
+ pCur = pCur->Flink)
+ {
+ pEntry = CONTAINING_RECORD(pCur, SIDTOUSERNAME, List);
+ if (EqualSid((PSID)&pEntry->Data, pSid))
+ {
+ wcsncpy(pUserName, pEntry->pszName, cwcUserName);
+ *pcwcUserName = cwcUserName;
+ return;
+ }
+ }
+
+ /* We didn't find the SID in the list, get the name conventional */
+ SidToUserName(pSid, pUserName, cwcUserName);
+
+ /* Allocate a new entry */
+ *pcwcUserName = wcslen(pUserName);
+ cwcUserName = *pcwcUserName + 1;
+ cbSid = GetLengthSid(pSid);
+ pEntry = HeapAlloc(GetProcessHeap(), 0, sizeof(SIDTOUSERNAME) + cbSid + cwcUserName * sizeof(WCHAR));
+
+ /* Copy the Sid and name to our entry */
+ CopySid(cbSid, (PSID)&pEntry->Data, pSid);
+ pEntry->pszName = (LPWSTR)(pEntry->Data + cbSid);
+ wcsncpy(pEntry->pszName, pUserName, cwcUserName);
+
+ /* Insert the new entry */
+ pEntry->List.Flink = &SidToUserNameHead;
+ pEntry->List.Blink = SidToUserNameHead.Blink;
+ SidToUserNameHead.Blink->Flink = &pEntry->List;
+ SidToUserNameHead.Blink = &pEntry->List;
+
+ return;
+}
+
void PerfDataRefresh(void)
{
ULONG ulSize;
@@ -106,6 +176,7 @@ void PerfDataRefresh(void)
PSECURITY_DESCRIPTOR ProcessSD;
PSID ProcessUser;
ULONG Buffer[64]; /* must be 4 bytes aligned! */
+ ULONG cwcUserName;
/* Get new system time */
status = NtQuerySystemInformation(SystemTimeOfDayInformation, &SysTimeInfo, sizeof(SysTimeInfo), 0);
@@ -341,7 +412,8 @@ ClearInfo:
ZeroMemory(&pPerfData[Idx].IOCounters, sizeof(IO_COUNTERS));
}
- SidToUserName(ProcessUser, pPerfData[Idx].UserName, sizeof(pPerfData[0].UserName) / sizeof(pPerfData[0].UserName[0]));
+ cwcUserName = sizeof(pPerfData[0].UserName) / sizeof(pPerfData[0].UserName[0]);
+ CachedGetUserFromSid(ProcessUser, pPerfData[Idx].UserName, &cwcUserName);
if (ProcessSD != NULL)
{
From d31ce0d47ba77de0de3eeacc3d08b4185a371f24 Mon Sep 17 00:00:00 2001
From: Gregor Schneider
Date: Sat, 10 Apr 2010 16:19:30 +0000
Subject: [PATCH 094/261] [TASKMGR] Handle icon list checks after enumerating
windows, instead of doing them per window Patch by Timo Kreuzer, bug #1940
svn path=/trunk/; revision=46818
---
reactos/base/applications/taskmgr/applpage.c | 115 ++++++++++---------
1 file changed, 63 insertions(+), 52 deletions(-)
diff --git a/reactos/base/applications/taskmgr/applpage.c b/reactos/base/applications/taskmgr/applpage.c
index 355c3aea51a..0c20e810817 100644
--- a/reactos/base/applications/taskmgr/applpage.c
+++ b/reactos/base/applications/taskmgr/applpage.c
@@ -236,6 +236,13 @@ void UpdateApplicationListControlViewSetting(void)
DWORD WINAPI ApplicationPageRefreshThread(void *lpParameter)
{
+ INT i;
+ BOOL bItemRemoved = FALSE;
+ LV_ITEM item;
+ LPAPPLICATION_PAGE_LIST_ITEM pAPLI = NULL;
+ HIMAGELIST hImageListLarge;
+ HIMAGELIST hImageListSmall;
+
/* Create the event */
hApplicationPageEvent = CreateEventW(NULL, TRUE, TRUE, NULL);
@@ -269,6 +276,55 @@ DWORD WINAPI ApplicationPageRefreshThread(void *lpParameter)
EnumWindows(EnumWindowsProc, 0);
if (noApps)
(void)ListView_DeleteAllItems(hApplicationPageListCtrl);
+
+ /* Get the image lists */
+ hImageListLarge = ListView_GetImageList(hApplicationPageListCtrl, LVSIL_NORMAL);
+ hImageListSmall = ListView_GetImageList(hApplicationPageListCtrl, LVSIL_SMALL);
+
+ /* Check to see if we need to remove any items from the list */
+ for (i=ListView_GetItemCount(hApplicationPageListCtrl)-1; i>=0; i--)
+ {
+ memset(&item, 0, sizeof(LV_ITEM));
+ item.mask = LVIF_IMAGE|LVIF_PARAM;
+ item.iItem = i;
+ (void)ListView_GetItem(hApplicationPageListCtrl, &item);
+
+ pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)item.lParam;
+ if (!IsWindow(pAPLI->hWnd)||
+ (wcslen(pAPLI->szTitle) <= 0) ||
+ !IsWindowVisible(pAPLI->hWnd) ||
+ (GetParent(pAPLI->hWnd) != NULL) ||
+ (GetWindow(pAPLI->hWnd, GW_OWNER) != NULL) ||
+ (GetWindowLongPtr(pAPLI->hWnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW))
+ {
+ ImageList_Remove(hImageListLarge, item.iItem);
+ ImageList_Remove(hImageListSmall, item.iItem);
+
+ (void)ListView_DeleteItem(hApplicationPageListCtrl, item.iItem);
+ HeapFree(GetProcessHeap(), 0, pAPLI);
+ bItemRemoved = TRUE;
+ }
+ }
+
+ /*
+ * If an item was removed from the list then
+ * we need to resync all the items with the
+ * image list
+ */
+ if (bItemRemoved)
+ {
+ for (i=0; i=0; i--)
- {
- memset(&item, 0, sizeof(LV_ITEM));
- item.mask = LVIF_IMAGE|LVIF_PARAM;
- item.iItem = i;
- (void)ListView_GetItem(hApplicationPageListCtrl, &item);
-
- pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)item.lParam;
- if (!IsWindow(pAPLI->hWnd)||
- (wcslen(pAPLI->szTitle) <= 0) ||
- !IsWindowVisible(pAPLI->hWnd) ||
- (GetParent(pAPLI->hWnd) != NULL) ||
- (GetWindow(pAPLI->hWnd, GW_OWNER) != NULL) ||
- (GetWindowLongPtrW(hWnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW))
- {
- ImageList_Remove(hImageListLarge, item.iItem);
- ImageList_Remove(hImageListSmall, item.iItem);
-
- (void)ListView_DeleteItem(hApplicationPageListCtrl, item.iItem);
- HeapFree(GetProcessHeap(), 0, pAPLI);
- bItemRemoved = TRUE;
- }
- }
-
- /*
- * If an item was removed from the list then
- * we need to resync all the items with the
- * image list
- */
- if (bItemRemoved)
- {
- for (i=0; i
Date: Sat, 10 Apr 2010 18:00:17 +0000
Subject: [PATCH 095/261] [KS] - Implement dispatching of enable/disable event
properties for filters/pins - Add new pins to list of instantiated pins when
a new pin is created - Remove pin on close and decrement instance count.
Fixes instantiating pin for 2nd time - Rewrite handling of pin
property/method/events - ks is now able to deliver signal statistics in XP
SP3
svn path=/trunk/; revision=46824
---
reactos/drivers/ksfilter/ks/filter.c | 101 +++++++++--
reactos/drivers/ksfilter/ks/ksfunc.h | 26 ++-
reactos/drivers/ksfilter/ks/methods.c | 3 -
reactos/drivers/ksfilter/ks/pin.c | 237 ++++++++++++++------------
4 files changed, 235 insertions(+), 132 deletions(-)
diff --git a/reactos/drivers/ksfilter/ks/filter.c b/reactos/drivers/ksfilter/ks/filter.c
index d5af650d417..bcac218e848 100644
--- a/reactos/drivers/ksfilter/ks/filter.c
+++ b/reactos/drivers/ksfilter/ks/filter.c
@@ -778,12 +778,16 @@ IKsFilter_DispatchDeviceIoControl(
/* get property from input buffer */
Property = (PKSPROPERTY)IoStack->Parameters.DeviceIoControl.Type3InputBuffer;
- /* sanity check */
- ASSERT(IoStack->Parameters.DeviceIoControl.InputBufferLength >= sizeof(KSIDENTIFIER));
-
/* get filter instance */
FilterInstance = Filter->lpVtbl->GetStruct(Filter);
+
+ /* sanity check */
+ ASSERT(IoStack->Parameters.DeviceIoControl.InputBufferLength >= sizeof(KSIDENTIFIER));
+ ASSERT(FilterInstance);
+ ASSERT(FilterInstance->Descriptor);
+ ASSERT(FilterInstance->Descriptor->AutomationTable);
+
RtlStringFromGUID(&Property->Set, &GuidString);
DPRINT("IKsFilter_DispatchDeviceIoControl property Set |%S| Id %u Flags %x\n", GuidString.Buffer, Property->Id, Property->Flags);
RtlFreeUnicodeString(&GuidString);
@@ -794,7 +798,7 @@ IKsFilter_DispatchDeviceIoControl(
ULONG MethodItemSize = 0;
/* check if the driver supports method sets */
- if (FilterInstance->Descriptor->AutomationTable && FilterInstance->Descriptor->AutomationTable->MethodSetsCount)
+ if (FilterInstance->Descriptor->AutomationTable->MethodSetsCount)
{
SetCount = FilterInstance->Descriptor->AutomationTable->MethodSetsCount;
MethodSet = FilterInstance->Descriptor->AutomationTable->MethodSets;
@@ -810,7 +814,7 @@ IKsFilter_DispatchDeviceIoControl(
ULONG PropertyItemSize = 0;
/* check if the driver supports method sets */
- if (FilterInstance->Descriptor->AutomationTable && FilterInstance->Descriptor->AutomationTable->PropertySetsCount)
+ if (FilterInstance->Descriptor->AutomationTable->PropertySetsCount)
{
SetCount = FilterInstance->Descriptor->AutomationTable->PropertySetsCount;
PropertySet = FilterInstance->Descriptor->AutomationTable->PropertySets;
@@ -829,8 +833,23 @@ IKsFilter_DispatchDeviceIoControl(
ASSERT(IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_ENABLE_EVENT ||
IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_DISABLE_EVENT);
- Status = STATUS_NOT_FOUND;
- UNIMPLEMENTED;
+ if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_ENABLE_EVENT)
+ {
+ /* call enable event handlers */
+ Status = KspEnableEvent(Irp,
+ FilterInstance->Descriptor->AutomationTable->EventSetsCount,
+ (PKSEVENT_SET)FilterInstance->Descriptor->AutomationTable->EventSets,
+ &This->Header.EventList,
+ KSEVENTS_SPINLOCK,
+ (PVOID)&This->Header.EventListLock,
+ NULL,
+ FilterInstance->Descriptor->AutomationTable->EventItemSize);
+ }
+ else
+ {
+ /* disable event handler */
+ Status = KsDisableEvent(Irp, &This->Header.EventList, KSEVENTS_SPINLOCK, &This->Header.EventListLock);
+ }
}
RtlStringFromGUID(&Property->Set, &GuidString);
@@ -1041,14 +1060,14 @@ IKsFilter_CopyFilterDescriptor(
}
-NTSTATUS
+VOID
IKsFilter_AddPin(
- IKsFilter * Filter,
+ PKSFILTER Filter,
PKSPIN Pin)
{
PKSPIN NextPin, CurPin;
PKSBASIC_HEADER BasicHeader;
- IKsFilterImpl * This = (IKsFilterImpl*)Filter;
+ IKsFilterImpl * This = (IKsFilterImpl*)CONTAINING_RECORD(Filter, IKsFilterImpl, Filter);
/* sanity check */
ASSERT(Pin->Id < This->PinDescriptorCount);
@@ -1057,7 +1076,8 @@ IKsFilter_AddPin(
{
/* welcome first pin */
This->FirstPin[Pin->Id] = Pin;
- return STATUS_SUCCESS;
+ This->PinInstanceCount[Pin->Id]++;
+ return;
}
/* get first pin */
@@ -1079,8 +1099,58 @@ IKsFilter_AddPin(
/* store pin */
BasicHeader->Next.Pin = Pin;
+}
- return STATUS_SUCCESS;
+VOID
+IKsFilter_RemovePin(
+ PKSFILTER Filter,
+ PKSPIN Pin)
+{
+ PKSPIN NextPin, CurPin, LastPin;
+ PKSBASIC_HEADER BasicHeader;
+ IKsFilterImpl * This = (IKsFilterImpl*)CONTAINING_RECORD(Filter, IKsFilterImpl, Filter);
+
+ /* sanity check */
+ ASSERT(Pin->Id < This->PinDescriptorCount);
+
+ /* get first pin */
+ CurPin = This->FirstPin[Pin->Id];
+
+ LastPin = NULL;
+ do
+ {
+ /* get next instantiated pin */
+ NextPin = KsPinGetNextSiblingPin(CurPin);
+
+ if (CurPin == Pin)
+ {
+ if (LastPin)
+ {
+ /* get basic header of last pin */
+ BasicHeader = (PKSBASIC_HEADER)((ULONG_PTR)LastPin - sizeof(KSBASIC_HEADER));
+
+ BasicHeader->Next.Pin = NextPin;
+ }
+ else
+ {
+ /* erase last pin */
+ This->FirstPin[Pin->Id] = NextPin;
+ }
+ /* decrement pin instance count */
+ This->PinInstanceCount[Pin->Id]--;
+ return;
+ }
+
+ if (!NextPin)
+ break;
+
+ LastPin = CurPin;
+ NextPin = CurPin;
+
+ }while(NextPin != NULL);
+
+ /* pin not found */
+ ASSERT(0);
}
@@ -1129,12 +1199,6 @@ IKsFilter_DispatchCreatePin(
Status = KspCreatePin(DeviceObject, Irp, This->Header.KsDevice, This->FilterFactory, (IKsFilter*)&This->lpVtbl, Connect, &This->PinDescriptorsEx[Connect->PinId]);
DPRINT("IKsFilter_DispatchCreatePin KspCreatePin %lx\n", Status);
-
- if (NT_SUCCESS(Status))
- {
- /* successfully created pin, increment pin instance count */
- This->PinInstanceCount[Connect->PinId]++;
- }
}
else
{
@@ -1471,6 +1535,7 @@ KsFilterReleaseProcessingMutex(
KeReleaseMutex(&This->ProcessingMutex, FALSE);
}
+
/*
@implemented
*/
diff --git a/reactos/drivers/ksfilter/ks/ksfunc.h b/reactos/drivers/ksfilter/ks/ksfunc.h
index 64e2582c4d4..75d73ea4aab 100644
--- a/reactos/drivers/ksfilter/ks/ksfunc.h
+++ b/reactos/drivers/ksfilter/ks/ksfunc.h
@@ -122,11 +122,6 @@ KspCreatePin(
IN PKSPIN_CONNECT Connect,
IN KSPIN_DESCRIPTOR_EX* Descriptor);
-NTSTATUS
-IKsFilter_AddPin(
- IKsFilter * Filter,
- PKSPIN Pin);
-
NTSTATUS
KspAddCreateItemToList(
OUT PLIST_ENTRY ListHead,
@@ -165,3 +160,24 @@ KspMethodHandlerWithAllocator(
IN PFNKSALLOCATOR Allocator OPTIONAL,
IN ULONG MethodItemSize OPTIONAL);
+VOID
+IKsFilter_AddPin(
+ PKSFILTER Filter,
+ PKSPIN Pin);
+
+VOID
+IKsFilter_RemovePin(
+ PKSFILTER Filter,
+ PKSPIN Pin);
+
+NTSTATUS
+KspEnableEvent(
+ 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);
+
diff --git a/reactos/drivers/ksfilter/ks/methods.c b/reactos/drivers/ksfilter/ks/methods.c
index eed17bd13e5..6263ce0b7bb 100644
--- a/reactos/drivers/ksfilter/ks/methods.c
+++ b/reactos/drivers/ksfilter/ks/methods.c
@@ -22,9 +22,6 @@ FindMethodHandler(
{
ULONG Index, ItemIndex;
- /* TODO */
- ASSERT((Method->Flags & KSMETHOD_TYPE_SETSUPPORT) == 0);
-
for(Index = 0; Index < MethodSetCount; Index++)
{
ASSERT(MethodSet[Index].Set);
diff --git a/reactos/drivers/ksfilter/ks/pin.c b/reactos/drivers/ksfilter/ks/pin.c
index 682d25e916d..aa39c8deae1 100644
--- a/reactos/drivers/ksfilter/ks/pin.c
+++ b/reactos/drivers/ksfilter/ks/pin.c
@@ -151,11 +151,14 @@ IKsPin_PinMasterClock(
/* get the object header */
ObjectHeader = (PKSIOBJECT_HEADER)IoStack->FileObject->FsContext2;
+ /* sanity check */
+ ASSERT(ObjectHeader);
+
/* locate ks pin implemention from KSPIN offset */
This = (IKsPinImpl*)CONTAINING_RECORD(ObjectHeader->ObjectType, IKsPinImpl, Pin);
- /* acquire control mutex */
- KeWaitForSingleObject(This->BasicHeader.ControlMutex, Executive, KernelMode, FALSE, NULL);
+ /* sanity check */
+ ASSERT(This);
Handle = (PHANDLE)Data;
@@ -226,10 +229,7 @@ IKsPin_PinMasterClock(
}
}
- /* release processing mutex */
- KeReleaseMutex(This->BasicHeader.ControlMutex, FALSE);
-
- DPRINT("IKsPin_PinStatePropertyHandler Status %lx\n", Status);
+ DPRINT("IKsPin_PinMasterClock Status %lx\n", Status);
return Status;
}
@@ -1907,86 +1907,6 @@ IKsPin_DispatchKsStream(
return Status;
}
-
-NTSTATUS
-IKsPin_DispatchKsProperty(
- PDEVICE_OBJECT DeviceObject,
- PIRP Irp,
- IKsPinImpl * This)
-{
- NTSTATUS Status;
- PKSPROPERTY Property;
- PIO_STACK_LOCATION IoStack;
- UNICODE_STRING GuidString;
- ULONG PropertySetsCount = 0, PropertyItemSize = 0;
- const KSPROPERTY_SET* PropertySets = NULL;
-
- /* sanity check */
- ASSERT(This->Pin.Descriptor);
-
- /* get current irp stack */
- IoStack = IoGetCurrentIrpStackLocation(Irp);
-
-
- if (This->Pin.Descriptor->AutomationTable)
- {
- /* use available driver property sets */
- PropertySetsCount = This->Pin.Descriptor->AutomationTable->PropertySetsCount;
- PropertySets = This->Pin.Descriptor->AutomationTable->PropertySets;
- PropertyItemSize = This->Pin.Descriptor->AutomationTable->PropertyItemSize;
- }
-
-
- /* try driver provided property sets */
- Status = KspPropertyHandler(Irp,
- PropertySetsCount,
- PropertySets,
- NULL,
- PropertyItemSize);
-
- if (Status != STATUS_NOT_FOUND)
- {
- /* property was handled by driver */
- if (Status != STATUS_PENDING)
- {
- Irp->IoStatus.Status = Status;
- IoCompleteRequest(Irp, IO_NO_INCREMENT);
- }
- return Status;
- }
-
- /* try our properties */
- Status = KspPropertyHandler(Irp,
- sizeof(PinPropertySet) / sizeof(KSPROPERTY_SET),
- PinPropertySet,
- NULL,
- 0);
-
- if (Status != STATUS_NOT_FOUND)
- {
- /* property was handled by driver */
- if (Status != STATUS_PENDING)
- {
- Irp->IoStatus.Status = Status;
- IoCompleteRequest(Irp, IO_NO_INCREMENT);
- }
- return Status;
- }
-
- /* property was not handled */
- Property = (PKSPROPERTY)IoStack->Parameters.DeviceIoControl.Type3InputBuffer;
-
- RtlStringFromGUID(&Property->Set, &GuidString);
- DPRINT("IKsPin_DispatchKsProperty Unhandled property Set |%S| Id %u Flags %x\n", GuidString.Buffer, Property->Id, Property->Flags);
- RtlFreeUnicodeString(&GuidString);
-
- Irp->IoStatus.Status = STATUS_NOT_FOUND;
- IoCompleteRequest(Irp, IO_NO_INCREMENT);
-
- return STATUS_NOT_FOUND;
-
-}
-
NTSTATUS
NTAPI
IKsPin_DispatchDeviceIoControl(
@@ -1996,6 +1916,10 @@ IKsPin_DispatchDeviceIoControl(
PIO_STACK_LOCATION IoStack;
PKSIOBJECT_HEADER ObjectHeader;
IKsPinImpl * This;
+ NTSTATUS Status;
+ UNICODE_STRING GuidString;
+ PKSPROPERTY Property;
+ ULONG SetCount = 0;
/* get current irp stack */
IoStack = IoGetCurrentIrpStackLocation(Irp);
@@ -2010,23 +1934,93 @@ IKsPin_DispatchDeviceIoControl(
/* locate ks pin implemention from KSPIN offset */
This = (IKsPinImpl*)CONTAINING_RECORD(ObjectHeader->ObjectType, IKsPinImpl, Pin);
- if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_PROPERTY)
+ /* current irp stack */
+ IoStack = IoGetCurrentIrpStackLocation(Irp);
+
+ /* get property from input buffer */
+ Property = (PKSPROPERTY)IoStack->Parameters.DeviceIoControl.Type3InputBuffer;
+
+ /* sanity check */
+ ASSERT(IoStack->Parameters.DeviceIoControl.InputBufferLength >= sizeof(KSIDENTIFIER));
+ ASSERT(This->Pin.Descriptor->AutomationTable);
+
+ RtlStringFromGUID(&Property->Set, &GuidString);
+ DPRINT("IKsPin_DispatchDeviceIoControl property Set |%S| Id %u Flags %x\n", GuidString.Buffer, Property->Id, Property->Flags);
+ RtlFreeUnicodeString(&GuidString);
+
+
+ if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_METHOD)
{
- /* handle ks properties */
- return IKsPin_DispatchKsProperty(DeviceObject, Irp, This);
+ const KSMETHOD_SET *MethodSet = NULL;
+ ULONG MethodItemSize = 0;
+
+ /* check if the driver supports method sets */
+ if (This->Pin.Descriptor->AutomationTable->MethodSetsCount)
+ {
+ SetCount = This->Pin.Descriptor->AutomationTable->MethodSetsCount;
+ MethodSet = This->Pin.Descriptor->AutomationTable->MethodSets;
+ MethodItemSize = This->Pin.Descriptor->AutomationTable->MethodItemSize;
+ }
+
+ /* call method set handler */
+ Status = KspMethodHandlerWithAllocator(Irp, SetCount, MethodSet, NULL, MethodItemSize);
+ }
+ else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_PROPERTY)
+ {
+ const KSPROPERTY_SET *PropertySet = NULL;
+ ULONG PropertyItemSize = 0;
+
+ /* check if the driver supports method sets */
+ if (This->Pin.Descriptor->AutomationTable->PropertySetsCount)
+ {
+ SetCount = This->Pin.Descriptor->AutomationTable->PropertySetsCount;
+ PropertySet = This->Pin.Descriptor->AutomationTable->PropertySets;
+ PropertyItemSize = This->Pin.Descriptor->AutomationTable->PropertyItemSize;
+ }
+
+ /* needed for our property handlers */
+ KSPROPERTY_ITEM_IRP_STORAGE(Irp) = (KSPROPERTY_ITEM*)This;
+
+ /* call property handler */
+ Status = KspPropertyHandler(Irp, SetCount, PropertySet, NULL, PropertyItemSize);
+ }
+ else
+ {
+ /* sanity check */
+ ASSERT(IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_ENABLE_EVENT ||
+ IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_DISABLE_EVENT);
+
+ if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_ENABLE_EVENT)
+ {
+ /* call enable event handlers */
+ Status = KspEnableEvent(Irp,
+ This->Pin.Descriptor->AutomationTable->EventSetsCount,
+ (PKSEVENT_SET)This->Pin.Descriptor->AutomationTable->EventSets,
+ &This->BasicHeader.EventList,
+ KSEVENTS_SPINLOCK,
+ (PVOID)&This->BasicHeader.EventListLock,
+ NULL,
+ This->Pin.Descriptor->AutomationTable->EventItemSize);
+ }
+ else
+ {
+ /* disable event handler */
+ Status = KsDisableEvent(Irp, &This->BasicHeader.EventList, KSEVENTS_SPINLOCK, &This->BasicHeader.EventListLock);
+ }
}
- if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_WRITE_STREAM ||
- IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_READ_STREAM)
+ RtlStringFromGUID(&Property->Set, &GuidString);
+ DPRINT("IKsPin_DispatchDeviceIoControl property Set |%S| Id %u Flags %x Status %lx ResultLength %lu\n", GuidString.Buffer, Property->Id, Property->Flags, Status, Irp->IoStatus.Information);
+ RtlFreeUnicodeString(&GuidString);
+
+ if (Status != STATUS_PENDING)
{
- /* handle ks properties */
- return IKsPin_DispatchKsStream(DeviceObject, Irp, This);
+ Irp->IoStatus.Status = Status;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
}
- UNIMPLEMENTED;
- Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
- IoCompleteRequest(Irp, IO_NO_INCREMENT);
- return STATUS_NOT_IMPLEMENTED;
+ /* done */
+ return Status;
}
NTSTATUS
@@ -2053,9 +2047,6 @@ IKsPin_Close(
/* locate ks pin implemention fro KSPIN offset */
This = (IKsPinImpl*)CONTAINING_RECORD(ObjectHeader->ObjectType, IKsPinImpl, Pin);
- /* acquire filter control mutex */
- KsFilterAcquireControl(&This->Pin);
-
if (This->Pin.Descriptor->Dispatch->Close)
{
/* call pin close routine */
@@ -2069,7 +2060,8 @@ IKsPin_Close(
return Status;
}
- /* FIXME remove pin from filter pin list and decrement reference count */
+ /* remove pin from filter pin list and decrement reference count */
+ IKsFilter_RemovePin(This->Filter->lpVtbl->GetStruct(This->Filter), &This->Pin);
if (Status != STATUS_PENDING)
{
@@ -2079,9 +2071,6 @@ IKsPin_Close(
}
}
- /* release filter control mutex */
- KsFilterReleaseControl(&This->Pin);
-
return Status;
}
@@ -2228,6 +2217,7 @@ KspCreatePin(
ULONG Index;
ULONG FrameSize = 0;
ULONG NumFrames = 0;
+ KSAUTOMATION_TABLE AutomationTable;
/* sanity checks */
ASSERT(Descriptor->Dispatch);
@@ -2314,6 +2304,8 @@ KspCreatePin(
This->BasicHeader.KsDevice = KsDevice;
This->BasicHeader.Type = KsObjectTypePin;
This->BasicHeader.Parent.KsFilter = Filter->lpVtbl->GetStruct(Filter);
+ InitializeListHead(&This->BasicHeader.EventList);
+ KeInitializeSpinLock(&This->BasicHeader.EventListLock);
ASSERT(This->BasicHeader.Parent.KsFilter);
@@ -2350,11 +2342,43 @@ KspCreatePin(
/* initialize object bag */
Device->lpVtbl->InitializeObjectBag(Device, This->Pin.Bag, NULL);
+ /* allocate pin descriptor */
+ This->Pin.Descriptor = AllocateItem(NonPagedPool, sizeof(KSPIN_DESCRIPTOR_EX));
+ if (!This->Pin.Descriptor)
+ {
+ /* not enough memory */
+ KsFreeObjectBag(This->Pin.Bag);
+ FreeItem(This);
+ FreeItem(CreateItem);
+ return STATUS_INSUFFICIENT_RESOURCES;
+ }
+
+ /* copy pin descriptor */
+ RtlMoveMemory((PVOID)This->Pin.Descriptor, Descriptor, sizeof(KSPIN_DESCRIPTOR_EX));
+
+ /* initialize automation table */
+ RtlZeroMemory(&AutomationTable, sizeof(KSAUTOMATION_TABLE));
+
+ AutomationTable.PropertyItemSize = sizeof(KSPROPERTY_ITEM);
+ AutomationTable.PropertySets = PinPropertySet;
+ AutomationTable.PropertySetsCount = sizeof(PinPropertySet) / sizeof(KSPROPERTY_SET);
+
+ /* merge in pin property sets */
+ Status = KsMergeAutomationTables((PKSAUTOMATION_TABLE*)&This->Pin.Descriptor->AutomationTable, (PKSAUTOMATION_TABLE)Descriptor->AutomationTable, &AutomationTable, This->Pin.Bag);
+
+ if (!NT_SUCCESS(Status))
+ {
+ /* not enough memory */
+ KsFreeObjectBag(This->Pin.Bag);
+ FreeItem(This);
+ FreeItem(CreateItem);
+ return Status;
+ }
+
/* get format */
DataFormat = (PKSDATAFORMAT)(Connect + 1);
/* initialize pin descriptor */
- This->Pin.Descriptor = Descriptor;
This->Pin.Context = NULL;
This->Pin.Id = Connect->PinId;
This->Pin.Communication = Descriptor->PinDescriptor.Communication;
@@ -2482,7 +2506,7 @@ KspCreatePin(
}
/* FIXME add pin instance to filter instance */
-
+ IKsFilter_AddPin(Filter->lpVtbl->GetStruct(Filter), &This->Pin);
if (Descriptor->Dispatch && Descriptor->Dispatch->SetDataFormat)
{
@@ -2505,6 +2529,7 @@ KspCreatePin(
if (!NT_SUCCESS(Status) && Status != STATUS_PENDING)
{
/* failed to create pin, release resources */
+ IKsFilter_RemovePin(Filter->lpVtbl->GetStruct(Filter), &This->Pin);
KsFreeObjectHeader((KSOBJECT_HEADER)This->ObjectHeader);
KsFreeObjectBag((KSOBJECT_BAG)This->Pin.Bag);
FreeItem(This);
From 232f47a639b5456f6007e879456712a08c5fc5b4 Mon Sep 17 00:00:00 2001
From: Daniel Reimer
Date: Sat, 10 Apr 2010 18:38:02 +0000
Subject: [PATCH 096/261] Bug 5217: Italian translation updates by Paolo Devoti
Bug 5282: Czech translation update by Radek Liska
svn path=/trunk/; revision=46825
---
reactos/base/applications/paint/lang/it-IT.rc | 6 +-
reactos/dll/win32/devmgr/lang/cs-CZ.rc | 8 +-
reactos/dll/win32/netcfgx/lang/cs-CZ.rc | 209 +++++++++---------
reactos/dll/win32/netid/lang/cs-CZ.rc | 23 +-
reactos/dll/win32/netid/lang/it-IT.rc | 10 +-
reactos/dll/win32/netshell/lang/cs-CZ.rc | 78 +++----
reactos/dll/win32/setupapi/lang/cs-CZ.rc | 30 +--
reactos/dll/win32/shell32/lang/cs-CZ.rc | 106 ++++-----
reactos/dll/win32/shell32/lang/it-IT.rc | 2 +-
reactos/dll/win32/syssetup/lang/it-IT.rc | 10 +-
reactos/dll/win32/userenv/lang/cs-CZ.rc | 22 +-
11 files changed, 232 insertions(+), 272 deletions(-)
diff --git a/reactos/base/applications/paint/lang/it-IT.rc b/reactos/base/applications/paint/lang/it-IT.rc
index d7b7c9ee218..2c381068586 100644
--- a/reactos/base/applications/paint/lang/it-IT.rc
+++ b/reactos/base/applications/paint/lang/it-IT.rc
@@ -60,8 +60,8 @@ BEGIN
MENUITEM "800%", IDM_VIEWZOOM800
END
MENUITEM SEPARATOR
- MENUITEM "Show grid", IDM_VIEWSHOWGRID
- MENUITEM "Show miniature", IDM_VIEWSHOWMINIATURE
+ MENUITEM "Mostra griglia", IDM_VIEWSHOWGRID
+ MENUITEM "Mostra miniature", IDM_VIEWSHOWMINIATURE
END
MENUITEM "Visualizza a schermo intero\tCtrl+F", IDM_VIEWFULLSCREEN
END
@@ -201,5 +201,5 @@ BEGIN
IDS_OPENFILTER, "Bitmap files (*.bmp;*.dib)\1*.bmp;*.dib\1All files (*.*)\1*.*\1"
IDS_SAVEFILTER, "24 bit bitmap (*.bmp;*.dib)\1*.bmp;*.dib\1"
IDS_FILESIZE, "%d bytes"
- IDS_PRINTRES, "%d x %d pixels per meter"
+ IDS_PRINTRES, "%d x %d pixels per metro"
END
diff --git a/reactos/dll/win32/devmgr/lang/cs-CZ.rc b/reactos/dll/win32/devmgr/lang/cs-CZ.rc
index 2c29b447a76..aa7a56e21c5 100644
--- a/reactos/dll/win32/devmgr/lang/cs-CZ.rc
+++ b/reactos/dll/win32/devmgr/lang/cs-CZ.rc
@@ -1,6 +1,6 @@
/* FILE: dll/win32/devmgr/lang/cs-CZ.rc
* TRANSLATOR: Radek Liska aka Black_Fox (radekliska at gmail dot com)
- * UPDATED: 2008-06-24
+ * UPDATED: 2010-01-07
*/
LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
@@ -202,7 +202,7 @@ END
IDD_DEVICEDETAILS DIALOGEX DISCARDABLE 0, 0, 252, 218
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
-CAPTION "Details"
+CAPTION "Detaily"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
@@ -215,7 +215,7 @@ END
IDD_DEVICERESOURCES DIALOGEX DISCARDABLE 0, 0, 252, 218
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
-CAPTION "Resources"
+CAPTION "Prostøedky"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
@@ -224,7 +224,7 @@ END
IDD_DEVICEPOWER DIALOGEX DISCARDABLE 0, 0, 252, 218
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
-CAPTION "Power"
+CAPTION "Napájení"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
diff --git a/reactos/dll/win32/netcfgx/lang/cs-CZ.rc b/reactos/dll/win32/netcfgx/lang/cs-CZ.rc
index 887cb443c8d..5aff39c2e5b 100644
--- a/reactos/dll/win32/netcfgx/lang/cs-CZ.rc
+++ b/reactos/dll/win32/netcfgx/lang/cs-CZ.rc
@@ -1,12 +1,17 @@
-LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
+/* FILE: dll/win32/netcfgx/lang/cs-CZ.rc
+ * TRANSLATOR: Radek Liska aka Black_Fox (radekliska at gmail dot com)
+ * UPDATED: 2010-03-14
+ * THANKS TO: potapnik, who translated part of this file
+ */
+LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
IDD_TCPIP_BASIC_DLG DIALOGEX DISCARDABLE 0, 0, 246, 228
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Obecné nastavení"
FONT 8, "MS Shell Dlg"
BEGIN
- LTEXT "Konfigurace IP adres mùže probìhnout automaticky, pokud to Vaše sí dovoluje. V opaèném pøípadì kontaktujte správce sítì pro správné nastavení.", -1, 9, 9, 228, 27
+ LTEXT "Konfigurace IP adres mùže probìhnout automaticky, pokud to sí dovoluje. V opaèném pøípadì kontaktujte správce sítì pro správné nastavení.", -1, 9, 9, 228, 27
CONTROL "Získat IP adresu automaticky", IDC_USEDHCP, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP, 14, 43, 210, 12
GROUPBOX "", -1, 9, 61, 228, 70, BS_GROUPBOX
CONTROL "&Použít následující IP adresu:", IDC_NODHCP, "BUTTON", BS_AUTORADIOBUTTON, 14, 59, 105, 12
@@ -28,43 +33,43 @@ END
IDD_TCPIP_ALTCF_DLG DIALOGEX DISCARDABLE 0, 0, 246, 228
STYLE DS_SHELLFONT | WS_CHILD | WS_CAPTION
-CAPTION "Alternate Configuration"
+CAPTION "Alternativní konfigurace"
FONT 8, "MS Shell Dlg"
BEGIN
- LTEXT "If this computer is used on more than one network, enter the alternate IP settings below", -1, 9, 9, 220, 20
- CONTROL "Au&tomatic private IP address", IDC_USEDHCP, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 14, 40, 210, 12
+ LTEXT "Pokud je tento poèítaè používán ve více než jedné síti, lze zadat alternativní nastavení níže", -1, 9, 9, 220, 20
+ CONTROL "Au&tomatická privátní IP adresa", IDC_USEDHCP, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 14, 40, 210, 12
GROUPBOX "", -1, 9, 55, 228, 80, BS_GROUPBOX
- CONTROL "U&ser configured", IDC_NODHCP, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 14, 55, 70, 12
- LTEXT "&IP address:", -1, 14, 75, 135, 8
+ CONTROL "&Uživatelské nastavení", IDC_NODHCP, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 14, 55, 70, 12
+ LTEXT "&IP adresa:", -1, 14, 75, 135, 8
CONTROL "",IDC_IPADDR,"SysIPAddress32",WS_TABSTOP, 150, 75, 80, 12
- LTEXT "S&ubnet mask:", -1, 14, 95, 135, 8
+ LTEXT "&Maska podsítì:", -1, 14, 95, 135, 8
CONTROL "",IDC_SUBNETMASK,"SysIPAddress32",WS_TABSTOP, 150, 95, 80, 12
- LTEXT "&Default gateway:", -1, 14, 115, 135, 8
+ LTEXT "&Výchozí brána:", -1, 14, 115, 135, 8
CONTROL "",IDC_DEFGATEWAY,"SysIPAddress32",WS_TABSTOP, 150, 115, 80, 12
- LTEXT "&Preferred DNS server:", -1, 14, 150, 135, 8
+ LTEXT "&Preferovaný DNS server:", -1, 14, 150, 135, 8
CONTROL "",IDC_DNS1,"SysIPAddress32",WS_TABSTOP, 150, 150, 80, 12
- LTEXT "&Alternate DNS server:", -1, 14, 165, 180, 8
+ LTEXT "&Alternativní DNS server:", -1, 14, 165, 180, 8
CONTROL "",IDC_DNS2,"SysIPAddress32",WS_TABSTOP, 150, 165, 80, 12
END
IDD_TCPIP_ADVIP_DLG DIALOGEX DISCARDABLE 0, 0, 247, 247
STYLE DS_SHELLFONT | WS_CHILD | WS_CAPTION
-CAPTION "IP Settings"
+CAPTION "IP nastavení"
FONT 8, "MS Shell Dlg"
BEGIN
- GROUPBOX "IP addresses", -1, 5, 5, 240, 90
+ GROUPBOX "IP adresy", -1, 5, 5, 240, 90
CONTROL "", IDC_IPLIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 15, 15, 210, 55
- PUSHBUTTON "Add...", IDC_IPADD, 60, 75, 50, 14, WS_TABSTOP
- PUSHBUTTON "Edit...", IDC_IPMOD, 120, 75, 50, 14, WS_TABSTOP
- PUSHBUTTON "Remove", IDC_IPDEL, 180, 75, 50, 14, WS_TABSTOP
- GROUPBOX "Default gateways:", -1, 5, 100, 240, 90
+ PUSHBUTTON "Pøidat...", IDC_IPADD, 60, 75, 50, 14, WS_TABSTOP
+ PUSHBUTTON "Upravit...", IDC_IPMOD, 120, 75, 50, 14, WS_TABSTOP
+ PUSHBUTTON "Odebrat", IDC_IPDEL, 180, 75, 50, 14, WS_TABSTOP
+ GROUPBOX "Výchozí brány:", -1, 5, 100, 240, 90
CONTROL "", IDC_GWLIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 15, 110, 210, 55
- PUSHBUTTON "Add...", IDC_GWADD, 60, 170, 50, 14, WS_TABSTOP
- PUSHBUTTON "Edit...", IDC_GWMOD, 120, 170, 50, 14, WS_TABSTOP
- PUSHBUTTON "Remove", IDC_GWDEL, 180, 170, 50, 14, WS_TABSTOP
+ PUSHBUTTON "Pøidat...", IDC_GWADD, 60, 170, 50, 14, WS_TABSTOP
+ PUSHBUTTON "Upravit...", IDC_GWMOD, 120, 170, 50, 14, WS_TABSTOP
+ PUSHBUTTON "Odebrat", IDC_GWDEL, 180, 170, 50, 14, WS_TABSTOP
GROUPBOX "", -1, 5, 200, 240, 30
- CHECKBOX "Automatic metric", IDC_AUTOMETRIC, 9, 200, 90, 12, BS_AUTOCHECKBOX | WS_TABSTOP
- LTEXT "Interface metric:", -1, 15, 215, 90, 12
+ CHECKBOX "Automatická metrika", IDC_AUTOMETRIC, 9, 200, 90, 12, BS_AUTOCHECKBOX | WS_TABSTOP
+ LTEXT "Metrika rozhraní:", -1, 15, 215, 90, 12
EDITTEXT IDC_METRIC, 110, 212, 50, 12, WS_TABSTOP | ES_NUMBER
END
@@ -74,158 +79,158 @@ CAPTION "DNS"
FONT 8, "MS Shell Dlg"
BEGIN
LISTBOX IDC_DNSADDRLIST, 5, 15, 180, 60, LBS_NOTIFY
- LTEXT "D&NS server addresses, in order of use:", -1, 5, 5, 180, 12
- PUSHBUTTON "Up", IDC_DNSADDRUP, 190, 30, 50, 14, WS_TABSTOP
- PUSHBUTTON "Down", IDC_DNSADDRDOWN, 190, 50, 50, 14, WS_TABSTOP
- PUSHBUTTON "&Add...", IDC_DNSADDRADD, 30, 70, 50, 14, WS_TABSTOP
- PUSHBUTTON "&Edit...", IDC_DNSADDRMOD, 100, 70, 50, 14, WS_TABSTOP
- PUSHBUTTON "Remo&ve", IDC_DNSADDRDEL, 170, 70, 50, 14, WS_TABSTOP
- LTEXT "The following three settings are applied to all connections with TCP/IP enabled. For resolution of unqualified names:", -1, 5, 90, 220, 24
- CONTROL "Append &primary and connection specific DNS suffixes", IDC_PRIMSUFFIX, "BUTTON", BS_AUTORADIOBUTTON, 5, 110, 160, 12
- CHECKBOX "Append parent suffi&xes of the primary DNS suffix", IDC_TOPPRIMSUFFIX, 15, 125, 190, 12, BS_AUTOCHECKBOX | WS_TABSTOP
- CONTROL "Append t&hese DNS suffixes(in order):", IDC_SELSUFFIX, "BUTTON", BS_AUTORADIOBUTTON, 5, 140, 190, 12
+ LTEXT "&Adresy DNS serverù v poøadí využití:", -1, 5, 5, 180, 12
+ PUSHBUTTON "Nahoru", IDC_DNSADDRUP, 190, 30, 50, 14, WS_TABSTOP
+ PUSHBUTTON "Dolù", IDC_DNSADDRDOWN, 190, 50, 50, 14, WS_TABSTOP
+ PUSHBUTTON "&Pøidat...", IDC_DNSADDRADD, 30, 70, 50, 14, WS_TABSTOP
+ PUSHBUTTON "&Upravit...", IDC_DNSADDRMOD, 100, 70, 50, 14, WS_TABSTOP
+ PUSHBUTTON "&Odebrat", IDC_DNSADDRDEL, 170, 70, 50, 14, WS_TABSTOP
+ LTEXT "Následující tøi nastavení jsou aplikována na všechna pøipojení s povoleným TCP/IP. Pøi rezoluci nekvalifikovaných jmen:", -1, 5, 90, 220, 24
+ CONTROL "Pøipojit p&rimární a pøipojením dané DNS pøípony", IDC_PRIMSUFFIX, "BUTTON", BS_AUTORADIOBUTTON, 5, 110, 160, 12
+ CHECKBOX "Pøipojit rodièovské pøípony primární DNS pøípony", IDC_TOPPRIMSUFFIX, 15, 125, 190, 12, BS_AUTOCHECKBOX | WS_TABSTOP
+ CONTROL "Pøipojit &tyto DNS pøípony (v tomto poøadí):", IDC_SELSUFFIX, "BUTTON", BS_AUTORADIOBUTTON, 5, 140, 190, 12
LISTBOX IDC_DNSSUFFIXLIST, 5, 155, 180, 60, LBS_NOTIFY
- PUSHBUTTON "Up", IDC_DNSSUFFIXUP, 190, 170, 50, 14, WS_TABSTOP
- PUSHBUTTON "Down", IDC_DNSSUFFIXDOWN, 190, 190, 50, 14, WS_TABSTOP
- PUSHBUTTON "&Add...", IDC_DNSSUFFIXADD, 30, 210, 50, 14, WS_TABSTOP
- PUSHBUTTON "&Edit...", IDC_DNSSUFFIXMOD, 100, 210, 50, 14, WS_TABSTOP
- PUSHBUTTON "Remo&ve", IDC_DNSSUFFIXDEL, 170, 210, 50, 14, WS_TABSTOP
- LTEXT "DNS &suffix for this connection:", -1, 5, 225, 110, 14
+ PUSHBUTTON "Nahoru", IDC_DNSSUFFIXUP, 190, 170, 50, 14, WS_TABSTOP
+ PUSHBUTTON "Dolù", IDC_DNSSUFFIXDOWN, 190, 190, 50, 14, WS_TABSTOP
+ PUSHBUTTON "&Pøidat...", IDC_DNSSUFFIXADD, 30, 210, 50, 14, WS_TABSTOP
+ PUSHBUTTON "&Upravit...", IDC_DNSSUFFIXMOD, 100, 210, 50, 14, WS_TABSTOP
+ PUSHBUTTON "&Odebrat", IDC_DNSSUFFIXDEL, 170, 210, 50, 14, WS_TABSTOP
+ LTEXT "DNS pøípo&na tohoto pøipojení:", -1, 5, 225, 110, 14
EDITTEXT IDC_SUFFIX, 120, 225, 100, 12, WS_TABSTOP
- CHECKBOX "&Register this connection's addresses in DNS", IDC_REGSUFFIX, 15, 240, 190, 12, BS_AUTOCHECKBOX | WS_TABSTOP
- CHECKBOX "&Use this connection's DNS suffix in DNS registration", IDC_USESUFFIX, 15, 255, 190, 12, BS_AUTOCHECKBOX | WS_TABSTOP
+ CHECKBOX "Registrovat &adresy tohoto pøipojení v DNS", IDC_REGSUFFIX, 15, 240, 190, 12, BS_AUTOCHECKBOX | WS_TABSTOP
+ CHECKBOX "P&oužít DNS pøíponu tohoto pøipojení pøi DNS registraci", IDC_USESUFFIX, 15, 255, 190, 12, BS_AUTOCHECKBOX | WS_TABSTOP
END
IDD_TCPIP_ADVOPT_DLG DIALOGEX DISCARDABLE 0, 0, 247, 247
STYLE DS_SHELLFONT | WS_CHILD | WS_CAPTION
-CAPTION "Options"
+CAPTION "Volby"
FONT 8, "MS Shell Dlg"
BEGIN
LISTBOX IDC_OPTLIST, 5, 30, 230, 70
- LTEXT "&Optional settings", -1, 5, 15, 130, 12
- PUSHBUTTON "&Properties", IDC_OPTPROP, 160, 100, 70, 14, WS_TABSTOP
- GROUPBOX "Description:", -1, 5, 120, 240, 70
+ LTEXT "&Volitelná nastavení", -1, 5, 15, 130, 12
+ PUSHBUTTON "&Podrobnosti", IDC_OPTPROP, 160, 100, 70, 14, WS_TABSTOP
+ GROUPBOX "Popis:", -1, 5, 120, 240, 70
LTEXT "", IDC_OPTDESC, 15, 130, 220, 33
END
IDD_TCPIPADDIP_DLG DIALOGEX DISCARDABLE 0, 0, 200, 70
STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "TCP/IP Address"
+CAPTION "TCP/IP adresa"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "",IDC_IPADDR,"SysIPAddress32",WS_TABSTOP, 100, 15, 80, 12
- LTEXT "IP address:", -1, 5, 15, 70, 12
- LTEXT "Subnet mask:", -1, 5, 30, 70, 12
+ LTEXT "IP adresa:", -1, 5, 15, 70, 12
+ LTEXT "Maska podsítì:", -1, 5, 30, 70, 12
CONTROL "",IDC_SUBNETMASK,"SysIPAddress32", WS_TABSTOP, 100, 30, 80, 12
- PUSHBUTTON "", IDC_OK, 50, 50, 50, 14, WS_TABSTOP
- PUSHBUTTON "Cancel", IDCANCEL, 110, 50, 50, 14, WS_TABSTOP
+ PUSHBUTTON "OK", IDC_OK, 50, 50, 50, 14, WS_TABSTOP
+ PUSHBUTTON "Storno", IDCANCEL, 110, 50, 50, 14, WS_TABSTOP
END
IDD_TCPIPGW_DLG DIALOGEX DISCARDABLE 0, 0, 200, 80
STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "TCP/IP Gateway Address"
+CAPTION "TCP/IP adresa brány"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "",IDC_IPADDR,"SysIPAddress32",WS_TABSTOP, 100, 15, 80, 12
- LTEXT "Gateway:", -1, 5, 15, 70, 12
- CHECKBOX "Automatic metric", IDC_USEMETRIC, 15, 30, 190, 12, BS_AUTOCHECKBOX | WS_TABSTOP
- LTEXT "&Metric:", IDC_METRICTXT, 5, 45, 45, 12, WS_DISABLED
+ LTEXT "Brána:", -1, 5, 15, 70, 12
+ CHECKBOX "Automatická metrika", IDC_USEMETRIC, 15, 30, 190, 12, BS_AUTOCHECKBOX | WS_TABSTOP
+ LTEXT "&Metrika:", IDC_METRICTXT, 5, 45, 45, 12, WS_DISABLED
EDITTEXT IDC_METRIC, 100, 45, 50, 12, WS_TABSTOP | ES_NUMBER | WS_DISABLED
PUSHBUTTON "", IDC_OK, 50, 60, 50, 14, WS_TABSTOP
- PUSHBUTTON "Cancel", IDCANCEL, 110, 60, 50, 14, WS_TABSTOP
+ PUSHBUTTON "Storno", IDCANCEL, 110, 60, 50, 14, WS_TABSTOP
END
IDD_TCPIPDNS_DLG DIALOGEX DISCARDABLE 0, 0, 200, 80
STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "TCP/IP DNS Server"
+CAPTION "TCP/IP DNS server"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "",IDC_IPADDR,"SysIPAddress32",WS_TABSTOP, 5, 25, 80, 12
LTEXT "DNS server:", -1, 5, 10, 120, 12
PUSHBUTTON "", IDC_OK, 50, 50, 50, 14, WS_TABSTOP
- PUSHBUTTON "Cancel", IDCANCEL, 110, 50, 50, 14, WS_TABSTOP
+ PUSHBUTTON "Storno", IDCANCEL, 110, 50, 50, 14, WS_TABSTOP
END
IDD_TCPIPSUFFIX_DLG DIALOGEX DISCARDABLE 0, 0, 200, 80
STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "TCP/IP Domain Suffix"
+CAPTION "TCP/IP doménová pøípona"
FONT 8, "MS Shell Dlg"
BEGIN
EDITTEXT IDC_SUFFIX, 5, 25, 190, 12, WS_TABSTOP
- LTEXT "Domain suffix:", -1, 5, 10, 120, 12
+ LTEXT "Doménová pøípona:", -1, 5, 10, 120, 12
PUSHBUTTON "", IDC_OK, 50, 50, 50, 14, WS_TABSTOP
- PUSHBUTTON "Cancel", IDCANCEL, 110, 50, 50, 14, WS_TABSTOP
+ PUSHBUTTON "Storno", IDCANCEL, 110, 50, 50, 14, WS_TABSTOP
END
IDD_TCPIP_FILTER_DLG DIALOGEX DISCARDABLE 0, 0, 305, 220
STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "TCP/IP Filtering"
+CAPTION "TCP/IP filtrování"
FONT 8, "MS Shell Dlg"
BEGIN
- CHECKBOX "Enable TCP/IP-Filtering (All adapters)", IDC_USE_FILTER, 15, 5, 190, 12, BS_AUTOCHECKBOX | WS_TABSTOP
+ CHECKBOX "Zapnout filtrování TCP/IP (všechny adaptéry)", IDC_USE_FILTER, 15, 5, 190, 12, BS_AUTOCHECKBOX | WS_TABSTOP
GROUPBOX "", -1, 5, 30, 90, 150
- CONTROL "Permit All", IDC_TCP_ALLOW_ALL, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 15, 30, 70, 12
- CONTROL "Permit Only", IDC_TCP_RESTRICT, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 15, 44, 70, 12
+ CONTROL "Povolit vše", IDC_TCP_ALLOW_ALL, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 15, 30, 70, 12
+ CONTROL "Povolit pouze", IDC_TCP_RESTRICT, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 15, 44, 70, 12
CONTROL "", IDC_TCP_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 11, 62, 72, 75
- PUSHBUTTON "Add", IDC_TCP_ADD, 15, 141, 50, 14, WS_TABSTOP
- PUSHBUTTON "Remove", IDC_TCP_DEL, 15, 161, 50, 14, WS_TABSTOP
+ PUSHBUTTON "Pøidat", IDC_TCP_ADD, 15, 141, 50, 14, WS_TABSTOP
+ PUSHBUTTON "Odebrat", IDC_TCP_DEL, 15, 161, 50, 14, WS_TABSTOP
GROUPBOX "", -1, 105, 30, 90, 150
- CONTROL "Permit All", IDC_UDP_ALLOW_ALL, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 115, 30, 70, 12
- CONTROL "Permit Only", IDC_UDP_RESTRICT, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 115, 44, 70, 12
+ CONTROL "Povolit vše", IDC_UDP_ALLOW_ALL, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 115, 30, 70, 12
+ CONTROL "Povolit pouze", IDC_UDP_RESTRICT, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 115, 44, 70, 12
CONTROL "", IDC_UDP_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 111, 62, 72, 75
- PUSHBUTTON "Add", IDC_UDP_ADD, 115, 141, 50, 14, WS_TABSTOP
- PUSHBUTTON "Remove", IDC_UDP_DEL, 115, 161, 50, 14, WS_TABSTOP
+ PUSHBUTTON "Pøidat", IDC_UDP_ADD, 115, 141, 50, 14, WS_TABSTOP
+ PUSHBUTTON "Odebrat", IDC_UDP_DEL, 115, 161, 50, 14, WS_TABSTOP
GROUPBOX "", -1, 205, 30, 90, 150
- CONTROL "Permit All", IDC_IP_ALLOW_ALL, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 215, 30, 70, 12
- CONTROL "Permit Only", IDC_IP_RESTRICT, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 215, 44, 70, 12
+ CONTROL "Povolit vše", IDC_IP_ALLOW_ALL, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 215, 30, 70, 12
+ CONTROL "Povolit pouze", IDC_IP_RESTRICT, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 215, 44, 70, 12
CONTROL "", IDC_IP_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 211, 62, 72, 75
- PUSHBUTTON "Add", IDC_IP_ADD, 215, 141, 50, 14, WS_TABSTOP
- PUSHBUTTON "Remove", IDC_IP_DEL, 215, 161, 50, 14, WS_TABSTOP
+ PUSHBUTTON "Pøidat", IDC_IP_ADD, 215, 141, 50, 14, WS_TABSTOP
+ PUSHBUTTON "Odebrat", IDC_IP_DEL, 215, 161, 50, 14, WS_TABSTOP
PUSHBUTTON "OK", IDC_OK, 150, 190, 50, 14, WS_TABSTOP
- PUSHBUTTON "Cancel", IDCANCEL, 210, 190, 50, 14, WS_TABSTOP
+ PUSHBUTTON "Storno", IDCANCEL, 210, 190, 50, 14, WS_TABSTOP
END
IDD_TCPIP_PORT_DLG DIALOGEX DISCARDABLE 0, 0, 200, 60
STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Add Filter"
+CAPTION "Pøidat filtr"
FONT 8, "MS Shell Dlg"
BEGIN
EDITTEXT IDC_PORT_VAL, 5, 30, 70, 12, WS_TABSTOP | ES_NUMBER
LTEXT "", IDC_PORT_DESC, 5, 15, 40, 12
PUSHBUTTON "OK", IDC_OK, 120, 15, 50, 14, WS_TABSTOP
- PUSHBUTTON "Cancel", IDCANCEL, 120, 30, 50, 14, WS_TABSTOP
+ PUSHBUTTON "Storno", IDCANCEL, 120, 30, 50, 14, WS_TABSTOP
END
STRINGTABLE
BEGIN
- IDS_NET_CONNECT "Network connection"
- IDS_NO_IPADDR_SET "The adapter requires at least one IP address. Please enter one."
- IDS_NO_SUBMASK_SET "You have entered an address that is missing its subnet mask. Please add a subnet mask."
- IDS_TCPFILTERDESC "TCP/IP filtering allows you to control the type of TCP/IP network traffic that reaches your computer."
- IDS_TCPFILTER "TCP/IP Filtering"
- IDS_IPADDR "IP address"
- IDS_SUBMASK "Subnet mask"
- IDS_GATEWAY "Gateway"
- IDS_METRIC "Metric"
- IDS_DHCPACTIVE "DHCP Enabled"
- IDS_AUTOMATIC "Automatic"
- IDS_NOITEMSEL "You have not selected an item. Select one first."
+ IDS_NET_CONNECT "Síové pøipojení"
+ IDS_NO_IPADDR_SET "Adaptér vyžaduje zadání alespoò jedné IP adresy."
+ IDS_NO_SUBMASK_SET "K zadané adrese je nutné doplnit masku podsítì."
+ IDS_TCPFILTERDESC "TCP/IP filtrování dovoluje kontrolovat typ TCP/IP síového provozu, který se dostane k tomuto poèítaèi."
+ IDS_TCPFILTER "TCP/IP filtrování"
+ IDS_IPADDR "IP adresa"
+ IDS_SUBMASK "Maska podsítì"
+ IDS_GATEWAY "Brána"
+ IDS_METRIC "Metrika"
+ IDS_DHCPACTIVE "DHCP zapnuto"
+ IDS_AUTOMATIC "Automaticky"
+ IDS_NOITEMSEL "Nebyla vybrána žádná položka."
IDS_TCPIP "ReactOS-TCP/IP"
- IDS_ADD "Add"
+ IDS_ADD "Pøidat"
IDS_MOD "OK"
- IDS_TCP_PORTS "TCP Ports"
- IDS_UDP_PORTS "UDP Ports"
- IDS_IP_PROTO "IP protocols"
- IDS_PORT_RANGE "Port numbers must be greater than 0 and less than 65536. Please enter a number within this range."
- IDS_PROT_RANGE "Protocol numbers must be greater than 0 and less than 256. Please enter a number within this range."
- IDS_DUP_NUMBER "The number you are trying to add is already in the list. Please enter a different number."
- IDS_DISABLE_FILTER "Disabling this global TCP/IP setting will affect all adapters."
- IDS_NO_SUFFIX "The current setting of search method requires at least one DNS suffix. Please enter one or change the setting."
- IDS_DOMAIN_SUFFIX "Domain suffix is not a valid suffix."
- IDS_DNS_SUFFIX "The DNS domain name ""%s"" is not a valid DNS name."
- IDS_DUP_SUFFIX "The DNS suffix is already on the list."
- IDS_DUP_IPADDR "The IP address is already on the list."
- IDS_DUP_GW "The default gateway is already on the list."
+ IDS_TCP_PORTS "TCP porty"
+ IDS_UDP_PORTS "UDP porty"
+ IDS_IP_PROTO "IP protokoly"
+ IDS_PORT_RANGE "Èísla portù musí být zadána vyšší než 0 a nižší než 65536."
+ IDS_PROT_RANGE "Èísla protokolù musí být zadána vyšší než 0 a nižší než 256."
+ IDS_DUP_NUMBER "Pøidávané èíslo se už nachází v seznamu. Je nutné zadat jiné èíslo."
+ IDS_DISABLE_FILTER "Vypnutí tohoto globálního nastavení TCP/IP ovlivní všechny adaptéry."
+ IDS_NO_SUFFIX "Souèasné nastavení metod vyhledávání vyžaduje alespoò jednu DNS pøíponu. Je nutné ji zadat nebo zmìnit nastavení."
+ IDS_DOMAIN_SUFFIX "Zadaná doménová pøípona není platná."
+ IDS_DNS_SUFFIX "DNS doménové jméno ""%s"" není platné."
+ IDS_DUP_SUFFIX "DNS pøípona se už nachází v seznamu."
+ IDS_DUP_IPADDR "IP adresa se už nachází v seznamu."
+ IDS_DUP_GW "Výchozí brána se už nachází v seznamu."
END
diff --git a/reactos/dll/win32/netid/lang/cs-CZ.rc b/reactos/dll/win32/netid/lang/cs-CZ.rc
index 886ad7ac864..41a04f6c041 100644
--- a/reactos/dll/win32/netid/lang/cs-CZ.rc
+++ b/reactos/dll/win32/netid/lang/cs-CZ.rc
@@ -1,6 +1,6 @@
/* FILE: dll/win32/netid/lang/cs-CZ.rc
* TRANSLATOR: Radek Liska aka Black_Fox (radekliska at gmail dot com)
- * UPDATED: 2008-06-26
+ * UPDATED: 2010-03-14
*/
LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
@@ -18,10 +18,9 @@ BEGIN
LTEXT "(Implicitní)", IDC_COMPUTERNAME, 98, 68, 144, 11
LTEXT "Pracovní skupina:", IDC_WORKGROUPDOMAIN, 6, 84, 64, 9
LTEXT "(prázdné)", IDC_WORKGROUPDOMAIN_NAME, 98, 84, 144, 9
- LTEXT "Pokud chcete použít Prùvodce síovou identifikací k pøipojení se k doménì a vytvoøení místního uživatele, kliknìte na ""Síová ID"".", IDC_STATIC, 6, 113, 172, 24
- //musi zustat jako sitova ID, jinak se nevejde na tlacitko!
- PUSHBUTTON "&Síová ID...", IDC_NETWORK_ID, 190, 114, 58, 15
- LTEXT "Pokud chcete pøejmenovat tento poèítaè nebo se pøipojit k doménì, kliknìte na ""Zmìnit"".", IDC_STATIC, 6, 149, 170, 17
+ LTEXT "Kliknutím na ""Síová ID"" lze použít Prùvodce síovou identifikací k pøipojení se k doménì a vytvoøení místního uživatele.", IDC_STATIC, 6, 113, 172, 24
+ PUSHBUTTON "&Síová ID...", IDC_NETWORK_ID, 190, 114, 58, 15 //FIXME nic vic nez "sitova ID" se nevejde na tlacitko!
+ LTEXT "Kliknutím na ""Zmìnit"" lze pøejmenovat tento poèítaè nebo se pøipojit k doménì.", IDC_STATIC, 6, 149, 170, 17
PUSHBUTTON "&Zmìnit...",IDC_NETWORK_PROPERTY, 190, 149, 58, 15
LTEXT "Poznámka: Identifikaci tohoto poèítaèe mohou zmìnit pouze administrátoøi.", IDC_STATIC, 6, 179, 300, 9
END
@@ -31,7 +30,7 @@ STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_CAPTIO
CAPTION "Zmìna názvu poèítaèe"
FONT 8, "MS Shell Dlg"
BEGIN
- LTEXT "(message goes here)", 1017, 7, 5, 218, 30
+ LTEXT "(sem patøí zpráva)", 1017, 7, 5, 218, 30
LTEXT "&Název poèítaèe:", -1, 7, 41, 219, 8
EDITTEXT 1002, 7, 53, 218, 14, ES_AUTOHSCROLL | ES_OEMCONVERT
LTEXT "Úplný název poèítaèe:", 1016, 7, 72, 218, 10
@@ -41,7 +40,7 @@ BEGIN
AUTORADIOBUTTON "&Domény:", 1008, 17, 132, 192, 10, WS_GROUP
AUTORADIOBUTTON "&Pracovní skupiny:", 1004, 17, 161, 191, 10
EDITTEXT 116, 28, 144, 181, 14, ES_AUTOHSCROLL | WS_GROUP
- PUSHBUTTON "Najít moj&i doménu", 1010, 7, 203, 109, 14, NOT WS_VISIBLE | WS_DISABLED
+ PUSHBUTTON "Najít &moji doménu", 1010, 7, 203, 109, 14, NOT WS_VISIBLE | WS_DISABLED
EDITTEXT 1007, 28, 172, 181, 14, ES_UPPERCASE | ES_AUTOHSCROLL | ES_OEMCONVERT
DEFPUSHBUTTON "OK", 1, 121, 203, 50, 14, WS_GROUP
PUSHBUTTON "Storno", 2, 176, 203, 50, 14
@@ -65,7 +64,7 @@ END
STRINGTABLE
BEGIN
1 "* Neznámé *"
- 2 "WORKGROUP"
+ 2 "SKUPINA"
3 "Pøi pokusu o naètení informací o èlenství v doménì nastala následující chyba:"
4 "Zmìna názvu poèítaèe"
5 "Pracovní skupina:"
@@ -73,12 +72,12 @@ BEGIN
22 "Vítejte v pracovní skupinì %1."
23 "Vítejte v doménì %1."
24 "Aby se zmìny mohly projevit, musí být poèítaè restartován."
- 25 "You can change the name and the membership of this computer. Changes may affect access to network resources."
+ 25 "Lze zmìnit název a èlenství tohoto poèítaèe. Zmìny mohou mít vliv na pøístup k síovým prostøedkùm."
1021 "Poznámka: Identifikaci tohoto poèítaèe mohou zmìnit pouze administrátoøi."
1022 "Poznámka: Identifikace poèítaèe nemùže být zmìnìna z následujících dùvodù:"
- 1030 "The new computer name ""%s"" contains characters which are not allowed. Characters which are not allowed include ` ~ ! @ # $ %% ^ & * ( ) = + _ [ ] { } \\ | ; : ' \" , . < > / and ?"
+ 1030 "Nový název poèítaèe ""%s"" obsahuje nepovolené znaky. Mezi nepovolené znaky patøí ` ~ ! @ # $ %% ^ & * ( ) = + _ [ ] { } \\ | ; : ' \" , . < > / ?"
3210 "&Detaily >>"
3220 "<< &Detaily"
- 4000 "Information"
- 4001 "Can't set new a computer name!"
+ 4000 "Informace"
+ 4001 "Nelze nastavit nový název poèítaèe!"
END
diff --git a/reactos/dll/win32/netid/lang/it-IT.rc b/reactos/dll/win32/netid/lang/it-IT.rc
index 26af2b20588..a85b3795367 100644
--- a/reactos/dll/win32/netid/lang/it-IT.rc
+++ b/reactos/dll/win32/netid/lang/it-IT.rc
@@ -67,13 +67,13 @@ BEGIN
6 "Dominio:"
22 "Benvenuto al gruppo di lavoro %1."
23 "Benvenuto al dominio %1."
- 24 "Il computer deve essre riavviato per rendere operative queste modifiche."
- 25 "You can change the name and the membership of this computer. Changes may affect access to network resources."
+ 24 "Il computer deve essere riavviato per rendere operative queste modifiche."
+ 25 "Potete modificare il nome e il dominio di questo computer. Le modifiche potrebbero influenzare l'accesso alle risorse di rete."
1021 "Nota: Solo gli Amministratori possono cambiare l'identificazione di questo computer."
1022 "Nota: L'identificazione di questo computer non può essere cambiata perchè:"
- 1030 "The new computer name ""%s"" contains characters which are not allowed. Characters which are not allowed include ` ~ ! @ # $ %% ^ & * ( ) = + _ [ ] { } \\ | ; : ' \" , . < > / and ?"
+ 1030 "Il nuovo nome del computer ""%s"" contiene dei caratteri non permessi. I caratteri vietati sono `? ~ ! @ # $ %% ^ & * ( ) = + _ [ ] { } \\ | ; : ' \" , . < > / "
3210 "&Dettagli >>"
3220 "<< &Dettagli"
- 4000 "Information"
- 4001 "Can't set new a computer name!"
+ 4000 "Informazioni"
+ 4001 "Impossibile assegnare il nuovo nome del computer!"
END
diff --git a/reactos/dll/win32/netshell/lang/cs-CZ.rc b/reactos/dll/win32/netshell/lang/cs-CZ.rc
index db5e3ea00b6..b98ecf7c9b8 100644
--- a/reactos/dll/win32/netshell/lang/cs-CZ.rc
+++ b/reactos/dll/win32/netshell/lang/cs-CZ.rc
@@ -16,12 +16,12 @@ BEGIN
GROUPBOX "Popis", -1, 9, 153, 230, 46, BS_GROUPBOX
LTEXT "Tak tady bude popis komponenty...", IDC_DESCRIPTION, 15, 165, 217, 28, WS_GROUP
CHECKBOX "Po pøipojení zobrazit ikonu na hlavním panelu", IDC_SHOWTASKBAR, 9, 206, 230, 12, BS_AUTOCHECKBOX | WS_TABSTOP
- CHECKBOX "&Notify me when this connection has limited or no connectivity", IDC_NOTIFYNOCONNECTION, 9, 220, 230, 24, BS_AUTOCHECKBOX | WS_TABSTOP
+ CHECKBOX "&Upozornit, když toto pøipojení bude mít omezenou nebo žádnou konektivitu", IDC_NOTIFYNOCONNECTION, 9, 220, 230, 24, BS_AUTOCHECKBOX | WS_TABSTOP
END
IDD_STATUS DIALOGEX DISCARDABLE 0, 0, 200, 280
STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "General"
+CAPTION "Obecné nastavení"
FONT 8, "MS Shell Dlg"
BEGIN
END
@@ -65,62 +65,62 @@ BEGIN
RTEXT "000.000.000.000", IDC_DETAILSSUBNET, 122, 48, 80, 8
RTEXT "", IDC_DETAILSGATEWAY, 122, 62, 80, 8
- PUSHBUTTON "&Detaily...", IDC_DETAILS, 22, 76, 62, 14
+ PUSHBUTTON "&Podrobnosti...", IDC_DETAILS, 22, 76, 62, 14
END
IDD_LAN_NETSTATUSDETAILS DIALOGEX DISCARDABLE 0, 0, 200,200
STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION
-CAPTION "Network Connection Details"
+CAPTION "Podrobnosti síového pøipojení"
FONT 8, "MS Shell Dlg"
BEGIN
- LTEXT "Network Connection &Details:", -1, 15, 9, 170, 12
+ LTEXT "&Podrobnosti síového pøipojení:", -1, 15, 9, 170, 12
CONTROL "", IDC_DETAILS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 15, 25, 170, 130
- PUSHBUTTON "&Close", IDC_CLOSE, 125, 165, 62, 14
+ PUSHBUTTON "&zavøít", IDC_CLOSE, 125, 165, 62, 14
END
STRINGTABLE DISCARDABLE
BEGIN
- IDS_PHYSICAL_ADDRESS "Physical Address"
- IDS_IP_ADDRESS "IP Address"
- IDS_SUBNET_MASK "Subnet Mask"
- IDS_DEF_GATEWAY "Default Gateway"
- IDS_DHCP_SERVER "DHCP Server"
- IDS_LEASE_OBTAINED "Lease Obtained"
- IDS_LEASE_EXPIRES "Lease Expires"
- IDS_DNS_SERVERS "DNS Servers"
- IDS_WINS_SERVERS "WINS Servers"
- IDS_PROPERTY "Property"
- IDS_VALUE "Value"
- IDS_NETWORKCONNECTION "Network Connection"
- IDS_SHV_COLUMN_NAME "Name"
- IDS_SHV_COLUMN_TYPE "Type"
+ IDS_PHYSICAL_ADDRESS "Fyzická adresa"
+ IDS_IP_ADDRESS "IP Adresa"
+ IDS_SUBNET_MASK "Maska podsítì"
+ IDS_DEF_GATEWAY "Výchozí brána"
+ IDS_DHCP_SERVER "DHCP server"
+ IDS_LEASE_OBTAINED "Zapùjèeno"
+ IDS_LEASE_EXPIRES "Zapùjèení vyprší"
+ IDS_DNS_SERVERS "DNS servery"
+ IDS_WINS_SERVERS "WINS servery"
+ IDS_PROPERTY "Vlastnost"
+ IDS_VALUE "Hodnota"
+ IDS_NETWORKCONNECTION "Síová pøipojení"
+ IDS_SHV_COLUMN_NAME "Název"
+ IDS_SHV_COLUMN_TYPE "Typ"
IDS_SHV_COLUMN_STATE "Status"
- IDS_SHV_COLUMN_DEVNAME "Device Name"
- IDS_SHV_COLUMN_PHONE "Phone # or Host Address"
- IDS_SHV_COLUMN_OWNER "Owner"
- IDS_TYPE_ETHERNET "LAN or High-Speed Internet"
- IDS_STATUS_NON_OPERATIONAL "Disabled"
- IDS_STATUS_UNREACHABLE "Not Connected"
- IDS_STATUS_DISCONNECTED "Network cable unplugged"
- IDS_STATUS_CONNECTING "Acquiring network address"
- IDS_STATUS_CONNECTED "Connected"
- IDS_STATUS_OPERATIONAL "Connected"
+ IDS_SHV_COLUMN_DEVNAME "Název zaøízení"
+ IDS_SHV_COLUMN_PHONE "Telefonní èíslo nebo adresa hostitele"
+ IDS_SHV_COLUMN_OWNER "Vlastník"
+ IDS_TYPE_ETHERNET "LAN nebo vysokorychlostní internet"
+ IDS_STATUS_NON_OPERATIONAL "Vypnuto"
+ IDS_STATUS_UNREACHABLE "Nepøipojeno"
+ IDS_STATUS_DISCONNECTED "Síový kabel byl odpojen"
+ IDS_STATUS_CONNECTING "Získávám síovou adresu"
+ IDS_STATUS_CONNECTED "Pøipojeno"
+ IDS_STATUS_OPERATIONAL "Pøipojeno"
- IDS_NET_ACTIVATE "Enable"
- IDS_NET_DEACTIVATE "Disable"
+ IDS_NET_ACTIVATE "Zapnout"
+ IDS_NET_DEACTIVATE "Vypnout"
IDS_NET_STATUS "Status"
- IDS_NET_REPAIR "Repair"
- IDS_NET_CREATELINK "Create Shortcut"
- IDS_NET_DELETE "Delete"
- IDS_NET_RENAME "Rename"
- IDS_NET_PROPERTIES "Properties"
+ IDS_NET_REPAIR "Opravit"
+ IDS_NET_CREATELINK "Vytvoøit zástupce"
+ IDS_NET_DELETE "Smazat"
+ IDS_NET_RENAME "Pøejmenovat"
+ IDS_NET_PROPERTIES "Vlasnosti"
IDS_FORMAT_BIT "%u Bit/s"
IDS_FORMAT_KBIT "%u KBit/s"
IDS_FORMAT_MBIT "%u MBit/s"
IDS_FORMAT_GBIT "%u GBit/s"
- IDS_DURATION_DAY "%d Day %s"
- IDS_DURATION_DAYS "%d Days %s"
+ IDS_DURATION_DAY "%d Den %s"
+ IDS_DURATION_DAYS "%d Dnù %s"
IDS_ASSIGNED_DHCP "Pøiøazeno DHCP"
IDS_ASSIGNED_MANUAL "Ruènì nastaveno"
END
diff --git a/reactos/dll/win32/setupapi/lang/cs-CZ.rc b/reactos/dll/win32/setupapi/lang/cs-CZ.rc
index 29573ac581d..c1ee9fd7c09 100644
--- a/reactos/dll/win32/setupapi/lang/cs-CZ.rc
+++ b/reactos/dll/win32/setupapi/lang/cs-CZ.rc
@@ -1,23 +1,7 @@
-/* Hey, Emacs, open this file with -*- coding: cp1250 -*-
- *
- * Czech resources for SETUPAPI
- *
- * Copyright 2001 Andreas Mohr
- * Copyright 2004 David Kredba
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+/* FILE: dll/win32/setupapi/lang/cs-CZ.rc
+ * TRANSLATOR: Radek Liska aka Black_Fox (radekliska at gmail dot com)
+ * THANKS TO: David Kredba
+ * UPDATED: 2010-01-07
*/
LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
@@ -39,7 +23,7 @@ END
STRINGTABLE DISCARDABLE
BEGIN
- IDS_QUERY_REBOOT_TEXT "Your computer needs to be rebooted to finish installation. Do you want to proceed?"
- IDS_QUERY_REBOOT_CAPTION "Reboot"
- IDS_INF_FILE "Setup Information"
+ IDS_QUERY_REBOOT_TEXT "Aby mohla být instalace dokonèena, musí být poèítaè restartován. Pokraèovat?"
+ IDS_QUERY_REBOOT_CAPTION "Restartovat"
+ IDS_INF_FILE "Instalaèní informace"
END
diff --git a/reactos/dll/win32/shell32/lang/cs-CZ.rc b/reactos/dll/win32/shell32/lang/cs-CZ.rc
index 8b8383f23b4..f2e2dd2aeea 100644
--- a/reactos/dll/win32/shell32/lang/cs-CZ.rc
+++ b/reactos/dll/win32/shell32/lang/cs-CZ.rc
@@ -1,21 +1,7 @@
-/*
- * Copyright 1998 Juergen Schmied
- * Copyright 2003 Filip Navara
- * Copyright 2008 Radek Liska
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+/* FILE: dll/win32/shell32/lang/cs-CZ.rc
+ * TRANSLATOR: Radek Liska aka Black_Fox (radekliska at gmail dot com)
+ * UPDATED: 2010-04-05
+ * THANKS TO: navaraf, who translated major part of this file
*/
LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
@@ -208,18 +194,18 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
ICON "", 14000, 10, 3, 30, 30, WS_VISIBLE
EDITTEXT 14001, 70, 9, 158, 14, ES_LEFT | ES_READONLY
- LTEXT "Type of file:", 14004, 8, 35, 50, 10
- LTEXT "Folder", 14005, 68, 35, 160, 10
- LTEXT "Location:", 14006, 8, 53, 50, 10
+ LTEXT "Typ souboru:", 14004, 8, 35, 50, 10
+ LTEXT "Složka", 14005, 68, 35, 160, 10
+ LTEXT "Umístìní:", 14006, 8, 53, 50, 10
LTEXT "", 14007, 68, 53, 315, 10
- LTEXT "Size:", 14008, 8, 72, 45, 10
+ LTEXT "Velikost:", 14008, 8, 72, 45, 10
LTEXT "", 14009, 68, 72, 315, 10
- LTEXT "Contains:", 14010, 8, 93, 45, 10
+ LTEXT "Obsahuje:", 14010, 8, 93, 45, 10
LTEXT "", 14011, 68, 93, 160, 10
- LTEXT "Created:", 14014, 8, 118, 45, 10
+ LTEXT "Vytvoøeno:", 14014, 8, 118, 45, 10
LTEXT "", 14015, 68, 118, 160, 10
- AUTOCHECKBOX "&Read-only", 14021, 45, 150, 67, 10
- AUTOCHECKBOX "&Hidden", 14022, 126, 150, 50, 10
+ AUTOCHECKBOX "&Jen pro ètení", 14021, 45, 150, 67, 10
+ AUTOCHECKBOX "&Skrytý", 14022, 126, 150, 50, 10
END
SHELL_FILE_GENERAL_DLG DIALOGEX 0, 0, 240, 205
@@ -546,7 +532,7 @@ END
FORMAT_DLG DIALOGEX 50, 50, 184, 218
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
-CAPTION "Format"
+CAPTION "Formátování"
FONT 8, "MS Shell Dlg"
BEGIN
DEFPUSHBUTTON "&Spustit", IDOK, 53, 198, 60, 14
@@ -567,14 +553,14 @@ END
CHKDSK_DLG DIALOGEX 50, 50, 194, 120
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
-CAPTION "Check Disk"
+CAPTION "Zkontrolovat disk"
FONT 8, "MS Shell Dlg"
BEGIN
DEFPUSHBUTTON "Start", IDOK, 53, 100, 60, 14
- GROUPBOX "Check disk options", -1, 7, 6, 179, 50
- PUSHBUTTON "Cancel", IDCANCEL, 118, 100, 60, 14
- AUTOCHECKBOX "Automatically fix file system errors", 14000, 16, 15, 155, 10
- AUTOCHECKBOX "&Scan for and attempt recovery of bad sectors", 14001, 16, 30, 165, 10
+ GROUPBOX "Možnosti kontroly disku", -1, 7, 6, 179, 50
+ PUSHBUTTON "Storno", IDCANCEL, 118, 100, 60, 14
+ AUTOCHECKBOX "Automaticky opravovat chyby souborového systému", 14000, 16, 15, 155, 10
+ AUTOCHECKBOX "&Vyhledat a pokusit se obnovit vadné sektory", 14001, 16, 30, 165, 10
CONTROL "", 14002, "MSCTLS_PROGRESS32", 16, 7, 60, 170, 8
LTEXT "", 14003, 60, 80, 170, 10
END
@@ -607,17 +593,17 @@ BEGIN
IDS_SHV_COLUMN9 "Komentáø"
IDS_SHV_COLUMN10 "Vlastník"
IDS_SHV_COLUMN11 "Skupina"
- IDS_SHV_COLUMN12 "Filename"
- IDS_SHV_COLUMN13 "Category"
+ IDS_SHV_COLUMN12 "Název souboru"
+ IDS_SHV_COLUMN13 "Kategorie"
IDS_SHV_COLUMN_DELFROM "Pùvodní umístìní"
IDS_SHV_COLUMN_DELDATE "Odstranìno"
IDS_SHV_COLUMN_FONTTYPE "Fonttype"
- IDS_SHV_COLUMN_WORKGROUP "Workgroup"
- IDS_SHV_NETWORKLOCATION "Network Location"
- IDS_SHV_COLUMN_DOCUMENTS "Documents"
+ IDS_SHV_COLUMN_WORKGROUP "Pracovní skupina"
+ IDS_SHV_NETWORKLOCATION "Síové umístìní"
+ IDS_SHV_COLUMN_DOCUMENTS "Dokumenty"
IDS_SHV_COLUMN_STATUS "Status"
- IDS_SHV_COLUMN_COMMENTS "Comments"
- IDS_SHV_COLUMN_LOCATION "Location"
+ IDS_SHV_COLUMN_COMMENTS "Komentáøe"
+ IDS_SHV_COLUMN_LOCATION "Umístìní"
IDS_SHV_COLUMN_MODEL "Model"
/* special folders */
@@ -625,7 +611,7 @@ BEGIN
IDS_MYCOMPUTER "Tento poèítaè"
IDS_RECYCLEBIN_FOLDER_NAME "Koš"
IDS_CONTROLPANEL "Ovládací panely"
- IDS_ADMINISTRATIVETOOLS "Administrative Tools"
+ IDS_ADMINISTRATIVETOOLS "Nástroje správy"
/* context menus */
IDS_VIEW_LARGE "&Vedle sebe"
@@ -634,15 +620,15 @@ BEGIN
IDS_VIEW_DETAILS "&Podrobnosti"
IDS_SELECT "Vybrat"
IDS_OPEN "Otevøít"
- IDS_CREATELINK "Vytvoøit zástupc&e"
+ IDS_CREATELINK "Vytvoøit zástupc&e"
IDS_COPY "&Kopírovat"
IDS_DELETE "O&dstranit"
IDS_PROPERTIES "&Vlastnosti"
IDS_CUT "Vyj&mout"
- IDS_RESTORE "Restore"
- IDS_FORMATDRIVE "Format..."
- IDS_RENAME "Rename"
- IDS_INSERT "Insert"
+ IDS_RESTORE "Obnovit"
+ IDS_FORMATDRIVE "Formátovat..."
+ IDS_RENAME "Pøejmenovat"
+ IDS_INSERT "Vložit"
IDS_CREATEFOLDER_DENIED "Nelze vytvoøit novou složku, protože pøístup byl odepøen."
IDS_CREATEFOLDER_CAPTION "Chyba pøi pokusu vytvoøit nový adresáø"
@@ -666,8 +652,8 @@ BEGIN
IDS_RESTART_PROMPT "Opravdu chcete restartovat systém?"
IDS_SHUTDOWN_TITLE "Vypnout"
IDS_SHUTDOWN_PROMPT "Opravdu chcete vypnout poèítaè?"
- IDS_LOGOFF_TITLE "Log Off"
- IDS_LOGOFF_PROMPT "Do you want to log off?"
+ IDS_LOGOFF_TITLE "Odhlásit se"
+ IDS_LOGOFF_PROMPT "Opravdu se chcete odhlásit?"
/* shell folder path default values */
IDS_PROGRAMS "Nabídka Start\\Programy"
@@ -737,19 +723,19 @@ BEGIN
IDS_LNK_FILE "Zástupce"
IDS_SYS_FILE "Systémový soubor"
- IDS_OPEN_VERB "Open"
- IDS_RUNAS_VERB "Run as "
- IDS_EDIT_VERB "Edit"
- IDS_FIND_VERB "Find"
- IDS_PRINT_VERB "Print"
- IDS_PLAY_VERB "Play"
- IDS_PREVIEW_VERB "Preview"
+ IDS_OPEN_VERB "Otevøít"
+ IDS_RUNAS_VERB "Spustit jako "
+ IDS_EDIT_VERB "Upravit"
+ IDS_FIND_VERB "Najít"
+ IDS_PRINT_VERB "Tisknout"
+ IDS_PLAY_VERB "Pøehrát"
+ IDS_PREVIEW_VERB "Náhled"
- IDS_FILE_FOLDER "%u Files, %u Folders"
- IDS_PRINTERS "Printers"
- IDS_FONTS "Fonts"
- IDS_INSTALLNEWFONT "Install New Font..."
+ IDS_FILE_FOLDER "%u souborù, %u složek"
+ IDS_PRINTERS "Tiskárny"
+ IDS_FONTS "Fonty"
+ IDS_INSTALLNEWFONT "Nainstalovat nový font..."
- IDS_DEFAULT_CLUSTER_SIZE "Default allocation size"
- IDS_COPY_OF "Copy of"
+ IDS_DEFAULT_CLUSTER_SIZE "Výchozí alokaèní velikost"
+ IDS_COPY_OF "Kopie "
END
diff --git a/reactos/dll/win32/shell32/lang/it-IT.rc b/reactos/dll/win32/shell32/lang/it-IT.rc
index ba31b5a98ac..afddebe5c6f 100644
--- a/reactos/dll/win32/shell32/lang/it-IT.rc
+++ b/reactos/dll/win32/shell32/lang/it-IT.rc
@@ -751,5 +751,5 @@ BEGIN
IDS_INSTALLNEWFONT "Installazione nuovi Font..."
IDS_DEFAULT_CLUSTER_SIZE "Dimensione predefinita di allocazione"
- IDS_COPY_OF "Copy of"
+ IDS_COPY_OF "Copia di"
END
diff --git a/reactos/dll/win32/syssetup/lang/it-IT.rc b/reactos/dll/win32/syssetup/lang/it-IT.rc
index ba3f9988707..bc76a2eaca5 100644
--- a/reactos/dll/win32/syssetup/lang/it-IT.rc
+++ b/reactos/dll/win32/syssetup/lang/it-IT.rc
@@ -213,7 +213,7 @@ BEGIN
IDS_GAMES "Giochi"
IDS_CMT_SOLITAIRE "Solitario"
IDS_CMT_WINEMINE "Campo minato"
- IDS_CMT_SPIDER "Spider Solitaire"
+ IDS_CMT_SPIDER "Spider"
END
STRINGTABLE
@@ -235,7 +235,7 @@ BEGIN
IDS_SYS_ENTERTAINMENT "Divertimento"
IDS_CMT_MPLAY32 "Esegui Multimedia Player"
IDS_CMT_SNDVOL32 "Esegui Controllo Volume"
- IDS_CMT_SNDREC32 "Launch Sound Recorder"
+ IDS_CMT_SNDREC32 "Esegui il Registratore di suonoi"
END
STRINGTABLE
@@ -255,7 +255,7 @@ STRINGTABLE
BEGIN
IDS_SHORT_CMD "Prompt dei comandi.lnk"
IDS_SHORT_EXPLORER "ReactOS Explorer.lnk"
- IDS_SHORT_DOWNLOADER "ReactOS Applications Manager.lnk"
+ IDS_SHORT_DOWNLOADER "ReactOS gestione applicazioni.lnk"
IDS_SHORT_SERVICE "Service Manager.lnk"
IDS_SHORT_DEVICE "Device Manager.lnk"
IDS_SHORT_MPLAY32 "Multimedia Player.lnk"
@@ -271,12 +271,12 @@ BEGIN
IDS_SHORT_RDESKTOP "Remote Desktop.lnk"
IDS_SHORT_KBSWITCH "Layout di tastiera.lnk"
IDS_SHORT_EVENTVIEW "Visualizzatore Eventi.lnk"
- IDS_SHORT_MSCONFIG "Configuratione del sistema.lnk"
+ IDS_SHORT_MSCONFIG "Configurazione del sistema.lnk"
IDS_SHORT_SNDVOL32 "Controllo Volume.lnk"
IDS_SHORT_SNDREC32 "Audiorecorder.lnk"
IDS_SHORT_DXDIAG "ReactX Diagnostica.lnk"
IDS_SHORT_PAINT "Paint.lnk"
- IDS_SHORT_SPIDER "Spider Solitaire.lnk"
+ IDS_SHORT_SPIDER "Spider.lnk"
END
STRINGTABLE
diff --git a/reactos/dll/win32/userenv/lang/cs-CZ.rc b/reactos/dll/win32/userenv/lang/cs-CZ.rc
index a582d533aab..4067447b058 100644
--- a/reactos/dll/win32/userenv/lang/cs-CZ.rc
+++ b/reactos/dll/win32/userenv/lang/cs-CZ.rc
@@ -1,20 +1,6 @@
-/*
- * Copyright (C) 2004 Eric Kohl
- * 2008 Radek Liska
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+/* FILE: dll/win32/devmgr/lang/cs-CZ.rc
+ * TRANSLATOR: Radek Liska aka Black_Fox (radekliska at gmail dot com)
+ * UPDATED: 2010-01-07
*/
LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
@@ -36,7 +22,7 @@ BEGIN
IDS_TEMPLATES "Šablony"
IDS_RECENT "Poslední dokumenty"
IDS_SENDTO "SendTo"
- IDS_PRINTHOOD "okolní tiskárny"
+ IDS_PRINTHOOD "Okolní tiskárny"
IDS_NETHOOD "Okolní sí"
IDS_LOCALSETTINGS "Local Settings"
IDS_LOCALAPPDATA "Local Settings\\Data Aplikací"
From a16ef45831da4c400d36a4596f8f056ab5877e3b Mon Sep 17 00:00:00 2001
From: Gregor Schneider
Date: Sat, 10 Apr 2010 19:24:21 +0000
Subject: [PATCH 097/261] [USETUP] Switch KDSERIAL debug builds to new boot
method, old boot method tends to bugcheck
svn path=/trunk/; revision=46826
---
reactos/base/setup/usetup/bootsup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/reactos/base/setup/usetup/bootsup.c b/reactos/base/setup/usetup/bootsup.c
index fe835ff5a1e..7abbcb1f4a0 100644
--- a/reactos/base/setup/usetup/bootsup.c
+++ b/reactos/base/setup/usetup/bootsup.c
@@ -428,7 +428,7 @@ CreateFreeLoaderIniForReactos(PWCHAR IniPath,
/* ReactOS_KdSerial */
CreateFreeLoaderEntry(IniCache, IniSection,
L"ReactOS_KdSerial", L"\"ReactOS (RosDbg)\"",
- L"ReactOS", ArcPath,
+ L"Windows2003", ArcPath,
L"/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /KDSERIAL");
/* ReactOS_LogFile */
From 386c534e6cc1359e268712c69cafd14fdae8c5ba Mon Sep 17 00:00:00 2001
From: Timo Kreuzer
Date: Sun, 11 Apr 2010 01:40:15 +0000
Subject: [PATCH 098/261] [CDROM] - ULONG -> ULONG_PTR
svn path=/trunk/; revision=46834
---
reactos/drivers/storage/class/cdrom/cdrom.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/reactos/drivers/storage/class/cdrom/cdrom.c b/reactos/drivers/storage/class/cdrom/cdrom.c
index e5a51493139..ef462658d7e 100644
--- a/reactos/drivers/storage/class/cdrom/cdrom.c
+++ b/reactos/drivers/storage/class/cdrom/cdrom.c
@@ -5127,7 +5127,7 @@ Return Value:
// The data buffer must be aligned.
//
- srb->DataBuffer = (PVOID) (((ULONG) (context + 1) + (alignment - 1)) &
+ srb->DataBuffer = (PVOID) (((ULONG_PTR) (context + 1) + (alignment - 1)) &
~(alignment - 1));
@@ -5877,7 +5877,7 @@ Return Value:
irpStack = IoGetCurrentIrpStackLocation(irp);
if (irpStack->Parameters.Others.Argument3) {
- ULONG count;
+ ULONG_PTR count;
//
// Decrement the countdown timer and put the IRP back in the list.
@@ -6497,7 +6497,7 @@ Return Value:
PIO_STACK_LOCATION irpStack;
NTSTATUS status;
BOOLEAN retry;
- ULONG retryCount;
+ ULONG_PTR retryCount;
ULONG lastSector;
PIRP originalIrp;
PCDROM_DATA cddata;
From 91d15df7c5fbf6f293be5d6d9e074dfdefa05925 Mon Sep 17 00:00:00 2001
From: Gregor Schneider
Date: Sun, 11 Apr 2010 10:39:20 +0000
Subject: [PATCH 099/261] [WIN32K] - Handle keyboard input when no windows are
present - Patch by Andrey Ivanov with changes suggested in the bug report See
issue #3560 for more details.
svn path=/trunk/; revision=46836
---
.../subsystems/win32/win32k/ntuser/input.c | 37 +++++++++++--------
1 file changed, 22 insertions(+), 15 deletions(-)
diff --git a/reactos/subsystems/win32/win32k/ntuser/input.c b/reactos/subsystems/win32/win32k/ntuser/input.c
index f0790e19a7b..6b02f2d270e 100644
--- a/reactos/subsystems/win32/win32k/ntuser/input.c
+++ b/reactos/subsystems/win32/win32k/ntuser/input.c
@@ -713,6 +713,7 @@ KeyboardThreadMain(PVOID StartContext)
for (;NumKeys;memcpy(&KeyInput, &NextKeyInput, sizeof(KeyInput)),
NumKeys--)
{
+ PKBL keyboardLayout = NULL;
lParam = 0;
IntKeyboardUpdateLeds(KeyboardDeviceHandle,
@@ -783,29 +784,30 @@ KeyboardThreadMain(PVOID StartContext)
}
/* Find the target thread whose locale is in effect */
- FocusQueue = IntGetFocusMessageQueue();
+ FocusQueue = IntGetFocusMessageQueue();
- /* This might cause us to lose hot keys, which are important
- * (ctrl-alt-del secure attention sequence). Not sure if it
- * can happen though.
- */
- if (!FocusQueue)
- continue;
+ if (FocusQueue)
+ {
+ msg.hwnd = FocusQueue->FocusWindow;
+
+ FocusThread = FocusQueue->Thread;
+ if (FocusThread && FocusThread->Tcb.Win32Thread)
+ {
+ keyboardLayout = ((PTHREADINFO)FocusThread->Tcb.Win32Thread)->KeyboardLayout;
+ }
+ }
+ if (!keyboardLayout)
+ {
+ keyboardLayout = W32kGetDefaultKeyLayout();
+ }
msg.lParam = lParam;
- msg.hwnd = FocusQueue->FocusWindow;
-
- FocusThread = FocusQueue->Thread;
-
- if (!(FocusThread && FocusThread->Tcb.Win32Thread &&
- ((PTHREADINFO)FocusThread->Tcb.Win32Thread)->KeyboardLayout))
- continue;
/* This function uses lParam to fill wParam according to the
* keyboard layout in use.
*/
W32kKeyProcessMessage(&msg,
- ((PTHREADINFO)FocusThread->Tcb.Win32Thread)->KeyboardLayout->KBTables,
+ keyboardLayout->KBTables,
KeyInput.Flags & KEY_E0 ? 0xE0 :
(KeyInput.Flags & KEY_E1 ? 0xE1 : 0));
@@ -827,6 +829,11 @@ KeyboardThreadMain(PVOID StartContext)
continue; /* Eat key up motion too */
}
+ if (!FocusQueue)
+ {
+ /* There is no focused window to receive a keyboard message */
+ continue;
+ }
/*
* Post a keyboard message.
*/
From a4f5e7b91227ac98805a39c490d23a0d3beed7f8 Mon Sep 17 00:00:00 2001
From: Aleksey Bragin
Date: Sun, 11 Apr 2010 12:18:27 +0000
Subject: [PATCH 100/261] [ISAPNP] - Comment it out from the bootloader. -
Remove it from machine.inf. - This "driver" introduces significant delay at
every boot due to i/o space scanning every time at every boot, however there
is no real benefit (it always fails). Inclusion of this driver into default
boot process might be reconsidered only after it starts providing some
advantages. For now please test this driver in your own working copies.
svn path=/trunk/; revision=46837
---
reactos/boot/bootdata/txtsetup.sif | 4 ++--
reactos/media/inf/machine.inf | Bin 45566 -> 45620 bytes
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/reactos/boot/bootdata/txtsetup.sif b/reactos/boot/bootdata/txtsetup.sif
index 4da20f331da..35f1c761937 100644
--- a/reactos/boot/bootdata/txtsetup.sif
+++ b/reactos/boot/bootdata/txtsetup.sif
@@ -37,10 +37,10 @@ ramdisk.sys=,,,,,,x,,,,,,4
ext2.sys=,,,,,,x,,,,,,4
[HardwareIdsDatabase]
-*PNP0A00 = isapnp
+;*PNP0A00 = isapnp
*PNP0A03 = pci
*PNP0C08 = acpi
-PCI\CC_0601 = isapnp
+;PCI\CC_0601 = isapnp
PCI\CC_0604 = pci
[BootBusExtenders.Load]
diff --git a/reactos/media/inf/machine.inf b/reactos/media/inf/machine.inf
index ce3f8658bd0285b1ad9b8532e5acf16a8fb95ffb..ecc90375e8d1de8d54b6cc66e14fa58f09e17e72 100644
GIT binary patch
delta 35
rcmezOm}$!srVT10jMkIwg`_9ji3Ckn5s{i4C8V@@nn=oACN2g5>ZA)u
delta 31
ncmdn;gz4X7rVT10lO2SlCOe1(O+Fybw)vb$%3PNJ|F{?c)P@YN
From 5d13bbcc06d90923ac22ec23550e24270fde214f Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Sun, 11 Apr 2010 16:08:20 +0000
Subject: [PATCH 101/261] [NTOSKRNL] - Make legacy device keys volatile
svn path=/trunk/; revision=46840
---
reactos/ntoskrnl/io/pnpmgr/pnpmgr.c | 10 ++++++----
reactos/ntoskrnl/io/pnpmgr/pnpreport.c | 3 ++-
reactos/ntoskrnl/io/pnpmgr/pnproot.c | 2 +-
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
index 14969fb18db..e5aee2001db 100644
--- a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
+++ b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
@@ -63,6 +63,7 @@ IopUpdateResourceMapForPnPDevice(
NTSTATUS
NTAPI
IopCreateDeviceKeyPath(IN PCUNICODE_STRING RegistryPath,
+ IN ULONG CreateOptions,
OUT PHANDLE Handle);
PDEVICE_NODE
@@ -226,7 +227,7 @@ IopStartDevice(
}
}
- Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, &InstanceHandle);
+ Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, 0, &InstanceHandle);
if (!NT_SUCCESS(Status))
return Status;
@@ -458,7 +459,7 @@ IopCreateDeviceNode(PDEVICE_NODE ParentNode,
}
/* Create the device key for legacy drivers */
- Status = IopCreateDeviceKeyPath(&Node->InstancePath, &InstanceHandle);
+ Status = IopCreateDeviceKeyPath(&Node->InstancePath, REG_OPTION_VOLATILE, &InstanceHandle);
if (!NT_SUCCESS(Status))
{
ZwClose(InstanceHandle);
@@ -761,6 +762,7 @@ IopTraverseDeviceTree(PDEVICETREE_TRAVERSE_CONTEXT Context)
NTSTATUS
NTAPI
IopCreateDeviceKeyPath(IN PCUNICODE_STRING RegistryPath,
+ IN ULONG CreateOptions,
OUT PHANDLE Handle)
{
UNICODE_STRING EnumU = RTL_CONSTANT_STRING(ENUM_ROOT);
@@ -811,7 +813,7 @@ IopCreateDeviceKeyPath(IN PCUNICODE_STRING RegistryPath,
&ObjectAttributes,
0,
NULL,
- 0,
+ CreateOptions,
NULL);
/* Close parent key handle, we don't need it anymore */
@@ -2244,7 +2246,7 @@ IopActionInterrogateDeviceStack(PDEVICE_NODE DeviceNode,
/*
* Create registry key for the instance id, if it doesn't exist yet
*/
- Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, &InstanceKey);
+ Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, 0, &InstanceKey);
if (!NT_SUCCESS(Status))
{
DPRINT1("Failed to create the instance key! (Status %lx)\n", Status);
diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpreport.c b/reactos/ntoskrnl/io/pnpmgr/pnpreport.c
index c75e566b0d4..239dcb0511d 100644
--- a/reactos/ntoskrnl/io/pnpmgr/pnpreport.c
+++ b/reactos/ntoskrnl/io/pnpmgr/pnpreport.c
@@ -15,6 +15,7 @@
NTSTATUS
NTAPI
IopCreateDeviceKeyPath(IN PCUNICODE_STRING RegistryPath,
+ IN ULONG CreateOptions,
OUT PHANDLE Handle);
NTSTATUS
@@ -196,7 +197,7 @@ IoReportDetectedDevice(IN PDRIVER_OBJECT DriverObject,
IopActionConfigureChildServices(DeviceNode, DeviceNode->Parent);
/* Open a handle to the instance path key */
- Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, &InstanceKey);
+ Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, 0, &InstanceKey);
if (!NT_SUCCESS(Status))
return Status;
diff --git a/reactos/ntoskrnl/io/pnpmgr/pnproot.c b/reactos/ntoskrnl/io/pnpmgr/pnproot.c
index 7a62ed23ca8..c755c0fc0b8 100644
--- a/reactos/ntoskrnl/io/pnpmgr/pnproot.c
+++ b/reactos/ntoskrnl/io/pnpmgr/pnproot.c
@@ -172,7 +172,7 @@ PnpRootCreateDevice(
if (NT_SUCCESS(Status))
{
InitializeObjectAttributes(&ObjectAttributes, &Device->DeviceID, OBJ_CASE_INSENSITIVE, EnumHandle, NULL);
- Status = ZwCreateKey(&DeviceKeyHandle, KEY_SET_VALUE, &ObjectAttributes, 0, NULL, 0, NULL);
+ Status = ZwCreateKey(&DeviceKeyHandle, KEY_SET_VALUE, &ObjectAttributes, 0, NULL, REG_OPTION_VOLATILE, NULL);
ZwClose(EnumHandle);
}
From 26d1db9190c7c986fb01fad1d56462bf264701cd Mon Sep 17 00:00:00 2001
From: Sir Richard
Date: Sun, 11 Apr 2010 16:10:49 +0000
Subject: [PATCH 102/261] [NTOS]: Some PnP ABI refactoring for future
patches/work. [NTOS]: Switch to PnP Add Device routine, currently mostly a
copy of the original ReactOS code. However, PnP now tries to open all the
required registry keys before attempting to start the device. Failures are
reported and load cancelled. More work TBD.
svn path=/trunk/; revision=46841
---
reactos/ntoskrnl/include/internal/io.h | 23 ++++
reactos/ntoskrnl/io/iomgr/device.c | 18 +++
reactos/ntoskrnl/io/iomgr/driver.c | 10 +-
reactos/ntoskrnl/io/pnpmgr/pnpinit.c | 112 +++++++++++++++++
reactos/ntoskrnl/io/pnpmgr/pnpmgr.c | 166 ++++++++++++-------------
5 files changed, 237 insertions(+), 92 deletions(-)
diff --git a/reactos/ntoskrnl/include/internal/io.h b/reactos/ntoskrnl/include/internal/io.h
index dc80ff249a5..4f2b236156c 100644
--- a/reactos/ntoskrnl/include/internal/io.h
+++ b/reactos/ntoskrnl/include/internal/io.h
@@ -509,6 +509,14 @@ typedef struct _DEVICETREE_TRAVERSE_CONTEXT
//
// PNP Routines
//
+NTSTATUS
+NTAPI
+PipCallDriverAddDevice(
+ IN PDEVICE_NODE DeviceNode,
+ IN BOOLEAN LoadDriver,
+ IN PDRIVER_OBJECT DriverObject
+);
+
VOID
PnpInit(
VOID
@@ -563,6 +571,15 @@ IopFreeDeviceNode(
);
NTSTATUS
+NTAPI
+IopSynchronousCall(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIO_STACK_LOCATION IoStackLocation,
+ OUT PVOID *Information
+);
+
+NTSTATUS
+NTAPI
IopInitiatePnpIrp(
IN PDEVICE_OBJECT DeviceObject,
IN PIO_STATUS_BLOCK IoStatusBlock,
@@ -694,6 +711,12 @@ IoInitSystem(
//
// Device/Volume Routines
//
+VOID
+NTAPI
+IopReadyDeviceObjects(
+ IN PDRIVER_OBJECT Driver
+);
+
NTSTATUS
FASTCALL
IopInitializeDevice(
diff --git a/reactos/ntoskrnl/io/iomgr/device.c b/reactos/ntoskrnl/io/iomgr/device.c
index 7434970734f..b9176ce276b 100644
--- a/reactos/ntoskrnl/io/iomgr/device.c
+++ b/reactos/ntoskrnl/io/iomgr/device.c
@@ -25,6 +25,24 @@ extern LIST_ENTRY IopTapeFsListHead;
/* PRIVATE FUNCTIONS **********************************************************/
+VOID
+NTAPI
+IopReadyDeviceObjects(IN PDRIVER_OBJECT Driver)
+{
+ PAGED_CODE();
+ PDEVICE_OBJECT DeviceObject;
+
+ /* Set the driver as initialized */
+ Driver->Flags |= DRVO_INITIALIZED;
+ DeviceObject = Driver->DeviceObject;
+ while (DeviceObject)
+ {
+ /* Set every device as initialized too */
+ DeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
+ DeviceObject = DeviceObject->NextDevice;
+ }
+}
+
VOID
NTAPI
IopDeleteDevice(IN PVOID ObjectBody)
diff --git a/reactos/ntoskrnl/io/iomgr/driver.c b/reactos/ntoskrnl/io/iomgr/driver.c
index 18202bfd5e4..1ab54458526 100644
--- a/reactos/ntoskrnl/io/iomgr/driver.c
+++ b/reactos/ntoskrnl/io/iomgr/driver.c
@@ -438,7 +438,6 @@ IopInitializeDriverModule(
UNICODE_STRING RegistryKey;
PDRIVER_INITIALIZE DriverEntry;
PDRIVER_OBJECT Driver;
- PDEVICE_OBJECT DeviceObject;
NTSTATUS Status;
DriverEntry = ModuleObject->EntryPoint;
@@ -495,14 +494,7 @@ IopInitializeDriverModule(
}
/* Set the driver as initialized */
- Driver->Flags |= DRVO_INITIALIZED;
- DeviceObject = Driver->DeviceObject;
- while (DeviceObject)
- {
- /* Set every device as initialized too */
- DeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
- DeviceObject = DeviceObject->NextDevice;
- }
+ IopReadyDeviceObjects(Driver);
if (PnpSystemInit) IopReinitializeDrivers();
diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpinit.c b/reactos/ntoskrnl/io/pnpmgr/pnpinit.c
index 8c5607289a6..24c8ba6753c 100644
--- a/reactos/ntoskrnl/io/pnpmgr/pnpinit.c
+++ b/reactos/ntoskrnl/io/pnpmgr/pnpinit.c
@@ -219,4 +219,116 @@ Quickie:
return i;
}
+NTSTATUS
+NTAPI
+PipCallDriverAddDevice(IN PDEVICE_NODE DeviceNode,
+ IN BOOLEAN LoadDriver,
+ IN PDRIVER_OBJECT DriverObject)
+{
+ NTSTATUS Status;
+ HANDLE EnumRootKey, SubKey, ControlKey, ClassKey, PropertiesKey;
+ UNICODE_STRING ClassGuid, Properties;
+ UNICODE_STRING EnumRoot = RTL_CONSTANT_STRING(ENUM_ROOT);
+ UNICODE_STRING ControlClass =
+ RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Class");
+ PKEY_VALUE_FULL_INFORMATION KeyValueInformation = NULL;
+ PWCHAR Buffer;
+
+ /* Open enumeration root key */
+ Status = IopOpenRegistryKeyEx(&EnumRootKey,
+ NULL,
+ &EnumRoot,
+ KEY_READ);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("IopOpenRegistryKeyEx() failed with Status %08X\n", Status);
+ return Status;
+ }
+
+ /* Open instance subkey */
+ Status = IopOpenRegistryKeyEx(&SubKey,
+ EnumRootKey,
+ &DeviceNode->InstancePath,
+ KEY_READ);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("IopOpenRegistryKeyEx() failed with Status %08X\n", Status);
+ ZwClose(EnumRootKey);
+ return Status;
+ }
+
+ /* Get class GUID */
+ Status = IopGetRegistryValue(SubKey,
+ REGSTR_VAL_CLASSGUID,
+ &KeyValueInformation);
+ if (NT_SUCCESS(Status))
+ {
+ /* Convert to unicode string */
+ Buffer = (PVOID)((ULONG_PTR)KeyValueInformation + KeyValueInformation->DataOffset);
+ PnpRegSzToString(Buffer, KeyValueInformation->DataLength, &ClassGuid.Length);
+ ClassGuid.MaximumLength = KeyValueInformation->DataLength;
+ ClassGuid.Buffer = Buffer;
+
+ /* Open the key */
+ Status = IopOpenRegistryKeyEx(&ControlKey,
+ NULL,
+ &ControlClass,
+ KEY_READ);
+ if (!NT_SUCCESS(Status))
+ {
+ /* No class key */
+ DPRINT1("IopOpenRegistryKeyEx() failed with Status %08X\n", Status);
+ ClassKey = NULL;
+ }
+ else
+ {
+ /* Open the class key */
+ Status = IopOpenRegistryKeyEx(&ClassKey,
+ ControlKey,
+ &ClassGuid,
+ KEY_READ);
+ ZwClose(ControlKey);
+ if (!NT_SUCCESS(Status))
+ {
+ /* No class key */
+ DPRINT1("IopOpenRegistryKeyEx() failed with Status %08X\n", Status);
+ ClassKey = NULL;
+ }
+ }
+
+ /* Check if we made it till here */
+ if (ClassKey)
+ {
+ /* Get the device properties */
+ RtlInitUnicodeString(&Properties, REGSTR_KEY_DEVICE_PROPERTIES);
+ Status = IopOpenRegistryKeyEx(&PropertiesKey,
+ ClassKey,
+ &Properties,
+ KEY_READ);
+ if (!NT_SUCCESS(Status))
+ {
+ /* No properties */
+ DPRINT("IopOpenRegistryKeyEx() failed with Status %08X\n", Status);
+ PropertiesKey = NULL;
+ }
+ }
+
+ /* Free the registry data */
+ ExFreePool(KeyValueInformation);
+ }
+
+ /* Do ReactOS-style setup */
+ IopAttachFilterDrivers(DeviceNode, TRUE);
+ Status = IopInitializeDevice(DeviceNode, DriverObject);
+ if (NT_SUCCESS(Status))
+ {
+ IopAttachFilterDrivers(DeviceNode, FALSE);
+ IopDeviceNodeSetFlag(DeviceNode, DNF_STARTED);
+ Status = IopStartDevice(DeviceNode);
+ }
+
+ /* Return status */
+ return Status;
+}
+
/* EOF */
diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
index e5aee2001db..8862fd87bcd 100644
--- a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
+++ b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
@@ -618,69 +618,90 @@ IopFreeDeviceNode(PDEVICE_NODE DeviceNode)
}
NTSTATUS
-IopInitiatePnpIrp(PDEVICE_OBJECT DeviceObject,
- PIO_STATUS_BLOCK IoStatusBlock,
- ULONG MinorFunction,
- PIO_STACK_LOCATION Stack OPTIONAL)
+NTAPI
+IopSynchronousCall(IN PDEVICE_OBJECT DeviceObject,
+ IN PIO_STACK_LOCATION IoStackLocation,
+ OUT PVOID *Information)
{
- PDEVICE_OBJECT TopDeviceObject;
- PIO_STACK_LOCATION IrpSp;
- NTSTATUS Status;
- KEVENT Event;
- PIRP Irp;
-
- /* Always call the top of the device stack */
- TopDeviceObject = IoGetAttachedDeviceReference(DeviceObject);
-
- KeInitializeEvent(
- &Event,
- NotificationEvent,
- FALSE);
-
- Irp = IoBuildSynchronousFsdRequest(
- IRP_MJ_PNP,
- TopDeviceObject,
- NULL,
- 0,
- NULL,
- &Event,
- IoStatusBlock);
-
- /* PNP IRPs are initialized with a status code of STATUS_NOT_SUPPORTED */
- Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
- Irp->IoStatus.Information = 0;
-
- if (MinorFunction == IRP_MN_FILTER_RESOURCE_REQUIREMENTS)
- {
- Irp->IoStatus.Information = (ULONG_PTR)Stack->Parameters.FilterResourceRequirements.IoResourceRequirementList;
- }
-
- IrpSp = IoGetNextIrpStackLocation(Irp);
- IrpSp->MinorFunction = (UCHAR)MinorFunction;
-
- if (Stack)
- {
- RtlCopyMemory(&IrpSp->Parameters,
- &Stack->Parameters,
- sizeof(Stack->Parameters));
- }
-
- Status = IoCallDriver(TopDeviceObject, Irp);
- if (Status == STATUS_PENDING)
- {
- KeWaitForSingleObject(&Event,
- Executive,
- KernelMode,
- FALSE,
- NULL);
- Status = IoStatusBlock->Status;
- }
-
- ObDereferenceObject(TopDeviceObject);
-
- return Status;
+ PIRP Irp;
+ PIO_STACK_LOCATION IrpStack;
+ IO_STATUS_BLOCK IoStatusBlock;
+ KEVENT Event;
+ NTSTATUS Status;
+ PDEVICE_OBJECT TopDeviceObject;
+ PAGED_CODE();
+
+ /* Call the top of the device stack */
+ TopDeviceObject = IoGetAttachedDeviceReference(DeviceObject);
+
+ /* Allocate an IRP */
+ Irp = IoAllocateIrp(TopDeviceObject->StackSize, FALSE);
+ if (!Irp) return STATUS_INSUFFICIENT_RESOURCES;
+
+ /* Initialize to failure */
+ Irp->IoStatus.Status = IoStatusBlock.Status = STATUS_NOT_SUPPORTED;
+ Irp->IoStatus.Information = IoStatusBlock.Information = 0;
+
+ /* Initialize the event */
+ KeInitializeEvent(&Event, SynchronizationEvent, FALSE);
+
+ /* Set them up */
+ Irp->UserIosb = &IoStatusBlock;
+ Irp->UserEvent = &Event;
+
+ /* Queue the IRP */
+ Irp->Tail.Overlay.Thread = PsGetCurrentThread();
+ IoQueueThreadIrp(Irp);
+
+ /* Copy-in the stack */
+ IrpStack = IoGetNextIrpStackLocation(Irp);
+ *IrpStack = *IoStackLocation;
+
+ /* Call the driver */
+ Status = IoCallDriver(TopDeviceObject, Irp);
+ if (Status == STATUS_PENDING)
+ {
+ /* Wait for it */
+ KeWaitForSingleObject(&Event,
+ Executive,
+ KernelMode,
+ FALSE,
+ NULL);
+ Status = IoStatusBlock.Status;
+ }
+
+ /* Return the information */
+ *Information = (PVOID)IoStatusBlock.Information;
+ return Status;
}
+NTSTATUS
+NTAPI
+IopInitiatePnpIrp(IN PDEVICE_OBJECT DeviceObject,
+ IN OUT PIO_STATUS_BLOCK IoStatusBlock,
+ IN ULONG MinorFunction,
+ IN PIO_STACK_LOCATION Stack OPTIONAL)
+{
+ IO_STACK_LOCATION IoStackLocation;
+
+ /* Fill out the stack information */
+ RtlZeroMemory(&IoStackLocation, sizeof(IO_STACK_LOCATION));
+ IoStackLocation.MajorFunction = IRP_MJ_PNP;
+ IoStackLocation.MinorFunction = MinorFunction;
+ if (Stack)
+ {
+ /* Copy the rest */
+ RtlCopyMemory(&IoStackLocation.Parameters,
+ &Stack->Parameters,
+ sizeof(Stack->Parameters));
+ }
+
+ /* Do the PnP call */
+ IoStatusBlock->Status = IopSynchronousCall(DeviceObject,
+ &IoStackLocation,
+ (PVOID)&IoStatusBlock->Information);
+ return IoStatusBlock->Status;
+}
NTSTATUS
IopTraverseDeviceTreeNode(PDEVICETREE_TRAVERSE_CONTEXT Context)
@@ -2909,29 +2930,8 @@ IopActionInitChildServices(PDEVICE_NODE DeviceNode,
/* Driver is loaded and initialized at this point */
if (NT_SUCCESS(Status))
{
- /* Attach lower level filter drivers. */
- IopAttachFilterDrivers(DeviceNode, TRUE);
-
- /* Initialize the function driver for the device node */
- Status = IopInitializeDevice(DeviceNode, DriverObject);
-
- if (NT_SUCCESS(Status))
- {
- /* Attach upper level filter drivers. */
- IopAttachFilterDrivers(DeviceNode, FALSE);
-
- Status = IopStartDevice(DeviceNode);
- if (!NT_SUCCESS(Status))
- {
- DPRINT1("IopStartDevice(%wZ) failed with status 0x%08x\n",
- &DeviceNode->InstancePath, Status);
- }
- }
- else
- {
- DPRINT1("IopInitializeDevice(%wZ) failed with status 0x%08x\n",
- &DeviceNode->InstancePath, Status);
- }
+ /* Initialize the device, including all filters */
+ Status = PipCallDriverAddDevice(DeviceNode, FALSE, DriverObject);
}
else
{
From 5d6b19c9a0f64fd1b79e17d752c51674309a85ea Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Sun, 11 Apr 2010 16:21:29 +0000
Subject: [PATCH 103/261] [NTOSKRNL] - Store the allocated resources for
reported devices
svn path=/trunk/; revision=46842
---
reactos/ntoskrnl/io/pnpmgr/pnpreport.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpreport.c b/reactos/ntoskrnl/io/pnpmgr/pnpreport.c
index 239dcb0511d..4995b16fd65 100644
--- a/reactos/ntoskrnl/io/pnpmgr/pnpreport.c
+++ b/reactos/ntoskrnl/io/pnpmgr/pnpreport.c
@@ -266,9 +266,6 @@ IoReportDetectedDevice(IN PDRIVER_OBJECT DriverObject,
/* Write the resource information to the registry */
IopSetDeviceInstanceData(InstanceKey, DeviceNode);
- /* Close the instance key handle */
- ZwClose(InstanceKey);
-
/* If the caller didn't get the resources assigned for us, do it now */
if (!ResourceAssigned)
{
@@ -278,7 +275,19 @@ IoReportDetectedDevice(IN PDRIVER_OBJECT DriverObject,
{
Status = IopTranslateDeviceResources(DeviceNode, RequiredLength);
if (NT_SUCCESS(Status))
+ {
Status = IopUpdateResourceMapForPnPDevice(DeviceNode);
+ if (NT_SUCCESS(Status) && DeviceNode->ResourceList)
+ {
+ RtlInitUnicodeString(&ValueName, L"AllocConfig");
+ Status = ZwSetValueKey(InstanceKey,
+ &ValueName,
+ 0,
+ REG_RESOURCE_LIST,
+ DeviceNode->ResourceList,
+ CM_RESOURCE_LIST_SIZE(DeviceNode->ResourceList));
+ }
+ }
}
IopDeviceNodeClearFlag(DeviceNode, DNF_ASSIGNING_RESOURCES);
@@ -286,10 +295,14 @@ IoReportDetectedDevice(IN PDRIVER_OBJECT DriverObject,
if (!NT_SUCCESS(Status))
{
DPRINT("Assigning resources failed: 0x%x\n", Status);
+ ZwClose(InstanceKey);
return Status;
}
}
+ /* Close the instance key handle */
+ ZwClose(InstanceKey);
+
/* Report the device's enumeration to umpnpmgr */
IopQueueTargetDeviceEvent(&GUID_DEVICE_ENUMERATED,
&DeviceNode->InstancePath);
From e511742ca6105c9bbb409332284143047cafbfe3 Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Sun, 11 Apr 2010 16:23:57 +0000
Subject: [PATCH 104/261] [NTOSKRNL] - Don't set the DNF_STARTED flag before
calling IopStartDevice
svn path=/trunk/; revision=46843
---
reactos/ntoskrnl/io/pnpmgr/pnpinit.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpinit.c b/reactos/ntoskrnl/io/pnpmgr/pnpinit.c
index 24c8ba6753c..afa54eb5ad9 100644
--- a/reactos/ntoskrnl/io/pnpmgr/pnpinit.c
+++ b/reactos/ntoskrnl/io/pnpmgr/pnpinit.c
@@ -323,7 +323,6 @@ PipCallDriverAddDevice(IN PDEVICE_NODE DeviceNode,
if (NT_SUCCESS(Status))
{
IopAttachFilterDrivers(DeviceNode, FALSE);
- IopDeviceNodeSetFlag(DeviceNode, DNF_STARTED);
Status = IopStartDevice(DeviceNode);
}
From d568475220437109561c8a329b257124673fe8e6 Mon Sep 17 00:00:00 2001
From: Cameron Gutman
Date: Sun, 11 Apr 2010 17:31:17 +0000
Subject: [PATCH 105/261] [NTOSKRNL] - Use IopDeviceNodeSetFlag to set the
DNF_HAS_BOOT_CONFIG flag - Set DNF_START_FAILED and print a warning if we
fail to start a device - Clear the DNF_ASSIGNING_RESOURCES flag before
failing - TODO: Release device resources when start fails
svn path=/trunk/; revision=46844
---
reactos/ntoskrnl/io/pnpmgr/pnpmgr.c | 29 +++++++++++++++++++----------
1 file changed, 19 insertions(+), 10 deletions(-)
diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
index 8862fd87bcd..644338ee502 100644
--- a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
+++ b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
@@ -147,7 +147,7 @@ IopStartDevice(
IO_STACK_LOCATION Stack;
ULONG RequiredLength;
NTSTATUS Status;
- HANDLE InstanceHandle, ControlHandle;
+ HANDLE InstanceHandle = INVALID_HANDLE_VALUE, ControlHandle = INVALID_HANDLE_VALUE;
UNICODE_STRING KeyName;
OBJECT_ATTRIBUTES ObjectAttributes;
@@ -162,6 +162,7 @@ IopStartDevice(
if (!NT_SUCCESS(Status) && Status != STATUS_NOT_SUPPORTED)
{
DPRINT("IopInitiatePnpIrp(IRP_MN_FILTER_RESOURCE_REQUIREMENTS) failed\n");
+ IopDeviceNodeClearFlag(DeviceNode, DNF_ASSIGNING_RESOURCES);
return Status;
}
else if (NT_SUCCESS(Status))
@@ -192,6 +193,9 @@ IopStartDevice(
}
IopDeviceNodeClearFlag(DeviceNode, DNF_ASSIGNING_RESOURCES);
+ if (!NT_SUCCESS(Status))
+ goto ByeBye;
+
DPRINT("Sending IRP_MN_START_DEVICE to driver\n");
Stack.Parameters.StartDevice.AllocatedResources = DeviceNode->ResourceList;
Stack.Parameters.StartDevice.AllocatedResourcesTranslated = DeviceNode->ResourceListTranslated;
@@ -213,7 +217,9 @@ IopStartDevice(
if (!NT_SUCCESS(Status))
{
- DPRINT("IopInitiatePnpIrp() failed\n");
+ DPRINT1("IRP_MN_START_DEVICE failed for %wZ\n", &DeviceNode->InstancePath);
+ IopDeviceNodeClearFlag(DeviceNode, DNF_NEED_ENUMERATION_ONLY);
+ goto ByeBye;
}
else
{
@@ -229,7 +235,7 @@ IopStartDevice(
Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, 0, &InstanceHandle);
if (!NT_SUCCESS(Status))
- return Status;
+ goto ByeBye;
RtlInitUnicodeString(&KeyName, L"Control");
InitializeObjectAttributes(&ObjectAttributes,
@@ -239,10 +245,7 @@ IopStartDevice(
NULL);
Status = ZwCreateKey(&ControlHandle, KEY_SET_VALUE, &ObjectAttributes, 0, NULL, REG_OPTION_VOLATILE, NULL);
if (!NT_SUCCESS(Status))
- {
- ZwClose(InstanceHandle);
- return Status;
- }
+ goto ByeBye;
RtlInitUnicodeString(&KeyName, L"ActiveService");
Status = ZwSetValueKey(ControlHandle, &KeyName, 0, REG_SZ, DeviceNode->ServiceName.Buffer, DeviceNode->ServiceName.Length);
@@ -254,11 +257,17 @@ IopStartDevice(
DeviceNode->ResourceList, CM_RESOURCE_LIST_SIZE(DeviceNode->ResourceList));
}
+ByeBye:
if (NT_SUCCESS(Status))
IopDeviceNodeSetFlag(DeviceNode, DNF_STARTED);
+ else
+ IopDeviceNodeSetFlag(DeviceNode, DNF_START_FAILED);
- ZwClose(ControlHandle);
- ZwClose(InstanceHandle);
+ if (ControlHandle != INVALID_HANDLE_VALUE)
+ ZwClose(ControlHandle);
+
+ if (InstanceHandle != INVALID_HANDLE_VALUE)
+ ZwClose(InstanceHandle);
return Status;
}
@@ -2497,7 +2506,7 @@ IopActionInterrogateDeviceStack(PDEVICE_NODE DeviceNode,
{
DeviceNode->BootResources =
(PCM_RESOURCE_LIST)IoStatusBlock.Information;
- DeviceNode->Flags |= DNF_HAS_BOOT_CONFIG;
+ IopDeviceNodeSetFlag(DeviceNode, DNF_HAS_BOOT_CONFIG);
}
else
{
From ec9ebec239dfbb4de339861cec89b1ab2f98ce56 Mon Sep 17 00:00:00 2001
From: Sir Richard
Date: Sun, 11 Apr 2010 21:25:50 +0000
Subject: [PATCH 106/261] [NTOS]: Rename IopBusTypeGuidList to
PnpBusTypeGuidList to match Windows 2003 PnP Namespace instead of Windows
2000. [NTOS]: Use PnpBusTypeGuidList->Lock instead of PnpBusTypeGuidListLock.
[NTOS]: Implement PipAllocateDeviceNode for setting up device nodes and
linking them to a PDO. Only used for Root PnP now. Main ABI change is that
allocate in ReactOS right now includes "insert". These will be seperate in
the new PnP ABI. [NTOS]: Implement IopInitializePnpServices to replace
PnpInit. Mostly the same work is done, but using new PnP ABI. [NTOS]:
Implement new helper: IopCreateRegistryKeyEx.
svn path=/trunk/; revision=46845
---
reactos/ntoskrnl/include/internal/io.h | 38 ++-
reactos/ntoskrnl/io/iomgr/iomgr.c | 5 +-
reactos/ntoskrnl/io/pnpmgr/pnpinit.c | 171 +++++++++++++-
reactos/ntoskrnl/io/pnpmgr/pnpmgr.c | 305 ++++++++++++++++---------
reactos/ntoskrnl/io/pnpmgr/pnproot.c | 2 +
5 files changed, 398 insertions(+), 123 deletions(-)
diff --git a/reactos/ntoskrnl/include/internal/io.h b/reactos/ntoskrnl/include/internal/io.h
index 4f2b236156c..1faff6bfcea 100644
--- a/reactos/ntoskrnl/include/internal/io.h
+++ b/reactos/ntoskrnl/include/internal/io.h
@@ -517,8 +517,9 @@ PipCallDriverAddDevice(
IN PDRIVER_OBJECT DriverObject
);
-VOID
-PnpInit(
+NTSTATUS
+NTAPI
+IopInitializePlugPlayServices(
VOID
);
@@ -557,6 +558,12 @@ IopGetSystemPowerDeviceObject(
IN PDEVICE_OBJECT *DeviceObject
);
+PDEVICE_NODE
+NTAPI
+PipAllocateDeviceNode(
+ IN PDEVICE_OBJECT PhysicalDeviceObject
+);
+
NTSTATUS
IopCreateDeviceNode(
IN PDEVICE_NODE ParentNode,
@@ -644,14 +651,32 @@ IopOpenRegistryKeyEx(
NTSTATUS
NTAPI
-IopGetRegistryValue(IN HANDLE Handle,
- IN PWSTR ValueName,
- OUT PKEY_VALUE_FULL_INFORMATION *Information);
+IopGetRegistryValue(
+ IN HANDLE Handle,
+ IN PWSTR ValueName,
+ OUT PKEY_VALUE_FULL_INFORMATION *Information
+);
+NTSTATUS
+NTAPI
+IopCreateRegistryKeyEx(
+ OUT PHANDLE Handle,
+ IN HANDLE BaseHandle OPTIONAL,
+ IN PUNICODE_STRING KeyName,
+ IN ACCESS_MASK DesiredAccess,
+ IN ULONG CreateOptions,
+ OUT PULONG Disposition OPTIONAL
+);
//
// PnP Routines
//
+NTSTATUS
+NTAPI
+IopUpdateRootKey(
+ VOID
+);
+
NTSTATUS
NTAPI
PiInitCacheGroupInformation(
@@ -1138,6 +1163,7 @@ IopStartRamdisk(
//
extern POBJECT_TYPE IoCompletionType;
extern PDEVICE_NODE IopRootDeviceNode;
+extern KSPIN_LOCK IopDeviceTreeLock;
extern ULONG IopTraceLevel;
extern GENERAL_LOOKASIDE IopMdlLookasideList;
extern GENERIC_MAPPING IopCompletionMapping;
@@ -1147,6 +1173,8 @@ extern HAL_DISPATCH _HalDispatchTable;
extern LIST_ENTRY IopErrorLogListHead;
extern ULONG IopNumTriageDumpDataBlocks;
extern PVOID IopTriageDumpDataBlocks[64];
+extern PIO_BUS_TYPE_GUID_LIST PnpBusTypeGuidList;
+extern PDRIVER_OBJECT IopRootDriverObject;
//
// Inlined Functions
diff --git a/reactos/ntoskrnl/io/iomgr/iomgr.c b/reactos/ntoskrnl/io/iomgr/iomgr.c
index e52f2fe54ab..a0f16bb15a4 100644
--- a/reactos/ntoskrnl/io/iomgr/iomgr.c
+++ b/reactos/ntoskrnl/io/iomgr/iomgr.c
@@ -488,10 +488,7 @@ IoInitSystem(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
if (!IopCreateRootDirectories()) return FALSE;
/* Initialize PnP manager */
- PnpInit();
-
- /* Setup the group cache */
- if (!NT_SUCCESS(PiInitCacheGroupInformation())) return FALSE;
+ IopInitializePlugPlayServices();
/* Load boot start drivers */
IopInitializeBootDrivers();
diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpinit.c b/reactos/ntoskrnl/io/pnpmgr/pnpinit.c
index afa54eb5ad9..deced326832 100644
--- a/reactos/ntoskrnl/io/pnpmgr/pnpinit.c
+++ b/reactos/ntoskrnl/io/pnpmgr/pnpinit.c
@@ -14,11 +14,34 @@
/* GLOBALS ********************************************************************/
+typedef struct _IOPNP_DEVICE_EXTENSION
+{
+ PWCHAR CompatibleIdList;
+ ULONG CompatibleIdListSize;
+} IOPNP_DEVICE_EXTENSION, *PIOPNP_DEVICE_EXTENSION;
+
PUNICODE_STRING PiInitGroupOrderTable;
ULONG PiInitGroupOrderTableCount;
-
+INTERFACE_TYPE PnpDefaultInterfaceType;
+
/* FUNCTIONS ******************************************************************/
+INTERFACE_TYPE
+NTAPI
+IopDetermineDefaultInterfaceType(VOID)
+{
+ /* FIXME: ReactOS doesn't support MicroChannel yet */
+ return Isa;
+}
+
+NTSTATUS
+NTAPI
+IopInitializeArbiters(VOID)
+{
+ /* FIXME: TODO */
+ return STATUS_SUCCESS;
+}
+
NTSTATUS
NTAPI
PiInitCacheGroupInformation(VOID)
@@ -330,4 +353,150 @@ PipCallDriverAddDevice(IN PDEVICE_NODE DeviceNode,
return Status;
}
+NTSTATUS
+NTAPI
+IopInitializePlugPlayServices(VOID)
+{
+ NTSTATUS Status;
+ ULONG Disposition;
+ HANDLE KeyHandle, EnumHandle, ParentHandle, TreeHandle;
+ UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\REGISTRY\\MACHINE\\SYSTEM\\CURRENTCONTROLSET");
+ PDEVICE_OBJECT Pdo;
+
+ /* Initialize locks and such */
+ KeInitializeSpinLock(&IopDeviceTreeLock);
+
+ /* Get the default interface */
+ PnpDefaultInterfaceType = IopDetermineDefaultInterfaceType();
+
+ /* Initialize arbiters */
+ Status = IopInitializeArbiters();
+ if (!NT_SUCCESS(Status)) return Status;
+
+ /* Setup the group cache */
+ Status = PiInitCacheGroupInformation();
+ if (!NT_SUCCESS(Status)) return Status;
+
+ /* Open the current control set */
+ Status = IopOpenRegistryKeyEx(&KeyHandle,
+ NULL,
+ &KeyName,
+ KEY_ALL_ACCESS);
+ if (!NT_SUCCESS(Status)) return Status;
+
+ /* Create the enum key */
+ RtlInitUnicodeString(&KeyName, REGSTR_KEY_ENUM);
+ Status = IopCreateRegistryKeyEx(&EnumHandle,
+ KeyHandle,
+ &KeyName,
+ KEY_ALL_ACCESS,
+ REG_OPTION_NON_VOLATILE,
+ &Disposition);
+ if (!NT_SUCCESS(Status)) return Status;
+
+ /* Check if it's a new key */
+ if (Disposition == REG_CREATED_NEW_KEY)
+ {
+ /* FIXME: DACLs */
+ DPRINT1("Need to build DACL\n");
+ }
+
+ /* Create the root key */
+ ParentHandle = EnumHandle;
+ RtlInitUnicodeString(&KeyName, REGSTR_KEY_ROOTENUM);
+ Status = IopCreateRegistryKeyEx(&EnumHandle,
+ ParentHandle,
+ &KeyName,
+ KEY_ALL_ACCESS,
+ REG_OPTION_NON_VOLATILE,
+ &Disposition);
+ NtClose(ParentHandle);
+ if (!NT_SUCCESS(Status)) return Status;
+ NtClose(EnumHandle);
+
+ /* Open the root key now */
+ RtlInitUnicodeString(&KeyName, L"\\REGISTRY\\MACHINE\\SYSTEM\\CURRENTCONTROLSET\\ENUM");
+ Status = IopOpenRegistryKeyEx(&EnumHandle,
+ NULL,
+ &KeyName,
+ KEY_ALL_ACCESS);
+ if (NT_SUCCESS(Status))
+ {
+ /* Create the root dev node */
+ RtlInitUnicodeString(&KeyName, REGSTR_VAL_ROOT_DEVNODE);
+ Status = IopCreateRegistryKeyEx(&TreeHandle,
+ EnumHandle,
+ &KeyName,
+ KEY_ALL_ACCESS,
+ REG_OPTION_NON_VOLATILE,
+ NULL);
+ NtClose(EnumHandle);
+ if (NT_SUCCESS(Status)) NtClose(TreeHandle);
+ }
+
+ /* Create the root driver */
+ Status = IoCreateDriver(NULL, PnpRootDriverEntry);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("IoCreateDriverObject() failed\n");
+ KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
+ }
+
+ /* Create the root PDO */
+ Status = IoCreateDevice(IopRootDriverObject,
+ sizeof(IOPNP_DEVICE_EXTENSION),
+ NULL,
+ FILE_DEVICE_CONTROLLER,
+ 0,
+ FALSE,
+ &Pdo);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("IoCreateDevice() failed\n");
+ KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
+ }
+
+ /* This is a bus enumerated device */
+ Pdo->Flags |= DO_BUS_ENUMERATED_DEVICE;
+
+ /* Create the root device node */
+ IopRootDeviceNode = PipAllocateDeviceNode(Pdo);
+
+ /* Set flags */
+ IopRootDeviceNode->Flags |= DNF_STARTED + DNF_PROCESSED + DNF_ENUMERATED +
+ DNF_MADEUP + DNF_NO_RESOURCE_REQUIRED +
+ DNF_ADDED;
+
+ /* Create instance path */
+ RtlCreateUnicodeString(&IopRootDeviceNode->InstancePath,
+ REGSTR_VAL_ROOT_DEVNODE);
+
+ /* Call the add device routine */
+ IopRootDriverObject->DriverExtension->AddDevice(IopRootDriverObject,
+ IopRootDeviceNode->PhysicalDeviceObject);
+
+ /* Initialize PnP-Event notification support */
+ Status = IopInitPlugPlayEvents();
+ if (!NT_SUCCESS(Status)) return Status;
+
+ /* Report the device to the user-mode pnp manager */
+ IopQueueTargetDeviceEvent(&GUID_DEVICE_ARRIVAL,
+ &IopRootDeviceNode->InstancePath);
+
+ /* Initialize the Bus Type GUID List */
+ PnpBusTypeGuidList = ExAllocatePool(PagedPool, sizeof(IO_BUS_TYPE_GUID_LIST));
+ RtlZeroMemory(PnpBusTypeGuidList, sizeof(IO_BUS_TYPE_GUID_LIST));
+ ExInitializeFastMutex(&PnpBusTypeGuidList->Lock);
+
+ /* Launch the firmware mapper */
+ Status = IopUpdateRootKey();
+ if (!NT_SUCCESS(Status)) return Status;
+
+ /* Close the handle to the control set */
+ NtClose(KeyHandle);
+
+ /* We made it */
+ return STATUS_SUCCESS;
+}
+
/* EOF */
diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
index 644338ee502..439795c603a 100644
--- a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
+++ b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
@@ -29,8 +29,7 @@ extern BOOLEAN PnpSystemInit;
/* DATA **********************************************************************/
PDRIVER_OBJECT IopRootDriverObject;
-FAST_MUTEX IopBusTypeGuidListLock;
-PIO_BUS_TYPE_GUID_LIST IopBusTypeGuidList = NULL;
+PIO_BUS_TYPE_GUID_LIST PnpBusTypeGuidList = NULL;
#if defined (ALLOC_PRAGMA)
#pragma alloc_text(INIT, PnpInit)
@@ -340,14 +339,14 @@ IopGetBusTypeGuidIndex(LPGUID BusTypeGuid)
PVOID NewList;
/* Acquire the lock */
- ExAcquireFastMutex(&IopBusTypeGuidListLock);
+ ExAcquireFastMutex(&PnpBusTypeGuidList->Lock);
/* Loop all entries */
- while (i < IopBusTypeGuidList->GuidCount)
+ while (i < PnpBusTypeGuidList->GuidCount)
{
/* Try to find a match */
if (RtlCompareMemory(BusTypeGuid,
- &IopBusTypeGuidList->Guids[i],
+ &PnpBusTypeGuidList->Guids[i],
sizeof(GUID)) == sizeof(GUID))
{
/* Found it */
@@ -358,43 +357,43 @@ IopGetBusTypeGuidIndex(LPGUID BusTypeGuid)
}
/* Check if we have to grow the list */
- if (IopBusTypeGuidList->GuidCount)
+ if (PnpBusTypeGuidList->GuidCount)
{
/* Calculate the new size */
NewSize = sizeof(IO_BUS_TYPE_GUID_LIST) +
- (sizeof(GUID) * IopBusTypeGuidList->GuidCount);
+ (sizeof(GUID) * PnpBusTypeGuidList->GuidCount);
/* Allocate the new copy */
NewList = ExAllocatePool(PagedPool, NewSize);
if (!NewList) {
/* Fail */
- ExFreePool(IopBusTypeGuidList);
+ ExFreePool(PnpBusTypeGuidList);
goto Quickie;
}
/* Now copy them, decrease the size too */
NewSize -= sizeof(GUID);
- RtlCopyMemory(NewList, IopBusTypeGuidList, NewSize);
+ RtlCopyMemory(NewList, PnpBusTypeGuidList, NewSize);
/* Free the old list */
- ExFreePool(IopBusTypeGuidList);
+ ExFreePool(PnpBusTypeGuidList);
/* Use the new buffer */
- IopBusTypeGuidList = NewList;
+ PnpBusTypeGuidList = NewList;
}
/* Copy the new GUID */
- RtlCopyMemory(&IopBusTypeGuidList->Guids[IopBusTypeGuidList->GuidCount],
+ RtlCopyMemory(&PnpBusTypeGuidList->Guids[PnpBusTypeGuidList->GuidCount],
BusTypeGuid,
sizeof(GUID));
/* The new entry is the index */
- FoundIndex = (USHORT)IopBusTypeGuidList->GuidCount;
- IopBusTypeGuidList->GuidCount++;
+ FoundIndex = (USHORT)PnpBusTypeGuidList->GuidCount;
+ PnpBusTypeGuidList->GuidCount++;
Quickie:
- ExReleaseFastMutex(&IopBusTypeGuidListLock);
+ ExReleaseFastMutex(&PnpBusTypeGuidList->Lock);
return FoundIndex;
}
@@ -1671,7 +1670,7 @@ IopCreateResourceListFromRequirements(
{
PIO_RESOURCE_LIST ResList = &RequirementsList->List[i];
Size += FIELD_OFFSET(CM_FULL_RESOURCE_DESCRIPTOR, PartialResourceList.PartialDescriptors)
- + ResList->Count * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
+ + ResList->Count * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
}
*ResourceList = ExAllocatePool(PagedPool, Size);
@@ -1821,8 +1820,8 @@ IopAssignDeviceResources(
for (i = 0; i < DeviceNode->BootResources->Count; i++)
{
pPartialResourceList = &DeviceNode->BootResources->List[i].PartialResourceList;
- Size += FIELD_OFFSET(CM_FULL_RESOURCE_DESCRIPTOR, PartialResourceList.PartialDescriptors)
- + pPartialResourceList->Count * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
+ Size += FIELD_OFFSET(CM_FULL_RESOURCE_DESCRIPTOR, PartialResourceList.PartialDescriptors) +
+ pPartialResourceList->Count * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
for (j = 0; j < pPartialResourceList->Count; j++)
{
if (pPartialResourceList->PartialDescriptors[j].Type == CmResourceTypeDeviceSpecific)
@@ -1865,8 +1864,8 @@ IopAssignDeviceResources(
for (i = 0; i < DeviceNode->ResourceList->Count; i++)
{
pPartialResourceList = &DeviceNode->ResourceList->List[i].PartialResourceList;
- Size += FIELD_OFFSET(CM_FULL_RESOURCE_DESCRIPTOR, PartialResourceList.PartialDescriptors)
- + pPartialResourceList->Count * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
+ Size += FIELD_OFFSET(CM_FULL_RESOURCE_DESCRIPTOR, PartialResourceList.PartialDescriptors) +
+ pPartialResourceList->Count * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
}
Status = IopDetectResourceConflict(DeviceNode->ResourceList, FALSE, NULL);
@@ -3153,7 +3152,7 @@ IopEnumerateDetectedDevices(
BootResourcesLength = pValueInformation->DataLength;
else
BootResourcesLength = ParentBootResourcesLength
- + pValueInformation->DataLength
+ + pValueInformation->DataLength
- Header;
BootResources = ExAllocatePool(PagedPool, BootResourcesLength);
if (!BootResources)
@@ -3585,7 +3584,8 @@ cleanup:
#endif
}
-static NTSTATUS INIT_FUNCTION
+NTSTATUS
+NTAPI
IopUpdateRootKey(VOID)
{
UNICODE_STRING EnumU = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Enum");
@@ -3692,6 +3692,131 @@ IopOpenRegistryKeyEx(PHANDLE KeyHandle,
return Status;
}
+NTSTATUS
+NTAPI
+IopCreateRegistryKeyEx(OUT PHANDLE Handle,
+ IN HANDLE RootHandle OPTIONAL,
+ IN PUNICODE_STRING KeyName,
+ IN ACCESS_MASK DesiredAccess,
+ IN ULONG CreateOptions,
+ OUT PULONG Disposition OPTIONAL)
+{
+ OBJECT_ATTRIBUTES ObjectAttributes;
+ ULONG KeyDisposition, RootHandleIndex = 0, i = 1, NestedCloseLevel = 0, Length;
+ HANDLE HandleArray[2];
+ BOOLEAN Recursing = TRUE;
+ PWCHAR pp, p, p1;
+ UNICODE_STRING KeyString;
+ NTSTATUS Status = STATUS_SUCCESS;
+ PAGED_CODE();
+
+ /* P1 is start, pp is end */
+ p1 = KeyName->Buffer;
+ pp = (PVOID)((ULONG_PTR)p1 + KeyName->Length);
+
+ /* Create the target key */
+ InitializeObjectAttributes(&ObjectAttributes,
+ KeyName,
+ OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
+ RootHandle,
+ NULL);
+ Status = ZwCreateKey(&HandleArray[i],
+ DesiredAccess,
+ &ObjectAttributes,
+ 0,
+ NULL,
+ CreateOptions,
+ &KeyDisposition);
+
+ /* Now we check if this failed */
+ if ((Status == STATUS_OBJECT_NAME_NOT_FOUND) && (RootHandle))
+ {
+ /* Target key failed, so we'll need to create its parent. Setup array */
+ HandleArray[0] = NULL;
+ HandleArray[1] = RootHandle;
+
+ /* Keep recursing for each missing parent */
+ while (Recursing)
+ {
+ /* And if we're deep enough, close the last handle */
+ if (NestedCloseLevel > 1) ZwClose(HandleArray[RootHandleIndex]);
+
+ /* We're setup to ping-pong between the two handle array entries */
+ RootHandleIndex = i;
+ i = (i + 1) & 1;
+
+ /* Clear the one we're attempting to open now */
+ HandleArray[i] = NULL;
+
+ /* Process the parent key name */
+ for (p = p1; ((p < pp) && (*p != OBJ_NAME_PATH_SEPARATOR)); p++);
+ Length = (p - p1) * sizeof(WCHAR);
+
+ /* Is there a parent name? */
+ if (Length)
+ {
+ /* Build the unicode string for it */
+ KeyString.Buffer = p1;
+ KeyString.Length = KeyString.MaximumLength = Length;
+
+ /* Now try opening the parent */
+ InitializeObjectAttributes(&ObjectAttributes,
+ &KeyString,
+ OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
+ HandleArray[RootHandleIndex],
+ NULL);
+ Status = ZwCreateKey(&HandleArray[i],
+ DesiredAccess,
+ &ObjectAttributes,
+ 0,
+ NULL,
+ CreateOptions,
+ &KeyDisposition);
+ if (NT_SUCCESS(Status))
+ {
+ /* It worked, we have one more handle */
+ NestedCloseLevel++;
+ }
+ else
+ {
+ /* Parent key creation failed, abandon loop */
+ Recursing = FALSE;
+ continue;
+ }
+ }
+ else
+ {
+ /* We don't have a parent name, probably corrupted key name */
+ Status = STATUS_INVALID_PARAMETER;
+ Recursing = FALSE;
+ continue;
+ }
+
+ /* Now see if there's more parents to create */
+ p1 = p + 1;
+ if ((p == pp) || (p1 == pp))
+ {
+ /* We're done, hopefully successfully, so stop */
+ Recursing = FALSE;
+ }
+ }
+
+ /* Outer loop check for handle nesting that requires closing the top handle */
+ if (NestedCloseLevel > 1) ZwClose(HandleArray[RootHandleIndex]);
+ }
+
+ /* Check if we broke out of the loop due to success */
+ if (NT_SUCCESS(Status))
+ {
+ /* Return the target handle (we closed all the parent ones) and disposition */
+ *Handle = HandleArray[i];
+ if (Disposition) *Disposition = KeyDisposition;
+ }
+
+ /* Return the success state */
+ return Status;
+}
+
NTSTATUS
NTAPI
IopGetRegistryValue(IN HANDLE Handle,
@@ -3737,95 +3862,6 @@ IopGetRegistryValue(IN HANDLE Handle,
return STATUS_SUCCESS;
}
-static NTSTATUS INIT_FUNCTION
-NTAPI
-PnpDriverInitializeEmpty(IN struct _DRIVER_OBJECT *DriverObject, IN PUNICODE_STRING RegistryPath)
-{
- return STATUS_SUCCESS;
-}
-
-VOID INIT_FUNCTION
-PnpInit(VOID)
-{
- PDEVICE_OBJECT Pdo;
- NTSTATUS Status;
-
- DPRINT("PnpInit()\n");
-
- KeInitializeSpinLock(&IopDeviceTreeLock);
- ExInitializeFastMutex(&IopBusTypeGuidListLock);
-
- /* Initialize the Bus Type GUID List */
- IopBusTypeGuidList = ExAllocatePool(NonPagedPool, sizeof(IO_BUS_TYPE_GUID_LIST));
- if (!IopBusTypeGuidList) {
- DPRINT1("ExAllocatePool() failed\n");
- KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, STATUS_NO_MEMORY, 0, 0, 0);
- }
-
- RtlZeroMemory(IopBusTypeGuidList, sizeof(IO_BUS_TYPE_GUID_LIST));
- ExInitializeFastMutex(&IopBusTypeGuidList->Lock);
-
- /* Initialize PnP-Event notification support */
- Status = IopInitPlugPlayEvents();
- if (!NT_SUCCESS(Status))
- {
- DPRINT1("IopInitPlugPlayEvents() failed\n");
- KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
- }
-
- /*
- * Create root device node
- */
-
- Status = IopCreateDriver(NULL, PnpDriverInitializeEmpty, NULL, 0, 0, &IopRootDriverObject);
- if (!NT_SUCCESS(Status))
- {
- DPRINT1("IoCreateDriverObject() failed\n");
- KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
- }
-
- Status = IoCreateDevice(IopRootDriverObject, 0, NULL, FILE_DEVICE_CONTROLLER,
- 0, FALSE, &Pdo);
- if (!NT_SUCCESS(Status))
- {
- DPRINT1("IoCreateDevice() failed\n");
- KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
- }
-
- Status = IopCreateDeviceNode(NULL, Pdo, NULL, &IopRootDeviceNode);
- if (!NT_SUCCESS(Status))
- {
- DPRINT1("Insufficient resources\n");
- KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
- }
-
- if (!RtlCreateUnicodeString(&IopRootDeviceNode->InstancePath,
- L"HTREE\\ROOT\\0"))
- {
- DPRINT1("Failed to create the instance path!\n");
- KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, STATUS_NO_MEMORY, 0, 0, 0);
- }
-
- /* Report the device to the user-mode pnp manager */
- IopQueueTargetDeviceEvent(&GUID_DEVICE_ARRIVAL,
- &IopRootDeviceNode->InstancePath);
-
- IopRootDeviceNode->PhysicalDeviceObject->Flags |= DO_BUS_ENUMERATED_DEVICE;
- PnpRootDriverEntry(IopRootDriverObject, NULL);
- IopRootDeviceNode->PhysicalDeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
- IopRootDriverObject->DriverExtension->AddDevice(
- IopRootDriverObject,
- IopRootDeviceNode->PhysicalDeviceObject);
-
- /* Move information about devices detected by Freeloader to SYSTEM\CurrentControlSet\Root\ */
- Status = IopUpdateRootKey();
- if (!NT_SUCCESS(Status))
- {
- DPRINT1("IopUpdateRootKey() failed\n");
- KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
- }
-}
-
RTL_GENERIC_COMPARE_RESULTS
NTAPI
PiCompareInstancePath(IN PRTL_AVL_TABLE Table,
@@ -3913,6 +3949,49 @@ PpInitSystem(VOID)
}
}
+LONG IopNumberDeviceNodes;
+
+PDEVICE_NODE
+NTAPI
+PipAllocateDeviceNode(IN PDEVICE_OBJECT PhysicalDeviceObject)
+{
+ PDEVICE_NODE DeviceNode;
+ PAGED_CODE();
+
+ /* Allocate it */
+ DeviceNode = ExAllocatePoolWithTag(NonPagedPool, sizeof(DEVICE_NODE), 'donD');
+ if (!DeviceNode) return DeviceNode;
+
+ /* Statistics */
+ InterlockedIncrement(&IopNumberDeviceNodes);
+
+ /* Set it up */
+ RtlZeroMemory(DeviceNode, sizeof(DEVICE_NODE));
+ DeviceNode->InterfaceType = InterfaceTypeUndefined;
+ DeviceNode->BusNumber = -1;
+ DeviceNode->ChildInterfaceType = InterfaceTypeUndefined;
+ DeviceNode->ChildBusNumber = -1;
+ DeviceNode->ChildBusTypeIndex = -1;
+// KeInitializeEvent(&DeviceNode->EnumerationMutex, SynchronizationEvent, TRUE);
+ InitializeListHead(&DeviceNode->DeviceArbiterList);
+ InitializeListHead(&DeviceNode->DeviceTranslatorList);
+ InitializeListHead(&DeviceNode->TargetDeviceNotify);
+ InitializeListHead(&DeviceNode->DockInfo.ListEntry);
+ InitializeListHead(&DeviceNode->PendedSetInterfaceState);
+
+ /* Check if there is a PDO */
+ if (PhysicalDeviceObject)
+ {
+ /* Link it and remove the init flag */
+ DeviceNode->PhysicalDeviceObject = PhysicalDeviceObject;
+ ((PEXTENDED_DEVOBJ_EXTENSION)PhysicalDeviceObject->DeviceObjectExtension)->DeviceNode = DeviceNode;
+ PhysicalDeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
+ }
+
+ /* Return the node */
+ return DeviceNode;
+}
+
/* PUBLIC FUNCTIONS **********************************************************/
/*
@@ -3953,7 +4032,7 @@ IoGetDeviceProperty(IN PDEVICE_OBJECT DeviceObject,
case DevicePropertyBusTypeGuid:
/* Sanity check */
if ((DeviceNode->ChildBusTypeIndex != 0xFFFF) &&
- (DeviceNode->ChildBusTypeIndex < IopBusTypeGuidList->GuidCount))
+ (DeviceNode->ChildBusTypeIndex < PnpBusTypeGuidList->GuidCount))
{
/* Return the GUID */
*ResultLength = sizeof(GUID);
@@ -3966,7 +4045,7 @@ IoGetDeviceProperty(IN PDEVICE_OBJECT DeviceObject,
/* Copy the GUID */
RtlCopyMemory(PropertyBuffer,
- &(IopBusTypeGuidList->Guids[DeviceNode->ChildBusTypeIndex]),
+ &(PnpBusTypeGuidList->Guids[DeviceNode->ChildBusTypeIndex]),
sizeof(GUID));
return STATUS_SUCCESS;
}
diff --git a/reactos/ntoskrnl/io/pnpmgr/pnproot.c b/reactos/ntoskrnl/io/pnpmgr/pnproot.c
index c755c0fc0b8..30c612f1fc3 100644
--- a/reactos/ntoskrnl/io/pnpmgr/pnproot.c
+++ b/reactos/ntoskrnl/io/pnpmgr/pnproot.c
@@ -1185,6 +1185,8 @@ PnpRootDriverEntry(
{
DPRINT("PnpRootDriverEntry(%p %wZ)\n", DriverObject, RegistryPath);
+ IopRootDriverObject = DriverObject;
+
DriverObject->DriverExtension->AddDevice = PnpRootAddDevice;
DriverObject->MajorFunction[IRP_MJ_PNP] = PnpRootPnpControl;
From 8b6a58978fc6b4aa3cb002032522402226eda5ec Mon Sep 17 00:00:00 2001
From: Timo Kreuzer
Date: Mon, 12 Apr 2010 19:39:50 +0000
Subject: [PATCH 107/261] [HAL] Fix a possible overflow of the hal heap in
HalpMapPhysicalMemory64 and simplify the code.
svn path=/trunk/; revision=46849
---
reactos/hal/halx86/generic/halinit.c | 36 +++++++++++++---------------
1 file changed, 17 insertions(+), 19 deletions(-)
diff --git a/reactos/hal/halx86/generic/halinit.c b/reactos/hal/halx86/generic/halinit.c
index 4309ac1a16e..db54eb59d63 100644
--- a/reactos/hal/halx86/generic/halinit.c
+++ b/reactos/hal/halx86/generic/halinit.c
@@ -145,33 +145,31 @@ HalpMapPhysicalMemory64(IN PHYSICAL_ADDRESS PhysicalAddress,
/* Start at the current HAL heap base */
BaseAddress = HalpHeapStart;
+ VirtualAddress = BaseAddress;
/* Loop until we have all the pages required */
while (UsedPages < PageCount)
{
- /* Begin a new loop cycle */
- UsedPages = 0;
- VirtualAddress = BaseAddress;
-
/* If this overflows past the HAL heap, it means there's no space */
- if (BaseAddress == NULL) return NULL;
+ if (VirtualAddress == NULL) return NULL;
- /* Loop until we have all the pages required in a single run */
- while (UsedPages < PageCount)
+ /* Get the PTE for this address */
+ PointerPte = HalAddressToPte(VirtualAddress);
+
+ /* Go to the next page */
+ VirtualAddress = (PVOID)((ULONG_PTR)VirtualAddress + PAGE_SIZE);
+
+ /* Check if the page is available */
+ if (PointerPte->Valid)
{
- /* Get the PTE for this address and check if it's available */
- PointerPte = HalAddressToPte(VirtualAddress);
- if (*(PULONG)PointerPte)
- {
- /* PTE has data, skip it and start with a new base address */
- BaseAddress = (PVOID)((ULONG_PTR)VirtualAddress + PAGE_SIZE);
- break;
- }
-
- /* PTE is available, keep going on this run */
- VirtualAddress = (PVOID)((ULONG_PTR)VirtualAddress + PAGE_SIZE);
- UsedPages++;
+ /* PTE has data, skip it and start with a new base address */
+ BaseAddress = VirtualAddress;
+ UsedPages = 0;
+ continue;
}
+
+ /* PTE is available, keep going on this run */
+ UsedPages++;
}
/* Take the base address of the page plus the actual offset in the address */
From c85b9b7fadcb2b026d2c2394a286849df64ad994 Mon Sep 17 00:00:00 2001
From: Gregor Schneider
Date: Mon, 12 Apr 2010 19:43:07 +0000
Subject: [PATCH 108/261] [KERNEL32] Daniel Zimmerman: Update GetShortPathNameW
to Wine See issue #4553 for more details.
svn path=/trunk/; revision=46850
---
reactos/dll/win32/kernel32/file/dir.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/reactos/dll/win32/kernel32/file/dir.c b/reactos/dll/win32/kernel32/file/dir.c
index 97c04470e75..848d4f8f543 100644
--- a/reactos/dll/win32/kernel32/file/dir.c
+++ b/reactos/dll/win32/kernel32/file/dir.c
@@ -741,7 +741,7 @@ GetShortPathNameW (
}
/* check for drive letter */
- if (longpath[1] == ':' )
+ if (longpath[0] != '/' && longpath[1] == ':' )
{
tmpshortpath[0] = longpath[0];
tmpshortpath[1] = ':';
@@ -772,7 +772,7 @@ GetShortPathNameW (
tmplen = p - (longpath + lp);
lstrcpynW(tmpshortpath + sp, longpath + lp, tmplen + 1);
/* Check, if the current element is a valid dos name */
- if (tmplen <= 8+1+3+1)
+ if (tmplen <= 8+1+3)
{
BOOLEAN spaces;
memcpy(ustr_buf, longpath + lp, tmplen * sizeof(WCHAR));
From 846afbdef51f397a8f6b8a26657922a7a5a81ded Mon Sep 17 00:00:00 2001
From: Gregor Schneider
Date: Mon, 12 Apr 2010 19:47:09 +0000
Subject: [PATCH 109/261] [SHELL32] - Add prepared file association failure
text plus some translations from Wine - Prevents completely empty message
boxes See issue #4572 for more details.
svn path=/trunk/; revision=46851
---
reactos/dll/win32/shell32/lang/bg-BG.rc | 2 ++
reactos/dll/win32/shell32/lang/ca-ES.rc | 2 ++
reactos/dll/win32/shell32/lang/cs-CZ.rc | 2 ++
reactos/dll/win32/shell32/lang/da-DK.rc | 2 ++
reactos/dll/win32/shell32/lang/de-DE.rc | 2 ++
reactos/dll/win32/shell32/lang/el-GR.rc | 2 ++
reactos/dll/win32/shell32/lang/en-GB.rc | 2 ++
reactos/dll/win32/shell32/lang/en-US.rc | 2 ++
reactos/dll/win32/shell32/lang/es-ES.rc | 2 ++
reactos/dll/win32/shell32/lang/fi-FI.rc | 2 ++
reactos/dll/win32/shell32/lang/fr-FR.rc | 2 ++
reactos/dll/win32/shell32/lang/hu-HU.rc | 2 ++
reactos/dll/win32/shell32/lang/it-IT.rc | 2 ++
reactos/dll/win32/shell32/lang/ja-JP.rc | 1 +
reactos/dll/win32/shell32/lang/ko-KR.rc | 2 ++
reactos/dll/win32/shell32/lang/nl-NL.rc | 2 ++
reactos/dll/win32/shell32/lang/no-NO.rc | 4 +++-
reactos/dll/win32/shell32/lang/pl-PL.rc | 2 ++
reactos/dll/win32/shell32/lang/pt-BR.rc | 2 ++
reactos/dll/win32/shell32/lang/pt-PT.rc | 2 ++
reactos/dll/win32/shell32/lang/ro-RO.rc | 2 ++
reactos/dll/win32/shell32/lang/ru-RU.rc | 2 ++
reactos/dll/win32/shell32/lang/sk-SK.rc | 2 ++
reactos/dll/win32/shell32/lang/sl-SI.rc | 2 ++
reactos/dll/win32/shell32/lang/sv-SE.rc | 2 ++
reactos/dll/win32/shell32/lang/tr-TR.rc | 2 ++
reactos/dll/win32/shell32/lang/uk-UA.rc | 2 ++
reactos/dll/win32/shell32/lang/zh-CN.rc | 2 ++
reactos/dll/win32/shell32/lang/zh-TW.rc | 2 ++
29 files changed, 58 insertions(+), 1 deletion(-)
diff --git a/reactos/dll/win32/shell32/lang/bg-BG.rc b/reactos/dll/win32/shell32/lang/bg-BG.rc
index 63fe6968565..13a9bdb9f44 100644
--- a/reactos/dll/win32/shell32/lang/bg-BG.rc
+++ b/reactos/dll/win32/shell32/lang/bg-BG.rc
@@ -752,6 +752,8 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "Ïîäðàçáèðàí ðàçïðåäåëèòåëåí ðàçìåð"
IDS_COPY_OF "Copy of"
+
+ IDS_SHLEXEC_NOASSOC "There is no Windows program configured to open this type of file."
END
diff --git a/reactos/dll/win32/shell32/lang/ca-ES.rc b/reactos/dll/win32/shell32/lang/ca-ES.rc
index 567cbc1533b..214028e7d8e 100644
--- a/reactos/dll/win32/shell32/lang/ca-ES.rc
+++ b/reactos/dll/win32/shell32/lang/ca-ES.rc
@@ -751,4 +751,6 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "Default allocation size"
IDS_COPY_OF "Copy of"
+
+ IDS_SHLEXEC_NOASSOC "There is no Windows program configured to open this type of file."
END
diff --git a/reactos/dll/win32/shell32/lang/cs-CZ.rc b/reactos/dll/win32/shell32/lang/cs-CZ.rc
index f2e2dd2aeea..1f4fc948540 100644
--- a/reactos/dll/win32/shell32/lang/cs-CZ.rc
+++ b/reactos/dll/win32/shell32/lang/cs-CZ.rc
@@ -738,4 +738,6 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "Výchozí alokaèní velikost"
IDS_COPY_OF "Kopie "
+
+ IDS_SHLEXEC_NOASSOC "There is no Windows program configured to open this type of file."
END
diff --git a/reactos/dll/win32/shell32/lang/da-DK.rc b/reactos/dll/win32/shell32/lang/da-DK.rc
index baa177f4631..9ad423c95e4 100644
--- a/reactos/dll/win32/shell32/lang/da-DK.rc
+++ b/reactos/dll/win32/shell32/lang/da-DK.rc
@@ -740,4 +740,6 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "Default allocation size"
IDS_COPY_OF "Copy of"
+
+ IDS_SHLEXEC_NOASSOC "There is no Windows program configured to open this type of file."
END
diff --git a/reactos/dll/win32/shell32/lang/de-DE.rc b/reactos/dll/win32/shell32/lang/de-DE.rc
index a07af8785d3..5610af6fa30 100644
--- a/reactos/dll/win32/shell32/lang/de-DE.rc
+++ b/reactos/dll/win32/shell32/lang/de-DE.rc
@@ -755,4 +755,6 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "Standardgröße"
IDS_COPY_OF "Kopie von"
+
+ IDS_SHLEXEC_NOASSOC "Es ist kein Programm mit diesem Dateityp verknüpft."
END
diff --git a/reactos/dll/win32/shell32/lang/el-GR.rc b/reactos/dll/win32/shell32/lang/el-GR.rc
index 4a18d144671..a269d68ed2f 100644
--- a/reactos/dll/win32/shell32/lang/el-GR.rc
+++ b/reactos/dll/win32/shell32/lang/el-GR.rc
@@ -752,4 +752,6 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "Default allocation size"
IDS_COPY_OF "Copy of"
+
+ IDS_SHLEXEC_NOASSOC "There is no Windows program configured to open this type of file."
END
diff --git a/reactos/dll/win32/shell32/lang/en-GB.rc b/reactos/dll/win32/shell32/lang/en-GB.rc
index e25cedd5e08..5d8f02c9a47 100644
--- a/reactos/dll/win32/shell32/lang/en-GB.rc
+++ b/reactos/dll/win32/shell32/lang/en-GB.rc
@@ -751,4 +751,6 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "Default allocation size"
IDS_COPY_OF "Copy of"
+
+ IDS_SHLEXEC_NOASSOC "There is no Windows program configured to open this type of file."
END
diff --git a/reactos/dll/win32/shell32/lang/en-US.rc b/reactos/dll/win32/shell32/lang/en-US.rc
index b24ed529a28..6e8aef34ee0 100644
--- a/reactos/dll/win32/shell32/lang/en-US.rc
+++ b/reactos/dll/win32/shell32/lang/en-US.rc
@@ -751,4 +751,6 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "Default allocation size"
IDS_COPY_OF "Copy of"
+
+ IDS_SHLEXEC_NOASSOC "There is no Windows program configured to open this type of file."
END
diff --git a/reactos/dll/win32/shell32/lang/es-ES.rc b/reactos/dll/win32/shell32/lang/es-ES.rc
index 8bbf95ef8c8..f26e1d4b616 100644
--- a/reactos/dll/win32/shell32/lang/es-ES.rc
+++ b/reactos/dll/win32/shell32/lang/es-ES.rc
@@ -754,4 +754,6 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "Tamaño asignado por defecto"
IDS_COPY_OF "Copia de"
+
+ IDS_SHLEXEC_NOASSOC "There is no Windows program configured to open this type of file."
END
diff --git a/reactos/dll/win32/shell32/lang/fi-FI.rc b/reactos/dll/win32/shell32/lang/fi-FI.rc
index d34a695da49..6469ce1b7b5 100644
--- a/reactos/dll/win32/shell32/lang/fi-FI.rc
+++ b/reactos/dll/win32/shell32/lang/fi-FI.rc
@@ -751,4 +751,6 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "Default allocation size"
IDS_COPY_OF "Copy of"
+
+ IDS_SHLEXEC_NOASSOC "There is no Windows program configured to open this type of file."
END
diff --git a/reactos/dll/win32/shell32/lang/fr-FR.rc b/reactos/dll/win32/shell32/lang/fr-FR.rc
index ae5b34b4973..3d4932fc081 100644
--- a/reactos/dll/win32/shell32/lang/fr-FR.rc
+++ b/reactos/dll/win32/shell32/lang/fr-FR.rc
@@ -755,4 +755,6 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "Taille d'allocation par défaut"
IDS_COPY_OF "Copy of"
+
+ IDS_SHLEXEC_NOASSOC "Aucun programme Windows n'est configuré pour ouvrir ce type de fichier."
END
diff --git a/reactos/dll/win32/shell32/lang/hu-HU.rc b/reactos/dll/win32/shell32/lang/hu-HU.rc
index 79964671b28..e45819a2d47 100644
--- a/reactos/dll/win32/shell32/lang/hu-HU.rc
+++ b/reactos/dll/win32/shell32/lang/hu-HU.rc
@@ -754,4 +754,6 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "Default allocation size"
IDS_COPY_OF "Copy of"
+
+ IDS_SHLEXEC_NOASSOC "There is no Windows program configured to open this type of file."
END
diff --git a/reactos/dll/win32/shell32/lang/it-IT.rc b/reactos/dll/win32/shell32/lang/it-IT.rc
index afddebe5c6f..8372b351e75 100644
--- a/reactos/dll/win32/shell32/lang/it-IT.rc
+++ b/reactos/dll/win32/shell32/lang/it-IT.rc
@@ -752,4 +752,6 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "Dimensione predefinita di allocazione"
IDS_COPY_OF "Copia di"
+
+ IDS_SHLEXEC_NOASSOC "There is no Windows program configured to open this type of file."
END
diff --git a/reactos/dll/win32/shell32/lang/ja-JP.rc b/reactos/dll/win32/shell32/lang/ja-JP.rc
index 3b083005517..c09ba106660 100644
--- a/reactos/dll/win32/shell32/lang/ja-JP.rc
+++ b/reactos/dll/win32/shell32/lang/ja-JP.rc
@@ -751,4 +751,5 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "ƒfƒtƒHƒ‹ƒg ƒAƒƒP[ƒVƒ‡ƒ“ ƒTƒCƒY"
IDS_COPY_OF "ƒRƒs[ `"
+
END
diff --git a/reactos/dll/win32/shell32/lang/ko-KR.rc b/reactos/dll/win32/shell32/lang/ko-KR.rc
index 96f8656e3eb..98981f74213 100644
--- a/reactos/dll/win32/shell32/lang/ko-KR.rc
+++ b/reactos/dll/win32/shell32/lang/ko-KR.rc
@@ -751,4 +751,6 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "Default allocation size"
IDS_COPY_OF "Copy of"
+
+ IDS_SHLEXEC_NOASSOC "There is no Windows program configured to open this type of file."
END
diff --git a/reactos/dll/win32/shell32/lang/nl-NL.rc b/reactos/dll/win32/shell32/lang/nl-NL.rc
index 95c4465e1f5..1689e2a3bae 100644
--- a/reactos/dll/win32/shell32/lang/nl-NL.rc
+++ b/reactos/dll/win32/shell32/lang/nl-NL.rc
@@ -751,4 +751,6 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "Default allocation size"
IDS_COPY_OF "Copy of"
+
+ IDS_SHLEXEC_NOASSOC "Er is geen Windows-programma geconfigureerd om dit soort bestanden te openen."
END
diff --git a/reactos/dll/win32/shell32/lang/no-NO.rc b/reactos/dll/win32/shell32/lang/no-NO.rc
index e659e3f8175..f02aa64fecd 100644
--- a/reactos/dll/win32/shell32/lang/no-NO.rc
+++ b/reactos/dll/win32/shell32/lang/no-NO.rc
@@ -752,6 +752,8 @@ BEGIN
IDS_FONTS "Skrifttyper"
IDS_INSTALLNEWFONT "Installere nye skrifttyper..."
- IDS_DEFAULT_CLUSTER_SIZE "Standard tildelingsstørrelse"
+ IDS_DEFAULT_CLUSTER_SIZE "Standard tildelingsstørrelse"
IDS_COPY_OF "Copy of"
+
+ IDS_SHLEXEC_NOASSOC "Intet Windows-program er satt opp til å åpne denne filtypen."
END
diff --git a/reactos/dll/win32/shell32/lang/pl-PL.rc b/reactos/dll/win32/shell32/lang/pl-PL.rc
index 7ef8add35dc..c9a4d40a48b 100644
--- a/reactos/dll/win32/shell32/lang/pl-PL.rc
+++ b/reactos/dll/win32/shell32/lang/pl-PL.rc
@@ -758,4 +758,6 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "Domyœlny rozmiar jednostki alokacji"
IDS_COPY_OF "Kopia"
+
+ IDS_SHLEXEC_NOASSOC "There is no Windows program configured to open this type of file."
END
diff --git a/reactos/dll/win32/shell32/lang/pt-BR.rc b/reactos/dll/win32/shell32/lang/pt-BR.rc
index a2d235b4883..7679014ff37 100644
--- a/reactos/dll/win32/shell32/lang/pt-BR.rc
+++ b/reactos/dll/win32/shell32/lang/pt-BR.rc
@@ -753,4 +753,6 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "Default allocation size"
IDS_COPY_OF "Copy of"
+
+ IDS_SHLEXEC_NOASSOC "Nici un program Windows nu este configurat sa deschida fi?iere de acest tip."
END
diff --git a/reactos/dll/win32/shell32/lang/pt-PT.rc b/reactos/dll/win32/shell32/lang/pt-PT.rc
index 34f98f578cb..2d99ca47e97 100644
--- a/reactos/dll/win32/shell32/lang/pt-PT.rc
+++ b/reactos/dll/win32/shell32/lang/pt-PT.rc
@@ -754,4 +754,6 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "Tamanho da unidade de atribuição"
IDS_COPY_OF "Cópia de"
+
+ IDS_SHLEXEC_NOASSOC "Não existe um programa Windows configurado para abrir este tipo de ficheiro."
END
diff --git a/reactos/dll/win32/shell32/lang/ro-RO.rc b/reactos/dll/win32/shell32/lang/ro-RO.rc
index a479927320e..fb24c2ba437 100644
--- a/reactos/dll/win32/shell32/lang/ro-RO.rc
+++ b/reactos/dll/win32/shell32/lang/ro-RO.rc
@@ -753,6 +753,8 @@ BEGIN
IDS_INSTALLNEWFONT "Instalare font nou..."
IDS_DEFAULT_CLUSTER_SIZE "Mărime de alocare implicită"
+
+ IDS_SHLEXEC_NOASSOC "There is no Windows program configured to open this type of file."
END
#pragma code_page(default)
diff --git a/reactos/dll/win32/shell32/lang/ru-RU.rc b/reactos/dll/win32/shell32/lang/ru-RU.rc
index d1c3b42f31b..daf4f2ce16b 100644
--- a/reactos/dll/win32/shell32/lang/ru-RU.rc
+++ b/reactos/dll/win32/shell32/lang/ru-RU.rc
@@ -750,4 +750,6 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "Âûäåëÿåìûé ïî óìîë÷àíèþ ðàçìåð"
IDS_COPY_OF "Copy of"
+
+ IDS_SHLEXEC_NOASSOC "There is no Windows program configured to open this type of file."
END
diff --git a/reactos/dll/win32/shell32/lang/sk-SK.rc b/reactos/dll/win32/shell32/lang/sk-SK.rc
index 24867f74690..897564b799a 100644
--- a/reactos/dll/win32/shell32/lang/sk-SK.rc
+++ b/reactos/dll/win32/shell32/lang/sk-SK.rc
@@ -757,4 +757,6 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "Predvolená alokaèná ve¾kos" //Default allocation size
IDS_COPY_OF "Kópia" //Copy of
+
+ IDS_SHLEXEC_NOASSOC "There is no Windows program configured to open this type of file."
END
diff --git a/reactos/dll/win32/shell32/lang/sl-SI.rc b/reactos/dll/win32/shell32/lang/sl-SI.rc
index 3d33693efcd..9789ec3841c 100644
--- a/reactos/dll/win32/shell32/lang/sl-SI.rc
+++ b/reactos/dll/win32/shell32/lang/sl-SI.rc
@@ -751,4 +751,6 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "Default allocation size"
IDS_COPY_OF "Copy of"
+
+ IDS_SHLEXEC_NOASSOC "Noben Okenski program ni nastavljen, da bi odpiral ta tip datotek."
END
diff --git a/reactos/dll/win32/shell32/lang/sv-SE.rc b/reactos/dll/win32/shell32/lang/sv-SE.rc
index 1bc2f6fa121..4ddd5c36520 100644
--- a/reactos/dll/win32/shell32/lang/sv-SE.rc
+++ b/reactos/dll/win32/shell32/lang/sv-SE.rc
@@ -751,4 +751,6 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "Default allocation size"
IDS_COPY_OF "Copy of"
+
+ IDS_SHLEXEC_NOASSOC "There is no Windows program configured to open this type of file."
END
diff --git a/reactos/dll/win32/shell32/lang/tr-TR.rc b/reactos/dll/win32/shell32/lang/tr-TR.rc
index 0ec3378ff17..633936f625a 100644
--- a/reactos/dll/win32/shell32/lang/tr-TR.rc
+++ b/reactos/dll/win32/shell32/lang/tr-TR.rc
@@ -751,4 +751,6 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "Default allocation size"
IDS_COPY_OF "Copy of"
+
+ IDS_SHLEXEC_NOASSOC "There is no Windows program configured to open this type of file."
END
diff --git a/reactos/dll/win32/shell32/lang/uk-UA.rc b/reactos/dll/win32/shell32/lang/uk-UA.rc
index 620bd261f0b..807a7c9afa3 100644
--- a/reactos/dll/win32/shell32/lang/uk-UA.rc
+++ b/reactos/dll/win32/shell32/lang/uk-UA.rc
@@ -752,4 +752,6 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "Ðîçì³ð êëàñòåðà çà ïðîìîâ÷àííÿì"
IDS_COPY_OF "Copy of"
+
+ IDS_SHLEXEC_NOASSOC "There is no Windows program configured to open this type of file."
END
diff --git a/reactos/dll/win32/shell32/lang/zh-CN.rc b/reactos/dll/win32/shell32/lang/zh-CN.rc
index 152903feb42..aa54e3eecb6 100644
--- a/reactos/dll/win32/shell32/lang/zh-CN.rc
+++ b/reactos/dll/win32/shell32/lang/zh-CN.rc
@@ -739,5 +739,7 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "Default allocation size"
IDS_COPY_OF "Copy of"
+
+ IDS_SHLEXEC_NOASSOC "There is no Windows program configured to open this type of file."
END
diff --git a/reactos/dll/win32/shell32/lang/zh-TW.rc b/reactos/dll/win32/shell32/lang/zh-TW.rc
index feb21894ceb..fcf7abf9f7b 100644
--- a/reactos/dll/win32/shell32/lang/zh-TW.rc
+++ b/reactos/dll/win32/shell32/lang/zh-TW.rc
@@ -752,6 +752,8 @@ BEGIN
IDS_DEFAULT_CLUSTER_SIZE "Default allocation size"
IDS_COPY_OF "Copy of"
+
+ IDS_SHLEXEC_NOASSOC "There is no Windows program configured to open this type of file."
END
#pragma code_page(default)
From 195355c7fa1c228e8a976f2a0a4608cb99586e7a Mon Sep 17 00:00:00 2001
From: Sir Richard
Date: Mon, 12 Apr 2010 19:49:32 +0000
Subject: [PATCH 110/261] [NTOS]: Try moving towards new ABI. Lots of debug
spam will be generated by various device node flags in incorrect states, and
hacks that had to be made to maintain current functionality. Also document
things being done at the wrong place. One small step...
svn path=/trunk/; revision=46852
---
reactos/ntoskrnl/io/pnpmgr/pnpmgr.c | 153 +++++++++++++++++++++-------
1 file changed, 116 insertions(+), 37 deletions(-)
diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
index 439795c603a..9fb57d86d18 100644
--- a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
+++ b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
@@ -138,6 +138,114 @@ IopInitializeDevice(PDEVICE_NODE DeviceNode,
return STATUS_SUCCESS;
}
+VOID
+NTAPI
+IopStartDevice2(IN PDEVICE_OBJECT DeviceObject)
+{
+ IO_STACK_LOCATION Stack;
+ PDEVICE_NODE DeviceNode;
+ NTSTATUS Status;
+ PVOID Dummy;
+
+ /* Get the device node */
+ DeviceNode = IopGetDeviceNode(DeviceObject);
+
+ /* Build the I/O stack locaiton */
+ RtlZeroMemory(&Stack, sizeof(IO_STACK_LOCATION));
+ Stack.MajorFunction = IRP_MJ_PNP;
+ Stack.MinorFunction = IRP_MN_START_DEVICE;
+
+ /* Check if we didn't already report the resources */
+ // if (!DeviceNode->Flags & DNF_RESOURCE_REPORTED)
+ {
+ /* Report them */
+ if (DeviceNode->Flags & DNF_RESOURCE_REPORTED)
+ {
+ DPRINT1("Warning: Setting resource pointers even though DNF_RESOURCE_REPORTED is set\n");
+ }
+ Stack.Parameters.StartDevice.AllocatedResources =
+ DeviceNode->ResourceList;
+ Stack.Parameters.StartDevice.AllocatedResourcesTranslated =
+ DeviceNode->ResourceListTranslated;
+ }
+
+ /* I don't think we set this flag yet */
+ ASSERT(!(DeviceNode->Flags & DNF_STOPPED));
+
+ /* Do the call */
+ Status = IopSynchronousCall(DeviceObject, &Stack, &Dummy);
+ if (!NT_SUCCESS(Status))
+ {
+ /* FIXME: TODO */
+ DPRINT1("Warning: PnP Start failed\n");
+ //ASSERT(FALSE);
+ return;
+ }
+
+ /* Otherwise, mark us as started */
+ DeviceNode->Flags |= DNF_STARTED;
+
+ /* We now need enumeration */
+ DeviceNode->Flags |= DNF_NEED_ENUMERATION_ONLY;
+}
+
+NTSTATUS
+NTAPI
+IopStartAndEnumerateDevice(IN PDEVICE_NODE DeviceNode)
+{
+ PDEVICE_OBJECT DeviceObject;
+ NTSTATUS Status;
+ PAGED_CODE();
+
+ /* Sanity check */
+ // ASSERT((DeviceNode->Flags & DNF_ADDED));
+ if (!(DeviceNode->Flags & DNF_ADDED)) DPRINT1("Warning: Starting a device node without DNF_ADDED\n");
+ ASSERT((DeviceNode->Flags & (DNF_RESOURCE_ASSIGNED |
+ DNF_RESOURCE_REPORTED |
+ DNF_NO_RESOURCE_REQUIRED |
+ DNF_NO_RESOURCE_REQUIRED)));
+ ASSERT((!(DeviceNode->Flags & (DNF_HAS_PROBLEM |
+ DNF_STARTED |
+ DNF_START_REQUEST_PENDING))));
+
+ /* Get the device object */
+ DeviceObject = DeviceNode->PhysicalDeviceObject;
+
+ /* Check if we're not started yet */
+ //if (!DeviceNode->Flags & DNF_STARTED)
+ {
+ /* Start us */
+ IopStartDevice2(DeviceObject);
+ }
+
+ /* Do we need to query IDs? This happens in the case of manual reporting */
+ //if (DeviceNode->Flags & DNF_NEED_QUERY_IDS)
+ //{
+ // DPRINT1("Warning: Device node has DNF_NEED_QUERY_IDS\n");
+ /* And that case shouldn't happen yet */
+ // ASSERT(FALSE);
+ //}
+
+ /* Make sure we're started, and check if we need enumeration */
+ if ((DeviceNode->Flags & DNF_STARTED) &&
+ (DeviceNode->Flags & DNF_NEED_ENUMERATION_ONLY))
+ {
+ /* Enumerate us */
+ //Status = IopEnumerateDevice(DeviceObject);
+ IoSynchronousInvalidateDeviceRelations(DeviceObject, BusRelations);
+ IopDeviceNodeClearFlag(DeviceNode, DNF_NEED_ENUMERATION_ONLY);
+ Status = STATUS_SUCCESS;
+ }
+ else
+ {
+ /* Nothing to do */
+ Status = STATUS_SUCCESS;
+ }
+
+ /* Return */
+ return Status;
+}
+
NTSTATUS
IopStartDevice(
PDEVICE_NODE DeviceNode)
@@ -195,47 +303,16 @@ IopStartDevice(
if (!NT_SUCCESS(Status))
goto ByeBye;
- DPRINT("Sending IRP_MN_START_DEVICE to driver\n");
- Stack.Parameters.StartDevice.AllocatedResources = DeviceNode->ResourceList;
- Stack.Parameters.StartDevice.AllocatedResourcesTranslated = DeviceNode->ResourceListTranslated;
-
- /*
- * Windows NT Drivers receive IRP_MN_START_DEVICE in a critical region and
- * actually _depend_ on this!. This is because NT will lock the Device Node
- * with an ERESOURCE, which of course requires APCs to be disabled.
- */
- KeEnterCriticalRegion();
-
- Status = IopInitiatePnpIrp(
- DeviceNode->PhysicalDeviceObject,
- &IoStatusBlock,
- IRP_MN_START_DEVICE,
- &Stack);
-
- KeLeaveCriticalRegion();
-
- if (!NT_SUCCESS(Status))
- {
- DPRINT1("IRP_MN_START_DEVICE failed for %wZ\n", &DeviceNode->InstancePath);
- IopDeviceNodeClearFlag(DeviceNode, DNF_NEED_ENUMERATION_ONLY);
- goto ByeBye;
- }
- else
- {
- if (IopDeviceNodeHasFlag(DeviceNode, DNF_NEED_ENUMERATION_ONLY))
- {
- DPRINT("Device needs enumeration, invalidating bus relations\n");
- /* Invalidate device relations synchronously
- (otherwise there will be dirty read of DeviceNode) */
- IopEnumerateDevice(DeviceNode->PhysicalDeviceObject);
- IopDeviceNodeClearFlag(DeviceNode, DNF_NEED_ENUMERATION_ONLY);
- }
- }
+ /* New PnP ABI */
+ IopStartAndEnumerateDevice(DeviceNode);
+ /* FIX: Should be done in new device instance code */
Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, 0, &InstanceHandle);
if (!NT_SUCCESS(Status))
goto ByeBye;
+ /* FIX: Should be done in IoXxxPrepareDriverLoading */
+ // {
RtlInitUnicodeString(&KeyName, L"Control");
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
@@ -248,7 +325,9 @@ IopStartDevice(
RtlInitUnicodeString(&KeyName, L"ActiveService");
Status = ZwSetValueKey(ControlHandle, &KeyName, 0, REG_SZ, DeviceNode->ServiceName.Buffer, DeviceNode->ServiceName.Length);
-
+ // }
+
+ /* FIX: Should be done somewhere in resoure code? */
if (NT_SUCCESS(Status) && DeviceNode->ResourceList)
{
RtlInitUnicodeString(&KeyName, L"AllocConfig");
From 79fef6c915a259e36dbb1a42026934812d6d81fd Mon Sep 17 00:00:00 2001
From: Gregor Schneider
Date: Mon, 12 Apr 2010 20:13:39 +0000
Subject: [PATCH 111/261] [USERENV] Revert r43057: setting environment
variables per process is not useful here, a higher authority has to do this
globally See issue #4008 for more details.
svn path=/trunk/; revision=46853
---
reactos/dll/win32/userenv/setup.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/reactos/dll/win32/userenv/setup.c b/reactos/dll/win32/userenv/setup.c
index 796325c7b0c..ca422dd5e9f 100644
--- a/reactos/dll/win32/userenv/setup.c
+++ b/reactos/dll/win32/userenv/setup.c
@@ -674,10 +674,6 @@ InitializeProfiles(VOID)
}
}
- SetEnvironmentVariableW(L"ProgramFiles", szProfilesPath);
- SetEnvironmentVariableW(L"CommonProgramFiles", szCommonFilesDirPath);
-
-
DPRINT("Success\n");
return TRUE;
From 31515fdd20fd0b67a4b7989d0b7f6e497e497eaa Mon Sep 17 00:00:00 2001
From: Gregor Schneider
Date: Mon, 12 Apr 2010 20:45:38 +0000
Subject: [PATCH 112/261] [RTL] Revert s(w)printf changes of r44970 See issue
#5125 for more details.
svn path=/trunk/; revision=46855
---
reactos/lib/rtl/sprintf.c | 60 +++++++++++++++++++++++---------------
reactos/lib/rtl/swprintf.c | 58 +++++++++++++++++++++---------------
2 files changed, 71 insertions(+), 47 deletions(-)
diff --git a/reactos/lib/rtl/sprintf.c b/reactos/lib/rtl/sprintf.c
index 42aca6c3511..52f46f8a3d3 100644
--- a/reactos/lib/rtl/sprintf.c
+++ b/reactos/lib/rtl/sprintf.c
@@ -27,33 +27,40 @@
#define SPECIAL 32 /* 0x */
#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */
#define REMOVEHEX 256 /* use 256 as remve 0x frim BASE 16 */
-typedef union {
- struct {
- unsigned int mantissal:32;
- unsigned int mantissah:20;
- unsigned int exponent:11;
- unsigned int sign:1;
- };
- long long AsLongLong;
+typedef struct {
+ unsigned int mantissal:32;
+ unsigned int mantissah:20;
+ unsigned int exponent:11;
+ unsigned int sign:1;
} double_t;
-/* We depend on this being true */
-C_ASSERT(sizeof(double_t) == sizeof(double));
-
static
__inline
int
-_isinf(double_t x)
+_isinf(double __x)
{
- return ( x.exponent == 0x7ff && ( x.mantissah == 0 && x.mantissal == 0 ));
+ union
+ {
+ double* __x;
+ double_t* x;
+ } x;
+
+ x.__x = &__x;
+ return ( x.x->exponent == 0x7ff && ( x.x->mantissah == 0 && x.x->mantissal == 0 ));
}
static
__inline
int
-_isnan(double_t x)
+_isnan(double __x)
{
- return ( x.exponent == 0x7ff && ( x.mantissah != 0 || x.mantissal != 0 ));
+ union
+ {
+ double* __x;
+ double_t* x;
+ } x;
+ x.__x = &__x;
+ return ( x.x->exponent == 0x7ff && ( x.x->mantissah != 0 || x.x->mantissal != 0 ));
}
@@ -173,13 +180,14 @@ number(char * buf, char * end, long long num, int base, int size, int precision,
}
static char *
-numberf(char * buf, char * end, double_t num, int base, int size, int precision, int type)
+numberf(char * buf, char * end, double num, int base, int size, int precision, int type)
{
char c,sign,tmp[66];
const char *digits;
const char *small_digits = "0123456789abcdefghijklmnopqrstuvwxyz";
const char *large_digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int i;
+ long long x;
/* FIXME
the float version of number is direcly copy of number
@@ -193,9 +201,9 @@ numberf(char * buf, char * end, double_t num, int base, int size, int precision,
c = (type & ZEROPAD) ? '0' : ' ';
sign = 0;
if (type & SIGN) {
- if (num.sign) {
+ if (num < 0) {
sign = '-';
- num.sign = 0;
+ num = -num;
size--;
} else if (type & PLUS) {
sign = '+';
@@ -212,11 +220,15 @@ numberf(char * buf, char * end, double_t num, int base, int size, int precision,
size--;
}
i = 0;
- if (num.AsLongLong == 0)
+ if (num == 0)
tmp[i++] = '0';
- else while (num.AsLongLong != 0)
+ else while (num != 0)
{
- tmp[i++] = digits[do_div(&num.AsLongLong,base)];
+ x = num;
+ tmp[i++] = digits[do_div(&x,base)];
+#ifndef _M_ARM // Missing __floatdidf in CeGCC 0.55 -- GCC 4.4
+ num=x;
+#endif
}
if (i > precision)
precision = i;
@@ -377,7 +389,7 @@ int __cdecl _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args)
{
int len;
unsigned long long num;
- double_t _double;
+ double _double;
int base;
char *str, *end;
@@ -591,7 +603,7 @@ int __cdecl _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args)
case 'f':
case 'g':
case 'G':
- _double = va_arg(args, double_t);
+ _double = (double)va_arg(args, double);
if ( _isnan(_double) ) {
s = "Nan";
len = 3;
@@ -622,7 +634,7 @@ int __cdecl _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args)
} else {
if ( precision == -1 )
precision = 6;
- str = numberf(str, end, _double, base, field_width, precision, flags);
+ str = numberf(str, end, (int)_double, base, field_width, precision, flags);
}
continue;
diff --git a/reactos/lib/rtl/swprintf.c b/reactos/lib/rtl/swprintf.c
index 3d6488b92b6..64d7d65397a 100644
--- a/reactos/lib/rtl/swprintf.c
+++ b/reactos/lib/rtl/swprintf.c
@@ -27,33 +27,40 @@
#define SPECIAL 32 /* 0x */
#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */
#define REMOVEHEX 256 /* use 256 as remve 0x frim BASE 16 */
-typedef union {
- struct {
- unsigned int mantissal:32;
- unsigned int mantissah:20;
- unsigned int exponent:11;
- unsigned int sign:1;
- };
- long long AsLongLong;
+typedef struct {
+ unsigned int mantissal:32;
+ unsigned int mantissah:20;
+ unsigned int exponent:11;
+ unsigned int sign:1;
} double_t;
-/* We depend on this being true */
-C_ASSERT(sizeof(double_t) == sizeof(double));
-
static
__inline
int
-_isinf(double_t x)
+_isinf(double __x)
{
- return ( x.exponent == 0x7ff && ( x.mantissah == 0 && x.mantissal == 0 ));
+ union
+ {
+ double* __x;
+ double_t* x;
+ } x;
+
+ x.__x = &__x;
+ return ( x.x->exponent == 0x7ff && ( x.x->mantissah == 0 && x.x->mantissal == 0 ));
}
static
__inline
int
-_isnan(double_t x)
+_isnan(double __x)
{
- return ( x.exponent == 0x7ff && ( x.mantissah != 0 || x.mantissal != 0 ));
+ union
+ {
+ double* __x;
+ double_t* x;
+ } x;
+ x.__x = &__x;
+ return ( x.x->exponent == 0x7ff && ( x.x->mantissah != 0 || x.x->mantissal != 0 ));
}
@@ -172,13 +179,14 @@ number(wchar_t * buf, wchar_t * end, long long num, int base, int size, int prec
}
static wchar_t *
-numberf(wchar_t * buf, wchar_t * end, double_t num, int base, int size, int precision, int type)
+numberf(wchar_t * buf, wchar_t * end, double num, int base, int size, int precision, int type)
{
wchar_t c, sign, tmp[66];
const wchar_t *digits;
const wchar_t *small_digits = L"0123456789abcdefghijklmnopqrstuvwxyz";
const wchar_t *large_digits = L"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int i;
+ long long x;
/* FIXME
the float version of number is direcly copy of number
@@ -193,9 +201,9 @@ numberf(wchar_t * buf, wchar_t * end, double_t num, int base, int size, int prec
c = (type & ZEROPAD) ? L'0' : L' ';
sign = 0;
if (type & SIGN) {
- if (num.sign) {
+ if (num < 0) {
sign = L'-';
- num.sign = 0;
+ num = -num;
size--;
} else if (type & PLUS) {
sign = L'+';
@@ -212,11 +220,15 @@ numberf(wchar_t * buf, wchar_t * end, double_t num, int base, int size, int prec
size--;
}
i = 0;
- if (num.AsLongLong == 0)
+ if (num == 0)
tmp[i++] = L'0';
- else while (num.AsLongLong != 0)
+ else while (num != 0)
{
- tmp[i++] = digits[do_div(&num.AsLongLong,base)];
+ x = num;
+ tmp[i++] = digits[do_div(&x,base)];
+#ifndef _M_ARM // Missing __floatdidf in CeGCC 0.55 -- GCC 4.4
+ num = x;
+#endif
}
if (i > precision)
precision = i;
@@ -382,7 +394,7 @@ int __cdecl _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list ar
const char *s;
const wchar_t *sw;
const wchar_t *ss;
- double_t _double;
+ double _double;
int flags; /* flags to number() */
@@ -588,7 +600,7 @@ int __cdecl _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list ar
case 'f':
case 'g':
case 'G':
- _double = va_arg(args, double_t);
+ _double = (double)va_arg(args, double);
if ( _isnan(_double) ) {
ss = L"Nan";
From de40f8d7d76e7ae9c96d5159065dbf488b79f296 Mon Sep 17 00:00:00 2001
From: Timo Kreuzer
Date: Mon, 12 Apr 2010 22:28:22 +0000
Subject: [PATCH 113/261] [FREELDR] - Don't prefix amd64 symbol names with
underscores - Cleanup unused amd64 functions - Fix amd64 GDT entries - Fix
amd64 APIC_BASE
svn path=/trunk/; revision=46856
---
.../boot/freeldr/freeldr/arch/amd64/arch.S | 76 +++---
.../boot/freeldr/freeldr/arch/amd64/boot.S | 6 +-
.../boot/freeldr/freeldr/arch/amd64/drvmap.S | 8 +-
.../boot/freeldr/freeldr/arch/amd64/i386cpu.S | 6 +-
.../boot/freeldr/freeldr/arch/amd64/i386pnp.S | 6 +-
.../freeldr/freeldr/arch/amd64/i386trap.S | 4 +-
.../boot/freeldr/freeldr/arch/amd64/int386.S | 2 +-
.../boot/freeldr/freeldr/arch/amd64/loader.c | 246 +-----------------
reactos/boot/freeldr/freeldr/arch/amd64/mb.S | 24 +-
.../freeldr/include/arch/amd64/amd64.h | 2 +-
.../freeldr/freeldr/windows/amd64/wlmemory.c | 39 +--
11 files changed, 89 insertions(+), 330 deletions(-)
diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/arch.S b/reactos/boot/freeldr/freeldr/arch/amd64/arch.S
index 0f6c257e34a..9def109221c 100644
--- a/reactos/boot/freeldr/freeldr/arch/amd64/arch.S
+++ b/reactos/boot/freeldr/freeldr/arch/amd64/arch.S
@@ -21,22 +21,22 @@ RealEntryPoint:
mov ss, ax
/* checkPoint Charlie - where it all began... */
- mov si, offset _CheckPoint0
+ mov si, offset CheckPoint0
call writestr
-
+
/* Setup a real mode stack */
mov sp, stack16
/* Zero BootDrive and BootPartition */
xor eax, eax
- mov _BootDrive, eax
- mov _BootPartition, eax
+ mov BootDrive, eax
+ mov BootPartition, eax
/* Store the boot drive */
- mov _BootDrive, dl
+ mov BootDrive, dl
/* Store the boot partition */
- mov _BootPartition, dh
+ mov BootPartition, dh
/* Load the GDT */
lgdt gdtptr
@@ -46,13 +46,13 @@ RealEntryPoint:
call x86_16_EnableA20
/* checkPoint Charlie - where it all began... */
- mov si, offset _CheckPoint1
+ mov si, offset CheckPoint1
call writestr
call x86_16_BuildPageTables
/* checkPoint Charlie - where it all began... */
- mov si, offset _CheckPoint2
+ mov si, offset CheckPoint2
call writestr
/* Check if CPU supports CPUID */
@@ -89,26 +89,26 @@ RealEntryPoint:
/* X64 Processor */
/* checkPoint Charlie - where it all began... */
- mov si, offset _CheckPoint3
+ mov si, offset CheckPoint3
call writestr
- jmp _switch64
+ jmp switch64
NO_X64_SUPPORT_DETECTED:
- mov si, offset _NotAnX64Processor // Loading message
+ mov si, offset NotAnX64Processor // Loading message
call writestr
- jmp _fail
+ jmp fail
NO_CPUID_SUPPORT_DETECTED:
- mov si, offset _NoCPUIDSupport // Loading message
- call writestr
+ mov si, offset NoCPUIDSupport // Loading message
+ call writestr
-_fail:
- jmp _fail
+fail:
+ jmp fail
nop
nop
-_switch64:
+switch64:
call x86_16_SwitchToLong
.code64
@@ -119,7 +119,7 @@ _switch64:
/* GO! */
xor rcx, rcx
- call _BootMain
+ call BootMain
/* Checkpoint */
// mov ax, LMODE_DS
@@ -174,14 +174,14 @@ x86_16_BuildPageTables:
push es
/* Get segment of pml4 */
- mov eax, offset _pml4_startup
+ mov eax, offset pml4_startup
shr eax, 4
mov es, ax
cld
xor di, di
/* One entry in the PML4 pointing to PDP */
- mov eax, offset _pdp_startup
+ mov eax, offset pdp_startup
or eax, 0x00f
stosd
/* clear rest */
@@ -190,7 +190,7 @@ x86_16_BuildPageTables:
rep stosd
/* One entry in the PDP pointing to PD */
- mov eax, offset _pd_startup
+ mov eax, offset pd_startup
or eax, 0x00f
stosd
/* clear rest */
@@ -268,7 +268,7 @@ x86_16_SwitchToLong:
mov eax, 0x00a0 // Set PAE and PGE: 10100000b
mov cr4, eax
- mov edx, offset _pml4_startup // Point cr3 at PML4
+ mov edx, offset pml4_startup // Point cr3 at PML4
mov cr3, edx
mov ecx, 0xC0000080 // Specify EFER MSR
@@ -405,42 +405,42 @@ gdtptr:
.long gdt /* Base Address */
-.global _BootDrive
-_BootDrive:
+.global BootDrive
+BootDrive:
.long 0
-.global _BootPartition
-_BootPartition:
+.global BootPartition
+BootPartition:
.long 0
-.global _NotAnX64Processor
-_NotAnX64Processor:
+.global NotAnX64Processor
+NotAnX64Processor:
.ascii "FreeLoader: No x64-compatible CPU detected! Exiting..."
.byte 0x0d, 0x0a, 0
-.global _NoCPUIDSupport
-_NoCPUIDSupport:
+.global NoCPUIDSupport
+NoCPUIDSupport:
.ascii "FreeLoader: No CPUID instruction support detected! Exiting..."
.byte 0x0d, 0x0a, 0
/////////////////////////// Checkpoint messages ///////////////////////////////
-.global _CheckPoint0
-_CheckPoint0:
+.global CheckPoint0
+CheckPoint0:
.ascii "Starting FreeLoader..."
.byte 0x0d, 0x0a, 0
-.global _CheckPoint1
-_CheckPoint1:
+.global CheckPoint1
+CheckPoint1:
.ascii "FreeLoader[16-bit]: building page tables..."
.byte 0x0d, 0x0a, 0
-.global _CheckPoint2
-_CheckPoint2:
+.global CheckPoint2
+CheckPoint2:
.ascii "FreeLoader[16-bit]: checking CPU for x64 long mode..."
.byte 0x0d, 0x0a, 0
-.global _CheckPoint3
-_CheckPoint3:
+.global CheckPoint3
+CheckPoint3:
.ascii "FreeLoader: Switching to x64 long mode..."
.byte 0x0d, 0x0a, 0
diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/boot.S b/reactos/boot/freeldr/freeldr/arch/amd64/boot.S
index ce7bb355c90..eb3ba3c3c64 100644
--- a/reactos/boot/freeldr/freeldr/arch/amd64/boot.S
+++ b/reactos/boot/freeldr/freeldr/arch/amd64/boot.S
@@ -24,14 +24,14 @@
#include
-EXTERN(_ChainLoadBiosBootSectorCode)
+EXTERN(ChainLoadBiosBootSectorCode)
.code64
call x86_64_SwitchToReal
.code16
/* Set the boot drive */
- mov dl, _BootDrive
+ mov dl, BootDrive
/* Load segment registers */
cli
@@ -46,7 +46,7 @@ EXTERN(_ChainLoadBiosBootSectorCode)
// ljmpl $0x0000,$0x7C00
jmp 0x7c00:0x0000
-EXTERN(_SoftReboot)
+EXTERN(SoftReboot)
.code64
call x86_64_SwitchToReal
diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/drvmap.S b/reactos/boot/freeldr/freeldr/arch/amd64/drvmap.S
index d6b081ca60b..6871fe0f62d 100644
--- a/reactos/boot/freeldr/freeldr/arch/amd64/drvmap.S
+++ b/reactos/boot/freeldr/freeldr/arch/amd64/drvmap.S
@@ -24,7 +24,7 @@
#include
-EXTERN(_DriveMapInt13HandlerStart)
+EXTERN(DriveMapInt13HandlerStart)
Int13Handler:
pushw %bp
@@ -82,7 +82,7 @@ CallOldInt13Handler:
/* Call old int 13h handler with new drive number */
.byte 0x9a /* lcall */
-EXTERN(_DriveMapOldInt13HandlerAddress)
+EXTERN(DriveMapOldInt13HandlerAddress)
.word 0
.word 0
@@ -105,7 +105,7 @@ CallersFlags:
PassedInDriveNumber:
.byte 0
-EXTERN(_DriveMapInt13HandlerMapList)
+EXTERN(DriveMapInt13HandlerMapList)
Int13HandlerMapCount:
.byte 0
@@ -129,4 +129,4 @@ Int13HandlerDrive4:
Int13HandlerDriveNew4:
.byte 0
-EXTERN(_DriveMapInt13HandlerEnd)
+EXTERN(DriveMapInt13HandlerEnd)
diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/i386cpu.S b/reactos/boot/freeldr/freeldr/arch/amd64/i386cpu.S
index 6dfb91dbf4a..ee3ee6fe256 100644
--- a/reactos/boot/freeldr/freeldr/arch/amd64/i386cpu.S
+++ b/reactos/boot/freeldr/freeldr/arch/amd64/i386cpu.S
@@ -33,7 +33,7 @@
* 0x00000400: Found 80486 CPU without CPUID support
*/
-EXTERN(_CpuidSupported)
+EXTERN(CpuidSupported)
.code32
pushl %ecx /* save ECX */
@@ -80,7 +80,7 @@ NoCpuid:
* VOID GetCpuid(U32 Level, U32 *eax, U32 *ebx, U32 *ecx, U32 *edx);
*/
-EXTERN(_GetCpuid)
+EXTERN(GetCpuid)
.code32
pushl %ebp
@@ -123,7 +123,7 @@ EXTERN(_GetCpuid)
* U64 RDTSC(VOID);
*/
-EXTERN(_RDTSC)
+EXTERN(RDTSC)
.code32
rdtsc
ret
diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/i386pnp.S b/reactos/boot/freeldr/freeldr/arch/amd64/i386pnp.S
index ff0ae71eb1a..19589275bac 100644
--- a/reactos/boot/freeldr/freeldr/arch/amd64/i386pnp.S
+++ b/reactos/boot/freeldr/freeldr/arch/amd64/i386pnp.S
@@ -35,7 +35,7 @@ _pnp_bios_entry_point:
_pnp_bios_data_segment:
.word 0
-EXTERN(_PnpBiosSupported)
+EXTERN(PnpBiosSupported)
.code64
push rdi
@@ -113,7 +113,7 @@ _pnp_node_size:
_pnp_node_count:
.word 0
-EXTERN(_PnpBiosGetDeviceNodeCount)
+EXTERN(PnpBiosGetDeviceNodeCount)
.code64
push rbp
@@ -182,7 +182,7 @@ _pnp_buffer_offset:
_pnp_node_number:
.byte 0
-EXTERN(_PnpBiosGetDeviceNode)
+EXTERN(PnpBiosGetDeviceNode)
.code64
push rbp
diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/i386trap.S b/reactos/boot/freeldr/freeldr/arch/amd64/i386trap.S
index 833fcc37104..195bf097cd0 100644
--- a/reactos/boot/freeldr/freeldr/arch/amd64/i386trap.S
+++ b/reactos/boot/freeldr/freeldr/arch/amd64/i386trap.S
@@ -273,7 +273,7 @@ i386CommonExceptionHandler:
SAVE_CPU_REGS
pushl $SCREEN_ATTR
- call _MachVideoClearScreen
+ call MachVideoClearScreen
add $4,%esp
movl $i386ExceptionHandlerText,%esi
@@ -485,7 +485,7 @@ i386PrintChar:
pushl $SCREEN_ATTR
andl $0xff,%eax
pushl %eax
- call _MachVideoPutChar
+ call MachVideoPutChar
addl $16,%esp
ret
diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/int386.S b/reactos/boot/freeldr/freeldr/arch/amd64/int386.S
index 1c1f2dbdf0a..a22e409c61c 100644
--- a/reactos/boot/freeldr/freeldr/arch/amd64/int386.S
+++ b/reactos/boot/freeldr/freeldr/arch/amd64/int386.S
@@ -63,7 +63,7 @@ Int386_regsout:
/*
* int Int386(int ivec, REGS* in, REGS* out);
*/
-EXTERN(_Int386)
+EXTERN(Int386)
.code64
/* Get the function parameters */
diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/loader.c b/reactos/boot/freeldr/freeldr/arch/amd64/loader.c
index 9ca6f858644..cad77bf48d6 100644
--- a/reactos/boot/freeldr/freeldr/arch/amd64/loader.c
+++ b/reactos/boot/freeldr/freeldr/arch/amd64/loader.c
@@ -39,33 +39,6 @@ EnableA20()
/* Already done */
}
-void
-DumpLoaderBlock()
-{
- DbgPrint("LoaderBlock @ %p.\n", &LoaderBlock);
- DbgPrint("Flags = 0x%x.\n", LoaderBlock.Flags);
- DbgPrint("MemLower = 0x%p.\n", (PVOID)LoaderBlock.MemLower);
- DbgPrint("MemHigher = 0x%p.\n", (PVOID)LoaderBlock.MemHigher);
- DbgPrint("BootDevice = 0x%x.\n", LoaderBlock.BootDevice);
- DbgPrint("CommandLine = %s.\n", LoaderBlock.CommandLine);
- DbgPrint("ModsCount = 0x%x.\n", LoaderBlock.ModsCount);
- DbgPrint("ModsAddr = 0x%p.\n", LoaderBlock.ModsAddr);
- DbgPrint("Syms = 0x%s.\n", LoaderBlock.Syms);
- DbgPrint("MmapLength = 0x%x.\n", LoaderBlock.MmapLength);
- DbgPrint("MmapAddr = 0x%p.\n", (PVOID)LoaderBlock.MmapAddr);
- DbgPrint("RdLength = 0x%x.\n", LoaderBlock.RdLength);
- DbgPrint("RdAddr = 0x%p.\n", (PVOID)LoaderBlock.RdAddr);
- DbgPrint("DrivesCount = 0x%x.\n", LoaderBlock.DrivesCount);
- DbgPrint("DrivesAddr = 0x%p.\n", (PVOID)LoaderBlock.DrivesAddr);
- DbgPrint("ConfigTable = 0x%x.\n", LoaderBlock.ConfigTable);
- DbgPrint("BootLoaderName = 0x%x.\n", LoaderBlock.BootLoaderName);
- DbgPrint("PageDirectoryStart = 0x%p.\n", (PVOID)LoaderBlock.PageDirectoryStart);
- DbgPrint("PageDirectoryEnd = 0x%p.\n", (PVOID)LoaderBlock.PageDirectoryEnd);
- DbgPrint("KernelBase = 0x%p.\n", (PVOID)LoaderBlock.KernelBase);
- DbgPrint("ArchExtra = 0x%p.\n", (PVOID)LoaderBlock.ArchExtra);
-
-}
-
/*++
* FrLdrStartup
* INTERNAL
@@ -86,222 +59,7 @@ VOID
NTAPI
FrLdrStartup(ULONG Magic)
{
- /* Disable Interrupts */
- _disable();
-
- /* Re-initalize EFLAGS */
- __writeeflags(0);
-
- /* Initialize the page directory */
- FrLdrSetupPageDirectory();
-
- /* Set the new PML4 */
- __writecr3((ULONGLONG)pPML4);
-
- FrLdrSetupGdtIdt();
-
- LoaderBlock.FrLdrDbgPrint = DbgPrint;
-
-// DumpLoaderBlock();
-
- DbgPrint("Jumping to kernel @ %p.\n", KernelEntryPoint);
-
- /* Jump to Kernel */
- (*KernelEntryPoint)(Magic, &LoaderBlock);
-
+ DbgPrint("ReactOS loader is unsupported! Halting.\n", KernelEntryPoint);
+ for(;;);
}
-PPAGE_DIRECTORY_AMD64
-FrLdrGetOrCreatePageDir(PPAGE_DIRECTORY_AMD64 pDir, ULONG Index)
-{
- PPAGE_DIRECTORY_AMD64 pSubDir;
-
- if (!pDir)
- return NULL;
-
- if (!pDir->Pde[Index].Valid)
- {
- pSubDir = MmAllocateMemoryWithType(PAGE_SIZE, LoaderSpecialMemory);
- if (!pSubDir)
- return NULL;
- RtlZeroMemory(pSubDir, PAGE_SIZE);
- pDir->Pde[Index].PageFrameNumber = PtrToPfn(pSubDir);
- pDir->Pde[Index].Valid = 1;
- pDir->Pde[Index].Write = 1;
- }
- else
- {
- pSubDir = (PPAGE_DIRECTORY_AMD64)((ULONGLONG)(pDir->Pde[Index].PageFrameNumber) * PAGE_SIZE);
- }
- return pSubDir;
-}
-
-BOOLEAN
-FrLdrMapSinglePage(ULONGLONG VirtualAddress, ULONGLONG PhysicalAddress)
-{
- PPAGE_DIRECTORY_AMD64 pDir3, pDir2, pDir1;
- ULONG Index;
-
- pDir3 = FrLdrGetOrCreatePageDir(pPML4, VAtoPXI(VirtualAddress));
- pDir2 = FrLdrGetOrCreatePageDir(pDir3, VAtoPPI(VirtualAddress));
- pDir1 = FrLdrGetOrCreatePageDir(pDir2, VAtoPDI(VirtualAddress));
-
- if (!pDir1)
- return FALSE;
-
- Index = VAtoPTI(VirtualAddress);
- if (pDir1->Pde[Index].Valid)
- {
- return FALSE;
- }
-
- pDir1->Pde[Index].Valid = 1;
- pDir1->Pde[Index].Write = 1;
- pDir1->Pde[Index].PageFrameNumber = PhysicalAddress / PAGE_SIZE;
-
- return TRUE;
-}
-
-ULONG
-FrLdrMapRangeOfPages(ULONGLONG VirtualAddress, ULONGLONG PhysicalAddress, ULONG cPages)
-{
- ULONG i;
-
- for (i = 0; i < cPages; i++)
- {
- if (!FrLdrMapSinglePage(VirtualAddress, PhysicalAddress))
- {
- return i;
- }
- VirtualAddress += PAGE_SIZE;
- PhysicalAddress += PAGE_SIZE;
- }
- return i;
-}
-
-
-/*++
- * FrLdrSetupPageDirectory
- * INTERNAL
- *
- * Sets up the ReactOS Startup Page Directory.
- *
- * Params:
- * None.
- *
- * Returns:
- * None.
- *--*/
-VOID
-FASTCALL
-FrLdrSetupPageDirectory(VOID)
-{
- ULONG KernelPages;
- PVOID UserSharedData;
-
- /* Allocate a Page for the PML4 */
- pPML4 = MmAllocateMemoryWithType(PAGE_SIZE, LoaderSpecialMemory);
-
- ASSERT(pPML4);
-
- /* The page tables are located at 0xfffff68000000000
- * We create a recursive self mapping through all 4 levels at
- * virtual address 0xfffff6fb7dbedf68 */
- pPML4->Pde[VAtoPXI(PXE_BASE)].Valid = 1;
- pPML4->Pde[VAtoPXI(PXE_BASE)].Write = 1;
- pPML4->Pde[VAtoPXI(PXE_BASE)].PageFrameNumber = PtrToPfn(pPML4);
-
- /* Setup low memory pages */
- if (FrLdrMapRangeOfPages(0, 0, 1024) < 1024)
- {
- DbgPrint("Could not map low memory pages.\n");
- }
-
- /* Setup kernel pages */
- KernelPages = (ROUND_TO_PAGES(NextModuleBase - KERNEL_BASE_PHYS) / PAGE_SIZE);
- if (FrLdrMapRangeOfPages(KernelBase, KERNEL_BASE_PHYS, KernelPages) != KernelPages)
- {
- DbgPrint("Could not map %d kernel pages.\n", KernelPages);
- }
-
- /* Setup a page for the idt */
- pIdt = MmAllocateMemoryWithType(PAGE_SIZE, LoaderSpecialMemory);
- IdtBase = KernelBase + KernelPages * PAGE_SIZE;
- if (!FrLdrMapSinglePage(IdtBase, (ULONGLONG)pIdt))
- {
- DbgPrint("Could not map idt page.\n", KernelPages);
- }
-
- /* Setup a page for the gdt & tss */
- pGdt = MmAllocateMemoryWithType(PAGE_SIZE, LoaderSpecialMemory);
- GdtBase = IdtBase + PAGE_SIZE;
- TssBase = GdtBase + 20 * sizeof(ULONG64); // FIXME: don't hardcode
- if (!FrLdrMapSinglePage(GdtBase, (ULONGLONG)pGdt))
- {
- DbgPrint("Could not map gdt page.\n", KernelPages);
- }
-
- /* Setup KUSER_SHARED_DATA page */
- UserSharedData = MmAllocateMemoryWithType(PAGE_SIZE, LoaderSpecialMemory);
- if (!FrLdrMapSinglePage(KI_USER_SHARED_DATA, (ULONG64)UserSharedData))
- {
- DbgPrint("Could not map KUSER_SHARED_DATA page.\n", KernelPages);
- }
-
- /* Map APIC page */
- if (!FrLdrMapSinglePage(APIC_BASE, APIC_PHYS_BASE))
- {
- DbgPrint("Could not map APIC page.\n");
- }
-
-}
-
-VOID
-FrLdrSetupGdtIdt()
-{
- PKGDTENTRY64 Entry;
- KDESCRIPTOR Desc;
-
- RtlZeroMemory(pGdt, PAGE_SIZE);
-
- /* Setup KGDT_64_R0_CODE */
- Entry = KiGetGdtEntry(pGdt, KGDT_64_R0_CODE);
- *(PULONG64)Entry = 0x00209b0000000000ULL;
-
- /* Setup KGDT_64_R0_SS */
- Entry = KiGetGdtEntry(pGdt, KGDT_64_R0_SS);
- *(PULONG64)Entry = 0x00cf93000000ffffULL;
-
- /* Setup KGDT_64_DATA */
- Entry = KiGetGdtEntry(pGdt, KGDT_64_DATA);
- *(PULONG64)Entry = 0x00cff3000000ffffULL;
-
- /* Setup KGDT_64_R3_CODE */
- Entry = KiGetGdtEntry(pGdt, KGDT_64_R3_CODE);
- *(PULONG64)Entry = 0x0020fb0000000000ULL;
-
- /* Setup KGDT_32_R3_TEB */
- Entry = KiGetGdtEntry(pGdt, KGDT_32_R3_TEB);
- *(PULONG64)Entry = 0xff40f3fd50003c00ULL;
-
- /* Setup TSS entry */
- Entry = KiGetGdtEntry(pGdt, KGDT_TSS);
- KiInitGdtEntry(Entry, TssBase, sizeof(KTSS), I386_TSS, 0);
-
- /* Setup the gdt descriptor */
- Desc.Limit = 12 * sizeof(ULONG64) - 1;
- Desc.Base = (PVOID)GdtBase;
-
- /* Set the new Gdt */
- __lgdt(&Desc.Limit);
- DbgPrint("Gdtr.Base = %p\n", Desc.Base);
-
- /* Setup the idt descriptor */
- Desc.Limit = 12 * sizeof(ULONG64) - 1;
- Desc.Base = (PVOID)IdtBase;
-
- /* Set the new Idt */
- __lidt(&Desc.Limit);
- DbgPrint("Idtr.Base = %p\n", Desc.Base);
-
-}
diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/mb.S b/reactos/boot/freeldr/freeldr/arch/amd64/mb.S
index 368338ed33b..2d515e90053 100644
--- a/reactos/boot/freeldr/freeldr/arch/amd64/mb.S
+++ b/reactos/boot/freeldr/freeldr/arch/amd64/mb.S
@@ -29,35 +29,35 @@
* This boots the kernel
*/
.code64
- .globl _PageDirectoryStart
+ .globl PageDirectoryStart
- .globl _pml4_startup
- .globl _pdp_startup
- .globl _pd_startup
+ .globl pml4_startup
+ .globl pdp_startup
+ .globl pd_startup
- .globl _PageDirectoryEnd
+ .globl PageDirectoryEnd
//
// Boot information structure
//
-EXTERN(_reactos_memory_map_descriptor_size)
+EXTERN(reactos_memory_map_descriptor_size)
.long 0
-EXTERN(_reactos_memory_map)
+EXTERN(reactos_memory_map)
.rept (32 * /*sizeof(memory_map_t)*/24)
.byte 0
.endr
.bss
-_PageDirectoryStart:
-_pml4_startup:
+PageDirectoryStart:
+pml4_startup:
.fill 4096, 1, 0
-_pdp_startup:
+pdp_startup:
.fill 4096, 1, 0
-_pd_startup:
+pd_startup:
.fill 4096, 1, 0
-_PageDirectoryEnd:
+PageDirectoryEnd:
diff --git a/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h b/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h
index af46178d9db..9068e00f90a 100644
--- a/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h
+++ b/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h
@@ -45,7 +45,7 @@
#define HYPERSPACE_BASE 0xfffff70000000000ULL
#define HAL_BASE 0xffffffff80000000ULL
-#define APIC_BASE 0xfffffffffee00000ULL // FIXME
+#define APIC_BASE 0xFFFFFFFFFFFE0000ULL
#define APIC_PHYS_BASE 0xfee00000
diff --git a/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c b/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c
index 3e3288a682a..5f979c4ca7b 100644
--- a/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c
+++ b/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c
@@ -252,28 +252,36 @@ WinLdrSetupGdt(PVOID GdtBase, ULONG64 TssBase)
PKGDTENTRY64 Entry;
KDESCRIPTOR GdtDesc;
- /* Setup KGDT_64_R0_CODE */
- Entry = KiGetGdtEntry(GdtBase, KGDT_64_R0_CODE);
+ /* Setup KGDT64_NULL */
+ Entry = KiGetGdtEntry(GdtBase, KGDT64_NULL);
+ *(PULONG64)Entry = 0x0000000000000000ULL;
+
+ /* Setup KGDT64_R0_CODE */
+ Entry = KiGetGdtEntry(GdtBase, KGDT64_R0_CODE);
*(PULONG64)Entry = 0x00209b0000000000ULL;
- /* Setup KGDT_64_R0_SS */
- Entry = KiGetGdtEntry(GdtBase, KGDT_64_R0_SS);
+ /* Setup KGDT64_R0_DATA */
+ Entry = KiGetGdtEntry(GdtBase, KGDT64_R0_DATA);
*(PULONG64)Entry = 0x00cf93000000ffffULL;
- /* Setup KGDT_64_DATA */
- Entry = KiGetGdtEntry(GdtBase, KGDT_64_DATA);
+ /* Setup KGDT64_R3_CMCODE */
+ Entry = KiGetGdtEntry(GdtBase, KGDT64_R3_CMCODE);
+ *(PULONG64)Entry = 0x00cffb000000ffffULL;
+
+ /* Setup KGDT64_R3_DATA */
+ Entry = KiGetGdtEntry(GdtBase, KGDT64_R3_DATA);
*(PULONG64)Entry = 0x00cff3000000ffffULL;
- /* Setup KGDT_64_R3_CODE */
- Entry = KiGetGdtEntry(GdtBase, KGDT_64_R3_CODE);
+ /* Setup KGDT64_R3_CODE */
+ Entry = KiGetGdtEntry(GdtBase, KGDT64_R3_CODE);
*(PULONG64)Entry = 0x0020fb0000000000ULL;
- /* Setup KGDT_32_R3_TEB */
- Entry = KiGetGdtEntry(GdtBase, KGDT_32_R3_TEB);
+ /* Setup KGDT64_R3_CMTEB */
+ Entry = KiGetGdtEntry(GdtBase, KGDT64_R3_CMTEB);
*(PULONG64)Entry = 0xff40f3fd50003c00ULL;
/* Setup TSS entry */
- Entry = KiGetGdtEntry(GdtBase, KGDT_TSS);
+ Entry = KiGetGdtEntry(GdtBase, KGDT64_SYS_TSS);
KiInitGdtEntry(Entry, TssBase, sizeof(KTSS), I386_TSS, 0);
/* Setup GDT descriptor */
@@ -333,15 +341,8 @@ WinLdrSetProcessorContext(PVOID GdtIdt, IN ULONG64 Pcr, IN ULONG64 Tss)
/* LDT is unused */
// __lldt(0);
- /* Load selectors for DS/ES/FS/GS/SS */
- Ke386SetDs(KGDT_64_DATA | RPL_MASK); // 0x2b
- Ke386SetEs(KGDT_64_DATA | RPL_MASK); // 0x2b
- Ke386SetFs(KGDT_32_R3_TEB | RPL_MASK); // 0x53
- Ke386SetGs(KGDT_64_DATA | RPL_MASK); // 0x2b
- Ke386SetSs(KGDT_64_R0_SS); // 0x18
-
/* Load TSR */
- __ltr(KGDT_TSS);
+ __ltr(KGDT64_SYS_TSS);
DPRINTM(DPRINT_WINDOWS, "leave WinLdrSetProcessorContext\n");
}
From e24364da67dfc58f812949019f9412114691aa14 Mon Sep 17 00:00:00 2001
From: Timo Kreuzer
Date: Mon, 12 Apr 2010 22:31:42 +0000
Subject: [PATCH 114/261] [NDK] - Fix KGDT64 selector names
svn path=/trunk/; revision=46857
---
reactos/include/ndk/amd64/ketypes.h | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/reactos/include/ndk/amd64/ketypes.h b/reactos/include/ndk/amd64/ketypes.h
index b57242055d4..8e4d4215514 100644
--- a/reactos/include/ndk/amd64/ketypes.h
+++ b/reactos/include/ndk/amd64/ketypes.h
@@ -58,12 +58,14 @@ Author:
//
#define RPL_MASK 0x0003
#define MODE_MASK 0x0001
-#define KGDT_64_R0_CODE 0x0010
-#define KGDT_64_R0_SS 0x0018
-#define KGDT_64_DATA 0x0028 // 2b
-#define KGDT_64_R3_CODE 0x0030 // 33
-#define KGDT_TSS 0x0040
-#define KGDT_32_R3_TEB 0x0050 // 53
+#define KGDT64_NULL 0x0000
+#define KGDT64_R0_CODE 0x0010
+#define KGDT64_R0_DATA 0x0018
+#define KGDT64_R3_CMCODE 0x0020
+#define KGDT64_R3_DATA 0x0028
+#define KGDT64_R3_CODE 0x0030
+#define KGDT64_SYS_TSS 0x0040
+#define KGDT64_R3_CMTEB 0x0050
//
From f6c641bb39b0fbc2d5a3629733bdd812da36cc84 Mon Sep 17 00:00:00 2001
From: Timo Kreuzer
Date: Tue, 13 Apr 2010 15:19:35 +0000
Subject: [PATCH 115/261] [NTOSKRNL] Add back FASTCALL macro in the pspec file
for amd64 builds
svn path=/trunk/; revision=46859
---
reactos/ntoskrnl/ntoskrnl.pspec | 175 ++++++++++++++++----------------
1 file changed, 90 insertions(+), 85 deletions(-)
diff --git a/reactos/ntoskrnl/ntoskrnl.pspec b/reactos/ntoskrnl/ntoskrnl.pspec
index 5016dbd2b87..12973661b81 100644
--- a/reactos/ntoskrnl/ntoskrnl.pspec
+++ b/reactos/ntoskrnl/ntoskrnl.pspec
@@ -1,5 +1,10 @@
#include
#undef i386
+#ifndef __x86_64__
+#define FASTCALL fastcall
+#else
+#define FASTCALL stdcall
+#endif
@ stdcall CcCanIWrite(ptr long long long)
@ stdcall CcCopyRead(ptr ptr long long ptr ptr)
@@ -57,13 +62,13 @@
@ stdcall DbgQueryDebugFilterState(long long)
@ stdcall DbgSetDebugFilterState(long long long)
@ stdcall -arch=x86_64 ExAcquireFastMutex(ptr)
-@ fastcall ExAcquireFastMutexUnsafe(ptr)
+@ FASTCALL ExAcquireFastMutexUnsafe(ptr)
@ stdcall ExAcquireResourceExclusiveLite(ptr long)
@ stdcall ExAcquireResourceSharedLite(ptr long)
-@ fastcall ExAcquireRundownProtection(ptr) ExfAcquireRundownProtection
-@ fastcall ExAcquireRundownProtectionCacheAware(ptr) ExfAcquireRundownProtectionCacheAware
-@ fastcall ExAcquireRundownProtectionCacheAwareEx(ptr long) ExfAcquireRundownProtectionCacheAwareEx
-@ fastcall ExAcquireRundownProtectionEx(ptr long) ExfAcquireRundownProtectionEx
+@ FASTCALL ExAcquireRundownProtection(ptr) ExfAcquireRundownProtection
+@ FASTCALL ExAcquireRundownProtectionCacheAware(ptr) ExfAcquireRundownProtectionCacheAware
+@ FASTCALL ExAcquireRundownProtectionCacheAwareEx(ptr long) ExfAcquireRundownProtectionCacheAwareEx
+@ FASTCALL ExAcquireRundownProtectionEx(ptr long) ExfAcquireRundownProtectionEx
@ stdcall ExAcquireSharedStarveExclusive(ptr long)
@ stdcall ExAcquireSharedWaitForExclusive(ptr long)
@ stdcall ExAllocateCacheAwareRundownProtection(long long)
@@ -80,7 +85,7 @@
@ stdcall ExDeleteResourceLite(ptr)
@ extern ExDesktopObjectType
@ stdcall ExDisableResourceBoostLite(ptr)
-@ fastcall ExEnterCriticalRegionAndAcquireFastMutexUnsafe(ptr)
+@ FASTCALL ExEnterCriticalRegionAndAcquireFastMutexUnsafe(ptr)
@ stdcall ExEnterCriticalRegionAndAcquireResourceExclusive(ptr)
@ stdcall ExEnterCriticalRegionAndAcquireResourceShared(ptr)
@ stdcall ExEnterCriticalRegionAndAcquireSharedWaitForExclusive(ptr)
@@ -99,33 +104,33 @@
@ stdcall ExInitializeNPagedLookasideList(ptr ptr ptr long long long long)
@ stdcall ExInitializePagedLookasideList(ptr ptr ptr long long long long)
@ stdcall ExInitializeResourceLite(ptr)
-@ fastcall ExInitializeRundownProtection(ptr) ExfInitializeRundownProtection
+@ FASTCALL ExInitializeRundownProtection(ptr) ExfInitializeRundownProtection
@ stdcall ExInitializeRundownProtectionCacheAware(ptr long)
@ stdcall ExInitializeZone(ptr long ptr long)
@ stdcall ExInterlockedAddLargeInteger(ptr long long ptr)
#ifndef __x86_64__
-@ fastcall ExInterlockedAddLargeStatistic(ptr long)
+@ FASTCALL ExInterlockedAddLargeStatistic(ptr long)
#endif
@ stdcall ExInterlockedAddUlong(ptr long ptr)
#ifndef __x86_64__
-@ fastcall ExInterlockedCompareExchange64(ptr ptr ptr ptr)
+@ FASTCALL ExInterlockedCompareExchange64(ptr ptr ptr ptr)
@ stdcall ExInterlockedDecrementLong(ptr ptr)
@ stdcall ExInterlockedExchangeUlong(ptr long ptr)
#endif
@ stdcall ExInterlockedExtendZone(ptr ptr long ptr)
#ifndef __x86_64__
-@ fastcall ExInterlockedFlushSList(ptr)
+@ FASTCALL ExInterlockedFlushSList(ptr)
@ stdcall ExInterlockedIncrementLong(ptr ptr)
#endif
@ stdcall ExInterlockedInsertHeadList(ptr ptr ptr)
@ stdcall ExInterlockedInsertTailList(ptr ptr ptr)
@ stdcall ExInterlockedPopEntryList(ptr ptr)
#ifndef __x86_64__
-@ fastcall ExInterlockedPopEntrySList(ptr ptr)
+@ FASTCALL ExInterlockedPopEntrySList(ptr ptr)
#endif
@ stdcall ExInterlockedPushEntryList(ptr ptr ptr)
#ifndef __x86_64__
-@ fastcall ExInterlockedPushEntrySList(ptr ptr ptr)
+@ FASTCALL ExInterlockedPushEntrySList(ptr ptr ptr)
#endif
@ stdcall ExInterlockedRemoveHeadList(ptr ptr)
@ stdcall ExIsProcessorFeaturePresent(long)
@@ -141,22 +146,22 @@
@ stdcall ExRaiseException(ptr) RtlRaiseException
@ stdcall ExRaiseHardError(long long long ptr long ptr)
@ stdcall ExRaiseStatus(long) RtlRaiseStatus
-@ fastcall ExReInitializeRundownProtection(ptr) ExfReInitializeRundownProtection
-@ fastcall ExReInitializeRundownProtectionCacheAware(ptr) ExfReInitializeRundownProtectionCacheAware
+@ FASTCALL ExReInitializeRundownProtection(ptr) ExfReInitializeRundownProtection
+@ FASTCALL ExReInitializeRundownProtectionCacheAware(ptr) ExfReInitializeRundownProtectionCacheAware
@ stdcall ExRegisterCallback(ptr ptr ptr)
@ stdcall ExReinitializeResourceLite(ptr)
@ stdcall -arch=x86_64 ExReleaseFastMutex(ptr)
-@ fastcall ExReleaseFastMutexUnsafe(ptr)
-@ fastcall ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(ptr)
-@ fastcall ExReleaseResourceAndLeaveCriticalRegion(ptr)
+@ FASTCALL ExReleaseFastMutexUnsafe(ptr)
+@ FASTCALL ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(ptr)
+@ FASTCALL ExReleaseResourceAndLeaveCriticalRegion(ptr)
@ stdcall ExReleaseResourceForThreadLite(ptr long)
-@ fastcall ExReleaseResourceLite(ptr)
-@ fastcall ExReleaseRundownProtection(ptr) ExfReleaseRundownProtection
-@ fastcall ExReleaseRundownProtectionCacheAware(ptr) ExfReleaseRundownProtectionCacheAware
-@ fastcall ExReleaseRundownProtectionCacheAwareEx(ptr long) ExfReleaseRundownProtectionCacheAwareEx
-@ fastcall ExReleaseRundownProtectionEx(ptr long) ExfReleaseRundownProtectionEx
-@ fastcall ExRundownCompleted(ptr) ExfRundownCompleted
-@ fastcall ExRundownCompletedCacheAware(ptr) ExfRundownCompletedCacheAware
+@ FASTCALL ExReleaseResourceLite(ptr)
+@ FASTCALL ExReleaseRundownProtection(ptr) ExfReleaseRundownProtection
+@ FASTCALL ExReleaseRundownProtectionCacheAware(ptr) ExfReleaseRundownProtectionCacheAware
+@ FASTCALL ExReleaseRundownProtectionCacheAwareEx(ptr long) ExfReleaseRundownProtectionCacheAwareEx
+@ FASTCALL ExReleaseRundownProtectionEx(ptr long) ExfReleaseRundownProtectionEx
+@ FASTCALL ExRundownCompleted(ptr) ExfRundownCompleted
+@ FASTCALL ExRundownCompletedCacheAware(ptr) ExfRundownCompletedCacheAware
@ extern ExSemaphoreObjectType _ExSemaphoreObjectType
@ stdcall ExSetResourceOwnerPointer(ptr ptr)
@ stdcall ExSetTimerResolution(long long)
@@ -167,37 +172,37 @@
@ stdcall ExUnregisterCallback(ptr)
@ stdcall ExUuidCreate(ptr)
@ stdcall ExVerifySuite(long)
-@ fastcall ExWaitForRundownProtectionRelease(ptr) ExfWaitForRundownProtectionRelease
-@ fastcall ExWaitForRundownProtectionReleaseCacheAware(ptr) ExfWaitForRundownProtectionReleaseCacheAware
+@ FASTCALL ExWaitForRundownProtectionRelease(ptr) ExfWaitForRundownProtectionRelease
+@ FASTCALL ExWaitForRundownProtectionReleaseCacheAware(ptr) ExfWaitForRundownProtectionReleaseCacheAware
@ extern ExWindowStationObjectType
-@ fastcall ExfAcquirePushLockExclusive(ptr)
-@ fastcall ExfAcquirePushLockShared(ptr)
+@ FASTCALL ExfAcquirePushLockExclusive(ptr)
+@ FASTCALL ExfAcquirePushLockShared(ptr)
#ifndef __x86_64__
-@ fastcall ExfInterlockedAddUlong(ptr long ptr)
-@ fastcall ExfInterlockedCompareExchange64(ptr ptr ptr)
-@ fastcall ExfInterlockedInsertHeadList(ptr ptr ptr)
-@ fastcall ExfInterlockedInsertTailList(ptr ptr ptr)
-@ fastcall ExfInterlockedPopEntryList(ptr ptr)
-@ fastcall ExfInterlockedPushEntryList(ptr ptr ptr)
-@ fastcall ExfInterlockedRemoveHeadList(ptr ptr)
+@ FASTCALL ExfInterlockedAddUlong(ptr long ptr)
+@ FASTCALL ExfInterlockedCompareExchange64(ptr ptr ptr)
+@ FASTCALL ExfInterlockedInsertHeadList(ptr ptr ptr)
+@ FASTCALL ExfInterlockedInsertTailList(ptr ptr ptr)
+@ FASTCALL ExfInterlockedPopEntryList(ptr ptr)
+@ FASTCALL ExfInterlockedPushEntryList(ptr ptr ptr)
+@ FASTCALL ExfInterlockedRemoveHeadList(ptr ptr)
#endif
-@ fastcall ExfReleasePushLock(ptr)
-@ fastcall ExfReleasePushLockExclusive(ptr)
-@ fastcall ExfReleasePushLockShared(ptr)
-@ fastcall ExfTryToWakePushLock(ptr)
-@ fastcall ExfUnblockPushLock(ptr ptr)
+@ FASTCALL ExfReleasePushLock(ptr)
+@ FASTCALL ExfReleasePushLockExclusive(ptr)
+@ FASTCALL ExfReleasePushLockShared(ptr)
+@ FASTCALL ExfTryToWakePushLock(ptr)
+@ FASTCALL ExfUnblockPushLock(ptr ptr)
@ stdcall -arch=x86_64 ExpInterlockedFlushSList(ptr)
@ stdcall -arch=x86_64 ExpInterlockedPopEntrySList(ptr ptr)
@ stdcall -arch=x86_64 ExpInterlockedPushEntrySList(ptr ptr)
-@ fastcall -arch=i386 Exfi386InterlockedDecrementLong(ptr)
-@ fastcall -arch=i386 Exfi386InterlockedExchangeUlong(ptr long)
-@ fastcall -arch=i386 Exfi386InterlockedIncrementLong(ptr)
+@ FASTCALL -arch=i386 Exfi386InterlockedDecrementLong(ptr)
+@ FASTCALL -arch=i386 Exfi386InterlockedExchangeUlong(ptr long)
+@ FASTCALL -arch=i386 Exfi386InterlockedIncrementLong(ptr)
@ stdcall -arch=i386 Exi386InterlockedDecrementLong(ptr)
@ stdcall -arch=i386 Exi386InterlockedExchangeUlong(ptr long long)
@ stdcall -arch=i386 Exi386InterlockedIncrementLong(ptr)
-@ fastcall -arch=i386 ExiAcquireFastMutex(ptr) ExAcquireFastMutex
-@ fastcall -arch=i386 ExiReleaseFastMutex(ptr) ExReleaseFastMutex
-@ fastcall -arch=i386 ExiTryToAcquireFastMutex(ptr) ExTryToAcquireFastMutex
+@ FASTCALL -arch=i386 ExiAcquireFastMutex(ptr) ExAcquireFastMutex
+@ FASTCALL -arch=i386 ExiReleaseFastMutex(ptr) ExReleaseFastMutex
+@ FASTCALL -arch=i386 ExiTryToAcquireFastMutex(ptr) ExTryToAcquireFastMutex
@ stdcall FsRtlAcquireFileExclusive(ptr)
;FsRtlAddBaseMcbEntry
@ stdcall FsRtlAddLargeMcbEntry(ptr long long long long long long)
@@ -318,7 +323,7 @@
@ stdcall FsRtlUninitializeMcb(ptr)
@ stdcall FsRtlUninitializeOplock(ptr)
@ extern HalDispatchTable _HalDispatchTable
-@ fastcall HalExamineMBR(ptr long long ptr)
+@ FASTCALL HalExamineMBR(ptr long long ptr)
@ extern HalPrivateDispatchTable
;HeadlessDispatch
@ stdcall InbvAcquireDisplayOwnership()
@@ -335,13 +340,13 @@
@ stdcall InbvSolidColorFill(long long long long long)
@ extern InitSafeBootMode
#ifndef __x86_64__
-@ fastcall InterlockedCompareExchange(ptr long long)
-@ fastcall InterlockedDecrement(ptr)
-@ fastcall InterlockedExchange(ptr long)
-@ fastcall InterlockedExchangeAdd(ptr long)
-@ fastcall InterlockedIncrement(ptr)
-@ fastcall InterlockedPopEntrySList(ptr)
-@ fastcall InterlockedPushEntrySList(ptr ptr)
+@ FASTCALL InterlockedCompareExchange(ptr long long)
+@ FASTCALL InterlockedDecrement(ptr)
+@ FASTCALL InterlockedExchange(ptr long)
+@ FASTCALL InterlockedExchangeAdd(ptr long)
+@ FASTCALL InterlockedIncrement(ptr)
+@ FASTCALL InterlockedPopEntrySList(ptr)
+@ FASTCALL InterlockedPushEntrySList(ptr ptr)
#else
@ stdcall InitializeSListHead(ptr) RtlInitializeSListHead
#endif
@@ -356,7 +361,7 @@
@ stdcall IoAllocateIrp(long long)
@ stdcall IoAllocateMdl(ptr long long long ptr)
@ stdcall IoAllocateWorkItem(ptr)
-@ fastcall IoAssignDriveLetters(ptr ptr ptr ptr)
+@ FASTCALL IoAssignDriveLetters(ptr ptr ptr ptr)
@ stdcall IoAssignResources(ptr ptr ptr ptr ptr ptr)
@ stdcall IoAttachDevice(ptr ptr ptr)
@ stdcall IoAttachDeviceByPointer(ptr ptr)
@@ -437,7 +442,7 @@
@ stdcall IoGetFileObjectGenericMapping()
@ stdcall IoGetInitialStack()
@ stdcall IoGetLowerDeviceObject(ptr)
-@ fastcall IoGetPagingIoPriority(ptr)
+@ FASTCALL IoGetPagingIoPriority(ptr)
@ stdcall IoGetRelatedDeviceObject(ptr)
@ stdcall IoGetRequestorProcess(ptr)
@ stdcall IoGetRequestorProcessId(ptr)
@@ -469,7 +474,7 @@
@ stdcall IoRaiseInformationalHardError(long ptr ptr)
@ stdcall IoReadDiskSignature(ptr long ptr)
@ extern IoReadOperationCount
-@ fastcall IoReadPartitionTable(ptr long long ptr)
+@ FASTCALL IoReadPartitionTable(ptr long long ptr)
@ stdcall IoReadPartitionTableEx(ptr ptr)
@ extern IoReadTransferCount
@ stdcall IoRegisterBootDriverReinitialization(ptr ptr ptr)
@@ -500,7 +505,7 @@
@ stdcall IoSetHardErrorOrVerifyDevice(ptr ptr)
@ stdcall IoSetInformation(ptr ptr long ptr)
@ stdcall IoSetIoCompletion(ptr ptr ptr long ptr long)
-@ fastcall IoSetPartitionInformation(ptr long long long)
+@ FASTCALL IoSetPartitionInformation(ptr long long long)
@ stdcall IoSetPartitionInformationEx(ptr long ptr)
@ stdcall IoSetShareAccess(long long ptr ptr)
@ stdcall IoSetStartIoAttributes(ptr long long)
@@ -543,11 +548,11 @@
@ stdcall IoWMIWriteEvent(ptr)
@ stdcall IoWriteErrorLogEntry(ptr)
@ extern IoWriteOperationCount
-@ fastcall IoWritePartitionTable(ptr long long long ptr)
+@ FASTCALL IoWritePartitionTable(ptr long long long ptr)
@ stdcall IoWritePartitionTableEx(ptr ptr)
@ extern IoWriteTransferCount
-@ fastcall IofCallDriver(ptr ptr)
-@ fastcall IofCompleteRequest(ptr long)
+@ FASTCALL IofCallDriver(ptr ptr)
+@ FASTCALL IofCompleteRequest(ptr long)
@ stdcall KdChangeOption(long long ptr long ptr ptr)
@ extern KdDebuggerEnabled _KdDebuggerEnabled
@ extern KdDebuggerNotPresent _KdDebuggerNotPresent
@@ -562,13 +567,13 @@
@ stdcall -arch=i386 Ke386IoSetAccessProcess(ptr long)
@ stdcall -arch=i386 Ke386QueryIoAccessMap(long ptr)
@ stdcall -arch=i386 Ke386SetIoAccessMap(long ptr)
-@ fastcall KeAcquireGuardedMutex(ptr)
-@ fastcall KeAcquireGuardedMutexUnsafe(ptr)
-@ fastcall KeAcquireInStackQueuedSpinLockAtDpcLevel(ptr ptr)
-@ fastcall KeAcquireInStackQueuedSpinLockForDpc(ptr ptr)
+@ FASTCALL KeAcquireGuardedMutex(ptr)
+@ FASTCALL KeAcquireGuardedMutexUnsafe(ptr)
+@ FASTCALL KeAcquireInStackQueuedSpinLockAtDpcLevel(ptr ptr)
+@ FASTCALL KeAcquireInStackQueuedSpinLockForDpc(ptr ptr)
@ stdcall KeAcquireInterruptSpinLock(ptr)
@ stdcall KeAcquireSpinLockAtDpcLevel(ptr)
-@ fastcall KeAcquireSpinLockForDpc(ptr)
+@ FASTCALL KeAcquireSpinLockForDpc(ptr)
@ stdcall -arch=x86_64 KeAcquireSpinLockRaiseToDpc(ptr)
@ stdcall KeAddSystemServiceTable(ptr ptr long ptr long)
@ stdcall KeAreAllApcsDisabled()
@@ -612,7 +617,7 @@
@ stdcall KeInitializeDeviceQueue(ptr)
@ stdcall KeInitializeDpc(ptr ptr ptr)
@ stdcall KeInitializeEvent(ptr long long)
-@ fastcall KeInitializeGuardedMutex(ptr)
+@ FASTCALL KeInitializeGuardedMutex(ptr)
@ stdcall KeInitializeInterrupt(ptr ptr ptr ptr long long long long long long long)
@ stdcall KeInitializeMutant(ptr long)
@ stdcall KeInitializeMutex(ptr long)
@@ -663,10 +668,10 @@
@ stdcall KeRegisterBugCheckCallback(ptr ptr ptr long ptr)
@ stdcall KeRegisterBugCheckReasonCallback(ptr ptr ptr ptr)
@ stdcall KeRegisterNmiCallback(ptr ptr)
-@ fastcall KeReleaseGuardedMutex(ptr)
-@ fastcall KeReleaseGuardedMutexUnsafe(ptr)
-@ fastcall KeReleaseInStackQueuedSpinLockForDpc(ptr)
-@ fastcall KeReleaseInStackQueuedSpinLockFromDpcLevel(ptr)
+@ FASTCALL KeReleaseGuardedMutex(ptr)
+@ FASTCALL KeReleaseGuardedMutexUnsafe(ptr)
+@ FASTCALL KeReleaseInStackQueuedSpinLockForDpc(ptr)
+@ FASTCALL KeReleaseInStackQueuedSpinLockFromDpcLevel(ptr)
@ stdcall KeReleaseInterruptSpinLock(ptr long)
@ stdcall KeReleaseMutant(ptr long long long)
@ stdcall KeReleaseMutex(ptr long)
@@ -674,7 +679,7 @@
#ifdef __x86_64__
@ stdcall KeReleaseSpinLock(ptr long)
#endif
-@ fastcall KeReleaseSpinLockForDpc(ptr long)
+@ FASTCALL KeReleaseSpinLockForDpc(ptr long)
@ stdcall KeReleaseSpinLockFromDpcLevel(ptr)
@ stdcall KeRemoveByKeyDeviceQueue(ptr long)
@ stdcall KeRemoveByKeyDeviceQueueIfBusy(ptr long)
@@ -710,10 +715,10 @@
@ stdcall KeStackAttachProcess(ptr ptr)
@ stdcall KeSynchronizeExecution(ptr ptr ptr)
@ stdcall KeTerminateThread(long)
-@ fastcall KeTestSpinLock(ptr)
+@ FASTCALL KeTestSpinLock(ptr)
@ extern KeTickCount
-@ fastcall KeTryToAcquireGuardedMutex(ptr)
-@ fastcall KeTryToAcquireSpinLockAtDpcLevel(ptr)
+@ FASTCALL KeTryToAcquireGuardedMutex(ptr)
+@ FASTCALL KeTryToAcquireSpinLockAtDpcLevel(ptr)
@ stdcall KeUnstackDetachProcess(ptr)
@ stdcall KeUpdateRunTime(ptr long)
@ fastcall KeUpdateSystemTime(ptr long long)
@@ -721,11 +726,11 @@
@ stdcall KeWaitForMultipleObjects(long ptr long long long long ptr ptr)
@ stdcall KeWaitForMutexObject(ptr long long long ptr) KeWaitForSingleObject
@ stdcall KeWaitForSingleObject(ptr long long long ptr)
-@ fastcall KefAcquireSpinLockAtDpcLevel(ptr)
-@ fastcall KefReleaseSpinLockFromDpcLevel(ptr)
+@ FASTCALL KefAcquireSpinLockAtDpcLevel(ptr)
+@ FASTCALL KefReleaseSpinLockFromDpcLevel(ptr)
@ stdcall -arch=i386 Kei386EoiHelper()
@ fastcall -arch=i386 KiEoiHelper(ptr) /* FIXME: Evaluate decision */
-@ fastcall KiAcquireSpinLock(ptr)
+@ FASTCALL KiAcquireSpinLock(ptr)
@ extern KiBugCheckData
@ stdcall KiCheckForKernelApcDelivery()
;KiCheckForSListAddress
@@ -734,7 +739,7 @@
@ stdcall -arch=i386 KiDispatchInterrupt()
@ extern KiEnableTimerWatchdog
@ stdcall KiIpiServiceRoutine(ptr ptr)
-@ fastcall KiReleaseSpinLock(ptr)
+@ FASTCALL KiReleaseSpinLock(ptr)
@ cdecl KiUnexpectedInterrupt()
#ifdef _M_IX86
@ stdcall Kii386SpinOnSpinLock(ptr long)
@@ -928,8 +933,8 @@
;ObSetHandleAttributes@12
@ stdcall ObSetSecurityDescriptorInfo(ptr ptr ptr ptr long ptr)
@ stdcall ObSetSecurityObjectByPointer(ptr long ptr)
-@ fastcall ObfDereferenceObject(ptr)
-@ fastcall ObfReferenceObject(ptr)
+@ FASTCALL ObfDereferenceObject(ptr)
+@ FASTCALL ObfReferenceObject(ptr)
;PfxFindPrefix
;PfxInitialize
;PfxInsertPrefix
@@ -1251,7 +1256,7 @@
@ stdcall RtlOemStringToUnicodeString(ptr ptr long)
@ stdcall RtlOemToUnicodeN(wstr long ptr ptr long)
@ stdcall RtlPinAtomInAtomTable(ptr ptr)
-@ fastcall RtlPrefetchMemoryNonTemporal(ptr long)
+@ FASTCALL RtlPrefetchMemoryNonTemporal(ptr long)
@ stdcall RtlPrefixString(ptr ptr long)
@ stdcall RtlPrefixUnicodeString(ptr ptr long)
@ stdcall RtlQueryAtomInAtomTable(ptr ptr ptr ptr ptr ptr)
@@ -1298,8 +1303,8 @@
;RtlTraceDatabaseUnlock
;RtlTraceDatabaseValidate
#ifndef __x86_64__
-@ fastcall RtlUlongByteSwap(long)
-@ fastcall RtlUlonglongByteSwap(long long)
+@ FASTCALL RtlUlongByteSwap(long)
+@ FASTCALL RtlUlonglongByteSwap(long long)
#endif
@ stdcall RtlUnicodeStringToAnsiSize(ptr) RtlxUnicodeStringToAnsiSize
@ stdcall RtlUnicodeStringToAnsiString(ptr ptr long)
@@ -1324,7 +1329,7 @@
@ stdcall RtlUpperChar(long)
@ stdcall RtlUpperString(ptr ptr)
#ifndef __x86_64__
-@ fastcall RtlUshortByteSwap(long)
+@ FASTCALL RtlUshortByteSwap(long)
#endif
@ stdcall RtlValidRelativeSecurityDescriptor(ptr long long)
@ stdcall RtlValidSecurityDescriptor(ptr)
From c100c972c16e08b4dd6bdafafdde1e733ada3812 Mon Sep 17 00:00:00 2001
From: Timo Kreuzer
Date: Tue, 13 Apr 2010 16:26:48 +0000
Subject: [PATCH 116/261] [HAL] - Give mini-hal it's own rbuild file - fix
amd64 rbuild
svn path=/trunk/; revision=46860
---
reactos/hal/halx86/directory.rbuild | 9 ++---
reactos/hal/halx86/hal_generic.rbuild | 52 +++++----------------------
reactos/hal/halx86/hal_mini.rbuild | 44 +++++++++++++++++++++++
reactos/hal/halx86/halamd64.rbuild | 18 +++++++---
4 files changed, 70 insertions(+), 53 deletions(-)
create mode 100644 reactos/hal/halx86/hal_mini.rbuild
diff --git a/reactos/hal/halx86/directory.rbuild b/reactos/hal/halx86/directory.rbuild
index 7cea4c006fa..9c8c482a2c7 100644
--- a/reactos/hal/halx86/directory.rbuild
+++ b/reactos/hal/halx86/directory.rbuild
@@ -3,14 +3,15 @@
-
-
-
+
+
+
+
-
+
diff --git a/reactos/hal/halx86/hal_generic.rbuild b/reactos/hal/halx86/hal_generic.rbuild
index 166bb930404..8dd5f7bc57d 100644
--- a/reactos/hal/halx86/hal_generic.rbuild
+++ b/reactos/hal/halx86/hal_generic.rbuild
@@ -16,7 +16,6 @@
sysbus.c
beep.c
- bios.c
cmos.c
display.c
dma.c
@@ -29,6 +28,7 @@
timer.c
usage.c
+ bios.c
portio.c
systimer.S
@@ -36,9 +36,16 @@
+
+ .
x86bios.c
+ halinit.c
+ irq.S
+ misc.c
+ apic.c
systimer.S
+ usage.c
@@ -46,47 +53,4 @@
hal.h
-
-
- include
- include
-
-
-
-
-
-
- bushndlr.c
- isabus.c
- halbus.c
- pcibus.c
- pcidata.c
- sysbus.c
-
- beep.c
- bios.c
- cmos.c
- dma.c
- display.c
- drive.c
- misc.c
- profil.c
- reboot.c
- spinlock.c
- sysinfo.c
- timer.c
- usage.c
-
-
- portio.c
- systimer.S
-
-
-
-
- halinit_up.c
- pic.c
- processor.c
-
-
diff --git a/reactos/hal/halx86/hal_mini.rbuild b/reactos/hal/halx86/hal_mini.rbuild
new file mode 100644
index 00000000000..a7baed44639
--- /dev/null
+++ b/reactos/hal/halx86/hal_mini.rbuild
@@ -0,0 +1,44 @@
+
+
+
+
+ include
+ include
+
+
+
+
+
+
+ bushndlr.c
+ isabus.c
+ halbus.c
+ pcibus.c
+ pcidata.c
+ sysbus.c
+
+ beep.c
+ bios.c
+ cmos.c
+ dma.c
+ display.c
+ drive.c
+ misc.c
+ profil.c
+ reboot.c
+ spinlock.c
+ sysinfo.c
+ timer.c
+ usage.c
+
+ portio.c
+ systimer.S
+
+
+
+ halinit_up.c
+ pic.c
+ processor.c
+
+
+
diff --git a/reactos/hal/halx86/halamd64.rbuild b/reactos/hal/halx86/halamd64.rbuild
index 0b60f7615dc..ad96c0f1cf9 100644
--- a/reactos/hal/halx86/halamd64.rbuild
+++ b/reactos/hal/halx86/halamd64.rbuild
@@ -12,17 +12,25 @@
hal_generic
hal_generic_acpi
- hal_generic_up
ntoskrnl
-
+ x86emu
-
+
+ spinlock.c
+
+
+
+ processor.c
+
+
+
+ mps.S
-
+
From 9032acdcf88e107fad66dc299fefbc7b3a97b0b5 Mon Sep 17 00:00:00 2001
From: Marc Piulachs
Date: Tue, 13 Apr 2010 21:59:21 +0000
Subject: [PATCH 117/261] My first commit in a very long time. I'm releasing
the source code of my C# implementation of Rbuild by popular demand :) I
would have preferred to release the code under a BSD licence but there is a
small portion of ancient Nant GPL code that would have been to be rewritten
first.
There are two executables (SysGen.Designer) and (SysGen.Make)
SysGen.Designer is a windows forms tool that allows to generate customized reactos images, it is similar in concept to Windows CE Platfom Builder. SysGen.Make is the actual Rbuild clone, It has three main parts, the .rbuild file parser + in-memory tree representation, the backends , and the auto generated files. The Mingw backend used to work 1'5 years ago and produced a 100% valid makefile.auto but have to be updated to be able to build a recent revision. Rewriting parts of it to take advantage of C# 3.5 extension methods would probably reduce the code by 50%. The other two parts are quite stable.
This code was only a proof of concept and was never intended to be released so there is a ton of unpolished code and hacks required by the current C++ implementation that should be removed.
How to test it:
Select SysGen.Make as the Start-up Project in Visual Studio and edit Program.cs to point to the correct path to ReactOS-i386.rbuild Edit SysGenEngine.cs:639 to enable/disable specific backends, The HtmlBackend in \SysGen.BuildEngine\Backends\Html\HtmlBackend.cs is a very simple illustration of how powerful this framework is.
Happy hacking!
svn path=/trunk/; revision=46862
---
.../tools/sysgen/FileSystemTreeView/App.ico | Bin 0 -> 1078 bytes
.../sysgen/FileSystemTreeView/AssemblyInfo.cs | 58 +
.../sysgen/FileSystemTreeView/Backup/App.ico | Bin 0 -> 1078 bytes
.../FileSystemTreeView/Backup/AssemblyInfo.cs | 58 +
.../Backup/FileSystemTreeView.cs | 201 ++
.../Backup/FileSystemTreeView.csproj | 143 +
.../Backup/FileSystemTreeView.csproj.user | 48 +
.../Backup/FileSystemTreeView.resx | 42 +
.../sysgen/FileSystemTreeView/Backup/Form1.cs | 178 ++
.../FileSystemTreeView/Backup/Form1.resx | 193 ++
.../FileSystemTreeView/Backup/ShellIcon.cs | 79 +
.../Backup/icons/folder.ico | Bin 0 -> 1406 bytes
.../FileSystemTreeView/FileSystemTreeView.cs | 202 ++
.../FileSystemTreeView.csproj | 124 +
.../FileSystemTreeView.csproj.user | 58 +
.../FileSystemTreeView.resx | 42 +
.../FileSystemTreeView/FileSystemTreeView.suo | Bin 0 -> 2560 bytes
.../tools/sysgen/FileSystemTreeView/Form1.cs | 178 ++
.../sysgen/FileSystemTreeView/Form1.resx | 193 ++
.../sysgen/FileSystemTreeView/ShellIcon.cs | 79 +
.../sysgen/FileSystemTreeView/UpgradeLog.XML | 19 +
.../_UpgradeReport_Files/UpgradeReport.css | 207 ++
.../_UpgradeReport_Files/UpgradeReport.xslt | 232 ++
.../UpgradeReport_Minus.gif | Bin 0 -> 69 bytes
.../UpgradeReport_Plus.gif | Bin 0 -> 71 bytes
.../bin/Debug/DirectoryTreeView.exe | Bin 0 -> 32768 bytes
.../bin/Debug/DirectoryTreeView.pdb | Bin 0 -> 28160 bytes
.../bin/Debug/DirectoryTreeView.vshost.exe | Bin 0 -> 5632 bytes
.../FileSystemTreeView/icons/folder.ico | Bin 0 -> 1406 bytes
.../Controls/CatalogTriStateTreeView.cs | 220 ++
.../Controls/ModuleFiltersListView.cs | 91 +
.../RosBuilder/Controls/NewItemListView.cs | 114 +
.../RosBuilder/Controls/PlatformTreeView.cs | 306 ++
.../RosBuilder/Controls/ProjectTreeView.cs | 161 +
.../Controls/RegistryEditor.Designer.cs | 118 +
.../RosBuilder/Controls/RegistryEditor.cs | 18 +
.../RosBuilder/Controls/RegistryEditor.resx | 120 +
.../tools/sysgen/RosBuilder/Form1.Designer.cs | 38 +
reactos/tools/sysgen/RosBuilder/Form1.cs | 18 +
reactos/tools/sysgen/RosBuilder/Form1.resx | 120 +
.../Inspectors/PlatformInspector.cs | 155 +
.../sysgen/RosBuilder/MainForm.Designer.cs | 654 ++++
reactos/tools/sysgen/RosBuilder/MainForm.cs | 362 +++
reactos/tools/sysgen/RosBuilder/MainForm.resx | 353 +++
.../tools/sysgen/RosBuilder/ModuleFilter.cs | 295 ++
.../sysgen/RosBuilder/NewItemForm.Designer.cs | 135 +
.../tools/sysgen/RosBuilder/NewItemForm.cs | 28 +
.../tools/sysgen/RosBuilder/NewItemForm.resx | 120 +
.../RosBuilder/PlatformCatalogReader.cs | 206 ++
.../sysgen/RosBuilder/PlatformController.cs | 86 +
reactos/tools/sysgen/RosBuilder/Program.cs | 109 +
.../sysgen/RosBuilder/Project/Project.cs | 267 ++
.../RosBuilder/Project/ProjectReader.cs | 319 ++
.../RosBuilder/Project/ProjectWriter.cs | 170 +
.../sysgen/RosBuilder/ProjectController.cs | 222 ++
.../RosBuilder/Properties/AssemblyInfo.cs | 33 +
.../Properties/Resources.Designer.cs | 63 +
.../RosBuilder/Properties/Resources.resx | 117 +
.../Properties/Settings.Designer.cs | 26 +
.../RosBuilder/Properties/Settings.settings | 7 +
.../sysgen/RosBuilder/SysGen.Designer.csproj | 148 +
.../RosBuilder/SysGen.Designer.csproj.user | 5 +
.../sysgen/RosBuilder/Util/FileAssociation.cs | 244 ++
.../sysgen/RosFramework/Base/RBuildElement.cs | 311 ++
.../Collections/RBuildAPIStatusCollection.cs | 53 +
.../Collections/RBuildAuthorCollection.cs | 20 +
.../RBuildBuildFamilyCollection.cs | 20 +
.../RBuildContributorCollection.cs | 20 +
.../RBuildDebugChannelCollection.cs | 35 +
.../Collections/RBuildDefineCollection.cs | 25 +
.../RBuildExportedFunctionsCollection.cs | 10 +
.../Collections/RBuildFamilyCollection.cs | 10 +
.../Collections/RBuildFileCollection.cs | 17 +
.../Collections/RBuildFolderCollection.cs | 17 +
.../RBuildIncludeFolderCollection.cs | 10 +
.../RBuildInstallFolderCollection.cs | 28 +
.../Collections/RBuildLanguageCollection.cs | 20 +
.../RBuildLocalizationFileCollection.cs | 25 +
.../Collections/RBuildModuleCollection.cs | 82 +
.../Collections/RBuildModuleInfoCollection.cs | 20 +
.../RBuildPlatformFileCollection.cs | 17 +
.../Collections/RBuildPropertyCollection.cs | 108 +
.../Collections/RBuildSourceFileCollection.cs | 60 +
.../Interfaces/IRBuildInstallable.cs | 13 +
.../Interfaces/IRBuildModulesContainer.cs | 10 +
.../RosFramework/Interfaces/IRBuildNamed.cs | 10 +
.../Interfaces/IRBuildSourceFilesContainer.cs | 10 +
.../tools/sysgen/RosFramework/Misc/Utility.cs | 17 +
.../NotImplementedYet/RBuildModuleGroup.cs | 23 +
.../NotImplementedYet/RBuildPatch.cs | 24 +
.../RosFramework/Obsolete/PlatformCatalog.cs | 92 +
.../RosFramework/Obsolete/RosArchitecture.cs | 43 +
.../RosFramework/Obsolete/RosOSImage.cs | 209 ++
.../RosFramework/Obsolete/RosPlatform.cs | 78 +
.../RosFramework/Obsolete/SoftwareCatalog.cs | 80 +
.../RosFramework/Properties/AssemblyInfo.cs | 35 +
.../sysgen/RosFramework/RBuildAPIInfo.cs | 37 +
.../tools/sysgen/RosFramework/RBuildAuthor.cs | 38 +
.../sysgen/RosFramework/RBuildAutoRegister.cs | 106 +
.../RosFramework/RBuildBootstrapFile.cs | 52 +
.../sysgen/RosFramework/RBuildBuildFamily.cs | 25 +
.../tools/sysgen/RosFramework/RBuildCDFile.cs | 14 +
.../sysgen/RosFramework/RBuildCDFileBase.cs | 11 +
.../RosFramework/RBuildCompilationUnit.cs | 24 +
.../sysgen/RosFramework/RBuildContributor.cs | 93 +
.../sysgen/RosFramework/RBuildDebugChannel.cs | 74 +
.../RosFramework/RBuildExportFunction.cs | 47 +
.../tools/sysgen/RosFramework/RBuildFamily.cs | 18 +
.../tools/sysgen/RosFramework/RBuildFile.cs | 441 +++
.../RosFramework/RBuildImportLibrary.cs | 38 +
.../RosFramework/RBuildInfInstallerFile.cs | 18 +
.../sysgen/RosFramework/RBuildInstallFile.cs | 38 +
.../RosFramework/RBuildInstallFolder.cs | 30 +
.../sysgen/RosFramework/RBuildLanguage.cs | 48 +
.../RosFramework/RBuildLocalizationFile.cs | 34 +
.../sysgen/RosFramework/RBuildMetadata.cs | 18 +
.../tools/sysgen/RosFramework/RBuildModule.cs | 1210 ++++++++
.../sysgen/RosFramework/RBuildModuleGroup.cs | 24 +
.../sysgen/RosFramework/RBuildModuleInfo.cs | 60 +
.../sysgen/RosFramework/RBuildPlatform.cs | 133 +
.../sysgen/RosFramework/RBuildPlatformFile.cs | 84 +
.../sysgen/RosFramework/RBuildProject.cs | 163 +
.../sysgen/RosFramework/RBuildProperty.cs | 104 +
.../sysgen/RosFramework/RBuildRegistryKey.cs | 67 +
.../tools/sysgen/RosFramework/RBuildSetup.cs | 52 +
.../sysgen/RosFramework/RBuildSetupFile.cs | 52 +
.../sysgen/RosFramework/RBuildSolution.cs | 21 +
.../tools/sysgen/RosFramework/RBuildTarget.cs | 274 ++
.../RosFramework/RBuildUnAttendSetup.cs | 102 +
.../SysGen.RBuild.Framework.csproj | 117 +
.../SysGen.RBuild.Framework.csproj.user | 5 +
.../tools/sysgen/SYSGen/Backends/Backend.cs | 10 +
.../SYSGen/Backends/Catalog/CatalogBackend.cs | 12 +
.../SYSGen/Backends/Mingw/MingwBackend.cs | 12 +
reactos/tools/sysgen/SYSGen/Program.cs | 13 +
.../sysgen/SYSGen/Properties/AssemblyInfo.cs | 33 +
reactos/tools/sysgen/SYSGen/SYSGen.csproj | 56 +
.../Attributes/BuildElementArrayAttribute.cs | 33 +
.../Attributes/BuildElementAttribute.cs | 50 +
.../Attributes/ElementNameAttribute.cs | 45 +
.../Attributes/FunctionAttribute.cs | 60 +
.../Attributes/FunctionSetAttribute.cs | 90 +
.../Attributes/TaskAttributeAttribute.cs | 43 +
.../Attributes/TaskFileSetAttribute.cs | 33 +
.../Attributes/TaskNameAttribute.cs | 46 +
.../Attributes/TaskOptionSetAttribute.cs | 32 +
.../Attributes/TaskPropertyAttribute.cs | 66 +
.../Attributes/TaskValueAttribute.cs | 19 +
.../Validators/Base/ValidatorAttribute.cs | 16 +
.../Validators/BooleanValidatorAttribute.cs | 21 +
.../Validators/Int32ValidatorAttribute.cs | 54 +
.../Validators/StringValidatorAttribute.cs | 35 +
.../Validators/UriValidatorAttribute.cs | 26 +
.../APIDocumentation/APIDocumentation.cs | 395 +++
.../Backends/Base/Backend.cs | 81 +
.../Backends/Base/CompilerBaseBacked.cs | 160 +
.../Backends/Base/HtmlDocumenterBaseBacked.cs | 97 +
.../BaseAddress/BaseAddressReportBackend.cs | 127 +
.../Backends/BuildLogReport/BuildLogReport.cs | 109 +
.../Backends/Catalog/CatalogBackend.cs | 69 +
.../Backends/Html/HtmlBackend.cs | 2743 +++++++++++++++++
.../Backends/MSVisualStudio/MSVisualStudio.cs | 45 +
.../MSVisualStudio/VisualStudio/Solution.cs | 703 +++++
.../Backends/Mingw/CompilableFile.cs | 621 ++++
.../Backends/Mingw/MingwBackend.cs | 504 +++
.../Mingw/MingwRBuildElementHandler.cs | 923 ++++++
.../Backends/Mingw/Misc/MakefileWriter.cs | 99 +
.../Base/MingwRBuildModuleHandler.cs | 10 +
.../MingwBootLoaderModuleHandler.cs | 35 +
.../MingwBootSectorModuleHandler.cs | 33 +
.../MingwBuildToolModuleHandler.cs | 43 +
.../MingwCabinetModuleHandler.cs | 39 +
.../MingwEmbeddedTypeLibModuleHandler.cs | 42 +
.../MingwHostStaticLibraryModuleHandler.cs | 17 +
.../MingwIdlHeaderModuleHandler.cs | 43 +
.../MingwKernelModeDLLModuleHandler.cs | 69 +
.../MingwKernelModeDriverModuleHandler.cs | 59 +
.../MingwKernelModuleHandler.cs | 68 +
.../MingwMessageHeaderModuleHandler.cs | 50 +
.../MingwNativeCUIModuleHandler.cs | 44 +
.../MingwNativeDLLModuleHandler.cs | 49 +
.../MingwObjectLibraryModuleHandler.cs | 58 +
.../MingwPackageModuleHandler.cs | 39 +
.../MingwRBuildProjectHandler.cs | 37 +
.../MingwRpcClientHeaderModuleHandler.cs | 42 +
.../MingwRpcProxyModuleHandler.cs | 42 +
.../MingwRpcServerHeaderModuleHandler.cs | 49 +
.../MingwStaticLibraryModuleHandler.cs | 61 +
.../MingwWin32CUIModuleHandler.cs | 45 +
.../MingwWin32DLLModuleHandler.cs | 64 +
.../MingwWin32GUIModuleHandler.cs | 54 +
.../MingwWin32OCXModuleHandler.cs | 54 +
.../Base/MingwRBuildTargetHandler.cs | 307 ++
.../ProjectTreeReport/ProjectTreeReport.cs | 66 +
.../Backends/RBuildDB/RBuildDBBackend.cs | 102 +
.../Backends/RGenStats/RGenStatBackend.cs | 110 +
.../Backends/WarningReport/WarningReport.cs | 82 +
.../Collections/BackendCollection.cs | 22 +
.../Collections/DefineCollection.cs | 23 +
.../Collections/FileHandlerCollection.cs | 24 +
.../Collections/LogListenerCollection.cs | 14 +
.../Collections/TaskBuilderCollection.cs | 33 +
.../Collections/TaskCollection.cs | 10 +
.../Elements/Base/Element.cs | 306 ++
.../Exceptions/BuildException.cs | 101 +
.../Exceptions/ValidationException.cs | 62 +
.../Base/AutoGeneratedCFileWriter.cs | 30 +
.../Base/AutoGeneratedFileWriter.cs | 39 +
.../Base/AutoGeneratedInfFileWriter.cs | 54 +
.../FileWriters/BuildNumberFileWriter.cs | 45 +
.../FileWriters/CompilationUnitFileWriter.cs | 42 +
.../FileWriters/DefinitionFileWriter.cs | 21 +
.../FileWriters/DffFileWriter.cs | 139 +
.../FileWriters/HeaderCreditsFileWriter.cs | 36 +
.../FileWriters/HeaderRosCfgFileWriter.cs | 26 +
.../SysSetupComponentSetupFileWriter.cs | 84 +
.../FileWriters/SysSetupFileWriter.cs | 92 +
.../FileWriters/TxtCreditsFileWriter.cs | 52 +
.../FileWriters/TxtSetupFileWriter.cs | 137 +
.../FileWriters/TxtSetupHiveFileWriter.cs | 59 +
.../FileWriters/UnAttendSetupFileWriter.cs | 46 +
.../Handlers/SysSetupFileHandler.cs | 138 +
.../Interfaces/IBuildStatusMailReporter.cs | 10 +
.../Interfaces/IDirectory.cs | 16 +
.../SysGen.BuildEngine/Interfaces/IElement.cs | 21 +
.../Interfaces/IFileHandler.cs | 35 +
.../Interfaces/IRBuildInstallable.cs | 13 +
.../Interfaces/ISysGenObject.cs | 21 +
.../SysGen.BuildEngine/Interfaces/ITask.cs | 18 +
.../Interfaces/ITaskContainer.cs | 12 +
.../sysgen/SysGen.BuildEngine/Location.cs | 89 +
.../sysgen/SysGen.BuildEngine/LocationMap.cs | 211 ++
.../sysgen/SysGen.BuildEngine/Log/Log.cs | 215 ++
.../Log/Loggers/ConsoleLogger.cs | 22 +
.../Log/Loggers/StringLogger.cs | 36 +
.../Log/Loggers/XmlLogger.cs | 193 ++
.../SysGen.BuildEngine/Plugins/TaskBuilder.cs | 72 +
.../SysGen.BuildEngine/Plugins/TaskFactory.cs | 136 +
.../Properties/AssemblyInfo.cs | 15 +
.../SysGen.Framework.csproj | 381 +++
.../SysGen.Framework.csproj.user | 19 +
.../SysGen.BuildEngine/SysGenConversion.cs | 26 +
.../SysGenDependencyTracker.cs | 118 +
.../sysgen/SysGen.BuildEngine/SysGenEngine.cs | 825 +++++
.../SysGen.BuildEngine/SysGenPathResolver.cs | 36 +
.../SysGen.BuildEngine/Tasks/Base/Task.cs | 257 ++
.../Tasks/Base/TaskContainer.cs | 29 +
.../Tasks/BuiltIn/Build/XIFallbackTask.cs | 11 +
.../Tasks/BuiltIn/Build/XIIncludeTask.cs | 148 +
.../Tasks/BuiltIn/Logic/IfNotTask.cs | 49 +
.../Tasks/BuiltIn/Logic/IfTask.cs | 134 +
.../Tasks/RBuild/AutoFilesTask.cs | 63 +
.../Tasks/RBuild/AutoInstallFilesTask.cs | 15 +
.../Tasks/RBuild/AutoManifest.cs | 15 +
.../Tasks/RBuild/AutoRegisterTask.cs | 33 +
.../Tasks/RBuild/AutoResource.cs | 15 +
.../Tasks/RBuild/Base/AuthorBaseTask.cs | 26 +
.../Tasks/RBuild/Base/AutoFilesTask.cs | 19 +
.../Tasks/RBuild/Base/CDFileBaseTask.cs | 42 +
.../Tasks/RBuild/Base/FileBaseTask.cs | 47 +
.../RBuild/Base/FileSystemInfoBaseTask.cs | 119 +
.../Tasks/RBuild/Base/FolderBaseTask.cs | 15 +
.../Tasks/RBuild/Base/PlatformFileBaseTask.cs | 37 +
.../Tasks/RBuild/Base/PropertyBaseTask.cs | 38 +
.../RBuild/Base/RbuildElementBaseTask.cs | 16 +
.../Tasks/RBuild/Base/ValueBaseTask.cs | 16 +
.../Tasks/RBuild/BaseAdressTask.cs | 17 +
.../Tasks/RBuild/BootSector.cs | 44 +
.../Tasks/RBuild/BootstrapFileTask.cs | 40 +
.../Tasks/RBuild/BootstrapTask.cs | 52 +
.../Tasks/RBuild/BuildFamilyTask.cs | 27 +
.../Tasks/RBuild/CDFileTask.cs | 20 +
.../Tasks/RBuild/CompilationUnitTask.cs | 58 +
.../Tasks/RBuild/CompilerFlagTask.cs | 14 +
.../Tasks/RBuild/ComponentTask.cs | 12 +
.../Tasks/RBuild/ContributorTask.cs | 42 +
.../Tasks/RBuild/DebugChannelTask.cs | 54 +
.../Tasks/RBuild/DefineTask.cs | 45 +
.../Tasks/RBuild/DependencyTask.cs | 27 +
.../Tasks/RBuild/DeveloperTask.cs | 16 +
.../Tasks/RBuild/DirectoryTask.cs | 59 +
.../Tasks/RBuild/FamilyTask.cs | 28 +
.../Tasks/RBuild/FileTask.cs | 50 +
.../Tasks/RBuild/GroupTask.cs | 13 +
.../Tasks/RBuild/ImportLibraryTask.cs | 50 +
.../Tasks/RBuild/IncludeTask.cs | 42 +
.../Tasks/RBuild/InstalFolder.cs | 31 +
.../Tasks/RBuild/InstallComponent.cs | 39 +
.../Tasks/RBuild/InstallFileTask.cs | 31 +
.../Tasks/RBuild/InstallWallPaperFileTask.cs | 16 +
.../Tasks/RBuild/LanguageTask.cs | 24 +
.../Tasks/RBuild/LibraryTask.cs | 51 +
.../Tasks/RBuild/LinkerFlagTask.cs | 14 +
.../Tasks/RBuild/LinkerScriptTask.cs | 36 +
.../Tasks/RBuild/LocalizationTask.cs | 41 +
.../Tasks/RBuild/MantainterTask.cs | 16 +
.../Tasks/RBuild/MetadataTask.cs | 27 +
.../Tasks/RBuild/ModuleStateTask.cs | 34 +
.../Tasks/RBuild/ModuleTask.cs | 588 ++++
.../Tasks/RBuild/Modules/BuildTool.cs | 17 +
.../Tasks/RBuild/Modules/Cabinet.cs | 17 +
.../Tasks/RBuild/Modules/Kernel.cs | 17 +
.../Tasks/RBuild/Modules/KernelModeDLL.cs | 17 +
.../Tasks/RBuild/Modules/KernelModeDriver.cs | 17 +
.../Tasks/RBuild/Modules/NativeCUI.cs | 17 +
.../Tasks/RBuild/Modules/NativeDLL.cs | 17 +
.../Tasks/RBuild/Modules/ObjectLibrary.cs | 17 +
.../Tasks/RBuild/Modules/Package.cs | 17 +
.../Tasks/RBuild/Modules/StaticLibrary.cs | 17 +
.../Tasks/RBuild/Modules/Win32CUI.cs | 17 +
.../Tasks/RBuild/Modules/Win32Dll.cs | 17 +
.../Tasks/RBuild/Modules/Win32GUI.cs | 17 +
.../Tasks/RBuild/Modules/Win32OCX.cs | 17 +
.../Tasks/RBuild/Modules/Win32SCR.cs | 17 +
.../Tasks/RBuild/OverrideModuleTask.cs | 52 +
.../Tasks/RBuild/PCHTask.cs | 43 +
.../RBuild/Platform/PlatformAutorunTask.cs | 21 +
.../Platform/PlatformDebugChannelTask.cs | 66 +
.../Platform/PlatformDescriptionTask.cs | 16 +
.../RBuild/Platform/PlatformLanguageTask.cs | 25 +
.../RBuild/Platform/PlatformModuleTask.cs | 25 +
.../Tasks/RBuild/Platform/PlatformNameTask.cs | 16 +
.../Platform/PlatformScreenSaverTask.cs | 28 +
.../RBuild/Platform/PlatformShellTask.cs | 29 +
.../RBuild/Platform/PlatformWallpaperTask.cs | 37 +
.../Tasks/RBuild/ProjectTask.cs | 70 +
.../Tasks/RBuild/PropertyTask.cs | 24 +
.../Tasks/RBuild/RBuildTask.cs | 10 +
.../Tasks/RBuild/ReDefineTask.cs | 16 +
.../Tasks/RBuild/RequiresTask.cs | 27 +
.../Tasks/RBuild/SetupTask.cs | 45 +
.../Tasks/RBuild/TargetTask.cs | 18 +
.../Tasks/RBuild/WallPaperTask.cs | 26 +
reactos/tools/sysgen/SysGen.Make/Program.cs | 42 +
.../SysGen.Make/Properties/AssemblyInfo.cs | 33 +
.../sysgen/SysGen.Make/SysGen.Make.csproj | 58 +
.../SysGen.Make/SysGen.Make.csproj.user | 6 +
.../tools/sysgen/SysGen.Make/SysGen.Make.sln | 20 +
.../tools/sysgen/SysGen.Make/SysGen.Make.suo | Bin 0 -> 182272 bytes
.../sysgen/SysGen.Make/SysGen.Make/Program.cs | 13 +
.../SysGen.Make/Properties/AssemblyInfo.cs | 33 +
.../SysGen.Make/SysGen.Make.csproj | 47 +
.../Collections/CommandCollection.cs | 10 +
.../Commands/Base/Command.cs | 16 +
.../Commands/WhoIsCommand.cs | 11 +
.../Properties/AssemblyInfo.cs | 33 +
.../SysGen.RBuild.IRCBot.csproj | 64 +
.../tools/sysgen/SysGen.RBuild.IRCBot/cIRC.cs | 72 +
reactos/tools/sysgen/SysGen.sln | 66 +
.../sysgen/TriStateTreeView/AssemblyInfo.cs | 55 +
.../sysgen/TriStateTreeView/LICENSING.txt | 41 +
.../TriStateTreeView/License_CPLv05.txt | 86 +
.../sysgen/TriStateTreeView/License_GPLv2.txt | 342 ++
.../TriStateTreeView/License_LGPLv21.txt | 506 +++
.../tools/sysgen/TriStateTreeView/SysGen.sln | 75 +
.../tools/sysgen/TriStateTreeView/SysGen.suo | Bin 0 -> 207872 bytes
.../TriStateTreeView/TriStateTreeView.cs | 458 +++
.../TriStateTreeView/TriStateTreeView.csproj | 116 +
.../TriStateTreeView/TriStateTreeView.resx | 166 +
.../TriStateTreeViewDemo/App.ico | Bin 0 -> 1078 bytes
.../TriStateTreeViewDemo/Backup/App.ico | Bin 0 -> 1078 bytes
.../TriStateTreeViewDemo/Backup/Form1.cs | 117 +
.../TriStateTreeViewDemo/Backup/Form1.resx | 139 +
.../Backup/TriStateTreeViewDemo.csproj | 119 +
.../Backup1/AssemblyInfo.cs | 55 +
.../Backup1/TriStateTreeView.cs | 458 +++
.../Backup1/TriStateTreeView.csproj | 120 +
.../Backup1/TriStateTreeView.resx | 166 +
.../Controls/FileSystemTriStateTreeView.cs | 158 +
.../TriStateTreeViewDemo/Form1.cs | 213 ++
.../TriStateTreeViewDemo/Form1.resx | 120 +
.../TriStateTreeViewDemo/RBuildModule.cs | 61 +
.../TriStateTreeViewDemo/RCWriter.cs | 50 +
.../TriStateTreeViewDemo.csproj | 124 +
.../TriStateTreeViewDemo.csproj.user | 5 +
.../TriStateTreeViewDemo.suo | Bin 0 -> 2560 bytes
.../TriStateTreeViewDemo/UpgradeLog.XML | 14 +
.../TriStateTreeViewDemo/UpgradeLog2.XML | 14 +
.../_UpgradeReport_Files/UpgradeReport.css | 207 ++
.../_UpgradeReport_Files/UpgradeReport.xslt | 232 ++
.../UpgradeReport_Minus.gif | Bin 0 -> 69 bytes
.../UpgradeReport_Plus.gif | Bin 0 -> 71 bytes
.../TriStateTreeViewTests/NUnit/.gitignore | 0
.../TriStateTreeViewTests.cs | 258 ++
.../TriStateTreeViewTests.csproj | 110 +
reactos/tools/sysgen/style.css | 105 +
386 files changed, 35340 insertions(+)
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/App.ico
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/AssemblyInfo.cs
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/Backup/App.ico
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/Backup/AssemblyInfo.cs
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/Backup/FileSystemTreeView.cs
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/Backup/FileSystemTreeView.csproj
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/Backup/FileSystemTreeView.csproj.user
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/Backup/FileSystemTreeView.resx
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/Backup/Form1.cs
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/Backup/Form1.resx
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/Backup/ShellIcon.cs
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/Backup/icons/folder.ico
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/FileSystemTreeView.cs
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/FileSystemTreeView.csproj
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/FileSystemTreeView.csproj.user
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/FileSystemTreeView.resx
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/FileSystemTreeView.suo
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/Form1.cs
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/Form1.resx
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/ShellIcon.cs
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/UpgradeLog.XML
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/_UpgradeReport_Files/UpgradeReport.css
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/_UpgradeReport_Files/UpgradeReport.xslt
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/_UpgradeReport_Files/UpgradeReport_Minus.gif
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/_UpgradeReport_Files/UpgradeReport_Plus.gif
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/bin/Debug/DirectoryTreeView.exe
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/bin/Debug/DirectoryTreeView.pdb
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/bin/Debug/DirectoryTreeView.vshost.exe
create mode 100644 reactos/tools/sysgen/FileSystemTreeView/icons/folder.ico
create mode 100644 reactos/tools/sysgen/RosBuilder/Controls/CatalogTriStateTreeView.cs
create mode 100644 reactos/tools/sysgen/RosBuilder/Controls/ModuleFiltersListView.cs
create mode 100644 reactos/tools/sysgen/RosBuilder/Controls/NewItemListView.cs
create mode 100644 reactos/tools/sysgen/RosBuilder/Controls/PlatformTreeView.cs
create mode 100644 reactos/tools/sysgen/RosBuilder/Controls/ProjectTreeView.cs
create mode 100644 reactos/tools/sysgen/RosBuilder/Controls/RegistryEditor.Designer.cs
create mode 100644 reactos/tools/sysgen/RosBuilder/Controls/RegistryEditor.cs
create mode 100644 reactos/tools/sysgen/RosBuilder/Controls/RegistryEditor.resx
create mode 100644 reactos/tools/sysgen/RosBuilder/Form1.Designer.cs
create mode 100644 reactos/tools/sysgen/RosBuilder/Form1.cs
create mode 100644 reactos/tools/sysgen/RosBuilder/Form1.resx
create mode 100644 reactos/tools/sysgen/RosBuilder/Inspectors/PlatformInspector.cs
create mode 100644 reactos/tools/sysgen/RosBuilder/MainForm.Designer.cs
create mode 100644 reactos/tools/sysgen/RosBuilder/MainForm.cs
create mode 100644 reactos/tools/sysgen/RosBuilder/MainForm.resx
create mode 100644 reactos/tools/sysgen/RosBuilder/ModuleFilter.cs
create mode 100644 reactos/tools/sysgen/RosBuilder/NewItemForm.Designer.cs
create mode 100644 reactos/tools/sysgen/RosBuilder/NewItemForm.cs
create mode 100644 reactos/tools/sysgen/RosBuilder/NewItemForm.resx
create mode 100644 reactos/tools/sysgen/RosBuilder/PlatformCatalogReader.cs
create mode 100644 reactos/tools/sysgen/RosBuilder/PlatformController.cs
create mode 100644 reactos/tools/sysgen/RosBuilder/Program.cs
create mode 100644 reactos/tools/sysgen/RosBuilder/Project/Project.cs
create mode 100644 reactos/tools/sysgen/RosBuilder/Project/ProjectReader.cs
create mode 100644 reactos/tools/sysgen/RosBuilder/Project/ProjectWriter.cs
create mode 100644 reactos/tools/sysgen/RosBuilder/ProjectController.cs
create mode 100644 reactos/tools/sysgen/RosBuilder/Properties/AssemblyInfo.cs
create mode 100644 reactos/tools/sysgen/RosBuilder/Properties/Resources.Designer.cs
create mode 100644 reactos/tools/sysgen/RosBuilder/Properties/Resources.resx
create mode 100644 reactos/tools/sysgen/RosBuilder/Properties/Settings.Designer.cs
create mode 100644 reactos/tools/sysgen/RosBuilder/Properties/Settings.settings
create mode 100644 reactos/tools/sysgen/RosBuilder/SysGen.Designer.csproj
create mode 100644 reactos/tools/sysgen/RosBuilder/SysGen.Designer.csproj.user
create mode 100644 reactos/tools/sysgen/RosBuilder/Util/FileAssociation.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Base/RBuildElement.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Collections/RBuildAPIStatusCollection.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Collections/RBuildAuthorCollection.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Collections/RBuildBuildFamilyCollection.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Collections/RBuildContributorCollection.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Collections/RBuildDebugChannelCollection.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Collections/RBuildDefineCollection.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Collections/RBuildExportedFunctionsCollection.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Collections/RBuildFamilyCollection.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Collections/RBuildFileCollection.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Collections/RBuildFolderCollection.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Collections/RBuildIncludeFolderCollection.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Collections/RBuildInstallFolderCollection.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Collections/RBuildLanguageCollection.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Collections/RBuildLocalizationFileCollection.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Collections/RBuildModuleCollection.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Collections/RBuildModuleInfoCollection.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Collections/RBuildPlatformFileCollection.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Collections/RBuildPropertyCollection.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Collections/RBuildSourceFileCollection.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Interfaces/IRBuildInstallable.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Interfaces/IRBuildModulesContainer.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Interfaces/IRBuildNamed.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Interfaces/IRBuildSourceFilesContainer.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Misc/Utility.cs
create mode 100644 reactos/tools/sysgen/RosFramework/NotImplementedYet/RBuildModuleGroup.cs
create mode 100644 reactos/tools/sysgen/RosFramework/NotImplementedYet/RBuildPatch.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Obsolete/PlatformCatalog.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Obsolete/RosArchitecture.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Obsolete/RosOSImage.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Obsolete/RosPlatform.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Obsolete/SoftwareCatalog.cs
create mode 100644 reactos/tools/sysgen/RosFramework/Properties/AssemblyInfo.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildAPIInfo.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildAuthor.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildAutoRegister.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildBootstrapFile.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildBuildFamily.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildCDFile.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildCDFileBase.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildCompilationUnit.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildContributor.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildDebugChannel.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildExportFunction.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildFamily.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildFile.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildImportLibrary.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildInfInstallerFile.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildInstallFile.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildInstallFolder.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildLanguage.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildLocalizationFile.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildMetadata.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildModule.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildModuleGroup.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildModuleInfo.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildPlatform.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildPlatformFile.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildProject.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildProperty.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildRegistryKey.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildSetup.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildSetupFile.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildSolution.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildTarget.cs
create mode 100644 reactos/tools/sysgen/RosFramework/RBuildUnAttendSetup.cs
create mode 100644 reactos/tools/sysgen/RosFramework/SysGen.RBuild.Framework.csproj
create mode 100644 reactos/tools/sysgen/RosFramework/SysGen.RBuild.Framework.csproj.user
create mode 100644 reactos/tools/sysgen/SYSGen/Backends/Backend.cs
create mode 100644 reactos/tools/sysgen/SYSGen/Backends/Catalog/CatalogBackend.cs
create mode 100644 reactos/tools/sysgen/SYSGen/Backends/Mingw/MingwBackend.cs
create mode 100644 reactos/tools/sysgen/SYSGen/Program.cs
create mode 100644 reactos/tools/sysgen/SYSGen/Properties/AssemblyInfo.cs
create mode 100644 reactos/tools/sysgen/SYSGen/SYSGen.csproj
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Attributes/BuildElementArrayAttribute.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Attributes/BuildElementAttribute.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Attributes/ElementNameAttribute.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Attributes/FunctionAttribute.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Attributes/FunctionSetAttribute.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskAttributeAttribute.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskFileSetAttribute.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskNameAttribute.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskOptionSetAttribute.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskPropertyAttribute.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskValueAttribute.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/Base/ValidatorAttribute.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/BooleanValidatorAttribute.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/Int32ValidatorAttribute.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/StringValidatorAttribute.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/UriValidatorAttribute.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/APIDocumentation/APIDocumentation.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Base/Backend.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Base/CompilerBaseBacked.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Base/HtmlDocumenterBaseBacked.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/BaseAddress/BaseAddressReportBackend.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/BuildLogReport/BuildLogReport.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Catalog/CatalogBackend.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Html/HtmlBackend.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/MSVisualStudio/MSVisualStudio.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/MSVisualStudio/VisualStudio/Solution.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/CompilableFile.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/MingwBackend.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/MingwRBuildElementHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/Misc/MakefileWriter.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/Base/MingwRBuildModuleHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwBootLoaderModuleHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwBootSectorModuleHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwBuildToolModuleHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwCabinetModuleHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwEmbeddedTypeLibModuleHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwHostStaticLibraryModuleHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwIdlHeaderModuleHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwKernelModeDLLModuleHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwKernelModeDriverModuleHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwKernelModuleHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwMessageHeaderModuleHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwNativeCUIModuleHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwNativeDLLModuleHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwObjectLibraryModuleHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwPackageModuleHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRBuildProjectHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRpcClientHeaderModuleHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRpcProxyModuleHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRpcServerHeaderModuleHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwStaticLibraryModuleHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32CUIModuleHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32DLLModuleHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32GUIModuleHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32OCXModuleHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/TargetsHandlers/Base/MingwRBuildTargetHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/ProjectTreeReport/ProjectTreeReport.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/RBuildDB/RBuildDBBackend.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/RGenStats/RGenStatBackend.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Backends/WarningReport/WarningReport.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Collections/BackendCollection.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Collections/DefineCollection.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Collections/FileHandlerCollection.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Collections/LogListenerCollection.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Collections/TaskBuilderCollection.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Collections/TaskCollection.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Elements/Base/Element.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Exceptions/BuildException.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Exceptions/ValidationException.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/Base/AutoGeneratedCFileWriter.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/Base/AutoGeneratedFileWriter.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/Base/AutoGeneratedInfFileWriter.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/BuildNumberFileWriter.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/CompilationUnitFileWriter.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/DefinitionFileWriter.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/DffFileWriter.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/HeaderCreditsFileWriter.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/HeaderRosCfgFileWriter.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/SysSetupComponentSetupFileWriter.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/SysSetupFileWriter.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/TxtCreditsFileWriter.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/TxtSetupFileWriter.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/TxtSetupHiveFileWriter.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/UnAttendSetupFileWriter.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Handlers/SysSetupFileHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IBuildStatusMailReporter.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IDirectory.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IElement.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IFileHandler.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IRBuildInstallable.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/ISysGenObject.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/ITask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/ITaskContainer.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Location.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/LocationMap.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Log/Log.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Log/Loggers/ConsoleLogger.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Log/Loggers/StringLogger.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Log/Loggers/XmlLogger.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Plugins/TaskBuilder.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Plugins/TaskFactory.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Properties/AssemblyInfo.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/SysGen.Framework.csproj
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/SysGen.Framework.csproj.user
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/SysGenConversion.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/SysGenDependencyTracker.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/SysGenEngine.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/SysGenPathResolver.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/Base/Task.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/Base/TaskContainer.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Build/XIFallbackTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Build/XIIncludeTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Logic/IfNotTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Logic/IfTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoFilesTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoInstallFilesTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoManifest.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoRegisterTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoResource.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/AuthorBaseTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/AutoFilesTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/CDFileBaseTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/FileBaseTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/FileSystemInfoBaseTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/FolderBaseTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/PlatformFileBaseTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/PropertyBaseTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/RbuildElementBaseTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/ValueBaseTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BaseAdressTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BootSector.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BootstrapFileTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BootstrapTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BuildFamilyTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/CDFileTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/CompilationUnitTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/CompilerFlagTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ComponentTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ContributorTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DebugChannelTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DefineTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DependencyTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DeveloperTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DirectoryTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/FamilyTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/FileTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/GroupTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ImportLibraryTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/IncludeTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstalFolder.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstallComponent.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstallFileTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstallWallPaperFileTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LanguageTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LibraryTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LinkerFlagTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LinkerScriptTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LocalizationTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/MantainterTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/MetadataTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ModuleStateTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ModuleTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/BuildTool.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Cabinet.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Kernel.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/KernelModeDLL.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/KernelModeDriver.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/NativeCUI.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/NativeDLL.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/ObjectLibrary.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Package.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/StaticLibrary.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32CUI.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32Dll.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32GUI.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32OCX.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32SCR.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/OverrideModuleTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/PCHTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformAutorunTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformDebugChannelTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformDescriptionTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformLanguageTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformModuleTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformNameTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformScreenSaverTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformShellTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformWallpaperTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ProjectTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/PropertyTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/RBuildTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ReDefineTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/RequiresTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/SetupTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/TargetTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/WallPaperTask.cs
create mode 100644 reactos/tools/sysgen/SysGen.Make/Program.cs
create mode 100644 reactos/tools/sysgen/SysGen.Make/Properties/AssemblyInfo.cs
create mode 100644 reactos/tools/sysgen/SysGen.Make/SysGen.Make.csproj
create mode 100644 reactos/tools/sysgen/SysGen.Make/SysGen.Make.csproj.user
create mode 100644 reactos/tools/sysgen/SysGen.Make/SysGen.Make.sln
create mode 100644 reactos/tools/sysgen/SysGen.Make/SysGen.Make.suo
create mode 100644 reactos/tools/sysgen/SysGen.Make/SysGen.Make/Program.cs
create mode 100644 reactos/tools/sysgen/SysGen.Make/SysGen.Make/Properties/AssemblyInfo.cs
create mode 100644 reactos/tools/sysgen/SysGen.Make/SysGen.Make/SysGen.Make.csproj
create mode 100644 reactos/tools/sysgen/SysGen.RBuild.IRCBot/Collections/CommandCollection.cs
create mode 100644 reactos/tools/sysgen/SysGen.RBuild.IRCBot/Commands/Base/Command.cs
create mode 100644 reactos/tools/sysgen/SysGen.RBuild.IRCBot/Commands/WhoIsCommand.cs
create mode 100644 reactos/tools/sysgen/SysGen.RBuild.IRCBot/Properties/AssemblyInfo.cs
create mode 100644 reactos/tools/sysgen/SysGen.RBuild.IRCBot/SysGen.RBuild.IRCBot.csproj
create mode 100644 reactos/tools/sysgen/SysGen.RBuild.IRCBot/cIRC.cs
create mode 100644 reactos/tools/sysgen/SysGen.sln
create mode 100644 reactos/tools/sysgen/TriStateTreeView/AssemblyInfo.cs
create mode 100644 reactos/tools/sysgen/TriStateTreeView/LICENSING.txt
create mode 100644 reactos/tools/sysgen/TriStateTreeView/License_CPLv05.txt
create mode 100644 reactos/tools/sysgen/TriStateTreeView/License_GPLv2.txt
create mode 100644 reactos/tools/sysgen/TriStateTreeView/License_LGPLv21.txt
create mode 100644 reactos/tools/sysgen/TriStateTreeView/SysGen.sln
create mode 100644 reactos/tools/sysgen/TriStateTreeView/SysGen.suo
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeView.cs
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeView.csproj
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeView.resx
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeViewDemo/App.ico
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeViewDemo/Backup/App.ico
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeViewDemo/Backup/Form1.cs
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeViewDemo/Backup/Form1.resx
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeViewDemo/Backup/TriStateTreeViewDemo.csproj
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeViewDemo/Backup1/AssemblyInfo.cs
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeViewDemo/Backup1/TriStateTreeView.cs
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeViewDemo/Backup1/TriStateTreeView.csproj
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeViewDemo/Backup1/TriStateTreeView.resx
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeViewDemo/Controls/FileSystemTriStateTreeView.cs
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeViewDemo/Form1.cs
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeViewDemo/Form1.resx
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeViewDemo/RBuildModule.cs
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeViewDemo/RCWriter.cs
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeViewDemo/TriStateTreeViewDemo.csproj
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeViewDemo/TriStateTreeViewDemo.csproj.user
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeViewDemo/TriStateTreeViewDemo.suo
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeViewDemo/UpgradeLog.XML
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeViewDemo/UpgradeLog2.XML
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeViewDemo/_UpgradeReport_Files/UpgradeReport.css
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeViewDemo/_UpgradeReport_Files/UpgradeReport.xslt
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeViewDemo/_UpgradeReport_Files/UpgradeReport_Minus.gif
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeViewDemo/_UpgradeReport_Files/UpgradeReport_Plus.gif
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeViewTests/NUnit/.gitignore
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeViewTests/TriStateTreeViewTests.cs
create mode 100644 reactos/tools/sysgen/TriStateTreeView/TriStateTreeViewTests/TriStateTreeViewTests.csproj
create mode 100644 reactos/tools/sysgen/style.css
diff --git a/reactos/tools/sysgen/FileSystemTreeView/App.ico b/reactos/tools/sysgen/FileSystemTreeView/App.ico
new file mode 100644
index 0000000000000000000000000000000000000000..3a5525fd794f7a7c5c8e6187f470ea3af38cd2b6
GIT binary patch
literal 1078
zcmeHHJr05}7=1t!Hp3A*8IHkVf+j?-!eHY14Gtcw1Eb*_9>Bq^zETJ@GKj{_2j4$w
zo9}xCh!8{T3=X##Skq>ikMjsvB|y%crWBM2iW(4pI}c%z6%lW!=~4v77#3{z!dmB1
z__&l)-{KUYR+|8|;wB^R|9ET$J@(@=#rd^=)qs85?vAy(PSF5CyNkus435LVkZ$rj
zNw|JG-P7^hF<(;#o*Vk}5R#e|^13tBbQkeF?djULtvqyxd3<{9
literal 0
HcmV?d00001
diff --git a/reactos/tools/sysgen/FileSystemTreeView/AssemblyInfo.cs b/reactos/tools/sysgen/FileSystemTreeView/AssemblyInfo.cs
new file mode 100644
index 00000000000..9f89a3282c5
--- /dev/null
+++ b/reactos/tools/sysgen/FileSystemTreeView/AssemblyInfo.cs
@@ -0,0 +1,58 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+//
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+//
+[assembly: AssemblyTitle("")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion("1.0.*")]
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing.
+//
+// Notes:
+// (*) If no key is specified, the assembly is not signed.
+// (*) KeyName refers to a key that has been installed in the Crypto Service
+// Provider (CSP) on your machine. KeyFile refers to a file which contains
+// a key.
+// (*) If the KeyFile and the KeyName values are both specified, the
+// following processing occurs:
+// (1) If the KeyName can be found in the CSP, that key is used.
+// (2) If the KeyName does not exist and the KeyFile does exist, the key
+// in the KeyFile is installed into the CSP and used.
+// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+// When specifying the KeyFile, the location of the KeyFile should be
+// relative to the project output directory which is
+// %Project Directory%\obj\. For example, if your KeyFile is
+// located in the project directory, you would specify the AssemblyKeyFile
+// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
+// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+// documentation for more information on this.
+//
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]
+[assembly: AssemblyKeyName("")]
diff --git a/reactos/tools/sysgen/FileSystemTreeView/Backup/App.ico b/reactos/tools/sysgen/FileSystemTreeView/Backup/App.ico
new file mode 100644
index 0000000000000000000000000000000000000000..3a5525fd794f7a7c5c8e6187f470ea3af38cd2b6
GIT binary patch
literal 1078
zcmeHHJr05}7=1t!Hp3A*8IHkVf+j?-!eHY14Gtcw1Eb*_9>Bq^zETJ@GKj{_2j4$w
zo9}xCh!8{T3=X##Skq>ikMjsvB|y%crWBM2iW(4pI}c%z6%lW!=~4v77#3{z!dmB1
z__&l)-{KUYR+|8|;wB^R|9ET$J@(@=#rd^=)qs85?vAy(PSF5CyNkus435LVkZ$rj
zNw|JG-P7^hF<(;#o*Vk}5R#e|^13tBbQkeF?djULtvqyxd3<{9
literal 0
HcmV?d00001
diff --git a/reactos/tools/sysgen/FileSystemTreeView/Backup/AssemblyInfo.cs b/reactos/tools/sysgen/FileSystemTreeView/Backup/AssemblyInfo.cs
new file mode 100644
index 00000000000..9f89a3282c5
--- /dev/null
+++ b/reactos/tools/sysgen/FileSystemTreeView/Backup/AssemblyInfo.cs
@@ -0,0 +1,58 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+//
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+//
+[assembly: AssemblyTitle("")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion("1.0.*")]
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing.
+//
+// Notes:
+// (*) If no key is specified, the assembly is not signed.
+// (*) KeyName refers to a key that has been installed in the Crypto Service
+// Provider (CSP) on your machine. KeyFile refers to a file which contains
+// a key.
+// (*) If the KeyFile and the KeyName values are both specified, the
+// following processing occurs:
+// (1) If the KeyName can be found in the CSP, that key is used.
+// (2) If the KeyName does not exist and the KeyFile does exist, the key
+// in the KeyFile is installed into the CSP and used.
+// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+// When specifying the KeyFile, the location of the KeyFile should be
+// relative to the project output directory which is
+// %Project Directory%\obj\. For example, if your KeyFile is
+// located in the project directory, you would specify the AssemblyKeyFile
+// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
+// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+// documentation for more information on this.
+//
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]
+[assembly: AssemblyKeyName("")]
diff --git a/reactos/tools/sysgen/FileSystemTreeView/Backup/FileSystemTreeView.cs b/reactos/tools/sysgen/FileSystemTreeView/Backup/FileSystemTreeView.cs
new file mode 100644
index 00000000000..e6c055e9b12
--- /dev/null
+++ b/reactos/tools/sysgen/FileSystemTreeView/Backup/FileSystemTreeView.cs
@@ -0,0 +1,201 @@
+using System;
+using System.IO;
+using System.Windows.Forms;
+using System.ComponentModel;
+using System.Collections;
+using System.Drawing;
+
+namespace C2C.FileSystem
+{
+ ///
+ /// Summary description for DirectoryTreeView.
+ ///
+ ///
+
+ public class FileSystemTreeView : TreeView
+ {
+ private bool _showFiles = true;
+ private ImageList _imageList = new ImageList();
+ private Hashtable _systemIcons = new Hashtable();
+
+ public static readonly int Folder = 0;
+
+ public FileSystemTreeView()
+ {
+ this.ImageList = _imageList;
+ this.MouseDown += new MouseEventHandler(FileSystemTreeView_MouseDown);
+ this.BeforeExpand += new TreeViewCancelEventHandler(FileSystemTreeView_BeforeExpand);
+ }
+
+ void FileSystemTreeView_MouseDown(object sender, MouseEventArgs e)
+ {
+ TreeNode node = this.GetNodeAt(e.X, e.Y);
+
+ if (node == null)
+ return;
+
+ this.SelectedNode = node; //select the node under the mouse
+ }
+
+ void FileSystemTreeView_BeforeExpand(object sender, TreeViewCancelEventArgs e)
+ {
+ if( e.Node is FileNode ) return;
+
+ DirectoryNode node = (DirectoryNode)e.Node;
+
+ if (!node.Loaded)
+ {
+ node.Nodes[0].Remove(); //remove the fake child node used for virtualization
+ node.LoadDirectory();
+ if( this._showFiles == true )
+ node.LoadFiles();
+ }
+ }
+
+ public void Load( string directoryPath )
+ {
+ if( Directory.Exists( directoryPath ) == false )
+ throw new DirectoryNotFoundException( "Directory Not Found" );
+
+ _systemIcons.Clear();
+ _imageList.Images.Clear();
+ Nodes.Clear();
+
+ Icon folderIcon = new Icon( typeof( FileSystemTreeView ), "icons.folder.ico");
+
+ _imageList.Images.Add( folderIcon );
+ _systemIcons.Add( FileSystemTreeView.Folder, 0 );
+
+ DirectoryNode node = new DirectoryNode( this, new DirectoryInfo( directoryPath ) );
+ node.Expand();
+ }
+
+ public int GetIconImageIndex( string path )
+ {
+ string extension = Path.GetExtension( path );
+
+ if( _systemIcons.ContainsKey( extension ) == false )
+ {
+ Icon icon = ShellIcon.GetSmallIcon( path );
+ _imageList.Images.Add( icon );
+ _systemIcons.Add( extension, _imageList.Images.Count-1 );
+ }
+
+ return (int)_systemIcons[ Path.GetExtension( path )];
+ }
+
+ public bool ShowFiles
+ {
+ get{ return this._showFiles; }
+ set{ this._showFiles = value; }
+ }
+ }
+
+ public class DirectoryNode : TreeNode
+ {
+ private DirectoryInfo _directoryInfo;
+
+ public DirectoryNode( DirectoryNode parent, DirectoryInfo directoryInfo ) : base( directoryInfo.Name )
+ {
+ this._directoryInfo = directoryInfo;
+
+ this.ImageIndex = FileSystemTreeView.Folder;
+ this.SelectedImageIndex = this.ImageIndex;
+
+ parent.Nodes.Add( this );
+
+ Virtualize();
+ }
+
+ public DirectoryNode( FileSystemTreeView treeView, DirectoryInfo directoryInfo ) : base( directoryInfo.Name )
+ {
+ this._directoryInfo = directoryInfo;
+
+ this.ImageIndex = FileSystemTreeView.Folder;
+ this.SelectedImageIndex = this.ImageIndex;
+
+ treeView.Nodes.Add( this );
+
+ Virtualize();
+
+ }
+
+ void Virtualize()
+ {
+ int fileCount = 0;
+
+ try
+ {
+ if( this.TreeView.ShowFiles == true )
+ fileCount = this._directoryInfo.GetFiles().Length;
+
+ if( (fileCount + this._directoryInfo.GetDirectories().Length) > 0 )
+ new FakeChildNode( this );
+ }
+ catch
+ {
+ }
+ }
+
+ public void LoadDirectory()
+ {
+ foreach( DirectoryInfo directoryInfo in _directoryInfo.GetDirectories() )
+ {
+ new DirectoryNode( this, directoryInfo );
+ }
+ }
+
+ public void LoadFiles()
+ {
+ foreach( FileInfo file in _directoryInfo.GetFiles() )
+ {
+ new FileNode( this, file );
+ }
+ }
+
+ public bool Loaded
+ {
+ get
+ {
+ if( this.Nodes.Count != 0 )
+ {
+ if( this.Nodes[0] is FakeChildNode )
+ return false;
+ }
+
+ return true;
+ }
+ }
+
+ public new FileSystemTreeView TreeView
+ {
+ get{ return (FileSystemTreeView)base.TreeView; }
+ }
+ }
+
+ public class FileNode : TreeNode
+ {
+ private FileInfo _fileInfo;
+ private DirectoryNode _directoryNode;
+
+ public FileNode( DirectoryNode directoryNode, FileInfo fileInfo ) : base( fileInfo.Name )
+ {
+ this._directoryNode = directoryNode;
+ this._fileInfo = fileInfo;
+
+ this.ImageIndex = ((FileSystemTreeView)_directoryNode.TreeView).GetIconImageIndex( _fileInfo.FullName );
+ this.SelectedImageIndex = this.ImageIndex;
+
+ _directoryNode.Nodes.Add( this );
+ }
+ }
+
+ public class FakeChildNode : TreeNode
+ {
+ public FakeChildNode( TreeNode parent ) : base()
+ {
+ parent.Nodes.Add( this );
+ }
+ }
+
+}
diff --git a/reactos/tools/sysgen/FileSystemTreeView/Backup/FileSystemTreeView.csproj b/reactos/tools/sysgen/FileSystemTreeView/Backup/FileSystemTreeView.csproj
new file mode 100644
index 00000000000..ccafd2eb14c
--- /dev/null
+++ b/reactos/tools/sysgen/FileSystemTreeView/Backup/FileSystemTreeView.csproj
@@ -0,0 +1,143 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/reactos/tools/sysgen/FileSystemTreeView/Backup/FileSystemTreeView.csproj.user b/reactos/tools/sysgen/FileSystemTreeView/Backup/FileSystemTreeView.csproj.user
new file mode 100644
index 00000000000..69ac1936f52
--- /dev/null
+++ b/reactos/tools/sysgen/FileSystemTreeView/Backup/FileSystemTreeView.csproj.user
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/reactos/tools/sysgen/FileSystemTreeView/Backup/FileSystemTreeView.resx b/reactos/tools/sysgen/FileSystemTreeView/Backup/FileSystemTreeView.resx
new file mode 100644
index 00000000000..3f337e081da
--- /dev/null
+++ b/reactos/tools/sysgen/FileSystemTreeView/Backup/FileSystemTreeView.resx
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 1.0.0.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
diff --git a/reactos/tools/sysgen/FileSystemTreeView/Backup/Form1.cs b/reactos/tools/sysgen/FileSystemTreeView/Backup/Form1.cs
new file mode 100644
index 00000000000..b825eb838c0
--- /dev/null
+++ b/reactos/tools/sysgen/FileSystemTreeView/Backup/Form1.cs
@@ -0,0 +1,178 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Data;
+using C2C.FileSystem;
+
+namespace DirectoryTreeView
+{
+ ///
+ /// Summary description for Form1.
+ ///
+ public class Form1 : System.Windows.Forms.Form
+ {
+ private System.Windows.Forms.Panel panel1;
+ private System.Windows.Forms.TextBox txtDirectory;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Button btnDirectory;
+ private C2C.FileSystem.FileSystemTreeView tree;
+ private System.Windows.Forms.Panel treePanel;
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.Container components = null;
+
+ public Form1()
+ {
+ //
+ // Required for Windows Form Designer support
+ //
+ InitializeComponent();
+
+ //
+ // TODO: Add any constructor code after InitializeComponent call
+ //
+ }
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ protected override void Dispose( bool disposing )
+ {
+ if( disposing )
+ {
+ if (components != null)
+ {
+ components.Dispose();
+ }
+ }
+ base.Dispose( disposing );
+ }
+
+ #region Windows Form Designer generated code
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.panel1 = new System.Windows.Forms.Panel();
+ this.btnDirectory = new System.Windows.Forms.Button();
+ this.label1 = new System.Windows.Forms.Label();
+ this.txtDirectory = new System.Windows.Forms.TextBox();
+ this.treePanel = new System.Windows.Forms.Panel();
+ this.panel1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // panel1
+ //
+ this.panel1.Controls.Add(this.btnDirectory);
+ this.panel1.Controls.Add(this.label1);
+ this.panel1.Controls.Add(this.txtDirectory);
+ this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.panel1.Location = new System.Drawing.Point(0, 0);
+ this.panel1.Name = "panel1";
+ this.panel1.Size = new System.Drawing.Size(721, 57);
+ this.panel1.TabIndex = 0;
+ //
+ // btnDirectory
+ //
+ this.btnDirectory.Location = new System.Drawing.Point(615, 27);
+ this.btnDirectory.Name = "btnDirectory";
+ this.btnDirectory.Size = new System.Drawing.Size(30, 21);
+ this.btnDirectory.TabIndex = 2;
+ this.btnDirectory.Text = "...";
+ this.btnDirectory.Click += new System.EventHandler(this.btnDirectory_Click);
+ //
+ // label1
+ //
+ this.label1.Location = new System.Drawing.Point(9, 9);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(102, 18);
+ this.label1.TabIndex = 1;
+ this.label1.Text = "Directory:";
+ //
+ // txtDirectory
+ //
+ this.txtDirectory.Location = new System.Drawing.Point(9, 27);
+ this.txtDirectory.Name = "txtDirectory";
+ this.txtDirectory.Size = new System.Drawing.Size(603, 20);
+ this.txtDirectory.TabIndex = 0;
+ this.txtDirectory.Text = "";
+ this.txtDirectory.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtDirectory_KeyDown);
+ this.txtDirectory.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtDirectory_KeyPress);
+ //
+ // treePanel
+ //
+ this.treePanel.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.treePanel.Location = new System.Drawing.Point(0, 57);
+ this.treePanel.Name = "treePanel";
+ this.treePanel.Size = new System.Drawing.Size(721, 530);
+ this.treePanel.TabIndex = 1;
+ //
+ // Form1
+ //
+ this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+ this.ClientSize = new System.Drawing.Size(721, 587);
+ this.Controls.Add(this.treePanel);
+ this.Controls.Add(this.panel1);
+ this.Name = "Form1";
+ this.Text = "Demo Application";
+ this.Load += new System.EventHandler(this.Form1_Load);
+ this.panel1.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+ #endregion
+
+ ///
+ /// The main entry point for the application.
+ ///
+ [STAThread]
+ static void Main()
+ {
+ Application.Run(new Form1());
+ }
+
+ private void Form1_Load(object sender, System.EventArgs e)
+ {
+ tree = new C2C.FileSystem.FileSystemTreeView();
+ treePanel.Controls.Add( tree );
+ tree.Dock = DockStyle.Fill;
+ //tree.ShowFiles = false;
+ }
+
+
+ private void btnDirectory_Click(object sender, System.EventArgs e)
+ {
+ FolderBrowserDialog dlg = new FolderBrowserDialog();
+
+ if( dlg.ShowDialog() == DialogResult.OK )
+ {
+ txtDirectory.Text = dlg.SelectedPath;
+ tree.Load( txtDirectory.Text );
+ }
+ }
+
+ private void txtDirectory_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
+ {
+
+
+ }
+
+ private void txtDirectory_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
+ {
+ if( e.KeyData == Keys.Enter )
+ {
+ if( System.IO.Directory.Exists( txtDirectory.Text ) == false )
+ {
+ MessageBox.Show( "Directory Does Not Exist", "Invalid Directory", MessageBoxButtons.OK, MessageBoxIcon.Information );
+ return;
+ }
+ tree.Load( txtDirectory.Text );
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/FileSystemTreeView/Backup/Form1.resx b/reactos/tools/sysgen/FileSystemTreeView/Backup/Form1.resx
new file mode 100644
index 00000000000..161c002f2c3
--- /dev/null
+++ b/reactos/tools/sysgen/FileSystemTreeView/Backup/Form1.resx
@@ -0,0 +1,193 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ False
+
+
+ True
+
+
+ Private
+
+
+ 3, 3
+
+
+ True
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ False
+
+
+ True
+
+
+ Private
+
+
+ 3, 3
+
+
+ True
+
+
+ Private
+
+
+ False
+
+
+ (Default)
+
+
+ False
+
+
+ False
+
+
+ 3, 3
+
+
+ True
+
+
+ 80
+
+
+ Form1
+
+
+ True
+
+
+ Private
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/FileSystemTreeView/Backup/ShellIcon.cs b/reactos/tools/sysgen/FileSystemTreeView/Backup/ShellIcon.cs
new file mode 100644
index 00000000000..6dd9f867916
--- /dev/null
+++ b/reactos/tools/sysgen/FileSystemTreeView/Backup/ShellIcon.cs
@@ -0,0 +1,79 @@
+using System;
+using System.Drawing;
+using System.Runtime.InteropServices;
+
+namespace C2C.FileSystem
+{
+ ///
+ /// Summary description for ShellIcon.
+ ///
+ ///
+ /// Summary description for ShellIcon. Get a small or large Icon with an easy C# function call
+ /// that returns a 32x32 or 16x16 System.Drawing.Icon depending on which function you call
+ /// either GetSmallIcon(string fileName) or GetLargeIcon(string fileName)
+ ///
+ public class ShellIcon
+ {
+ [StructLayout(LayoutKind.Sequential)]
+ public struct SHFILEINFO
+ {
+ public IntPtr hIcon;
+ public IntPtr iIcon;
+ public uint dwAttributes;
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
+ public string szDisplayName;
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]
+ public string szTypeName;
+ };
+
+
+ class Win32
+ {
+ public const uint SHGFI_ICON = 0x100;
+ public const uint SHGFI_LARGEICON = 0x0; // 'Large icon
+ public const uint SHGFI_SMALLICON = 0x1; // 'Small icon
+
+
+ [DllImport("shell32.dll")]
+ public static extern IntPtr SHGetFileInfo(string pszPath, uint dwFileAttributes, ref SHFILEINFO psfi, uint cbSizeFileInfo, uint uFlags);
+ }
+
+
+ public ShellIcon()
+ {
+ //
+ // TODO: Add constructor logic here
+ //
+ }
+
+
+ public static Icon GetSmallIcon(string fileName)
+ {
+ IntPtr hImgSmall; //the handle to the system image list
+ SHFILEINFO shinfo = new SHFILEINFO();
+
+
+ //Use this to get the small Icon
+ hImgSmall = Win32.SHGetFileInfo(fileName, 0, ref shinfo,(uint)Marshal.SizeOf(shinfo),Win32.SHGFI_ICON | Win32.SHGFI_SMALLICON);
+
+
+ //The icon is returned in the hIcon member of the shinfo struct
+ return System.Drawing.Icon.FromHandle(shinfo.hIcon);
+ }
+
+
+ public static Icon GetLargeIcon(string fileName)
+ {
+ IntPtr hImgLarge; //the handle to the system image list
+ SHFILEINFO shinfo = new SHFILEINFO();
+
+
+ //Use this to get the large Icon
+ hImgLarge = Win32.SHGetFileInfo(fileName, 0, ref shinfo, (uint)Marshal.SizeOf(shinfo), Win32.SHGFI_ICON | Win32.SHGFI_LARGEICON);
+
+
+ //The icon is returned in the hIcon member of the shinfo struct
+ return System.Drawing.Icon.FromHandle(shinfo.hIcon);
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/FileSystemTreeView/Backup/icons/folder.ico b/reactos/tools/sysgen/FileSystemTreeView/Backup/icons/folder.ico
new file mode 100644
index 0000000000000000000000000000000000000000..c9e4b0b4a38001b92f3820c44b00a942347f8889
GIT binary patch
literal 1406
zcmeH{Jr2S!4255u{$}dL%*ZWZgW
zSJ~0$)`{av1{9yF0)2s13XA|uXbfRYb8)Ac@=NTNN7U=u$4*a+#n}Se3ozf{@UUoZ
z4el=sYZ)IjbYSSfUv)sFh$Jdf7#zHD<^)wB@1^t1vDUhzxU}rZspSC9hxdVv>DXtN
z#+W$&!(aRN=jYr{x}Op16AASttW3PXx^$BA%a%hzhjJzFL+rPA^HbBNv>lBj@eN@5
B9CiQz
literal 0
HcmV?d00001
diff --git a/reactos/tools/sysgen/FileSystemTreeView/FileSystemTreeView.cs b/reactos/tools/sysgen/FileSystemTreeView/FileSystemTreeView.cs
new file mode 100644
index 00000000000..f3da9388b71
--- /dev/null
+++ b/reactos/tools/sysgen/FileSystemTreeView/FileSystemTreeView.cs
@@ -0,0 +1,202 @@
+using System;
+using System.IO;
+using System.Windows.Forms;
+using System.ComponentModel;
+using System.Collections;
+using System.Drawing;
+
+namespace C2C.FileSystem
+{
+ ///
+ /// Summary description for DirectoryTreeView.
+ ///
+ ///
+
+ public class FileSystemTreeView : TreeView
+ {
+ private bool _showFiles = true;
+ private ImageList _imageList = new ImageList();
+ private Hashtable _systemIcons = new Hashtable();
+
+ public static readonly int Folder = 0;
+
+ public FileSystemTreeView()
+ {
+ this.CheckBoxes = true;
+ this.ImageList = _imageList;
+ this.MouseDown += new MouseEventHandler(FileSystemTreeView_MouseDown);
+ this.BeforeExpand += new TreeViewCancelEventHandler(FileSystemTreeView_BeforeExpand);
+ }
+
+ void FileSystemTreeView_MouseDown(object sender, MouseEventArgs e)
+ {
+ TreeNode node = this.GetNodeAt(e.X, e.Y);
+
+ if (node == null)
+ return;
+
+ this.SelectedNode = node; //select the node under the mouse
+ }
+
+ void FileSystemTreeView_BeforeExpand(object sender, TreeViewCancelEventArgs e)
+ {
+ if( e.Node is FileNode ) return;
+
+ DirectoryNode node = (DirectoryNode)e.Node;
+
+ if (!node.Loaded)
+ {
+ node.Nodes[0].Remove(); //remove the fake child node used for virtualization
+ node.LoadDirectory();
+ if( this._showFiles == true )
+ node.LoadFiles();
+ }
+ }
+
+ public void Load( string directoryPath )
+ {
+ if( Directory.Exists( directoryPath ) == false )
+ throw new DirectoryNotFoundException( "Directory Not Found" );
+
+ _systemIcons.Clear();
+ _imageList.Images.Clear();
+ Nodes.Clear();
+
+ Icon folderIcon = new Icon( typeof( FileSystemTreeView ), "icons.folder.ico");
+
+ _imageList.Images.Add( folderIcon );
+ _systemIcons.Add( FileSystemTreeView.Folder, 0 );
+
+ DirectoryNode node = new DirectoryNode( this, new DirectoryInfo( directoryPath ) );
+ node.Expand();
+ }
+
+ public int GetIconImageIndex( string path )
+ {
+ string extension = Path.GetExtension( path );
+
+ if( _systemIcons.ContainsKey( extension ) == false )
+ {
+ Icon icon = ShellIcon.GetSmallIcon( path );
+ _imageList.Images.Add( icon );
+ _systemIcons.Add( extension, _imageList.Images.Count-1 );
+ }
+
+ return (int)_systemIcons[ Path.GetExtension( path )];
+ }
+
+ public bool ShowFiles
+ {
+ get{ return this._showFiles; }
+ set{ this._showFiles = value; }
+ }
+ }
+
+ public class DirectoryNode : TreeNode
+ {
+ private DirectoryInfo _directoryInfo;
+
+ public DirectoryNode( DirectoryNode parent, DirectoryInfo directoryInfo ) : base( directoryInfo.Name )
+ {
+ this._directoryInfo = directoryInfo;
+
+ this.ImageIndex = FileSystemTreeView.Folder;
+ this.SelectedImageIndex = this.ImageIndex;
+
+ parent.Nodes.Add( this );
+
+ Virtualize();
+ }
+
+ public DirectoryNode( FileSystemTreeView treeView, DirectoryInfo directoryInfo ) : base( directoryInfo.Name )
+ {
+ this._directoryInfo = directoryInfo;
+
+ this.ImageIndex = FileSystemTreeView.Folder;
+ this.SelectedImageIndex = this.ImageIndex;
+
+ treeView.Nodes.Add( this );
+
+ Virtualize();
+
+ }
+
+ void Virtualize()
+ {
+ int fileCount = 0;
+
+ try
+ {
+ if( this.TreeView.ShowFiles == true )
+ fileCount = this._directoryInfo.GetFiles().Length;
+
+ if( (fileCount + this._directoryInfo.GetDirectories().Length) > 0 )
+ new FakeChildNode( this );
+ }
+ catch
+ {
+ }
+ }
+
+ public void LoadDirectory()
+ {
+ foreach( DirectoryInfo directoryInfo in _directoryInfo.GetDirectories() )
+ {
+ new DirectoryNode( this, directoryInfo );
+ }
+ }
+
+ public void LoadFiles()
+ {
+ foreach( FileInfo file in _directoryInfo.GetFiles() )
+ {
+ new FileNode( this, file );
+ }
+ }
+
+ public bool Loaded
+ {
+ get
+ {
+ if( this.Nodes.Count != 0 )
+ {
+ if( this.Nodes[0] is FakeChildNode )
+ return false;
+ }
+
+ return true;
+ }
+ }
+
+ public new FileSystemTreeView TreeView
+ {
+ get{ return (FileSystemTreeView)base.TreeView; }
+ }
+ }
+
+ public class FileNode : TreeNode
+ {
+ private FileInfo _fileInfo;
+ private DirectoryNode _directoryNode;
+
+ public FileNode( DirectoryNode directoryNode, FileInfo fileInfo ) : base( fileInfo.Name )
+ {
+ this._directoryNode = directoryNode;
+ this._fileInfo = fileInfo;
+
+ this.ImageIndex = ((FileSystemTreeView)_directoryNode.TreeView).GetIconImageIndex( _fileInfo.FullName );
+ this.SelectedImageIndex = this.ImageIndex;
+
+ _directoryNode.Nodes.Add( this );
+ }
+ }
+
+ public class FakeChildNode : TreeNode
+ {
+ public FakeChildNode( TreeNode parent ) : base()
+ {
+ parent.Nodes.Add( this );
+ }
+ }
+
+}
diff --git a/reactos/tools/sysgen/FileSystemTreeView/FileSystemTreeView.csproj b/reactos/tools/sysgen/FileSystemTreeView/FileSystemTreeView.csproj
new file mode 100644
index 00000000000..66d811ad0ab
--- /dev/null
+++ b/reactos/tools/sysgen/FileSystemTreeView/FileSystemTreeView.csproj
@@ -0,0 +1,124 @@
+
+
+ Local
+ 8.0.50727
+ 2.0
+ {83281176-6B39-4EB8-8CDC-82F018DEED68}
+ Debug
+ AnyCPU
+ App.ico
+
+
+ DirectoryTreeView
+
+
+ JScript
+ Grid
+ IE50
+ false
+ WinExe
+ C2C.FileSystem
+ OnBuildSuccess
+
+
+
+
+
+
+
+
+ bin\Debug\
+ false
+ 285212672
+ false
+
+
+ DEBUG;TRACE
+
+
+ true
+ 4096
+ false
+
+
+ false
+ false
+ false
+ false
+ 4
+ full
+ prompt
+
+
+ bin\Release\
+ false
+ 285212672
+ false
+
+
+ TRACE
+
+
+ false
+ 4096
+ false
+
+
+ true
+ false
+ false
+ false
+ 4
+ none
+ prompt
+
+
+
+ System
+
+
+ System.Data
+
+
+ System.DirectoryServices
+
+
+ System.Drawing
+
+
+ System.Windows.Forms
+
+
+ System.XML
+
+
+
+
+
+ Code
+
+
+ Component
+
+
+ Form
+
+
+ Code
+
+
+ FileSystemTreeView.cs
+
+
+ Form1.cs
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/FileSystemTreeView/FileSystemTreeView.csproj.user b/reactos/tools/sysgen/FileSystemTreeView/FileSystemTreeView.csproj.user
new file mode 100644
index 00000000000..d9bb8387dbc
--- /dev/null
+++ b/reactos/tools/sysgen/FileSystemTreeView/FileSystemTreeView.csproj.user
@@ -0,0 +1,58 @@
+
+
+ 7.10.3077
+ Debug
+ AnyCPU
+
+
+
+
+
+
+ 0
+ ProjectFiles
+ 0
+
+
+ false
+ false
+ false
+ false
+ false
+
+
+ Project
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+ false
+ false
+ false
+ false
+ false
+
+
+ Project
+
+
+
+
+
+
+
+
+
+
+ false
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/FileSystemTreeView/FileSystemTreeView.resx b/reactos/tools/sysgen/FileSystemTreeView/FileSystemTreeView.resx
new file mode 100644
index 00000000000..3f337e081da
--- /dev/null
+++ b/reactos/tools/sysgen/FileSystemTreeView/FileSystemTreeView.resx
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 1.0.0.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
diff --git a/reactos/tools/sysgen/FileSystemTreeView/FileSystemTreeView.suo b/reactos/tools/sysgen/FileSystemTreeView/FileSystemTreeView.suo
new file mode 100644
index 0000000000000000000000000000000000000000..df5e95f4d885bd8c4655ffd0810e2258e0b7a61e
GIT binary patch
literal 2560
zcmca`Uhu)fjZzO8(10BSGsD0CoD6J8;*3Bx2!nwD0|OI~0pkDr|NlQkkbwcn90fxt
z1pWfu3W`4%9zsqZbt)A?Ac!F!2um0g7+e|hfOHWzD+eeV3@lxW!J@egAz*c>3}HaIRG>cM
kROvA!15IFH*e3V3O&mxMwEeKuK~kV0DW+6El2K$a0k4%X7XSbN
literal 0
HcmV?d00001
diff --git a/reactos/tools/sysgen/FileSystemTreeView/Form1.cs b/reactos/tools/sysgen/FileSystemTreeView/Form1.cs
new file mode 100644
index 00000000000..b825eb838c0
--- /dev/null
+++ b/reactos/tools/sysgen/FileSystemTreeView/Form1.cs
@@ -0,0 +1,178 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Data;
+using C2C.FileSystem;
+
+namespace DirectoryTreeView
+{
+ ///
+ /// Summary description for Form1.
+ ///
+ public class Form1 : System.Windows.Forms.Form
+ {
+ private System.Windows.Forms.Panel panel1;
+ private System.Windows.Forms.TextBox txtDirectory;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Button btnDirectory;
+ private C2C.FileSystem.FileSystemTreeView tree;
+ private System.Windows.Forms.Panel treePanel;
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.Container components = null;
+
+ public Form1()
+ {
+ //
+ // Required for Windows Form Designer support
+ //
+ InitializeComponent();
+
+ //
+ // TODO: Add any constructor code after InitializeComponent call
+ //
+ }
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ protected override void Dispose( bool disposing )
+ {
+ if( disposing )
+ {
+ if (components != null)
+ {
+ components.Dispose();
+ }
+ }
+ base.Dispose( disposing );
+ }
+
+ #region Windows Form Designer generated code
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.panel1 = new System.Windows.Forms.Panel();
+ this.btnDirectory = new System.Windows.Forms.Button();
+ this.label1 = new System.Windows.Forms.Label();
+ this.txtDirectory = new System.Windows.Forms.TextBox();
+ this.treePanel = new System.Windows.Forms.Panel();
+ this.panel1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // panel1
+ //
+ this.panel1.Controls.Add(this.btnDirectory);
+ this.panel1.Controls.Add(this.label1);
+ this.panel1.Controls.Add(this.txtDirectory);
+ this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.panel1.Location = new System.Drawing.Point(0, 0);
+ this.panel1.Name = "panel1";
+ this.panel1.Size = new System.Drawing.Size(721, 57);
+ this.panel1.TabIndex = 0;
+ //
+ // btnDirectory
+ //
+ this.btnDirectory.Location = new System.Drawing.Point(615, 27);
+ this.btnDirectory.Name = "btnDirectory";
+ this.btnDirectory.Size = new System.Drawing.Size(30, 21);
+ this.btnDirectory.TabIndex = 2;
+ this.btnDirectory.Text = "...";
+ this.btnDirectory.Click += new System.EventHandler(this.btnDirectory_Click);
+ //
+ // label1
+ //
+ this.label1.Location = new System.Drawing.Point(9, 9);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(102, 18);
+ this.label1.TabIndex = 1;
+ this.label1.Text = "Directory:";
+ //
+ // txtDirectory
+ //
+ this.txtDirectory.Location = new System.Drawing.Point(9, 27);
+ this.txtDirectory.Name = "txtDirectory";
+ this.txtDirectory.Size = new System.Drawing.Size(603, 20);
+ this.txtDirectory.TabIndex = 0;
+ this.txtDirectory.Text = "";
+ this.txtDirectory.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtDirectory_KeyDown);
+ this.txtDirectory.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtDirectory_KeyPress);
+ //
+ // treePanel
+ //
+ this.treePanel.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.treePanel.Location = new System.Drawing.Point(0, 57);
+ this.treePanel.Name = "treePanel";
+ this.treePanel.Size = new System.Drawing.Size(721, 530);
+ this.treePanel.TabIndex = 1;
+ //
+ // Form1
+ //
+ this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+ this.ClientSize = new System.Drawing.Size(721, 587);
+ this.Controls.Add(this.treePanel);
+ this.Controls.Add(this.panel1);
+ this.Name = "Form1";
+ this.Text = "Demo Application";
+ this.Load += new System.EventHandler(this.Form1_Load);
+ this.panel1.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+ #endregion
+
+ ///
+ /// The main entry point for the application.
+ ///
+ [STAThread]
+ static void Main()
+ {
+ Application.Run(new Form1());
+ }
+
+ private void Form1_Load(object sender, System.EventArgs e)
+ {
+ tree = new C2C.FileSystem.FileSystemTreeView();
+ treePanel.Controls.Add( tree );
+ tree.Dock = DockStyle.Fill;
+ //tree.ShowFiles = false;
+ }
+
+
+ private void btnDirectory_Click(object sender, System.EventArgs e)
+ {
+ FolderBrowserDialog dlg = new FolderBrowserDialog();
+
+ if( dlg.ShowDialog() == DialogResult.OK )
+ {
+ txtDirectory.Text = dlg.SelectedPath;
+ tree.Load( txtDirectory.Text );
+ }
+ }
+
+ private void txtDirectory_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
+ {
+
+
+ }
+
+ private void txtDirectory_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
+ {
+ if( e.KeyData == Keys.Enter )
+ {
+ if( System.IO.Directory.Exists( txtDirectory.Text ) == false )
+ {
+ MessageBox.Show( "Directory Does Not Exist", "Invalid Directory", MessageBoxButtons.OK, MessageBoxIcon.Information );
+ return;
+ }
+ tree.Load( txtDirectory.Text );
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/FileSystemTreeView/Form1.resx b/reactos/tools/sysgen/FileSystemTreeView/Form1.resx
new file mode 100644
index 00000000000..161c002f2c3
--- /dev/null
+++ b/reactos/tools/sysgen/FileSystemTreeView/Form1.resx
@@ -0,0 +1,193 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ False
+
+
+ True
+
+
+ Private
+
+
+ 3, 3
+
+
+ True
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ False
+
+
+ True
+
+
+ Private
+
+
+ 3, 3
+
+
+ True
+
+
+ Private
+
+
+ False
+
+
+ (Default)
+
+
+ False
+
+
+ False
+
+
+ 3, 3
+
+
+ True
+
+
+ 80
+
+
+ Form1
+
+
+ True
+
+
+ Private
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/FileSystemTreeView/ShellIcon.cs b/reactos/tools/sysgen/FileSystemTreeView/ShellIcon.cs
new file mode 100644
index 00000000000..6dd9f867916
--- /dev/null
+++ b/reactos/tools/sysgen/FileSystemTreeView/ShellIcon.cs
@@ -0,0 +1,79 @@
+using System;
+using System.Drawing;
+using System.Runtime.InteropServices;
+
+namespace C2C.FileSystem
+{
+ ///
+ /// Summary description for ShellIcon.
+ ///
+ ///
+ /// Summary description for ShellIcon. Get a small or large Icon with an easy C# function call
+ /// that returns a 32x32 or 16x16 System.Drawing.Icon depending on which function you call
+ /// either GetSmallIcon(string fileName) or GetLargeIcon(string fileName)
+ ///
+ public class ShellIcon
+ {
+ [StructLayout(LayoutKind.Sequential)]
+ public struct SHFILEINFO
+ {
+ public IntPtr hIcon;
+ public IntPtr iIcon;
+ public uint dwAttributes;
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
+ public string szDisplayName;
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]
+ public string szTypeName;
+ };
+
+
+ class Win32
+ {
+ public const uint SHGFI_ICON = 0x100;
+ public const uint SHGFI_LARGEICON = 0x0; // 'Large icon
+ public const uint SHGFI_SMALLICON = 0x1; // 'Small icon
+
+
+ [DllImport("shell32.dll")]
+ public static extern IntPtr SHGetFileInfo(string pszPath, uint dwFileAttributes, ref SHFILEINFO psfi, uint cbSizeFileInfo, uint uFlags);
+ }
+
+
+ public ShellIcon()
+ {
+ //
+ // TODO: Add constructor logic here
+ //
+ }
+
+
+ public static Icon GetSmallIcon(string fileName)
+ {
+ IntPtr hImgSmall; //the handle to the system image list
+ SHFILEINFO shinfo = new SHFILEINFO();
+
+
+ //Use this to get the small Icon
+ hImgSmall = Win32.SHGetFileInfo(fileName, 0, ref shinfo,(uint)Marshal.SizeOf(shinfo),Win32.SHGFI_ICON | Win32.SHGFI_SMALLICON);
+
+
+ //The icon is returned in the hIcon member of the shinfo struct
+ return System.Drawing.Icon.FromHandle(shinfo.hIcon);
+ }
+
+
+ public static Icon GetLargeIcon(string fileName)
+ {
+ IntPtr hImgLarge; //the handle to the system image list
+ SHFILEINFO shinfo = new SHFILEINFO();
+
+
+ //Use this to get the large Icon
+ hImgLarge = Win32.SHGetFileInfo(fileName, 0, ref shinfo, (uint)Marshal.SizeOf(shinfo), Win32.SHGFI_ICON | Win32.SHGFI_LARGEICON);
+
+
+ //The icon is returned in the hIcon member of the shinfo struct
+ return System.Drawing.Icon.FromHandle(shinfo.hIcon);
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/FileSystemTreeView/UpgradeLog.XML b/reactos/tools/sysgen/FileSystemTreeView/UpgradeLog.XML
new file mode 100644
index 00000000000..e913238577e
--- /dev/null
+++ b/reactos/tools/sysgen/FileSystemTreeView/UpgradeLog.XML
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/FileSystemTreeView/_UpgradeReport_Files/UpgradeReport.css b/reactos/tools/sysgen/FileSystemTreeView/_UpgradeReport_Files/UpgradeReport.css
new file mode 100644
index 00000000000..fae98af0a86
--- /dev/null
+++ b/reactos/tools/sysgen/FileSystemTreeView/_UpgradeReport_Files/UpgradeReport.css
@@ -0,0 +1,207 @@
+BODY
+{
+ BACKGROUND-COLOR: white;
+ FONT-FAMILY: "Verdana", sans-serif;
+ FONT-SIZE: 100%;
+ MARGIN-LEFT: 0px;
+ MARGIN-TOP: 0px
+}
+P
+{
+ FONT-FAMILY: "Verdana", sans-serif;
+ FONT-SIZE: 70%;
+ LINE-HEIGHT: 12pt;
+ MARGIN-BOTTOM: 0px;
+ MARGIN-LEFT: 10px;
+ MARGIN-TOP: 10px
+}
+.note
+{
+ BACKGROUND-COLOR: #ffffff;
+ COLOR: #336699;
+ FONT-FAMILY: "Verdana", sans-serif;
+ FONT-SIZE: 100%;
+ MARGIN-BOTTOM: 0px;
+ MARGIN-LEFT: 0px;
+ MARGIN-TOP: 0px;
+ PADDING-RIGHT: 10px
+}
+.infotable
+{
+ BACKGROUND-COLOR: #f0f0e0;
+ BORDER-BOTTOM: #ffffff 0px solid;
+ BORDER-COLLAPSE: collapse;
+ BORDER-LEFT: #ffffff 0px solid;
+ BORDER-RIGHT: #ffffff 0px solid;
+ BORDER-TOP: #ffffff 0px solid;
+ FONT-SIZE: 70%;
+ MARGIN-LEFT: 10px
+}
+.issuetable
+{
+ BACKGROUND-COLOR: #ffffe8;
+ BORDER-COLLAPSE: collapse;
+ COLOR: #000000;
+ FONT-SIZE: 100%;
+ MARGIN-BOTTOM: 10px;
+ MARGIN-LEFT: 13px;
+ MARGIN-TOP: 0px
+}
+.issuetitle
+{
+ BACKGROUND-COLOR: #ffffff;
+ BORDER-BOTTOM: #dcdcdc 1px solid;
+ BORDER-TOP: #dcdcdc 1px;
+ COLOR: #003366;
+ FONT-WEIGHT: normal
+}
+.header
+{
+ BACKGROUND-COLOR: #cecf9c;
+ BORDER-BOTTOM: #ffffff 1px solid;
+ BORDER-LEFT: #ffffff 1px solid;
+ BORDER-RIGHT: #ffffff 1px solid;
+ BORDER-TOP: #ffffff 1px solid;
+ COLOR: #000000;
+ FONT-WEIGHT: bold
+}
+.issuehdr
+{
+ BACKGROUND-COLOR: #E0EBF5;
+ BORDER-BOTTOM: #dcdcdc 1px solid;
+ BORDER-TOP: #dcdcdc 1px solid;
+ COLOR: #000000;
+ FONT-WEIGHT: normal
+}
+.issuenone
+{
+ BACKGROUND-COLOR: #ffffff;
+ BORDER-BOTTOM: 0px;
+ BORDER-LEFT: 0px;
+ BORDER-RIGHT: 0px;
+ BORDER-TOP: 0px;
+ COLOR: #000000;
+ FONT-WEIGHT: normal
+}
+.content
+{
+ BACKGROUND-COLOR: #e7e7ce;
+ BORDER-BOTTOM: #ffffff 1px solid;
+ BORDER-LEFT: #ffffff 1px solid;
+ BORDER-RIGHT: #ffffff 1px solid;
+ BORDER-TOP: #ffffff 1px solid;
+ PADDING-LEFT: 3px
+}
+.issuecontent
+{
+ BACKGROUND-COLOR: #ffffff;
+ BORDER-BOTTOM: #dcdcdc 1px solid;
+ BORDER-TOP: #dcdcdc 1px solid;
+ PADDING-LEFT: 3px
+}
+A:link
+{
+ COLOR: #cc6633;
+ TEXT-DECORATION: underline
+}
+A:visited
+{
+ COLOR: #cc6633;
+}
+A:active
+{
+ COLOR: #cc6633;
+}
+A:hover
+{
+ COLOR: #cc3300;
+ TEXT-DECORATION: underline
+}
+H1
+{
+ BACKGROUND-COLOR: #003366;
+ BORDER-BOTTOM: #336699 6px solid;
+ COLOR: #ffffff;
+ FONT-SIZE: 130%;
+ FONT-WEIGHT: normal;
+ MARGIN: 0em 0em 0em -20px;
+ PADDING-BOTTOM: 8px;
+ PADDING-LEFT: 30px;
+ PADDING-TOP: 16px
+}
+H2
+{
+ COLOR: #000000;
+ FONT-SIZE: 80%;
+ FONT-WEIGHT: bold;
+ MARGIN-BOTTOM: 3px;
+ MARGIN-LEFT: 10px;
+ MARGIN-TOP: 20px;
+ PADDING-LEFT: 0px
+}
+H3
+{
+ COLOR: #000000;
+ FONT-SIZE: 80%;
+ FONT-WEIGHT: bold;
+ MARGIN-BOTTOM: -5px;
+ MARGIN-LEFT: 10px;
+ MARGIN-TOP: 20px
+}
+H4
+{
+ COLOR: #000000;
+ FONT-SIZE: 70%;
+ FONT-WEIGHT: bold;
+ MARGIN-BOTTOM: 0px;
+ MARGIN-TOP: 15px;
+ PADDING-BOTTOM: 0px
+}
+UL
+{
+ COLOR: #000000;
+ FONT-SIZE: 70%;
+ LIST-STYLE: square;
+ MARGIN-BOTTOM: 0pt;
+ MARGIN-TOP: 0pt
+}
+OL
+{
+ COLOR: #000000;
+ FONT-SIZE: 70%;
+ LIST-STYLE: square;
+ MARGIN-BOTTOM: 0pt;
+ MARGIN-TOP: 0pt
+}
+LI
+{
+ LIST-STYLE: square;
+ MARGIN-LEFT: 0px
+}
+.expandable
+{
+ CURSOR: hand
+}
+.expanded
+{
+ color: black
+}
+.collapsed
+{
+ DISPLAY: none
+}
+.foot
+{
+BACKGROUND-COLOR: #ffffff;
+BORDER-BOTTOM: #cecf9c 1px solid;
+BORDER-TOP: #cecf9c 2px solid
+}
+.settings
+{
+MARGIN-LEFT: 25PX;
+}
+.help
+{
+TEXT-ALIGN: right;
+margin-right: 10px;
+}
diff --git a/reactos/tools/sysgen/FileSystemTreeView/_UpgradeReport_Files/UpgradeReport.xslt b/reactos/tools/sysgen/FileSystemTreeView/_UpgradeReport_Files/UpgradeReport.xslt
new file mode 100644
index 00000000000..83f4304ab60
--- /dev/null
+++ b/reactos/tools/sysgen/FileSystemTreeView/_UpgradeReport_Files/UpgradeReport.xslt
@@ -0,0 +1,232 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Solution:
+ Project:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ javascript:document.images[''].click() src
+ |
+
+
+
+ Converted
+
+
+
+ Converted
+
+ |
+ |
+ |
+
+
+
+ src
+
+
+
+
+ | Conversion Issues - : |
+
+
+
+
+
+ |
+
+ |
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | : |
+
+
+
+
+
+
+
+
+ Conversion Report
+
+
+
+
+
+
+
+ Conversion Report -
+
+
+ Time of Conversion:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+ Conversion Settings
+ |
+
+
+
+
+
+
+
diff --git a/reactos/tools/sysgen/FileSystemTreeView/_UpgradeReport_Files/UpgradeReport_Minus.gif b/reactos/tools/sysgen/FileSystemTreeView/_UpgradeReport_Files/UpgradeReport_Minus.gif
new file mode 100644
index 0000000000000000000000000000000000000000..17751cb2fd5c284dfe984adc4c769982f73a0a66
GIT binary patch
literal 69
zcmZ?wbhEHb23ky~TYXIqG7FYlP
literal 0
HcmV?d00001
diff --git a/reactos/tools/sysgen/FileSystemTreeView/bin/Debug/DirectoryTreeView.exe b/reactos/tools/sysgen/FileSystemTreeView/bin/Debug/DirectoryTreeView.exe
new file mode 100644
index 0000000000000000000000000000000000000000..c893a8ea1219632646c606c327780e5da4d2a98b
GIT binary patch
literal 32768
zcmeHQ3wRvGk*=9t%|0y4mTXHhmeCqxBU|>y!ZyZ$!LsCsK$2yzFm^D=EA2>Hyt|{!
z?Aj7O6DbcK36~EDkAsjqLLecRO9Bb6JRlAM5;)>7KuEZJJd%)ngyc(rFWdzJXWw7d
zvoA^Jec#9Bw$0RZRaaM6S9e$UboYvm4_`(eBJ$!ne36XmI@D{1>`W>YPlZ}HM?y&}W`?Iu4Ib-??pjaO
zu6d{;a_5F@X}_WhZHne6>H;OCsGU(aJ}P*n(5EZCnZo)@H~Mu}eXab#S$fv6m$f7nG-H!kT-(GU@8kPCj`n{pUYIBgE6fp<3pAWiD(>J3an
zh-g>XcI-Z2qT47U%(DwmL0F6C3fpGF0we26H{fBuAv^_PEz!CHv=l8_pk#rP1xgku
zS)gQrk_Ac@C|RInfszGE7WjW;fo1$%jlkcgI+f9_8;KsNCDMQgh>Q~#6AjO0j<**U
z>katw41#$v%~)1OD-eUMN~+Qh&B8{5u2)xSzDqgQPzlD6hSUapy&J(QZ6D&^hANQD
z8_B=;ZRKa_N63G)(q(b4K6C#xNY)#wMK!$vU*-mDNYGKI58;iyf=cpKAJT%x(z&GX
zWB!?fRk)Z{qw1x58epFwa(k9}X+CNqL3d_@x*s<4>dsLd#iux;b2vIhqS!wO?uThW
z72XPt?&BO5EF6SI)Ju_$21(z?Lacg8EhMwRNysd`kX&Ph@>#2^oq52lWAY>$#v8Kc
z=Lw-lVTk(G4z_24)`C2}+FGa()+aQ;Omm8)G2MpIa?+Ske{}t?TD={dVdE^C}@RAwqyW-(W$QB{T+L5C#_X9?4nDmr(DIoal7q#Dgo
z*j`MtKT@C<6QsRDRZy--HBQP_drtjSl@^wQRE{&UIU3OUx#y|g#`)a-<5Hw|s{Utx
z5`{OY&SGDluPSPTN~tDmSf*;j*{Urx4`f$2$b0b#E
z*jTIYJ3=wg7iIK{lR!B&`{5tq0ZvA?{m=x_Q#cB*2M4tVQD$m5l_R>ok2xC9XBjzU
zV1OCUT3`*$SrVif&N?Q+G{`G;@`!JPSFI%7YqcW5YprLV4FEv{j!oH1Z}jU%16;mq
z3!Tn|o@L4wm=b~+cuIZdA$E)~uim)cYcV;Eol+gfhjTMP{}35g8_3nx>44T50HDCf
z889GMS7rAZ791m+p6%|TYfu(2_+7DWxqs;tJD|~!(+&aW>-*RwRtF1HcCb2G`eq?C
zba8wO$A1bLdc#&k?IzBR?c5+dCtFT(7*;p4DR~#n0Qpi_M5`8PVWcC?hi`apZ_`(Z#Y;BK#ad;d%55DnfM_uTJyKu<|;1?m(R;O73IY|
zJ!xK@;0*}#48~mpj|eLUpfsQ7lGGr{K)L+D@>T~M%cw?LSG79|=eB1#CPbvUkGsie
zYY(CQB#dio&wf>To9xXmsZx{d$>lXGB
zjExK6BzR?~(R5f}L%R-wg5szF4>w2%57RlUMYBu@(JN_pa<`E0cGWB4BHp_sw9T}gxRqLSe0UlETM}x?B+?n%T$3_0X*-%&66(tICgOc(
zm?PcRZZox}ch#!s%D$B+G_78~!d!OZ>iH83%cRorq?s)}Vy4+n^>|qO^IZNGTmopd
zlHm?B*=yR(>9ig1&7@6dNk}og532RMMYY<|z46pQI1)eK%!&`Y#CKE7vgQ3N`&ach
zHN{pgi!P5Q-C{N-tlnrMett9!gN9u@wx#;5_toBA&8__3^7cP|(s<;Oi+com(1Dy8F=GH{bKh>n|Q`>aKceR%^{`b8n1zyRUu2JO9PM8rx>x
z5*Yg4Z54C2e6!-E$6u=O{8^h``Sd9>uAF;a&88)@7yN$zCztos^{sy{{B-+{{zB
zKEG+p1vdMu&S6Zw}wZ(}d@zpsn%}J&(4I;e91&
zI}sm7o)vg*M!Eyq7m>CS^n;*b*-q0DuSQxq=vN{BGUyRJ2Z8s4{#C^91^tg$h%Y&o
z(lkhM2nu7tYf?W&DMJZRJIJCKQu^_jSh#ahxU^B6!3O(Y+KA*hm_I+BA)63E^7)YR
zFXI{7kv~NPC^8CYQVaAurm%>1Xwiqngh+_u!!H50Z$b6iiEO)(6r($kII}RZ6Zw-!
zx(f-R!h{IQj^bKJHwwwBdhd9qZd5KxBiPb2p~C>Im8Jt=T39G4%f$7ur6z4q+k*TD
zz*Gp=3CqRM_kg8vn%tcddJ}7mmHaOVte)@LpTAAd!bYUeeSK*
z@nD^ORB@I<6>dOss5p6Iu{VM#JcMFXZ@bvjuw*`Ze3s(A_tZp|Y?Eet-!ou2s#r>)
z@*l&8MyNP>qVk^r(=o+Nll7u`_}EyHmew|L7b#oUw>I#6WIT5AjK%dma3sd@wZ0FG
zp~)l`*1aFQEej`OnrMMRur^G_I+-2Hun~1qnugKi-%aoLAv@GMQue|c+yvGoM`oQ^
zk1rv^T7tjfPol&8=1>mjNNw-iyvZNXRPWAeN1CUZ$G0b%$e2AnoMjTrc
z0B>0($&1z7^5ffE+FE_C?On^E1izmP;wQkOz05zkYFRU27lo!JdlGRc9Wl{j(X?e3
zwPa;q#z|XAcLCRl7Mg;Ff(4GyL{pPJO2KGqpskg+Ls&1(k1rNPmS{n#F01HeBfPz4
zmqHT&YpXd+knnT5q1wDUgb$RIECy
zAx1+y6;F@2}0QCnc(+m}4Q8ND@tO=}74R`|&V9*)_-bQzwcY13F`M*QqE
zrm^lhtdfOs9Sj^`khaXgnFVQ02F^N2JKn%%Drw6N>;RLt!oXfMX)BF-ew|>1__fNI
z$FCEOWB9dtiVlsmGIpL#y5`3`34E;-_d%V;KiKM(Y=~zDY}@^xSU!Hx2d`FY
zW3@H+9zGFDZTy}-13%dF2fQc3?RY-$`{tr4fV=O@I`uXdyn+==;Q0=TWH_nm|xxZ=4`G}X7N*nM%yqx&*B8Z;>JiMObMIQ2H?=A?9
zzkWDh_F+K*-^>KYezCQt;0%*`KAJ=Oy=%_oOf!_op7p6oxo)R*9f!#4I1@d
z>sxF6#D
zpF+3~P$uypu43St6nch+Uu1fa#{H@cvb@51I`)aCA{FO(Nb5zuO1vus%K)22Gtr|s
z?c;*YqPc=yDp(DAnL%^3xq$No9;b!Kn7%@r54a9++h_+U+eWtw90b(pQkfAyr?n#f
zb!`*i_q2AvhqNxhgOd8H){Xep`X0cq>LY-U>-*^h`jtM0_zj+$0RQH>576sHmgGd2(D;-6Hf{oEP&^PPoXDW@pBiQsss=OZy)~+!B
zV<@kVu5_`dJ$D1UU15;F_s>2|;}`XQi3
z4-1^(XP%<~HF_`civujdk8engRtj7Ps8gH7Zz_mCAo0hAzApF`dY-O;?_>CF!0q${
zi9aOpQGx#<@Ye!g5csmd*92-B=M4ZpNwWc;#W>+!8bE507HRX1-{RC{vGD>mf&N!&
z20TPt0I#6g!m|TCFo-z!!_`9BBCt(hv*OX7!bkoN?G0nP7RBd(wYEd6@y*pf0y)Pb
zzR$S_>_$|J6Z8pxungIV@
z;4i_sLwnA*ovsB>kiMWz^GCF=Nc=YKbpH;-&-C|zryuYml=h#eJ*0igKcqdX-Q&+_
zBcl13zMsNy(3+sbL8JzJ
zKi9^vaq^UQEhtyeBGQ6rDZMKA2hi(-FM_8rcn#vifmgI9y+7E4vJ|Hkd=~r{AaxP_
zBjT^2Ej0aF`dZKjcxP~`{+h;l7tzz6CcR02%FWCDp_Uc`)=?v1h?e0bt%Xk3!|)*t
zX9%1laJj&f1)eSN41p1WyQvxc`*2DoLEsZ~4`?$mPBqL19>nKhoa)fkN1sBL01a#K
z!=pU9h@J>e`!Ze#YG*~o8ESN$Aj%6Xx+Z7U*;R+4RbWlQp_uQBDiM%Nc>yEzV(})J
z+pwZKfL$P_HzLj&dR6XII;>bGVV+8@aog;}-ttJdZJOKS=H9S5Y*J*pVOlR?SH_2|%L@AWdlNFq2>cpiAVNj9iZnI@Do`?yS
zz4JkCft!2JgMPG)k8rw2hM=0dHG7j(jK)3Oi39O7#A4Zo4@fv&iSozXDAUJ;k|ZXtc^q?n>KD}>uGD*+zIn=w7q%j
z#`Ohwq@%gLJ&T)ZHVt+PE$WJ<%mfWFY$D$HUuWSsZaAH56Kaq4f+NAOiPmM(X|zah
zI+bTgqpHL}$#RX;g2NUoh5dH4GV-@rsdO}+GHv41A4zb~8V)wNO=`o|cAPJSn7Lfk
z0d88q2LhUHEXJjcd)lpNtf=sw7TmbmO}KN@Wt)zZ=P#^6Pd1tPj?B_(?M+dSGidE)
z>p0Ywj1HLXIQ*aV5r0{I-X^E!#%*2~!T4(lKwz+;7Ef*s(3wjV2ELyjvV&*UnnCYHKt~yQ;mZ!Tl
zYTKM29MUs-V%cFS=(f0>&PW?carx%w!j-|eJjTqJ6rHV&@Pn4?b3Ogp-j^>!#)_-T
zRspf#pt2Xf-iR_+V#Zl6#YDVuE{+H8G*vMy--jd-ueo
z7Heq4=A+YzNnJJ^T;C)K+{>e>k%>7lO8Vmi8Jx7CXH86QHJv^?J~Vk^cRXEa2iKOZ
z@#sLx!qG<`hMU=&85rQ6nis8T_}=AV>SX=YR&_Bg%!h;3
zbBr*2o5P~*(Ge?CU{{5o0e1|yAz7OXbUHJYjHWPtW8%A8;c(%A?1JnL&os-A562Sl
zgwFXmkQ$_zIDwq%4ifs~)Yr=@_6caZF8;X~+EhwIGhH!AL^vY6OtgO$F
z;lUmeybd+TV$^E&?T(~JP(vQ3j8T^rPo)KIxBA4+f++hz3&B_&iF8MM)u8A6?8lYw
zRA$4~l2|P7D#fuBreJi5|H=Bv$r!}HN>R<3v=!l#`E^kTN2jg=aK!M{f^uQvl5nvx
zlQdl`M7o>12W{K|$QhNIhlb$3Ro&2YART^-uTUx9xz5JyYTD?+35#u;Oj?+B1W_-R
zpGae+VC{A3;_^)P9%fA1kqKfB)XfpQb7gTto%eRMei%;Pp$<$S=q5Y?=A&xDD@>GG
znTr%-v<#YkyO9NBgDsz*GxC1F(9&<}>kAo+{5w}-yC}bdHkxVnmCdSaMBKWH`(!qW
zu;=B-xE{wOWdpuJL0iqFwFfuqvTk1NmGkSJR(gY#NyXL=_nG2xs3l=WZ8a;76D+lM
zNXD1z0XVMe!x}SIFp4qWv21fEuOS|8QZ^XZ52sC>hx4LOEf^d$mpfeGEJ&`=P`FPP
zReXsAv|I&bp5no&e4n6V6Im=}TPHs^7EF~gIl8tiAoHq*7o=PV7VK~&Yoa*NT-joG
z_HVgTH)IkC8LY+2*Kiz@v=i=^)d3^COXIyBH^ulWD{d*xZ$rL4kioKINSi2u
zj+;o!%VPa9kP(A^tPShImt^}9OMuE(V#A`Rg)f)>$IFiCSW&h1V-Gf7e%DpUol5?@
z&fmFh_KII!;tAmf%dMyNe6;e3;7QoltD0S*8@0L-(2WY-#ly!Af)^2dhL_b=1g2M(
zw6(@P??W*4qGp)Gc`GT#hYe$X_+f0IVFngoXK`y}z!E
zYgFs=d1@=mt7fa@TwXo|-YQUeo2lS9BTVj^4)fs?o2hNXar9GfaO7z}d~g6*o;0n~x)t*DyqhXlzbTk*H_33`>Pk5_3fT-9OB>HtE=%Pra*QZt0
z%2^SvsF9ER1V^xghHy0R4tML-XW7xAPAipjyO=XE3komJ3f#Z@rz68Tc>ZY@9(>Ag
zjkHF-d(Zu0|1mo@T)gEopZ?tspL>LPT29&-vHH_{;V8SXab|C2P
zk0T!|>4qCFM7>n9P=0(7eioZe#JhG3_azJXuh&!$+GsO&?t1X<
z#QjJ79V&!-ye}S7cL6k-_T?w!CJ(<)lT@`?R#2=^TLCplXaMK%95~c&CoT
zvE&8pMk@ad*Fk#0&Z2PK>U{%3HR!}Um2q$lOd{z?;aP^;9qQi-+_+nY{7cY!T8^Lh
zG9By}vYa8vb9XSo7s9g^H^=h4+hiBfDd6GXVDs&f<7pNCEk|sH#7_XmpzxQ|`-&a^B_j8_uLU^+M`~c#Uhf(g_+_BXQ5Yczk&wXxpb*;8>
zvnccGyMAv{&9|{#HOt2PmEZ%=vMBIS8!e)|4MgKHsvfqEPNC3ru@cXGI{q@7!g$`}
zdAbxz7ARSuWPy?eN){+tpkx8Dz%KPWy)Im9DTR^+N){+tpk#rP1xgkuS)gQrk_Ac@
SC|RInfszGE7Wn(L!2bXNXl9N8
literal 0
HcmV?d00001
diff --git a/reactos/tools/sysgen/FileSystemTreeView/bin/Debug/DirectoryTreeView.pdb b/reactos/tools/sysgen/FileSystemTreeView/bin/Debug/DirectoryTreeView.pdb
new file mode 100644
index 0000000000000000000000000000000000000000..0baced4e8e9e86abb083c6062289db2e9d5e84c3
GIT binary patch
literal 28160
zcmeI436zx8mB+v8ZVF^=78Mb(+4rWKwZVm^yFpq3QE-Wafrc)i$EFLr8$rh;6{86n
zN6CyDFgW9aN)nuyafv86#33fma5A`!cur;}W=tmWU|hzW_kC4!8jyK4)Q>-IrxQ~GWqTO+R}P$*gKr=8$6fxZJXRq)R_qw)6MXz}
z5m=bwUpsxSCGg?Wi>5!{@#UTy76iL4e4yaI-7_!P^t<1@)N{jh8}4$?*RSZg{N>4^dBp7?0V58j&4dHTG+DI=~B
zj>DtjG4NQp6z&RlgFC{V;FI9aa2L2c+yhpgz(Z@3S9GJFbrD%=-74eke@4)=%8
zfCs>5!X@xPco3{DZU{US9sv)BhruIZhIK;Iv6}zo#jn0S?Zw*`HrDsN4wi&6Wpu!fY4$I&p`yV`~Xj+Opr+y6G2YmfenN#Iz`f4lwvj7@Bw-8okC
z|D(bM`^UZb(#yB(e!BXB$C~A;wbOARfnzoQV_(1X{KmVR@9MwzpCAXSDYDN5G!}I`GbccQpSM`d2+|(E=U?
ztgUNK%uhDACYl$`YG_O>xVEJ=v1(y+B5`R$V(p>@D-(^4wab!CrOR4^VA-@qdU~KD
zt8J0x6lpOVpy(yPx3o&Kw`*giV*=>B`&`r&IojcFW5LjI0N<;J^$8msPERCmqy
ze%|YHK1&vokJ1vbC&|m_{n|&bZBgE+ETefPN1u1g*zK<>ujH$Gl@`rQu$_)T0^2*;
z%pS9gnsrgStToxJJG`Qz7pA}U{9|AE*V-LJPbzrk`;RYC{<%SoSp!96E{Z+aL3;)J
zM7)6AIfB6xpec~xl_j^x+=Yr3G7l1p#
zE5T>Mj=>W2suTB!rSK5A8J-A_Ht`>jPi<)(iuAbz*7`e<$?JdW#Xny1_vpX;fFq&9
z>3_2JvMTB6pF;nmbIZ8mx??u$_`F2xf>m{P7bEVJps?p2a2<&%3@IN{1`$%aV$QOIqUrrrHk0uAB
zOq(0rL`BEQT*RdxYBOMrbLyH`B(zf#)EFNnVG-q2#^;m2SL*7l=d;M`raq&0@oJ;9
z1dd4mAI_=&wyxazFTI!kOYf!s(tGLuc2N2+y;r|?fYN{Iz4ZSdz@yRsNtD+!h^gRU
z@ElNk8EvHsgChP$!e4_c@R5s*En8^Qk##JzA@ZAN!=kDnNNFBwK-EpWse2Bny61xF
zx^D`6-5-!9+hpbt>t^le9pE66!uZBBSv=bl*h?fQ>gvi1Ly+Bjod5bmd8;og5aWt89NkzS}8)>d@ypP0S(r_(u$a5}6`
zV%R8mr2D&{J8#1tcl$f*Iwbaj_}zXCbCPxSH4V)Px#ZW{{e1%+PEk%}d_F%8_MqrE
zCP&Airn1tfD7~C`m6zUSr5ibD{b?`w8SP$AC1VJ0cKsXVe4})^AgK4nHe)0X~!=w*ZcFV;Fr)SG#Hh5jwUAjn?$Jd%z2!yQLd
zHW@y!^du|YjJ=%r{KsJZ+-yBKTTT_^8aJPL-y=RA#Z$Y1#^CR!2x>iUWDK1sr!qdD
z9|v|a=QuuTKef-SgRPB>$=@?X_ri1SGSpIjZ9T~NbWdUY+7;kH!Yjd2@Xx`sz(%kN
zTm^RIfBIZInYE%b?O^y+6Ytx%_A__;N$OGit3kDYH7LItl`!pNuT1;bfNG!dnD(y&
zI|i*e+8>(H{+pDsb~6^*TnTv}Ecz1lXs*5tvc!U~f=p3x1K1n<{W}Lz>;ZV#L23wi
z6R0()czp5T>x65-Z-6sh{CVJd!n47f!CLSZ@O+m($02@p@J-^a4ExjXEHS5-=)EZ2b!a?V7q+kCf^w4UzG
zyq%>xQ7d2M;%rYW^jolx!Huc_x|e#@-}}H~Q0;3C-A}j=_y9P@#mmNTAv^(m5S$1;
z3|4^5W6H{I1R=eT)}1w=9JZedcjFB+<#QBrKDWLo;3kZtyUQy(s46--J4kYP{x7Bt(NYWMKWicW1er`y*7lTC@H*15_0M5D%$E?1pw
zY{cJbNH(?PJYUL&pL@8oBZJqNwRSXr3=g?}`3mVUV>EXxvz-6@rjy4glh6KRZsVtR
zaPm0#>B!=_$u%vBn&jFhvTHBuLmj$zQ60XV_c!Q=%p_#)l|tXr`vvLrAZS7y%K1t6
zsq@{KcDVKPMOEeqS;S`?VoX&D9GY!?
zmp@m?w-RB8LZTD#zxCsipF@iJzKed>lV5p#y4MTTBxm21u8Py?_-e_<`b4w6VDsnT
zX!_C4*)%_AECiAC*pu{sveRkZ^&L+CeO^CKum5iCW%zRvWmbCV&v`kd)A484wI-Tc
zP)o{5zWb=)M*2LR@I2Q?FP~_+275JW)^z^sI`bUh&r9{pvq*aEiG3ly)yqhJ;)0dQ
zwUM*HF8WwTIhFDG{P|fMs%-6fGM@jS~b28^N~7(Fn)ybar%No
z33FacjRpIG^84`bQ}WyTgG)flP|q;NF&Wk!>;Slk{aMd>hQagU#U@VuV%u=GHWt3$
zt$r+lMJ3dS`O^F0#%CA|(w6Zhc$)C^25E~vWGZp
z2V=%2Dv$htUHSlF|4p0tNEtq_!pK4I#v7T81EYRa8DZk&)um>D?YE+A)!lzc|KzLZ)&7o@+k2PxSE#*tbGR)fpI8t?{i7I-^&9*AFR
z?#%5Nv??U?3+UgOu;#rld^s#1_$>HJxNq3^&E&T>FBaNO^-XJ5bOCLs?{h%)eIBSY
zk;b6;xR5aGQm2Dd33w5R>;q(;x)fXhUIrrj)M}78C+{irgAqek#ufB?G(5|MJ0k@z
z-?PbM?M^JTTZP0i=Z3DJPW4eJy%JiVau{oJMCg}V+Y!?pjiG2Af9C2CYMeq_hiVvU
z>QH;uCdBBQCG4N{zz}jt#rY)JbTr@MuzsuRd(LJFD!~d0&4KG-J)hbN?}Oiki|AB;
z_-uF~yc%8)Z-IBfx_jU)lhSPeFX|g+`;8gT80uQ<)D;s~J-)g$?VFkX$;5l{}E|IW8z-W)s<{m*RYMAQGY
z4Z9$5?fm9MOUoylA8&I$a5hIik|)+fd~w9)WV9K%E16B6U9igf{GZl7sr^VksI^@&
zW5?8A9nZ8+iF7W}esnt69qbSG087AAK+Z0yLcH8U%({J-qn|<5y%n~5eeQeL(Ug@=
zi~(8W#O*uL~8r0uW+
zfAk#cfHjXZ8lmEg+&N19mCt5X&@_L0~0F-;Hly
z0ag*N0joiLZR67~1(9v)TCf(}0GX|1HmzO
zsUe{J?{ZN7cNKUUcm*gwHwi8R)$uFAJHao4_k)YU$G~Nvo?q63uY(EjJ#aaA09*m~
zD6r3HhJy`+r-Q3N`MOQu5-ic|gp4pq16OP`flOM%@JVw{UC
zF~soP^9{y|=*{yTt+kuo*o!!yN(Nf5(p_uwW8q#9)!kcN9e)X`j@!V&;O!tfWS+bD
zv!(6tP~%^!?i*q2yTyzjN6?(Dm@`9ny1MTIWgj+zeL%0Pn+W$Md^b1>{0=w++zeKM
ztar-EmzBKGT*#gk$0HBPFMS4AU#-6u3;nnP;)bXYbT4&DRu8y3{n=9X$J)@Cv8M#h
z8IwL3ddQV~7?e#@-+O_SGxrnU1=WV)hlAfEJOcbacow(~JO}(cP;>DE5M2z=VK+AA
z_T!QT@XuIo;_m&_jB$QIS|=EtGgQg{zD3wZSU&6`SdOZm>plwahJOKn2p2Qy6X7}V
zYIr@o4bDxKnbDNbCdpRvY>N(;esDRJ$fU}QphlhtRpyZ=l0|D?Yj6mxH6)#z4QsBJ
zz>Tohv%b^a@1$|>?PAb-=qhX5jDHd`lpM}MF@*z36ZUlRFSvYHyYSU6-y|3RZ^%~p
zUw7qx=)z~Xe5bka+b%rS%v3pYqlJ8!5j5*1qsA{J(G~1fb`ZC9v+U^jx|I
zo)0gASHi7u3ceNA-PRUZ&pCI%@~2*be+lo0KZJ`ALowVR9sy5;D`ELi@-gLqu7>p<
znVu`&0k_kqFM$C;_nvCyB-9RX{ldAU7td^JZN7H#{A7b(Wb73THR)274(M!t~Y>$hpH%=mN}tus?5@&yN9#-_P4
zxK`2r7v<3#Ej8Uu>EyGbLSSgY+TDe1X%K
zv1zVMh3c~Me+qrDW$Xh?pWnv2{8Q6y=svy3yd39V@Qd`zrr9z?9~Eg`6y}g?p`Yu7
zo_*Od$fgtq>5F;)+Ftaf2|q5I*Y>dt$FS7Z@!PiQ$a+b^*JJZL`QQloIo^dl3(Xv)
z=gY>qysXgyu1($N7Up=!?%S~Gu3TiD?m{?)W)9L1o_!gc=E|^6y*{kOzbFhc9|HR_
zHqDipm|h#Nm@@8RF7x5@+jy6sdGKS`obl}=^X#|8tgGBh!25>Up*oQd(HqX4`*Rta
z=jMF;j=j7tz4mmzvNpqOW_m5zG`E(PX0D}n{g=)<*&Jv3?`?&(32qGane$ta!@d`I
z`_5kI_bB;_1ws1Zr?1<_+q%ox2M0O3y4U1)4648foj3It+SVD5Mzq`oI&@LZse;qFR`*1!**fsR!yV9WA+&Z!a
zU(-_Nqx#bD$0dU5@fDLMlucpFHgxDVip^b+GHzxsR2w5+UlX`n{2t&U6rU_+0a;T8Y-VMt76im2{S1-_UTex%Nx@3k!(_$;{CXz
z=}OZZIc=piljg4!d>bmS&$qzi6o9hRwiD;yugFf*{kFf`&Q8<4HSVRM>@?jwyCrf^
zd%C0Y`kP%&cfE(w|D~=yUtU4gA(<8NVHS*e4S(Zt9pQb1FOM)yu+N!;qPa`f_;mj*
zCyDc8FfOkjYsvUAm~k!5%f>C&*R%2~%!|nOcVUjWV9sA|kxEGdlEjx`5mrz~VXV0w
z9Z!nP2m!n!n_tSg5!R@WZ_?WC3;X&1FK1|h~0&hS%+?-k5!X@xPShF}79s&=A)qg$D7zU4oN5LmD={pHt2HCbj@3Zo})KGSs-V6P9
z8)qm$&;`%bsK@^nI$f()7K_X)beiIemXfYg&|@rr*Vor4gY$bQL>(Z2Bdvyh<2H
zJpbGn?#y2xQ_;ZxZkZcCJ$IzRTI!6!@SlBZJ7!7Xj?(hj6&F7_OH1aNox4jr4f?{Y
z^%vdt&0qiHfA0Br;>OKsXu8ULUwd3r-73CCZ8qMO3BEMkytFaNTaQP&6SwdGSyS*Q
z4QfA~1Lw23&26+Umg;MiccvX$*QEU{T$9osBr9ou8T!CO4GX{f1rGjlzDVoO|!Prgq~qltDz9r~?B;$Ix=|OT07mVmN>1Z}RE2drlP`Q)*5X
zG<6uR8guNZqj#!d-Lh;?4GGnWTdHBHf%>4@X-9-MYENnj=gbf*dm1jLN#cftptQL=|aWNfvWlQP?*hWf2t+?Lo}%k$q{6hp9nL
zgjRO$01v%$;r&I$YdXI8&)FG$2N&cn{PM~EIUlboSblZ6|HQ<{cD(w-H$Pi{GB!Q7
z|H6B@KUnhF)GHNJoBn(6mQTf)Ia@0-J4*9+&;GPbIdCa>RcoH#{Qln`m|0=hKQWNC
z!#y@@!#j(1Un%|Q)aTD`kDfW+w4v>(rqa#M$bmyo{cgLmeRW{M$FpYm3da-W&f8x&
z0nLKxvau(Eo?AGHIeD_NCo>0YuLwR+p^ze1#Ifrt(TcT2#Y;+-Fe_7rvIeo7wS(yA
zX#bP}I_Nou6?Iv{Lq2$0&05=B9YEWMekRLTn0AN-P|#J@A{QJ}x~7y8++mAT5@Rw|
z@Q22sG9U6Nxk<0GsfFs1h&|K+JVrkSo|br>`a#cB7|RvrMHFKBr(Uw
zl5-@k@UiBtzD8d*9q>KoTQAp`O~3WAt@psmrLqha^n)4xjBMH^@f9F@n1~ujPf^Cu
z1X8hoxc8RIqmNGBB-e08_V!a4+g72m#M~*saoB2`Xc84k`hJPumRK&aTH=EeACjm`
zG$d}7*dy^#;3Rrn;NPL;}jK9&ZX=lbcdYSfRoToq2>!3ASPn#8u
z^5_H5<0%vLR4N9}qQ$`Zh^$7XR0mux@nJd(I!OC~-=*IJ!;-UI&T=Kai#`PZNxBT&
zOIH;?y#RZey+d~b$L>D*2U4BLHo7PZt&wf=(v$RGXdorBqSlVYO|go)+z#9IG|?@n
z%JQ6^2HUVasx`un?b_|0)?&DE-3)s1h+%8%Ad2nU;Mif|y42~0ZO1f16zp+5(Mk28
zEh6lZ7WQn1YIVa(4rq;W%QHHKR%v&}3{yBk;dB{LLCFE;>z)xZOvCFb_i!dcaZe1+
z7VReV8n#8{t}8l2X3u)jvj&QWL{kF+Vd_0WBWeu|C7jb5g=@zhHd-g*o}-(Cj2hjF
z#`S2LwxI3_6TXN_8!^$tUW;&C*dJ1wvR7@j+fFBZw=LZqR*HQcc5v8%N;}r$7|{;z
zRXI0nx6BteC@kn?
zx7}3wC`~t$^_JixeXZ}r;oYm_b%)++Tlw0>+HX%C`+@-Ake_bp%{*%iWKZ&%~jNE(TX9o*6g%-Rh7EHhP*OlHTd*KJ4?D*a4-;jvD#}$T
zOIQn=@p>DHr7y*I8$Y743XSBB{D^C1B}AnPX@5AP4(=bd(sp9DBln=DmYb$353H*?
z$g9&OB6vF%DKvX%LSbW(nz&Qd#HFe-r=+-e5z#jlnlL1prkZH9Lb+*IH9O7$Qj&K*
zi1dqo@D0qF`iTGURq
zl$y==AvIxC2iL{8P9EfJ^b+N0<`}+a;gbg`1N`W1H1*>kDp+;uS4JU@0csxjmC)CT
zpTKMnR`9n2umfBdeGU9>R4z4m@TcTs(x)CoK$mlQycQmW;RnyOu?i1|k+nM%lbG(k
zU)oNsIsglXDI;B4QqNAHkZxdK@%Jm&3M+mh+d;;>sRJgjdxC
zjKDHcB4+hTNzOL=or(eXIE%yQ&!joDM74@5pgblnV%bN-JGR6=O_ohmcu4Tp%XjSM5Nh|8#A5K!MWx={dKuZ
TBcLY!&!}P9UAq3eeA)j4ZC9R*
literal 0
HcmV?d00001
diff --git a/reactos/tools/sysgen/FileSystemTreeView/icons/folder.ico b/reactos/tools/sysgen/FileSystemTreeView/icons/folder.ico
new file mode 100644
index 0000000000000000000000000000000000000000..c9e4b0b4a38001b92f3820c44b00a942347f8889
GIT binary patch
literal 1406
zcmeH{Jr2S!4255u{$}dL%*ZWZgW
zSJ~0$)`{av1{9yF0)2s13XA|uXbfRYb8)Ac@=NTNN7U=u$4*a+#n}Se3ozf{@UUoZ
z4el=sYZ)IjbYSSfUv)sFh$Jdf7#zHD<^)wB@1^t1vDUhzxU}rZspSC9hxdVv>DXtN
z#+W$&!(aRN=jYr{x}Op16AASttW3PXx^$BA%a%hzhjJzFL+rPA^HbBNv>lBj@eN@5
B9CiQz
literal 0
HcmV?d00001
diff --git a/reactos/tools/sysgen/RosBuilder/Controls/CatalogTriStateTreeView.cs b/reactos/tools/sysgen/RosBuilder/Controls/CatalogTriStateTreeView.cs
new file mode 100644
index 00000000000..c4309b01166
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Controls/CatalogTriStateTreeView.cs
@@ -0,0 +1,220 @@
+using System;
+using System.Drawing;
+using System.Text;
+using System.Collections.Generic;
+using System.IO;
+using System.Windows.Forms;
+
+using SIL.FieldWorks.Common.Controls;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Tasks;
+
+namespace TriStateTreeViewDemo
+{
+ public class CatalogTriStateTreeView : TriStateTreeView
+ {
+ private ISysGenDesigner m_SysGenDesigner = null;
+ private TreeNode m_PlatformNode = null;
+
+ public CatalogTriStateTreeView()
+ {
+ }
+
+ private void CatalogTriStateTreeView_BeforeCheck(object sender, TreeViewCancelEventArgs e)
+ {
+ if (m_SysGenDesigner.SysGenEngine.Project != null)
+ {
+ if (e.Node is ModuleTreeNode)
+ {
+ //Get the underlying module
+ ModuleTreeNode moduleNode = e.Node as ModuleTreeNode;
+
+ if (GetChecked(e.Node) == CheckState.Unchecked)
+ {
+ //Add the selected node and dependencies
+ m_SysGenDesigner.PlatformController.Add(moduleNode.Module);
+ }
+ else
+ {
+ //Remove the module from our platform
+ m_SysGenDesigner.PlatformController.Remove(moduleNode.Module);
+ }
+
+ //Update current module status
+ UpdateCatalogTree();
+ }
+ else if (e.Node is FolderTreeNode)
+ {
+ if (m_AutoUpdatingParents == false)
+ {
+ //e.Cancel = (AddTreeNodeModules(e.Node) == false);
+ }
+ }
+ }
+ else
+ {
+ MessageBox.Show("Cannot modify a catalog tree without platform associated");
+ }
+ }
+
+ public void SetCatalog(ISysGenDesigner sysGenDesigner)
+ {
+ //Set the software catalog
+ m_SysGenDesigner = sysGenDesigner;
+
+ //Load the platform tree catalog
+ LoadCatalogTree();
+ UpdateCatalogTree();
+
+ NodeMouseClick += new TreeNodeMouseClickEventHandler(CatalogTriStateTreeView_NodeMouseClick);
+ }
+
+ void CatalogTriStateTreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
+ {
+ ModuleTreeNode moduleNode = e.Node as ModuleTreeNode;
+
+ if (moduleNode != null)
+ m_SysGenDesigner.InspectedObject = moduleNode.Module;
+ }
+
+ private void LoadCatalogTree()
+ {
+ m_PlatformNode = new TreeNode();
+
+ LoadPlatformModules(m_PlatformNode, m_SysGenDesigner.SysGenEngine.ProjectTask);
+
+ Nodes.Clear();
+ Nodes.Add(m_PlatformNode);
+
+ m_PlatformNode.Text = RootNodeText;
+ m_PlatformNode.Expand();
+ }
+
+ private void UpdateCatalogTree()
+ {
+ BeginUpdate();
+ BeforeCheck -= new TreeViewCancelEventHandler(CatalogTriStateTreeView_BeforeCheck);
+
+ m_PlatformNode.Text = RootNodeText;
+ m_PlatformNode.Expand();
+
+ UpdatePlatformModules(m_PlatformNode);
+
+ EndUpdate();
+ BeforeCheck += new TreeViewCancelEventHandler(CatalogTriStateTreeView_BeforeCheck);
+ }
+
+ private string RootNodeText
+ {
+ get
+ {
+ return string.Format("Catalog ({0} Modules-{1} Available)",
+ m_SysGenDesigner.PlatformController.Project.Platform.Modules.Count,
+ m_SysGenDesigner.PlatformController.Project.Modules.Count);
+ }
+ }
+
+ private void UpdatePlatformModules(TreeNode node)
+ {
+ if (node is ModuleTreeNode)
+ {
+ //Get the underlying module
+ ModuleTreeNode moduleNode = node as ModuleTreeNode;
+
+ if (moduleNode != null)
+ {
+ if (m_SysGenDesigner.PlatformController.Project.Platform.Modules.Contains(moduleNode.Module))
+ {
+ SetChecked(moduleNode, CheckState.Checked);
+ }
+ else
+ {
+ SetChecked(moduleNode, CheckState.Unchecked);
+ }
+ }
+ }
+ else
+ {
+ foreach (TreeNode subNode in node.Nodes)
+ {
+ UpdatePlatformModules(subNode);
+ }
+ }
+ }
+
+ private void LoadPlatformModules(TreeNode node, Task task)
+ {
+ if (task is ModuleTask)
+ {
+ RBuildModule module = ((ModuleTask)task).Module;
+
+ node.Nodes.Add(new ModuleTreeNode(module));
+ }
+ else if (task is ITaskContainer)
+ {
+ if (task is DirectoryTask)
+ {
+ FolderTreeNode taskNode = new FolderTreeNode(((DirectoryTask)task).Name);
+
+ node.Nodes.Add(taskNode);
+
+ foreach (Task innerTask in ((ITaskContainer)task).ChildTasks)
+ {
+ LoadPlatformModules(taskNode, innerTask);
+ }
+ }
+ else
+ {
+ foreach (Task innerTask in ((ITaskContainer)task).ChildTasks)
+ {
+ LoadPlatformModules(node, innerTask);
+ }
+ }
+ }
+ }
+
+ public abstract class CatalogTreeNode : TreeNode
+ {
+ public abstract string NodeName { get; }
+ }
+
+ public class ModuleTreeNode : CatalogTreeNode
+ {
+ RBuildModule m_Module = null;
+
+ public ModuleTreeNode(RBuildModule module)
+ {
+ m_Module = module;
+ Text = module.Name;
+ }
+
+ public RBuildModule Module
+ {
+ get { return m_Module; }
+ }
+
+ public override string NodeName
+ {
+ get { return Module.Name; }
+ }
+ }
+
+ public class FolderTreeNode : CatalogTreeNode
+ {
+ private string m_FolderName = null;
+
+ public FolderTreeNode(string name)
+ {
+ m_FolderName = name;
+ Text = name;
+ }
+
+ public override string NodeName
+ {
+ get { return m_FolderName; }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/Controls/ModuleFiltersListView.cs b/reactos/tools/sysgen/RosBuilder/Controls/ModuleFiltersListView.cs
new file mode 100644
index 00000000000..2228f2b729d
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Controls/ModuleFiltersListView.cs
@@ -0,0 +1,91 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Tasks;
+
+namespace TriStateTreeViewDemo
+{
+ public class ModuleFiltersListViewItem : ListViewItem
+ {
+ private ModuleFilter m_ModuleFilter = null;
+
+ public ModuleFiltersListViewItem(ModuleFilter filter)
+ {
+ m_ModuleFilter = filter;
+
+ Text = filter.Name;
+ SubItems.Add(filter.Modules.Count.ToString());
+ }
+
+ public ModuleFilter Filter
+ {
+ get { return m_ModuleFilter; }
+ }
+ }
+
+ public class ModuleFiltersListView : ListView
+ {
+ private ISysGenDesigner m_SysGenDesigner = null;
+
+ public ModuleFiltersListView()
+ {
+ View = View.Details;
+
+ FullRowSelect = true;
+ CheckBoxes = true;
+
+ Columns.Add("Name", 200);
+ Columns.Add("Modules", 100);
+ }
+
+ public void SetCatalog(ISysGenDesigner sysGenDesigner)
+ {
+ //Set the software catalog
+ m_SysGenDesigner = sysGenDesigner;
+ //m_SysGenDesigner.PlatformController.PlatformModulesUpdated += new EventHandler(PlatformController_PlatformModulesUpdated);
+
+ foreach (ModuleFilter filter in sysGenDesigner.ModuleFilterController.ModuleFilters)
+ {
+ Items.Add(new ModuleFiltersListViewItem(filter));
+ }
+ }
+
+ //protected override void OnItemCheck(ItemCheckEventArgs ice)
+ //{
+ // base.OnItemCheck(ice);
+ //}
+
+ //protected override void OnItemChecked(ItemCheckedEventArgs e)
+ //{
+ // base.OnItemChecked(e);
+ //}
+
+ private void PlatformController_PlatformModulesUpdated(object sender, EventArgs e)
+ {
+ BeginUpdate();
+
+ foreach (ModuleFiltersListViewItem filterItem in Items)
+ {
+ foreach (RBuildModule module in m_SysGenDesigner.ProjectController.Project.Platform.Modules)
+ {
+ if (!filterItem.Filter.Modules.Contains(module))
+ {
+ filterItem.Checked = false;
+ break;
+ }
+ }
+
+ filterItem.Checked = true;
+ }
+
+ EndUpdate();
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/Controls/NewItemListView.cs b/reactos/tools/sysgen/RosBuilder/Controls/NewItemListView.cs
new file mode 100644
index 00000000000..e2e28dc11f5
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Controls/NewItemListView.cs
@@ -0,0 +1,114 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Tasks;
+
+namespace TriStateTreeViewDemo
+{
+ public abstract class NewItemListViewItem : ListViewItem
+ {
+ protected ISysGenDesigner m_SysGenDesigner = null;
+
+ public NewItemListViewItem(ISysGenDesigner designer)
+ {
+ m_SysGenDesigner = designer;
+ }
+
+ public abstract string Description { get; }
+ public abstract string DefaultFileName { get; }
+
+ public virtual void Apply()
+ {
+ }
+ }
+
+ public class ModuleFiltersNewItemListViewItem : NewItemListViewItem
+ {
+ private ModuleFilter m_ModuleFilter = null;
+
+ public ModuleFiltersNewItemListViewItem(ISysGenDesigner designer ,ModuleFilter filter): base(designer)
+ {
+ m_ModuleFilter = filter;
+
+ Text = filter.Name;
+ }
+
+ public override string Description
+ {
+ get { return m_ModuleFilter.Name; }
+ }
+
+ public override string DefaultFileName
+ {
+ get { return null; }
+ }
+
+ public override void Apply()
+ {
+ m_SysGenDesigner.ModuleFilterController.Apply(m_ModuleFilter);
+ }
+ }
+
+ public class LanguageNewItemListViewItem : NewItemListViewItem
+ {
+ private RBuildLanguage m_Language = null;
+
+ public LanguageNewItemListViewItem(ISysGenDesigner designer, RBuildLanguage language)
+ : base(designer)
+ {
+ m_Language = language;
+
+ Text = language.Name;
+ }
+
+ public override string Description
+ {
+ get { return m_Language.Name; }
+ }
+
+ public override string DefaultFileName
+ {
+ get { return null; }
+ }
+
+ public override void Apply()
+ {
+ m_SysGenDesigner.ProjectController.AddLanguage(m_Language);
+ }
+ }
+
+ public class DebugChannelNewItemListViewItem : NewItemListViewItem
+ {
+ private RBuildDebugChannel m_DebugChannel = null;
+
+ public DebugChannelNewItemListViewItem(ISysGenDesigner designer, RBuildDebugChannel channel)
+ : base(designer)
+ {
+ m_DebugChannel = channel;
+
+ Text = channel.Name;
+ }
+
+ public override string Description
+ {
+ get { return m_DebugChannel.Name; }
+ }
+
+ public override string DefaultFileName
+ {
+ get { return null; }
+ }
+
+ public override void Apply()
+ {
+ m_SysGenDesigner.ProjectController.AddDebugChannel(m_DebugChannel);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/Controls/PlatformTreeView.cs b/reactos/tools/sysgen/RosBuilder/Controls/PlatformTreeView.cs
new file mode 100644
index 00000000000..1f12d95df50
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Controls/PlatformTreeView.cs
@@ -0,0 +1,306 @@
+using System;
+using System.Drawing;
+using System.Text;
+using System.Collections.Generic;
+using System.IO;
+using System.Windows.Forms;
+
+using SIL.FieldWorks.Common.Controls;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Tasks;
+
+namespace TriStateTreeViewDemo
+{
+ public class PlatformTreeView : TriStateTreeView
+ {
+ private ISysGenDesigner m_SysGenDesigner = null;
+ private PlatformTreeNode m_PlatformNode = null;
+
+ public PlatformTreeView()
+ {
+ }
+
+ private void CatalogTriStateTreeView_BeforeCheck(object sender, TreeViewCancelEventArgs e)
+ {
+ if (m_SysGenDesigner.ProjectController.Project != null)
+ {
+ if (e.Node is ModuleTreeNode)
+ {
+ //Get the underlying module
+ ModuleTreeNode moduleNode = e.Node as ModuleTreeNode;
+
+ if (GetChecked(e.Node) == CheckState.Unchecked)
+ {
+ //Add the selected node and dependencies
+ m_SysGenDesigner.ProjectController.Add(moduleNode.Module);
+ }
+ else
+ {
+ //Remove the module from our platform
+ m_SysGenDesigner.ProjectController.Remove(moduleNode.Module);
+ }
+
+ }
+ else if (e.Node is FolderTreeNode)
+ {
+ }
+ }
+ else
+ {
+ MessageBox.Show("Cannot modify a catalog tree without platform associated");
+ }
+
+ /* cancel the paint event*/
+ e.Cancel = true;
+ }
+
+ public void SetCatalog(ISysGenDesigner sysGenDesigner)
+ {
+ //Set the software catalog
+ m_SysGenDesigner = sysGenDesigner;
+
+ m_SysGenDesigner.ProjectController.PlatformModulesUpdated += new EventHandler(PlatformController_PlatformModulesUpdated);
+
+ //Load the platform tree catalog
+ LoadCatalogTree();
+ UpdateCatalogTree();
+
+ NodeMouseClick += new TreeNodeMouseClickEventHandler(CatalogTriStateTreeView_NodeMouseClick);
+ }
+
+ void PlatformController_PlatformModulesUpdated(object sender, EventArgs e)
+ {
+ //Update current module status
+ UpdateCatalogTree();
+ }
+
+ void CatalogTriStateTreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
+ {
+ CatalogTreeNode catalogNode = e.Node as CatalogTreeNode;
+
+ if (catalogNode != null)
+ m_SysGenDesigner.InspectedObject = catalogNode.NodeObject;
+ }
+
+ private void LoadCatalogTree()
+ {
+ m_PlatformNode = new PlatformTreeNode(m_SysGenDesigner.ProjectController.Project.Platform);
+
+ LoadPlatformModules(m_PlatformNode);
+ //LoadPlatformModules(m_PlatformNode, m_SysGenDesigner.SysGenEngine.ProjectTask);
+
+ Nodes.Clear();
+ Nodes.Add(m_PlatformNode);
+
+ m_PlatformNode.Text = RootNodeText;
+ m_PlatformNode.Expand();
+ }
+
+ private void UpdateCatalogTree()
+ {
+ BeginUpdate();
+ BeforeCheck -= new TreeViewCancelEventHandler(CatalogTriStateTreeView_BeforeCheck);
+
+ m_PlatformNode.Text = RootNodeText;
+ m_PlatformNode.Expand();
+
+ UpdatePlatformModules(m_PlatformNode);
+
+ EndUpdate();
+ BeforeCheck += new TreeViewCancelEventHandler(CatalogTriStateTreeView_BeforeCheck);
+ }
+
+ private string RootNodeText
+ {
+ get
+ {
+ return string.Format("Catalog ({0} Modules-{1} Available)",
+ m_SysGenDesigner.ProjectController.Project.Platform.Modules.Count,
+ m_SysGenDesigner.ProjectController.Project.Modules.Count);
+ }
+ }
+
+ private void UpdatePlatformModules(TreeNode node)
+ {
+ if (node is ModuleTreeNode)
+ {
+ //Get the underlying module
+ ModuleTreeNode moduleNode = node as ModuleTreeNode;
+
+ if (moduleNode != null)
+ {
+ if (m_SysGenDesigner.ProjectController.Project.Platform.Modules.Contains(moduleNode.Module))
+ {
+ SetChecked(moduleNode, CheckState.Checked);
+ }
+ else
+ {
+ SetChecked(moduleNode, CheckState.Unchecked);
+ }
+ }
+ }
+ else
+ {
+ foreach (TreeNode subNode in node.Nodes)
+ {
+ UpdatePlatformModules(subNode);
+ }
+ }
+ }
+
+ private void LoadPlatformModules(TreeNode node)
+ {
+ foreach (RBuildModule module in m_SysGenDesigner.ProjectController.AvailableModules)
+ {
+ TreeNode parent = node;
+
+ foreach (string part in module.CatalogPath.Split(new char[] { '\\' }))
+ {
+ if (part.Length > 0)
+ {
+ parent = GetFolderNode(parent, part);
+ }
+ }
+
+ parent.Nodes.Add(new ModuleTreeNode(module));
+ }
+ }
+
+ private TreeNode GetFolderNode(TreeNode parent, string name)
+ {
+ foreach (TreeNode node in parent.Nodes)
+ {
+ CatalogTreeNode folderNode = node as CatalogTreeNode;
+
+ if (folderNode != null)
+ {
+ if (folderNode.NodeName == name)
+ {
+ return folderNode;
+ }
+ }
+ }
+
+ FolderTreeNode newNode = new FolderTreeNode(name);
+
+ parent.Nodes.Add(newNode);
+
+ return newNode;
+ }
+
+ //private void LoadPlatformModules(TreeNode node, Task task)
+ //{
+ // foreach (string path in
+ // /*
+ // if (task is ModuleTask)
+ // {
+ // RBuildModule module = ((ModuleTask)task).Module;
+
+ // node.Nodes.Add(new ModuleTreeNode(module));
+ // }
+ // else if (task is ITaskContainer)
+ // {
+ // if (task is DirectoryTask)
+ // {
+ // FolderTreeNode taskNode = new FolderTreeNode(((DirectoryTask)task).Name);
+
+ // node.Nodes.Add(taskNode);
+
+ // foreach (Task innerTask in ((ITaskContainer)task).ChildTasks)
+ // {
+ // LoadPlatformModules(taskNode, innerTask);
+ // }
+ // }
+ // else
+ // {
+ // foreach (Task innerTask in ((ITaskContainer)task).ChildTasks)
+ // {
+ // LoadPlatformModules(node, innerTask);
+ // }
+ // }
+ // }
+ // */
+ //}
+
+ public abstract class CatalogTreeNode : TreeNode
+ {
+ public abstract string NodeName { get; }
+ public abstract object NodeObject { get;}
+ }
+
+ public class PlatformTreeNode : CatalogTreeNode
+ {
+ RBuildPlatform m_Platform = null;
+
+ public PlatformTreeNode(RBuildPlatform platform)
+ {
+ m_Platform = platform;
+ Text = platform.Name;
+ }
+
+ public RBuildPlatform Platform
+ {
+ get { return m_Platform; }
+ }
+
+ public override string NodeName
+ {
+ get { return m_Platform.Name; }
+ }
+
+ public override object NodeObject
+ {
+ get { return Platform; }
+ }
+ }
+
+ public class ModuleTreeNode : CatalogTreeNode
+ {
+ RBuildModule m_Module = null;
+
+ public ModuleTreeNode(RBuildModule module)
+ {
+ m_Module = module;
+ Text = module.Name;
+ }
+
+ public RBuildModule Module
+ {
+ get { return m_Module; }
+ }
+
+ public override string NodeName
+ {
+ get { return Module.Name; }
+ }
+
+ public override object NodeObject
+ {
+ get { return Module; }
+ }
+ }
+
+ public class FolderTreeNode : CatalogTreeNode
+ {
+ private string m_FolderName = null;
+
+ public FolderTreeNode(string name)
+ {
+ m_FolderName = name;
+ Text = name;
+ }
+
+ public override string NodeName
+ {
+ get { return m_FolderName; }
+ }
+
+ public override object NodeObject
+ {
+ get { return NodeName; }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/Controls/ProjectTreeView.cs b/reactos/tools/sysgen/RosBuilder/Controls/ProjectTreeView.cs
new file mode 100644
index 00000000000..35f827319a4
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Controls/ProjectTreeView.cs
@@ -0,0 +1,161 @@
+using System;
+using System.Windows.Forms;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Tasks;
+
+namespace TriStateTreeViewDemo
+{
+ public class ProjectTreeView : TreeView
+ {
+ private ISysGenDesigner m_SysGenDesigner = null;
+ private TreeNode m_Project = new TreeNode("Project");
+ private TreeNode m_Platforms = new TreeNode("Platform");
+ private TreeNode m_Languages = new TreeNode("Languages");
+ private TreeNode m_DebugChannels = new TreeNode("Debug Channels");
+ //private TreeNode m_Filters = new TreeNode("Filters");
+ private TreeNode m_Files = new TreeNode("Files");
+ private TreeNode m_Registry = new TreeNode("Registry");
+ //private TreeNode m_Filters = new TreeNode("Filters");
+
+ public ProjectTreeView()
+ {
+ }
+
+ public void SetCatalog(ISysGenDesigner sysGenDesigner)
+ {
+ //Set the software catalog
+ m_SysGenDesigner = sysGenDesigner;
+ m_SysGenDesigner.ProjectController.ProjectLoaded += new EventHandler(PlatformController_ProjectLoaded);
+ m_SysGenDesigner.ProjectController.ProjectUpdated += new EventHandler(PlatformController_ProjectUpdated);
+
+
+ LoadProject();
+ }
+
+ void PlatformController_ProjectLoaded(object sender, EventArgs e)
+ {
+ LoadProject();
+ UpdateProject();
+ }
+
+ void PlatformController_ProjectUpdated(object sender, EventArgs e)
+ {
+ UpdateProject();
+ }
+
+ private void LoadProject()
+ {
+ Nodes.Clear();
+
+ m_Project = new ProjectTreeNode(m_SysGenDesigner.ProjectController.SysGenProject);
+ m_Project.Nodes.Add(m_Platforms);
+ m_Project.Nodes.Add(m_Languages);
+ m_Project.Nodes.Add(m_DebugChannels);
+// m_Project.Nodes.Add(m_Filters);
+ m_Project.Nodes.Add(m_Files);
+ m_Project.Nodes.Add(m_Registry);
+ m_Project.Expand();
+
+ Nodes.Add(m_Project);
+ }
+
+ private void UpdateProject()
+ {
+ m_Languages.Nodes.Clear();
+ m_DebugChannels.Nodes.Clear();
+
+ foreach (RBuildLanguage language in m_SysGenDesigner.ProjectController.Project.Platform.Languages)
+ {
+ m_Languages.Nodes.Add(language.Name);
+ }
+
+ foreach (RBuildDebugChannel channel in m_SysGenDesigner.ProjectController.Project.Platform.DebugChannels)
+ {
+ m_DebugChannels.Nodes.Add(channel.Name);
+ }
+ }
+
+ public abstract class CatalogTreeNode : TreeNode
+ {
+ public abstract string NodeName { get; }
+ public abstract object NodeObject { get;}
+ }
+
+ public class ProjectTreeNode : CatalogTreeNode
+ {
+ Project m_Platform = null;
+
+ public ProjectTreeNode(Project platform)
+ {
+ m_Platform = platform;
+ Text = platform.FileName;
+ }
+
+ public Project Platform
+ {
+ get { return m_Platform; }
+ }
+
+ public override string NodeName
+ {
+ get { return m_Platform.Name; }
+ }
+
+ public override object NodeObject
+ {
+ get { return Platform; }
+ }
+ }
+
+ public class ModuleTreeNode : CatalogTreeNode
+ {
+ RBuildModule m_Module = null;
+
+ public ModuleTreeNode(RBuildModule module)
+ {
+ m_Module = module;
+ Text = module.Name;
+ }
+
+ public RBuildModule Module
+ {
+ get { return m_Module; }
+ }
+
+ public override string NodeName
+ {
+ get { return Module.Name; }
+ }
+
+ public override object NodeObject
+ {
+ get { return Module; }
+ }
+ }
+
+ public class FolderTreeNode : CatalogTreeNode
+ {
+ private string m_FolderName = null;
+
+ public FolderTreeNode(string name)
+ {
+ m_FolderName = name;
+ Text = name;
+ }
+
+ public override string NodeName
+ {
+ get { return m_FolderName; }
+ }
+
+ public override object NodeObject
+ {
+ get { return NodeName; }
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosBuilder/Controls/RegistryEditor.Designer.cs b/reactos/tools/sysgen/RosBuilder/Controls/RegistryEditor.Designer.cs
new file mode 100644
index 00000000000..1c20f5713ba
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Controls/RegistryEditor.Designer.cs
@@ -0,0 +1,118 @@
+namespace RosBuilder.Controls
+{
+ partial class RegistryEditor
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.splitContainer1 = new System.Windows.Forms.SplitContainer();
+ this.listView1 = new System.Windows.Forms.ListView();
+ this.treeView1 = new System.Windows.Forms.TreeView();
+ this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
+ this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
+ this.columnHeader3 = new System.Windows.Forms.ColumnHeader();
+ this.splitContainer1.Panel1.SuspendLayout();
+ this.splitContainer1.Panel2.SuspendLayout();
+ this.splitContainer1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // splitContainer1
+ //
+ this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.splitContainer1.Location = new System.Drawing.Point(0, 0);
+ this.splitContainer1.Name = "splitContainer1";
+ //
+ // splitContainer1.Panel1
+ //
+ this.splitContainer1.Panel1.Controls.Add(this.treeView1);
+ //
+ // splitContainer1.Panel2
+ //
+ this.splitContainer1.Panel2.Controls.Add(this.listView1);
+ this.splitContainer1.Size = new System.Drawing.Size(623, 542);
+ this.splitContainer1.SplitterDistance = 207;
+ this.splitContainer1.TabIndex = 0;
+ //
+ // listView1
+ //
+ this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+ this.columnHeader1,
+ this.columnHeader2,
+ this.columnHeader3});
+ this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.listView1.Location = new System.Drawing.Point(0, 0);
+ this.listView1.Name = "listView1";
+ this.listView1.Size = new System.Drawing.Size(412, 542);
+ this.listView1.TabIndex = 0;
+ this.listView1.UseCompatibleStateImageBehavior = false;
+ this.listView1.View = System.Windows.Forms.View.Details;
+ //
+ // treeView1
+ //
+ this.treeView1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.treeView1.Location = new System.Drawing.Point(0, 0);
+ this.treeView1.Name = "treeView1";
+ this.treeView1.Size = new System.Drawing.Size(207, 542);
+ this.treeView1.TabIndex = 0;
+ //
+ // columnHeader1
+ //
+ this.columnHeader1.Text = "Name";
+ this.columnHeader1.Width = 159;
+ //
+ // columnHeader2
+ //
+ this.columnHeader2.Text = "Type";
+ this.columnHeader2.Width = 130;
+ //
+ // columnHeader3
+ //
+ this.columnHeader3.Text = "Data";
+ //
+ // RegistryEditor
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.splitContainer1);
+ this.Name = "RegistryEditor";
+ this.Size = new System.Drawing.Size(623, 542);
+ this.splitContainer1.Panel1.ResumeLayout(false);
+ this.splitContainer1.Panel2.ResumeLayout(false);
+ this.splitContainer1.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.SplitContainer splitContainer1;
+ private System.Windows.Forms.TreeView treeView1;
+ private System.Windows.Forms.ListView listView1;
+ private System.Windows.Forms.ColumnHeader columnHeader1;
+ private System.Windows.Forms.ColumnHeader columnHeader2;
+ private System.Windows.Forms.ColumnHeader columnHeader3;
+ }
+}
diff --git a/reactos/tools/sysgen/RosBuilder/Controls/RegistryEditor.cs b/reactos/tools/sysgen/RosBuilder/Controls/RegistryEditor.cs
new file mode 100644
index 00000000000..738adfbefc0
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Controls/RegistryEditor.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+
+namespace RosBuilder.Controls
+{
+ public partial class RegistryEditor : UserControl
+ {
+ public RegistryEditor()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosBuilder/Controls/RegistryEditor.resx b/reactos/tools/sysgen/RosBuilder/Controls/RegistryEditor.resx
new file mode 100644
index 00000000000..19dc0dd8b39
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Controls/RegistryEditor.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/Form1.Designer.cs b/reactos/tools/sysgen/RosBuilder/Form1.Designer.cs
new file mode 100644
index 00000000000..04418fb8104
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Form1.Designer.cs
@@ -0,0 +1,38 @@
+namespace RosBuilder
+{
+ partial class Form1
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Text = "Form1";
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/Form1.cs b/reactos/tools/sysgen/RosBuilder/Form1.cs
new file mode 100644
index 00000000000..a11fbad5119
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Form1.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+
+namespace RosBuilder
+{
+ public partial class Form1 : Form
+ {
+ public Form1()
+ {
+ InitializeComponent();
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/Form1.resx b/reactos/tools/sysgen/RosBuilder/Form1.resx
new file mode 100644
index 00000000000..19dc0dd8b39
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Form1.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/Inspectors/PlatformInspector.cs b/reactos/tools/sysgen/RosBuilder/Inspectors/PlatformInspector.cs
new file mode 100644
index 00000000000..7d798289853
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Inspectors/PlatformInspector.cs
@@ -0,0 +1,155 @@
+using System;
+using System.Windows.Forms;
+using System.ComponentModel;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace TriStateTreeViewDemo
+{
+ public class PlatformInspector
+ {
+ private RBuildPlatform m_Platform = null;
+
+ public PlatformInspector(RBuildPlatform platform)
+ {
+ m_Platform = platform;
+ }
+
+ [Category("Info")]
+ public string Name
+ {
+ get { return m_Platform.Name; }
+ set { m_Platform.Name = value; }
+ }
+
+ [Category("Info")]
+ public string Description
+ {
+ get { return m_Platform.Description; }
+ set { m_Platform.Description = value; }
+ }
+
+ [Category("Applications")]
+ [Description("The module to be used as a shell for the platform")]
+ public string Shell
+ {
+ set
+ {
+ if (value != string.Empty)
+ {
+ try
+ {
+ RBuildModule module = m_Platform.Modules.GetByName(value);
+
+ if (module == null)
+ throw new ArgumentException("Unknown '" + value + "' shell module");
+
+ if (module.Type != ModuleType.Win32CUI &&
+ module.Type != ModuleType.Win32GUI)
+ throw new ArgumentException("Only Win32 GUI and CUI applications can be set as shell");
+
+ /* set the shell to use */
+ m_Platform.Shell = module;
+ }
+ catch (ArgumentException e)
+ {
+ MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ }
+ get
+ {
+ if (m_Platform.Shell != null)
+ return m_Platform.Shell.Name;
+
+ return string.Empty;
+ }
+ }
+
+ [Category("Applications")]
+ [Description("The module to be used as a screensaver for the platform")]
+ public string Screensaver
+ {
+ set
+ {
+ if (value != string.Empty)
+ {
+ try
+ {
+ RBuildModule module = m_Platform.Modules.GetByName(value);
+
+ if (module == null)
+ throw new ArgumentException("Unknown '" + value + "' screen saver module");
+
+ if (module.Type != ModuleType.Win32SCR)
+ throw new ArgumentException("Only Win32 SCR applications can be set as shell");
+
+ /* set the shell to use */
+ m_Platform.Screensaver = module;
+ }
+ catch (ArgumentException e)
+ {
+ MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ }
+ get
+ {
+ if (m_Platform.Screensaver != null)
+ return m_Platform.Screensaver.Name;
+
+ return string.Empty;
+ }
+ }
+
+ //public IList DebugChannels
+ //{
+ // get { return m_Platform.DebugChannels; }
+ //}
+
+ [Category("Appareance")]
+ [Description("The module to be used as a screensaver for the platform")]
+ public string Wallpaper
+ {
+ set
+ {
+ if (value != string.Empty)
+ {
+ RBuildWallpaperFile iW = new RBuildWallpaperFile();
+
+ iW.Name = value;
+
+ m_Platform.Wallpaper = iW;
+
+ //foreach (RBuildModule module in m_Platform.Modules)
+ //{
+ // foreach (RBuildFile file in module.Files)
+ // {
+ // RBuildInstallWallpaperFile wallpaper = file as RBuildInstallWallpaperFile;
+
+ // if (wallpaper != null)
+ // {
+ // if (wallpaper.ID.ToLower() == value.ToLower())
+ // {
+ // m_Platform.Wallpaper = wallpaper;
+ // }
+ // }
+ // }
+ //}
+
+ // specified wallpaper not found
+ //throw new ArgumentException();
+ }
+ }
+ get
+ {
+ if (m_Platform.Wallpaper != null)
+ return m_Platform.Wallpaper.ID;
+
+ return string.Empty;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosBuilder/MainForm.Designer.cs b/reactos/tools/sysgen/RosBuilder/MainForm.Designer.cs
new file mode 100644
index 00000000000..9ebe4ebeefd
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/MainForm.Designer.cs
@@ -0,0 +1,654 @@
+namespace TriStateTreeViewDemo
+{
+ partial class MainForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
+ this.statusStrip1 = new System.Windows.Forms.StatusStrip();
+ this.toolStrip1 = new System.Windows.Forms.ToolStrip();
+ this.newToolStripButton = new System.Windows.Forms.ToolStripButton();
+ this.openToolStripButton = new System.Windows.Forms.ToolStripButton();
+ this.saveToolStripButton = new System.Windows.Forms.ToolStripButton();
+ this.toolStripSeparator = new System.Windows.Forms.ToolStripSeparator();
+ this.cutToolStripButton = new System.Windows.Forms.ToolStripButton();
+ this.copyToolStripButton = new System.Windows.Forms.ToolStripButton();
+ this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
+ this.saveConfigToolStripButton = new System.Windows.Forms.ToolStripButton();
+ this.cmbArchitecture = new System.Windows.Forms.ToolStripComboBox();
+ this.cmbDebug = new System.Windows.Forms.ToolStripComboBox();
+ this.cmbOptimization = new System.Windows.Forms.ToolStripComboBox();
+ this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
+ this.helpToolStripButton = new System.Windows.Forms.ToolStripButton();
+ this.menuStrip1 = new System.Windows.Forms.MenuStrip();
+ this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
+ this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
+ this.printToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.printPreviewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
+ this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.platformToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.addFiltersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.addLanguagesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.addDebToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.redoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
+ this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
+ this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.customizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.contentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.indexToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.searchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
+ this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.pgProperties = new System.Windows.Forms.PropertyGrid();
+ this.splitContainer1 = new System.Windows.Forms.SplitContainer();
+ this.splitContainer2 = new System.Windows.Forms.SplitContainer();
+ this.tvPlatform = new TriStateTreeViewDemo.PlatformTreeView();
+ this.tvProject = new TriStateTreeViewDemo.ProjectTreeView();
+ this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
+ this.statusStrip1.SuspendLayout();
+ this.toolStrip1.SuspendLayout();
+ this.menuStrip1.SuspendLayout();
+ this.splitContainer1.Panel1.SuspendLayout();
+ this.splitContainer1.Panel2.SuspendLayout();
+ this.splitContainer1.SuspendLayout();
+ this.splitContainer2.Panel1.SuspendLayout();
+ this.splitContainer2.Panel2.SuspendLayout();
+ this.splitContainer2.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // statusStrip1
+ //
+ this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.toolStripStatusLabel1});
+ this.statusStrip1.Location = new System.Drawing.Point(0, 601);
+ this.statusStrip1.Name = "statusStrip1";
+ this.statusStrip1.Size = new System.Drawing.Size(820, 22);
+ this.statusStrip1.TabIndex = 5;
+ this.statusStrip1.Text = "statusStrip1";
+ //
+ // toolStrip1
+ //
+ this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.newToolStripButton,
+ this.openToolStripButton,
+ this.saveToolStripButton,
+ this.toolStripSeparator,
+ this.cutToolStripButton,
+ this.copyToolStripButton,
+ this.toolStripSeparator8,
+ this.saveConfigToolStripButton,
+ this.cmbArchitecture,
+ this.cmbDebug,
+ this.cmbOptimization,
+ this.toolStripSeparator1,
+ this.helpToolStripButton});
+ this.toolStrip1.Location = new System.Drawing.Point(0, 24);
+ this.toolStrip1.Name = "toolStrip1";
+ this.toolStrip1.Size = new System.Drawing.Size(820, 25);
+ this.toolStrip1.TabIndex = 6;
+ this.toolStrip1.Text = "toolStrip1";
+ //
+ // newToolStripButton
+ //
+ this.newToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.newToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("newToolStripButton.Image")));
+ this.newToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.newToolStripButton.Name = "newToolStripButton";
+ this.newToolStripButton.Size = new System.Drawing.Size(23, 22);
+ this.newToolStripButton.Text = "&New";
+ this.newToolStripButton.Click += new System.EventHandler(this.newToolStripButton_Click);
+ //
+ // openToolStripButton
+ //
+ this.openToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.openToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripButton.Image")));
+ this.openToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.openToolStripButton.Name = "openToolStripButton";
+ this.openToolStripButton.Size = new System.Drawing.Size(23, 22);
+ this.openToolStripButton.Text = "&Open";
+ this.openToolStripButton.Click += new System.EventHandler(this.openToolStripButton_Click);
+ //
+ // saveToolStripButton
+ //
+ this.saveToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.saveToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripButton.Image")));
+ this.saveToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.saveToolStripButton.Name = "saveToolStripButton";
+ this.saveToolStripButton.Size = new System.Drawing.Size(23, 22);
+ this.saveToolStripButton.Text = "&Save";
+ this.saveToolStripButton.Click += new System.EventHandler(this.saveToolStripButton_Click);
+ //
+ // toolStripSeparator
+ //
+ this.toolStripSeparator.Name = "toolStripSeparator";
+ this.toolStripSeparator.Size = new System.Drawing.Size(6, 25);
+ //
+ // cutToolStripButton
+ //
+ this.cutToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.cutToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("cutToolStripButton.Image")));
+ this.cutToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.cutToolStripButton.Name = "cutToolStripButton";
+ this.cutToolStripButton.Size = new System.Drawing.Size(23, 22);
+ this.cutToolStripButton.Text = "C&ut";
+ //
+ // copyToolStripButton
+ //
+ this.copyToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.copyToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("copyToolStripButton.Image")));
+ this.copyToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.copyToolStripButton.Name = "copyToolStripButton";
+ this.copyToolStripButton.Size = new System.Drawing.Size(23, 22);
+ this.copyToolStripButton.Text = "&Copy";
+ //
+ // toolStripSeparator8
+ //
+ this.toolStripSeparator8.Name = "toolStripSeparator8";
+ this.toolStripSeparator8.Size = new System.Drawing.Size(6, 25);
+ //
+ // saveConfigToolStripButton
+ //
+ this.saveConfigToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.saveConfigToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("saveConfigToolStripButton.Image")));
+ this.saveConfigToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.saveConfigToolStripButton.Name = "saveConfigToolStripButton";
+ this.saveConfigToolStripButton.Size = new System.Drawing.Size(69, 22);
+ this.saveConfigToolStripButton.Text = "&Save Config";
+ this.saveConfigToolStripButton.Click += new System.EventHandler(this.saveConfigToolStripButton_Click);
+ //
+ // cmbArchitecture
+ //
+ this.cmbArchitecture.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cmbArchitecture.Name = "cmbArchitecture";
+ this.cmbArchitecture.Size = new System.Drawing.Size(150, 25);
+ //
+ // cmbDebug
+ //
+ this.cmbDebug.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cmbDebug.Name = "cmbDebug";
+ this.cmbDebug.Size = new System.Drawing.Size(75, 25);
+ //
+ // cmbOptimization
+ //
+ this.cmbOptimization.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cmbOptimization.Name = "cmbOptimization";
+ this.cmbOptimization.Size = new System.Drawing.Size(75, 25);
+ //
+ // toolStripSeparator1
+ //
+ this.toolStripSeparator1.Name = "toolStripSeparator1";
+ this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
+ //
+ // helpToolStripButton
+ //
+ this.helpToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.helpToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("helpToolStripButton.Image")));
+ this.helpToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.helpToolStripButton.Name = "helpToolStripButton";
+ this.helpToolStripButton.Size = new System.Drawing.Size(23, 22);
+ this.helpToolStripButton.Text = "He&lp";
+ //
+ // menuStrip1
+ //
+ this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.fileToolStripMenuItem,
+ this.platformToolStripMenuItem,
+ this.editToolStripMenuItem,
+ this.toolsToolStripMenuItem,
+ this.helpToolStripMenuItem});
+ this.menuStrip1.Location = new System.Drawing.Point(0, 0);
+ this.menuStrip1.Name = "menuStrip1";
+ this.menuStrip1.Size = new System.Drawing.Size(820, 24);
+ this.menuStrip1.TabIndex = 7;
+ this.menuStrip1.Text = "menuStrip1";
+ //
+ // fileToolStripMenuItem
+ //
+ this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.newToolStripMenuItem,
+ this.openToolStripMenuItem,
+ this.toolStripSeparator2,
+ this.saveToolStripMenuItem,
+ this.saveAsToolStripMenuItem,
+ this.toolStripSeparator3,
+ this.printToolStripMenuItem,
+ this.printPreviewToolStripMenuItem,
+ this.toolStripSeparator4,
+ this.exitToolStripMenuItem});
+ this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
+ this.fileToolStripMenuItem.Size = new System.Drawing.Size(35, 20);
+ this.fileToolStripMenuItem.Text = "&File";
+ //
+ // newToolStripMenuItem
+ //
+ this.newToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("newToolStripMenuItem.Image")));
+ this.newToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.newToolStripMenuItem.Name = "newToolStripMenuItem";
+ this.newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
+ this.newToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
+ this.newToolStripMenuItem.Text = "&New";
+ //
+ // openToolStripMenuItem
+ //
+ this.openToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripMenuItem.Image")));
+ this.openToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.openToolStripMenuItem.Name = "openToolStripMenuItem";
+ this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
+ this.openToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
+ this.openToolStripMenuItem.Text = "&Open";
+ //
+ // toolStripSeparator2
+ //
+ this.toolStripSeparator2.Name = "toolStripSeparator2";
+ this.toolStripSeparator2.Size = new System.Drawing.Size(148, 6);
+ //
+ // saveToolStripMenuItem
+ //
+ this.saveToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripMenuItem.Image")));
+ this.saveToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
+ this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
+ this.saveToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
+ this.saveToolStripMenuItem.Text = "&Save";
+ //
+ // saveAsToolStripMenuItem
+ //
+ this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem";
+ this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
+ this.saveAsToolStripMenuItem.Text = "Save &As";
+ //
+ // toolStripSeparator3
+ //
+ this.toolStripSeparator3.Name = "toolStripSeparator3";
+ this.toolStripSeparator3.Size = new System.Drawing.Size(148, 6);
+ //
+ // printToolStripMenuItem
+ //
+ this.printToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("printToolStripMenuItem.Image")));
+ this.printToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.printToolStripMenuItem.Name = "printToolStripMenuItem";
+ this.printToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P)));
+ this.printToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
+ this.printToolStripMenuItem.Text = "&Print";
+ //
+ // printPreviewToolStripMenuItem
+ //
+ this.printPreviewToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("printPreviewToolStripMenuItem.Image")));
+ this.printPreviewToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.printPreviewToolStripMenuItem.Name = "printPreviewToolStripMenuItem";
+ this.printPreviewToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
+ this.printPreviewToolStripMenuItem.Text = "Print Pre&view";
+ //
+ // toolStripSeparator4
+ //
+ this.toolStripSeparator4.Name = "toolStripSeparator4";
+ this.toolStripSeparator4.Size = new System.Drawing.Size(148, 6);
+ //
+ // exitToolStripMenuItem
+ //
+ this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
+ this.exitToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
+ this.exitToolStripMenuItem.Text = "E&xit";
+ //
+ // platformToolStripMenuItem
+ //
+ this.platformToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.addFiltersToolStripMenuItem,
+ this.addLanguagesToolStripMenuItem,
+ this.addDebToolStripMenuItem});
+ this.platformToolStripMenuItem.Name = "platformToolStripMenuItem";
+ this.platformToolStripMenuItem.Size = new System.Drawing.Size(59, 20);
+ this.platformToolStripMenuItem.Text = "&Platform";
+ //
+ // addFiltersToolStripMenuItem
+ //
+ this.addFiltersToolStripMenuItem.Name = "addFiltersToolStripMenuItem";
+ this.addFiltersToolStripMenuItem.Size = new System.Drawing.Size(185, 22);
+ this.addFiltersToolStripMenuItem.Text = "&Add Filters";
+ this.addFiltersToolStripMenuItem.Click += new System.EventHandler(this.addFiltersToolStripMenuItem_Click);
+ //
+ // addLanguagesToolStripMenuItem
+ //
+ this.addLanguagesToolStripMenuItem.Name = "addLanguagesToolStripMenuItem";
+ this.addLanguagesToolStripMenuItem.Size = new System.Drawing.Size(185, 22);
+ this.addLanguagesToolStripMenuItem.Text = "&Add Languages";
+ this.addLanguagesToolStripMenuItem.Click += new System.EventHandler(this.addLanguagesToolStripMenuItem_Click);
+ //
+ // addDebToolStripMenuItem
+ //
+ this.addDebToolStripMenuItem.Name = "addDebToolStripMenuItem";
+ this.addDebToolStripMenuItem.Size = new System.Drawing.Size(185, 22);
+ this.addDebToolStripMenuItem.Text = "&Add Debug Channels";
+ this.addDebToolStripMenuItem.Click += new System.EventHandler(this.addDebToolStripMenuItem_Click);
+ //
+ // editToolStripMenuItem
+ //
+ this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.undoToolStripMenuItem,
+ this.redoToolStripMenuItem,
+ this.toolStripSeparator5,
+ this.cutToolStripMenuItem,
+ this.copyToolStripMenuItem,
+ this.pasteToolStripMenuItem,
+ this.toolStripSeparator6,
+ this.selectAllToolStripMenuItem});
+ this.editToolStripMenuItem.Name = "editToolStripMenuItem";
+ this.editToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
+ this.editToolStripMenuItem.Text = "&Edit";
+ //
+ // undoToolStripMenuItem
+ //
+ this.undoToolStripMenuItem.Name = "undoToolStripMenuItem";
+ this.undoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z)));
+ this.undoToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
+ this.undoToolStripMenuItem.Text = "&Undo";
+ //
+ // redoToolStripMenuItem
+ //
+ this.redoToolStripMenuItem.Name = "redoToolStripMenuItem";
+ this.redoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y)));
+ this.redoToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
+ this.redoToolStripMenuItem.Text = "&Redo";
+ //
+ // toolStripSeparator5
+ //
+ this.toolStripSeparator5.Name = "toolStripSeparator5";
+ this.toolStripSeparator5.Size = new System.Drawing.Size(147, 6);
+ //
+ // cutToolStripMenuItem
+ //
+ this.cutToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("cutToolStripMenuItem.Image")));
+ this.cutToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.cutToolStripMenuItem.Name = "cutToolStripMenuItem";
+ this.cutToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X)));
+ this.cutToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
+ this.cutToolStripMenuItem.Text = "Cu&t";
+ //
+ // copyToolStripMenuItem
+ //
+ this.copyToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("copyToolStripMenuItem.Image")));
+ this.copyToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
+ this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
+ this.copyToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
+ this.copyToolStripMenuItem.Text = "&Copy";
+ //
+ // pasteToolStripMenuItem
+ //
+ this.pasteToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("pasteToolStripMenuItem.Image")));
+ this.pasteToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem";
+ this.pasteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));
+ this.pasteToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
+ this.pasteToolStripMenuItem.Text = "&Paste";
+ //
+ // toolStripSeparator6
+ //
+ this.toolStripSeparator6.Name = "toolStripSeparator6";
+ this.toolStripSeparator6.Size = new System.Drawing.Size(147, 6);
+ //
+ // selectAllToolStripMenuItem
+ //
+ this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem";
+ this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
+ this.selectAllToolStripMenuItem.Text = "Select &All";
+ //
+ // toolsToolStripMenuItem
+ //
+ this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.customizeToolStripMenuItem,
+ this.optionsToolStripMenuItem});
+ this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem";
+ this.toolsToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
+ this.toolsToolStripMenuItem.Text = "&Tools";
+ //
+ // customizeToolStripMenuItem
+ //
+ this.customizeToolStripMenuItem.Name = "customizeToolStripMenuItem";
+ this.customizeToolStripMenuItem.Size = new System.Drawing.Size(134, 22);
+ this.customizeToolStripMenuItem.Text = "&Customize";
+ //
+ // optionsToolStripMenuItem
+ //
+ this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
+ this.optionsToolStripMenuItem.Size = new System.Drawing.Size(134, 22);
+ this.optionsToolStripMenuItem.Text = "&Options";
+ //
+ // helpToolStripMenuItem
+ //
+ this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.contentsToolStripMenuItem,
+ this.indexToolStripMenuItem,
+ this.searchToolStripMenuItem,
+ this.toolStripSeparator7,
+ this.aboutToolStripMenuItem});
+ this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
+ this.helpToolStripMenuItem.Size = new System.Drawing.Size(40, 20);
+ this.helpToolStripMenuItem.Text = "&Help";
+ //
+ // contentsToolStripMenuItem
+ //
+ this.contentsToolStripMenuItem.Name = "contentsToolStripMenuItem";
+ this.contentsToolStripMenuItem.Size = new System.Drawing.Size(129, 22);
+ this.contentsToolStripMenuItem.Text = "&Contents";
+ //
+ // indexToolStripMenuItem
+ //
+ this.indexToolStripMenuItem.Name = "indexToolStripMenuItem";
+ this.indexToolStripMenuItem.Size = new System.Drawing.Size(129, 22);
+ this.indexToolStripMenuItem.Text = "&Index";
+ //
+ // searchToolStripMenuItem
+ //
+ this.searchToolStripMenuItem.Name = "searchToolStripMenuItem";
+ this.searchToolStripMenuItem.Size = new System.Drawing.Size(129, 22);
+ this.searchToolStripMenuItem.Text = "&Search";
+ //
+ // toolStripSeparator7
+ //
+ this.toolStripSeparator7.Name = "toolStripSeparator7";
+ this.toolStripSeparator7.Size = new System.Drawing.Size(126, 6);
+ //
+ // aboutToolStripMenuItem
+ //
+ this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
+ this.aboutToolStripMenuItem.Size = new System.Drawing.Size(129, 22);
+ this.aboutToolStripMenuItem.Text = "&About...";
+ //
+ // pgProperties
+ //
+ this.pgProperties.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pgProperties.Location = new System.Drawing.Point(0, 0);
+ this.pgProperties.Name = "pgProperties";
+ this.pgProperties.Size = new System.Drawing.Size(348, 304);
+ this.pgProperties.TabIndex = 9;
+ //
+ // splitContainer1
+ //
+ this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.splitContainer1.Location = new System.Drawing.Point(0, 49);
+ this.splitContainer1.Name = "splitContainer1";
+ //
+ // splitContainer1.Panel1
+ //
+ this.splitContainer1.Panel1.Controls.Add(this.tvPlatform);
+ //
+ // splitContainer1.Panel2
+ //
+ this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
+ this.splitContainer1.Size = new System.Drawing.Size(820, 552);
+ this.splitContainer1.SplitterDistance = 468;
+ this.splitContainer1.TabIndex = 11;
+ //
+ // splitContainer2
+ //
+ this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.splitContainer2.Location = new System.Drawing.Point(0, 0);
+ this.splitContainer2.Name = "splitContainer2";
+ this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
+ //
+ // splitContainer2.Panel1
+ //
+ this.splitContainer2.Panel1.Controls.Add(this.tvProject);
+ //
+ // splitContainer2.Panel2
+ //
+ this.splitContainer2.Panel2.Controls.Add(this.pgProperties);
+ this.splitContainer2.Size = new System.Drawing.Size(348, 552);
+ this.splitContainer2.SplitterDistance = 244;
+ this.splitContainer2.TabIndex = 0;
+ //
+ // tvPlatform
+ //
+ this.tvPlatform.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tvPlatform.ImageIndex = 1;
+ this.tvPlatform.Location = new System.Drawing.Point(0, 0);
+ this.tvPlatform.Name = "tvPlatform";
+ this.tvPlatform.SelectedImageIndex = 1;
+ this.tvPlatform.Size = new System.Drawing.Size(468, 552);
+ this.tvPlatform.TabIndex = 1;
+ //
+ // tvProject
+ //
+ this.tvProject.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tvProject.Location = new System.Drawing.Point(0, 0);
+ this.tvProject.Name = "tvProject";
+ this.tvProject.Size = new System.Drawing.Size(348, 244);
+ this.tvProject.TabIndex = 10;
+ //
+ // toolStripStatusLabel1
+ //
+ this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
+ this.toolStripStatusLabel1.Size = new System.Drawing.Size(109, 17);
+ this.toolStripStatusLabel1.Text = "toolStripStatusLabel1";
+ //
+ // MainForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(820, 623);
+ this.Controls.Add(this.splitContainer1);
+ this.Controls.Add(this.toolStrip1);
+ this.Controls.Add(this.statusStrip1);
+ this.Controls.Add(this.menuStrip1);
+ this.MainMenuStrip = this.menuStrip1;
+ this.Name = "MainForm";
+ this.Text = "SysGen Platform Designer";
+ this.Load += new System.EventHandler(this.MainForm_Load);
+ this.statusStrip1.ResumeLayout(false);
+ this.statusStrip1.PerformLayout();
+ this.toolStrip1.ResumeLayout(false);
+ this.toolStrip1.PerformLayout();
+ this.menuStrip1.ResumeLayout(false);
+ this.menuStrip1.PerformLayout();
+ this.splitContainer1.Panel1.ResumeLayout(false);
+ this.splitContainer1.Panel2.ResumeLayout(false);
+ this.splitContainer1.ResumeLayout(false);
+ this.splitContainer2.Panel1.ResumeLayout(false);
+ this.splitContainer2.Panel2.ResumeLayout(false);
+ this.splitContainer2.ResumeLayout(false);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private TriStateTreeViewDemo.PlatformTreeView tvPlatform;
+ private System.Windows.Forms.StatusStrip statusStrip1;
+ private System.Windows.Forms.ToolStrip toolStrip1;
+ private System.Windows.Forms.ToolStripButton newToolStripButton;
+ private System.Windows.Forms.ToolStripButton openToolStripButton;
+ private System.Windows.Forms.ToolStripButton saveToolStripButton;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator;
+ private System.Windows.Forms.ToolStripButton cutToolStripButton;
+ private System.Windows.Forms.ToolStripButton copyToolStripButton;
+ private System.Windows.Forms.ToolStripButton saveConfigToolStripButton;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
+ private System.Windows.Forms.ToolStripButton helpToolStripButton;
+ private System.Windows.Forms.ToolStripComboBox cmbArchitecture;
+ private System.Windows.Forms.ToolStripComboBox cmbDebug;
+ private System.Windows.Forms.MenuStrip menuStrip1;
+ private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
+ private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
+ private System.Windows.Forms.ToolStripMenuItem printToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem printPreviewToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
+ private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem undoToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem redoToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
+ private System.Windows.Forms.ToolStripMenuItem cutToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;
+ private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem toolsToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem customizeToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem contentsToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem indexToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem searchToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;
+ private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
+ private System.Windows.Forms.PropertyGrid pgProperties;
+ private System.Windows.Forms.ToolStripComboBox cmbOptimization;
+ private ProjectTreeView tvProject;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;
+ private System.Windows.Forms.SplitContainer splitContainer1;
+ private System.Windows.Forms.SplitContainer splitContainer2;
+ private System.Windows.Forms.ToolStripMenuItem platformToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem addFiltersToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem addLanguagesToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem addDebToolStripMenuItem;
+ private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
+ }
+}
+
diff --git a/reactos/tools/sysgen/RosBuilder/MainForm.cs b/reactos/tools/sysgen/RosBuilder/MainForm.cs
new file mode 100644
index 00000000000..c001ba7d016
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/MainForm.cs
@@ -0,0 +1,362 @@
+using System;
+using System.Xml;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+
+using TriStateTreeViewDemo;
+
+using SysGen.Framework.Catalog;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Log;
+using SysGen.BuildEngine.Framework;
+using SysGen.RBuild.Framework;
+
+namespace TriStateTreeViewDemo
+{
+ public interface ISysGenDesigner
+ {
+ ModuleFilterController ModuleFilterController { get; }
+ ProjectController ProjectController { get; }
+ object InspectedObject { set; }
+ }
+
+ public partial class MainForm : Form, ISysGenDesigner
+ {
+ ProjectController m_ProjectController = null;
+ ModuleFilterController m_FilterController = null;
+
+ public MainForm()
+ {
+ InitializeComponent();
+
+ m_ProjectController = new ProjectController(this);
+ m_FilterController = new ModuleFilterController(this);
+
+ tvPlatform.SetCatalog(this);
+ tvProject.SetCatalog(this);
+ tvProject.DoubleClick += new EventHandler(tvProject_DoubleClick);
+ //lvModuleFilters.SetCatalog(this);
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ //m_project = new RBuildProject();
+
+ m_ProjectController = new ProjectController(this);
+ m_FilterController = new ModuleFilterController(this);
+
+ tvPlatform.SetCatalog(this);
+ tvProject.SetCatalog(this);
+ //lvModuleFilters.SetCatalog(this);
+
+ //PlatformCatalogReader m_Reader = new PlatformCatalogReader(@"C:\Ros\trunk\reactos\rbuilddb.xml");
+
+ /*
+ BuildLog.Listeners.Clear();
+
+ m_SysGenEngine.SetDefaults = false;
+ m_SysGenEngine.RunBackends = false;
+ m_SysGenEngine.CleanCustomConfigs();
+ m_SysGenEngine.ReadBuildFiles();
+
+ m_PlatformController = new PlatformController(this);
+ m_FilterController = new ModuleFilterController(this);
+
+ catalogTriStateTreeView1.SetCatalog(this);
+ lvModuleFilters.SetCatalog(this);
+ */
+
+ }
+
+ void tvProject_DoubleClick(object sender, EventArgs e)
+ {
+ }
+
+ private void button2_Click(object sender, EventArgs e)
+ {
+ using (XmlTextWriter writer = new XmlTextWriter(@"c:\pkg.rbuild", Encoding.ASCII))
+ {
+ writer.Indentation = 4;
+ writer.Formatting = Formatting.Indented;
+
+ // Starts a new document
+ writer.WriteStartDocument();
+ writer.WriteStartElement("module");
+ writer.WriteAttributeString("name", "");
+ writer.WriteAttributeString("type", "modulegroup");
+
+ foreach (RBuildModule module in m_ProjectController.Project.Platform.Modules)
+ {
+ writer.WriteElementString("requires", module.Name);
+ }
+
+ writer.WriteEndElement();
+ writer.WriteEndDocument();
+ }
+
+ }
+
+ private void button3_Click(object sender, EventArgs e)
+ {
+ }
+
+ public ModuleFilterController ModuleFilterController
+ {
+ get { return m_FilterController; }
+ }
+
+ public ProjectController ProjectController
+ {
+ get { return m_ProjectController; }
+ }
+
+ private void lvModuleFilters_SelectedIndexChanged(object sender, EventArgs e)
+ {
+
+ }
+
+ //private void lvModuleFilters_ItemCheck(object sender, ItemCheckEventArgs e)
+ //{
+ // ModuleFiltersListViewItem filerListViewItem = lvModuleFilters.FocusedItem as ModuleFiltersListViewItem;
+
+ // if (filerListViewItem != null)
+ // {
+ // if (e.NewValue == CheckState.Checked)
+ // {
+ // m_FilterController.Apply(filerListViewItem.Filter);
+ // }
+ // }
+ //}
+
+ private void MainForm_Load(object sender, EventArgs e)
+ {
+ cmbArchitecture.Items.Add("x86 - (i486)");
+ cmbArchitecture.Items.Add("x86 - (i586)");
+ cmbArchitecture.Items.Add("x86 - (Pentium)");
+ cmbArchitecture.Items.Add("x86 - (Pentium2)");
+ cmbArchitecture.Items.Add("x86 - (Pentium3)");
+ cmbArchitecture.Items.Add("x86 - (Pentium4)");
+ cmbArchitecture.Items.Add("x86 - (athlon-xp)");
+ cmbArchitecture.Items.Add("x86 - (athlon-mp)");
+ cmbArchitecture.Items.Add("x86 - (k6-2)");
+ cmbArchitecture.Items.Add("x86 - Xbox");
+ cmbArchitecture.Items.Add("Power PC");
+ cmbArchitecture.Items.Add("ARM");
+ cmbArchitecture.SelectedIndex = 2;
+
+ cmbDebug.Items.Add("Debug");
+ cmbDebug.Items.Add("Release");
+ cmbDebug.SelectedIndex = 0;
+
+ cmbOptimization.Items.Add("Level 0");
+ cmbOptimization.Items.Add("Level 1");
+ cmbOptimization.Items.Add("Level 2");
+ cmbOptimization.Items.Add("Level 3");
+ cmbOptimization.Items.Add("Level 4");
+ cmbOptimization.Items.Add("Level 5");
+ cmbOptimization.SelectedIndex = 1;
+ }
+
+ public object InspectedObject
+ {
+ set
+ {
+ if (value is RBuildPlatform)
+ {
+ pgProperties.SelectedObject = new PlatformInspector(m_ProjectController.Project.Platform);
+ }
+ else
+ pgProperties.SelectedObject = value;
+ }
+ }
+
+ private void openToolStripButton_Click(object sender, EventArgs e)
+ {
+ m_ProjectController.Open();
+ }
+
+ private void saveToolStripButton_Click(object sender, EventArgs e)
+ {
+ m_ProjectController.Save();
+ }
+
+ private void saveConfigToolStripButton_Click(object sender, EventArgs e)
+ {
+ //if (MessageBox.Show("Your platform does not have a default shell selected ¿are you sure you want to continue?",
+ // "Question",
+ // MessageBoxButtons.YesNo,
+ // MessageBoxIcon.Question) == DialogResult.OK)
+ //{
+ // Creates an XML file is not exist
+ using (XmlTextWriter writer = new XmlTextWriter(m_ProjectController.SysGenProject.Source + @"\config.rbuild", Encoding.ASCII))
+ {
+ writer.Indentation = 4;
+ writer.Formatting = Formatting.Indented;
+
+ // Starts a new document
+ writer.WriteStartDocument();
+ writer.WriteStartElement("group");
+
+ writer.WriteComment("Platform information");
+ writer.WriteElementString("platformname", m_ProjectController.Project.Platform.Name);
+ writer.WriteElementString("platformdescription", m_ProjectController.Project.Platform.Description);
+
+ writer.WriteComment("Default applications");
+
+ if (m_ProjectController.Project.Platform.Shell != null)
+ {
+ writer.WriteElementString("platformshell", m_ProjectController.Project.Platform.Shell.Name);
+ }
+
+ if (m_ProjectController.Project.Platform.Screensaver != null)
+ {
+ writer.WriteElementString("platformscreensaver", m_ProjectController.Project.Platform.Screensaver.Name);
+ }
+
+ if (m_ProjectController.Project.Platform.Wallpaper != null)
+ {
+ writer.WriteElementString("platformwallpaper", m_ProjectController.Project.Platform.Wallpaper.ID);
+ }
+
+ writer.WriteComment("Modules incuded in the platform");
+ foreach (RBuildModule module in m_ProjectController.Project.Platform.Modules)
+ {
+ writer.WriteElementString("platformmodule", module.Name);
+ }
+
+ writer.WriteComment("Languages incuded in the platform");
+ foreach (RBuildLanguage language in m_ProjectController.Project.Platform.Languages)
+ {
+ writer.WriteElementString("platformlanguage", language.Name);
+ }
+
+ writer.WriteComment("Debug Channels incuded in the platform");
+ foreach (RBuildDebugChannel debugChannel in m_ProjectController.Project.Platform.DebugChannels)
+ {
+ writer.WriteElementString("platformdebugchhanel", debugChannel.Name);
+ }
+
+ writer.WriteComment("Platform RBuild Properties");
+ writer.WriteComment("Properties");
+ writer.WriteStartElement("property");
+ writer.WriteAttributeString("name", "SARCH");
+ writer.WriteAttributeString("value", "");
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("property");
+ writer.WriteAttributeString("name", "OARCH");
+ writer.WriteAttributeString("value", "pentium");
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("property");
+ writer.WriteAttributeString("name", "OPTIMIZE");
+ writer.WriteAttributeString("value", ((int)m_ProjectController.SysGenProject.OptimizeLevel).ToString());
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("property");
+ writer.WriteAttributeString("name", "KDBG");
+ writer.WriteAttributeString("value", m_ProjectController.SysGenProject.KDebug ? "1" : "0");
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("property");
+ writer.WriteAttributeString("name", "DBG");
+ writer.WriteAttributeString("value", m_ProjectController.SysGenProject.Debug ? "1" : "0");
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("property");
+ writer.WriteAttributeString("name", "GDB");
+ writer.WriteAttributeString("value", m_ProjectController.SysGenProject.GDB ? "1" : "0");
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("property");
+ writer.WriteAttributeString("name", "NSWPAT");
+ writer.WriteAttributeString("value", m_ProjectController.SysGenProject.NSWPAT ? "1" : "0");
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("property");
+ writer.WriteAttributeString("name", "_WINKD_");
+ writer.WriteAttributeString("value", m_ProjectController.SysGenProject.WINKD ? "1" : "0");
+ writer.WriteEndElement();
+
+ writer.WriteEndElement();
+ writer.WriteEndDocument();
+ // }
+ }
+ }
+
+ private void newToolStripButton_Click(object sender, EventArgs e)
+ {
+ m_ProjectController.New();
+ }
+
+ private void addFiltersToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ using (NewItemForm newItem = new NewItemForm())
+ {
+ foreach (ModuleFilter filter in ModuleFilterController.ModuleFilters)
+ {
+ newItem.ListView.Items.Add(new ModuleFiltersNewItemListViewItem(this, filter));
+ }
+
+ if (newItem.ShowDialog() == DialogResult.OK)
+ {
+ foreach (ListViewItem lvItem in newItem.ListView.SelectedItems)
+ {
+ NewItemListViewItem item = lvItem as NewItemListViewItem;
+
+ if (item != null)
+ item.Apply();
+ }
+ }
+ }
+ }
+
+ private void addLanguagesToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ using (NewItemForm newItem = new NewItemForm())
+ {
+ foreach (RBuildLanguage language in m_ProjectController.Project.Languages)
+ {
+ newItem.ListView.Items.Add(new LanguageNewItemListViewItem(this, language));
+ }
+
+ if (newItem.ShowDialog() == DialogResult.OK)
+ {
+ foreach (ListViewItem lvItem in newItem.ListView.SelectedItems)
+ {
+ NewItemListViewItem item = lvItem as NewItemListViewItem;
+
+ if (item != null)
+ item.Apply();
+ }
+ }
+ }
+ }
+
+ private void addDebToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ using (NewItemForm newItem = new NewItemForm())
+ {
+ foreach (RBuildDebugChannel channel in m_ProjectController.Project.DebugChannels)
+ {
+ newItem.ListView.Items.Add(new DebugChannelNewItemListViewItem(this, channel));
+ }
+
+ if (newItem.ShowDialog() == DialogResult.OK)
+ {
+ foreach (ListViewItem lvItem in newItem.ListView.SelectedItems)
+ {
+ NewItemListViewItem item = lvItem as NewItemListViewItem;
+
+ if (item != null)
+ item.Apply();
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/MainForm.resx b/reactos/tools/sysgen/RosBuilder/MainForm.resx
new file mode 100644
index 00000000000..222877d4dd7
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/MainForm.resx
@@ -0,0 +1,353 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 17, 17
+
+
+ 127, 17
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAQ9JREFUOE+t09lq
+ wkAUBmBfyr5DfY32jaReSOmFCyKCgkKLFrVUBZeKiEbshqRuaNw1xiXmLxMJBJ0Zc+GBw9zMfDPnHMZm
+ u1ZE35s4zXCqjmC8Al+sgHLjD9y7yGFWPIbecOO45yORtMAEHnxxJHL1IyKI9JeEXqtMwOl50Q8bSS0l
+ 8PzBBPbqAQQxICrgjeapgKZpkJUdBmNZB+y3d/QSnsIZKrDdqZjMFYj9OR9wB1NngHrQsJC36EkrfIkT
+ PuDyJ84AZbOHNF2j1Z2h9i3xAVKfOUjjZssN2oMFmq0xSkLfOmBu3E97iurnENlKxzpgbpzwO0Kh1kOy
+ KFoDjHmzVuYYjRmTDZfyWh9Yd/4B2Mz2w1z7EGUAAAAASUVORK5CYII=
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAlpJREFUOE+tk21I
+ k1EYhif0oyA0sqIQCix/+GcQFFH9CCmiUBTLLEjShJofVBgL2fxoU9Pp5ubUlS5rU9f8rCyjsA+pUCRC
+ TR1ppmVFUSlmhq78unrnQF1KGHTg/nEOz30993PO+7qJFrmUeiv2n+Mij+XLRLLYULdF2pxlEVIDcw0p
+ AsyxD5fmI/rQ94pqi26eOlsfuZj+7BgSm01QdA4ih7m73Yx9qGpavwatjPebqCzOprPt8YKQgzFagqL0
+ BEjyEFWVaBkdLHMxT34uYNwWR9nVTEoL0zHlp2DMSeaSRk6eKt4VWm5WM/rVPNN5SjDTLQebZEHNA1wr
+ UvHjk3E6tsNcV62e1r3KLGqtKm6WplNpSsVqVFJsOM8VfSKFWjkGtcyZptSYzvC7XByx3zQoqCnTMvlG
+ CX1prnornPUmQJcUXsbSVhGK5bIOkcmQyveeTHiv4VZ5Nk33Nc6iuSO8CIfmECYa/bE/8ON1iRipJNh5
+ F0V6Bd86lfQ1JlFj1TDVq4COKCegLVIwHmGiKRB7/V6G7+5koHozymgfYRy5E1CgTWKgXcZ1i5qWp0KS
+ rjgBcAJawph6FszYk/2M1O1isGYLX8p9ab6wgqP+3rMvYciS01GfzA1LFvQkQ6sQ9/khxhoCGHnox1Dt
+ NvorxXw0b8Km8UQh2cip6GOzgNyMeKqKM7HdjqFZJ5pRk2YJ9aql3EnxoCJxNaZ4Ly6e3UDY3O6OEXRp
+ 59ApTpIhiyDh9GHORAZyPHQPB/ZtZ/cOMVvFPvh6e7F+3SrWrHRnraf7Xz/xf/rJ/kvxb84I3U1y+9/W
+ AAAAAElFTkSuQmCC
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAixJREFUOE+tk91L
+ k3EUx/cvdN9N0EW3NTWGa7EaPOUcyqphWBG9PZEv5dJlmqhYmUYtXyBb4dJJy+kknFT4BqZIjaFMJUsz
+ V7TEoabYRDD49ju/6Pm1Mi+iH5zLz+c855zvo1L9j/fsaRRUvvZltHmX8Ni9gMaGCO47ZlBb8wn22yHc
+ KJ9CackECgteIy93FBfOB6H0JrC3B6ipXsVGb2V1Dca0XhxOe8JLEXhbF7mgsuLLX3mCIwsr2G1+DrVa
+ huWQRwjcj+a5oLTk87qCn/D78CLiTD4UXJ7GAXOTEDjrZ7ngku3dH4Jf4ZHJCLZJXlhzxpGa4hSCurth
+ LsjOGo0R/A4PBsPYrHdDlgMwmRxCUF31kQvkMwFFsB7c4/+ATYkNOHL0BZKSaoXgZuU0urvATgkcP/kK
+ lmMDfNu0MJqZPps6/4D7cNDSCUmyC8HVskl0+MAyADS5vrG7f0X59Tm+VFoYzZyZEVTg5NR2GAwVQnCl
+ cByeZuChc40FJwpjek5MmU/YkH6uiHdOTmHwfg/0+jIhsOWNMRiouhPlnUnAQoI4rYSht7MYm5qDnHsN
+ e41tHNbucUGnKxICiqXjHpTPJgHBZ/Nv4U1oHqGZJVwstiNe72JwI+J3PYA2MV8IMjOG2dzLfOatBg+2
+ 7JDQ0tEPX9cguvv8GHg5hH0mC9S6eiQweLumDhqNVQgo06dP9fN4UsIoJHRnOhVtmxZGM1NXKoJ3JmTH
+ Cv71r/4OTrQ4xWMwWlcAAAAASUVORK5CYII=
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAYdJREFUOE+t001L
+ QlEQBuB+TdCmRVEJRRIWtRAUlKsQhFmkpZQtIiWyAlMwP5KkXS0shLqGFkgoFqWQmaRR2qIvU7FMwWhd
+ 8JZXkFx0uVGzOcNh5jkDw6mr+++4SN7B6fbju/uQecYm6a25+/Hdl2IJptWNmmJyL4DwWZwZUJbtayT8
+ RxGqIV8oQaaaRfrxkTmw4z2G+WuKbC6PYDgOkUSJp6ccc+AgdI4luwPbHh/UCxb0S0aZN5fHTmefMTVv
+ wfDEHIiBMegMpt8BZUShNoGQTIKQGxA8TTIHMoUPGF1vEOvTWHTcgqeJQahNwLqVQiRRpIdS+XcM2l4h
+ 1t2DI3WAP7oGoSYE3kwSPQofljcqm/kxjK4SCH0OXSMetItsUC26wZuOVptYhI0eEOuz1YI2gZnKBdpr
+ 6iR9V2jkKOkBQpeiCryhFFr4eioft16iU7qNho4h1Dc00QOqlRuwpSSa+UawuZXdByIZsPoUaOmWwrUf
+ owcOozlwZeto7ZXDuXvCfHV/+dGfqqrf44qgu28AAAAASUVORK5CYII=
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAeJJREFUOE+lk9FP
+ klEYxv1TSsecde0f0FpZrTbbal7URVvZuuJCr7pq2WzLNWy0iSHNwtIB9qG0ltLSYRJpBomUgZPMGSyU
+ 8SmJIOiv7zssCdrAzXd77s77e5/nnPdUVR20HBPfUCWNB4QsI176HB8IL/9iX2y1ubTMwx6utz0nuLhc
+ GWIfCxT153Z26ep/g9Md4FJLZ2WIZdQnAM4QSJ/BH5Z5aH6NNCljm0hgdSV4MppAPxQXCq5kil31OTx7
+ DjLbOeSNNJFYUgBKq31glfpmN76F9QLEZHOJc73ubXQjMreln7Q+DdP/du0/QIsxhmNK5mjTMJ/m43mI
+ Qcmr5t5MZVlNpFiKrPM1vIbpVVQAOqSckF+ZekUX5UjTS+ouDFLb+CwPUPNupbN7k7WmEDcMX3hgXSpy
+ IP/OsrCyhXtuA6M0g+bc4wJATqaZ/x7DF4zg8f9g/OMibb355701kERriHL5fojzd2aFjNI0mjPdBUD9
+ 6auUqlU/KwBZJV4skWUuvMmYV8b+Ls6jQQ81DfryO3KtfUoA/p3810G37T3VJ3TlARdvukhldjANeemx
+ z2B8MS0mq80GyySHj98rD2jQOpXbtgrVNprRnO2h5lQX1Sc7leYODh27W3nN9/WZDnroDx0A5wwhdtmt
+ AAAAAElFTkSuQmCC
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAlBJREFUOE+1k1lI
+ lGEUhn/owm6KFuqqq4LoJooIqouMwixMM4zEjKyJGJUSlcnSITU1RSe3SdPGyGVQc6tEUSkSIXFo13CM
+ FonUyGmy5p9xz+Lp/z8ZbGjzpgMv5+a8z1n4Pkn6H9HZnEH7zVQayxKYF7+hMg+3ynKO4LBVMWa7xmBf
+ Nme1vuSl67hi0GNMj/sVqBon5XqmnXVMOqoxF+sYH6kgJyWKF13xnD/tT7xmM7bOY4y0riY6bL8nRAWo
+ 5mlnDUUZR+m2ZCO/L2C4T89bywmaSgIJD/WmKnEVT/MkIg/v8wTUVeTMAuQbGBLDSNaFoI8K5lxkEDpt
+ IDEafyJCfciPXiMAIX7enoDqUgNTci1TdhPjQ5nYn0dhrVgu1Fu+jO7iRTwyegmzKp9tGz0BZlMGE/Yy
+ JgbSGH95irFnB5GbF5Nb3kqmqZELl2uJN5iJSS0hPMFIWGyWJ6C0MJXRQSNjfVpGH/vjur+Jj7dXCLM7
+ pme+4XBOMjDsIDgihYDj+jlISW4S8qs0XA99cXWsx9m2ksFySXRWo/RWp5Cppp3efpsw3+2ysidIMwsp
+ zErgc88ZnO3rkFuWYq/3ov+6JMb+OvOdLy6l8wcHvW9sWHre4Rcag69i3rX3AN7bdyDlX4zD/iBCMS/h
+ U8NChioXYC2SiFZ2Vsd2T3BVmaDA3EZTh1VkVVs3rEW6lBwrHoj7yu6sVQ72c+d7ltfCXH+nm5rWJ3MA
+ dY3cpJPKCwtEE7SbgJ1bBFm9trqzu9vvspjgT3FIubZa8C/N67P9regHTvjvLQ3rR38AAAAASUVORK5C
+ YII=
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAhhJREFUOE+1U09r
+ E0EU70fIR9iPUBQ8eMrR46IN5JhCDz2oBA8SBHEpCMFgG5GiwdJdq2Ijqe6ldo3Wrmhri0gXazW2YbMt
+ UdNmm45ulf7R/HwzU1hLIzn54LFvhvn9eW9nOjr+R0wvBLhTXEf6bgV9w0sYLJQx/uoz2mq9c7eRn2pA
+ L67Bq+/i29YeWLBL9Q6u5ktI6w6Kr1dbE3HwA3sT/o8mbAfQRgE1LZPXtsPgbjZxaXAG4y/Kh0m48sbP
+ JgwbiKYAwwLYNkR4DEje5HsMFSI5l3l2kGD6/RYezzeEMgfzwzzMWSCRlV9OFk0xqhl06wNy+Tchyb2n
+ dXxhv4TVaFLazppAJ9VKL0MySxYoVI0hkXaw5AbovjAWEmTur4qBqZoEdfbKVCgTBObqdolBUW0ocRs1
+ P8Cx2PWQ4PJtl6a9J+xLIB1OMHIilU2b1gSMqCZ9TdTq33FEHQgJcg8rWPF3qHcJVOKeyOyoJIioDqUk
+ UFM2SuUqus4YIcHEzFdYji8GxIGROAc41JJHc6E1B58wRRqWhzFrEVduTR78E5mRBSz7v0l1H0AgXgsH
+ +2DNcPBp3cep0/rhezA5V0Vfbg5ug+4CqaiaI/rmyWu+t1zdQIysDxdmW9/GiZcVnO+fgvHkI+YXV7BG
+ 067VA9Ezt91Fyvq/wH8/lKHCW/RcfITj8Rs4evIaYmdHkBl63v4xtX1tLQ78AZ3a8qxOv4hDAAAAAElF
+ TkSuQmCC
+
+
+
+ 226, 17
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAQ9JREFUOE+t09lq
+ wkAUBmBfyr5DfY32jaReSOmFCyKCgkKLFrVUBZeKiEbshqRuaNw1xiXmLxMJBJ0Zc+GBw9zMfDPnHMZm
+ u1ZE35s4zXCqjmC8Al+sgHLjD9y7yGFWPIbecOO45yORtMAEHnxxJHL1IyKI9JeEXqtMwOl50Q8bSS0l
+ 8PzBBPbqAQQxICrgjeapgKZpkJUdBmNZB+y3d/QSnsIZKrDdqZjMFYj9OR9wB1NngHrQsJC36EkrfIkT
+ PuDyJ84AZbOHNF2j1Z2h9i3xAVKfOUjjZssN2oMFmq0xSkLfOmBu3E97iurnENlKxzpgbpzwO0Kh1kOy
+ KFoDjHmzVuYYjRmTDZfyWh9Yd/4B2Mz2w1z7EGUAAAAASUVORK5CYII=
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAlpJREFUOE+tk21I
+ k1EYhif0oyA0sqIQCix/+GcQFFH9CCmiUBTLLEjShJofVBgL2fxoU9Pp5ubUlS5rU9f8rCyjsA+pUCRC
+ TR1ppmVFUSlmhq78unrnQF1KGHTg/nEOz30993PO+7qJFrmUeiv2n+Mij+XLRLLYULdF2pxlEVIDcw0p
+ AsyxD5fmI/rQ94pqi26eOlsfuZj+7BgSm01QdA4ih7m73Yx9qGpavwatjPebqCzOprPt8YKQgzFagqL0
+ BEjyEFWVaBkdLHMxT34uYNwWR9nVTEoL0zHlp2DMSeaSRk6eKt4VWm5WM/rVPNN5SjDTLQebZEHNA1wr
+ UvHjk3E6tsNcV62e1r3KLGqtKm6WplNpSsVqVFJsOM8VfSKFWjkGtcyZptSYzvC7XByx3zQoqCnTMvlG
+ CX1prnornPUmQJcUXsbSVhGK5bIOkcmQyveeTHiv4VZ5Nk33Nc6iuSO8CIfmECYa/bE/8ON1iRipJNh5
+ F0V6Bd86lfQ1JlFj1TDVq4COKCegLVIwHmGiKRB7/V6G7+5koHozymgfYRy5E1CgTWKgXcZ1i5qWp0KS
+ rjgBcAJawph6FszYk/2M1O1isGYLX8p9ab6wgqP+3rMvYciS01GfzA1LFvQkQ6sQ9/khxhoCGHnox1Dt
+ NvorxXw0b8Km8UQh2cip6GOzgNyMeKqKM7HdjqFZJ5pRk2YJ9aql3EnxoCJxNaZ4Ly6e3UDY3O6OEXRp
+ 59ApTpIhiyDh9GHORAZyPHQPB/ZtZ/cOMVvFPvh6e7F+3SrWrHRnraf7Xz/xf/rJ/kvxb84I3U1y+9/W
+ AAAAAElFTkSuQmCC
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAixJREFUOE+tk91L
+ k3EUx/cvdN9N0EW3NTWGa7EaPOUcyqphWBG9PZEv5dJlmqhYmUYtXyBb4dJJy+kknFT4BqZIjaFMJUsz
+ V7TEoabYRDD49ju/6Pm1Mi+iH5zLz+c855zvo1L9j/fsaRRUvvZltHmX8Ni9gMaGCO47ZlBb8wn22yHc
+ KJ9CackECgteIy93FBfOB6H0JrC3B6ipXsVGb2V1Dca0XhxOe8JLEXhbF7mgsuLLX3mCIwsr2G1+DrVa
+ huWQRwjcj+a5oLTk87qCn/D78CLiTD4UXJ7GAXOTEDjrZ7ngku3dH4Jf4ZHJCLZJXlhzxpGa4hSCurth
+ LsjOGo0R/A4PBsPYrHdDlgMwmRxCUF31kQvkMwFFsB7c4/+ATYkNOHL0BZKSaoXgZuU0urvATgkcP/kK
+ lmMDfNu0MJqZPps6/4D7cNDSCUmyC8HVskl0+MAyADS5vrG7f0X59Tm+VFoYzZyZEVTg5NR2GAwVQnCl
+ cByeZuChc40FJwpjek5MmU/YkH6uiHdOTmHwfg/0+jIhsOWNMRiouhPlnUnAQoI4rYSht7MYm5qDnHsN
+ e41tHNbucUGnKxICiqXjHpTPJgHBZ/Nv4U1oHqGZJVwstiNe72JwI+J3PYA2MV8IMjOG2dzLfOatBg+2
+ 7JDQ0tEPX9cguvv8GHg5hH0mC9S6eiQweLumDhqNVQgo06dP9fN4UsIoJHRnOhVtmxZGM1NXKoJ3JmTH
+ Cv71r/4OTrQ4xWMwWlcAAAAASUVORK5CYII=
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAi1JREFUOE+1k/9P
+ UlEYxv2nWK2tVlttGmpltrCcEQ1XUjSMaUHJNLIpNcnCragplBvUoC/okJhZLG92ySUpU8RNICdIhAio
+ EF+e7r1UZMDW1jrb+8t7z/N83vucc8rK/sdyeYIwvpopWYbRaZTk0uIx0o0/V/JbGt7lVTwxT6CKKylt
+ oLd8xGYihS/hKGz2WaaeWUnoTATsMz7UCztx9Ex7cYN3jkUQU4tb4DR5LZaAcyEAg4VE5YlLMFmJQoNQ
+ JA61gUA6k4XPH9pCN9s+gZz2oq5Jjlq+DDfUz3Fba86bOGY9jHiUdDF0mvqT7A/F4fKEcE9nZf5d1jOI
+ B4ZxVJ2U5gyc8z70akegMX3AXb0ND1+8R6/GgvZbeog61OA2K3CA2lxR34JjZ69B2T8EsVyN/Q0XcwY3
+ B14iGk8UpE43UukMNqhA6QyC4Q0srcQg7dagsbWHmuDHScj7jDC9nsJTqx0a4xjuaIfRqXoMSXc/hG0q
+ 8C4owGnqwEGeFOXHxThH9eoEV7G7VpiboE2pK0qnm9H1JLz+NUzOBfHWEcAQsQSuqAuVDa1gVZzKGUgU
+ jwoMqAzxNZbC3Od1jDvDYPdth+7NCpP8Yf4V7KoR5A1arg8gmQIoGMLxLJYjWSwEMphwb2J4MoZB2yqU
+ LBZUIxHGYB9HlBfTE4jl9+GmBPTHv6lfo//+GGoaZajmXQabumXl1HHt5TRjz5Hz2HlIgB3Vp7GNzWeo
+ RcX/+pq/AwHYL0leVl8fAAAAAElFTkSuQmCC
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAY5JREFUOE+d081L
+ AkEUAPD1T+hYhzoERV77OHUo8JBBt+4RRkSQ4U0SunaJOkSRKQWZWCiF5kdroa0WRAoRFXXoEEkWCUFY
+ Wbvrvnqz7NK6OxANPIZh5v1m3uyOKZK5AaamiaLICILACDzPtDXXM+3mRlPtGnWMAK15g4fQabVBYDej
+ 20QFdtJXVGBxg4Xk8aWMRDhjJLh/TgUW1hPQ1T+ihmEZgXieCghiFRBRIEPAFzkxBO4fSsByOfBsRkkE
+ 4xkoFEv6Mla3szoAF2Jy+E2A0KMc/nyRINe3BS2yspXSAf4YR5Kfq/LUE1QJopxEU8qSP6kD5nwxFUAE
+ A0E8hdM1rz0BXtDvhheHwMEnwKkkJ2OPAJMuw+TUDB2QJAneKzxgCRNnHwTBUJJd3ijYx8fowBcvwstr
+ BXIXdxBOZAmCu2JgssMxBGvOOmNA+d5KP+sJw17qiJRjn3bDwOAocF4LQMWtRTABf9W/hLWjFcpsA0Fc
+ tm76+6C+vJ+J4b4WgmAp/0bMTXVg6ekFNrQM3y3xMcC3lb+tAAAAAElFTkSuQmCC
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAYdJREFUOE+t001L
+ QlEQBuB+TdCmRVEJRRIWtRAUlKsQhFmkpZQtIiWyAlMwP5KkXS0shLqGFkgoFqWQmaRR2qIvU7FMwWhd
+ 8JZXkFx0uVGzOcNh5jkDw6mr+++4SN7B6fbju/uQecYm6a25+/Hdl2IJptWNmmJyL4DwWZwZUJbtayT8
+ RxGqIV8oQaaaRfrxkTmw4z2G+WuKbC6PYDgOkUSJp6ccc+AgdI4luwPbHh/UCxb0S0aZN5fHTmefMTVv
+ wfDEHIiBMegMpt8BZUShNoGQTIKQGxA8TTIHMoUPGF1vEOvTWHTcgqeJQahNwLqVQiRRpIdS+XcM2l4h
+ 1t2DI3WAP7oGoSYE3kwSPQofljcqm/kxjK4SCH0OXSMetItsUC26wZuOVptYhI0eEOuz1YI2gZnKBdpr
+ 6iR9V2jkKOkBQpeiCryhFFr4eioft16iU7qNho4h1Dc00QOqlRuwpSSa+UawuZXdByIZsPoUaOmWwrUf
+ owcOozlwZeto7ZXDuXvCfHV/+dGfqqrf44qgu28AAAAASUVORK5CYII=
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAeJJREFUOE+lk9FP
+ klEYxv1TSsecde0f0FpZrTbbal7URVvZuuJCr7pq2WzLNWy0iSHNwtIB9qG0ltLSYRJpBomUgZPMGSyU
+ 8SmJIOiv7zssCdrAzXd77s77e5/nnPdUVR20HBPfUCWNB4QsI176HB8IL/9iX2y1ubTMwx6utz0nuLhc
+ GWIfCxT153Z26ep/g9Md4FJLZ2WIZdQnAM4QSJ/BH5Z5aH6NNCljm0hgdSV4MppAPxQXCq5kil31OTx7
+ DjLbOeSNNJFYUgBKq31glfpmN76F9QLEZHOJc73ubXQjMreln7Q+DdP/du0/QIsxhmNK5mjTMJ/m43mI
+ Qcmr5t5MZVlNpFiKrPM1vIbpVVQAOqSckF+ZekUX5UjTS+ouDFLb+CwPUPNupbN7k7WmEDcMX3hgXSpy
+ IP/OsrCyhXtuA6M0g+bc4wJATqaZ/x7DF4zg8f9g/OMibb355701kERriHL5fojzd2aFjNI0mjPdBUD9
+ 6auUqlU/KwBZJV4skWUuvMmYV8b+Ls6jQQ81DfryO3KtfUoA/p3810G37T3VJ3TlARdvukhldjANeemx
+ z2B8MS0mq80GyySHj98rD2jQOpXbtgrVNprRnO2h5lQX1Sc7leYODh27W3nN9/WZDnroDx0A5wwhdtmt
+ AAAAAElFTkSuQmCC
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAlBJREFUOE+1k1lI
+ lGEUhn/owm6KFuqqq4LoJooIqouMwixMM4zEjKyJGJUSlcnSITU1RSe3SdPGyGVQc6tEUSkSIXFo13CM
+ FonUyGmy5p9xz+Lp/z8ZbGjzpgMv5+a8z1n4Pkn6H9HZnEH7zVQayxKYF7+hMg+3ynKO4LBVMWa7xmBf
+ Nme1vuSl67hi0GNMj/sVqBon5XqmnXVMOqoxF+sYH6kgJyWKF13xnD/tT7xmM7bOY4y0riY6bL8nRAWo
+ 5mlnDUUZR+m2ZCO/L2C4T89bywmaSgIJD/WmKnEVT/MkIg/v8wTUVeTMAuQbGBLDSNaFoI8K5lxkEDpt
+ IDEafyJCfciPXiMAIX7enoDqUgNTci1TdhPjQ5nYn0dhrVgu1Fu+jO7iRTwyegmzKp9tGz0BZlMGE/Yy
+ JgbSGH95irFnB5GbF5Nb3kqmqZELl2uJN5iJSS0hPMFIWGyWJ6C0MJXRQSNjfVpGH/vjur+Jj7dXCLM7
+ pme+4XBOMjDsIDgihYDj+jlISW4S8qs0XA99cXWsx9m2ksFySXRWo/RWp5Cppp3efpsw3+2ysidIMwsp
+ zErgc88ZnO3rkFuWYq/3ov+6JMb+OvOdLy6l8wcHvW9sWHre4Rcag69i3rX3AN7bdyDlX4zD/iBCMS/h
+ U8NChioXYC2SiFZ2Vsd2T3BVmaDA3EZTh1VkVVs3rEW6lBwrHoj7yu6sVQ72c+d7ltfCXH+nm5rWJ3MA
+ dY3cpJPKCwtEE7SbgJ1bBFm9trqzu9vvspjgT3FIubZa8C/N67P9regHTvjvLQ3rR38AAAAASUVORK5C
+ YII=
+
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/ModuleFilter.cs b/reactos/tools/sysgen/RosBuilder/ModuleFilter.cs
new file mode 100644
index 00000000000..0853aeec8a1
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/ModuleFilter.cs
@@ -0,0 +1,295 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Framework;
+using SysGen.RBuild.Framework;
+
+namespace TriStateTreeViewDemo
+{
+ public class ModuleFilterController
+ {
+ private List m_ModuleFilters = new List();
+ private ISysGenDesigner m_SysGenDesigner = null;
+
+ public ModuleFilterController(ISysGenDesigner engine)
+ {
+ //The engine...
+ m_SysGenDesigner = engine;
+
+ RegisterDinamicFilters();
+ RegisterModuleGroups();
+ InitializeFilters();
+ }
+
+ private void RegisterDinamicFilters()
+ {
+ m_ModuleFilters.Add(new AllModuleFilter());
+ m_ModuleFilters.Add(new AllWin32CUIModuleFilter());
+ m_ModuleFilters.Add(new AllWin32GUIModuleFilter());
+ m_ModuleFilters.Add(new AllScreenSaversModuleFilter());
+ m_ModuleFilters.Add(new AllKeyboardLayoutsModuleFilter());
+ m_ModuleFilters.Add(new AllDriversModuleFilter());
+ m_ModuleFilters.Add(new AllDllsModuleFilter());
+ }
+
+ private void RegisterModuleGroups()
+ {
+ foreach (RBuildModule module in m_SysGenDesigner.ProjectController.AvailableModules)
+ {
+ if (module.Type == ModuleType.ModuleGroup)
+ {
+ m_ModuleFilters.Add(new PackageModuleFilter(module));
+ }
+ }
+ }
+
+ private void InitializeFilters()
+ {
+ foreach (ModuleFilter filter in m_ModuleFilters)
+ {
+ filter.Designer = m_SysGenDesigner;
+ filter.Initialize();
+ }
+ }
+
+ public List ModuleFilters
+ {
+ get { return m_ModuleFilters; }
+ }
+
+ public void Apply(ModuleFilter filter)
+ {
+ m_SysGenDesigner.ProjectController.Add(filter.Modules);
+ }
+
+ public void Remove(ModuleFilter filter)
+ {
+ //m_SysGenDesigner.PlatformController.Remove(filter.Modules);
+ }
+ }
+
+ public abstract class ModuleFilter
+ {
+ protected ISysGenDesigner m_Project = null;
+ protected RBuildModuleCollection m_Modules = new RBuildModuleCollection();
+
+ public ModuleFilter()
+ {
+ }
+
+ public virtual void Initialize()
+ {
+ ExecuteRule();
+ }
+
+ public abstract void ExecuteRule();
+
+ public RBuildModuleCollection Modules
+ {
+ get { return m_Modules; }
+ }
+
+ public ISysGenDesigner Designer
+ {
+ get { return m_Project; }
+ set { m_Project = value; }
+ }
+
+ public abstract string Name { get; }
+
+ public override string ToString()
+ {
+ return string.Format("{0} - ({1} modules)",
+ Name,
+ Modules.Count);
+ }
+ }
+
+ public class PackageModuleFilter : ModuleFilter
+ {
+ RBuildModule m_Module = null;
+
+ public PackageModuleFilter(RBuildModule module)
+ {
+ //Save the underlaying module...
+ m_Module = module;
+ }
+
+ public override string Name
+ {
+ get { return (m_Module.Description != null) ? m_Module.Description : m_Module.Name; }
+ }
+
+ public override void ExecuteRule()
+ {
+ Modules.Add(m_Module.Needs);
+ }
+ }
+
+ public class AllModuleFilter : ModuleFilter
+ {
+ public AllModuleFilter()
+ {
+ }
+
+ public override string Name
+ {
+ get { return "All"; }
+ }
+
+ public override void ExecuteRule()
+ {
+ foreach (RBuildModule module in Designer.ProjectController.AvailableModules)
+ {
+ if (Modules.Contains(module) == false)
+ Modules.Add(module);
+ }
+ }
+ }
+
+ public class AllWin32CUIModuleFilter : ModuleFilter
+ {
+ public AllWin32CUIModuleFilter()
+ {
+ }
+
+ public override string Name
+ {
+ get { return "All Console Applications"; }
+ }
+
+ public override void ExecuteRule()
+ {
+ foreach (RBuildModule module in Designer.ProjectController.AvailableModules)
+ {
+ if (module.Type == ModuleType.Win32CUI)
+ {
+ if (Modules.Contains(module) == false)
+ Modules.Add(module);
+ }
+ }
+ }
+ }
+
+ public class AllWin32GUIModuleFilter : ModuleFilter
+ {
+ public AllWin32GUIModuleFilter()
+ {
+ }
+
+ public override string Name
+ {
+ get { return "All Graphical Applications"; }
+ }
+
+ public override void ExecuteRule()
+ {
+ foreach (RBuildModule module in Designer.ProjectController.AvailableModules)
+ {
+ if (module.Type == ModuleType.Win32GUI)
+ {
+ if (Modules.Contains(module) == false)
+ Modules.Add(module);
+ }
+ }
+ }
+ }
+
+ public class AllScreenSaversModuleFilter : ModuleFilter
+ {
+ public AllScreenSaversModuleFilter()
+ {
+ }
+
+ public override string Name
+ {
+ get { return "All ScreenSavers"; }
+ }
+
+ public override void ExecuteRule()
+ {
+ foreach (RBuildModule module in Designer.ProjectController.AvailableModules)
+ {
+ if (module.Type == ModuleType.Win32SCR)
+ {
+ if (Modules.Contains(module) == false)
+ Modules.Add(module);
+ }
+ }
+ }
+ }
+
+ public class AllKeyboardLayoutsModuleFilter : ModuleFilter
+ {
+ public AllKeyboardLayoutsModuleFilter()
+ {
+ }
+
+ public override string Name
+ {
+ get { return "All Keyboard Layouts"; }
+ }
+
+ public override void ExecuteRule()
+ {
+ foreach (RBuildModule module in Designer.ProjectController.AvailableModules)
+ {
+ if (module.Type == ModuleType.KeyboardLayout)
+ {
+ if (Modules.Contains(module) == false)
+ Modules.Add(module);
+ }
+ }
+ }
+ }
+
+ public class AllDriversModuleFilter : ModuleFilter
+ {
+ public AllDriversModuleFilter()
+ {
+ }
+
+ public override string Name
+ {
+ get { return "All Drivers"; }
+ }
+
+ public override void ExecuteRule()
+ {
+ foreach (RBuildModule module in Designer.ProjectController.AvailableModules)
+ {
+ if (module.Type == ModuleType.KernelModeDriver)
+ {
+ if (Modules.Contains(module) == false)
+ Modules.Add(module);
+ }
+ }
+ }
+ }
+
+ public class AllDllsModuleFilter : ModuleFilter
+ {
+ public AllDllsModuleFilter()
+ {
+ }
+
+ public override string Name
+ {
+ get { return "All Dlls"; }
+ }
+
+ public override void ExecuteRule()
+ {
+ foreach (RBuildModule module in Designer.ProjectController.AvailableModules)
+ {
+ if (module.Type == ModuleType.Win32DLL)
+ {
+ if (Modules.Contains(module) == false)
+ Modules.Add(module);
+ }
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosBuilder/NewItemForm.Designer.cs b/reactos/tools/sysgen/RosBuilder/NewItemForm.Designer.cs
new file mode 100644
index 00000000000..81bcb58e30d
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/NewItemForm.Designer.cs
@@ -0,0 +1,135 @@
+namespace TriStateTreeViewDemo
+{
+ partial class NewItemForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.lbItems = new System.Windows.Forms.Label();
+ this.lvAddItem = new System.Windows.Forms.ListView();
+ this.btnAdd = new System.Windows.Forms.Button();
+ this.btnCancel = new System.Windows.Forms.Button();
+ this.lbDescription = new System.Windows.Forms.Label();
+ this.lbName = new System.Windows.Forms.Label();
+ this.textBox1 = new System.Windows.Forms.TextBox();
+ this.SuspendLayout();
+ //
+ // lbItems
+ //
+ this.lbItems.AutoSize = true;
+ this.lbItems.Location = new System.Drawing.Point(12, 24);
+ this.lbItems.Name = "lbItems";
+ this.lbItems.Size = new System.Drawing.Size(78, 13);
+ this.lbItems.TabIndex = 0;
+ this.lbItems.Text = "Available Items";
+ //
+ // lvAddItem
+ //
+ this.lvAddItem.Location = new System.Drawing.Point(12, 40);
+ this.lvAddItem.Name = "lvAddItem";
+ this.lvAddItem.Size = new System.Drawing.Size(583, 236);
+ this.lvAddItem.TabIndex = 1;
+ this.lvAddItem.UseCompatibleStateImageBehavior = false;
+ this.lvAddItem.View = System.Windows.Forms.View.List;
+ this.lvAddItem.DoubleClick += new System.EventHandler(this.lvAddItem_DoubleClick);
+ //
+ // btnAdd
+ //
+ this.btnAdd.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.btnAdd.Location = new System.Drawing.Point(439, 348);
+ this.btnAdd.Name = "btnAdd";
+ this.btnAdd.Size = new System.Drawing.Size(75, 23);
+ this.btnAdd.TabIndex = 2;
+ this.btnAdd.Text = "Add";
+ this.btnAdd.UseVisualStyleBackColor = true;
+ //
+ // btnCancel
+ //
+ this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.btnCancel.Location = new System.Drawing.Point(520, 348);
+ this.btnCancel.Name = "btnCancel";
+ this.btnCancel.Size = new System.Drawing.Size(75, 23);
+ this.btnCancel.TabIndex = 3;
+ this.btnCancel.Text = "Cancel";
+ this.btnCancel.UseVisualStyleBackColor = true;
+ //
+ // lbDescription
+ //
+ this.lbDescription.AutoSize = true;
+ this.lbDescription.Location = new System.Drawing.Point(12, 279);
+ this.lbDescription.Name = "lbDescription";
+ this.lbDescription.Size = new System.Drawing.Size(79, 13);
+ this.lbDescription.TabIndex = 4;
+ this.lbDescription.Text = "Select any item";
+ //
+ // lbName
+ //
+ this.lbName.AutoSize = true;
+ this.lbName.Location = new System.Drawing.Point(9, 308);
+ this.lbName.Name = "lbName";
+ this.lbName.Size = new System.Drawing.Size(35, 13);
+ this.lbName.TabIndex = 5;
+ this.lbName.Text = "&Name";
+ //
+ // textBox1
+ //
+ this.textBox1.Location = new System.Drawing.Point(53, 305);
+ this.textBox1.Name = "textBox1";
+ this.textBox1.Size = new System.Drawing.Size(542, 20);
+ this.textBox1.TabIndex = 6;
+ //
+ // NewItemForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(607, 383);
+ this.Controls.Add(this.textBox1);
+ this.Controls.Add(this.lbName);
+ this.Controls.Add(this.lbDescription);
+ this.Controls.Add(this.btnCancel);
+ this.Controls.Add(this.btnAdd);
+ this.Controls.Add(this.lvAddItem);
+ this.Controls.Add(this.lbItems);
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "NewItemForm";
+ this.Text = "Add Item";
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label lbItems;
+ private System.Windows.Forms.ListView lvAddItem;
+ private System.Windows.Forms.Button btnAdd;
+ private System.Windows.Forms.Button btnCancel;
+ private System.Windows.Forms.Label lbDescription;
+ private System.Windows.Forms.Label lbName;
+ private System.Windows.Forms.TextBox textBox1;
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/NewItemForm.cs b/reactos/tools/sysgen/RosBuilder/NewItemForm.cs
new file mode 100644
index 00000000000..4101b0c988c
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/NewItemForm.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+
+namespace TriStateTreeViewDemo
+{
+ public partial class NewItemForm : Form
+ {
+ public NewItemForm()
+ {
+ InitializeComponent();
+ }
+
+ public ListView ListView
+ {
+ get { return lvAddItem; }
+ }
+
+ private void lvAddItem_DoubleClick(object sender, EventArgs e)
+ {
+ DialogResult = DialogResult.OK;
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/NewItemForm.resx b/reactos/tools/sysgen/RosBuilder/NewItemForm.resx
new file mode 100644
index 00000000000..19dc0dd8b39
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/NewItemForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/PlatformCatalogReader.cs b/reactos/tools/sysgen/RosBuilder/PlatformCatalogReader.cs
new file mode 100644
index 00000000000..7a847340622
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/PlatformCatalogReader.cs
@@ -0,0 +1,206 @@
+using System;
+using System.Collections;
+using System.Diagnostics;
+using System.Text;
+using System.Xml;
+using System.Collections.Generic;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.Framework.Catalog
+{
+ public class PlatformCatalogReader
+ {
+ XmlDocument doc = new XmlDocument();
+
+ RBuildProject m_Project = new RBuildProject();
+
+ public PlatformCatalogReader(string filename)
+ {
+ doc.Load(filename);
+ }
+
+ public RBuildProject Project
+ {
+ get { return m_Project; }
+ }
+
+ public void Read()
+ {
+
+ foreach (XmlNode node in doc.SelectSingleNode("/catalog/modules").ChildNodes)
+ {
+ RBuildModule module = new RBuildModule();
+
+ module.Type = (ModuleType)Enum.Parse(typeof(ModuleType), node.Attributes["type"].Value.ToString());
+ module.Name = node.Attributes["name"].Value.ToString();
+ module.Folder.Base = node.Attributes["base"].Value.ToString();
+ module.CatalogPath = node.Attributes["path"].Value.ToString();
+ module.Description = node.Attributes["desc"].Value.ToString();
+
+ m_Project.Modules.Add(module);
+ }
+
+ foreach (XmlNode node in doc.SelectSingleNode("/catalog/modules").ChildNodes)
+ {
+ RBuildModule module = m_Project.Modules.GetByName(node.Attributes["name"].Value.ToString());
+
+ foreach (XmlNode snode in node.SelectSingleNode("libraries").ChildNodes)
+ {
+ module.Libraries.Add(m_Project.Modules.GetByName(snode.InnerText));
+ }
+
+ foreach (XmlNode snode in node.SelectSingleNode("dependencies").ChildNodes)
+ {
+ module.Dependencies.Add(m_Project.Modules.GetByName(snode.InnerText));
+ }
+
+ foreach (XmlNode snode in node.SelectSingleNode("requeriments").ChildNodes)
+ {
+ module.Requeriments.Add(m_Project.Modules.GetByName(snode.InnerText));
+ }
+ }
+
+ foreach (XmlNode node in doc.SelectSingleNode("/catalog/languages").ChildNodes)
+ {
+ RBuildLanguage language = new RBuildLanguage();
+
+ language.Name = node.Attributes["name"].Value.ToString();
+
+ m_Project.Languages.Add(language);
+ }
+
+ foreach (XmlNode node in doc.SelectSingleNode("/catalog/debugchannels").ChildNodes)
+ {
+ RBuildDebugChannel language = new RBuildDebugChannel();
+
+ language.Name = node.Attributes["name"].Value.ToString();
+
+ m_Project.DebugChannels.Add(language);
+ }
+
+ /*
+ RBuildModuleInfoCollection modules = new RBuildModuleInfoCollection();
+
+
+ WhitespaceHandling = WhitespaceHandling.None;
+
+ ReadStartElement("modules");
+ while (Name == "module")
+ {
+ RBuildModuleInfo module = new RBuildModuleInfo();
+
+ MoveToFirstAttribute();
+ do
+ {
+ switch (Name)
+ {
+ case "name":
+ module.Name = Value;
+ break;
+ case "type":
+ module.Type = (ModuleType)Enum.Parse(typeof(ModuleType), Value);
+ break;
+ case "base":
+ module.Base = Value;
+ break;
+ case "desc":
+ module.CatalogPath = Value;
+ break;
+ case "path":
+ module.CatalogPath = Value;
+ break;
+ }
+
+ }
+ while (MoveToNextAttribute());
+
+ MoveToElement();
+
+ //Read();
+ //Read();
+
+ if (Name == "libraries")
+ {
+ if (!IsEmptyElement)
+ {
+ ReadStartElement("libraries");
+ while (Name == "library")
+ {
+ ReadStartElement("library");
+ module.Libraries.Add(ReadContentAsString());
+ ReadEndElement();
+ }
+ ReadEndElement();
+ }
+ else
+ ReadStartElement("libraries");
+ }
+
+ if (Name == "dependencies")
+ {
+ if (!IsEmptyElement)
+ {
+ ReadStartElement("dependencies");
+ while (Name == "dependency")
+ {
+ ReadStartElement("dependency");
+ module.Dependencies.Add(ReadContentAsString());
+ ReadEndElement();
+ }
+ ReadEndElement();
+ }
+ else
+ ReadStartElement("dependencies");
+ }
+
+ if (Name == "requeriments")
+ {
+ if (!IsEmptyElement)
+ {
+ ReadStartElement("requeriments");
+ while (Name == "requires")
+ {
+ ReadStartElement("requires");
+ module.Requirements.Add(ReadContentAsString());
+ ReadEndElement();
+ }
+ ReadEndElement();
+ }
+ else
+ ReadStartElement("requeriments");
+ }
+
+ modules.Add(module);
+
+ Read();
+ }
+
+ ReadEndElement();
+
+ foreach (RBuildModuleInfo moduleInfo in modules)
+ {
+ RBuildModule module = new RBuildModule();
+
+ module.Type = moduleInfo.Type;
+ module.Name = moduleInfo.Name;
+
+ m_Modules.Add(module);
+ }
+
+ foreach (RBuildModuleInfo moduleInfo in modules)
+ {
+ RBuildModule module = m_Modules.GetByName(moduleInfo.Name);
+
+ foreach (string library in moduleInfo.Libraries)
+ module.Libraries.Add(m_Modules.GetByName(library));
+
+ foreach (string library in moduleInfo.Dependencies)
+ module.Dependencies.Add(m_Modules.GetByName(library));
+
+ foreach (string library in moduleInfo.Requirements)
+ module.Requeriments.Add(m_Modules.GetByName(library));
+ }*/
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosBuilder/PlatformController.cs b/reactos/tools/sysgen/RosBuilder/PlatformController.cs
new file mode 100644
index 00000000000..1d710cb372f
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/PlatformController.cs
@@ -0,0 +1,86 @@
+using System;
+using System.Windows.Forms;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Tasks;
+
+namespace TriStateTreeViewDemo
+{
+ public class PlatformController
+ {
+ private ISysGenDesigner m_SysGenDesigner = null;
+
+ public PlatformController(ISysGenDesigner engine)
+ {
+ m_SysGenDesigner = engine;
+ }
+
+ public ProjectTask ProjectTask
+ {
+ get { return m_SysGenDesigner.SysGenEngine.ProjectTask; }
+ }
+
+ public RBuildProject Project
+ {
+ get { return m_SysGenDesigner.SysGenEngine.Project; }
+ }
+
+ public void Remove(RBuildModule module)
+ {
+ }
+
+ public void Add(RBuildModule module)
+ {
+ SysGenDependencyTracker dependencyTracker = new SysGenDependencyTracker(module , Project.Platform.Modules);
+
+ if (AskAddModulesToPlatform(dependencyTracker.Missing))
+ {
+ Project.Platform.Modules.Add(dependencyTracker.Dependencies);
+ }
+ }
+
+ public void Add(RBuildModuleCollection modules)
+ {
+ SysGenDependencyTracker dependencyTracker = new SysGenDependencyTracker(modules, Project.Platform.Modules);
+
+ if (AskAddModulesToPlatform(dependencyTracker.Missing))
+ {
+ Project.Platform.Modules.Add(dependencyTracker.Dependencies);
+ }
+ }
+
+ public bool AskAddModulesToPlatform(RBuildModuleCollection missingDependencies)
+ {
+ if (missingDependencies.Count > 0)
+ {
+ StringBuilder str = new StringBuilder();
+
+ str.AppendFormat("This action requieres adding {0} dependecies no present in your platform :", missingDependencies.Count);
+ str.AppendLine();
+ str.AppendLine();
+
+ foreach (RBuildModule dependency in missingDependencies)
+ {
+ str.AppendFormat("{0} on '{1}' \n",
+ dependency.Name,
+ dependency.Base);
+ }
+
+ str.AppendLine();
+ str.AppendLine("¿Do you want to add this dependencies?");
+
+ if (MessageBox.Show(str.ToString(), "RosBuilder", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
+ {
+ return true;
+ }
+ }
+ else
+ return true;
+
+ return false;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosBuilder/Program.cs b/reactos/tools/sysgen/RosBuilder/Program.cs
new file mode 100644
index 00000000000..6d9cbcb5b1f
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Program.cs
@@ -0,0 +1,109 @@
+using System;
+using System.Reflection;
+using System.Collections.Generic;
+using System.Windows.Forms;
+
+using TriStateTreeViewDemo;
+
+namespace TriStateTreeViewDemo
+{
+ static class Program
+ {
+ ///
+ /// The main entry point for the application.
+ ///
+ [STAThread]
+ static void Main(string[] args)
+ {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+
+ MainForm mainForm = new MainForm();
+
+ if (args.Length == 0)
+ {
+ //Create file associations from .dnml files to the script engine
+ CreateFileAssociation();
+ }
+ else if (args[0].ToLower() == "remove")
+ {
+ //Remove file associations for .dnml files to the script engine
+ RemoveFileAssociation();
+ }
+ else
+ {
+ mainForm.ProjectController.Open(args[0]);
+
+ if (args.Length > 1)
+ {
+ if (args[1].ToLower() == "x86")
+ {
+ MessageBox.Show("86");
+ }
+ else if (args[1].ToLower() == "ppc")
+ {
+ MessageBox.Show("ppc");
+ }
+ else if (args[1].ToLower() == "arm")
+ {
+ MessageBox.Show("arm");
+ }
+ else
+ {
+ MessageBox.Show("Unknown Architecture");
+ }
+
+ if (args.Length > 2)
+ {
+ if (args[2].ToLower() == "debug")
+ {
+ mainForm.ProjectController.SysGenProject.Debug = true;
+ }
+ else if (args[2].ToLower() == "release")
+ {
+ mainForm.ProjectController.SysGenProject.Debug = false;
+ }
+ else
+ {
+ MessageBox.Show("Unknown Target Mode");
+ }
+ }
+ }
+ }
+
+ //Run the application
+ Application.Run(mainForm);
+ }
+
+ internal static void CreateFileAssociation()
+ {
+ FileAssociation FA = new FileAssociation();
+ FA.Extension = "sgpd";
+ FA.ContentType = "application/sysgenproject";
+ FA.FullName = "SysGenProject";
+ FA.ProperName = "SysGenProject";
+ FA.AddCommand("open", "\"" + Assembly.GetExecutingAssembly().Location + "\" \" %1\"");
+ FA.AddCommand("edit", "notepad.exe %1");
+ FA.AddCommand("Generate x86", "\"" + Assembly.GetExecutingAssembly().Location + "\" \" %1\" X86 RELEASE");
+ FA.AddCommand("Generate x86 [DEBUG]", "\"" + Assembly.GetExecutingAssembly().Location + "\" \" %1\" X86 DEBUG");
+ FA.IconPath = Assembly.GetExecutingAssembly().Location;
+ FA.IconIndex = 0;
+ FA.Create();
+ }
+
+ internal static void RemoveFileAssociation()
+ {
+ FileAssociation FA = new FileAssociation();
+ FA.Extension = "sgpd";
+ FA.ContentType = "application/sysgenproject";
+ FA.FullName = "SysGenProject";
+ FA.ProperName = "SysGenProject";
+ FA.AddCommand("open", Assembly.GetExecutingAssembly().Location + " %1");
+ FA.AddCommand("edit", "notepad.exe %1");
+ FA.AddCommand("edit123", "notepad.exe %1");
+ FA.IconPath = Assembly.GetExecutingAssembly().Location;
+ FA.IconIndex = 0;
+ FA.Remove();
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/Project/Project.cs b/reactos/tools/sysgen/RosBuilder/Project/Project.cs
new file mode 100644
index 00000000000..f024dc385a5
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Project/Project.cs
@@ -0,0 +1,267 @@
+using System;
+using System.Collections.Specialized;
+using System.Collections.Generic;
+using System.Xml;
+using System.Collections;
+using System.IO;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace TriStateTreeViewDemo
+{
+ public enum TargetArchitectureType
+ {
+ X86,
+ X86_i486,
+ X86_i586,
+ X86_Pentium,
+ X86_Pentium2,
+ X86_Pentium3,
+ X86_Pentium4,
+ X86_AthlonXP,
+ X86_AthlonMP,
+ X86_Xbox,
+ PPC,
+ ARM
+ }
+
+ public enum OptimizeLevelType : int
+ {
+ Level_0 = 0,
+ Level_1 = 1,
+ Level_2 = 2,
+ Level_3 = 3,
+ Level_4 = 4,
+ Level_5 = 5
+ }
+
+ public class Project : RBuildPlatform
+ {
+ RBuildProject m_Project = null;
+
+ string m_FilePath; // full path to this project, including filename
+ string m_FileName = "Unnamed";
+
+ //MovieOptions movieOptions;
+ //CompilerOptions compilerOptions;
+ //PathCollection classpaths;
+ //PathCollection compileTargets;
+ //HiddenPathCollection hiddenPaths;
+ //AssetCollection libraryAssets;
+ bool traceEnabled; // selected configuration
+
+ public bool NoOutput; // Disable file building
+ public string InputPath; // For code injection
+ public string OutputPath;
+ public string PreBuildEvent;
+ public string PostBuildEvent;
+ public string TestMovieCommand;
+ public bool AlwaysRunPostBuild;
+ public bool ShowHiddenPaths;
+
+ public string Source;
+
+ public Project(RBuildProject project,string path)
+ {
+ m_FilePath = path;
+ m_FileName = Path.GetFileName(path);
+ m_Project = project;
+ m_Project.Platform = this;
+ }
+
+ public Project(RBuildProject project)
+ {
+ m_Project = project;
+ m_Project.Platform = this;
+ }
+
+ public RBuildProject RBuildProject
+ {
+ get { return m_Project; }
+ }
+
+ public virtual bool UsesInjection { get { return false; } }
+ public virtual bool HasLibraries { get { return false; } }
+ public virtual void ValidateBuild(out string error) { error = null; }
+
+ #region Simple Properties
+
+ public string ProjectPath { get { return m_FilePath; } set { m_FilePath = value; } }
+ //public string Name { get { return Path.GetFileNameWithoutExtension(path).Replace(' ', '-'); } }
+ public string Directory { get { return Path.GetDirectoryName(m_FilePath); } }
+ public Boolean TraceEnabled { set { traceEnabled = value; } get { return traceEnabled; } }
+
+ public string FileName
+ {
+ get { return m_FileName; }
+ }
+
+ //// we only provide getters for these to preserve the original pointer
+ //public MovieOptions MovieOptions { get { return movieOptions; } }
+ //public PathCollection Classpaths { get { return classpaths; } }
+ //public PathCollection CompileTargets { get { return compileTargets; } }
+ //public HiddenPathCollection HiddenPaths { get { return hiddenPaths; } }
+ //public AssetCollection LibraryAssets { get { return libraryAssets; } }
+
+ //public CompilerOptions CompilerOptions
+ //{
+ // get { return compilerOptions; }
+ // set { compilerOptions = value; }
+ //}
+
+ //public PathCollection AbsoluteClasspaths
+ //{
+ // get
+ // {
+ // PathCollection absolute = new PathCollection();
+ // foreach (string cp in classpaths)
+ // absolute.Add(GetAbsolutePath(cp));
+ // return absolute;
+ // }
+ //}
+
+ //public string OutputPathAbsolute { get { return GetAbsolutePath(OutputPath); } }
+
+ public bool CanBuild
+ {
+ get { return OutputPath != null && OutputPath.Length > 0; }
+ }
+
+ #endregion
+
+ #region Methods
+
+ // all the Set/Is methods expect absolute paths (as opposed to the way they're
+ // actually stored)
+
+ //public void SetPathHidden(string path, bool isHidden)
+ //{
+ // path = GetRelativePath(path);
+
+ // if (isHidden)
+ // {
+ // hiddenPaths.Add(path);
+ // compileTargets.RemoveAtOrBelow(path); // can't compile hidden files
+ // libraryAssets.RemoveAtOrBelow(path); // can't embed hidden resources
+ // }
+ // else hiddenPaths.Remove(path);
+ //}
+
+ //public bool IsPathHidden(string path)
+ //{
+ // return hiddenPaths.IsHidden(GetRelativePath(path));
+ //}
+
+ public void SetCompileTarget(string path, bool isCompileTarget)
+ {
+ //if (isCompileTarget)
+ // compileTargets.Add(GetRelativePath(path));
+ //else
+ // compileTargets.Remove(GetRelativePath(path));
+ }
+
+ //public bool IsCompileTarget(string path) { return compileTargets.Contains(GetRelativePath(path)); }
+
+ public void SetLibraryAsset(string path, bool isLibraryAsset)
+ {
+ //if (isLibraryAsset)
+ // libraryAssets.Add(GetRelativePath(path));
+ //else
+ // libraryAssets.Remove(GetRelativePath(path));
+ }
+
+ //public bool IsLibraryAsset(string path) { return libraryAssets.Contains(GetRelativePath(path)); }
+// public LibraryAsset GetAsset(string path) { return libraryAssets[GetRelativePath(path)]; }
+
+ public void ChangeAssetPath(string fromPath, string toPath)
+ {
+ //if (IsLibraryAsset(fromPath))
+ //{
+ // //LibraryAsset asset = libraryAssets[GetRelativePath(fromPath)];
+ // //libraryAssets.Remove(asset);
+ // //asset.Path = GetRelativePath(toPath);
+ // //libraryAssets.Add(asset);
+ //}
+ }
+
+ //public bool IsInput(string path) { return GetRelativePath(path) == InputPath; }
+ //public bool IsOutput(string path) { return GetRelativePath(path) == OutputPath; }
+
+ ///
+ /// Call this when you delete a path so we can remove all our references to it
+ ///
+ public void NotifyPathsDeleted(string path)
+ {
+ //path = GetRelativePath(path);
+ //hiddenPaths.Remove(path);
+ //compileTargets.RemoveAtOrBelow(path);
+ //libraryAssets.RemoveAtOrBelow(path);
+ }
+
+ ///
+ /// Returns the path to the "obj\" subdirectory, creating it if necessary.
+ ///
+ public string GetObjDirectory()
+ {
+ string objPath = Path.Combine(this.Directory, "obj");
+ if (!System.IO.Directory.Exists(objPath))
+ System.IO.Directory.CreateDirectory(objPath);
+ return objPath;
+ }
+
+ #endregion
+
+ #region Relative Path Helpers
+
+ //public string GetRelativePath(string path)
+ //{
+ // return ProjectPaths.GetRelativePath(this.Directory,path);
+ //}
+
+ //public string GetAbsolutePath(string path)
+ //{
+ // return ProjectPaths.GetAbsolutePath(this.Directory,path);
+ //}
+
+ #endregion
+
+ public Project Load()
+ {
+ ProjectReader reader = new ProjectReader(this, ProjectPath);
+
+ try
+ {
+ return reader.ReadProject();
+ }
+ catch (XmlException exception)
+ {
+ string format = string.Format("Error in Project '{0}' line {1}, position {2}.",
+ ProjectPath,
+ exception.LineNumber,
+ exception.LinePosition);
+
+ throw new Exception(format, exception);
+ }
+ finally
+ {
+ reader.Close();
+ }
+ }
+
+ public void Save()
+ {
+ ProjectWriter writer = new ProjectWriter(this, ProjectPath);
+
+ try
+ {
+ writer.WriteProject();
+ writer.Flush();
+ }
+ finally
+ {
+ writer.Close();
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosBuilder/Project/ProjectReader.cs b/reactos/tools/sysgen/RosBuilder/Project/ProjectReader.cs
new file mode 100644
index 00000000000..4fec3546bc6
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Project/ProjectReader.cs
@@ -0,0 +1,319 @@
+using System;
+using System.Windows.Forms;
+using System.Collections;
+using System.Diagnostics;
+using System.Text;
+using System.Xml;
+using System.Collections.Generic;
+
+using SysGen.RBuild.Framework;
+
+namespace TriStateTreeViewDemo
+{
+ public class ProjectReader : XmlTextReader
+ {
+ Project project;
+
+ public ProjectReader(Project project, string filename)
+ : base(filename)
+ {
+ this.project = project;
+ WhitespaceHandling = WhitespaceHandling.None;
+ }
+
+ protected Project Project { get { return project; } }
+
+ public virtual Project ReadProject()
+ {
+ MoveToContent();
+
+ while (Read())
+ ProcessNode(Name);
+
+ return project;
+ }
+
+ private void ReadModules()
+ {
+ RBuildModule module = null;
+
+ ReadStartElement("modules");
+ while (Name == "module")
+ {
+ try
+ {
+ module = project.RBuildProject.Modules.GetByName(GetAttribute("name"));
+
+ if (module == null)
+ throw new Exception("Unkown module '" + Value + "'");
+
+ project.Modules.Add(module);
+
+ //project.SysGenDesinger.PlatformController.Project.Platform.Modules.Add(module);
+ }
+ catch (Exception e)
+ {
+ MessageBox.Show(
+ e.Message,
+ "Error",
+ MessageBoxButtons.OK,
+ MessageBoxIcon.Error);
+ }
+
+ //project.Modules.Add(GetAttribute("name"));
+
+ // continue reading
+ Read();
+ }
+
+ ReadEndElement();
+ }
+
+ private void ReadLanguages()
+ {
+ RBuildLanguage language = null;
+
+ ReadStartElement("languages");
+ while (Name == "language")
+ {
+ try
+ {
+ language = project.RBuildProject.Languages.GetByName(GetAttribute("name"));
+
+ if (language == null)
+ throw new Exception("Unkown language '" + Value + "'");
+
+ project.Languages.Add(language);
+ }
+ catch (Exception e)
+ {
+ MessageBox.Show(e.Message,
+ "Error",
+ MessageBoxButtons.OK,
+ MessageBoxIcon.Error);
+ }
+
+ // continue reading
+ Read();
+ }
+
+ ReadEndElement();
+ }
+
+ //private void ReadRSLPaths()
+ //{
+ // //project.CompilerOptions.RSLPaths = ReadLibrary("rslPaths");
+ //}
+
+ //private void ReadExternalLibraryPaths()
+ //{
+ // //project.CompilerOptions.ExternalLibraryPaths = ReadLibrary("externalLibraryPaths");
+ //}
+
+ //private void ReadLibrayPath()
+ //{
+ // //project.CompilerOptions.LibraryPaths = ReadLibrary("libraryPaths");
+ //}
+
+ //private void ReadIncludeLibraries()
+ //{
+ // //project.CompilerOptions.IncludeLibraries = ReadLibrary("includeLibraries");
+ //}
+
+ //private string[] ReadLibrary(string name)
+ //{
+ // ReadStartElement(name);
+ // List elements = new List();
+ // while (Name == "element")
+ // {
+ // elements.Add(GetAttribute("path"));
+ // Read();
+ // }
+ // ReadEndElement();
+ // string[] result = new string[elements.Count];
+ // elements.CopyTo(result);
+ // return result;
+ //}
+
+ public void ReadApplications()
+ {
+ ReadStartElement("applications");
+ while (Name == "option")
+ {
+ MoveToFirstAttribute();
+ switch (Name)
+ {
+ case "shell":
+ project.Shell = Project.RBuildProject.Modules.GetByName(Value);
+ break;
+ case "screensaver":
+ project.Screensaver = Project.RBuildProject.Modules.GetByName(Value);
+ break;
+ case "wallpaper":
+ //project.Wallpaper = Value;
+ break;
+ }
+ Read();
+ }
+ ReadEndElement();
+ }
+
+ //protected virtual void ProcessNode(string name)
+ //{
+ // switch (name)
+ // {
+ // case "output": ReadOutputOptions(); break;
+ // // case "classpaths": ReadClasspaths(); break;
+ // // case "compileTargets": ReadCompileTargets(); break;
+ // // case "hiddenPaths": ReadHiddenPaths(); break;
+ // // case "preBuildCommand": ReadPreBuildCommand(); break;
+ // // case "postBuildCommand": ReadPostBuildCommand(); break;
+ // // case "options": ReadProjectOptions(); break;
+ // }
+ //}
+
+ // process AS3-specific stuff
+ protected virtual void ProcessNode(string name)
+ {
+ if (NodeType == XmlNodeType.Element)
+ {
+ switch (name)
+ {
+ //case "build": ReadBuildOptions(); break;
+ //case "includeLibraries": ReadIncludeLibraries(); break;
+ //case "libraryPaths": ReadLibrayPath(); break;
+ //case "externalLibraryPaths": ReadExternalLibraryPaths(); break;
+ case "modules":
+ ReadModules();
+ break;
+ case "languages":
+ ReadLanguages();
+ break;
+ case "applications":
+ ReadApplications();
+ break;
+ case "output":
+ ReadOutputOptions();
+ break;
+ case "options":
+ ReadProjectOptions();
+ break;
+ //default:
+ // base.ProcessNode(name); break;
+ }
+ }
+ }
+
+ public void ReadOutputOptions()
+ {
+ ReadStartElement("output");
+ while (Name == "movie")
+ {
+ MoveToFirstAttribute();
+ switch (Name)
+ {
+ case "name":
+ project.Name = Value;
+ break;
+ case "desc":
+ project.Description = Value;
+ break;
+ //case "path": project.OutputPath = OSPath(Value); break;
+ //case "fps": project.MovieOptions.Fps = IntValue; break;
+ //case "width": project.MovieOptions.Width = IntValue; break;
+ //case "height": project.MovieOptions.Height = IntValue; break;
+ //case "version": project.MovieOptions.Version = IntValue; break;
+ //case "background": project.MovieOptions.Background = Value; break;
+ }
+ Read();
+ }
+ ReadEndElement();
+ }
+
+ //public void ReadClasspaths()
+ //{
+ // ReadStartElement("classpaths");
+ // //ReadPaths("class",project.Classpaths);
+ // ReadEndElement();
+ //}
+
+ //public void ReadCompileTargets()
+ //{
+ // ReadStartElement("compileTargets");
+ // //ReadPaths("compile",project.CompileTargets);
+ // ReadEndElement();
+ //}
+
+ //public void ReadHiddenPaths()
+ //{
+ // ReadStartElement("hiddenPaths");
+ // //ReadPaths("hidden",project.HiddenPaths);
+ // ReadEndElement();
+ //}
+
+ //public void ReadPreBuildCommand()
+ //{
+ // if (!IsEmptyElement)
+ // {
+ // ReadStartElement("preBuildCommand");
+ // project.PreBuildEvent = OSPath(ReadString().Trim());
+ // ReadEndElement();
+ // }
+ //}
+
+ public void ReadPostBuildCommand()
+ {
+ //project.AlwaysRunPostBuild = Convert.ToBoolean(GetAttribute("alwaysRun"));
+
+ //if (!IsEmptyElement)
+ //{
+ // ReadStartElement("postBuildCommand");
+ // project.PostBuildEvent = OSPath(ReadString().Trim());
+ // ReadEndElement();
+ //}
+ }
+
+ public void ReadProjectOptions()
+ {
+ ReadStartElement("options");
+ while (Name == "option")
+ {
+ MoveToFirstAttribute();
+ switch (Name)
+ {
+ case "debug":
+ project.Debug = BoolValue;
+ break;
+ case "kdebug":
+ project.KDebug = BoolValue;
+ break;
+ case "source":
+ project.Source = Value;
+ break;
+ }
+ Read();
+ }
+ ReadEndElement();
+ }
+
+ public bool BoolValue { get { return Convert.ToBoolean(Value); } }
+ public int IntValue { get { return Convert.ToInt32(Value); } }
+
+ //public void ReadPaths(string pathNodeName, IAddPaths paths)
+ //{
+ // while (Name == pathNodeName)
+ // {
+ // paths.Add(OSPath(GetAttribute("path")));
+ // Read();
+ // }
+ //}
+
+ //protected string OSPath(string path)
+ //{
+ // if (path != null)
+ // return path.Replace('\\',System.IO.Path.DirectorySeparatorChar);
+ // else
+ // return null;
+ //}
+ }
+}
diff --git a/reactos/tools/sysgen/RosBuilder/Project/ProjectWriter.cs b/reactos/tools/sysgen/RosBuilder/Project/ProjectWriter.cs
new file mode 100644
index 00000000000..1061c326395
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Project/ProjectWriter.cs
@@ -0,0 +1,170 @@
+using System;
+using System.Collections;
+using System.IO;
+using System.Diagnostics;
+using System.Text;
+using System.Xml;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Framework;
+
+namespace TriStateTreeViewDemo
+{
+ public class ProjectWriter : XmlTextWriter
+ {
+ Project m_Project;
+
+ public ProjectWriter(Project project, string filename) : base(filename,Encoding.UTF8)
+ {
+ m_Project = project;
+ Formatting = Formatting.Indented;
+ }
+
+ protected Project Project { get { return m_Project; } }
+
+ public void WriteProject()
+ {
+ WriteStartDocument();
+ WriteStartElement("project");
+ WriteOutputOptions();
+ WriteBuildOptions();
+ WriteProjectOptions();
+ WriteEndElement();
+ WriteEndDocument();
+ }
+
+ public void WriteOutputOptions()
+ {
+ WriteComment(" Output SWF options ");
+ WriteStartElement("output");
+ WriteOption("movie", "name", m_Project.Name);
+ WriteOption("movie", "desc", m_Project.Description);
+ WriteEndElement();
+ }
+
+ public void WriteBuildOptions()
+ {
+ WriteComment(" Build options ");
+ WriteStartElement("build");
+
+ if (Project.Modules.Count > 0)
+ {
+ WriteStartElement("modules");
+ foreach (RBuildModule module in Project.Modules)
+ {
+ WriteStartElement("module");
+ WriteAttributeString("name", module.Name);
+ WriteEndElement();
+ }
+ WriteEndElement();
+ }
+
+ WriteEndElement();
+
+ if (Project.Languages.Count > 0)
+ {
+ WriteComment(" Build options ");
+ WriteStartElement("languages");
+ foreach (RBuildLanguage language in Project.Languages)
+ {
+ WriteStartElement("language");
+ WriteAttributeString("name", language.Name);
+ WriteEndElement();
+ }
+ WriteEndElement();
+ }
+
+ if (Project.DebugChannels.Count > 0)
+ {
+ WriteStartElement("debugchhanels");
+ foreach (RBuildDebugChannel channel in Project.DebugChannels)
+ {
+ WriteStartElement("debugchannel");
+ WriteAttributeString("name", channel.Name);
+ WriteEndElement();
+ }
+ WriteEndElement();
+ }
+
+ WriteStartElement("applications");
+
+ if (m_Project.Shell != null)
+ WriteOption("Shell", m_Project.Shell.Name);
+
+ if (m_Project.Screensaver != null)
+ WriteOption("Screensaver", m_Project.Screensaver.Name);
+
+ if (m_Project.Wallpaper != null)
+ WriteOption("Wallpaper", m_Project.Wallpaper.Name);
+
+ WriteEndElement();
+ }
+
+ public void WriteClasspaths()
+ {
+ WriteComment(" Other classes to be compiled into your SWF ");
+ WriteStartElement("classpaths");
+ //WritePaths(project.Classpaths,"class");
+ WriteEndElement();
+ }
+
+ public void WriteCompileTargets()
+ {
+ WriteComment(" Class files to compile (other referenced classes will automatically be included) ");
+ WriteStartElement("compileTargets");
+ //WritePaths(project.CompileTargets,"compile");
+ WriteEndElement();
+ }
+
+ public void WriteHiddenPaths()
+ {
+ WriteComment(" Paths to exclude from the Project Explorer tree ");
+ WriteStartElement("hiddenPaths");
+ //WritePaths(project.HiddenPaths,"hidden");
+ WriteEndElement();
+ }
+
+ public void WritePreBuildCommand()
+ {
+ WriteComment(" Executed before build ");
+ WriteStartElement("preBuildCommand");
+ if (m_Project.PreBuildEvent.Length > 0)
+ WriteString(m_Project.PreBuildEvent);
+ WriteEndElement();
+ }
+
+ public void WritePostBuildCommand()
+ {
+ WriteComment(" Executed after build ");
+ WriteStartElement("postBuildCommand");
+ WriteAttributeString("alwaysRun",m_Project.AlwaysRunPostBuild.ToString());
+ if (m_Project.PostBuildEvent.Length > 0)
+ WriteString(m_Project.PostBuildEvent);
+ WriteEndElement();
+
+ }
+
+ public void WriteProjectOptions()
+ {
+ WriteComment(" Other project options ");
+ WriteStartElement("options");
+ WriteOption("debug",m_Project.Debug);
+ WriteOption("kdebug",m_Project.KDebug);
+ WriteOption("source", @"c:\ros\trunk\reactos" /*project.Source*/);
+ WriteEndElement();
+ }
+
+ public void WriteOption(string optionName, object optionValue)
+ {
+ WriteOption("option", optionName, optionValue);
+ }
+
+ public void WriteOption(string nodeName, string optionName, object optionValue)
+ {
+ WriteStartElement(nodeName);
+ WriteAttributeString(optionName, optionValue.ToString());
+ WriteEndElement();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosBuilder/ProjectController.cs b/reactos/tools/sysgen/RosBuilder/ProjectController.cs
new file mode 100644
index 00000000000..c77491d236f
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/ProjectController.cs
@@ -0,0 +1,222 @@
+using System;
+using System.Windows.Forms;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Tasks;
+using SysGen.Framework.Catalog;
+
+namespace TriStateTreeViewDemo
+{
+ public class ProjectController
+ {
+ private ISysGenDesigner m_SysGenDesigner = null;
+ private RBuildProject m_Project = null;
+
+ public event EventHandler PlatformModulesUpdated;
+ public event EventHandler ProjectLoaded;
+ public event EventHandler ProjectSaved;
+ public event EventHandler ProjectUpdated;
+
+ public ProjectController(ISysGenDesigner engine)
+ {
+ m_SysGenDesigner = engine;
+
+ PlatformCatalogReader m_Catalog = new PlatformCatalogReader(@"C:\Ros\trunk\reactos\rbuilddb.xml");
+ m_Catalog.Read();
+
+ m_Project = m_Catalog.Project;
+
+ New();
+ }
+
+ public void New()
+ {
+ m_Project.Platform = new Project(m_Project);
+
+ if (ProjectLoaded != null)
+ ProjectLoaded(this, EventArgs.Empty);
+
+ if (PlatformModulesUpdated != null)
+ PlatformModulesUpdated(this, EventArgs.Empty);
+ }
+
+ public void Open(string file)
+ {
+ SysGenProject = new Project(m_Project, file);
+ SysGenProject.Load();
+
+ if (ProjectLoaded != null)
+ ProjectLoaded(this, EventArgs.Empty);
+
+ if (PlatformModulesUpdated != null)
+ PlatformModulesUpdated(this, EventArgs.Empty);
+ }
+
+ public void Open()
+ {
+ using (OpenFileDialog openFile = new OpenFileDialog())
+ {
+ openFile.Title = "Open SysGen Designer Project File";
+ //openFile.InitialDirectory = m_SysGenEngine.BaseDirectory;
+ openFile.Filter = "SysGen Project File|*.sgpd";
+
+ if (openFile.ShowDialog() == DialogResult.OK)
+ {
+ SysGenProject = new Project(m_Project, openFile.FileName);
+ SysGenProject.Load();
+
+ if (ProjectLoaded != null)
+ ProjectLoaded(this, EventArgs.Empty);
+
+ if (PlatformModulesUpdated != null)
+ PlatformModulesUpdated(this, EventArgs.Empty);
+ }
+ }
+ }
+
+ public void Save()
+ {
+ using (SaveFileDialog saveFile = new SaveFileDialog())
+ {
+ saveFile.Title = "Save SysGen Designer Project File";
+ //saveFile.InitialDirectory = m_SysGenEngine.BaseDirectory;
+ saveFile.Filter = "SysGen Project File|*.sgpd";
+
+ if (saveFile.ShowDialog() == DialogResult.OK)
+ {
+ SysGenProject.ProjectPath = saveFile.FileName;
+ SysGenProject.Save();
+
+ if (PlatformModulesUpdated != null)
+ PlatformModulesUpdated(this, EventArgs.Empty);
+
+ if (ProjectSaved != null)
+ ProjectSaved(this, EventArgs.Empty);
+ }
+ }
+ }
+
+ public RBuildModuleCollection AvailableModules
+ {
+ get { return m_Project.Modules; }
+ }
+
+ public RBuildProject Project
+ {
+ get { return m_Project; }
+ }
+
+ public Project SysGenProject
+ {
+ get { return Project.Platform as Project; }
+ set { Project.Platform = value; }
+ }
+
+ public void Remove(RBuildModule module)
+ {
+ SysGenDependencyTracker dependencyTracker = new SysGenDependencyTracker(Project, module);
+
+ if (dependencyTracker.Using.Count > 0)
+ {
+ string s = string.Format("Cannot remove module '{0}' because '{1}' modules depends on it",
+ module.Name,
+ dependencyTracker.Using.Count);
+
+ MessageBox.Show(s, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ else
+ {
+ Project.Platform.Modules.Remove(module);
+ }
+
+ if (PlatformModulesUpdated != null)
+ PlatformModulesUpdated(this, EventArgs.Empty);
+ }
+
+ public void Add(RBuildModule module)
+ {
+ SysGenDependencyTracker dependencyTracker = new SysGenDependencyTracker(Project , module);
+
+ if (AskAddModulesToPlatform(dependencyTracker.Missing))
+ {
+ Project.Platform.Modules.Add(dependencyTracker.DependsOn);
+ Project.Platform.Modules.Add(module);
+ }
+
+ if (PlatformModulesUpdated != null)
+ PlatformModulesUpdated(this, EventArgs.Empty);
+ }
+
+ public void Add(RBuildModuleCollection modules)
+ {
+ SysGenDependencyTracker dependencyTracker = new SysGenDependencyTracker(Project, modules);
+
+ if (AskAddModulesToPlatform(dependencyTracker.Missing))
+ {
+ Project.Platform.Modules.Add(dependencyTracker.DependsOn);
+ Project.Platform.Modules.Add(modules);
+ }
+
+ if (PlatformModulesUpdated != null)
+ PlatformModulesUpdated(this, EventArgs.Empty);
+ }
+
+ public void AddLanguage(RBuildLanguage language)
+ {
+ if (Project.Platform.Languages.Contains(language) == false)
+ Project.Platform.Languages.Add(language);
+
+ if (PlatformModulesUpdated != null)
+ PlatformModulesUpdated(this, EventArgs.Empty);
+
+ if (ProjectUpdated != null)
+ ProjectUpdated(this, EventArgs.Empty);
+ }
+
+ public void AddDebugChannel(RBuildDebugChannel channel)
+ {
+ if (Project.Platform.DebugChannels.Contains(channel) == false)
+ Project.Platform.DebugChannels.Add(channel);
+
+ if (PlatformModulesUpdated != null)
+ PlatformModulesUpdated(this, EventArgs.Empty);
+
+ if (ProjectUpdated != null)
+ ProjectUpdated(this, EventArgs.Empty);
+ }
+
+ public bool AskAddModulesToPlatform(RBuildModuleCollection missingDependencies)
+ {
+ if (missingDependencies.Count > 0)
+ {
+ StringBuilder str = new StringBuilder();
+
+ str.AppendFormat("This action requieres adding {0} dependecies no present in your platform :", missingDependencies.Count);
+ str.AppendLine();
+ str.AppendLine();
+
+ foreach (RBuildModule dependency in missingDependencies)
+ {
+ str.AppendFormat("{0} on '{1}' \n",
+ dependency.Name,
+ dependency.Base);
+ }
+
+ str.AppendLine();
+ str.AppendLine("¿Do you want to add this dependencies?");
+
+ if (MessageBox.Show(str.ToString(), "RosBuilder", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
+ {
+ return true;
+ }
+ }
+ else
+ return true;
+
+ return false;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosBuilder/Properties/AssemblyInfo.cs b/reactos/tools/sysgen/RosBuilder/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..0b59df60ad1
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("RosBuilder")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Sand")]
+[assembly: AssemblyProduct("RosBuilder")]
+[assembly: AssemblyCopyright("Copyright © Sand 2007")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("8f4d0b84-8882-4b89-8e3c-8ce5238d603f")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/reactos/tools/sysgen/RosBuilder/Properties/Resources.Designer.cs b/reactos/tools/sysgen/RosBuilder/Properties/Resources.Designer.cs
new file mode 100644
index 00000000000..268c5602106
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Properties/Resources.Designer.cs
@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.4927
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace RosBuilder.Properties {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RosBuilder.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosBuilder/Properties/Resources.resx b/reactos/tools/sysgen/RosBuilder/Properties/Resources.resx
new file mode 100644
index 00000000000..af7dbebbace
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/Properties/Settings.Designer.cs b/reactos/tools/sysgen/RosBuilder/Properties/Settings.Designer.cs
new file mode 100644
index 00000000000..71b700b5e99
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Properties/Settings.Designer.cs
@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.4927
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace RosBuilder.Properties {
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default {
+ get {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosBuilder/Properties/Settings.settings b/reactos/tools/sysgen/RosBuilder/Properties/Settings.settings
new file mode 100644
index 00000000000..39645652af6
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/reactos/tools/sysgen/RosBuilder/SysGen.Designer.csproj b/reactos/tools/sysgen/RosBuilder/SysGen.Designer.csproj
new file mode 100644
index 00000000000..3e94b2c1469
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/SysGen.Designer.csproj
@@ -0,0 +1,148 @@
+
+
+ Debug
+ AnyCPU
+ 8.0.50727
+ 2.0
+ {78A0F196-A5BD-469A-B901-B269671AFB0A}
+ WinExe
+ Properties
+ RosBuilder
+ RosBuilder
+
+
+ 2.0
+
+
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+ Component
+
+
+ Component
+
+
+ Component
+
+
+ UserControl
+
+
+ RegistryEditor.cs
+
+
+ Form
+
+
+ Form1.cs
+
+
+ Form
+
+
+ MainForm.cs
+
+
+
+ Form
+
+
+ NewItemForm.cs
+
+
+ Code
+
+
+
+
+
+
+
+
+
+ Designer
+ RegistryEditor.cs
+
+
+ Designer
+ Form1.cs
+
+
+ Designer
+ MainForm.cs
+
+
+ Designer
+ NewItemForm.cs
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+ True
+ Resources.resx
+ True
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ Settings.settings
+ True
+
+
+
+
+
+ {88D9BED7-30C5-4683-A6C6-6F2EB55B8F26}
+ SysGen.RBuild.Framework
+
+
+ {8F5F8375-4097-4952-B860-784EB9961ABE}
+ SysGen.Framework
+
+
+ {99CEE41D-B76D-4102-B0AD-C81069509D17}
+ TriStateTreeView
+
+
+
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/SysGen.Designer.csproj.user b/reactos/tools/sysgen/RosBuilder/SysGen.Designer.csproj.user
new file mode 100644
index 00000000000..6a34e7dcdf5
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/SysGen.Designer.csproj.user
@@ -0,0 +1,5 @@
+
+
+ ShowAllFiles
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/Util/FileAssociation.cs b/reactos/tools/sysgen/RosBuilder/Util/FileAssociation.cs
new file mode 100644
index 00000000000..f60b10d4603
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Util/FileAssociation.cs
@@ -0,0 +1,244 @@
+using System;
+using System.Security;
+using System.Collections;
+using Microsoft.Win32;
+
+namespace TriStateTreeViewDemo
+{
+ /// List of commands.
+ internal struct CommandList
+ {
+ ///
+ /// Holds the names of the commands.
+ ///
+ public ArrayList Captions;
+ ///
+ /// Holds the commands.
+ ///
+ public ArrayList Commands;
+ }
+ /// Properties of the file association.
+ internal struct FileType
+ {
+ ///
+ /// Holds the command names and the commands.
+ ///
+ public CommandList Commands;
+ ///
+ /// Holds the extension of the file type.
+ ///
+ public string Extension;
+ ///
+ /// Holds the proper name of the file type.
+ ///
+ public string ProperName;
+ ///
+ /// Holds the full name of the file type.
+ ///
+ public string FullName;
+ ///
+ /// Holds the name of the content type of the file type.
+ ///
+ public string ContentType;
+ ///
+ /// Holds the path to the resource with the icon of this file type.
+ ///
+ public string IconPath;
+ ///
+ /// Holds the icon index in the resource file.
+ ///
+ public short IconIndex;
+ }
+ /// Creates file associations for your programs.
+ /// The following example creates a file association for the type XYZ with a non-existent program.
+ ///
VB.NET code
+ ///
+ /// Dim FA as New FileAssociation
+ /// FA.Extension = "xyz"
+ /// FA.ContentType = "application/myprogram"
+ /// FA.FullName = "My XYZ Files!"
+ /// FA.ProperName = "XYZ File"
+ /// FA.AddCommand("open", "C:\mydir\myprog.exe %1")
+ /// FA.Create
+ ///
+ ///
C# code
+ ///
+ /// FileAssociation FA = new FileAssociation();
+ /// FA.Extension = "xyz";
+ /// FA.ContentType = "application/myprogram";
+ /// FA.FullName = "My XYZ Files!";
+ /// FA.ProperName = "XYZ File";
+ /// FA.AddCommand("open", "C:\\mydir\\myprog.exe %1");
+ /// FA.Create();
+ ///
+ ///
+ public class FileAssociation
+ {
+ /// Initializes an instance of the FileAssociation class.
+ public FileAssociation()
+ {
+ FileInfo = new FileType();
+ FileInfo.Commands.Captions = new ArrayList();
+ FileInfo.Commands.Commands = new ArrayList();
+ }
+ /// Gets or sets the proper name of the file type.
+ /// A String representing the proper name of the file type.
+ public string ProperName
+ {
+ get
+ {
+ return FileInfo.ProperName;
+ }
+ set
+ {
+ FileInfo.ProperName = value;
+ }
+ }
+ /// Gets or sets the full name of the file type.
+ /// A String representing the full name of the file type.
+ public string FullName
+ {
+ get
+ {
+ return FileInfo.FullName;
+ }
+ set
+ {
+ FileInfo.FullName = value;
+ }
+ }
+ /// Gets or sets the content type of the file type.
+ /// A String representing the content type of the file type.
+ public string ContentType
+ {
+ get
+ {
+ return FileInfo.ContentType;
+ }
+ set
+ {
+ FileInfo.ContentType = value;
+ }
+ }
+ /// Gets or sets the extension of the file type.
+ /// A String representing the extension of the file type.
+ /// If the extension doesn't start with a dot ("."), a dot is automatically added.
+ public string Extension
+ {
+ get
+ {
+ return FileInfo.Extension;
+ }
+ set
+ {
+ if (value.Substring(0, 1) != ".")
+ value = "." + value;
+ FileInfo.Extension = value;
+ }
+ }
+ /// Gets or sets the index of the icon of the file type.
+ /// A short representing the index of the icon of the file type.
+ public short IconIndex
+ {
+ get
+ {
+ return FileInfo.IconIndex;
+ }
+ set
+ {
+ FileInfo.IconIndex = value;
+ }
+ }
+ /// Gets or sets the path of the resource that contains the icon for the file type.
+ /// A String representing the path of the resource that contains the icon for the file type.
+ /// This resource can be an executable or a DLL.
+ public string IconPath
+ {
+ get
+ {
+ return FileInfo.IconPath;
+ }
+ set
+ {
+ FileInfo.IconPath = value;
+ }
+ }
+ /// Adds a new command to the command list.
+ /// The name of the command.
+ /// The command to execute.
+ /// Caption -or- Command is null (VB.NET: Nothing).
+ public void AddCommand(string Caption, string Command)
+ {
+ if (Caption == null || Command == null)
+ throw new ArgumentNullException();
+ FileInfo.Commands.Captions.Add(Caption);
+ FileInfo.Commands.Commands.Add(Command);
+ }
+ /// Creates the file association.
+ /// Extension -or- ProperName is null (VB.NET: Nothing).
+ /// Extension -or- ProperName is empty.
+ /// The user does not have registry write access.
+ public void Create()
+ {
+ // remove the extension to avoid incompatibilities [such as DDE links]
+ try
+ {
+ Remove();
+ }
+ catch (ArgumentException) {} // the extension doesn't exist
+
+ // create the exception
+ if (Extension == "" || ProperName == "")
+ throw new ArgumentException();
+ int cnt;
+
+ try
+ {
+ RegistryKey RegKey = Registry.ClassesRoot.CreateSubKey(Extension);
+ RegKey.SetValue("", ProperName);
+
+ if (ContentType != null && ContentType != "")
+ RegKey.SetValue("Content Type", ContentType);
+
+ RegKey.Close();
+ RegKey = Registry.ClassesRoot.CreateSubKey(ProperName);
+ RegKey.SetValue("", FullName);
+ RegKey.Close();
+
+ if (IconPath != "")
+ {
+ RegKey = Registry.ClassesRoot.CreateSubKey(ProperName + "\\" + "DefaultIcon");
+ RegKey.SetValue("", IconPath + "," + IconIndex.ToString());
+ RegKey.Close();
+ }
+
+ for (cnt = 0; cnt < FileInfo.Commands.Captions.Count; cnt++)
+ {
+ RegKey = Registry.ClassesRoot.CreateSubKey(ProperName + "\\" + "Shell" + "\\" + (String)FileInfo.Commands.Captions[cnt]);
+ RegKey = RegKey.CreateSubKey("Command");
+ RegKey.SetValue("", FileInfo.Commands.Commands[cnt]);
+ RegKey.Close();
+ }
+ }
+ catch
+ {
+ throw new SecurityException();
+ }
+ }
+ /// Removes the file association.
+ /// Extension -or- ProperName is null (VB.NET: Nothing).
+ /// Extension -or- ProperName is empty -or- the specified extension doesn't exist.
+ /// The user does not have registry delete access.
+ public void Remove()
+ {
+ if (Extension == null || ProperName == null)
+ throw new ArgumentNullException();
+ if (Extension == "" || ProperName == "")
+ throw new ArgumentException();
+ Registry.ClassesRoot.DeleteSubKeyTree(Extension);
+ Registry.ClassesRoot.DeleteSubKeyTree(ProperName);
+ }
+ /// Holds the properties of the file type.
+ private FileType FileInfo;
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Base/RBuildElement.cs b/reactos/tools/sysgen/RosFramework/Base/RBuildElement.cs
new file mode 100644
index 00000000000..3376bd00ed7
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Base/RBuildElement.cs
@@ -0,0 +1,311 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public abstract class RBuildElement : IRBuildNamed
+ {
+ protected string m_RBuild = null;
+ protected string m_Name = null;
+ protected string m_Base = null;
+ protected string m_Path = null;
+ protected string m_XmlFile = null;
+
+ protected List m_AssemblyFlags = new List();
+ protected List m_CompilerFlags = new List();
+ protected List m_LinkerFlags = new List();
+ protected RBuildIncludeFolderCollection m_Includes = new RBuildIncludeFolderCollection();
+ protected RBuildPlatformFileCollection m_Files = new RBuildPlatformFileCollection();
+ protected RBuildDefineCollection m_Defines = new RBuildDefineCollection();
+ protected RBuildPropertyCollection m_Properties = new RBuildPropertyCollection();
+ protected RBuildFolderCollection m_Folders = new RBuildFolderCollection();
+ protected RBuildFolder m_Folder = new RBuildFolder();
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public virtual RBuildFolder Folder
+ {
+ get { return m_Folder; }
+ set { m_Folder = value; }
+ }
+
+ public string XmlFile
+ {
+ get { return m_XmlFile; }
+ set { m_XmlFile = value; }
+ }
+
+ public string Path
+ {
+ get { return m_Path; }
+ set { m_Path = value; }
+ }
+
+ public string Base
+ {
+ get { return Folder.FullPath; }
+ }
+
+ public string RBuildPath
+ {
+ get { return System.IO.Path.Combine(Base, RBuildFile); }
+ }
+
+ public string RBuildFile
+ {
+ get { return m_RBuild; }
+ set { m_RBuild = value; }
+ }
+
+ public Uri BaseURI
+ {
+ get { return new Uri(Base, UriKind.Relative); }
+ }
+
+ public string BaseParent
+ {
+ get { return Base.Replace(System.IO.Path.DirectorySeparatorChar + Name , string.Empty); }
+ }
+
+ public string FolderFullPath
+ {
+ get { return System.IO.Path.Combine(Path, Base); }
+ }
+
+ public RBuildFolderCollection Folders
+ {
+ get { return m_Folders; }
+ }
+
+ public RBuildPlatformFileCollection Files
+ {
+ get { return m_Files; }
+ }
+
+ public RBuildPropertyCollection Properties
+ {
+ get { return m_Properties; }
+ }
+
+ public List CompilerFlags
+ {
+ get { return m_CompilerFlags; }
+ }
+
+ public List LinkerFlags
+ {
+ get { return m_LinkerFlags; }
+ }
+
+ public List AssemblyFlags
+ {
+ get { return m_AssemblyFlags; }
+ }
+
+ public RBuildDefineCollection Defines
+ {
+ get { return m_Defines; }
+ }
+
+ public RBuildIncludeFolderCollection IncludeFolders
+ {
+ get { return m_Includes; }
+ set { m_Includes = value; }
+ }
+
+ public string MakeFilePreCondition
+ {
+ get { return string.Format("{0}_PRECONDITION", Name); }
+ }
+
+ public string MakeFileRCFlags
+ {
+ get { return string.Format("{0}_RCFLAGS", Name); }
+ }
+
+ public string MakeFileWIDLFlags
+ {
+ get { return string.Format("{0}_WIDLFLAGS", Name); }
+ }
+
+ public string MakeFileLFlags
+ {
+ get { return string.Format("{0}_LFLAGS", Name); }
+ }
+
+ public string MakeFileNASMFlags
+ {
+ get { return string.Format("{0}_NASMFLAGS", Name); }
+ }
+
+ public string MakeFileFoldersMacro
+ {
+ get { return string.Format("$({0}_FOLDERS)", Name); }
+ }
+
+ public string MakeFileFolders
+ {
+ get { return string.Format("{0}_FOLDERS", Name); }
+ }
+
+ public string MakeFileCFlags
+ {
+ get { return string.Format("{0}_CFLAGS", Name); }
+ }
+
+ public string MakeFileObjs
+ {
+ get { return string.Format("{0}_OBJS", Name); }
+ }
+
+ public string MakeFileSources
+ {
+ get { return string.Format("{0}_SOURCES", Name); }
+ }
+
+ public string MakeFileHeaders
+ {
+ get { return string.Format("{0}_HEADERS", Name); }
+ }
+
+ public string MakeFileMakeTarget
+ {
+ get { return string.Format("{0}", Name); }
+ }
+
+ public string MakeFileFlagDebugTarget
+ {
+ get { return string.Format("{0}_flagdebug", Name); }
+ }
+
+ public string MakeFileInfoTarget
+ {
+ get { return string.Format("{0}_info", Name); }
+ }
+
+ public string MakeFileCleanTarget
+ {
+ get { return string.Format("{0}_clean", Name); }
+ }
+
+ public string MakeFileDependsTarget
+ {
+ get { return string.Format("{0}_depends", Name); }
+ }
+
+ public string MakeFileInstallTarger
+ {
+ get { return string.Format("{0}_install", Name); }
+ }
+
+ public string MakeFileHeadersMacro
+ {
+ get { return string.Format("$({0}_HEADERS)", Name); }
+ }
+
+ public string MakeFileMCHeadersMacro
+ {
+ get { return string.Format("$({0}_MCHEADERS)", Name); }
+ }
+
+ public string MakeFileMCHeaders
+ {
+ get { return string.Format("{0}_MCHEADERS", Name); }
+ }
+
+ public string MakeFileRPCHeadersMacro
+ {
+ get { return string.Format("$({0}_RPCHEADERS)", Name); }
+ }
+
+ public string MakeFileRPCHeaders
+ {
+ get { return string.Format("{0}_RPCHEADERS", Name); }
+ }
+
+ public string MakeFileRPCSourcesMacro
+ {
+ get { return string.Format("$({0}_RPCSOURCES)", Name); }
+ }
+
+ public string MakeFileRPCSources
+ {
+ get { return string.Format("{0}_RPCSOURCES", Name); }
+ }
+
+ public string MakeFilePCHMacro
+ {
+ get { return string.Format("$({0}_PCH)", Name); }
+ }
+
+ public string MakeFilePCHHeaders
+ {
+ get { return string.Format("{0}_PCH", Name); }
+ }
+
+ public string MakeFileNASMMacro
+ {
+ get { return string.Format("$({0}_NASMFLAGS)", Name); }
+ }
+
+ public string MakeFileCFlagsMacro
+ {
+ get { return string.Format("$({0}_CFLAGS)", Name); }
+ }
+
+ public string MakeFileLFlagsMacro
+ {
+ get { return string.Format("$({0}_LFLAGS)", Name); }
+ }
+
+ public string MakeFileWIDLFlagsMacro
+ {
+ get { return string.Format("$({0}_WIDLFLAGS)", Name); }
+ }
+
+ public string MakeFileObjsMacro
+ {
+ get { return string.Format("$({0}_OBJS)", Name); }
+ }
+
+ public string MakeFileSourcesMacro
+ {
+ get { return string.Format("$({0}_SOURCES)", Name); }
+ }
+
+ public string MakeFilePreConditionMacro
+ {
+ get { return string.Format("$({0}_PRECONDITION)", Name); }
+ }
+
+ public string MakeFileRCFlagsMacro
+ {
+ get { return string.Format("$({0}_RCFLAGS)", Name); }
+ }
+
+ public abstract void SaveAs(string file);
+
+ public override bool Equals(object obj)
+ {
+ if (obj is RBuildElement)
+ {
+ RBuildElement element = obj as RBuildElement;
+
+ if (element.Name == Name)
+ return true;
+ }
+
+ return false;
+ }
+
+ public override int GetHashCode()
+ {
+ return base.GetHashCode();
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildAPIStatusCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildAPIStatusCollection.cs
new file mode 100644
index 00000000000..e877521ee0c
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildAPIStatusCollection.cs
@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildAPIStatusCollection : List
+ {
+ public int Percentage
+ {
+ get
+ {
+ if (TotalFunctions == 0)
+ return 100;
+
+ return ((100 * ImplementedFunctionsCount) / TotalFunctions);
+ }
+ }
+
+ public int TotalFunctions
+ {
+ get { return (ImplementedFunctionsCount + UnImplementedFunctionsCount); }
+ }
+
+ public int ImplementedFunctionsCount
+ {
+ get
+ {
+ int count = 0;
+
+ foreach (RBuildAPIInfo info in this)
+ if (info.Implemented == true)
+ count++;
+
+ return count;
+ }
+ }
+
+ public int UnImplementedFunctionsCount
+ {
+ get
+ {
+ int count = 0;
+
+ foreach (RBuildAPIInfo info in this)
+ if (info.Implemented == false)
+ count++;
+
+ return count;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildAuthorCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildAuthorCollection.cs
new file mode 100644
index 00000000000..e9f588ae119
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildAuthorCollection.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildAuthorCollection : List
+ {
+ public RBuildAuthor GetByName(string alias)
+ {
+ foreach (RBuildAuthor author in this)
+ {
+ if (author.Contributor.Alias == alias)
+ return author;
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildBuildFamilyCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildBuildFamilyCollection.cs
new file mode 100644
index 00000000000..c2f0b416a42
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildBuildFamilyCollection.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildBuildFamilyCollection : List
+ {
+ public RBuildBuildFamily GetByName(string name)
+ {
+ foreach (RBuildBuildFamily family in this)
+ {
+ if (family.Name == name)
+ return family;
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildContributorCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildContributorCollection.cs
new file mode 100644
index 00000000000..ee8e5530b7e
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildContributorCollection.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildContributorCollection : List
+ {
+ public RBuildContributor GetByName(string alias)
+ {
+ foreach (RBuildContributor contributor in this)
+ {
+ if (contributor.Alias == alias)
+ return contributor;
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildDebugChannelCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildDebugChannelCollection.cs
new file mode 100644
index 00000000000..8f45b25cfb1
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildDebugChannelCollection.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildDebugChannelCollection : List
+ {
+ public RBuildDebugChannel GetByName(string name)
+ {
+ foreach (RBuildDebugChannel channel in this)
+ {
+ if (channel.Name == name)
+ return channel;
+ }
+
+ return null;
+ }
+
+ public string Text
+ {
+ get
+ {
+ StringBuilder sBuilder = new StringBuilder();
+
+ foreach (RBuildDebugChannel channel in this)
+ {
+ sBuilder.Append(channel.Text);
+ }
+
+ return sBuilder.ToString();
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildDefineCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildDefineCollection.cs
new file mode 100644
index 00000000000..7281ab8a556
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildDefineCollection.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildDefineCollection : List
+ {
+ public bool IsDefined(string name)
+ {
+ foreach (RBuildDefine define in this)
+ {
+ if (define.Name == name)
+ return true;
+ }
+
+ return false;
+ }
+
+ public void Add(string name)
+ {
+ Add(new RBuildDefine(name));
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildExportedFunctionsCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildExportedFunctionsCollection.cs
new file mode 100644
index 00000000000..c3d17463fad
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildExportedFunctionsCollection.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildExportedFunctionsCollection : List
+ {
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildFamilyCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildFamilyCollection.cs
new file mode 100644
index 00000000000..66ea4355fd4
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildFamilyCollection.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildFamilyCollection : List
+ {
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildFileCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildFileCollection.cs
new file mode 100644
index 00000000000..08e47dd24be
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildFileCollection.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildFileCollection : List
+ {
+ public void Add(RBuildFileCollection files)
+ {
+ foreach (RBuildFile file in files)
+ {
+ Add(file);
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildFolderCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildFolderCollection.cs
new file mode 100644
index 00000000000..09faabaa28f
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildFolderCollection.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildFolderCollection : List
+ {
+ public void Add(RBuildFolderCollection folders)
+ {
+ foreach (RBuildFolder folder in folders)
+ {
+ Add(folder);
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildIncludeFolderCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildIncludeFolderCollection.cs
new file mode 100644
index 00000000000..96b63771fe8
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildIncludeFolderCollection.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildIncludeFolderCollection : List
+ {
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildInstallFolderCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildInstallFolderCollection.cs
new file mode 100644
index 00000000000..e9620346126
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildInstallFolderCollection.cs
@@ -0,0 +1,28 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildInstallFolderCollection : List
+ {
+ public RBuildInstallFolder GetByName(string name)
+ {
+ foreach (RBuildInstallFolder folder in this)
+ {
+ if (NormalizeFolderName(folder.Name) == NormalizeFolderName(name))
+ return folder;
+ }
+
+ return null;
+ }
+
+ private string NormalizeFolderName(string path)
+ {
+ return path.Replace(
+ Path.AltDirectorySeparatorChar,
+ Path.DirectorySeparatorChar);
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildLanguageCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildLanguageCollection.cs
new file mode 100644
index 00000000000..d81f0506a49
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildLanguageCollection.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildLanguageCollection : List
+ {
+ public RBuildLanguage GetByName(string culture)
+ {
+ foreach (RBuildLanguage language in this)
+ {
+ if (language.Name == culture)
+ return language;
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildLocalizationFileCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildLocalizationFileCollection.cs
new file mode 100644
index 00000000000..7e005d00616
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildLocalizationFileCollection.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildLocalizationFileCollection : List
+ {
+ public bool ContainsLocalization(string culture)
+ {
+ return GetByName(culture) != null;
+ }
+
+ public RBuildLocalizationFile GetByName(string culture)
+ {
+ foreach (RBuildLocalizationFile file in this)
+ {
+ if (file.IsoName == culture)
+ return file;
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildModuleCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildModuleCollection.cs
new file mode 100644
index 00000000000..2c472e74f07
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildModuleCollection.cs
@@ -0,0 +1,82 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class ModulePreferenceComparer : IComparer
+ {
+ public int Compare(RBuildModule x, RBuildModule y)
+ {
+ if (x.Type == y.Type)
+ return 0;
+
+ if (x.Type == ModuleType.BuildTool)
+ return -1;
+
+ return 1;
+ }
+ }
+
+ public class RBuildModuleCollection : List
+ {
+ public event EventHandler OnModuleAdded;
+
+ public void Add(RBuildModuleCollection modules)
+ {
+ foreach (RBuildModule module in modules)
+ {
+ Add(module);
+ }
+ }
+
+ public new void Add(RBuildModule module)
+ {
+ if (module == null)
+ throw new Exception("Could not add a null instance");
+
+ if (GetByName(module.Name) == null)
+ {
+ base.Add(module);
+ }
+
+ if (OnModuleAdded != null)
+ OnModuleAdded(this, EventArgs.Empty);
+ }
+
+ public void Add(string moduleName)
+ {
+ RBuildModule module = GetByName(moduleName);
+
+ if (module == null)
+ throw new Exception(string.Format("Unknown '{0}' module", moduleName));
+
+ Add(module);
+ }
+
+ public void Add(int index, RBuildModule moduleName)
+ {
+ base.Insert(index, moduleName);
+ }
+
+ public void DisableAll()
+ {
+ foreach (RBuildModule module in this)
+ {
+ // Disable module
+ module.Enabled = false;
+ }
+ }
+
+ public RBuildModule GetByName(string name)
+ {
+ foreach (RBuildModule module in this)
+ {
+ if (module.Name == name)
+ return module;
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildModuleInfoCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildModuleInfoCollection.cs
new file mode 100644
index 00000000000..4670f093936
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildModuleInfoCollection.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildModuleInfoCollection : List
+ {
+ public RBuildModuleInfo GetByName(string name)
+ {
+ foreach (RBuildModuleInfo module in this)
+ {
+ if (module.Name == name)
+ return module;
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildPlatformFileCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildPlatformFileCollection.cs
new file mode 100644
index 00000000000..7ccf135cefc
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildPlatformFileCollection.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildPlatformFileCollection : List
+ {
+ public void Add(RBuildPlatformFileCollection files)
+ {
+ foreach (RBuildPlatformFile file in files)
+ {
+ Add(file);
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildPropertyCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildPropertyCollection.cs
new file mode 100644
index 00000000000..f3a4769258f
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildPropertyCollection.cs
@@ -0,0 +1,108 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Text.RegularExpressions;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildPropertyCollection : List
+ {
+ ///
+ /// Adds a property that cannot be changed.
+ ///
+ ///
+ /// Properties added with this method can never be changed. Note that
+ /// they are removed if the Clear method is called.
+ ///
+ /// Name of property
+ /// Value of property
+ public virtual void AddReadOnly(string name, string value)
+ {
+ Add(name, value, true);
+ }
+
+ ///
+ /// Adds a property to the collection.
+ ///
+ /// Name of property
+ /// Value of property
+ public virtual void Add(string name, string value)
+ {
+ Add(name, value, false);
+ }
+
+ ///
+ /// Adds a property to the collection.
+ ///
+ /// Name of property
+ /// Value of property
+ public virtual void Add(string name, bool value)
+ {
+ Add(name, value.ToString());
+ }
+
+ ///
+ /// Adds a property to the collection.
+ ///
+ /// Name of property
+ /// Value of property
+ public virtual void Add(string name, string value, bool readOnly)
+ {
+ if (!PropertyExists(name))
+ {
+ Add(new RBuildProperty(name, value , readOnly));
+ }
+ }
+
+ ///
+ /// Adds a property to the collection.
+ ///
+ /// Name of property
+ /// Value of property
+ public virtual void Add(string name, string value, bool readOnly, bool isInternal)
+ {
+ if (!PropertyExists(name))
+ {
+ Add(new RBuildProperty(name, value, readOnly,isInternal));
+ }
+ }
+
+ ///
+ /// Returns true if a property is listed as read only
+ ///
+ /// Property to check
+ /// true if readonly, false otherwise
+ public virtual bool IsReadOnlyProperty(string name)
+ {
+ if (PropertyExists(name))
+ return this[name].ReadOnly;
+ return false;
+ }
+
+ ///
+ /// Returns true if a property exists
+ ///
+ /// Property to check
+ /// true if exists, false otherwise
+ public bool PropertyExists(string name)
+ {
+ return (this[name] != null);
+ }
+
+ ///
+ /// Indexer property.
+ ///
+ public virtual RBuildProperty this[string name]
+ {
+ get
+ {
+ foreach (RBuildProperty property in this)
+ if (property.Name == name)
+ return property;
+
+ return null;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildSourceFileCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildSourceFileCollection.cs
new file mode 100644
index 00000000000..7175bac8e8a
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildSourceFileCollection.cs
@@ -0,0 +1,60 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class SourceCodePreferenceComparer : IComparer
+ {
+ public int Compare(RBuildSourceFile x, RBuildSourceFile y)
+ {
+ if (x.First != y.First)
+ {
+ if (x.First)
+ return -1;
+ else
+ return 1;
+ }
+
+ if (x.Extension == y.Extension)
+ return 0;
+
+ if (x.IsWidl)
+ return -1;
+ else if (y.IsWidl)
+ return 1;
+
+ if (x.IsAssembler)
+ return 1;
+ else if (y.IsAssembler)
+ return -1;
+
+ if (x.IsNASM)
+ return 1;
+ else if (y.IsNASM)
+ return -1;
+
+ return 0;
+ }
+ }
+
+ public class RBuildSourceFileCollection : List
+ {
+ public bool ContainsASM
+ {
+ get
+ {
+ foreach (RBuildSourceFile file in this)
+ {
+ if ((file.IsAssembler) || (file.IsNASM))
+ {
+ return true;
+ }
+ }
+
+ // This module does not contain C++ code
+ return false;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Interfaces/IRBuildInstallable.cs b/reactos/tools/sysgen/RosFramework/Interfaces/IRBuildInstallable.cs
new file mode 100644
index 00000000000..4e5a8467d0b
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Interfaces/IRBuildInstallable.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public interface IRBuildInstallable
+ {
+ string InstallBase { get; set; }
+
+ RBuildInstallFolder InstallFolder { get; set; }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Interfaces/IRBuildModulesContainer.cs b/reactos/tools/sysgen/RosFramework/Interfaces/IRBuildModulesContainer.cs
new file mode 100644
index 00000000000..9bc5f9902f3
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Interfaces/IRBuildModulesContainer.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+
+namespace SysGen.RBuild.Framework
+{
+ public interface IRBuildModulesContainer
+ {
+ RBuildSourceFileCollection Modules { get; }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Interfaces/IRBuildNamed.cs b/reactos/tools/sysgen/RosFramework/Interfaces/IRBuildNamed.cs
new file mode 100644
index 00000000000..34252cab108
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Interfaces/IRBuildNamed.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+
+namespace SysGen.RBuild.Framework
+{
+ public interface IRBuildNamed
+ {
+ string Name { get; }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Interfaces/IRBuildSourceFilesContainer.cs b/reactos/tools/sysgen/RosFramework/Interfaces/IRBuildSourceFilesContainer.cs
new file mode 100644
index 00000000000..78eccd72cdb
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Interfaces/IRBuildSourceFilesContainer.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+
+namespace SysGen.RBuild.Framework
+{
+ public interface IRBuildSourceFilesContainer
+ {
+ RBuildSourceFileCollection SourceFiles { get; }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Misc/Utility.cs b/reactos/tools/sysgen/RosFramework/Misc/Utility.cs
new file mode 100644
index 00000000000..da5200b907d
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Misc/Utility.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ class Utility
+ {
+ public static string GetSafeString (string str)
+ {
+ str = str.Replace(" ", string.Empty);
+ str = str.Replace(".", string.Empty);
+
+ return str;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/NotImplementedYet/RBuildModuleGroup.cs b/reactos/tools/sysgen/RosFramework/NotImplementedYet/RBuildModuleGroup.cs
new file mode 100644
index 00000000000..6cc00b2fe2a
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/NotImplementedYet/RBuildModuleGroup.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework.NotImplementedYet
+{
+ public class RBuildModuleGroup
+ {
+ private RBuildModuleCollection m_Modules = new RBuildModuleCollection();
+ private string m_Name = null;
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public RBuildModuleCollection Modules
+ {
+ get { return m_Modules; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/NotImplementedYet/RBuildPatch.cs b/reactos/tools/sysgen/RosFramework/NotImplementedYet/RBuildPatch.cs
new file mode 100644
index 00000000000..0b8b9c22b82
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/NotImplementedYet/RBuildPatch.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework.NotImplementedYet
+{
+ public class RBuildPatch
+ {
+ private string m_Filename = null;
+ private string m_Name = null;
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public string FileName
+ {
+ get { return m_Filename; }
+ set { m_Filename = value; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Obsolete/PlatformCatalog.cs b/reactos/tools/sysgen/RosFramework/Obsolete/PlatformCatalog.cs
new file mode 100644
index 00000000000..4d8fcfbaf41
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Obsolete/PlatformCatalog.cs
@@ -0,0 +1,92 @@
+using System;
+using System.Xml;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class PlatformCatalog
+ {
+ public List m_Platform = new List();
+ public SoftwareCatalog m_SoftwareCatalog = new SoftwareCatalog();
+
+ public PlatformCatalog()
+ {
+ }
+
+ public List Platforms
+ {
+ get { return m_Platform; }
+ }
+
+ public SoftwareCatalog SoftwareCatalog
+ {
+ get { return m_SoftwareCatalog; }
+ set { m_SoftwareCatalog = value; }
+ }
+
+ public RosPlatform GetPlatformByName(string name)
+ {
+ foreach (RosPlatform platform in Platforms)
+ {
+ if (platform.Name == name)
+ {
+ return platform;
+ }
+ }
+
+ throw new Exception("Platform not found in catalog");
+ }
+
+ public void LoadFromFile(string file)
+ {
+ XmlDocument doc = new XmlDocument();
+
+ //Load the file in to memory
+ doc.Load(file);
+
+ //Load modules ...
+ foreach (XmlNode node in doc.SelectNodes("/platforms/platform"))
+ {
+ RosPlatform platform = new RosPlatform();
+
+ platform.Name = node.Attributes["name"].InnerText;
+
+ if (node.Attributes["base"] != null)
+ {
+ platform.Base = node.Attributes["base"].InnerText;
+ }
+
+ m_Platform.Add(platform);
+ }
+
+ foreach (XmlNode comp in doc.SelectNodes("/platforms/platform"))
+ {
+ // Get the component name....
+ string name = comp.Attributes["name"].InnerText;
+
+ RosPlatform platform = GetPlatformByName(name);
+
+ if (platform.Base != null)
+ {
+ platform.ParentPlatform = GetPlatformByName(platform.Base);
+
+ foreach (RBuildModule module in platform.ParentModules)
+ {
+ platform.Modules.Add(module);
+ }
+ }
+
+ foreach (XmlNode dep in comp.SelectNodes("modules/module"))
+ {
+ // Gets the dependency name
+ name = dep.Attributes["name"].InnerText;
+
+ RBuildModule module = SoftwareCatalog.Modules.GetByName(name);
+
+ platform.Modules.Add(module);
+ }
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Obsolete/RosArchitecture.cs b/reactos/tools/sysgen/RosFramework/Obsolete/RosArchitecture.cs
new file mode 100644
index 00000000000..593a0373a1a
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Obsolete/RosArchitecture.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RosArchitecture
+ {
+ private string m_Name = null;
+ private string m_Sub = null;
+ private string m_Optimization = null;
+
+ public RosArchitecture ()
+ {
+ m_Name = "i386";
+ m_Sub = string.Empty;
+ m_Optimization = "pentium";
+ }
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public string SubArchitecture
+ {
+ get { return m_Sub; }
+ set { m_Sub = value; }
+ }
+
+ public string Optimization
+ {
+ get { return m_Optimization; }
+ set { m_Optimization = value; }
+ }
+
+ public string SafeName
+ {
+ get { return Utility.GetSafeString(m_Name).ToUpper(); }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/Obsolete/RosOSImage.cs b/reactos/tools/sysgen/RosFramework/Obsolete/RosOSImage.cs
new file mode 100644
index 00000000000..7890b26cf26
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Obsolete/RosOSImage.cs
@@ -0,0 +1,209 @@
+using System;
+using System.Xml;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildOSImage
+ {
+ private RosPlatform m_Platform = null;
+ private RBuildLanguage m_Language = null;
+ private RosArchitecture m_Architecture = null;
+
+ private Dictionary m_Properties = new Dictionary();
+ private List m_Defines = new List();
+ private List m_Includes = new List();
+
+ private bool m_Debug = false;
+ //private bool m_KernelDebugger = false;
+ //private bool m_GDBDebugger = false;
+
+ private bool m_MakeBootCD = false;
+ private bool m_MakeLiveCD = false;
+
+ public RBuildOSImage()
+ {
+ Properties.Add("SARCH", "");
+ Properties.Add("OARCH", "pentium");
+ Properties.Add("OPTIMIZE", "1");
+ Properties.Add("MP", "0");
+ Properties.Add("KDBG", "0");
+ Properties.Add("DBG", "0");
+ Properties.Add("GDB", "0");
+ Properties.Add("NSWPAT", "0");
+ Properties.Add("NTLPC", "1");
+ Properties.Add("_WINKD_", "0");
+
+ Defines.Add ("_M_IX86");
+ Defines.Add ("_X86_");
+ Defines.Add ("__i386__");
+ Defines.Add ("_REACTOS_");
+
+ Includes.Add(".");
+ Includes.Add("include");
+ Includes.Add("include/psdk");
+ Includes.Add("include/dxsdk");
+ Includes.Add("include/crt");
+ Includes.Add("include/ddk");
+ Includes.Add("include/GL");
+ Includes.Add("include/ndk");
+ Includes.Add("include/reactos");
+ Includes.Add("include/reactos/libs");
+ }
+
+ public bool MakeLiveCD
+ {
+ get { return m_MakeLiveCD; }
+ set { m_MakeLiveCD = value; }
+ }
+
+ public bool MakeBootCD
+ {
+ get { return m_MakeBootCD; }
+ set { m_MakeBootCD = value; }
+ }
+
+ public RBuildLanguage Language
+ {
+ get { return m_Language; }
+ set { m_Language = value; }
+ }
+
+ public RosPlatform Platform
+ {
+ get { return m_Platform; }
+ set { m_Platform = value; }
+ }
+
+ public RosArchitecture Architecture
+ {
+ get { return m_Architecture; }
+ set { m_Architecture = value; }
+ }
+
+ public Dictionary Properties
+ {
+ get { return m_Properties; }
+ }
+
+ public List Defines
+ {
+ get { return m_Defines; }
+ }
+
+ public List Includes
+ {
+ get { return m_Includes; }
+ }
+
+ public string ReleaseType
+ {
+ get
+ {
+ if (m_Debug)
+ return "DBG";
+
+ return "RELEASE";
+ }
+ }
+
+ public string ImageType
+ {
+ get
+ {
+ if (m_MakeBootCD)
+ return "BootCD";
+
+ return "LiveCD";
+ }
+ }
+
+ public void SaveAs(string file)
+ {
+ // Creates an XML file is not exist
+ using (XmlTextWriter writer = new XmlTextWriter(file, Encoding.ASCII))
+ {
+ writer.Indentation = 4;
+ writer.Formatting = Formatting.Indented;
+
+ // Starts a new document
+ writer.WriteStartDocument();
+ writer.WriteStartElement("project");
+ writer.WriteAttributeString("name", "ReactOS");
+ writer.WriteAttributeString("makefile", "makefile.auto");
+ writer.WriteAttributeString("xmlns", "xi", null, "http://www.w3.org/2001/XInclude");
+
+ writer.WriteComment("Generic Properties");
+ foreach (KeyValuePair property in Properties)
+ {
+ writer.WriteStartElement("property");
+ writer.WriteAttributeString("name", property.Key);
+ writer.WriteAttributeString("value", property.Value);
+ writer.WriteEndElement();
+ }
+
+ foreach (string define in Defines)
+ {
+ writer.WriteStartElement("define");
+ writer.WriteAttributeString("name", define);
+ writer.WriteEndElement();
+ }
+
+ writer.WriteStartElement("xi:include");
+ writer.WriteAttributeString("href", "baseaddress.rbuild");
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("xi:include");
+ writer.WriteAttributeString("href", "boot/bootdata/bootdata.rbuild");
+ writer.WriteEndElement();
+
+ writer.WriteElementString("compilerflag", "-Os");
+ writer.WriteElementString("compilerflag", "-ftracer");
+ writer.WriteElementString("compilerflag", "-momit-leaf-frame-pointer");
+ writer.WriteElementString("compilerflag", "-mpreferred-stack-boundary=2");
+
+ writer.WriteElementString("compilerflag", "-Wno-strict-aliasing");
+ writer.WriteElementString("compilerflag", "-Wpointer-arith");
+ writer.WriteElementString("linkerflag", "-enable-stdcall-fixup");
+
+ foreach (string include in Includes)
+ {
+ writer.WriteStartElement("include");
+ writer.WriteAttributeString("root", "intermediate");
+ writer.WriteString(include);
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("include");
+ writer.WriteString(include);
+ writer.WriteEndElement();
+ }
+
+ foreach (RBuildModule module in Platform.Modules)
+ {
+ writer.WriteStartElement("xi:include");
+ writer.WriteAttributeString("href", module.RBuildFile);
+ writer.WriteEndElement();
+ }
+
+ writer.WriteEndElement(); //Project
+ writer.WriteEndDocument();
+ }
+
+ string a = Name;
+ }
+
+ public string Name
+ {
+ get {
+ return "";
+ //return string.Format("{0}_{1}{2}_{3}_{4}.iso",
+ // Platform.SafeName,
+ // Architecture.SafeName ,
+ // Language.CultureInfo.ThreeLetterISOLanguageName,
+ // ImageType,
+ // ReleaseType);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/Obsolete/RosPlatform.cs b/reactos/tools/sysgen/RosFramework/Obsolete/RosPlatform.cs
new file mode 100644
index 00000000000..2864a425bbf
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Obsolete/RosPlatform.cs
@@ -0,0 +1,78 @@
+using System;
+using System.Xml;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RosPlatform
+ {
+ private List m_Modules = new List();
+
+ private string m_Name = null;
+ private string m_Base = null;
+
+ private RosPlatform m_ParentPlatform = null;
+
+ public RosPlatform()
+ {
+ m_Name = "ReactOS Core";
+ }
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public string Base
+ {
+ get { return m_Base; }
+ set { m_Base = value; }
+ }
+
+ public RosPlatform ParentPlatform
+ {
+ get { return m_ParentPlatform; }
+ set { m_ParentPlatform = value; }
+ }
+
+ public string SafeName
+ {
+ get { return Utility.GetSafeString(m_Name); }
+ }
+
+ public void SaveAs(string file)
+ {
+
+ }
+
+ public List Modules
+ {
+ get { return m_Modules; }
+ }
+
+ public List ParentModules
+ {
+ get
+ {
+ List modules = new List();
+
+ if (ParentPlatform != null)
+ {
+ foreach (RBuildModule module in ParentPlatform.Modules)
+ {
+ modules.Add(module);
+ }
+
+ foreach (RBuildModule module in ParentPlatform.ParentModules)
+ {
+ modules.Add(module);
+ }
+ }
+
+ return modules;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Obsolete/SoftwareCatalog.cs b/reactos/tools/sysgen/RosFramework/Obsolete/SoftwareCatalog.cs
new file mode 100644
index 00000000000..5169cf21a55
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Obsolete/SoftwareCatalog.cs
@@ -0,0 +1,80 @@
+using System;
+using System.Xml;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class SoftwareCatalog
+ {
+ public RBuildModuleCollection m_Modules = new RBuildModuleCollection();
+
+ public SoftwareCatalog()
+ {
+ }
+
+ public RBuildModuleCollection Modules
+ {
+ get { return m_Modules; }
+ }
+
+ public void LoadFromFile(string file)
+ {
+ XmlDocument doc = new XmlDocument();
+
+ //Load the file in to memory
+ doc.Load(file);
+
+ //Load modules ...
+ foreach (XmlNode node in doc.SelectNodes("/modules/module"))
+ {
+ RBuildModule module;
+
+ module = new RBuildModule();
+ module.Metadata = new RBuildMetadata();
+
+ module.Name = node.Attributes["name"].Value;
+ //module.Base = node.Attributes["base"].Value;
+ module.Metadata.Description = node.Attributes["desc"].Value;
+ //module.Rbuild = node.Attributes["rbuild"].Value;
+
+ /*
+ foreach (XmlNode dep in node.SelectNodes("provides/provide"))
+ {
+ string value = dep.SelectSingleNode("value").InnerText;
+ string type = dep.SelectSingleNode("type").InnerText;
+
+ module.Provides.Add(value, type);
+ }*/
+
+ m_Modules.Add(module);
+ }
+
+ foreach (XmlNode comp in doc.SelectNodes("/modules/module"))
+ {
+ // Get the component name....
+ string componentName = comp.Attributes["name"].Value;
+
+ foreach (XmlNode dep in comp.SelectNodes("dependencies/dependency"))
+ {
+ // Gets the dependency name
+ string dependencyName = dep.Attributes["name"].Value;
+
+ foreach (RBuildModule dependency in m_Modules)
+ {
+ if (dependency.Name == dependencyName)
+ {
+ foreach (RBuildModule module in m_Modules)
+ {
+ if (module.Name == componentName)
+ {
+ module.Libraries.Add(dependency);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Properties/AssemblyInfo.cs b/reactos/tools/sysgen/RosFramework/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..c9902b14d7b
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("RosFramework")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Sand")]
+[assembly: AssemblyProduct("RosFramework")]
+[assembly: AssemblyCopyright("Copyright © Sand 2007")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("bc0dfcae-52a0-41f1-83b6-df64128d52b7")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/reactos/tools/sysgen/RosFramework/RBuildAPIInfo.cs b/reactos/tools/sysgen/RosFramework/RBuildAPIInfo.cs
new file mode 100644
index 00000000000..dc175f72398
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildAPIInfo.cs
@@ -0,0 +1,37 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildAPIInfo
+ {
+ private string m_Name;
+ private string m_File;
+ private bool m_Implemented;
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public string File
+ {
+ get { return m_File; }
+ set { m_File = value; }
+ }
+
+ public bool Implemented
+ {
+ get { return m_Implemented; }
+ set { m_Implemented = value; }
+ }
+
+ public string HtmlDocFileName
+ {
+ get { return string.Format("{0}.htm", Name); }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildAuthor.cs b/reactos/tools/sysgen/RosFramework/RBuildAuthor.cs
new file mode 100644
index 00000000000..eb504b687d6
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildAuthor.cs
@@ -0,0 +1,38 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public enum AuthorRole
+ {
+ Developer,
+ Mantainer,
+ Translator
+ }
+
+ public class RBuildAuthor
+ {
+ private AuthorRole m_AuthorRole = AuthorRole.Developer;
+ private RBuildContributor m_Contributor = null;
+
+ ///
+ /// The underlying contributor.
+ ///
+ public RBuildContributor Contributor
+ {
+ get { return m_Contributor; }
+ set { m_Contributor = value; }
+ }
+
+ ///
+ /// The author role.
+ ///
+ public AuthorRole Role
+ {
+ get { return m_AuthorRole; }
+ set { m_AuthorRole = value; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildAutoRegister.cs b/reactos/tools/sysgen/RosFramework/RBuildAutoRegister.cs
new file mode 100644
index 00000000000..8bc526a5f01
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildAutoRegister.cs
@@ -0,0 +1,106 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ ///
+ /// Type of registration
+ ///
+ public enum AutoRegisterType : int
+ {
+ DllRegisterServer = 1,
+ DllInstall = 2,
+ Both = 3
+ }
+
+ public enum SetupApiFolder : int
+ {
+ SourceDrive = 1, //(the directory from which the INF file was installed)
+ OS = 10, //(%SystemRoot%)
+ System = 11, //(%SystemRoot%\system32)
+ Drivers = 12, //(%SystemRoot%\system32\drivers)
+ Inf = 17, //(%SystemRoot%\inf)
+ Help = 18, //(%SystemRoot%\Help)
+ Fonts = 20, //(%SystemRoot%\Fonts)
+ Root = 24, //(%SystemDrive%)
+ Shared = 25, //(%ALLUSERSPROFILE%\Shared Documents)
+ UserProfile = 53 //(%USERPROFILE%)
+ }
+
+ public enum SetupApiShellFolder : int
+ {
+ AllUsersApplicationData, // 16419 %ALLUSERSPROFILE%\Application Data
+ AllUsersDesktop, // 16409 %ALLUSERSPROFILE%\Desktop
+ AllUsersMyDocuments, // 16430 %ALLUSERSPROFILE%\Documents
+ AllUsersMyMusic, // 16437 %ALLUSERSPROFILE%\Documents\My Music
+ AllUsersMyPictures, // 16438 %ALLUSERSPROFILE%\Documents\My Pictures
+ AllUsersMyVideos, // 16439 %ALLUSERSPROFILE%\Documents\My Videos
+ AllUsersFavourites, // 16415 %ALLUSERSPROFILE%\Favorites
+ AllUsersStartMenu, // 16406 %ALLUSERSPROFILE%\Start Menu
+ AllUsersStartMenuPrograms, // 16407 %ALLUSERSPROFILE%\Start Menu\Programs
+ AllUsersStartMenuAdministrativeTools, // 16431 %ALLUSERSPROFILE%\Start Menu\Programs\Administrative Tools
+ AllUsersStartMenuStartup, // 16408 %ALLUSERSPROFILE%\Start Menu\Programs\Startup
+ AllUsersTemplates, // 16429 %ALLUSERSPROFILE%\Templates
+ UserApplicationData, // 16410 %USERPROFILE%\Application Data
+ UserCookies, // 16417 %USERPROFILE%\Cookies
+ UserDesktop, // 16384 %USERPROFILE%\Desktop
+ UserDesktop2, // 16400 %USERPROFILE%\Desktop
+ UserFavourites, // 16390 %USERPROFILE%\Favorites
+ UserLocalSettingsApplicationData, // 16412 %USERPROFILE%\Local Settings\Application Data
+ UserLocalSettingsMSCDBruning, // 16443 %USERPROFILE%\Local Settings\Application Data\Microsoft\CD Burning
+ UserHistory, // 16418 %USERPROFILE%\Local Settings\History
+ UserTemporaryInternetFiles, // 16416 %USERPROFILE%\Local Settings\Temporary Internet Files
+ UserMyDocuments, // 16389 %USERPROFILE%\My Documents
+ UserMyMusic, // 16397 %USERPROFILE%\My Documents\My Music
+ UserMyPictures, // 16423 %USERPROFILE%\My Documents\My Pictures
+ UserMyVideos, // 16398 %USERPROFILE%\My Documents\My Videos
+ UserNetHood, // 16403 %USERPROFILE%\NetHood
+ UserPrintHood, // 16411 %USERPROFILE%\PrintHood
+ UserRecent, // 16392 %USERPROFILE%\Recent
+ UserSendTo, // 16393 %USERPROFILE%\SendTo
+ UserStartMenu, // 16395 %USERPROFILE%\Start Menu
+ UserStartMenuPrograms, // 16386 %USERPROFILE%\Start Menu\Programs
+ UserStartMenuAdministrativeTools, // 16432 %USERPROFILE%\Start Menu\Programs\Administrative Tools
+ UserStartMenuStartup, // 16391 %USERPROFILE%\Start Menu\Programs\Startup
+ UserTemplates, // 16405 %USERPROFILE%\Templates
+ ProgramFiles, // 16422 %ProgramFiles%
+ ProgramFilesCommonFiles, // 16427 %ProgramFiles%\Common Files
+ SystenResources, // 16440 %SystemRoot%\Resources
+ SystemEnglishResources // 16441 %SystemRoot%\Resources\0409
+ }
+
+ ///
+ /// An autoregister element specifies that the generated executable should be
+ /// registered in the registry during second stage setup.
+ ///
+ public class RBuildAutoRegister
+ {
+ private AutoRegisterType m_AutoRegisterType = AutoRegisterType.Both;
+ private string m_InfSection = null;
+
+ ///
+ /// Name of section in syssetup.inf.
+ ///
+ public string InfSection
+ {
+ get { return m_InfSection; }
+ set { m_InfSection = value; }
+ }
+
+ ///
+ /// Type of registration.
+ ///
+ public AutoRegisterType Type
+ {
+ get { return m_AutoRegisterType; }
+ set { m_AutoRegisterType = value; }
+ }
+
+ public int RegistrationType
+ {
+ get { return (int)Type; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildBootstrapFile.cs b/reactos/tools/sysgen/RosFramework/RBuildBootstrapFile.cs
new file mode 100644
index 00000000000..07771b10d46
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildBootstrapFile.cs
@@ -0,0 +1,52 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ ///
+ /// A bootstrap element specifies that the generated file should
+ /// be put on the bootable CD as a bootstrap file.
+ ///
+ public class RBuildBootstrapFile : RBuildCDFileBase
+ {
+ public RBuildBootstrapFile()
+ {
+ }
+
+ public RBuildBootstrapFile(string basePath , string name)
+ {
+ Base = basePath;
+ Name = name;
+ }
+
+ //public override RBuildFile CDNewFile
+ //{
+ // get
+ // {
+ // RBuildFile file = (RBuildFile)Clone();
+
+ // file.Name = NewName;
+ // file.Base = InstallBase;
+ // file.Root = PathRoot.CDOutput;
+
+ // return file;
+ // }
+ //}
+
+ //public virtual RBuildFile CDNewFile
+ //{
+ // get
+ // {
+ // RBuildFile file = (RBuildFile)Clone();
+
+ // file.Name = NewName;
+ // file.Base = InstallBase;
+ // file.Root = PathRoot.CDOutput;
+
+ // return file;
+ // }
+ //}
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/RBuildBuildFamily.cs b/reactos/tools/sysgen/RosFramework/RBuildBuildFamily.cs
new file mode 100644
index 00000000000..24014e0e2c7
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildBuildFamily.cs
@@ -0,0 +1,25 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildBuildFamily
+ {
+ private string m_Name = null;
+ private string m_Description = null;
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public string Description
+ {
+ get { return m_Description; }
+ set { m_Description = value; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildCDFile.cs b/reactos/tools/sysgen/RosFramework/RBuildCDFile.cs
new file mode 100644
index 00000000000..e8b34f00252
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildCDFile.cs
@@ -0,0 +1,14 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ ///
+ /// A cdfile element specifies the name of a file that is to be put on the bootable CD.
+ ///
+ public class RBuildCDFile : RBuildCDFileBase
+ {
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/RBuildCDFileBase.cs b/reactos/tools/sysgen/RosFramework/RBuildCDFileBase.cs
new file mode 100644
index 00000000000..5f07e283027
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildCDFileBase.cs
@@ -0,0 +1,11 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildCDFileBase : RBuildOutputFile /*RBuildPlatformFile*/
+ {
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/RBuildCompilationUnit.cs b/reactos/tools/sysgen/RosFramework/RBuildCompilationUnit.cs
new file mode 100644
index 00000000000..2b1348b8c7b
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildCompilationUnit.cs
@@ -0,0 +1,24 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ ///
+ /// A compilationunit element specifies that one or more source code
+ /// files are to be compiled as a single compilation unit.
+ ///
+ public class RBuildCompilationUnitFile : RBuildSourceFile , IRBuildSourceFilesContainer
+ {
+ private RBuildSourceFileCollection m_SourceFiles = new RBuildSourceFileCollection();
+
+ ///
+ /// Gets the collection of .
+ ///
+ public RBuildSourceFileCollection SourceFiles
+ {
+ get { return m_SourceFiles; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildContributor.cs b/reactos/tools/sysgen/RosFramework/RBuildContributor.cs
new file mode 100644
index 00000000000..a881176f071
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildContributor.cs
@@ -0,0 +1,93 @@
+using System;
+using System.Text.RegularExpressions;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildContributor
+ {
+ private string m_FirstName = null;
+ private string m_LastName = null;
+ private string m_Alias = null;
+ private string m_City = null;
+ private string m_Country = null;
+ private string m_Mail = null;
+ private string m_Website = null;
+ private bool m_Active = true;
+
+ public string FirstName
+ {
+ get { return m_FirstName; }
+ set { m_FirstName = value; }
+ }
+
+ public string Website
+ {
+ get { return m_Website; }
+ set { m_Website = value; }
+ }
+
+ public string LastName
+ {
+ get { return m_LastName; }
+ set { m_LastName = value; }
+ }
+
+ public string Alias
+ {
+ get { return m_Mail; }
+ set { m_Mail = value; }
+ }
+
+ public string Mail
+ {
+ get { return m_Alias; }
+ set { m_Alias = value; }
+ }
+
+ public string City
+ {
+ get { return m_City; }
+ set { m_City = value; }
+ }
+
+ public string Country
+ {
+ get { return m_Country; }
+ set { m_Country = value; }
+ }
+
+ public bool Active
+ {
+ get { return m_Active; }
+ set { m_Active = value; }
+ }
+
+ public string FullName
+ {
+ get { return string.Format("{0} {1}", FirstName, LastName); }
+ }
+
+ public string HtmlDocFileName
+ {
+ get { return string.Format("{0}.htm", Alias); }
+ }
+
+ public bool HasAlias
+ {
+ get { return ((Alias != null) && (Alias.Length > 0)); }
+ }
+
+ public bool HasMail
+ {
+ get { return ((Mail != null) && (Mail.Length > 0)); }
+ }
+
+ public bool HasLocation
+ {
+ get { return ((City != null) && (City.Length > 0) && (Country != null) && (Country.Length > 0)); }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/RBuildDebugChannel.cs b/reactos/tools/sysgen/RosFramework/RBuildDebugChannel.cs
new file mode 100644
index 00000000000..6125c49bd48
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildDebugChannel.cs
@@ -0,0 +1,74 @@
+using System;
+using System.Text;
+using System.IO;
+using System.Collections.Generic;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildDebugChannel
+ {
+ private string m_Name = null;
+ private bool m_Warn = true;
+ private bool m_Error = true;
+ private bool m_Trace = false;
+ private bool m_Fixme = true;
+
+ public RBuildDebugChannel()
+ {
+ }
+
+ public RBuildDebugChannel(string name)
+ {
+ m_Name = name;
+ }
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public bool Warn
+ {
+ get { return m_Warn; }
+ set { m_Warn = value; }
+ }
+
+ public bool Error
+ {
+ get { return m_Error; }
+ set { m_Error = value; }
+ }
+
+ public bool Trace
+ {
+ get { return m_Trace; }
+ set { m_Trace = value; }
+ }
+
+ public bool Fixme
+ {
+ get { return m_Fixme; }
+ set { m_Fixme = value; }
+ }
+
+ public string Text
+ {
+ get
+ {
+ StringBuilder sBuilder = new StringBuilder();
+
+ if (Warn)
+ sBuilder.AppendFormat("warn+{0},", Name);
+ if (Error)
+ sBuilder.AppendFormat("err+{0},", Name);
+ if (Trace)
+ sBuilder.AppendFormat("trace+{0},", Name);
+ if (Fixme)
+ sBuilder.AppendFormat("fix+{0},", Name);
+
+ return sBuilder.ToString();
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildExportFunction.cs b/reactos/tools/sysgen/RosFramework/RBuildExportFunction.cs
new file mode 100644
index 00000000000..9e1868a01f5
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildExportFunction.cs
@@ -0,0 +1,47 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public enum CallingConventionType
+ {
+ None,
+ StdCall,
+ Pascal,
+ VarArgs
+ }
+
+ public class RBuildExportFunction
+ {
+ private string m_Ordinal;
+ private string m_FunctionName;
+ private CallingConventionType m_CallingConvention = CallingConventionType.None;
+ private bool m_Stub;
+
+ public string Ordinal
+ {
+ get { return m_Ordinal; }
+ set { m_Ordinal = value; }
+ }
+
+ public string FunctionName
+ {
+ get { return m_FunctionName; }
+ set { m_FunctionName = value; }
+ }
+
+ public CallingConventionType CallingConvention
+ {
+ get { return m_CallingConvention; }
+ set { m_CallingConvention = value; }
+ }
+
+ public bool IsStub
+ {
+ get { return m_Stub; }
+ set { m_Stub = value; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildFamily.cs b/reactos/tools/sysgen/RosFramework/RBuildFamily.cs
new file mode 100644
index 00000000000..067453a19df
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildFamily.cs
@@ -0,0 +1,18 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildFamily
+ {
+ private string m_FamilyName = null;
+
+ public string Name
+ {
+ get { return m_FamilyName; }
+ set { m_FamilyName = value; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildFile.cs b/reactos/tools/sysgen/RosFramework/RBuildFile.cs
new file mode 100644
index 00000000000..ed070b95ecf
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildFile.cs
@@ -0,0 +1,441 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public enum PathRoot
+ {
+ Default,
+ SourceCode,
+ Output,
+ Intermediate,
+ CDOutput,
+ Temporary,
+ Install,
+ BootCD,
+ LiveCD,
+ Platform
+ }
+
+ public enum SourceType
+ {
+ Unknown,
+ C,
+ CPP,
+ IDL,
+ Assembler,
+ NASM,
+ WineBuild,
+ WindResource,
+ MessageTable,
+ Header
+ }
+
+ public class RBuildFolder : RBuildFileSystemInfo
+ {
+ private List m_Contents = new List();
+
+ public RBuildFolder()
+ {
+ }
+
+ public RBuildFolder(RBuildFolder parentFolder , string name)
+ {
+ Root = parentFolder.Root;
+ Base = parentFolder.Base;
+ Name = name;
+ }
+
+ public RBuildFolder(PathRoot rootPath)
+ {
+ Root = rootPath;
+ //Base = ".";
+ }
+
+ public RBuildFolder (PathRoot rootPath, string basePath)
+ {
+ Root = rootPath;
+ Base = basePath;
+ }
+
+ public RBuildFolder Parent
+ {
+ get
+ {
+ RBuildFolder folder = null;
+
+ folder = new RBuildFolder();
+ folder.Base = Path.GetDirectoryName(FullPath);
+ folder.Name = "";
+ folder.Root = Root;
+
+ return folder;
+ // return new RBuildFolder(Root, Path.GetDirectoryName(Base), Name);
+ }
+ }
+
+ public List Contents
+ {
+ get { return m_Contents; }
+ }
+
+ public override string ToString()
+ {
+ return string.Format("{0} - {1}", Root, FullPath);
+ }
+ }
+
+ public class RBuildSourceFile : RBuildFile, IComparable
+ {
+ private bool m_First = false;
+ private string m_Switches = string.Empty;
+
+ public string Switches
+ {
+ get { return m_Switches; }
+ set { m_Switches = value; }
+ }
+
+ public bool First
+ {
+ get { return m_First; }
+ set { m_First = value; }
+ }
+
+ public SourceType Type
+ {
+ get
+ {
+ if (IsC)
+ return SourceType.C;
+ if (IsCPP)
+ return SourceType.CPP;
+ if (IsAssembler)
+ return SourceType.Assembler;
+ if (IsNASM)
+ return SourceType.NASM;
+ if (IsWidl)
+ return SourceType.IDL;
+ if (IsWindResource)
+ return SourceType.WindResource;
+ if (IsWineBuild)
+ return SourceType.WineBuild;
+ if (IsMessageTable)
+ return SourceType.MessageTable;
+ if (IsHeader)
+ return SourceType.Header;
+
+ return SourceType.Unknown;
+ }
+ }
+
+ public bool CompilableObject
+ {
+ get
+ {
+ if (IsWidl)
+ return false;
+ if (IsMessageTable)
+ return false;
+
+ return true;
+ }
+ }
+
+ public bool IsCPP
+ {
+ get
+ {
+ switch (Extension)
+ {
+ case ".cc":
+ case ".cpp":
+ case ".cxx":
+ return true;
+ default:
+ return false;
+ }
+ }
+ }
+
+ public bool IsWidl
+ {
+ get
+ {
+ if (Extension == ".idl")
+ return true;
+
+ return false;
+ }
+ }
+
+ public bool IsMessageTable
+ {
+ get
+ {
+ if (Extension == ".mc")
+ return true;
+
+ return false;
+ }
+ }
+
+ public bool IsHeader
+ {
+ get
+ {
+ if (Extension == ".h")
+ return true;
+
+ return false;
+ }
+ }
+
+ public bool IsWineBuild
+ {
+ get
+ {
+ if (Extension == ".spec")
+ return true;
+
+ return false;
+ }
+ }
+
+ public bool IsWindResource
+ {
+ get
+ {
+ if (Extension == ".rc")
+ return true;
+
+ return false;
+ }
+ }
+
+ public bool IsNASM
+ {
+ get
+ {
+ if (Extension == ".asm")
+ return true;
+
+ return false;
+ }
+ }
+
+ public bool IsAssembler
+ {
+ get
+ {
+ if (Extension == ".s")
+ return true;
+
+ return false;
+ }
+ }
+
+ public bool IsC
+ {
+ get
+ {
+ if (Extension == ".c")
+ return true;
+
+ return false;
+ }
+ }
+
+ public bool IsCompilable
+ {
+ get { return (IsC || IsCPP || IsAssembler || IsNASM || IsWidl || IsWindResource || IsWineBuild || IsHeader); }
+ }
+
+ public override string ToString()
+ {
+ return string.Format("{0} {1}" , Name , Type);
+ }
+
+ #region IComparable Members
+
+ public int CompareTo(object obj)
+ {
+ RBuildSourceFile source = (RBuildSourceFile)obj;
+
+ if (First != source.First)
+ {
+ if (source.First)
+ return 1;
+ else
+ return -1;
+ }
+
+ return 0;
+ }
+
+ #endregion
+ }
+
+ public class RBuildFile : RBuildFileSystemInfo
+ {
+ public RBuildFile()
+ {
+ }
+
+ public RBuildFile(RBuildElement element)
+ : base (element)
+ {
+ }
+
+ public string Extension
+ {
+ get { return Path.GetExtension(Name).Trim().ToLower(); }
+ }
+
+ public override object Clone()
+ {
+ RBuildFile file = new RBuildFile();
+
+ file.Base = Base;
+ file.Name = Name;
+ file.Root = Root;
+ file.Enabled = Enabled;
+
+ return file;
+ }
+
+ public RBuildFolder Folder
+ {
+ get { return new RBuildFolder(Root, Base); }
+ }
+ }
+
+ ///
+ /// Represents the base class for source-code , installable file , folder , include folder , cdfile taks ... from a build.
+ ///
+ public abstract class RBuildFileSystemInfo : ICloneable
+ {
+ protected RBuildElement m_Element = null;
+ protected PathRoot m_Root = PathRoot.Default;
+ protected string m_Name = string.Empty; //".";
+ protected string m_Base = string.Empty; //null;
+ protected bool m_Enabled = true;
+
+ public RBuildFileSystemInfo(RBuildElement element)
+ {
+ m_Element = element;
+ }
+
+ public RBuildFileSystemInfo()
+ {
+ }
+
+ private string NormalizePath(string path)
+ {
+ return path.Replace(
+ Path.AltDirectorySeparatorChar,
+ Path.DirectorySeparatorChar);
+ }
+
+ public string FullPath
+ {
+ get {
+
+ if (Base == null || Name == null)
+ {
+ int i = 10;
+ }
+
+ return NormalizePath(Path.Combine(Base, Name));
+ }
+ }
+
+ public string Name
+ {
+ get { return m_Name; }
+ set
+ {
+ if (value == null)
+ {
+ int i = 10;
+ }
+ m_Name = value; }
+ }
+
+ public string Base
+ {
+ get { return m_Base; }
+ set
+ {
+ if (value == null)
+ {
+ int i = 10;
+ }
+ m_Base = value;
+ }
+ }
+
+ public bool Enabled
+ {
+ get { return m_Enabled; }
+ set { m_Enabled = value; }
+ }
+
+ //TODO : ELIMINAR
+ public RBuildElement Element
+ {
+ get { return m_Element; }
+ set { m_Element = value; }
+ }
+
+ public virtual PathRoot Root
+ {
+ get { return m_Root; }
+ set { m_Root = value; }
+ }
+
+ public string[] BasePathParts
+ {
+ get { return Base.Split(new char[] { '\\' }); }
+ }
+
+ public override bool Equals(object obj)
+ {
+ if (obj is RBuildFileSystemInfo)
+ {
+ RBuildFileSystemInfo rfsInfo = obj as RBuildFileSystemInfo;
+
+ if ((rfsInfo.Base == Base) &&
+ (rfsInfo.Root == Root) &&
+ (rfsInfo.Name == Name))
+ {
+ return true;
+ }
+
+ if ((rfsInfo.FullPath == FullPath) && (rfsInfo.Root == Root))
+ {
+ return true;
+ }
+ }
+
+ // The instances are not equal
+ return false;
+ }
+
+ public override int GetHashCode()
+ {
+ return Base.GetHashCode() ^ Name.GetHashCode() ^ Root.GetHashCode ();
+ }
+
+ #region ICloneable Members
+
+ public virtual object Clone()
+ {
+ throw new Exception("The method or operation is not implemented.");
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/RBuildImportLibrary.cs b/reactos/tools/sysgen/RosFramework/RBuildImportLibrary.cs
new file mode 100644
index 00000000000..04d9508d25f
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildImportLibrary.cs
@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ ///
+ /// An importlibrary element specifies that an import library should be
+ /// generated which other modules can use to link with the current module.
+ ///
+ public sealed class RBuildImportLibrary : RBuildFile
+ {
+ private string m_DllName = null;
+
+ ///
+ /// Creates a new instance of the .
+ ///
+ public RBuildImportLibrary()
+ {
+ }
+
+ public string DllName
+ {
+ get { return m_DllName; }
+ set { m_DllName = value; }
+ }
+
+ public bool IsSpecFile
+ {
+ get { return Name.EndsWith(".spec.def"); }
+ }
+
+ public string Definition
+ {
+ get { return Name; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildInfInstallerFile.cs b/reactos/tools/sysgen/RosFramework/RBuildInfInstallerFile.cs
new file mode 100644
index 00000000000..0eec49b37ae
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildInfInstallerFile.cs
@@ -0,0 +1,18 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildInfInstallerFile : RBuildFile
+ {
+ private string m_InstallSection = "DefaultInstall";
+
+ public string InstallSection
+ {
+ get { return m_InstallSection; }
+ set { m_InstallSection = value; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/RBuildInstallFile.cs b/reactos/tools/sysgen/RosFramework/RBuildInstallFile.cs
new file mode 100644
index 00000000000..a401e126969
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildInstallFile.cs
@@ -0,0 +1,38 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildInstallFile : RBuildPlatformFile
+ {
+ }
+
+ public class RBuildWallpaperFile : RBuildInstallFile
+ {
+ private string m_ID = null;
+
+ public RBuildWallpaperFile()
+ {
+ }
+
+ public RBuildWallpaperFile(string file)
+ {
+ Name = file;
+ }
+
+ public string ID
+ {
+ get
+ {
+ if (m_ID == null ||
+ m_ID == string.Empty)
+ return base.Name;
+
+ return m_ID;
+ }
+ set { m_ID = value; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/RBuildInstallFolder.cs b/reactos/tools/sysgen/RosFramework/RBuildInstallFolder.cs
new file mode 100644
index 00000000000..acc7918b249
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildInstallFolder.cs
@@ -0,0 +1,30 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildInstallFolder : RBuildFolder
+ {
+ private string m_ID = null;
+
+ public RBuildInstallFolder()
+ {
+ Root = PathRoot.Install;
+ }
+
+ public RBuildInstallFolder(string id, string name)
+ {
+ ID = id;
+ Name = name;
+ Root = PathRoot.Install;
+ }
+
+ public string ID
+ {
+ get { return m_ID; }
+ set { m_ID = value; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildLanguage.cs b/reactos/tools/sysgen/RosFramework/RBuildLanguage.cs
new file mode 100644
index 00000000000..0e0be1389f2
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildLanguage.cs
@@ -0,0 +1,48 @@
+using System;
+using System.Globalization;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildLanguage
+ {
+ private string m_Name = null;
+ private string m_LCID = null;
+
+ private CultureInfo m_CultureInfo = null;
+
+ public RBuildLanguage()
+ {
+ }
+
+ public RBuildLanguage(string name)
+ {
+ //IsoName = name;
+ Name = name;
+ }
+
+ public string LCID
+ {
+ get { return m_LCID; }
+ set { m_LCID = value; }
+ }
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public CultureInfo CultureInfo
+ {
+ get { return m_CultureInfo; }
+ }
+
+ //public string IsoName
+ //{
+ // get { return m_CultureInfo.Name; }
+ // set { m_CultureInfo = CultureInfo.GetCultureInfo(value); }
+ //}
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildLocalizationFile.cs b/reactos/tools/sysgen/RosFramework/RBuildLocalizationFile.cs
new file mode 100644
index 00000000000..cbc46aa5c99
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildLocalizationFile.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Globalization;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildLocalizationFile : RBuildFile
+ {
+ private bool m_Dirty = false;
+ private CultureInfo m_CultureInfo = null;
+
+ public RBuildLocalizationFile()
+ {
+ }
+
+ public CultureInfo CultureInfo
+ {
+ get { return m_CultureInfo; }
+ }
+
+ public bool Dirty
+ {
+ get { return m_Dirty; }
+ set { m_Dirty = value; }
+ }
+
+ public string IsoName
+ {
+ get { return m_CultureInfo.Name; }
+ set { m_CultureInfo = CultureInfo.GetCultureInfo(value); }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/RBuildMetadata.cs b/reactos/tools/sysgen/RosFramework/RBuildMetadata.cs
new file mode 100644
index 00000000000..e828dbdc725
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildMetadata.cs
@@ -0,0 +1,18 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildMetadata
+ {
+ private string m_Description = null;
+
+ public string Description
+ {
+ get { return m_Description; }
+ set { m_Description = value; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/RBuildModule.cs b/reactos/tools/sysgen/RosFramework/RBuildModule.cs
new file mode 100644
index 00000000000..f7fcb2f504d
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildModule.cs
@@ -0,0 +1,1210 @@
+using System;
+using System.Xml;
+using System.IO;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Text;
+using System.ComponentModel;
+
+namespace SysGen.RBuild.Framework
+{
+ public enum ModuleType
+ {
+ BuildTool = 0,
+ StaticLibrary = 1,
+ ObjectLibrary = 2,
+ Kernel = 3,
+ KernelModeDLL = 4,
+ KernelModeDriver = 5,
+ NativeDLL = 6,
+ NativeCUI = 7,
+ Win32DLL = 8,
+ Win32OCX = 9,
+ Win32CUI = 10,
+ Win32GUI = 11,
+ BootLoader = 12,
+ BootSector = 13,
+ Iso = 14,
+ LiveIso = 15,
+ Test = 16,
+ RpcServer = 17,
+ RpcClient = 18,
+ Alias = 19,
+ BootProgram = 20,
+ Win32SCR = 21,
+ IdlHeader = 23,
+ IsoRegTest = 24,
+ LiveIsoRegTest = 25,
+ EmbeddedTypeLib = 26,
+ ElfExecutable = 27,
+ RpcProxy = 28,
+ HostStaticLibrary = 29,
+ Cabinet = 30,
+ Package = 50,
+ ModuleGroup = 51,
+ PlatformProfile = 52,
+ KeyboardLayout,
+ MessageHeader,
+ IdlInterface
+ }
+
+ [DefaultPropertyAttribute("Name")]
+ public class RBuildModule : RBuildElement, IRBuildSourceFilesContainer//, IRBuildInstallable
+ {
+ private string m_InstallBase = ".";
+ private string m_InstallName = null;
+ private string m_BaseAddress = null;
+ private string m_EntryPoint = null;
+ private string m_AliasOf = null;
+ private string m_Extension = null;
+ private string m_BuildType = null;
+ private string m_Description = null;
+ private string m_LCID = null;
+ private string m_CDLabel = null;
+ private string m_OutputName = null;
+ private string m_CatalogPath = null;
+
+ private ModuleType m_Type = ModuleType.Win32CUI;
+
+ protected bool m_Enabled = true;
+ protected bool m_Unicode = false;
+ protected bool m_AllowWarnings = false;
+ protected bool m_IsStartupLib = false;
+ protected bool m_UnderscoreSymbols = false;
+ protected bool m_MangledSymbols = false;
+ protected bool m_HostBuild = false;
+
+ //protected RBuildInfInstallerFile m_InfInstallComponent = null;
+ protected RBuildFile m_LinkerScript = null;
+ protected RBuildSourceFile m_PrecompiledHeader = null;
+ protected RBuildAutoRegister m_AutoRegister = null;
+ protected RBuildSetupFile m_RBuildSetup = null;
+ protected RBuildImportLibrary m_ImportLibrary = null;
+ protected RBuildMetadata m_Metadata = null;
+ //protected RBuildInstallFolder m_InstallFolder = null;
+ protected RBuildBootstrapFile m_Bootstrap = null;
+ protected RBuildModule m_BootSectorModule = null;
+
+ private RBuildFamilyCollection m_Families = new RBuildFamilyCollection();
+ private RBuildAPIStatusCollection m_ApiInfo = new RBuildAPIStatusCollection();
+ private RBuildModuleCollection m_Dependencies = new RBuildModuleCollection();
+ private RBuildModuleCollection m_Libraries = new RBuildModuleCollection();
+ private RBuildModuleCollection m_Requeriments = new RBuildModuleCollection();
+ private RBuildSourceFileCollection m_SourceFiles = new RBuildSourceFileCollection();
+ private RBuildLocalizationFileCollection m_LocalizationFiles = new RBuildLocalizationFileCollection();
+ private RBuildExportedFunctionsCollection m_ExportedFunctions = new RBuildExportedFunctionsCollection();
+ private RBuildAuthorCollection m_Authors = new RBuildAuthorCollection();
+ private List m_RegistryKeys = new List();
+ private List m_CompilationUnits = new List();
+
+ //public void GenerateFromPath(string path)
+ //{
+ // m_Base = path;
+
+ // m_Path = System.IO.Path.GetFileName(path);
+ // m_Name = System.IO.Path.GetFileName(path);
+ //}
+
+ public RBuildSourceFile PreCompiledHeader
+ {
+ get
+ {
+ foreach (RBuildSourceFile file in SourceFiles)
+ {
+ if (file.Type == SourceType.Header)
+ return file;
+ }
+
+ return null;
+ }
+ }
+
+ public RBuildFile LinkerScript
+ {
+ get { return m_LinkerScript; }
+ set { m_LinkerScript = value; }
+ }
+
+ public RBuildBootstrapFile Bootstrap
+ {
+ get { return m_Bootstrap; }
+ set { m_Bootstrap = value; }
+ }
+
+ public bool IsBootstrap
+ {
+ get { return Bootstrap != null; }
+ }
+
+ //Hack:
+ public bool IsSpecialIncludedBootStrap
+ {
+ get { return (Name == "ntdll"); }
+ }
+
+ //Hack::
+ public bool IsSpecialExcludedBootStrap
+ {
+ get { return (Name == "hal"); }
+ }
+
+ public RBuildModule BootSector
+ {
+ get { return m_BootSectorModule; }
+ set { m_BootSectorModule = value; }
+ }
+
+ //public RBuildInstallFolder InstallFolder
+ //{
+ // get { return m_InstallFolder; }
+ // set { m_InstallFolder = value; }
+ //}
+
+ public RBuildMetadata Metadata
+ {
+ get { return m_Metadata; }
+ set { m_Metadata = value; }
+ }
+
+ public string Extension
+ {
+ get
+ {
+ if ((m_Extension == null) || (m_Extension == string.Empty))
+ return DefaultExtension;
+
+ return m_Extension;
+ }
+ set { m_Extension = value; }
+ }
+
+ public string DefaultExtension
+ {
+ get
+ {
+ switch (Type)
+ {
+ case ModuleType.StaticLibrary:
+ case ModuleType.HostStaticLibrary:
+ return ".a";
+ case ModuleType.ObjectLibrary:
+ return ".o";
+ case ModuleType.Kernel:
+ case ModuleType.NativeCUI:
+ case ModuleType.Win32CUI:
+ case ModuleType.Win32GUI:
+ return ".exe";
+ case ModuleType.Win32SCR:
+ return ".scr";
+ case ModuleType.KeyboardLayout:
+ case ModuleType.KernelModeDLL:
+ case ModuleType.NativeDLL:
+ case ModuleType.Win32DLL:
+ return ".dll";
+ case ModuleType.Win32OCX:
+ return ".ocx";
+ case ModuleType.KernelModeDriver:
+ case ModuleType.BootLoader:
+ return ".sys";
+ case ModuleType.BootSector:
+ return ".o";
+ case ModuleType.Iso:
+ case ModuleType.LiveIso:
+ case ModuleType.IsoRegTest:
+ case ModuleType.LiveIsoRegTest:
+ return ".iso";
+ case ModuleType.Test:
+ return ".exe";
+ case ModuleType.RpcServer:
+ case ModuleType.RpcClient:
+ case ModuleType.RpcProxy:
+ return ".o";
+ case ModuleType.BuildTool:
+ return ".exe";
+ case ModuleType.Alias:
+ case ModuleType.BootProgram:
+ case ModuleType.IdlHeader:
+ case ModuleType.MessageHeader:
+ case ModuleType.Package:
+ case ModuleType.ModuleGroup:
+ case ModuleType.PlatformProfile:
+ return string.Empty;
+ case ModuleType.EmbeddedTypeLib:
+ return ".tlb";
+ case ModuleType.Cabinet:
+ return ".cab";
+ default:
+ throw new Exception("Unknown module type");
+ }
+ }
+ }
+
+ public string CatalogPath
+ {
+ get
+ {
+ if (m_CatalogPath == null)
+ return Folder.Parent.FullPath;
+
+ return m_CatalogPath;
+ }
+ set { m_CatalogPath = value; }
+ }
+
+ public RBuildImportLibrary ImportLibrary
+ {
+ get { return m_ImportLibrary; }
+ set { m_ImportLibrary = value; }
+ }
+
+ public string AliasOf
+ {
+ get { return m_AliasOf; }
+ set { m_AliasOf = value; }
+ }
+
+ public string BuildType
+ {
+ get
+ {
+ if (m_BuildType == null)
+ m_BuildType = "BOOTPROG";
+
+ return m_BuildType;
+ }
+ set { m_BuildType = value; }
+ }
+
+ public string BaseAddress
+ {
+ get
+ {
+ if ((m_BaseAddress == null) || (m_BaseAddress == string.Empty))
+ return DefaultBaseAdress;
+
+ return m_BaseAddress;
+ }
+ set { m_BaseAddress = value; }
+ }
+
+ public string EntryPoint
+ {
+ get
+ {
+ if (string.IsNullOrEmpty(m_EntryPoint))
+ return DefaultEntrypoint;
+
+ return m_EntryPoint;
+ }
+ set { m_EntryPoint = value; }
+ }
+
+ public bool NoEntryPoint
+ {
+ get { return (EntryPoint == "0") || (EntryPoint == "0x0"); }
+ }
+
+ public string LinkerEntryPoint
+ {
+ get
+ {
+ if (NoEntryPoint)
+ return EntryPoint;
+
+ return string.Format("_{0}", EntryPoint);
+ }
+ }
+
+ public string HtmlDocFileName
+ {
+ get { return string.Format("{0}.htm", Name); }
+ }
+
+ public bool IsDefaultBaseAdress
+ {
+ get { return (BaseAddress == DefaultBaseAdress); }
+ }
+
+ public bool IsDefaultEntryPoint
+ {
+ get { return (EntryPoint == DefaultEntrypoint); }
+ }
+
+ public bool PCH
+ {
+ get { return (PreCompiledHeader != null); }
+ }
+
+ public bool CPlusPlus
+ {
+ get
+ {
+ foreach (RBuildSourceFile file in SourceFiles)
+ {
+ if ((file.Extension == ".cpp") ||
+ (file.Extension == ".cc") ||
+ (file.Extension == ".cxx"))
+ {
+ return true;
+ }
+ }
+
+ // This module does not contain C++ code
+ return false;
+ }
+ }
+
+ public bool IsRPC
+ {
+ get
+ {
+ switch (Type)
+ {
+ case ModuleType.RpcClient:
+ case ModuleType.RpcServer:
+ case ModuleType.RpcProxy:
+ return true;
+ default:
+ return false;
+ }
+ }
+ }
+
+ public bool IsLibrary
+ {
+ get
+ {
+ switch (Type)
+ {
+ case ModuleType.StaticLibrary:
+ case ModuleType.ObjectLibrary:
+ case ModuleType.HostStaticLibrary: //HACK
+ return true;
+ default:
+ return false;
+ }
+ }
+ }
+
+ public bool HasInstallBase
+ {
+ get { return InstallBase != null; }
+ }
+
+ public bool IsInstallable
+ {
+ get { return (IsDLL) || (IsApplication); }
+ }
+
+ public bool IsApplication
+ {
+ get
+ {
+ switch (Type)
+ {
+ case ModuleType.NativeCUI:
+ case ModuleType.Win32CUI:
+ case ModuleType.Win32SCR:
+ case ModuleType.Win32GUI:
+ return true;
+ case ModuleType.KeyboardLayout:
+ case ModuleType.Kernel:
+ case ModuleType.KernelModeDLL:
+ case ModuleType.KernelModeDriver:
+ case ModuleType.NativeDLL:
+ case ModuleType.Win32DLL:
+ case ModuleType.Win32OCX:
+ case ModuleType.Test:
+ case ModuleType.BuildTool:
+ case ModuleType.HostStaticLibrary:
+ case ModuleType.StaticLibrary:
+ case ModuleType.ObjectLibrary:
+ case ModuleType.BootLoader:
+ case ModuleType.BootSector:
+ case ModuleType.BootProgram:
+ case ModuleType.Iso:
+ case ModuleType.LiveIso:
+ case ModuleType.IsoRegTest:
+ case ModuleType.LiveIsoRegTest:
+ case ModuleType.RpcServer:
+ case ModuleType.RpcClient:
+ case ModuleType.RpcProxy:
+ case ModuleType.Alias:
+ case ModuleType.IdlHeader:
+ case ModuleType.MessageHeader:
+ case ModuleType.EmbeddedTypeLib:
+ case ModuleType.Cabinet:
+ case ModuleType.Package:
+ case ModuleType.ModuleGroup:
+ case ModuleType.PlatformProfile:
+ return false;
+ default:
+ throw new Exception("Unknown Module Type");
+ }
+ }
+ }
+
+ public bool IsDLL
+ {
+ get
+ {
+ switch (Type)
+ {
+ case ModuleType.Kernel:
+ case ModuleType.KernelModeDLL:
+ case ModuleType.KernelModeDriver:
+ case ModuleType.NativeDLL:
+ case ModuleType.Win32DLL:
+ case ModuleType.Win32OCX:
+ case ModuleType.KeyboardLayout:
+ return true;
+ case ModuleType.NativeCUI:
+ case ModuleType.Win32CUI:
+ case ModuleType.Test:
+ case ModuleType.Win32SCR:
+ case ModuleType.Win32GUI:
+ case ModuleType.BuildTool:
+ case ModuleType.HostStaticLibrary:
+ case ModuleType.StaticLibrary:
+ case ModuleType.ObjectLibrary:
+ case ModuleType.BootLoader:
+ case ModuleType.BootSector:
+ case ModuleType.BootProgram:
+ case ModuleType.Iso:
+ case ModuleType.LiveIso:
+ case ModuleType.IsoRegTest:
+ case ModuleType.LiveIsoRegTest:
+ case ModuleType.RpcServer:
+ case ModuleType.RpcClient:
+ case ModuleType.RpcProxy:
+ case ModuleType.Alias:
+ case ModuleType.IdlHeader:
+ case ModuleType.MessageHeader:
+ case ModuleType.EmbeddedTypeLib:
+ case ModuleType.Cabinet:
+ case ModuleType.Package:
+ case ModuleType.ModuleGroup:
+ case ModuleType.PlatformProfile:
+ return false;
+ default:
+ throw new Exception("Unknown Module Type");
+ }
+ }
+ }
+
+ public string DefaultBaseAdress
+ {
+ get
+ {
+ switch (Type)
+ {
+ case ModuleType.Kernel:
+ return "0x80800000";
+ case ModuleType.Win32DLL:
+ case ModuleType.Win32OCX:
+ return "0x10000000";
+ case ModuleType.NativeDLL:
+ case ModuleType.NativeCUI:
+ case ModuleType.Win32CUI:
+ case ModuleType.Test:
+ return "0x00400000";
+ case ModuleType.Win32SCR:
+ case ModuleType.Win32GUI:
+ return "0x00400000";
+ case ModuleType.KeyboardLayout:
+ case ModuleType.KernelModeDLL:
+ case ModuleType.KernelModeDriver:
+ return "0x00010000";
+ case ModuleType.BuildTool:
+ case ModuleType.HostStaticLibrary:
+ case ModuleType.StaticLibrary:
+ case ModuleType.ObjectLibrary:
+ case ModuleType.BootLoader:
+ case ModuleType.BootSector:
+ case ModuleType.Iso:
+ case ModuleType.LiveIso:
+ case ModuleType.IsoRegTest:
+ case ModuleType.LiveIsoRegTest:
+ case ModuleType.RpcServer:
+ case ModuleType.RpcClient:
+ case ModuleType.RpcProxy:
+ case ModuleType.Alias:
+ case ModuleType.BootProgram:
+ case ModuleType.IdlHeader:
+ case ModuleType.MessageHeader:
+ case ModuleType.EmbeddedTypeLib:
+ case ModuleType.Cabinet:
+ case ModuleType.Package:
+ case ModuleType.ModuleGroup:
+ case ModuleType.PlatformProfile:
+ return string.Empty;
+ default:
+ throw new Exception("Unknown Module Type");
+ }
+ }
+ }
+
+ public string DefaultEntrypoint
+ {
+ get
+ {
+ switch (Type)
+ {
+ case ModuleType.Kernel:
+ return "KiSystemStartup";
+ case ModuleType.KeyboardLayout:
+ case ModuleType.KernelModeDLL:
+ case ModuleType.KernelModeDriver:
+ return "DriverEntry@8";
+ case ModuleType.NativeDLL:
+ return "DllMainCRTStartup@12";
+ case ModuleType.NativeCUI:
+ return "NtProcessStartup@4";
+ case ModuleType.Win32DLL:
+ case ModuleType.Win32OCX:
+ return "DllMain@12";
+ case ModuleType.Win32CUI:
+ case ModuleType.Test:
+ {
+ if (Unicode)
+ return "wmainCRTStartup";
+ return "mainCRTStartup";
+ }
+ case ModuleType.Win32SCR:
+ case ModuleType.Win32GUI:
+ {
+ if (Unicode)
+ return "wWinMainCRTStartup";
+ return "WinMainCRTStartup";
+ }
+ case ModuleType.HostStaticLibrary:
+ case ModuleType.BuildTool:
+ case ModuleType.StaticLibrary:
+ case ModuleType.ObjectLibrary:
+ case ModuleType.BootLoader:
+ case ModuleType.BootSector:
+ case ModuleType.Iso:
+ case ModuleType.LiveIso:
+ case ModuleType.IsoRegTest:
+ case ModuleType.LiveIsoRegTest:
+ case ModuleType.RpcServer:
+ case ModuleType.RpcClient:
+ case ModuleType.RpcProxy:
+ case ModuleType.Alias:
+ case ModuleType.BootProgram:
+ case ModuleType.IdlHeader:
+ case ModuleType.MessageHeader:
+ case ModuleType.EmbeddedTypeLib:
+ case ModuleType.Cabinet:
+ case ModuleType.Package:
+ case ModuleType.ModuleGroup:
+ case ModuleType.PlatformProfile:
+ return string.Empty;
+ default:
+ throw new Exception("Unknown Module Type");
+ }
+ }
+ }
+
+ public bool IsBuildable
+ {
+ get { return Type != ModuleType.Package && Type != ModuleType.ModuleGroup && Type != ModuleType.PlatformProfile; }
+ }
+
+ public bool IncludeInAllTarget
+ {
+ get
+ {
+ if (Type == ModuleType.BootSector ||
+ Type == ModuleType.Iso ||
+ Type == ModuleType.LiveIso ||
+ Type == ModuleType.IsoRegTest ||
+ Type == ModuleType.LiveIsoRegTest ||
+ Type == ModuleType.Test ||
+ Type == ModuleType.Alias)
+ {
+ return false;
+ }
+
+ return true;
+ }
+ }
+
+ public bool LinksToCRuntimeLibrary
+ {
+ get
+ {
+ foreach (RBuildModule module in Libraries)
+ {
+ if ((module.Name == "libcntpr") ||
+ (module.Name == "crt"))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+ }
+
+ ///
+ /// Default root to use when someone references
+ /// this module by using include
+ ///
+ public PathRoot IncludeDefaultRoot
+ {
+ get
+ {
+ switch (Type)
+ {
+ case ModuleType.RpcClient:
+ case ModuleType.RpcServer:
+ case ModuleType.RpcProxy:
+ return PathRoot.Intermediate;
+ default:
+ return PathRoot.SourceCode;
+ }
+ }
+ }
+
+ ///
+ /// Gets the folder to be used when another object
+ /// references this module
+ ///
+ public PathRoot ReferenceDefaultRoot
+ {
+ get
+ {
+ switch (Type)
+ {
+ case ModuleType.RpcClient:
+ case ModuleType.RpcServer:
+ case ModuleType.RpcProxy:
+ case ModuleType.IdlHeader:
+ case ModuleType.MessageHeader:
+ case ModuleType.BootSector:
+ case ModuleType.StaticLibrary:
+ case ModuleType.HostStaticLibrary:
+ return PathRoot.Intermediate;
+ default:
+ return PathRoot.Output;
+ }
+ }
+ }
+
+ ///
+ /// Gets the folder to be used when another objects
+ /// references the target file generated by this module
+ ///
+ public PathRoot TargetDefaultRoot
+ {
+ get
+ {
+ switch (Type)
+ {
+ case ModuleType.Iso:
+ case ModuleType.LiveIso:
+ case ModuleType.IsoRegTest:
+ case ModuleType.LiveIsoRegTest:
+ return PathRoot.Default;
+ case ModuleType.RpcClient:
+ case ModuleType.RpcServer:
+ case ModuleType.RpcProxy:
+ case ModuleType.IdlHeader:
+ case ModuleType.MessageHeader:
+ case ModuleType.BootSector:
+ case ModuleType.StaticLibrary:
+ case ModuleType.EmbeddedTypeLib:
+ case ModuleType.HostStaticLibrary:
+ return PathRoot.Intermediate;
+ default:
+ return PathRoot.Output;
+ }
+ }
+ }
+
+ public bool Enabled
+ {
+ get { return m_Enabled; }
+ set { m_Enabled = value; }
+ }
+
+ public bool MangledSymbols
+ {
+ get { return m_MangledSymbols; }
+ set { m_MangledSymbols = value; }
+ }
+
+ public bool IsStartupLib
+ {
+ get { return m_IsStartupLib; }
+ set { m_IsStartupLib = value; }
+ }
+
+ public bool UnderscoreSymbols
+ {
+ get { return m_UnderscoreSymbols; }
+ set { m_UnderscoreSymbols = value; }
+ }
+
+ public bool Unicode
+ {
+ get { return m_Unicode; }
+ set { m_Unicode = value; }
+ }
+
+ public bool AllowWarnings
+ {
+ get { return m_AllowWarnings; }
+ set { m_AllowWarnings = value; }
+ }
+
+ /*
+ public RBuildFolder Folder
+ {
+ get { return new RBuildFolder(PathRoot.SourceCode, Base); }
+ }
+ */
+
+ ///
+ /// Gets the collection of .
+ ///
+ public RBuildSourceFileCollection SourceFiles
+ {
+ get { return m_SourceFiles; }
+ set { m_SourceFiles = value; }
+ }
+
+ public RBuildLocalizationFileCollection LocalizationFiles
+ {
+ get { return m_LocalizationFiles; }
+ set { m_LocalizationFiles = value; }
+ }
+
+ public List RegistryKeys
+ {
+ get { return m_RegistryKeys; }
+ set { m_RegistryKeys = value; }
+ }
+
+ public RBuildAuthorCollection Authors
+ {
+ get { return m_Authors; }
+ set { m_Authors = value; }
+ }
+
+ public List CompilationUnits
+ {
+ get { return m_CompilationUnits; }
+ }
+
+ public RBuildExportedFunctionsCollection ExportedFunctions
+ {
+ get { return m_ExportedFunctions; }
+ }
+
+ public RBuildAPIStatusCollection ApiInfo
+ {
+ get { return m_ApiInfo; }
+ }
+
+ public RBuildFamilyCollection Families
+ {
+ get { return m_Families; }
+ }
+
+ public string ModulePath
+ {
+ get { return m_Path + @"\"; }
+ }
+
+ public RBuildFolder TargetFolder
+ {
+ get
+ {
+ RBuildFolder folder = null;
+
+ folder = new RBuildFolder();
+ folder.Root = TargetDefaultRoot;
+
+ //Las ISO son excepciones a la regla , generan su resultado en el raiz y no en la carpeta
+ //del módulo donde se encuentran
+ if (Type != ModuleType.Iso &&
+ Type != ModuleType.LiveIso &&
+ Type != ModuleType.IsoRegTest &&
+ Type != ModuleType.LiveIsoRegTest)
+ {
+ folder.Name = Folder.Name;
+ folder.Base = Folder.Base;
+ }
+
+ return folder;
+ }
+ }
+
+ public RBuildFile TargetFile
+ {
+ get
+ {
+ RBuildFile file = null;
+
+ file = new RBuildFile();
+ file.Name = TargetName;
+ file.Base = TargetFolder.FullPath;
+ file.Root = TargetFolder.Root;
+
+ return file;
+ }
+ }
+
+ public RBuildFile Install
+ {
+ get
+ {
+ RBuildFile file = null;
+
+ file = new RBuildFile();
+ file.Base = InstallBase;
+ file.Name = InstallName;
+ file.Root = PathRoot.Install;
+
+ return file;
+ }
+ }
+
+ public RBuildFile PlatformInstall
+ {
+ get
+ {
+ RBuildFile file = null;
+
+ file = new RBuildFile();
+ file.Base = "%SystemRoot%\\" + InstallBase;
+ file.Name = InstallName;
+ file.Root = PathRoot.Platform;
+
+ return file;
+ }
+ }
+
+ public RBuildFile Dependency
+ {
+ get
+ {
+ RBuildFile file = null;
+
+ file = new RBuildFile();
+ file.Base = Folder.FullPath;
+ file.Name = DependencyName;
+ file.Root = PathRoot.Intermediate; // ReferenceDefaultRoot;
+
+ return file;
+ }
+ }
+
+ public string CDLabel
+ {
+ get { return "ReactOS"; }
+ set { m_CDLabel = value; }
+ }
+
+ public string TargetName
+ {
+ get
+ {
+ if (OutputName != null)
+ return OutputName;
+
+ if (InstallName != null)
+ return InstallName;
+
+ return string.Format("{0}{1}", Name, Extension);
+ }
+ }
+
+ public string DependencyName
+ {
+ get
+ {
+ if (HasImportLibrary)
+ return string.Format("lib{0}.a" , Name);
+
+ //Get the regular name
+ return string.Format("{0}.a" , Name);
+ }
+ }
+
+ public string InstallBase
+ {
+ get { return m_InstallBase; }
+ set { m_InstallBase = value; }
+ }
+
+ public string InstallName
+ {
+ get { return m_InstallName; }
+ set { m_InstallName = value; }
+ }
+
+ public string OutputName
+ {
+ get { return m_OutputName; }
+ set { m_OutputName = value; }
+ }
+
+ public bool Host
+ {
+ get { return m_HostBuild; }
+ set { m_HostBuild = value; }
+ }
+
+ public bool HasImportLibrary
+ {
+ get { return (ImportLibrary != null) && (Type != ModuleType.StaticLibrary); }
+ }
+
+ public bool HasMessageTables
+ {
+ get
+ {
+ foreach (RBuildSourceFile source in SourceFiles)
+ if (source.Type == SourceType.MessageTable)
+ return true;
+
+ return false;
+ }
+ }
+
+ public bool HasIDLs
+ {
+ get
+ {
+ foreach (RBuildSourceFile source in SourceFiles)
+ if (source.Type == SourceType.IDL)
+ return true;
+
+ return false;
+ }
+ }
+
+ ///*
+ //public string[] BaseLocation
+ //{
+ // get { return Base.Split(new char[] { '\\' }); }
+ //}
+
+ //public string[] PathLocation
+ //{
+ // get
+ // {
+ // Uri uri = new Uri(Base , UriKind.Relative);
+
+ // return Base.Split(new char[] { '\\' });
+
+ // /*
+ // DirectoryInfo info = new DirectoryInfo(Base);
+ // return info.Parent.FullName.Split(new char[] { '\\' });
+ // */
+ // }
+ //}
+ //*/
+
+ public bool IsModuleInRoot
+ {
+ get { return Path == string.Empty; }
+ }
+
+ public string Description
+ {
+ get { return m_Description; }
+ set { m_Description = value; }
+ }
+
+ public string LCID
+ {
+ get { return m_LCID; }
+ set { m_LCID = value; }
+ }
+
+ public RBuildModuleCollection Dependencies
+ {
+ get { return m_Dependencies; }
+ }
+
+ public RBuildModuleCollection Requeriments
+ {
+ get { return m_Requeriments; }
+ }
+
+ public RBuildModuleCollection Libraries
+ {
+ get { return m_Libraries; }
+ }
+
+ public RBuildModuleCollection Needs
+ {
+ get
+ {
+ RBuildModuleCollection modules = new RBuildModuleCollection();
+
+ modules.Add(Dependencies);
+ modules.Add(Libraries);
+ modules.Add(Requeriments);
+
+ return modules;
+ }
+ }
+
+ public ModuleType Type
+ {
+ get { return m_Type; }
+ set { m_Type = value; }
+ }
+
+ public RBuildSetupFile Setup
+ {
+ get { return m_RBuildSetup; }
+ set { m_RBuildSetup = value; }
+ }
+
+ public RBuildAutoRegister AutoRegister
+ {
+ get { return m_AutoRegister; }
+ set { m_AutoRegister = value; }
+ }
+
+ public string MakeFileTargetMacro
+ {
+ get { return string.Format("$({0}_TARGET)", Name); }
+ }
+
+ public string MakeFileTarget
+ {
+ get { return string.Format("{0}_TARGET", Name); }
+ }
+
+ public string MakeFileLibs
+ {
+ get { return string.Format("{0}_LIBS", Name); }
+ }
+
+ public string MakeFileLinkDeps
+ {
+ get { return string.Format("{0}_LINKDEPS", Name); }
+ }
+
+ public string MakeFileLinkDepsMacro
+ {
+ get { return string.Format("$({0}_LINKDEPS)", Name); }
+ }
+
+ public string MakeFileLibsMacro
+ {
+ get { return string.Format("$({0}_LIBS)", Name); }
+ }
+
+ public override void SaveAs(string moduleFile)
+ {
+ // Creates an XML file is not exist
+ using (XmlTextWriter writer = new XmlTextWriter(moduleFile, Encoding.ASCII))
+ {
+ writer.Indentation = 4;
+ writer.Formatting = Formatting.Indented;
+
+ // Starts a new document
+ writer.WriteStartDocument();
+
+ writer.WriteComment("File autogenerated by RosBuilder 0.1");
+ writer.WriteStartElement("module");
+
+ writer.WriteAttributeString("name", Name);
+ writer.WriteAttributeString("type", Type.ToString());
+ writer.WriteAttributeString("installbase", InstallBase);
+ writer.WriteAttributeString("installname", InstallName);
+ writer.WriteAttributeString("unicode", Unicode.ToString());
+ writer.WriteAttributeString("allowwarnings", AllowWarnings.ToString());
+ writer.WriteAttributeString("underscoresymbols", UnderscoreSymbols.ToString());
+ writer.WriteAttributeString("baseadress", BaseAddress);
+ writer.WriteAttributeString("entrypoint", EntryPoint);
+ writer.WriteAttributeString("extension", Extension);
+ writer.WriteAttributeString("isstartuplib", IsStartupLib.ToString());
+ writer.WriteAttributeString("mangledsymbols", MangledSymbols.ToString());
+
+ writer.WriteStartElement("include");
+ writer.WriteAttributeString("base", Name);
+ writer.WriteString(".");
+ writer.WriteEndElement();
+
+ foreach (RBuildFolder include in IncludeFolders)
+ {
+ writer.WriteStartElement("include");
+ writer.WriteAttributeString("base", include.Base);
+ writer.WriteString(include.Name);
+ writer.WriteEndElement();
+ }
+
+ foreach (RBuildDefine define in Defines)
+ {
+ writer.WriteStartElement("define");
+ writer.WriteAttributeString("name", define.Name);
+
+ if (define.Name != string.Empty)
+ {
+ writer.WriteString(define.Value);
+ }
+
+ writer.WriteEndElement();
+ }
+
+ foreach (RBuildModule dependency in Dependencies)
+ {
+ writer.WriteStartElement("dependency");
+ writer.WriteString(dependency.Name);
+ writer.WriteEndElement();
+ }
+
+ foreach (RBuildModule library in Libraries)
+ {
+ writer.WriteStartElement("library");
+ writer.WriteString(library.Name);
+ writer.WriteEndElement();
+ }
+
+ foreach (RBuildSourceFile sourceFile in SourceFiles)
+ {
+ if (sourceFile.IsCompilable)
+ {
+ if (sourceFile.Switches != string.Empty)
+ {
+ writer.WriteAttributeString("switches", sourceFile.Switches);
+ }
+
+ writer.WriteStartElement("file");
+ writer.WriteString(sourceFile.Name);
+ writer.WriteEndElement();
+ }
+ }
+
+ if (PreCompiledHeader != null)
+ {
+ writer.WriteStartElement("pch");
+ writer.WriteString(PreCompiledHeader.Name);
+ writer.WriteEndElement();
+ }
+
+ writer.WriteEndDocument();
+ }
+ }
+
+ public override string ToString()
+ {
+ return string.Format("Module : '{0}' Type : {1} Base : '{2}' Libraries : '{3}' Dependencies : '{4}' Requeriments : '{5}'",
+ Name,
+ Type,
+ Base,
+ Libraries.Count,
+ Dependencies.Count,
+ Requeriments.Count);
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildModuleGroup.cs b/reactos/tools/sysgen/RosFramework/RBuildModuleGroup.cs
new file mode 100644
index 00000000000..a3c57c26c8a
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildModuleGroup.cs
@@ -0,0 +1,24 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildModuleGroup
+ {
+ private string m_Name = null;
+ private RBuildModuleCollection m_Modules = new RBuildModuleCollection();
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public RBuildModuleCollection Modules
+ {
+ get { return m_Modules; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildModuleInfo.cs b/reactos/tools/sysgen/RosFramework/RBuildModuleInfo.cs
new file mode 100644
index 00000000000..c4c944e87fc
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildModuleInfo.cs
@@ -0,0 +1,60 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildModuleInfo
+ {
+ private string m_Name = string.Empty;
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+ private string m_Base = string.Empty;
+
+ public string Base
+ {
+ get { return m_Base; }
+ set { m_Base = value; }
+ }
+ private string m_CatalogPath = string.Empty;
+
+ public string CatalogPath
+ {
+ get { return m_CatalogPath; }
+ set { m_CatalogPath = value; }
+ }
+ private ModuleType m_Type = ModuleType.BuildTool;
+
+ public ModuleType Type
+ {
+ get { return m_Type; }
+ set { m_Type = value; }
+ }
+
+ List m_Libraries = new List();
+ List m_Dependencies = new List();
+ List m_Requirements = new List();
+
+ public List Libraries
+ {
+ get { return m_Libraries; }
+ set { m_Libraries = value; }
+ }
+
+ public List Dependencies
+ {
+ get { return m_Dependencies; }
+ set { m_Dependencies = value; }
+ }
+
+ public List Requirements
+ {
+ get { return m_Requirements; }
+ set { m_Requirements = value; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildPlatform.cs b/reactos/tools/sysgen/RosFramework/RBuildPlatform.cs
new file mode 100644
index 00000000000..8940398da6e
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildPlatform.cs
@@ -0,0 +1,133 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public enum OptimizeLevelType : int
+ {
+ Level_0 = 0,
+ Level_1 = 1,
+ Level_2 = 2,
+ Level_3 = 3,
+ Level_4 = 4,
+ Level_5 = 5
+ }
+
+ public class RBuildPlatform
+ {
+ private string m_Name = "Unamed Platform";
+ private string m_Description = "This Platform has not yet a description";
+ private bool m_Debug = true;
+ private bool m_KDebug = true;
+ private bool m_GDB = false;
+ private bool m_NSWPAT = false;
+ private bool m_WINKD = false;
+ private OptimizeLevelType m_OptimizeLevelType = OptimizeLevelType.Level_1;
+ private RBuildModule m_ShellModule = null;
+ private RBuildModule m_ScreenSaverModule = null;
+ private RBuildLanguage m_Language = null;
+ private RBuildWallpaperFile m_Wallpaper = null;
+ private RBuildModuleCollection m_Modules = new RBuildModuleCollection();
+ private RBuildModuleCollection m_Autorun = new RBuildModuleCollection();
+ private RBuildLanguageCollection m_Languages = new RBuildLanguageCollection();
+ private RBuildDebugChannelCollection m_DebugChannels = new RBuildDebugChannelCollection();
+
+ public RBuildPlatform()
+ {
+ }
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public string Description
+ {
+ get { return m_Description; }
+ set { m_Description = value; }
+ }
+
+ public RBuildDebugChannelCollection DebugChannels
+ {
+ get { return m_DebugChannels; }
+ }
+
+ public RBuildModule Shell
+ {
+ get { return m_ShellModule; }
+ set { m_ShellModule = value; }
+ }
+
+ public RBuildModule Screensaver
+ {
+ get { return m_ScreenSaverModule; }
+ set { m_ScreenSaverModule = value; }
+ }
+
+ public RBuildLanguage Language
+ {
+ get { return m_Language; }
+ set { m_Language = value; }
+ }
+
+ public RBuildWallpaperFile Wallpaper
+ {
+ get { return m_Wallpaper; }
+ set { m_Wallpaper = value; }
+ }
+
+ public RBuildModuleCollection Modules
+ {
+ get { return m_Modules; }
+ }
+
+ public RBuildModuleCollection AutorunModules
+ {
+ get { return m_Autorun; }
+ }
+
+ public RBuildLanguageCollection Languages
+ {
+ get { return m_Languages; }
+ }
+
+ public bool Debug
+ {
+ get { return m_Debug; }
+ set { m_Debug = value; }
+ }
+
+ public bool KDebug
+ {
+ get { return m_KDebug; }
+ set { m_KDebug = value; }
+ }
+
+ public bool GDB
+ {
+ get { return m_GDB; }
+ set { m_GDB = value; }
+ }
+
+ public bool NSWPAT
+ {
+ get { return m_NSWPAT; }
+ set { m_NSWPAT = value; }
+ }
+
+ public bool WINKD
+ {
+ get { return m_WINKD; }
+ set { m_WINKD = value; }
+ }
+
+ public OptimizeLevelType OptimizeLevel
+ {
+ get { return m_OptimizeLevelType; }
+ set { m_OptimizeLevelType = value; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/RBuildPlatformFile.cs b/reactos/tools/sysgen/RosFramework/RBuildPlatformFile.cs
new file mode 100644
index 00000000000..2e300fd4f30
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildPlatformFile.cs
@@ -0,0 +1,84 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildOutputFile : RBuildFile //, IRBuildInstallable
+ {
+ private string m_InstallBase = "."; //".";
+ private string m_NewName = null;
+
+ public string NewName
+ {
+ get
+ {
+ if (m_NewName == null)
+ return m_Name;
+ return m_NewName;
+ }
+ set { m_NewName = value; }
+ }
+
+ public string InstallBase
+ {
+ get { return m_InstallBase; }
+ set { m_InstallBase = value; }
+ }
+
+ public virtual RBuildFile CDNewFile
+ {
+ get
+ {
+ RBuildFile file = (RBuildFile)Clone();
+
+ file.Name = NewName;
+ file.Base = InstallBase;
+ file.Root = PathRoot.CDOutput;
+
+ return file;
+ }
+ }
+
+ public virtual RBuildFile NewFile
+ {
+ get
+ {
+ RBuildFile file = (RBuildFile)Clone();
+
+ file.Name = NewName;
+ file.Base = InstallBase;
+ file.Root = Root;
+
+ return file;
+ }
+ }
+ }
+
+ public class RBuildPlatformFile : RBuildOutputFile
+ {
+ //protected RBuildInstallFolder m_InstallFolder = null;
+
+ //public RBuildInstallFolder InstallFolder
+ //{
+ // get { return m_InstallFolder; }
+ // set { m_InstallFolder = value; }
+ //}
+
+ public RBuildFile PlatformInstall
+ {
+ get
+ {
+ RBuildFile file = null;
+
+ file = new RBuildFile();
+ file.Base = "%SystemRoot%\\" + InstallBase;
+ file.Name = Name;
+ file.Root = PathRoot.Platform;
+
+ return file;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildProject.cs b/reactos/tools/sysgen/RosFramework/RBuildProject.cs
new file mode 100644
index 00000000000..c771b923d95
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildProject.cs
@@ -0,0 +1,163 @@
+using System;
+using System.Text;
+using System.Xml;
+using System.Collections.Generic;
+
+namespace SysGen.RBuild.Framework
+{
+ ///
+ /// There can be one project per top-level XML build file.
+ /// A project can only be defined in a top-level xml build file.
+ ///
+ public class RBuildProject : RBuildElement
+ {
+ private RBuildContributorCollection m_Contributors = new RBuildContributorCollection();
+ private RBuildModuleCollection m_Modules = new RBuildModuleCollection();
+ private RBuildLanguageCollection m_Languages = new RBuildLanguageCollection();
+ private RBuildInstallFolderCollection m_InstallFolders = new RBuildInstallFolderCollection();
+ private RBuildBuildFamilyCollection m_BuildFamilies = new RBuildBuildFamilyCollection();
+ private RBuildPlatform m_Platform = new RBuildPlatform();
+ private RBuildDebugChannelCollection m_DebugChannels = new RBuildDebugChannelCollection();
+
+ private string m_PackagesFile = "obj-i386/reactos.dff";
+ private string m_MakeFile = "makefile.auto";
+
+ public RBuildProject()
+ {
+ Folder = new RBuildFolder(PathRoot.SourceCode);
+ }
+
+ ///
+ /// Filename of the GNU makefile that is to be created.
+ ///
+ public string MakeFile
+ {
+ get { return m_MakeFile; }
+ set { m_MakeFile = value; }
+ }
+
+ public string PackagesFile
+ {
+ get { return m_PackagesFile; }
+ set { m_PackagesFile = value; }
+ }
+
+ public RBuildDebugChannelCollection DebugChannels
+ {
+ get { return m_DebugChannels; }
+ }
+
+ public RBuildPlatform Platform
+ {
+ get { return m_Platform; }
+ set { m_Platform = value; }
+ }
+
+ public RBuildBuildFamilyCollection BuildFamilies
+ {
+ get { return m_BuildFamilies; }
+ set { m_BuildFamilies = value; }
+ }
+
+ public RBuildInstallFolderCollection InstallFolders
+ {
+ get { return m_InstallFolders; }
+ set { m_InstallFolders = value; }
+ }
+
+ public RBuildContributorCollection Contributors
+ {
+ get { return m_Contributors; }
+ set { m_Contributors = value; }
+ }
+
+ public RBuildModuleCollection Modules
+ {
+ get { return m_Modules; }
+ }
+
+ public RBuildLanguageCollection Languages
+ {
+ get { return m_Languages; }
+ }
+
+ public string MakeFileGCCOptions
+ {
+ get { return string.Format("{0}_GCCOPTIONS", Name); }
+ }
+
+ public string MakeFileGCCOptionsMacro
+ {
+ get { return string.Format("$({0}_GCCOPTIONS)", Name); }
+ }
+
+ public override void SaveAs(string projectFile)
+ {
+ // Creates an XML file is not exist
+ using (XmlTextWriter writer = new XmlTextWriter(projectFile, Encoding.ASCII))
+ {
+ writer.Indentation = 4;
+ writer.Formatting = Formatting.Indented;
+
+ // Starts a new document
+ writer.WriteStartDocument();
+ writer.WriteStartElement("project");
+ writer.WriteAttributeString("name", Name);
+ writer.WriteAttributeString("makefile", MakeFile);
+ writer.WriteAttributeString("xmlns", "xi", null, "http://www.w3.org/2001/XInclude");
+
+ /*
+ writer.WriteComment("Generic Properties");
+ foreach (KeyValuePair property in Properties)
+ {
+ writer.WriteStartElement("property");
+ writer.WriteAttributeString("name", property.Key);
+ writer.WriteAttributeString("value", property.Value);
+ writer.WriteEndElement();
+ }
+
+ foreach (string define in Defines)
+ {
+ writer.WriteStartElement("define");
+ writer.WriteAttributeString("name", define);
+ writer.WriteEndElement();
+ }*/
+
+ writer.WriteStartElement("xi:include");
+ writer.WriteAttributeString("href", "baseaddress.rbuild");
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("xi:include");
+ writer.WriteAttributeString("href", "boot/bootdata/bootdata.rbuild");
+ writer.WriteEndElement();
+
+ writer.WriteElementString("compilerflag", "-Os");
+ writer.WriteElementString("compilerflag", "-ftracer");
+ writer.WriteElementString("compilerflag", "-momit-leaf-frame-pointer");
+ writer.WriteElementString("compilerflag", "-mpreferred-stack-boundary=2");
+
+ writer.WriteElementString("compilerflag", "-Wno-strict-aliasing");
+ writer.WriteElementString("compilerflag", "-Wpointer-arith");
+ writer.WriteElementString("linkerflag", "-enable-stdcall-fixup");
+
+ foreach (RBuildFolder folder in IncludeFolders)
+ {
+ writer.WriteStartElement("include");
+ writer.WriteAttributeString("root", folder.Root.ToString());
+ writer.WriteString(folder.Name);
+ writer.WriteEndElement();
+ }
+
+ foreach (RBuildModule module in Modules)
+ {
+ writer.WriteStartElement("xi:include");
+ writer.WriteAttributeString("href", module.RBuildFile);
+ writer.WriteEndElement();
+ }
+
+ writer.WriteEndElement(); //Project
+ writer.WriteEndDocument();
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildProperty.cs b/reactos/tools/sysgen/RosFramework/RBuildProperty.cs
new file mode 100644
index 00000000000..bbc996f00e0
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildProperty.cs
@@ -0,0 +1,104 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildProperty : RBuildValueKey
+ {
+ public RBuildProperty(string name, string value)
+ : base(name, value)
+ {
+ }
+
+ public RBuildProperty(string name, string value, bool readOnly)
+ : base(name, value, readOnly)
+ {
+ }
+
+ public RBuildProperty(string name, string value, bool readOnly, bool isInternal)
+ : base(name, value, readOnly, isInternal)
+ {
+ }
+ }
+
+ public class RBuildBaseAdress : RBuildProperty
+ {
+ public RBuildBaseAdress(string name, string value)
+ : base(name, value, true)
+ {
+ }
+ }
+
+ public class RBuildDefine : RBuildValueKey
+ {
+ public RBuildDefine(string name)
+ : base(name, string.Empty, true)
+ {
+ }
+
+ public RBuildDefine(string name, string value)
+ : base(name, value, true)
+ {
+ }
+ }
+
+ public abstract class RBuildValueKey
+ {
+ protected string m_Name = null;
+ protected string m_Value = null;
+ protected bool m_ReadOnly = false;
+ protected bool m_IsInternal = false;
+
+ public RBuildValueKey(string name, string value)
+ {
+ m_Name = name;
+ m_Value = value;
+ }
+
+ public RBuildValueKey(string name, string value, bool readOnly)
+ {
+ m_Name = name;
+ m_Value = value;
+ m_ReadOnly = readOnly;
+ }
+
+ public RBuildValueKey(string name, string value, bool readOnly, bool isInternal)
+ {
+ m_Name = name;
+ m_Value = value;
+ m_ReadOnly = readOnly;
+ m_IsInternal = isInternal;
+ }
+
+ public bool IsEmpty
+ {
+ get { return string.IsNullOrEmpty(Value); }
+ }
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public string Value
+ {
+ get { return m_Value; }
+ set { m_Value = value; }
+ }
+
+ public bool ReadOnly
+ {
+ get { return m_ReadOnly; }
+ set { m_ReadOnly = value; }
+ }
+
+ public bool Internal
+ {
+ get { return m_IsInternal; }
+ set { m_IsInternal = value; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildRegistryKey.cs b/reactos/tools/sysgen/RosFramework/RBuildRegistryKey.cs
new file mode 100644
index 00000000000..2f573be5409
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildRegistryKey.cs
@@ -0,0 +1,67 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using Microsoft.Win32;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildRegistryKey
+ {
+ private bool m_Enabled = true;
+ private bool m_LiveCD = true;
+ private bool m_BootCD = true;
+
+ private string m_KeyName = null;
+ private string m_KeyValue = null;
+
+ private RegistryHive m_RegistryHive = RegistryHive.ClassesRoot;
+ private RegistryValueKind m_RegistryValueKind = RegistryValueKind.Unknown;
+
+ public RBuildRegistryKey()
+ {
+ }
+
+ public bool LiveCD
+ {
+ get { return m_LiveCD; }
+ set { m_LiveCD = value; }
+ }
+
+ public bool BootCD
+ {
+ get { return m_BootCD; }
+ set { m_BootCD = value; }
+ }
+
+ public bool Enabled
+ {
+ get { return m_Enabled; }
+ set { m_Enabled = value; }
+ }
+
+ public string KeyName
+ {
+ get { return m_KeyName; }
+ set { m_KeyName = value; }
+ }
+
+ public string KeyValue
+ {
+ get { return m_KeyValue; }
+ set { m_KeyValue = value; }
+ }
+
+ public RegistryHive RegistryHive
+ {
+ get { return m_RegistryHive; }
+ set { m_RegistryHive = value; }
+ }
+
+ public RegistryValueKind RegistryValueKind
+ {
+ get { return m_RegistryValueKind; }
+ set { m_RegistryValueKind = value; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildSetup.cs b/reactos/tools/sysgen/RosFramework/RBuildSetup.cs
new file mode 100644
index 00000000000..42dc5c18ed7
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildSetup.cs
@@ -0,0 +1,52 @@
+//using System;
+//using System.IO;
+//using System.Collections.Generic;
+//using System.Text;
+
+//namespace SysGen.RBuild.Framework
+//{
+// public enum SetupType
+// {
+// Device,
+// Component
+// }
+
+// public class RBuildSetup : RBuildPlatformFile
+// {
+// private SetupType m_SetupType = SetupType.Component;
+// private bool m_InstallAlways = true;
+// private string m_InstallSection = "DefaultInstall";
+
+// public SetupType SetupType
+// {
+// get { return m_SetupType; }
+// set { m_SetupType = value; }
+// }
+
+// public string InstallSection
+// {
+// get { return m_InstallSection; }
+// set { m_InstallSection = value; }
+// }
+
+// public string DefaultInstallSection
+// {
+// get
+// {
+// switch (SetupType)
+// {
+// case SetupType.Device:
+// return "DefaultInstall";
+// default:
+// return "DefaultInstall";
+// }
+// }
+// }
+
+// public bool InstallAlways
+// {
+// get { return m_InstallAlways; }
+// set { m_InstallAlways = value; }
+// }
+// }
+//}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildSetupFile.cs b/reactos/tools/sysgen/RosFramework/RBuildSetupFile.cs
new file mode 100644
index 00000000000..6bd9aee38c9
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildSetupFile.cs
@@ -0,0 +1,52 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public enum SetupType
+ {
+ Device,
+ Component
+ }
+
+ public class RBuildSetupFile : RBuildPlatformFile
+ {
+ private SetupType m_SetupType = SetupType.Component;
+ private bool m_InstallAlways = true;
+ private string m_InstallSection = "DefaultInstall";
+
+ public SetupType SetupType
+ {
+ get { return m_SetupType; }
+ set { m_SetupType = value; }
+ }
+
+ public string InstallSection
+ {
+ get { return m_InstallSection; }
+ set { m_InstallSection = value; }
+ }
+
+ public string DefaultInstallSection
+ {
+ get
+ {
+ switch (SetupType)
+ {
+ case SetupType.Device:
+ return "DefaultInstall";
+ default:
+ return "DefaultInstall";
+ }
+ }
+ }
+
+ public bool InstallAlways
+ {
+ get { return m_InstallAlways; }
+ set { m_InstallAlways = value; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildSolution.cs b/reactos/tools/sysgen/RosFramework/RBuildSolution.cs
new file mode 100644
index 00000000000..32d10134769
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildSolution.cs
@@ -0,0 +1,21 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildSolution
+ {
+ private List m_Projects = null;
+
+ ///
+ /// The projects this solution contains.
+ ///
+ public List Projects
+ {
+ get { return m_Projects; }
+ set { m_Projects = value; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildTarget.cs b/reactos/tools/sysgen/RosFramework/RBuildTarget.cs
new file mode 100644
index 00000000000..adf726165e3
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildTarget.cs
@@ -0,0 +1,274 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public enum TargetType
+ {
+ LiveCD,
+ BootCD
+ }
+
+ public enum TargetDebugOutputType
+ {
+ COM1,
+ COM2,
+ Screen,
+ Bochs
+ }
+
+ public enum TargetDebugType
+ {
+ None,
+ Debug,
+ KernelDebug
+ }
+
+ public enum TargetWindowsPlatformType
+ {
+ WindowsNT4 = 0x400,
+ Windows2000 = 0x500,
+ WindowsXP = 0x501,
+ Windows2003 = 0x0502,
+ WindowsVista = 0x600
+ }
+
+ public enum TargetWindowsSPType
+ {
+ NoServicePack,
+ ServicePack1 = 0x100,
+ ServicePack2 = 0x200,
+ ServicePack3 = 0x300,
+ ServicePack4 = 0x400,
+ ServicePack5 = 0x500,
+ ServicePack6 = 0x600,
+ ServicePack7 = 0x700,
+ ServicePack8 = 0x800,
+ ServicePack9 = 0x900
+ }
+
+ public enum TargetPlatformType
+ {
+ NT4, /* Windows NT 4.0 */
+ NT4_SP1,
+ NT4_SP2,
+ NT4_SP3,
+ NT4_SP4,
+ NT4_SP5,
+ NT4_SP6,
+ NT5, /* Windows 2000 */
+ NT5_SP1,
+ NT5_SP2,
+ NT5_SP3,
+ NT5_SP4,
+ NT51, /* Windows XP */
+ NT51_SP1,
+ NT51_SP2,
+ NT52, /* Windows 2003 */
+ NT52_SP1,
+ NT52_SP2,
+ NT6 /* Windows Vista */
+ }
+
+ public enum TargetArchitectureType
+ {
+ X86,
+ X86_i486,
+ X86_i586,
+ X86_Pentium,
+ X86_Pentium2,
+ X86_Pentium3,
+ X86_Pentium4,
+ X86_AthlonXP,
+ X86_AthlonMP,
+ X86_Xbox,
+ PPC
+ }
+
+ public enum TargetOptimizeLevelType
+ {
+ Level_0,
+ Level_1,
+ Level_2,
+ Level_3,
+ Level_4,
+ Level_5
+ }
+
+ public class RBuildTarget
+ {
+ private string m_Name = null;
+
+ private bool m_RegTest = false;
+ private bool m_Multiprocessor = false;
+
+ private TargetType m_Type = TargetType.BootCD;
+ private TargetDebugType m_DebugType = TargetDebugType.None;
+ private TargetPlatformType m_PlatformType = TargetPlatformType.NT5_SP4;
+ private TargetDebugOutputType m_DebugOutputType = TargetDebugOutputType.COM1;
+ private TargetArchitectureType m_ArchitectureType = TargetArchitectureType.X86_Pentium;
+ private TargetOptimizeLevelType m_OptimizeLevelType = TargetOptimizeLevelType.Level_1;
+
+ public RBuildTarget()
+ {
+ }
+
+ public RBuildTarget(string name)
+ {
+ m_Name = name;
+ }
+
+ public RBuildTarget(string name, TargetType type)
+ {
+ m_Name = name;
+ m_Type = type;
+ }
+
+ public RBuildTarget(string name, TargetType type, TargetDebugType debugType)
+ {
+ m_Name = name;
+ m_Type = type;
+ m_DebugType = debugType;
+ }
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public bool MultiProcessor
+ {
+ get { return m_Multiprocessor; }
+ set { m_Multiprocessor = value; }
+ }
+
+ public bool RegressionTest
+ {
+ get { return m_RegTest; }
+ set { m_RegTest = value; }
+ }
+
+ public bool Debug
+ {
+ get { return ((DebugType == TargetDebugType.Debug) || (DebugType == TargetDebugType.KernelDebug)); }
+ }
+
+ public bool KernelDebug
+ {
+ get { return (DebugType == TargetDebugType.KernelDebug); }
+ }
+
+ public TargetType Type
+ {
+ get { return m_Type; }
+ set { m_Type = value; }
+ }
+
+ public TargetDebugType DebugType
+ {
+ get { return m_DebugType; }
+ set { m_DebugType = value; }
+ }
+
+ public TargetDebugOutputType DebugOutputType
+ {
+ get { return m_DebugOutputType; }
+ set { m_DebugOutputType = value; }
+ }
+
+ public TargetPlatformType PlatformType
+ {
+ get { return m_PlatformType; }
+ set { m_PlatformType = value; }
+ }
+
+ public TargetArchitectureType ArchitectureType
+ {
+ get { return m_ArchitectureType; }
+ set { m_ArchitectureType = value; }
+ }
+
+ public TargetOptimizeLevelType OptimizeType
+ {
+ get { return m_OptimizeLevelType; }
+ set { m_OptimizeLevelType = value; }
+ }
+
+ public TargetWindowsSPType WindowsServicePack
+ {
+ get
+ {
+ switch (PlatformType)
+ {
+ case TargetPlatformType.NT4:
+ case TargetPlatformType.NT5:
+ case TargetPlatformType.NT51:
+ case TargetPlatformType.NT52:
+ case TargetPlatformType.NT6:
+ return TargetWindowsSPType.NoServicePack;
+ case TargetPlatformType.NT4_SP1:
+ case TargetPlatformType.NT5_SP1:
+ case TargetPlatformType.NT51_SP1:
+ case TargetPlatformType.NT52_SP1:
+ return TargetWindowsSPType.ServicePack1;
+ case TargetPlatformType.NT4_SP2:
+ case TargetPlatformType.NT5_SP2:
+ case TargetPlatformType.NT51_SP2:
+ case TargetPlatformType.NT52_SP2:
+ return TargetWindowsSPType.ServicePack2;
+ case TargetPlatformType.NT4_SP3:
+ case TargetPlatformType.NT5_SP3:
+ return TargetWindowsSPType.ServicePack3;
+ case TargetPlatformType.NT4_SP4:
+ case TargetPlatformType.NT5_SP4:
+ return TargetWindowsSPType.ServicePack4;
+ case TargetPlatformType.NT4_SP5:
+ return TargetWindowsSPType.ServicePack5;
+ case TargetPlatformType.NT4_SP6:
+ return TargetWindowsSPType.ServicePack6;
+ default:
+ throw new Exception("");
+ }
+ }
+ }
+
+ public TargetWindowsPlatformType WindowsPlatfom
+ {
+ get
+ {
+ switch (PlatformType)
+ {
+ case TargetPlatformType.NT4:
+ case TargetPlatformType.NT4_SP1:
+ case TargetPlatformType.NT4_SP2:
+ case TargetPlatformType.NT4_SP3:
+ case TargetPlatformType.NT4_SP4:
+ case TargetPlatformType.NT4_SP5:
+ case TargetPlatformType.NT4_SP6:
+ return TargetWindowsPlatformType.WindowsNT4;
+ case TargetPlatformType.NT5:
+ case TargetPlatformType.NT5_SP1:
+ case TargetPlatformType.NT5_SP2:
+ case TargetPlatformType.NT5_SP3:
+ case TargetPlatformType.NT5_SP4:
+ return TargetWindowsPlatformType.Windows2000;
+ case TargetPlatformType.NT51:
+ case TargetPlatformType.NT51_SP1:
+ case TargetPlatformType.NT51_SP2:
+ return TargetWindowsPlatformType.WindowsXP;
+ case TargetPlatformType.NT52:
+ case TargetPlatformType.NT52_SP1:
+ case TargetPlatformType.NT52_SP2:
+ return TargetWindowsPlatformType.Windows2003;
+ case TargetPlatformType.NT6:
+ return TargetWindowsPlatformType.WindowsVista;
+ default:
+ throw new Exception("");
+ }
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildUnAttendSetup.cs b/reactos/tools/sysgen/RosFramework/RBuildUnAttendSetup.cs
new file mode 100644
index 00000000000..a240dbda757
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildUnAttendSetup.cs
@@ -0,0 +1,102 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public enum InstallType : int
+ {
+ SkipMBRInstall = 0,
+ FloppyMBRInstall = 1,
+ HDDMBRInstall = 2
+ }
+
+ public class RBuildUnAttendSetup
+ {
+ private InstallType m_InstallType = InstallType.HDDMBRInstall;
+ private int m_DestinationDiskNumber = 0;
+ private int m_DestinationPartitionNumber = 1;
+ private bool m_FormatPartition;
+ private bool m_AutoPartition;
+ private bool m_DisableVmwDriverInstall;
+ private bool m_Enabled = false;
+ private string m_InstallDirectory;
+ private string m_FullName;
+ private string m_OrgName;
+ private string m_ComputerName;
+ private string m_AdminPassword;
+
+ public InstallType InstallType
+ {
+ get { return m_InstallType; }
+ set { m_InstallType = value; }
+ }
+
+ public int DestinationDiskNumber
+ {
+ get { return m_DestinationDiskNumber; }
+ set { m_DestinationDiskNumber = value; }
+ }
+
+ public int DestinationPartitionNumber
+ {
+ get { return m_DestinationPartitionNumber; }
+ set { m_DestinationPartitionNumber = value; }
+ }
+
+ public string InstallDirectory
+ {
+ get { return m_InstallDirectory; }
+ set { m_InstallDirectory = value; }
+ }
+
+ public string FullName
+ {
+ get { return m_FullName; }
+ set { m_FullName = value; }
+ }
+
+ public string OrgName
+ {
+ get { return m_OrgName; }
+ set { m_OrgName = value; }
+ }
+
+ public string ComputerName
+ {
+ get { return m_ComputerName; }
+ set { m_ComputerName = value; }
+ }
+
+ public string AdminPassword
+ {
+ get { return m_AdminPassword; }
+ set { m_AdminPassword = value; }
+ }
+
+ public bool FormatPartition
+ {
+ get { return m_FormatPartition; }
+ set { m_FormatPartition = value; }
+ }
+
+ public bool AutoPartition
+ {
+ get { return m_AutoPartition; }
+ set { m_AutoPartition = value; }
+ }
+
+ public bool DisableVmwDriverInstall
+ {
+ get { return m_DisableVmwDriverInstall; }
+ set { m_DisableVmwDriverInstall = value; }
+ }
+
+ public bool Enabled
+ {
+ get { return m_Enabled; }
+ set { m_Enabled = value; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/SysGen.RBuild.Framework.csproj b/reactos/tools/sysgen/RosFramework/SysGen.RBuild.Framework.csproj
new file mode 100644
index 00000000000..6ccaf2fe069
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/SysGen.RBuild.Framework.csproj
@@ -0,0 +1,117 @@
+
+
+ Debug
+ AnyCPU
+ 9.0.30729
+ 2.0
+ {88D9BED7-30C5-4683-A6C6-6F2EB55B8F26}
+ Library
+ Properties
+ SysGen.RBuild.Framework
+ SysGen.RBuild.Framework
+
+
+ 2.0
+
+
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/SysGen.RBuild.Framework.csproj.user b/reactos/tools/sysgen/RosFramework/SysGen.RBuild.Framework.csproj.user
new file mode 100644
index 00000000000..6a34e7dcdf5
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/SysGen.RBuild.Framework.csproj.user
@@ -0,0 +1,5 @@
+
+
+ ShowAllFiles
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SYSGen/Backends/Backend.cs b/reactos/tools/sysgen/SYSGen/Backends/Backend.cs
new file mode 100644
index 00000000000..849137aa76d
--- /dev/null
+++ b/reactos/tools/sysgen/SYSGen/Backends/Backend.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SYSGen.Backends
+{
+ public abstract class Backend
+ {
+ }
+}
diff --git a/reactos/tools/sysgen/SYSGen/Backends/Catalog/CatalogBackend.cs b/reactos/tools/sysgen/SYSGen/Backends/Catalog/CatalogBackend.cs
new file mode 100644
index 00000000000..52bd011dd41
--- /dev/null
+++ b/reactos/tools/sysgen/SYSGen/Backends/Catalog/CatalogBackend.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SYSGen.Backends;
+
+namespace SYSGen.Backends.Catalog
+{
+ class CatalogBackend : Backend
+ {
+ }
+}
diff --git a/reactos/tools/sysgen/SYSGen/Backends/Mingw/MingwBackend.cs b/reactos/tools/sysgen/SYSGen/Backends/Mingw/MingwBackend.cs
new file mode 100644
index 00000000000..73c2ae3a7bd
--- /dev/null
+++ b/reactos/tools/sysgen/SYSGen/Backends/Mingw/MingwBackend.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SYSGen.Backends;
+
+namespace SYSGen.Backends.Mingw
+{
+ class MingwBackend : Backend
+ {
+ }
+}
diff --git a/reactos/tools/sysgen/SYSGen/Program.cs b/reactos/tools/sysgen/SYSGen/Program.cs
new file mode 100644
index 00000000000..c49fc075055
--- /dev/null
+++ b/reactos/tools/sysgen/SYSGen/Program.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SYSGen
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SYSGen/Properties/AssemblyInfo.cs b/reactos/tools/sysgen/SYSGen/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..04c75a90f62
--- /dev/null
+++ b/reactos/tools/sysgen/SYSGen/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("SYSGen")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Sand")]
+[assembly: AssemblyProduct("SYSGen")]
+[assembly: AssemblyCopyright("Copyright © Sand 2007")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("eb4b0be6-5b08-4933-b932-61bf335383db")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/reactos/tools/sysgen/SYSGen/SYSGen.csproj b/reactos/tools/sysgen/SYSGen/SYSGen.csproj
new file mode 100644
index 00000000000..93452a30484
--- /dev/null
+++ b/reactos/tools/sysgen/SYSGen/SYSGen.csproj
@@ -0,0 +1,56 @@
+
+
+ Debug
+ AnyCPU
+ 8.0.50727
+ 2.0
+ {5AEA291F-D79C-4FC1-AA60-96C591658B85}
+ Exe
+ Properties
+ SYSGen
+ sysgen
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {88D9BED7-30C5-4683-A6C6-6F2EB55B8F26}
+ RosFramework
+
+
+
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/BuildElementArrayAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/BuildElementArrayAttribute.cs
new file mode 100644
index 00000000000..3e2e2155fe8
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/BuildElementArrayAttribute.cs
@@ -0,0 +1,33 @@
+// NAnt - A .NET build tool
+// Copyright (C) 2001 Gerry Shaw
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// Ian MacLean ( ian@maclean.ms )
+
+namespace SysGen.BuildEngine.Attributes
+{
+ using System;
+ using System.Reflection;
+
+ /// Indicates that property should be treated as a xml arrayList for the task.
+ [AttributeUsage(AttributeTargets.Property, Inherited=true)]
+ public class BuildElementArrayAttribute : BuildElementAttribute {
+
+ public BuildElementArrayAttribute(string name) : base(name) {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/BuildElementAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/BuildElementAttribute.cs
new file mode 100644
index 00000000000..5b453a063f2
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/BuildElementAttribute.cs
@@ -0,0 +1,50 @@
+// NAnt - A .NET build tool
+// Copyright (C) 2001 Gerry Shaw
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// Ian MacLean ( ian@maclean.ms )
+
+namespace SysGen.BuildEngine.Attributes
+{
+
+ using System;
+ using System.Reflection;
+
+ /// Indicates that field should be treated as a xml file set for the task.
+ [AttributeUsage(AttributeTargets.Property, Inherited=true)]
+ public class BuildElementAttribute : Attribute
+ {
+
+ string _name;
+ bool _required;
+
+ public BuildElementAttribute(string name)
+ {
+ Name = name;
+ }
+
+ public string Name
+ {
+ get { return _name; }
+ set { _name = value; }
+ }
+ public bool Required
+ {
+ get { return _required; }
+ set { _required = value; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/ElementNameAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/ElementNameAttribute.cs
new file mode 100644
index 00000000000..a52f72ef520
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/ElementNameAttribute.cs
@@ -0,0 +1,45 @@
+// NAnt - A .NET build tool
+// Copyright (C) 2001 Gerry Shaw
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// Ian MacLean (ian_maclean@another.com)
+
+namespace SysGen.BuildEngine.Attributes {
+
+ using System;
+ using System.Reflection;
+
+ /// Indicates that class should be treated as a NAnt element.
+ ///
+ /// Attach this attribute to a subclass of Element to have NAnt be able
+ /// to recognize it. The name should be short but must not confict
+ /// with any other element already in use.
+ ///
+ [AttributeUsage(AttributeTargets.Class, Inherited=false, AllowMultiple=false)]
+ public class ElementNameAttribute : Attribute {
+
+ string _name;
+
+ public ElementNameAttribute(string name) {
+ _name = name;
+ }
+
+ public string Name {
+ get { return _name; }
+ set { _name = value; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/FunctionAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/FunctionAttribute.cs
new file mode 100644
index 00000000000..506cab8a400
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/FunctionAttribute.cs
@@ -0,0 +1,60 @@
+namespace SysGen.BuildEngine.Attributes
+{
+ using System;
+ using System.Reflection;
+
+ ///
+ /// Indicates that the method should be exposed as a function in NAnt build
+ /// files.
+ ///
+ ///
+ /// Attach this attribute to a method of a class that derives from
+ /// to have NAnt be able to recognize it.
+ ///
+ [AttributeUsage(AttributeTargets.Method, Inherited=false, AllowMultiple=false)]
+ public sealed class FunctionAttribute : Attribute {
+ #region Public Instance Constructors
+
+ ///
+ /// Initializes a new instance of the
+ /// class with the specified name.
+ ///
+ /// The name of the function.
+ /// is .
+ /// is a zero-length .
+ public FunctionAttribute(string name) {
+ if (name == null) {
+ throw new ArgumentNullException("name");
+ }
+
+ if (name.Trim().Length == 0) {
+ throw new ArgumentOutOfRangeException("name", name, "A zero-length string is not an allowed value.");
+ }
+
+ _name = name;
+ }
+
+ #endregion Public Instance Constructors
+
+ #region Public Instance Properties
+
+ ///
+ /// Gets or sets the name of the function.
+ ///
+ ///
+ /// The name of the function.
+ ///
+ public string Name {
+ get { return _name; }
+ set { _name = value; }
+ }
+
+ #endregion Public Instance Properties
+
+ #region Private Instance Fields
+
+ private string _name;
+
+ #endregion Private Instance Fields
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/FunctionSetAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/FunctionSetAttribute.cs
new file mode 100644
index 00000000000..0ac033f07e0
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/FunctionSetAttribute.cs
@@ -0,0 +1,90 @@
+namespace SysGen.BuildEngine.Attributes
+{
+ using System;
+ using System.Reflection;
+
+ ///
+ /// Indicates that class should be treated as a set of functions.
+ ///
+ ///
+ /// Attach this attribute to a class that derives from
+ /// to have NAnt be able to recognize it as containing custom functions.
+ ///
+ [AttributeUsage(AttributeTargets.Class, Inherited=false, AllowMultiple=false)]
+ public sealed class FunctionSetAttribute : Attribute {
+ #region Public Instance Constructors
+
+ ///
+ /// Initializes a new instance of the
+ /// class with the specified name.
+ ///
+ /// The prefix used to distinguish the functions.
+ /// The category of the functions.
+ ///
+ /// is .
+ /// -or-
+ /// is .
+ ///
+ ///
+ /// is a zero-length .
+ /// -or-
+ /// is a zero-length .
+ ///
+ public FunctionSetAttribute(string prefix, string category) {
+ if (prefix == null) {
+ throw new ArgumentNullException("prefix");
+ }
+ if (category == null) {
+ throw new ArgumentNullException("category");
+ }
+
+ if (prefix.Trim().Length == 0) {
+ throw new ArgumentOutOfRangeException("prefix", prefix, "A zero-length string is not an allowed value.");
+ }
+ if (category.Trim().Length == 0) {
+ throw new ArgumentOutOfRangeException("category", category, "A zero-length string is not an allowed value.");
+ }
+
+ _prefix = prefix;
+ _category = category;
+ }
+
+ #endregion Public Instance Constructors
+
+ #region Public Instance Properties
+
+ ///
+ /// Gets or sets the category of the function set.
+ ///
+ ///
+ /// The name of the category of the function set.
+ ///
+ ///
+ /// This will be displayed in the user docs.
+ ///
+ public string Category {
+ get { return _category; }
+ set { _category = value; }
+ }
+
+ ///
+ /// Gets or sets the prefix of all functions in this function set.
+ ///
+ ///
+ /// The prefix of the functions in this function set.
+ ///
+ public string Prefix {
+ get { return _prefix; }
+ set { _prefix = value; }
+ }
+
+ #endregion Public Instance Properties
+
+ #region Private Instance Fields
+
+ private string _prefix;
+ private string _category;
+
+ #endregion Private Instance Fields
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskAttributeAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskAttributeAttribute.cs
new file mode 100644
index 00000000000..3242801bf09
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskAttributeAttribute.cs
@@ -0,0 +1,43 @@
+namespace SysGen.BuildEngine.Attributes
+{
+ using System;
+ using System.Reflection;
+
+ /// Indicates that field should be treated as a xml attribute for the task.
+ ///
+ /// Examples of how to specify task attributes
+ ///
+ /// // task XmlType default is string
+ /// [TaskAttribute("out", Required=true)]
+ /// string _out = null; // assign default value here
+ ///
+ /// [TaskAttribute("optimize")]
+ /// [BooleanValidator()]
+ /// // during ExecuteTask you can safely use Convert.ToBoolean(_optimize)
+ /// string _optimize = Boolean.FalseString;
+ ///
+ /// [TaskAttribute("warnlevel")]
+ /// [Int32Validator(0,4)] // limit values to 0-4
+ /// // during ExecuteTask you can safely use Convert.ToInt32(_optimize)
+ /// string _warnlevel = "0";
+ ///
+ /// [FileSet("sources")]
+ /// FileSet _sources = new FileSet();
+ ///
+ /// NOTE: Attribute values must be of type of string if you want
+ /// to be able to have macros. The field stores the exact value during
+ /// InitializeTask. Just before ExecuteTask is called NAnt will expand
+ /// all the macros with the current values.
+ ///
+ [AttributeUsage( AttributeTargets.Property, Inherited=true)]
+ public class TaskAttributeAttribute : TaskPropertyAttribute {
+
+ public TaskAttributeAttribute(string name) : base(name){
+ }
+
+ public override TaskPropertyLocation Location
+ {
+ get { return TaskPropertyLocation.Attribute; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskFileSetAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskFileSetAttribute.cs
new file mode 100644
index 00000000000..fd9ad0cad05
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskFileSetAttribute.cs
@@ -0,0 +1,33 @@
+// NAnt - A .NET build tool
+// Copyright (C) 2001 Gerry Shaw
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// Gerry Shaw (gerry_shaw@yahoo.com)
+// Ian MacLean ( ian@maclean.ms )
+
+namespace SysGen.BuildEngine.Attributes {
+
+ using System;
+ using System.Reflection;
+
+ /// Indicates that field should be treated as a xml file set for the task.
+ [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited=true)]
+ public class FileSetAttribute : BuildElementAttribute {
+
+ public FileSetAttribute(string name) : base(name) {
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskNameAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskNameAttribute.cs
new file mode 100644
index 00000000000..d46357f6892
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskNameAttribute.cs
@@ -0,0 +1,46 @@
+namespace SysGen.BuildEngine.Attributes
+{
+ using System;
+ using System.Reflection;
+
+ /// Indicates that class should be treated as a task.
+ ///
+ /// Attach this attribute to a subclass of Task to have NAnt be able
+ /// to recognize it. The name should be short but must not confict
+ /// with any other task already in use.
+ ///
+ [AttributeUsage(AttributeTargets.Class, Inherited=false, AllowMultiple=false)]
+ public class TaskNameAttribute : Attribute
+ {
+ private string m_Namespace = null;
+ private string m_Name = null;
+
+ public TaskNameAttribute(string name)
+ {
+ m_Name = name;
+ }
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public string Namespace
+ {
+ get { return m_Namespace; }
+ set { m_Namespace = value; }
+ }
+
+ public string FullTaskName
+ {
+ get
+ {
+ if (Namespace != null)
+ return string.Format("{0}:{1}", Namespace, Name);
+
+ return Name;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskOptionSetAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskOptionSetAttribute.cs
new file mode 100644
index 00000000000..c62c48f3312
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskOptionSetAttribute.cs
@@ -0,0 +1,32 @@
+// NAnt - A .NET build tool
+// Copyright (C) 2001 Gerry Shaw
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// Tomas Restrepo (tomasr@mvps.org)
+
+namespace SysGen.BuildEngine.Attributes {
+
+ using System;
+ using System.Reflection;
+
+ /// Indicates that field should be treated as a xml option set for the task.
+ [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited=true)]
+ public class OptionSetAttribute : BuildElementAttribute {
+
+ public OptionSetAttribute(string name) : base(name) {
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskPropertyAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskPropertyAttribute.cs
new file mode 100644
index 00000000000..6ee83ec2058
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskPropertyAttribute.cs
@@ -0,0 +1,66 @@
+using System;
+using System.Reflection;
+
+namespace SysGen.BuildEngine.Attributes
+{
+ public enum TaskPropertyLocation
+ {
+ Attribute,
+ Node
+ }
+
+ /// Indicates that field should be treated as a xml attribute for the task.
+ ///
+ /// Examples of how to specify task attributes
+ ///
+ /// // task XmlType default is string
+ /// [BuildAttribute("out", Required=true)]
+ /// string _out = null; // assign default value here
+ ///
+ /// [BuildAttribute("optimize")]
+ /// [BooleanValidator()]
+ /// // during ExecuteTask you can safely use Convert.ToBoolean(_optimize)
+ /// string _optimize = Boolean.FalseString;
+ ///
+ /// [BuildAttribute("warnlevel")]
+ /// [Int32Validator(0,4)] // limit values to 0-4
+ /// // during ExecuteTask you can safely use Convert.ToInt32(_optimize)
+ /// string _warnlevel = "0";
+ ///
+ /// [FileSet("sources")]
+ /// FileSet _sources = new FileSet();
+ ///
+ /// NOTE: Attribute values must be of type of string if you want
+ /// to be able to have macros. The field stores the exact value during
+ /// InitializeTask. Just before ExecuteTask is called NAnt will expand
+ /// all the macros with the current values.
+ ///
+ [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field , Inherited=true)]
+ public abstract class TaskPropertyAttribute : Attribute
+ {
+ string _name;
+ bool _required = false;
+ bool _expandProperties = true;
+
+ public TaskPropertyAttribute(string name) {
+ _name = name;
+ }
+
+ public string Name {
+ get { return _name; }
+ set { _name = value; }
+ }
+
+ public bool Required {
+ get { return _required; }
+ set { _required = value; }
+ }
+
+ public bool ExpandProperties {
+ get { return _expandProperties; }
+ set { _expandProperties = value; }
+ }
+
+ public abstract TaskPropertyLocation Location { get; }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskValueAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskValueAttribute.cs
new file mode 100644
index 00000000000..9a00b764e17
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskValueAttribute.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Reflection;
+
+namespace SysGen.BuildEngine.Attributes
+{
+ [AttributeUsage(AttributeTargets.Property, Inherited = true)]
+ public class TaskValueAttribute : TaskPropertyAttribute
+ {
+ public TaskValueAttribute()
+ : base(null)
+ {
+ }
+
+ public override TaskPropertyLocation Location
+ {
+ get { return TaskPropertyLocation.Node; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/Base/ValidatorAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/Base/ValidatorAttribute.cs
new file mode 100644
index 00000000000..21592caa508
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/Base/ValidatorAttribute.cs
@@ -0,0 +1,16 @@
+namespace SysGen.BuildEngine.Attributes
+{
+ using System;
+ using System.Reflection;
+
+ public abstract class ValidatorAttribute : Attribute
+ {
+ ///
+ /// Validates the object.
+ ///
+ /// The object to be validated
+ /// Throws a ValidationException when validation fails.
+ /// Returns an indication of the result.
+ public abstract bool Validate(object value);
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/BooleanValidatorAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/BooleanValidatorAttribute.cs
new file mode 100644
index 00000000000..a77c4044db3
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/BooleanValidatorAttribute.cs
@@ -0,0 +1,21 @@
+namespace SysGen.BuildEngine.Attributes
+{
+ using System;
+ using System.Reflection;
+
+ ///
+ /// Indicates that field should be able to be converted into a Boolean.
+ ///
+ [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property , Inherited=true)]
+ public class BooleanValidatorAttribute : ValidatorAttribute
+ {
+ public BooleanValidatorAttribute()
+ {
+ }
+
+ public override bool Validate(object value)
+ {
+ return SysGenConversion.ToBolean(value);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/Int32ValidatorAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/Int32ValidatorAttribute.cs
new file mode 100644
index 00000000000..0336016ff3d
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/Int32ValidatorAttribute.cs
@@ -0,0 +1,54 @@
+using System;
+using System.Reflection;
+
+namespace SysGen.BuildEngine.Attributes
+{
+ ///
+ /// Indicates that field should be able to be converted into a Int32 within the given range.
+ ///
+ [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited = true)]
+ public class Int32ValidatorAttribute : ValidatorAttribute
+ {
+ int _minValue = Int32.MinValue;
+ int _maxValue = Int32.MaxValue;
+
+ public Int32ValidatorAttribute()
+ {
+ }
+
+ public Int32ValidatorAttribute(int minValue, int maxValue)
+ {
+ MinValue = minValue;
+ MaxValue = maxValue;
+ }
+
+ public int MinValue
+ {
+ get { return _minValue; }
+ set { _minValue = value; }
+ }
+
+ public int MaxValue
+ {
+ get { return _maxValue; }
+ set { _maxValue = value; }
+ }
+
+ public override bool Validate(object value)
+ {
+ try
+ {
+ Int32 intValue = Convert.ToInt32(value);
+ if (intValue < MinValue || intValue > MaxValue)
+ {
+ throw new ValidationException(String.Format("Cannot resolve '{0}' to integer between '{1}' and '{2}'.", value.ToString(), MinValue, MaxValue));
+ }
+ }
+ catch (Exception)
+ {
+ throw new ValidationException(String.Format("Cannot resolve '{0}' to integer value.", value.ToString()));
+ }
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/StringValidatorAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/StringValidatorAttribute.cs
new file mode 100644
index 00000000000..be617dee875
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/StringValidatorAttribute.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Reflection;
+
+namespace SysGen.BuildEngine.Attributes
+{
+ [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited = true)]
+ public class StringValidatorAttribute : ValidatorAttribute
+ {
+ private bool m_AllowEmpty = true;
+ private bool m_AllowSpaces = true;
+
+ public override bool Validate(object value)
+ {
+ if (!AllowSpaces && string.Equals(value, " "))
+ throw new ValidationException("No spaces allowed");
+
+ if (!AllowEmpty && value.ToString().Length == 0)
+ throw new ValidationException("No empty string allowed");
+
+ return true;
+ }
+
+ public bool AllowEmpty
+ {
+ get { return m_AllowEmpty; }
+ set { m_AllowEmpty = value; }
+ }
+
+ public bool AllowSpaces
+ {
+ get { return m_AllowSpaces; }
+ set { m_AllowSpaces = value; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/UriValidatorAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/UriValidatorAttribute.cs
new file mode 100644
index 00000000000..54da6e52690
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/UriValidatorAttribute.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Reflection;
+
+namespace SysGen.BuildEngine.Attributes
+{
+ ///
+ /// Indicates that field should be able to be converted into a Uri.
+ ///
+ [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited = true)]
+ public class UriValidatorAttribute : ValidatorAttribute
+ {
+ public override bool Validate(object value)
+ {
+ try
+ {
+ Uri uriValue = new Uri(value.ToString(), UriKind.Relative);
+ }
+ catch (Exception)
+ {
+ throw new ValidationException(String.Format("Cannot resolve '{0}' to Uri.", value.ToString()));
+ }
+
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/APIDocumentation/APIDocumentation.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/APIDocumentation/APIDocumentation.cs
new file mode 100644
index 00000000000..330f3d65ef6
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/APIDocumentation/APIDocumentation.cs
@@ -0,0 +1,395 @@
+using System;
+using System.Text.RegularExpressions;
+using System.Web.UI;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Tasks;
+using SysGen.BuildEngine.Backends;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class APIDocumentation : HtmlDocumenterBaseBacked
+ {
+ public APIDocumentation(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ if (Directory.Exists(@"C:\rosLib"))
+ Directory.Delete(@"C:\rosLib", true);
+
+ Directory.CreateDirectory(@"C:\rosLib");
+
+ File.Copy(@"c:\style.css", @"c:\rosLib\style.css");
+ }
+
+ protected override string FriendlyName
+ {
+ get { return "APIDocumentation Report"; }
+ }
+
+ private void WriteModuleFunctions()
+ {
+ foreach (RBuildModule module in Project.Modules)
+ {
+ if (module.IsDLL || module.IsLibrary)
+ {
+ foreach (RBuildAPIInfo apiInfo in module.ApiInfo)
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\roslib\" + apiInfo.HtmlDocFileName))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Module");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("{0} Function", apiInfo.Name);
+ writer.RenderEndTag();
+
+ if (apiInfo.Implemented)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Function '{0}' on '{1}' is currently implemented.",
+ apiInfo.Name,
+ apiInfo.File);
+ writer.RenderEndTag();
+ }
+ else
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Function '{0}' on '{1}' is currently un-implemented.",
+ apiInfo.Name,
+ apiInfo.File);
+ writer.RenderEndTag();
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private void WriteModules()
+ {
+ foreach (RBuildModule module in Project.Modules)
+ {
+ if (module.IsDLL || module.IsLibrary)
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\roslib\" + module.HtmlDocFileName))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Module");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("{0}", module.Name);
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Module {0} has a total of {1} functions , {2} implemented and {3} un-implemented ({4}%)",
+ module.Name,
+ module.ApiInfo.TotalFunctions,
+ module.ApiInfo.ImplementedFunctionsCount,
+ module.ApiInfo.UnImplementedFunctionsCount,
+ module.ApiInfo.Percentage);
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("{0} Functions", module.Name);
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildAPIInfo apiInfo in module.ApiInfo)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute("href", apiInfo.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(apiInfo.Name);
+ writer.RenderEndTag();
+
+ if (!apiInfo.Implemented)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.B);
+ writer.Write("(UnImplemented)");
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ }
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+ }
+ }
+
+ private void WriteWelcome()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\roslib\welcome.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Warnings");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("ReactOS API Documentation");
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Welcome to the ReactOS API documentation website.");
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H1);
+ writer.Write("Implementation status Color Key");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Cellpadding, "5");
+ writer.AddAttribute(HtmlTextWriterAttribute.Cellspacing, "0");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ for (int i = 0; i <= 100; i = i + 5)
+ {
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct" + i);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write("{0}%" , i);
+ writer.RenderEndTag();
+ }
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Native DLLs");
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildModule module in Project.Modules)
+ {
+ if (module.Type == ModuleType.NativeDLL)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute("href", module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Win32 DLLs");
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildModule module in Project.Modules)
+ {
+ if (module.Type == ModuleType.Win32DLL)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute("href", module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void WriteHeader()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\roslib\header.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ writer.WriteLine("ReactOS API Documentation
");
+ }
+ }
+ }
+
+ private void WriteFrameSet()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\roslib\default.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ writer.WriteLine("");
+ }
+ }
+ }
+
+ private void ReadApiStatusFile()
+ {
+ XmlDocument doc = new XmlDocument();
+
+ //Load the file in to memory
+ doc.Load(@"C:\Ros\clean\reactos\apistatus.xml");
+
+ foreach (XmlNode comp in doc.SelectNodes("/components/component"))
+ {
+ // Get the component name....
+ string modulename = comp.Attributes["name"].InnerText;
+
+ RBuildModule module = Project.Modules.GetByName(modulename);
+
+ if (module != null)
+ {
+ foreach (XmlNode dep in comp.SelectNodes("functions/f"))
+ {
+ // Gets the dependency name
+ string name = dep.Attributes["n"].InnerText;
+ string file = dep.Attributes["f"].InnerText;
+ bool imp = Boolean.Parse(dep.Attributes["i"].InnerText);
+
+ RBuildAPIInfo apiInfo = new RBuildAPIInfo();
+
+ apiInfo.Name = name;
+ apiInfo.File = file;
+ apiInfo.Implemented = imp;
+
+ module.ApiInfo.Add(apiInfo);
+ }
+ }
+ }
+ }
+
+ protected override void Generate()
+ {
+ ReadApiStatusFile();
+ WriteFrameSet();
+ WriteHeader();
+ WriteWelcome();
+ WriteModules();
+ WriteModuleFunctions();
+
+ using (StreamWriter sw = new StreamWriter(@"C:\roslib\tree.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Warnings");
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Cellpadding, "2");
+ writer.AddAttribute(HtmlTextWriterAttribute.Cellspacing, "2");
+ writer.AddAttribute(HtmlTextWriterAttribute.Border, "0");
+ //writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ foreach (RBuildModule module in Project.Modules)
+ {
+ if ((module.IsDLL) || (module.IsLibrary))
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+
+ if ((module.ApiInfo.Percentage >= 0) && (module.ApiInfo.Percentage <= 5))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct0");
+ if ((module.ApiInfo.Percentage >= 5) && (module.ApiInfo.Percentage <= 10))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct5");
+ if ((module.ApiInfo.Percentage >= 10) && (module.ApiInfo.Percentage <= 15))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct10");
+ if ((module.ApiInfo.Percentage >= 15) && (module.ApiInfo.Percentage <= 20))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct15");
+ if ((module.ApiInfo.Percentage >= 20) && (module.ApiInfo.Percentage <= 25))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct20");
+ if ((module.ApiInfo.Percentage >= 25) && (module.ApiInfo.Percentage <= 30))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct25");
+ if ((module.ApiInfo.Percentage >= 30) && (module.ApiInfo.Percentage <= 35))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct30");
+ if ((module.ApiInfo.Percentage >= 35) && (module.ApiInfo.Percentage <= 40))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct35");
+ if ((module.ApiInfo.Percentage >= 40) && (module.ApiInfo.Percentage <= 45))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct40");
+ if ((module.ApiInfo.Percentage >= 45) && (module.ApiInfo.Percentage <= 50))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct45");
+ if ((module.ApiInfo.Percentage >= 50) && (module.ApiInfo.Percentage <= 55))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct50");
+ if ((module.ApiInfo.Percentage >= 55) && (module.ApiInfo.Percentage <= 60))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct55");
+ if ((module.ApiInfo.Percentage >= 60) && (module.ApiInfo.Percentage <= 65))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct60");
+ if ((module.ApiInfo.Percentage >= 65) && (module.ApiInfo.Percentage <= 70))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct65");
+ if ((module.ApiInfo.Percentage >= 70) && (module.ApiInfo.Percentage <= 75))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct70");
+ if ((module.ApiInfo.Percentage >= 75) && (module.ApiInfo.Percentage <= 80))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct75");
+ if ((module.ApiInfo.Percentage >= 80) && (module.ApiInfo.Percentage <= 85))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct80");
+ if ((module.ApiInfo.Percentage >= 85) && (module.ApiInfo.Percentage <= 90))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct85");
+ if ((module.ApiInfo.Percentage >= 90) && (module.ApiInfo.Percentage <= 95))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct90");
+ if ((module.ApiInfo.Percentage >= 95) && (module.ApiInfo.Percentage <= 100))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct100");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+
+ if (module.ApiInfo.Count > 0)
+ {
+ writer.AddAttribute("href", module.HtmlDocFileName);
+ writer.AddAttribute("target", "content");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.Name);
+ writer.RenderEndTag();
+
+ writer.Write(" (I:{0} U:{1} P:{2}%)",
+ module.ApiInfo.ImplementedFunctionsCount,
+ module.ApiInfo.UnImplementedFunctionsCount,
+ module.ApiInfo.Percentage);
+ }
+ else
+ {
+ writer.Write(module.Name);
+ }
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ if (module.ApiInfo.Count > 0)
+ {
+ foreach (RBuildAPIInfo apiInfo in module.ApiInfo)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute("href", apiInfo.HtmlDocFileName);
+ writer.AddAttribute("target", "content");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(apiInfo.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ else
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.Write("No documentation available yet");
+ writer.RenderEndTag();
+ }
+ writer.RenderEndTag();
+
+
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Base/Backend.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Base/Backend.cs
new file mode 100644
index 00000000000..5811c6fc253
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Base/Backend.cs
@@ -0,0 +1,81 @@
+using System;
+using System.Reflection;
+using System.Diagnostics;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Log;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public abstract class Backend
+ {
+ private SysGenEngine m_SysGenEngine = null;
+
+ public Backend(SysGenEngine sysgen)
+ {
+ m_SysGenEngine = sysgen;
+ }
+
+ public SysGenEngine SysGen
+ {
+ get { return m_SysGenEngine; }
+ }
+
+ public RBuildProject Project
+ {
+ get { return m_SysGenEngine.Project; }
+ }
+
+ public string AppInfo
+ {
+ get { return string.Format("{0} {1}", AppName, AppVersion); }
+ }
+
+ public string AppName
+ {
+ get { return "SysGen"; }
+ }
+
+ public string AppVersion
+ {
+ get
+ {
+ FileVersionInfo info = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
+
+ return string.Format("{0}.{1}.{2}",
+ info.FileMajorPart,
+ info.FileMinorPart,
+ info.FileBuildPart);
+ }
+ }
+
+ protected abstract string FriendlyName { get;}
+ //protected abstract string Name { get;}
+
+ public void Run()
+ {
+ BuildLog.WriteLine();
+ BuildLog.Write("[Backend] {0} running ...", FriendlyName);
+
+ try
+ {
+ //Run current Backend
+ Generate();
+
+ //Report OK
+ BuildLog.Write("{0,30}", "[OK]");
+ }
+ catch (Exception e)
+ {
+ //Report OK
+ BuildLog.Write("{0,30}", "[FAIL]");
+ throw;
+ }
+ }
+
+ protected abstract void Generate();
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Base/CompilerBaseBacked.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Base/CompilerBaseBacked.cs
new file mode 100644
index 00000000000..9c1d05417e9
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Base/CompilerBaseBacked.cs
@@ -0,0 +1,160 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.BuildEngine.Framework;
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public abstract class CompilerBaseBacked : Backend
+ {
+ public CompilerBaseBacked(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ //Initialize();
+ }
+
+ protected override void Generate()
+ {
+ CheckCompiler();
+ GenerateRosCfg();
+ GenerateFolders();
+ //GenerateBuildNumber();
+ //GenerateCompilationUnits();
+ GenerateTxtSetupCustomHive();
+ GenerateSysSetup();
+ GenerateTxtSetup();
+ GenerateDffSetup();
+ }
+
+ protected virtual void GenerateCompilationUnits()
+ {
+ foreach (RBuildModule module in SysGen.Project.Modules)
+ {
+ foreach (RBuildCompilationUnitFile unit in module.CompilationUnits)
+ {
+ using (CompilationUnitFileWriter writer = new CompilationUnitFileWriter(module , unit , SysGen.ResolveRBuildFilePath(unit)))
+ {
+ writer.WriteFile();
+ }
+ }
+ }
+ }
+
+ protected virtual void GenerateRosCfg()
+ {
+ Directory.CreateDirectory (Project.Path + "\\obj-i386\\include\\reactos");
+
+ using (HeaderRosCfgFileWriter writer = new HeaderRosCfgFileWriter(SysGen.Project, Project.Path + "\\obj-i386\\include\\reactos\\roscfg.h"))
+ {
+ writer.WriteFile();
+ }
+ }
+
+ protected virtual void GenerateDffSetup()
+ {
+ using (DffFileWriter writer = new DffFileWriter(Project, Project.Path + "\\obj-i386\\reactos.dff"))
+ {
+ writer.WriteFile();
+ }
+ }
+
+ protected virtual void GenerateBuildNumber()
+ {
+ using (DffFileWriter writer = new DffFileWriter(SysGen.Project, "c:\\buildno.h"))
+ {
+ writer.WriteFile();
+ }
+ }
+
+ protected virtual void GenerateTxtSetup()
+ {
+ using (TxtSetupFileWriter writer = new TxtSetupFileWriter(SysGen.Project, "c:\\txtsetup.sif"))
+ {
+ writer.WriteFile();
+ }
+ }
+
+ protected virtual void GenerateTxtSetupCustomHive()
+ {
+ //using (DesktopComponentSetupFileWriter writer = new DesktopComponentSetupFileWriter(SysGen.Project, Project.Path + "\\output-i386\\wallpaper.inf"))
+ //{
+ // writer.WriteFile();
+
+ // RBuildSetup s = new RBuildSetup();
+
+ // s.InstallBase = "inf";
+ // s.Name = "wallpaper.inf";
+ // s.Root = PathRoot.Output;
+
+ // Project.Files.Add(s);
+ //}
+
+ //using (ShellComponentSetupFileWriter writer = new ShellComponentSetupFileWriter(SysGen.Project, Project.Path + "\\output-i386\\shell.inf"))
+ //{
+ // writer.WriteFile();
+
+ // RBuildSetup s1 = new RBuildSetup();
+
+ // s1.InstallBase = "inf";
+ // s1.Name = "shell.inf";
+ // s1.Root = PathRoot.Output;
+
+ // Project.Files.Add(s1);
+ //}
+
+ using (TxtSetupHiveFileWriter writer = new TxtSetupHiveFileWriter(SysGen.Project, Project.Path + "\\output-i386\\hivecst.inf"))
+ {
+ writer.WriteFile();
+ }
+
+ RBuildBootstrapFile bs = new RBuildBootstrapFile();
+
+ bs.InstallBase = "reactos";
+ bs.Name = "hivecst.inf";
+ bs.Root = PathRoot.Output;
+
+ Project.Files.Add(bs);
+ }
+
+ protected virtual void GenerateSysSetup()
+ {
+ Directory.CreateDirectory(Project.Path + "\\output-i386\\media\\inf");
+
+ using (SysSetupFileWriter writer = new SysSetupFileWriter(SysGen.Project, Project.Path + "\\output-i386\\media\\inf\\syssetup.inf"))
+ {
+ writer.WriteFile();
+ }
+ }
+
+ private void GenerateFolders()
+ {
+ //foreach (RBuildModule module in Project.Modules)
+ //{
+ // foreach (RBuildFolder folder in module.Folders)
+ // {
+ // if (folders.Contains(folder) == false)
+ // folders.Add(folder);
+ // }
+ //}
+
+ //foreach (RBuildFolder folder in Project.Folders)
+ //{
+ // if (folders.Contains(folder) == false)
+ // folders.Add(folder);
+ //}
+
+ //foreach (RBuildFolder folder in folders)
+ //{
+ // GenerateFolder(makefile, folder);
+ //}
+ }
+
+ protected virtual void CheckCompiler()
+ {
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Base/HtmlDocumenterBaseBacked.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Base/HtmlDocumenterBaseBacked.cs
new file mode 100644
index 00000000000..aac5117de0d
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Base/HtmlDocumenterBaseBacked.cs
@@ -0,0 +1,97 @@
+using System;
+using System.Web.UI;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Framework;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public abstract class HtmlDocumenterBaseBacked : Backend
+ {
+ public HtmlDocumenterBaseBacked(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ }
+
+ public string ReportFileExtension
+ {
+ get { return "htm"; }
+ }
+
+ protected string GetHtmlFileName(IRBuildNamed namedObject)
+ {
+ return string.Format("{0}.{1}",
+ namedObject.Name,
+ ReportFileExtension);
+ }
+
+ protected void WriteDocumentStart(HtmlTextWriter writer, string title)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Html);//
+ writer.RenderBeginTag(HtmlTextWriterTag.Head);//
+ writer.RenderBeginTag(HtmlTextWriterTag.Title); //
+ writer.Write(title);
+ writer.RenderEndTag(); //
+ writer.AddAttribute(HtmlTextWriterAttribute.Rel, "stylesheet");
+ writer.AddAttribute(HtmlTextWriterAttribute.Type, "text/css");
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "style.css");
+ writer.RenderBeginTag(HtmlTextWriterTag.Link);
+ writer.RenderEndTag();
+
+ writer.RenderEndTag(); //
+ writer.RenderBeginTag(HtmlTextWriterTag.Body);//
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "header");
+ writer.RenderBeginTag(HtmlTextWriterTag.Div);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "default.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("ReactOS RBuild Documentation");
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+
+ if (!Project.Properties["ARCH"].IsEmpty)
+ {
+ if (!Project.Properties["SARCH"].IsEmpty)
+ {
+ writer.Write("RBuild Documentation for the '{0}' architecture, sub-architecture '{1}'. Project used '{2}'",
+ Project.Properties["ARCH"].Value,
+ Project.Properties["SARCH"].Value,
+ Project.RBuildFile);
+ }
+ else
+ {
+ writer.Write("RBuild Documentation for the '{0}' architecture. Project used '{1}'",
+ Project.Properties["ARCH"].Value,
+ Project.RBuildFile);
+ }
+ }
+
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ protected void WriteDocumentEnd(HtmlTextWriter writer)
+ {
+ writer.WriteBreak();
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "footer");
+ writer.RenderBeginTag(HtmlTextWriterTag.Div);
+ WriteDocumentLastUpdate(writer);
+ writer.RenderEndTag();
+
+ writer.RenderEndTag(); //
+ writer.RenderEndTag(); //
+ }
+
+ protected void WriteDocumentLastUpdate(HtmlTextWriter writer)
+ {
+ //writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Document last updated on {0}", DateTime.Now);
+ //writer.RenderEndTag();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/BaseAddress/BaseAddressReportBackend.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/BaseAddress/BaseAddressReportBackend.cs
new file mode 100644
index 00000000000..df0cf9ebc2d
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/BaseAddress/BaseAddressReportBackend.cs
@@ -0,0 +1,127 @@
+using System;
+using System.Globalization;
+using System.Text.RegularExpressions;
+using System.Web.UI;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Tasks;
+using SysGen.BuildEngine.Backends;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class BaseAddressReportBackend : Backend
+ {
+ private List m_Modules = new List ();
+
+ public class BaseAddressModule
+ {
+ private FileInfo m_FileInfo = null;
+ private RBuildModule m_Module = null;
+
+ public BaseAddressModule(RBuildModule module , string file)
+ {
+ m_Module = module;
+ m_FileInfo = new FileInfo(file);
+ }
+
+ public string Name
+ {
+ get { return m_Module.Name; }
+ }
+
+ public string BaseAddress
+ {
+ get { return m_Module.BaseAddress; }
+ }
+
+ public long Size
+ {
+ get { return m_FileInfo.Length; }
+ }
+
+ public string HexBaseAddressStart
+ {
+ get { return m_Module.BaseAddress.Replace("0x", string.Empty); }
+ }
+
+ public long BaseAddressStart
+ {
+ get { return Int64.Parse(HexBaseAddressStart, NumberStyles.AllowHexSpecifier); }
+ }
+
+ public long BaseAddressEnd
+ {
+ get { return m_FileInfo.Length + BaseAddressStart; }
+ }
+ }
+
+ public BaseAddressReportBackend(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ }
+
+ protected override string FriendlyName
+ {
+ get { return "Base Address Report"; }
+ }
+
+ protected override void Generate()
+ {
+ foreach (RBuildModule module in Project.Modules)
+ {
+ if (module.Type == ModuleType.Win32DLL ||
+ module.Type == ModuleType.Win32OCX)
+ {
+ if (module.BaseAddress != module.DefaultBaseAdress)
+ {
+ BaseAddressModule baseAddressModule = new BaseAddressModule(module , SysGen.ResolveRBuildFilePath (module.TargetFile));
+
+ Console.WriteLine(baseAddressModule.Name);
+
+ Console.WriteLine(" {0} {1}",
+ baseAddressModule.BaseAddressStart,
+ baseAddressModule.BaseAddressEnd);
+
+ m_Modules.Add (baseAddressModule);
+ }
+ }
+
+
+ }
+
+ using (StreamWriter sw = new StreamWriter(Directory.GetCurrentDirectory() + "\\overlapping.txt"))
+ {
+ foreach (BaseAddressModule module in m_Modules)
+ {
+ foreach (BaseAddressModule testModule in m_Modules)
+ {
+ if (module.Name != testModule.Name)
+ {
+ if ((testModule.BaseAddressStart >= module.BaseAddressStart && testModule.BaseAddressStart <= module.BaseAddressEnd) ||
+ (testModule.BaseAddressEnd >= module.BaseAddressStart && testModule.BaseAddressEnd <= module.BaseAddressEnd) ||
+ (testModule.BaseAddressStart <= module.BaseAddressStart && testModule.BaseAddressEnd >= module.BaseAddressEnd))
+ {
+ sw.WriteLine("- Module '{0}' [size '{1} and base address '{2}' [start:{3} end:{4}] is provably being overlapped by module '{5}' [size '{6} and base address '{7}' [start:{3} end:{8}]",
+ module.Name,
+ module.Size,
+ module.BaseAddress,
+ module.BaseAddressStart,
+ module.BaseAddressEnd,
+ testModule.Name,
+ testModule.Size,
+ testModule.BaseAddress,
+ testModule.BaseAddressStart,
+ testModule.BaseAddressEnd);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/BuildLogReport/BuildLogReport.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/BuildLogReport/BuildLogReport.cs
new file mode 100644
index 00000000000..af1fb660479
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/BuildLogReport/BuildLogReport.cs
@@ -0,0 +1,109 @@
+using System;
+using System.Text.RegularExpressions;
+using System.Web.UI;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+using SysGen.BuildEngine.Backends;
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class BuildLogReportEntry
+ {
+ public string File;
+ public string Message;
+ public string Position;
+ public string Type;
+ }
+
+ public class BuildLogReport : Backend
+ {
+ private List m_Errors = new List();
+
+ public BuildLogReport(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ }
+
+ protected override string FriendlyName
+ {
+ get { return "Build Log analizer"; }
+ }
+
+ private List Errors
+ {
+ get { return m_Errors; }
+ }
+
+ protected override void Generate()
+ {
+ using (StreamReader sr = new StreamReader(@"C:\Ros\Trunk\reactos\RosBE-Logs\BuildLog-4.1.3-20070210-0630.txt"))
+ {
+ Regex regex = new Regex(@"(.*?):(.*?): (.*?): (.*?)$",
+ RegexOptions.IgnoreCase |
+ RegexOptions.Multiline |
+ RegexOptions.Compiled);
+
+ MatchCollection matches = regex.Matches(sr.ReadToEnd());
+ foreach (Match match in matches)
+ {
+ BuildLogReportEntry error = new BuildLogReportEntry();
+
+ error.File = match.Groups[1].ToString();
+ error.Position = match.Groups[2].ToString();
+ error.Type = match.Groups[3].ToString();
+ error.Message = match.Groups[4].ToString();
+
+ Errors.Add(error);
+ }
+ }
+
+ using (StreamWriter sw = new StreamWriter(@"C:\rosbuildwarnings.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ writer.WriteLine("{0} Warnings" , Errors.Count);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("File");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Line/Column");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Error");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (BuildLogReportEntry report in m_Errors)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(report.File);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(report.Position);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(report.Type);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(report.Message);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Catalog/CatalogBackend.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Catalog/CatalogBackend.cs
new file mode 100644
index 00000000000..9e2a499d2b0
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Catalog/CatalogBackend.cs
@@ -0,0 +1,69 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+using SysGen.BuildEngine.Backends;
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class CatalogBackend : Backend
+ {
+ public CatalogBackend(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ }
+
+ protected override string FriendlyName
+ {
+ get { return "Component catalog"; }
+ }
+
+ private string CatalogFile
+ {
+ get { return Path.Combine(SysGen.BaseDirectory, "catalog.xml"); }
+ }
+
+ protected override void Generate()
+ {
+ // Creates an XML file is not exist
+ using (XmlTextWriter writer = new XmlTextWriter(CatalogFile, Encoding.ASCII))
+ {
+ writer.Indentation = 4;
+ writer.Formatting = Formatting.Indented;
+
+ // Starts a new document
+ writer.WriteStartDocument();
+ writer.WriteComment("File autogenerated by " + AppInfo);
+ writer.WriteStartElement("modules");
+
+ foreach (RBuildModule module in Project.Modules)
+ {
+ writer.WriteStartElement("module");
+ writer.WriteAttributeString("name", module.Name);
+ writer.WriteAttributeString("type", module.Type.ToString());
+ writer.WriteAttributeString("base", module.Base);
+ writer.WriteAttributeString("path", module.Path);
+ writer.WriteAttributeString("desc", module.Description);
+
+ writer.WriteStartElement("dependencies");
+ foreach (RBuildModule library in module.Libraries)
+ {
+ writer.WriteStartElement("dependency");
+ writer.WriteAttributeString("name", library.Name);
+ writer.WriteEndElement();
+ }
+ writer.WriteEndElement();
+
+ writer.WriteEndElement();
+ }
+
+ writer.WriteEndElement();
+ writer.WriteEndDocument();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Html/HtmlBackend.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Html/HtmlBackend.cs
new file mode 100644
index 00000000000..02f40a102f9
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Html/HtmlBackend.cs
@@ -0,0 +1,2743 @@
+using System;
+using System.Web.UI;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.Drawing;
+
+using SysGen.BuildEngine.Backends;
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class HtmlBackend : HtmlDocumenterBaseBacked
+ {
+ public HtmlBackend(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ try
+ {
+ if (Directory.Exists(@"C:\rosDoc"))
+ Directory.Delete(@"C:\rosDoc", true);
+
+ Directory.CreateDirectory(@"C:\rosDoc");
+
+ File.Copy(@"c:\style.css", @"c:\rosDoc\style.css");
+ }
+ catch (Exception)
+ {
+ }
+ }
+
+ protected override string FriendlyName
+ {
+ get { return "HTML Report"; }
+ }
+
+ private void GenerateFrontPage()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\default.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "RBuild Auto Documentation");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Modules");
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "platform.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Platform");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Quick platform overview.");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "modules.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Modules");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("ReactOS is a modular operating system, made of components that collaborate with each other.");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "baseaddresses.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Base Addresses");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Memory address serving as a reference point for other addresses.");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "dllbaseaddresses.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("DLL Base Addresses");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Base addresses used in ReactOS dlls.");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "properties.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Properties");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Properties used during the build process.");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "defines.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Project Defines");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Global defines.");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "depmap.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Dependency map");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Graphically represents interdependencies between modules.");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "files.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Files");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Files included for current platform.");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "installfolders.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Install Folders");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Install folders created during ReactOS setup.");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "installfiles.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Install Files");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Install files created during ReactOS setup.");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "authors.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Authors");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Individuals who have contributed time and energy to supporting the ReactOS Project.");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "unicodemodules.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Unicode");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Modules supporting UNICODE builds");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "localizations.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Localizations");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Languages and cultures currently supported by ReactOS");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "codestats.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Stats");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Basic ReactOS code base statistics");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "warnings.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("RBuild Warnings");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Warnings and inconsistencies detected by rbuild.");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "buildsummary.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Build Summary");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Options and build settings per module.");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GenerateDependencyMap()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\depmap.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Module Dependency Map");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Module Dependency Map");
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.B);
+ writer.Write("Direct Dependencies :");
+ writer.RenderEndTag();
+ writer.Write("Dependencies and libraries this module is using");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Br);
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.B);
+ writer.Write("Full Dependencies :");
+ writer.RenderEndTag();
+ writer.Write("Dependencies and libraries this module and it's dependencies are using");
+
+ SysGenDependencyTracker dependencyTracker = null;
+
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ dependencyTracker = new SysGenDependencyTracker(Project, module);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("{0}", module.Name);
+ writer.RenderEndTag();
+
+ writer.AddAttribute("name", module.Name);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Blockquote);
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Direct Dependencies");
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildModule dependency in module.Needs)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "#" + dependency.Name);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("{0} - ({1} Dependencies , {2} Libraries , {3} Requeriments)",
+ dependency.Name,
+ dependency.Dependencies.Count,
+ dependency.Libraries.Count,
+ dependency.Requeriments.Count);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Full Dependencies");
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildModule dependency in dependencyTracker.DependsOn)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "#" + dependency.Name);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("{0} - ({1} Dependencies , {2} Libraries , {3} Requeriments)",
+ dependency.Name,
+ dependency.Dependencies.Count,
+ dependency.Libraries.Count,
+ dependency.Requeriments.Count);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ }
+ }
+
+ private void GenerateModulesBuildSummary()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\buildsummary.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Modules");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Modules");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Module");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Libraries");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Dependencies");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("CFLAGS");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("LFLAGS");
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Type);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+
+ foreach (RBuildModule library in module.Libraries)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, library.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(library.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+
+ foreach (RBuildModule dependency in module.Dependencies)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, dependency.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(dependency.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+
+ foreach (string flag in module.CompilerFlags)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.Write(flag);
+ writer.RenderEndTag();
+ }
+
+ foreach (string flag in Project.CompilerFlags)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.Write(flag);
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+
+ foreach (string flag in module.LinkerFlags)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.Write(flag);
+ writer.RenderEndTag();
+ }
+
+ foreach (string flag in Project.LinkerFlags)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.Write(flag);
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GenerateModules()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\modules.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Modules");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Modules");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Module");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Unicode");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("C++");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("PCH");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Target");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Install Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Install Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("RBuild");
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Type);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Unicode);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.CPlusPlus);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.PCH);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.TargetName);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.InstallBase);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.InstallName);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.RBuildPath);
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+ }
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GenerateStats()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\codestats.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Stats");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Stats");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Modules");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(Project.Modules.Count);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GenerateWarnings()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\warnings.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Warnings");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Warnings");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Unicode == false)
+ {
+ if ((module.Defines.IsDefined("UNICODE")) ||
+ (module.Defines.IsDefined("_UNICODE")) ||
+ (module.Defines.IsDefined("_UNICODE_")))
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.WriteLine("Module '{0}' has unicode defines but 'Unicode' property set to 'False'", module.Name);
+ writer.RenderEndTag();
+ }
+ }
+
+ foreach (RBuildDefine define in Project.Defines)
+ {
+ if (module.Defines.IsDefined(define.Name))
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.WriteLine("Module '{0}' defines '{1}' already inherited from project ", module.Name, define.Name);
+ writer.RenderEndTag();
+ }
+ }
+
+ foreach (string flag in Project.CompilerFlags)
+ {
+ if (module.CompilerFlags.Contains(flag))
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.WriteLine("Module '{0}' has compiler flag '{1}' already inherited from project ", module.Name, flag);
+ writer.RenderEndTag();
+ }
+ }
+
+ foreach (string flag in Project.LinkerFlags)
+ {
+ if (module.LinkerFlags.Contains(flag))
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.WriteLine("Module '{0}' has linker flag '{1}' already inherited from project ", module.Name, flag);
+ writer.RenderEndTag();
+ }
+ }
+
+ foreach (RBuildFolder include in module.IncludeFolders)
+ {
+ if (Project.IncludeFolders.Contains(include))
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.WriteLine("Module '{0}' includes folder '({1}){2}' already inherited from project ", module.Name, include.Root, include.FullPath);
+ writer.RenderEndTag();
+ }
+
+ if (include.Root == PathRoot.Default ||
+ include.Root == PathRoot.SourceCode)
+ {
+ if (SysGen.RBuildFolderExists(include) == false)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.WriteLine("Module '{0}' includes folder '({1}){2}' which could not be found ", module.Name, include.Root, include.FullPath);
+ writer.RenderEndTag();
+ }
+ }
+ }
+ }
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GenerateFiles()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\files.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Modules");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Files");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Path");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Root");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Install Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("New Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildOutputFile file in Project.Files)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.FullPath);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.Root);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.InstallBase);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.NewFile.FullPath);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.GetType().Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GenerateBaseAddresses()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\baseaddresses.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "BaseAdress");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Base Adress");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Value");
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+
+ foreach (RBuildProperty property in SysGen.Project.Properties)
+ {
+ if (property is RBuildBaseAdress)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(property.Name);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(property.Value);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GenerateDllBaseAddresses()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\dllbaseaddresses.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Dll's base addresses");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Dll's base addresses");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Module");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base Adress");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Is Default");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.IsDLL)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Name);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Type);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.BaseAddress);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.IsDefaultBaseAdress);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ }
+ }
+ }
+
+ private void GenerateDefines()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\defines.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Project Defines");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Project Defines");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Value");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildDefine define in Project.Defines)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(define.Name);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(define.Value);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GenerateProperties()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\properties.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Properties");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Properties");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Value");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Read-Only");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Internal");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildProperty property in SysGen.Project.Properties)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(property.Name);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(property.Value);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(property.ReadOnly);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(property.Internal);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(property.GetType().Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GenerateInstallFiles()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\installfiles.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Install Files");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Install Files");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("ID");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Enabled)
+ {
+ if (module.IsInstallable)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.InstallBase);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.TargetFile.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+
+ foreach (RBuildOutputFile file in module.Files)
+ {
+ RBuildPlatformFile platformFile = file as RBuildPlatformFile;
+
+ if (platformFile != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(platformFile.InstallBase);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(platformFile.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ }
+
+ foreach (RBuildOutputFile file in Project.Files)
+ {
+ RBuildPlatformFile platformFile = file as RBuildPlatformFile;
+
+ if (platformFile != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(platformFile.InstallBase);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(platformFile.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GenerateInstallFolders()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\installfolders.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Folders");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Install Folders");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("ID");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+
+ foreach (RBuildInstallFolder folder in Project.InstallFolders)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(folder.ID);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(folder.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GenerateAuthors()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\authors.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Authors");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("ReactOS Authors");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Alias");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Mail");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("City");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Country");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Active");
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+
+ foreach (RBuildContributor contributor in Project.Contributors)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+
+ if (contributor.Alias != null)
+ {
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, contributor.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(contributor.Alias);
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(contributor.FullName);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(contributor.Mail);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(contributor.City);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(contributor.Country);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(contributor.Active);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GenerateContributors()
+ {
+ foreach (RBuildContributor contributor in Project.Contributors)
+ {
+ if (contributor.Alias != null)
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\" + contributor.HtmlDocFileName))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Authors");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("ReactOS Authors");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Module");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Roles");
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Authors.GetByName(contributor.Alias) != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildAuthor author in module.Authors)
+ {
+ if (author.Contributor == contributor)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.Write(author.Role);
+ writer.RenderEndTag();
+ }
+ }
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+
+ }
+ }
+
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+ }
+ }
+
+ private void GenerateLocalizations()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\localizations.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Translations");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Available Languages");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("ID");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("ThreeLetter ISO");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildLanguage language in Project.Languages)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(language.Name);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(language.Name);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(language.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Localization by Module");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Module");
+ writer.RenderEndTag();
+
+ foreach (RBuildLanguage language in Project.Languages)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write(language.Name);
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildLanguage language in Project.Languages)
+ {
+ RBuildLocalizationFile localization = module.LocalizationFiles.GetByName(language.Name);
+
+ if (localization != null)
+ {
+ if (localization.Dirty)
+ {
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "Red");
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write("Yes");
+ writer.RenderEndTag();
+ }
+ else
+ {
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "Green");
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write("Yes");
+ writer.RenderEndTag();
+ }
+ }
+ else
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write("No");
+ writer.RenderEndTag();
+ }
+ }
+
+ writer.RenderEndTag();
+ }
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GenerateModulePages()
+ {
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\" + module.HtmlDocFileName))
+ {
+ // Creates an XML file is not exist
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, module.Name);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Module : {0}", module.Name);
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Base);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Entry Point");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.EntryPoint);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("C++");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.CPlusPlus);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base Adress");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.BaseAddress);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Unicode");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Unicode);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Target Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.TargetName);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Type.ToString());
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ if (module.Families.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Families this module belong");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildFamily family in module.Families)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(family.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ }
+
+ if (module.Folders.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Folders");
+ writer.RenderEndTag();
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Root");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildFolder folder in module.Folders)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(folder.Root);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(folder.FullPath);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ }
+
+ if (module.IsBuildable)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Output Files");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Root");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("File");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ if (module.TargetFile != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.TargetFile.Root);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.TargetFile.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.TargetFile.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ if (module.Install != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Install.Root);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Install.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Install.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ if (module.PlatformInstall != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.PlatformInstall.Root);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.PlatformInstall.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.PlatformInstall.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ }
+
+ if (module.Authors.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Authors");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Alias");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Full Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Mail");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Role");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildAuthor author in module.Authors)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, author.Contributor.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(author.Contributor.Alias);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(author.Contributor.FullName);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(author.Contributor.Mail);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(author.Role);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ }
+
+ if (module.Metadata != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Metadata");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Description");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Metadata.Description);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ if (module.AutoRegister != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("COM Auto register");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Register Type");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.AutoRegister.Type.ToString());
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("SysSetup INF Section");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.AutoRegister.InfSection);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ if (module.ImportLibrary != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("DLL Import");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Root");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.ImportLibrary.Root);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.ImportLibrary.Base);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Definition");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.ImportLibrary.Definition);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Import Dll Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.ImportLibrary.DllName);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ if (module.Bootstrap != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("CD Bootstrap");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Install Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Bootstrap.InstallBase);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Path");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Bootstrap.FullPath);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("New name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Bootstrap.NewName);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ if (module.Dependencies.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Dependencies");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Inherited");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildModule dependency in module.Dependencies)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, dependency.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(dependency.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(dependency.Type);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(dependency.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.FalseString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ }
+
+ if (module.Libraries.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Libraries");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Inherited");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildModule dependency in module.Libraries)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, dependency.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(dependency.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(dependency.Type);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(dependency.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.FalseString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ }
+
+ if (module.Requeriments.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Requeriments");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Inherited");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildModule dependency in module.Requeriments)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, dependency.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(dependency.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(dependency.Type);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(dependency.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.FalseString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ }
+
+ SysGenDependencyTracker dependencyTracker = new SysGenDependencyTracker(Project,module);
+
+ if (dependencyTracker.DependsOn.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Depdends On");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Inherited");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildModule dependency in dependencyTracker.DependsOn)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, dependency.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(dependency.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(dependency.Type);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(dependency.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.FalseString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ }
+
+ if (dependencyTracker.DependencyOf.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Dependency Of");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Inherited");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildModule dependency in dependencyTracker.DependencyOf)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, dependency.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(dependency.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(dependency.Type);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(dependency.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.FalseString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ }
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Include Folders");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Root");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Inherited");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildFolder folder in module.IncludeFolders)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(folder.Root);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(folder.FullPath);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.FalseString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ foreach (RBuildFolder folder in Project.IncludeFolders)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(folder.Root);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(folder.FullPath);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.TrueString);
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+
+ if (module.LocalizationFiles.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Localizations");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("ISO Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Resource");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Outdated");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildLocalizationFile localization in module.LocalizationFiles)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(localization.CultureInfo.Name);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(localization.CultureInfo.EnglishName);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(localization.Name);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(localization.Dirty);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ }
+
+ if (module.Defines.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Defines");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Value");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Inherited");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildDefine define in module.Defines)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(define.Name);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(define.Value);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.FalseString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ foreach (RBuildDefine define in Project.Defines)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(define.Name);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(define.Value);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.TrueString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ writer.RenderEndTag();
+ }
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Linker Flags");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Flag");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Inherited");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (string flag in module.LinkerFlags)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(flag);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.FalseString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ foreach (string flag in Project.LinkerFlags)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(flag);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.TrueString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+
+ if (module.LinkerScript != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Linker Script");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Root");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.LinkerScript.Root);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.LinkerScript.FullPath);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+ }
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("CompilerFlags Flags");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Flag");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Inherited");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (string flag in module.CompilerFlags)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(flag);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.FalseString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ foreach (string flag in Project.CompilerFlags)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(flag);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.TrueString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+
+ if (module.Files.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Files");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Path");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Root");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Install Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("New Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildOutputFile file in module.Files)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.FullPath);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.Root);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.InstallBase);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.NewFile.FullPath);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.GetType().Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ }
+
+ if (module.SourceFiles.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Source Files");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Root");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Source Type");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Switches");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildSourceFile file in module.SourceFiles)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.Root);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.Type);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.FullPath);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.Switches);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+
+ if (module.PreCompiledHeader != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Precompiled Header");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Root");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Source Type");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.PreCompiledHeader.Root);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.PreCompiledHeader.Type);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.PreCompiledHeader.FullPath);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+ }
+ }
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+ }
+
+ private void GenerateUnicodeModules()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\unicodemodules.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Unicode");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Unicode Modules");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Module");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Unicode)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Type);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Non-Unicode Modules");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Module");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (!module.Unicode)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Type);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+
+ writer.RenderEndTag();
+
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GeneratePlatformFrontPage()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\platform.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Platform");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write(Project.Platform.Name);
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write(Project.Platform.Description);
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Modules");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.WriteLine("{0} out of {1}", Project.Platform.Modules.Count, Project.Modules.Count);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ if (Project.Platform.Shell != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Shell");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(Project.Platform.Shell.InstallName);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ if (Project.Platform.Screensaver != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Screen Saver");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(Project.Platform.Screensaver.InstallName);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ if (Project.Platform.Languages.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Languages");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildLanguage language in Project.Platform.Languages)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.Write(language.Name);
+ writer.RenderEndTag();
+ }
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ if (Project.Platform.DebugChannels.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Debug Channels");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildDebugChannel channel in Project.Platform.DebugChannels)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.Write(channel.Name);
+ writer.RenderEndTag();
+ }
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Platform Profiles");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Type == ModuleType.ModuleGroup)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.Write(module.Description);
+ writer.RenderEndTag();
+ }
+ }
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Debug Build");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.TrueString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Kernel Debug");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.FalseString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Files");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("GUI Applications");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Console Applications");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Dlls");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Drivers");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Keyboard Layouts");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("KernelMode DLLs");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("OCX & TypeLibs");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Type == ModuleType.Win32GUI)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.TargetName);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Type == ModuleType.Win32CUI)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.TargetName);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Type == ModuleType.Win32DLL)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.TargetName);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Type == ModuleType.KernelModeDriver)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.TargetName);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Type == ModuleType.KeyboardLayout)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.TargetName);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Type == ModuleType.KernelModeDLL)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.TargetName);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Type == ModuleType.Win32OCX || module.Type == ModuleType.EmbeddedTypeLib)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.TargetName);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ protected override void Generate()
+ {
+ GenerateFrontPage();
+ GeneratePlatformFrontPage();
+ GenerateModules();
+ GenerateProperties();
+ GenerateModulesBuildSummary();
+ GenerateStats();
+ //GenerateDependencyMap();
+ GenerateWarnings();
+ GenerateFiles();
+ GenerateBaseAddresses();
+ GenerateDllBaseAddresses();
+ GenerateDefines();
+ GenerateInstallFolders();
+ GenerateInstallFiles();
+ GenerateAuthors();
+ GenerateContributors();
+ GenerateLocalizations();
+ GenerateModulePages();
+ GenerateUnicodeModules();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/MSVisualStudio/MSVisualStudio.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/MSVisualStudio/MSVisualStudio.cs
new file mode 100644
index 00000000000..c1744aad138
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/MSVisualStudio/MSVisualStudio.cs
@@ -0,0 +1,45 @@
+using System;
+using System.Web.UI;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+using SysGen.BuildEngine.Framework.VisualStudio;
+using SysGen.BuildEngine.Backends;
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MSVisualStudio : Backend
+ {
+ public MSVisualStudio(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ }
+
+ protected override string FriendlyName
+ {
+ get { return "Visual Studio 6.0-2005"; }
+ }
+
+ protected override void Generate()
+ {
+ VSSolution solution = new VSSolution();
+
+ solution.Name = "ReactOS";
+ solution.FileName = "reactos.sln";
+
+ foreach (RBuildModule module in SysGen.Project.Modules)
+ {
+ VSProject project = new VSProject();
+
+ //project.Name = module.Name;
+ project.FileName = module.Name + ".vcproj";
+
+ solution.Projects.Add(project);
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/MSVisualStudio/VisualStudio/Solution.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/MSVisualStudio/VisualStudio/Solution.cs
new file mode 100644
index 00000000000..00ececbee87
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/MSVisualStudio/VisualStudio/Solution.cs
@@ -0,0 +1,703 @@
+using System;
+using System.IO;
+using System.Xml;
+using System.Collections;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.BuildEngine.Framework.VisualStudio
+{
+ public enum VisualStudioVersion
+ {
+ VS6,
+ VS2002,
+ VS2003,
+ VS2005
+ }
+
+ #region ProjectFile
+ public class ProjectFile
+ {
+ private string relPath = "";
+ private string basePath = "";
+ private string buildAction = "";
+ private string subType = "";
+
+ public string AbsolutePath
+ {
+ get
+ {
+ return Path.Combine(basePath, relPath);
+ }
+ }
+ public string AbsoluteDirectory
+ {
+ get
+ {
+ return Path.GetDirectoryName(Path.Combine(basePath, relPath));
+ }
+ }
+
+ public string RelativePath
+ {
+ get
+ {
+ return relPath;
+ }
+ }
+
+ public string BasePath
+ {
+ get
+ {
+ return basePath;
+ }
+ }
+ public string BuildAction
+ {
+ get
+ {
+ return buildAction;
+ }
+ }
+ public string SubType
+ {
+ get
+ {
+ return subType;
+ }
+ }
+
+ public override string ToString()
+ {
+ StringBuilder buff = new StringBuilder("\nProject File:");
+ buff.Append("\n\tRelativePath:");
+ buff.Append(relPath);
+ buff.Append("\n\tBuildAction:");
+ buff.Append(buildAction);
+ buff.Append("\n\tSubType:");
+ buff.Append(subType);
+ buff.Append("\n\tBasePath:");
+ buff.Append(basePath);
+ return buff.ToString();
+ }
+
+ public ProjectFile(
+ string relPath,
+ string buildAction,
+ string subType,
+ string basePath)
+ {
+ this.relPath = relPath;
+ this.buildAction = buildAction;
+ this.subType = subType;
+ this.basePath = basePath;
+ }
+ }
+ #endregion
+
+ #region ProjectFileCollection
+ public class ProjectFileCollection : ReadOnlyCollectionBase
+ {
+ public ProjectFile this[int index]
+ {
+ get
+ {
+ return (ProjectFile)this.InnerList[index];
+ }
+ }
+
+ public override string ToString()
+ {
+ StringBuilder buff = new StringBuilder();
+ buff.Append("\nProjectFileCollection");
+ foreach (ProjectFile pf in this.InnerList)
+ {
+ buff.Append(pf.ToString());
+ }
+ return buff.ToString();
+ }
+
+ public ProjectFileCollection(ProjectFile[] projectFileArray)
+ {
+ foreach (ProjectFile projectFile in projectFileArray)
+ {
+ this.InnerList.Add(projectFile);
+ }
+ }
+
+
+ }
+ #endregion
+
+ #region ProjectReference
+ public class ProjectReference
+ {
+ private string name = "";
+ private string assemblyName = "";
+ private string hintPath = "";
+ private string basePath = "";
+
+ public string Name
+ {
+ get
+ {
+ return this.name;
+
+ }
+ }
+ public string AssemblyName
+ {
+ get
+ {
+ return this.assemblyName;
+ }
+ }
+ public string HintPath
+ {
+ get
+ {
+ return this.hintPath;
+ }
+ }
+ public string AbsolutePath
+ {
+ get
+ {
+ return Path.Combine(this.basePath, this.hintPath);
+ }
+ }
+
+ public string BasePath
+ {
+ get
+ {
+ return this.basePath;
+ }
+ }
+ public override string ToString()
+ {
+ StringBuilder buff = new StringBuilder("\nReference:");
+ buff.Append("\n\tName");
+ buff.Append(name);
+ buff.Append("\n\tAssemblyName");
+ buff.Append(assemblyName);
+ buff.Append("\n\tHintPath:");
+ buff.Append(hintPath);
+ buff.Append("\n\tBasePath:");
+ buff.Append(basePath);
+ return buff.ToString();
+ }
+
+ public ProjectReference(string name,
+ string assemblyName,
+ string hintPath,
+ string basePath)
+ {
+ this.name = name;
+ this.assemblyName = assemblyName;
+ this.hintPath = hintPath;
+ this.basePath = basePath;
+ }
+
+ }
+ #endregion
+
+ #region ProjectReferenceCollection
+ public class ProjectReferenceCollection : ReadOnlyCollectionBase
+ {
+ public ProjectReference this[int index]
+ {
+ get
+ {
+ return (ProjectReference)this.InnerList[index];
+ }
+ }
+
+ public override string ToString()
+ {
+ StringBuilder buff = new StringBuilder();
+ buff.Append("\nProjectReferenceCollection");
+ foreach (ProjectReference pr in this.InnerList)
+ {
+ buff.Append(pr.ToString());
+ }
+ return buff.ToString();
+ }
+
+ public ProjectReferenceCollection(ProjectReference[]
+ projectReferenceArray)
+ {
+ foreach (ProjectReference projectReference in projectReferenceArray)
+ {
+ this.InnerList.Add(projectReference);
+ }
+ }
+
+ }
+ #endregion
+
+ #region ProjectConfigItem
+ public class ProjectConfigItem
+ {
+ private string key = "";
+ private string keyValue = "";
+
+ public string Key
+ {
+ get
+ {
+ return key;
+ }
+ }
+ public string Value
+ {
+ get
+ {
+ return keyValue;
+ }
+ }
+
+ public override string ToString()
+ {
+ StringBuilder buff = new StringBuilder();
+ buff.Append("\nProjectConfigItem:");
+ buff.Append("\n\tKey:");
+ buff.Append(key);
+ buff.Append("\n\tValue:");
+ buff.Append(keyValue);
+ return buff.ToString();
+ }
+
+ public ProjectConfigItem(string key, string keyValue)
+ {
+ this.key = key;
+ this.keyValue = keyValue;
+
+ }
+ }
+ #endregion
+
+ #region ProjectConfigItemCollection
+ public class ProjectConfigItemCollection : ReadOnlyCollectionBase
+ {
+ private string basePath = "";
+
+ public string Name
+ {
+ get
+ {
+ string name = "";
+ foreach (ProjectConfigItem pc in this.InnerList)
+ {
+ if (pc.Key.Equals("Name"))
+ {
+ name = pc.Value;
+ break;
+ }
+ }
+ return name;
+ }
+ }
+
+ public string OutputRelPath
+ {
+ get
+ {
+ string relPath = "";
+ foreach (ProjectConfigItem pc in this.InnerList)
+ {
+ if (pc.Key.Equals("OutputPath"))
+ {
+ relPath = pc.Value;
+ break;
+ }
+ }
+ return relPath;
+ }
+ }
+
+ public string OutputAbsolutePath
+ {
+ get
+ {
+ string absPath = OutputRelPath;
+ absPath = Path.Combine(this.basePath, absPath);
+ return absPath.Replace("\\.\\", "");
+ }
+ }
+
+ public ProjectConfigItem this[int index]
+ {
+ get
+ {
+ return (ProjectConfigItem)this.InnerList[index];
+ }
+ }
+
+ public override string ToString()
+ {
+ StringBuilder buff = new StringBuilder();
+ buff.Append("\nProjectConfigItemCollection:");
+ foreach (ProjectConfigItem pc in this.InnerList)
+ {
+ buff.Append(pc.ToString());
+ }
+ return buff.ToString();
+ }
+
+ public ProjectConfigItemCollection(ProjectConfigItem[]
+ projectConfigItemArray, string basePath)
+ {
+ this.basePath = basePath;
+ foreach (ProjectConfigItem pc in projectConfigItemArray)
+ {
+ this.InnerList.Add(pc);
+ }
+
+ }
+ }
+ #endregion
+
+ #region ProjectConfigCollection
+ public class ProjectConfigCollection : ReadOnlyCollectionBase
+ {
+ public override string ToString()
+ {
+ StringBuilder buff = new StringBuilder();
+ buff.Append("\nProjectConfigCollection:");
+ foreach (ProjectConfigItemCollection pc in this.InnerList)
+ {
+ buff.Append(pc.ToString());
+ }
+ return buff.ToString();
+ }
+
+ public ProjectConfigItemCollection this[int index]
+ {
+ get
+ {
+ return (ProjectConfigItemCollection)this.InnerList[index];
+ }
+ }
+
+ public ProjectConfigCollection(XmlNodeList configItems, string basePath)
+ {
+ if (configItems.Count > 0)
+ {
+ foreach (XmlNode configItem in configItems)
+ {
+ // create an array of items:
+ ProjectConfigItem[] projectConfigItemArray = new
+ ProjectConfigItem[configItem.Attributes.Count];
+ int i = 0;
+ foreach (XmlAttribute attrib in configItem.Attributes)
+ {
+ projectConfigItemArray[i] = new
+ ProjectConfigItem(attrib.Name, attrib.Value);
+ i++;
+ }
+ // create a ProjectConfigItemCollection:
+ ProjectConfigItemCollection projectConfigItemCollection = new
+ ProjectConfigItemCollection(projectConfigItemArray, basePath);
+ this.InnerList.Add(projectConfigItemCollection);
+ }
+ }
+ }
+ }
+ #endregion
+
+ #region Project
+ public class VSProject : VSItem
+ {
+ private string basePath = "";
+ private string projectBasePath = "";
+ private string projectFileName = "";
+ private string projectGuid = "";
+ private string projectConfigurationGuid = "";
+ private string projectName = "";
+ private string projectType = "";
+ private ProjectConfigCollection configCollection = null;
+ private ProjectReferenceCollection referenceCollection = null;
+ private ProjectFileCollection fileCollection = null;
+
+ public string AbsolutePath
+ {
+ get
+ {
+ return Path.Combine(basePath, projectFileName);
+ }
+ }
+
+ public string AbsoluteDirectory
+ {
+ get
+ {
+ return basePath;
+ }
+ }
+
+ public ProjectConfigCollection Configurations
+ {
+ get
+ {
+ return configCollection;
+ }
+ }
+ public ProjectReferenceCollection ReferenceCollection
+ {
+ get
+ {
+ return referenceCollection;
+ }
+ }
+ public ProjectFileCollection FileCollection
+ {
+ get
+ {
+ return fileCollection;
+ }
+ }
+
+ public string RelPath
+ {
+ get
+ {
+ return projectFileName;
+ }
+ }
+
+ public string Guid
+ {
+ get
+ {
+ return projectGuid;
+ }
+ }
+
+ public string ConfigurationGuid
+ {
+ get
+ {
+ return projectConfigurationGuid;
+ }
+ }
+
+ public string Name
+ {
+ get
+ {
+ return projectName;
+ }
+ }
+
+ public string ProjectType
+ {
+ get
+ {
+ return projectType;
+ }
+ }
+
+ public override string ToString()
+ {
+ StringBuilder buff = new StringBuilder();
+ buff.Append("\nProject:");
+ buff.Append("\n\tName:");
+ buff.Append(projectName);
+ buff.Append("\n\tFileName:");
+ buff.Append(projectFileName);
+ buff.Append("\n\tBasePath:");
+ buff.Append(basePath);
+ buff.Append("\n\tGuid:");
+ buff.Append(projectGuid);
+ buff.Append("\nConfiguration:");
+ buff.Append(configCollection.ToString());
+ buff.Append("\nReferences:");
+ buff.Append(referenceCollection.ToString());
+ buff.Append("\nFiles:");
+ buff.Append(fileCollection.ToString());
+ return buff.ToString();
+ }
+ }
+ #endregion
+
+ #region ProjectCollection
+ public class ProjectCollection : List
+ {
+ public override string ToString()
+ {
+ StringBuilder buff = new StringBuilder();
+ buff.Append("\nProject Collection:");
+ foreach (VSProject p in this)
+ {
+ buff.Append(p.ToString());
+ }
+ return buff.ToString();
+ }
+ }
+ #endregion
+
+ #region Solution
+ public class VSSolution : VSItem
+ {
+ private string solutionFileName = "";
+ private string solutionDirectory = "";
+ private string solutionFileVersion = "";
+ private ProjectCollection projectCollection = null;
+
+ public string LongestSharedPath
+ {
+ get
+ {
+ // find the longest path which is shared by all of the
+ // objects in the project (if any)
+ string longestSharedPath = solutionDirectory;
+ foreach (VSProject p in projectCollection)
+ {
+ string projectDir = p.AbsoluteDirectory;
+ longestSharedPath = getMinimumSharedPath(longestSharedPath,
+ projectDir);
+ foreach (ProjectFile pf in p.FileCollection)
+ {
+ string fileDir = pf.AbsoluteDirectory;
+ longestSharedPath = getMinimumSharedPath(longestSharedPath,
+ fileDir);
+ }
+ }
+ return longestSharedPath;
+ }
+ }
+
+ private string getMinimumSharedPath(
+ string sharedPath,
+ string newPath
+ )
+ {
+ string retSharedPath = "";
+ if (sharedPath.Length > 0)
+ {
+ string[] sharedPathParts = sharedPath.Split(
+ (new char[] {Path.DirectorySeparatorChar,
+ Path.AltDirectorySeparatorChar }));
+ string[] newPathParts = newPath.Split(
+ (new char[] {Path.DirectorySeparatorChar,
+ Path.AltDirectorySeparatorChar}));
+ int max = Math.Min(sharedPathParts.Length, newPathParts.Length);
+ int sharedCount = 0;
+ for (int i = 0; i < max; i++)
+ {
+ if
+ (!sharedPathParts[i].ToUpper().Equals(newPathParts[i].ToUpper())
+ )
+ {
+ break;
+ }
+ else
+ {
+ sharedCount = i + 1;
+ }
+ }
+ if (sharedCount == 0)
+ {
+ return "";
+ }
+ else
+ {
+ for (int i = 0; i < sharedCount; i++)
+ {
+ if (retSharedPath.Length > 0)
+ {
+ retSharedPath += Path.DirectorySeparatorChar;
+ }
+ retSharedPath += sharedPathParts[i];
+ }
+ }
+ }
+ return retSharedPath;
+ }
+
+ public string FileVersion
+ {
+ get
+ {
+ return solutionFileVersion;
+ }
+ }
+
+ public ProjectCollection Projects
+ {
+ get
+ {
+ return projectCollection;
+ }
+ }
+
+ public string FileName
+ {
+ get
+ {
+ return solutionFileName;
+ }
+ set
+ {
+ solutionFileName = value;
+ }
+ }
+
+ public string BasePath
+ {
+ get
+ {
+ return solutionDirectory;
+ }
+ }
+
+ public override string ToString()
+ {
+ StringBuilder s = new StringBuilder();
+ s.Append("\nSolution:");
+ s.Append("\nFileName:");
+ s.Append(solutionFileName);
+ s.Append("\nVersion:");
+ s.Append(solutionFileVersion);
+ if (projectCollection != null)
+ {
+ s.Append(projectCollection.ToString());
+ }
+ return s.ToString();
+ }
+
+ public VSSolution()
+ {
+ }
+
+ public VSSolution(string fileName)
+ {
+ solutionFileName = fileName;
+ }
+ }
+ #endregion
+
+ public class VSItem
+ {
+ private string m_Name = null;
+ private string m_FileName = null;
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public string FileName
+ {
+ get { return m_FileName; }
+ set { m_FileName = value; }
+ }
+
+ public void SaveAs(VisualStudioVersion version)
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/CompilableFile.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/CompilableFile.cs
new file mode 100644
index 00000000000..c4451fceeab
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/CompilableFile.cs
@@ -0,0 +1,621 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Tasks;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class BackedBuildIncludeFolder : BackedBuildFolder
+ {
+ public BackedBuildIncludeFolder(RBuildFolder folder, SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ m_RBuildFile = folder;
+ }
+ }
+
+ public class BackendBuildFile : BackendBuildFileSystemInfo
+ {
+ public BackendBuildFile(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ m_RBuildFile = new RBuildFile();
+ }
+
+ public string GetPathWithNewExtension(PathRoot root, string newExtension)
+ {
+ return GetPath(root, BuildFile.Name, newExtension);
+ }
+
+ public string GetPathWithNewName(PathRoot root, string newName)
+ {
+ return GetPath(root, newName, Path.GetExtension(BuildFile.Name));
+ }
+
+ public string GetPath(PathRoot root, string newName, string newExtension)
+ {
+ return Path.Combine(SysGen.GetPathRoot(root), Path.ChangeExtension(newName, newExtension));
+ }
+
+ public string IntermediateFolderFullPath
+ {
+ get { return Path.Combine(SysGen.GetPathRoot(PathRoot.Intermediate), BuildFile.Base) /*+ @"\."*/; }
+ }
+
+ public string BaseFolderFullPath
+ {
+ get { return Path.Combine(SysGen.GetPathRoot(PathRoot.SourceCode), BuildFile.Base) /*+ @"\."*/; }
+ }
+
+ public RBuildFile BuildFile
+ {
+ get { return m_RBuildFile as RBuildFile; }
+ }
+ }
+
+ public class BackedBuildFolder : BackendBuildFileSystemInfo
+ {
+ public BackedBuildFolder(RBuildFolder folder, SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ m_RBuildFile = folder;
+ }
+
+ public BackedBuildFolder(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ m_RBuildFile = new RBuildFolder();
+ }
+
+ public RBuildFolder BuildFolder
+ {
+ get { return m_RBuildFile as RBuildFolder; }
+ }
+ }
+
+ public abstract class BackendBuildFileSystemInfo
+ {
+ protected RBuildFileSystemInfo m_RBuildFile = null;
+ protected SysGenEngine m_SysGenEngine = null;
+
+ public BackendBuildFileSystemInfo(SysGenEngine sysgen)
+ {
+ m_SysGenEngine = sysgen;
+ }
+
+ public SysGenEngine SysGen
+ {
+ get { return m_SysGenEngine; }
+ }
+
+ public string RelativePath
+ {
+ get { return SysGen.NormalizePath(m_RBuildFile.FullPath); }
+ }
+
+ public string GetPath(PathRoot root)
+ {
+ return Path.Combine(SysGen.GetPathRoot(root), RelativePath);
+ }
+
+ public string OriginalFullPath
+ {
+ get { return Path.Combine(SysGen.GetPathRoot(m_RBuildFile.Root), RelativePath); }
+ }
+
+ public string BaseFullPath
+ {
+ get { return Path.Combine(SysGen.BaseDirectory, RelativePath); }
+ }
+
+ public string IntermediateFullPath
+ {
+ get { return Path.Combine(SysGen.IntermediateDirectory, RelativePath); }
+ }
+
+ public string OutputFullPath
+ {
+ get { return Path.Combine(SysGen.OutputDirectory, RelativePath); }
+ }
+
+ public string BootCDOutputDirectory
+ {
+ get { return Path.Combine(SysGen.BootCDOutputDirectory, RelativePath); }
+ }
+
+ public string TemporaryFullPath
+ {
+ get { return Path.Combine(SysGen.TemporaryDirectory, RelativePath); }
+ }
+
+ public string InstallFullPath
+ {
+ get { return Path.Combine(SysGen.InstallDirectory, RelativePath); }
+ }
+
+ public RBuildModule Module
+ {
+ get { return m_RBuildFile.Element as RBuildModule; }
+ }
+ }
+
+ public class SourceFile : BackendBuildModule
+ {
+ RBuildSourceFile m_File = null;
+ BackendBuildFile m_SourceCodeFile = null;
+ BackendBuildFile m_SourceCodeObjectFile = null;
+ BackendBuildFile m_SourceCodeActualFile = null;
+ BackendBuildFile m_SourceCodeHeaderFile = null;
+ BackendBuildFile m_SourceCodePCHeaderFile = null;
+ BackendBuildFile m_SourceRpcClientHeaderFile = null;
+ BackendBuildFile m_SourceRpcServerHeaderFile = null;
+ BackendBuildFile m_SourceMessageTableHeaderFile = null;
+ BackendBuildFile m_SourceMessageTableResourceFile = null;
+ BackendBuildFile m_PCH = null;
+ BackendBuildFile m_PCHTemp = null;
+
+ public SourceFile(RBuildSourceFile file, RBuildModule module, SysGenEngine sysgen)
+ : base(module, sysgen)
+ {
+ m_File = file;
+
+ m_SourceCodeFile = new BackendBuildFile(sysgen);
+ m_SourceCodeFile.BuildFile.Name = file.Name;
+ m_SourceCodeFile.BuildFile.Element = module;
+ m_SourceCodeFile.BuildFile.Base = file.Base;
+ m_SourceCodeFile.BuildFile.Root = file.Root;
+
+ m_SourceCodeObjectFile = new BackendBuildFile(sysgen);
+ m_SourceCodeObjectFile.BuildFile.Name = GetObjectFileName(file);
+ m_SourceCodeObjectFile.BuildFile.Element = module;
+ m_SourceCodeObjectFile.BuildFile.Base = file.Base;
+
+ m_SourceCodeActualFile = new BackendBuildFile(sysgen);
+ m_SourceCodeActualFile.BuildFile.Name = GetActualSourceFile(file);
+ m_SourceCodeActualFile.BuildFile.Element = module;
+ m_SourceCodeActualFile.BuildFile.Base = file.Base;
+
+ m_SourceCodeHeaderFile = new BackendBuildFile(sysgen);
+ m_SourceCodeHeaderFile.BuildFile.Name = GetHeaderFile(file);
+ m_SourceCodeHeaderFile.BuildFile.Element = module;
+ m_SourceCodeHeaderFile.BuildFile.Base = file.Base;
+
+ m_SourceRpcClientHeaderFile = new BackendBuildFile(sysgen);
+ m_SourceRpcClientHeaderFile.BuildFile.Name = GetRpcClientHeaderFile(file);
+ m_SourceRpcClientHeaderFile.BuildFile.Element = module;
+ m_SourceRpcClientHeaderFile.BuildFile.Base = file.Base;
+
+ m_SourceRpcServerHeaderFile = new BackendBuildFile(sysgen);
+ m_SourceRpcServerHeaderFile.BuildFile.Name = GetRpcServerHeaderFile(file);
+ m_SourceRpcServerHeaderFile.BuildFile.Element = module;
+ m_SourceRpcServerHeaderFile.BuildFile.Base = file.Base;
+
+ m_SourceMessageTableHeaderFile = new BackendBuildFile(sysgen);
+ m_SourceMessageTableHeaderFile.BuildFile.Name = GetMessageTableHeaderFile(file);
+ m_SourceMessageTableHeaderFile.BuildFile.Element = module;
+ m_SourceMessageTableHeaderFile.BuildFile.Base = /*file.Base; //*/ "include/reactos";
+
+ m_SourceMessageTableResourceFile = new BackendBuildFile(sysgen);
+ m_SourceMessageTableResourceFile.BuildFile.Name = GetMessageTableResourceFile(file);
+ m_SourceMessageTableResourceFile.BuildFile.Element = module;
+ m_SourceMessageTableResourceFile.BuildFile.Base = file.Base;
+ }
+
+ public string GetMessageTableResourceFile(RBuildFile file)
+ {
+ return Path.GetFileNameWithoutExtension(file.Name) + ".rc";
+ }
+
+ public string GetMessageTableHeaderFile(RBuildFile file)
+ {
+ return Path.GetFileNameWithoutExtension(file.Name) + ".h";
+ }
+
+ public string GetRpcServerHeaderFile(RBuildFile file)
+ {
+ return Path.GetFileNameWithoutExtension(file.Name) + "_s.h";
+ }
+
+ public string GetRpcClientHeaderFile(RBuildFile file)
+ {
+ return Path.GetFileNameWithoutExtension(file.Name) + "_c.h";
+ }
+
+ public string GetRpcProxyHeaderFile(RBuildFile file)
+ {
+ return Path.GetFileNameWithoutExtension(file.Name) + "_p.h";
+ }
+
+ private string GetHeaderFile(RBuildFile file)
+ {
+ switch (file.Extension)
+ {
+ case ".idl":
+ {
+ if (Module.Type == ModuleType.RpcServer)
+ return GetRpcServerHeaderFile(file);
+
+ if (Module.Type == ModuleType.RpcClient)
+ return GetRpcClientHeaderFile(file);
+
+ if (Module.Type == ModuleType.RpcProxy)
+ return GetRpcProxyHeaderFile(file);
+
+ return Path.ChangeExtension(file.Name, ".h");
+ }
+ break;
+ default:
+ return file.Name;
+ }
+ }
+
+ private string GetActualSourceFile(RBuildFile file)
+ {
+ switch (file.Extension)
+ {
+ case ".spec":
+ return Path.ChangeExtension(file.Name, ".stubs.c");
+ break;
+ case ".idl":
+ {
+ if (Module.Type == ModuleType.RpcServer)
+ return Path.GetFileNameWithoutExtension(file.Name) + "_s.c";
+
+ if (Module.Type == ModuleType.RpcClient)
+ return Path.GetFileNameWithoutExtension(file.Name) + "_c.c";
+
+ if (Module.Type == ModuleType.RpcProxy)
+ return Path.GetFileNameWithoutExtension(file.Name) + "_p.c";
+
+ return Path.ChangeExtension(file.Name, ".h");
+ }
+ break;
+ default:
+ return file.Name;
+ }
+ }
+
+ private string GetObjectFileName(RBuildFile file)
+ {
+ string filename = null;
+ switch (file.Extension)
+ {
+ case ".h":
+ filename = Path.ChangeExtension(file.Name, ".h.gch");
+ break;
+ case ".mc":
+ filename = Path.ChangeExtension(file.Name, ".rc");
+ break;
+ case ".rc":
+ filename = Path.ChangeExtension(file.Name, ".coff");
+ break;
+ case ".spec":
+ filename = Path.ChangeExtension(file.Name, ".stubs.o");
+ break;
+ case ".idl":
+ {
+ if (Module.Type == ModuleType.RpcServer)
+ return Path.GetFileNameWithoutExtension(file.Name) + "_s.o";
+
+ if (Module.Type == ModuleType.RpcClient)
+ return Path.GetFileNameWithoutExtension(file.Name) + "_c.o";
+
+ if (Module.Type == ModuleType.RpcProxy)
+ return Path.GetFileNameWithoutExtension(file.Name) + "_p.o";
+
+ /*
+ if (Module.Type == ModuleType.EmbeddedTypeLib)
+ return Path.GetFileNameWithoutExtension(file.Name) + ".tlb";
+ */
+
+ filename = Path.ChangeExtension(file.Name, ".h");
+ }
+ break;
+ //case ".c":
+ //case ".cpp":
+ //case ".cxx":
+ // {
+ // filename = Path.ChangeExtension(file.Name, ".o");
+ // }
+ // break;
+ default:
+ filename = Path.ChangeExtension(file.Name, ".o");
+
+ //HACK:
+ if (Module.Type == ModuleType.BootSector)
+ return filename;
+
+ //filename = string.Format("{1}_{0}{2}",
+ // Module.Name,
+ // Path.GetFileNameWithoutExtension(filename),
+ // Path.GetExtension(filename));
+ break;
+ }
+
+ if (file.Extension == ".mc" ||
+ file.Extension == ".rc" ||
+ file.Extension == ".c" ||
+ file.Extension == ".cpp" ||
+ file.Extension == ".cxx" ||
+ file.Extension == ".asm" ||
+ file.Extension == ".s")
+ {
+ filename = string.Format("{0}_{1}{2}",
+ Path.GetFileNameWithoutExtension(filename),
+ Module.Name,
+ Path.GetExtension(filename));
+ }
+ else if (file.Extension == ".h")
+ {
+ return filename;
+ }
+
+ return filename;
+ }
+
+ public BackendBuildFile SourceCodeFile
+ {
+ get { return m_SourceCodeFile; }
+ }
+
+ public BackendBuildFile SourceCodeHeaderFile
+ {
+ get { return m_SourceCodeHeaderFile; }
+ }
+
+ public BackendBuildFile SourceCodeObjectFile
+ {
+ get { return m_SourceCodeObjectFile; }
+ }
+
+ public BackendBuildFile SourceCodeActualFile
+ {
+ get { return m_SourceCodeActualFile; }
+ }
+
+ public BackendBuildFile SourceRpcClientHeaderFile
+ {
+ get { return m_SourceRpcClientHeaderFile; }
+ }
+
+ public BackendBuildFile SourceRpcServerHeaderFile
+ {
+ get { return m_SourceRpcServerHeaderFile; }
+ }
+
+ public BackendBuildFile SourceCodePCHeaderFile
+ {
+ get { return m_SourceCodePCHeaderFile; }
+ }
+
+ public RBuildSourceFile File
+ {
+ get { return m_File; }
+ }
+
+ public BackendBuildFile MessageTableHeaderFile
+ {
+ get { return m_SourceMessageTableHeaderFile; }
+ }
+
+ public BackendBuildFile MessageTableResourceFile
+ {
+ get { return m_SourceMessageTableResourceFile; }
+ }
+ }
+
+ public class LibraryModule : BackendBuildModule
+ {
+ BackendBuildFile m_Dependency = null;
+
+ public LibraryModule(RBuildModule module, SysGenEngine sysgen) : base (module , sysgen)
+ {
+ m_Dependency = new BackendBuildFile(sysgen);
+ m_Dependency.BuildFile.Name = module.DependencyName;
+ m_Dependency.BuildFile.Element = module;
+ m_Dependency.BuildFile.Base = module.Base;
+ }
+
+ public BackendBuildFile Dependency
+ {
+ get { return m_Dependency; }
+ }
+ }
+
+ public class BackendBuildModule
+ {
+ SysGenEngine m_SysGenEngine = null;
+ RBuildModule m_Module = null;
+ BackendBuildFile m_Target = null;
+ BackendBuildFile m_TargetNoStrip = null;
+ BackendBuildFile m_Dependency = null;
+ BackendBuildFile m_Definition = null;
+
+ public BackendBuildModule(RBuildModule module, SysGenEngine sysgen)
+ {
+ m_Module = module;
+ m_SysGenEngine = sysgen;
+
+ m_Target = new BackendBuildFile(sysgen);
+ m_Target.BuildFile.Name = module.TargetFile.Name; //module.TargetName;
+ m_Target.BuildFile.Element = module;
+ m_Target.BuildFile.Base = module.TargetFile.Base; //module.Base;
+
+ m_TargetNoStrip = new BackendBuildFile(sysgen);
+ m_TargetNoStrip.BuildFile.Name = GetNoStripTargetName(module);
+ m_TargetNoStrip.BuildFile.Element = module;
+ m_TargetNoStrip.BuildFile.Base = module.Base;
+
+ m_Dependency = new BackendBuildFile(sysgen);
+ m_Dependency.BuildFile.Name = module.DependencyName;
+ m_Dependency.BuildFile.Element = module;
+ m_Dependency.BuildFile.Base = module.Base;
+
+
+ m_Definition = new BackendBuildFile(sysgen);
+ m_Definition.BuildFile.Element = module;
+
+ if (module.ImportLibrary == null)
+ {
+ m_Definition.BuildFile.Name = "tools/rbuild/empty.def";
+ m_Definition.BuildFile.Base = sysgen.BaseDirectory;
+ }
+ else
+ {
+ if (IsWineModule)
+ m_Definition.BuildFile.Root = PathRoot.Intermediate;
+
+ m_Definition.BuildFile.Name = module.ImportLibrary.Definition;
+ m_Definition.BuildFile.Base = module.ImportLibrary.Base;
+ }
+ }
+
+ public bool IsWineModule
+ {
+ get
+ {
+ if (Module.ImportLibrary == null)
+ return false;
+
+ return ((Module.ImportLibrary.Definition != null) &&
+ (Module.ImportLibrary.Definition != string.Empty) &&
+ (Module.ImportLibrary.Definition.Contains(".spec.def")));
+ }
+ }
+
+ public string GetNoStripTargetName(RBuildModule module)
+ {
+ return string.Format("{0}.nostrip{1}",
+ Path.GetFileNameWithoutExtension(module.TargetName),
+ Path.GetExtension(module.TargetName));
+ }
+
+ public string LibTempFileName
+ {
+ get
+ {
+ if (m_Module.Type == ModuleType.StaticLibrary)
+ return m_Module.TargetName;
+
+ return Path.ChangeExtension(m_Module.TargetName, ".temp.a");
+ }
+ }
+
+ public string ExpTempFileName
+ {
+ get
+ {
+ if (m_Module.Type == ModuleType.StaticLibrary)
+ return m_Module.TargetName;
+
+ return Path.ChangeExtension(m_Module.TargetName, ".temp.exp");
+ }
+ }
+
+ public string JunkTempFileName
+ {
+ get
+ {
+ if (m_Module.Type == ModuleType.StaticLibrary)
+ return m_Module.TargetName;
+
+ return Path.ChangeExtension(m_Module.TargetName, ".junk.tmp");
+ }
+ }
+
+ public string RcTempFileName
+ {
+ get
+ {
+ if (m_Module.Type == ModuleType.StaticLibrary)
+ return m_Module.TargetName;
+
+ return Path.ChangeExtension(m_Module.TargetName, ".rci.tmp");
+ }
+ }
+
+ public string ResTempFileName
+ {
+ get
+ {
+ if (m_Module.Type == ModuleType.StaticLibrary)
+ return m_Module.TargetName;
+
+ return Path.ChangeExtension(m_Module.TargetName, ".res.tmp");
+ }
+ }
+
+ public string JunkTempFileNameFullPath
+ {
+ get { return Path.Combine(m_SysGenEngine.GetPathRoot(PathRoot.SourceCode), JunkTempFileName); }
+ }
+
+ public string RcTempFileNameFullPath
+ {
+ get { return Path.Combine(m_SysGenEngine.GetPathRoot(PathRoot.Temporary), RcTempFileName); }
+ }
+
+ public string ResTempFileNameFullPath
+ {
+ get { return Path.Combine(m_SysGenEngine.GetPathRoot(PathRoot.Intermediate), ResTempFileName); }
+ }
+
+ public string ExpTempFileNameFullPath
+ {
+ get { return Path.Combine(m_SysGenEngine.GetPathRoot(PathRoot.SourceCode), ExpTempFileName); }
+ }
+
+ public string LibTempFileNameFullPath
+ {
+ get { return Path.Combine(m_SysGenEngine.GetPathRoot(PathRoot.Intermediate), LibTempFileName); }
+ }
+
+ public string ModuleIntermediateLocation
+ {
+ get { return Path.Combine(m_SysGenEngine.GetPathRoot(PathRoot.Intermediate), Module.Base); }
+ }
+
+ public string ModuleOutputLocation
+ {
+ get { return Path.Combine(m_SysGenEngine.GetPathRoot(PathRoot.Output), Module.Base); }
+ }
+
+ public string ModuleBaseIntermediateLocation
+ {
+ get { return Path.Combine(m_SysGenEngine.GetPathRoot(PathRoot.Intermediate), Module.Base); }
+ }
+
+ public string ModuleBaseOutputLocation
+ {
+ get { return Path.Combine(m_SysGenEngine.GetPathRoot(PathRoot.Output), Module.Base); }
+ }
+
+ public RBuildModule Module
+ {
+ get { return m_Module; }
+ }
+
+ public BackendBuildFile Target
+ {
+ get { return m_Target; }
+ }
+
+ public BackendBuildFile Dependency
+ {
+ get { return m_Dependency; }
+ }
+
+ public BackendBuildFile Definition
+ {
+ get { return m_Definition; }
+ }
+
+ public BackendBuildFile TargetNoStrip
+ {
+ get { return m_TargetNoStrip; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/MingwBackend.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/MingwBackend.cs
new file mode 100644
index 00000000000..356dde7aa9a
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/MingwBackend.cs
@@ -0,0 +1,504 @@
+using System;
+using System.IO;
+using System.Collections;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Backends;
+using SysGen.BuildEngine.Framework;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwBackend : CompilerBaseBacked
+ {
+ public const string ECHO_AR_MACRO = "$(ECHO_AR)";
+ public const string ECHO_CC_MACRO = "$(ECHO_CC)";
+ public const string ECHO_LD_MACRO = "$(ECHO_LD)";
+ public const string ECHO_WRC_MACRO = "$(ECHO_WRC)";
+
+ public const string EMPTY_DEF_FILE = "tools\\rbuild\\empty.def";
+
+ protected bool m_UsePipe = false;
+ protected bool m_UsePch = false;
+ protected bool m_ManualBinUtilsSetting = false;
+
+ protected List m_ModuleHandlers = new List();
+
+ public MingwBackend(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ }
+
+ protected override string FriendlyName
+ {
+ get { return "MINGW32 Backend"; }
+ }
+
+ private void WriteXmlRBuildFiles(MakefileWriter makefile, RBuildProject project)
+ {
+ foreach (string xmlBuildFile in SysGen.BuildFiles)
+ {
+ makefile.WriteIndentedLine(xmlBuildFile);
+ }
+ }
+
+ protected List ModuleHandlers
+ {
+ get { return m_ModuleHandlers; }
+ }
+
+ protected override void Generate()
+ {
+ base.Generate();
+
+ using (MakefileWriter makefile = new MakefileWriter(Directory.GetCurrentDirectory() + "\\" + Project.MakeFile))
+ {
+ makefile.WriteComplexComment("THIS FILE IS AUTOMATICALLY GENERATED, EDIT " + Project.XmlFile + " INSTEAD");
+ makefile.WriteLine();
+
+ makefile.WriteProperty("nasm", "nasm");
+ makefile.WriteProperty("ARCH", "i386");
+
+ foreach (RBuildProperty property in SysGen.Project.Properties)
+ {
+ if (property.Internal == false)
+ {
+ if (property.Value != null)
+ {
+ makefile.WriteProperty(
+ property.Name.ToString(),
+ property.Value.ToString());
+ }
+ }
+ }
+
+ makefile.WriteComplexComment("XML rbuild files");
+
+ makefile.WritePropertyListStart("XMLBUILDFILES");
+ WriteXmlRBuildFiles(makefile, Project);
+ makefile.WritePropertyListEnd();
+
+ MingwRBuildElementHandler projectHandler = new MingwRBuildProjectHandler(Project);
+
+ projectHandler.Makefile = makefile;
+ projectHandler.SysGen = SysGen;
+ projectHandler.GenerateMakeFile();
+
+ //BackendBuildModule cModule;
+ SourceFile cFile;
+ MingwRBuildModuleHandler moduleHandler = null;
+
+ foreach (RBuildModule module in SysGen.Project.Platform.Modules)
+ {
+ makefile.WritePropertyListStart(module.MakeFileSources);
+ foreach (RBuildSourceFile file in module.SourceFiles)
+ {
+ makefile.WriteIndentedLine(file.FullPath);
+ }
+ makefile.WritePropertyListEnd();
+ }
+
+ foreach (RBuildModule module in SysGen.Project.Platform.Modules)
+ {
+ if (module.Type == ModuleType.RpcClient)
+ {
+ makefile.WritePropertyListStart(module.MakeFileRPCHeaders);
+
+ foreach (RBuildSourceFile file in module.SourceFiles)
+ {
+ cFile = new SourceFile(file, module, SysGen);
+
+ if (cFile.File.IsWidl)
+ {
+ makefile.WriteIndentedLine(cFile.SourceRpcClientHeaderFile.IntermediateFullPath);
+ }
+ }
+
+ makefile.WritePropertyListEnd();
+ makefile.WritePropertyListStart(module.MakeFileRPCSources);
+
+ foreach (RBuildSourceFile file in module.SourceFiles)
+ {
+ cFile = new SourceFile(file, module, SysGen);
+
+ if (cFile.File.IsWidl)
+ {
+ makefile.WriteIndentedLine(cFile.SourceCodeActualFile.IntermediateFullPath);
+ }
+ }
+
+ makefile.WritePropertyListEnd();
+ }
+
+ if (module.Type == ModuleType.RpcClient ||
+ module.Type == ModuleType.RpcServer ||
+ module.Type == ModuleType.RpcProxy)
+ {
+ makefile.WritePropertyListStart(module.MakeFileObjs);
+
+ // Procesamos primero los .idl que generan .h que pueden
+ // ser luego requeridos para compilar el resto del módulo.
+
+ foreach (RBuildSourceFile file in module.SourceFiles)
+ {
+ cFile = new SourceFile(file, module, SysGen);
+
+ if (cFile.File.IsWidl)
+ {
+ makefile.WriteIndentedLine(cFile.SourceCodeObjectFile.IntermediateFullPath);
+ }
+ }
+
+ // Luego compilamos el resto de fuentes
+ foreach (RBuildSourceFile file in module.SourceFiles)
+ {
+ cFile = new SourceFile(file, module, SysGen);
+
+ if (!cFile.File.IsWidl && !cFile.File.IsMessageTable)
+ {
+ makefile.WriteIndentedLine(cFile.SourceCodeObjectFile.IntermediateFullPath);
+ }
+ }
+
+ makefile.WritePropertyListEnd();
+ }
+ else
+ {
+ makefile.WritePropertyListStart(module.MakeFileHeaders);
+
+ // Procesamos primero los .idl que generan .h que pueden
+ // ser luego requeridos para compilar el resto del módulo.
+
+ foreach (RBuildSourceFile file in module.SourceFiles)
+ {
+ cFile = new SourceFile(file, module, SysGen);
+
+ if (module.Type == ModuleType.EmbeddedTypeLib)
+ {
+ /* idl files in EmbeddedTypeLib modules do not generate header files */
+ }
+ else
+ {
+ if (cFile.File.IsWidl)
+ {
+ makefile.WriteIndentedLine(cFile.SourceCodeObjectFile.IntermediateFullPath);
+ }
+ }
+ }
+
+ makefile.WritePropertyListEnd();
+ makefile.WritePropertyListStart(module.MakeFilePCHHeaders);
+
+ // Procesamos primero los .idl que generan .h que pueden
+ // ser luego requeridos para compilar el resto del módulo.
+
+ foreach (RBuildSourceFile file in module.SourceFiles)
+ {
+ cFile = new SourceFile(file, module, SysGen);
+
+ if (cFile.File.IsHeader)
+ {
+ makefile.WriteIndentedLine(cFile.SourceCodeObjectFile.IntermediateFullPath);
+ }
+ }
+
+ makefile.WritePropertyListEnd();
+ makefile.WritePropertyListStart(module.MakeFileMCHeaders);
+
+ // Procesamos primero los .idl que generan .h que pueden
+ // ser luego requeridos para compilar el resto del módulo.
+
+ foreach (RBuildSourceFile file in module.SourceFiles)
+ {
+ cFile = new SourceFile(file, module, SysGen);
+
+ if (cFile.File.IsMessageTable)
+ {
+ makefile.WriteIndentedLine(cFile.MessageTableHeaderFile.IntermediateFullPath);
+ }
+ }
+
+ makefile.WritePropertyListEnd();
+ makefile.WritePropertyListStart(module.MakeFileObjs);
+
+ foreach (RBuildSourceFile file in module.SourceFiles)
+ {
+ cFile = new SourceFile(file, module, SysGen);
+ //if (cFile.File.IsCompilable)
+ if (!cFile.File.IsWidl && !cFile.File.IsMessageTable &&!cFile.File.IsHeader)
+ {
+ makefile.WriteIndentedLine(cFile.SourceCodeObjectFile.IntermediateFullPath);
+ }
+ }
+
+ makefile.WritePropertyListEnd();
+ }
+ }
+
+ makefile.WriteLine();
+
+
+ foreach (RBuildModule module in SysGen.Project.Platform.Modules)
+ {
+ moduleHandler = null;
+
+ switch (module.Type)
+ {
+ case ModuleType.RpcClient:
+ moduleHandler = new MingwRpcClientHeaderModuleHandler(module);
+ break;
+ case ModuleType.RpcServer:
+ moduleHandler = new MingwRpcServerHeaderModuleHandler(module);
+ break;
+ case ModuleType.RpcProxy:
+ moduleHandler = new MingwRpcProxyModuleHandler(module);
+ break;
+ case ModuleType.BootLoader:
+ moduleHandler = new MingwBootLoaderModuleHandler(module);
+ break;
+ case ModuleType.BootSector:
+ moduleHandler = new MingwBootSectorModuleHandler(module);
+ break;
+ case ModuleType.IdlHeader:
+ moduleHandler = new MingwIdlHeaderModuleHandler(module);
+ break;
+ case ModuleType.Win32CUI:
+ moduleHandler = new MingwWin32CUIModuleHandler(module);
+ break;
+ case ModuleType.Win32SCR:
+ case ModuleType.Win32GUI:
+ moduleHandler = new MingwWin32GUIModuleHandler(module);
+ break;
+ case ModuleType.Win32DLL:
+ moduleHandler = new MingwWin32DLLModuleHandler(module);
+ break;
+ case ModuleType.Win32OCX:
+ moduleHandler = new MingwWin32OCXModuleHandler(module);
+ break;
+ case ModuleType.KeyboardLayout:
+ case ModuleType.KernelModeDLL:
+ moduleHandler = new MingwKernelModeDLLModuleHandler(module);
+ break;
+ case ModuleType.KernelModeDriver:
+ moduleHandler = new MingwKernelModeDriverModuleHandler(module);
+ break;
+ case ModuleType.Kernel:
+ moduleHandler = new MingwKernelModuleHandler(module);
+ break;
+ case ModuleType.NativeCUI:
+ moduleHandler = new MingwNativeCUIModuleHandler(module);
+ break;
+ case ModuleType.NativeDLL:
+ moduleHandler = new MingwNativeDLLModuleHandler(module);
+ break;
+ case ModuleType.ObjectLibrary:
+ moduleHandler = new MingwObjectLibraryModuleHandler(module);
+ break;
+ case ModuleType.StaticLibrary:
+ moduleHandler = new MingwStaticLibraryModuleHandler(module);
+ break;
+ case ModuleType.EmbeddedTypeLib:
+ moduleHandler = new MingwEmbeddedTypeLibModuleHandler(module);
+ break;
+ case ModuleType.HostStaticLibrary:
+ moduleHandler = new MingwHostStaticLibraryModuleHandler(module);
+ break;
+ case ModuleType.BuildTool:
+ moduleHandler = new MingwBuildToolModuleHandler(module);
+ break;
+ case ModuleType.Cabinet:
+ moduleHandler = new MingwCabinetModuleHandler(module);
+ break;
+ case ModuleType.Iso:
+ moduleHandler = new MingwBootCDTargetHandler(module);
+ break;
+ case ModuleType.LiveIso:
+ moduleHandler = new MingwLiveCDTargetHandler(module);
+ break;
+ case ModuleType.IsoRegTest:
+ moduleHandler = new MingwBootCDRegTestTargetHandler(module);
+ break;
+ case ModuleType.LiveIsoRegTest:
+ moduleHandler = new MingwLiveCDRegTestTargetHandler(module);
+ break;
+ case ModuleType.MessageHeader:
+ moduleHandler = new MingwMessageHeaderModuleHandler(module);
+ break;
+ case ModuleType.Package:
+ moduleHandler = new MingwPackageModuleHandler(module);
+ break;
+ }
+
+ if (moduleHandler != null)
+ {
+ moduleHandler.SysGen = SysGen;
+ moduleHandler.Makefile = makefile;
+ moduleHandler.Project = Project;
+
+ ModuleHandlers.Add(moduleHandler);
+ }
+
+ }
+
+ foreach (MingwRBuildModuleHandler moduleHandler2 in ModuleHandlers)
+ {
+ if (moduleHandler2.Module.IsBuildable) // Hack
+ {
+ makefile.WriteProperty(moduleHandler2.Module.MakeFileTarget, moduleHandler2.ModuleTarget);
+ }
+ }
+
+ foreach (MingwRBuildModuleHandler moduleHandler2 in ModuleHandlers)
+ {
+ if (moduleHandler2.Module.IsBuildable) // Hack
+ {
+ makefile.WriteComplexComment("Buid instructions for module '{0}' on '{1}' [{2}]",
+ moduleHandler2.Module.Name,
+ moduleHandler2.Module.Base,
+ moduleHandler2.Module.Type);
+
+ moduleHandler2.GenerateMakeFile();
+
+ makefile.WritePhonyTarget(moduleHandler2.Module.MakeFileMakeTarget);
+ makefile.WriteRule(moduleHandler2.Module.Name, moduleHandler2.Module.MakeFileTargetMacro);
+ makefile.WriteLine();
+
+ makefile.WriteSingleLineTarget(moduleHandler2.Module.MakeFileInfoTarget);
+ makefile.WriteLine("\t@echo =======================Module Info============================");
+ makefile.WriteLine("\t@echo Name: '{0}'", moduleHandler2.Module.Name);
+ makefile.WriteLine("\t@echo Type: '{0}'", moduleHandler2.Module.Type);
+ makefile.WriteLine("\t@echo Base: '{0}'", moduleHandler2.Module.Base);
+ makefile.WriteLine("\t@echo XML: '{0}'", moduleHandler2.Module.RBuildPath);
+ makefile.WriteLine("\t@echo Target: '{0}'", moduleHandler2.Module.TargetName);
+ makefile.WriteLine("\t@echo ===============================================================");
+ makefile.WriteLine();
+
+ makefile.WriteSingleLineTarget(moduleHandler2.Module.MakeFileFlagDebugTarget);
+ makefile.WriteLine("\t@echo =======================Module Debug Info=======================");
+ makefile.WriteLine("\t@echo CFLAGS: '{0}'", moduleHandler2.Module.MakeFileCFlagsMacro);
+ makefile.WriteLine("\t@echo LFLAGS: '{0}'", moduleHandler2.Module.MakeFileLFlagsMacro);
+ makefile.WriteLine("\t@echo LIBS: '{0}'", moduleHandler2.Module.MakeFileLibsMacro);
+ makefile.WriteLine("\t@echo LINKDEPS: '{0}'", moduleHandler2.Module.MakeFileLinkDepsMacro);
+ makefile.WriteLine("\t@echo NASM: '{0}'", moduleHandler2.Module.MakeFileNASMMacro);
+ makefile.WriteLine("\t@echo OBJS: '{0}'", moduleHandler2.Module.MakeFileObjsMacro);
+ makefile.WriteLine("\t@echo RCFLAGS: '{0}'", moduleHandler2.Module.MakeFileRCFlagsMacro);
+ makefile.WriteLine("\t@echo TARGET: '{0}'", moduleHandler2.Module.MakeFileTargetMacro);
+ makefile.WriteLine("\t@echo WIDL: '{0}'", moduleHandler2.Module.MakeFileWIDLFlagsMacro);
+ makefile.WriteLine("\t@echo ===============================================================");
+ makefile.WriteLine();
+ }
+ }
+
+ GenerateAllTarget(makefile);
+ GenerateCleanTarget(makefile);
+ GenerateInstallTarget(makefile);
+ GenerateTestTarget(makefile);
+ }
+ }
+
+ private void GenerateAllTarget(MakefileWriter makefile)
+ {
+ makefile.WriteComplexComment("Generate the ALL target");
+ makefile.WriteTarget("all");
+
+ foreach (RBuildModule module in SysGen.Project.Platform.Modules)
+ {
+ if ((module.Enabled) && (module.IncludeInAllTarget))
+ {
+ makefile.WriteIndentedLine(module.MakeFileTargetMacro);
+ }
+ }
+ }
+
+ private void GenerateCleanTarget(MakefileWriter makefile)
+ {
+ makefile.WriteComplexComment("Generate the CLEAN target");
+ makefile.WriteTarget("clean");
+
+ foreach (RBuildModule module in SysGen.Project.Platform.Modules)
+ {
+ makefile.WriteIndentedLine(module.MakeFileCleanTarget);
+ }
+ }
+
+ private void GenerateInstallTarget(MakefileWriter makefile)
+ {
+ makefile.WriteComplexComment("Generate the INSTALL target");
+ makefile.WriteTarget("install");
+
+ //foreach (RBuildModule module in SysGen.Project.Platform.Modules)
+ //{
+ // makefile.WriteIndentedLine(module.MakeFileCleanTarget);
+ //}
+ }
+
+ private void GenerateTestTarget(MakefileWriter makefile)
+ {
+ RBuildFolderCollection folders = new RBuildFolderCollection();
+
+ makefile.WriteComplexComment("Generate the TEST target");
+ makefile.WriteSingleLineTarget("test");
+
+ foreach (RBuildFolder folder in Project.Folders)
+ {
+ if (folders.Contains(folder) == false)
+ folders.Add(folder);
+ }
+
+ foreach (RBuildModule module in Project.Modules)
+ {
+ foreach (RBuildFolder folder in module.Folders)
+ {
+ if (folders.Contains(folder) == false)
+ folders.Add(folder);
+ }
+ }
+
+ foreach (RBuildInstallFolder folder in Project.InstallFolders)
+ {
+ if (folders.Contains(folder) == false)
+ folders.Add(folder);
+ }
+
+ foreach (RBuildFolder folder in folders)
+ {
+ GenerateFolder(makefile, folder);
+ }
+ }
+
+ private void GenerateFolder(MakefileWriter makefile, RBuildFolder folder)
+ {
+ if ((folder.Root == PathRoot.Default) ||
+ (folder.Root == PathRoot.SourceCode))
+ {
+ makefile.WriteLine("{0}: | {1}",
+ SysGen.ResolveRBuildFilePath(new RBuildFolder(PathRoot.Intermediate, folder.FullPath)),
+ SysGen.ResolveRBuildFilePath(new RBuildFolder(PathRoot.Intermediate, folder.Parent.FullPath)));
+
+ makefile.WriteSingleLineIndented("$(ECHO_MKDIR)");
+ makefile.WriteSingleLineIndented("$(mkdir) $@");
+
+ makefile.WriteLine("{0}: | {1}",
+ SysGen.ResolveRBuildFilePath(new RBuildFolder(PathRoot.Output, folder.FullPath)),
+ SysGen.ResolveRBuildFilePath(new RBuildFolder(PathRoot.Output, folder.Parent.FullPath)));
+
+ makefile.WriteSingleLineIndented("$(ECHO_MKDIR)");
+ makefile.WriteSingleLineIndented("$(mkdir) $@");
+ }
+
+ //Create the install and output folders
+ if (folder.Root == PathRoot.Output ||
+ folder.Root == PathRoot.Install)
+ {
+ makefile.WriteLine("{0}: | {1}",
+ SysGen.ResolveRBuildFilePath(new RBuildFolder(folder.Root, folder.FullPath)),
+ SysGen.ResolveRBuildFilePath(new RBuildFolder(folder.Root, folder.Parent.FullPath)));
+
+ makefile.WriteSingleLineIndented("$(ECHO_MKDIR)");
+ makefile.WriteSingleLineIndented("$(mkdir) $@");
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/MingwRBuildElementHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/MingwRBuildElementHandler.cs
new file mode 100644
index 00000000000..f76bcc21151
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/MingwRBuildElementHandler.cs
@@ -0,0 +1,923 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public enum LinkerSubSystem
+ {
+ Windows,
+ Console,
+ Native
+ }
+
+ public abstract class MingwRBuildMakefileGenerator
+ {
+ protected SysGenEngine m_SysGenEngine = null;
+ protected MakefileWriter m_Makefile = null;
+
+ public SysGenEngine SysGen
+ {
+ get { return m_SysGenEngine; }
+ set { m_SysGenEngine = value; }
+ }
+
+ public MakefileWriter Makefile
+ {
+ get { return m_Makefile; }
+ set { m_Makefile = value; }
+ }
+
+ protected virtual string ResolveRBuildFilePath(RBuildFile file)
+ {
+ return SysGen.ResolveRBuildFilePath(file);
+ }
+
+ protected virtual string ResolveRBuildFolderPath(RBuildFolder folder)
+ {
+ return SysGen.ResolveRBuildFolderPath(folder);
+ }
+
+ public virtual string ResolveRBuildFilePath(PathRoot root, RBuildFileSystemInfo file)
+ {
+ return SysGen.ResolveRBuildFilePath(root , file);
+ }
+
+ public abstract void GenerateMakeFile();
+ }
+
+ public abstract class MingwRBuildElementHandler : MingwRBuildMakefileGenerator
+ {
+ protected RBuildElement m_BuildElement = null;
+
+ public MingwRBuildElementHandler(RBuildElement element)
+ {
+ m_BuildElement = element;
+ }
+
+ public override void GenerateMakeFile()
+ {
+ /* Do checking */
+ CheckSourceFiles();
+
+ /* Do makefile generation */
+ WriteCommon();
+ WriteSpecific();
+ //WritePCHFiles();
+ WriteFiles();
+ WriteLinker();
+ WriteImportLibrary();
+ WriteCleanTarget();
+ }
+
+ protected virtual void WriteFolders()
+ {
+ Makefile.WritePropertyListStart(BuildElement.MakeFileFolders);
+ WriteElementFolders(Makefile, BuildElement);
+ Makefile.WritePropertyListEnd();
+ }
+
+ protected virtual void CheckSourceFiles()
+ {
+ }
+
+ protected virtual void WriteCommon()
+ {
+ WriteFolders();
+ WriteCFlags();
+ WriteRCFlags();
+ WriteLFlags();
+ WriteWIDLFlags();
+ }
+
+ protected virtual void WriteStrip()
+ {
+ }
+
+ protected virtual void WriteNonSymbolStripped()
+ {
+ }
+
+ protected virtual void WriteRsym()
+ {
+ }
+
+ protected virtual void WriteImportLibrary()
+ {
+ }
+
+ protected virtual void WriteLinker()
+ {
+ }
+
+ protected virtual void WriteCleanTarget()
+ {
+ }
+
+ protected virtual void WriteSpecific()
+ {
+ }
+
+ protected virtual void WriteFiles()
+ {
+ }
+
+ protected virtual void WritePCHFiles()
+ {
+ }
+
+ protected virtual void WriteCFlags()
+ {
+ Makefile.WritePropertyListStart(BuildElement.MakeFileCFlags);
+ WriteElementIncludes(Makefile, BuildElement);
+ WriteElementDefines(Makefile, BuildElement);
+ Makefile.WritePropertyListEnd();
+ }
+
+ protected virtual void WriteLFlags()
+ {
+ Makefile.WritePropertyListStart(BuildElement.MakeFileLFlags);
+ WriteLinkerFlags(Makefile, BuildElement);
+ Makefile.WritePropertyListEnd();
+ }
+
+ protected virtual void WriteRCFlags()
+ {
+ Makefile.WriteProperty(BuildElement.MakeFileRCFlags, BuildElement.MakeFileCFlagsMacro);
+ }
+
+ protected virtual void WriteWIDLFlags()
+ {
+ Makefile.WriteProperty(BuildElement.MakeFileWIDLFlags, BuildElement.MakeFileCFlagsMacro);
+ }
+
+ protected void WriteElementDefines(MakefileWriter makefile, RBuildElement element)
+ {
+ foreach (RBuildDefine define in element.Defines)
+ {
+ if (!define.IsEmpty)
+ {
+ makefile.WriteIndentedLine("-D" + define.Name + "=" + define.Value);
+ }
+ else
+ makefile.WriteIndentedLine("-D" + define.Name);
+ }
+ }
+
+ protected void WriteElementDependencyFlags(MakefileWriter makefile, RBuildModule module)
+ {
+ foreach (RBuildModule dependency in module.Dependencies)
+ {
+ Makefile.WriteIndentedLine(dependency.MakeFileTargetMacro);
+ }
+ }
+
+ protected void WriteElementIncludes(MakefileWriter makefile, RBuildElement element)
+ {
+ foreach (RBuildFolder includeFolder in element.IncludeFolders)
+ {
+ Makefile.WriteIndentedLine("-I" + ResolveRBuildFolderPath(includeFolder));
+ }
+ }
+
+ protected void WriteElementFolders(MakefileWriter makefile, RBuildElement element)
+ {
+ foreach (RBuildFolder folder in element.Folders)
+ {
+ Makefile.WriteIndentedLine(ResolveRBuildFolderPath(folder));
+ }
+ }
+
+ protected void WriteModuleAssemblyFlags(MakefileWriter makefile, RBuildModule module)
+ {
+ foreach (string assemblyFlag in module.AssemblyFlags)
+ {
+ Makefile.WriteIndentedLine(assemblyFlag);
+ }
+ }
+
+ protected void WriteCompilerFlags(MakefileWriter makefile, RBuildElement element)
+ {
+ foreach (string compilerFlag in element.CompilerFlags)
+ {
+ Makefile.WriteIndentedLine(compilerFlag);
+ }
+ }
+
+ protected void WriteLinkerFlags(MakefileWriter makefile, RBuildElement element)
+ {
+ foreach (string linkerFlag in element.LinkerFlags)
+ {
+ Makefile.WriteIndentedLine(linkerFlag);
+ }
+ }
+
+ public RBuildElement BuildElement
+ {
+ get { return m_BuildElement; }
+ }
+ }
+
+ public abstract class MingwRBuildModuleHandler : MingwRBuildElementHandler
+ {
+ private RBuildProject m_Project = null;
+ private RBuildModule m_Module = null;
+
+ private BackendBuildModule m_CompModule = null;
+ private BackedBuildFolder m_Folder = null;
+
+ public MingwRBuildModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ m_Module = module;
+ }
+
+ ////Para que sirve?
+ //public bool ReferenceObjects
+ //{
+ // get
+ // {
+ // switch (Module.Type)
+ // {
+ // case ModuleType.RpcServer:
+ // case ModuleType.RpcClient:
+ // case ModuleType.RpcProxy:
+ // case ModuleType.ObjectLibrary:
+ // //case ModuleType.IdlHeader:
+ // //case ModuleType.MessageHeader:
+ // return true;
+ // }
+
+ // return false;
+ // }
+ //}
+
+ public string ModuleTarget
+ {
+ get
+ {
+ if (Module.Type == ModuleType.IdlHeader)
+ return Module.MakeFileHeadersMacro;
+
+ if (Module.Type == ModuleType.MessageHeader)
+ return Module.MakeFileMCHeadersMacro;
+
+ if (Module.Type == ModuleType.RpcServer ||
+ Module.Type == ModuleType.RpcClient ||
+ Module.Type == ModuleType.RpcProxy ||
+ Module.Type == ModuleType.ObjectLibrary)
+ {
+ return Module.MakeFileObjsMacro;
+ }
+
+ if (Module.TargetFile.Root == PathRoot.Intermediate ||
+ Module.TargetFile.Root == PathRoot.Output ||
+ Module.TargetFile.Root == PathRoot.Default)
+ {
+ return ResolveRBuildFilePath(Module.TargetFile);
+ }
+ else
+ throw new BuildException("Don't know module target");
+ }
+ }
+
+ public override void GenerateMakeFile()
+ {
+ //m_Project = SysGen.Project;
+
+ m_CompModule = new BackendBuildModule(Module, SysGen);
+ m_Folder = new BackedBuildFolder(SysGen);
+ m_Folder.BuildFolder.Base = Module.Folder.Base;
+ m_Folder.BuildFolder.Name = Module.Folder.Name;
+ m_Folder.BuildFolder.Element = Module;
+
+ // Si se trata de un WinModule agregamos un include a la carpeta intermedia
+ // ya que algunas dlls de wine generan ahi sus recursos incrustrados como iconos
+ // o bitmaps
+ if (CompilableModule.IsWineModule)
+ {
+ Module.IncludeFolders.Add(new RBuildFolder(PathRoot.Intermediate, Module.Base));
+ }
+
+ // Llamamos a la clase base
+ base.GenerateMakeFile();
+ }
+
+ protected override void WriteFiles()
+ {
+ foreach (RBuildSourceFile file in Module.SourceFiles)
+ {
+ SourceFile sourceFile = new SourceFile(file, Module, SysGen);
+
+ if (CanCompile(file))
+ {
+ WriteFileBuildInstructions(sourceFile);
+ }
+ else
+ throw new Exception("Don't know how to write build instructions for '" + sourceFile.SourceCodeFile.OriginalFullPath + "' on module '" + Module.Name + "'");
+ }
+ }
+
+ protected abstract void WriteFileBuildInstructions(SourceFile sourceFile);
+
+ protected abstract bool CanCompile(RBuildSourceFile file);
+
+ protected override void WriteSpecific()
+ {
+ WriteModuleCommon();
+ WritePreconditions();
+ }
+
+ protected virtual void WritePreconditions()
+ {
+ Makefile.WritePropertyAppendListStart(Module.MakeFilePreCondition);
+ WriteElementDependencyFlags(Makefile, Module);
+ Makefile.WritePropertyListEnd();
+ Makefile.WriteLine();
+
+ foreach (RBuildSourceFile file in Module.SourceFiles)
+ {
+ if (file.IsCompilable)
+ {
+ Makefile.WriteLine("{0}: {1}", ResolveRBuildFilePath(file), Module.MakeFilePreConditionMacro);
+ }
+ }
+
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteWidl()
+ {
+ Makefile.WritePropertyListStart(Module.MakeFileWIDLFlags);
+ WriteElementIncludes(Makefile, Module);
+ Makefile.WritePropertyListEnd();
+
+ Makefile.WritePropertyAppend(Module.MakeFileWIDLFlags, Project.MakeFileWIDLFlagsMacro);
+ }
+
+ protected virtual void WriteLibs()
+ {
+ Makefile.WritePropertyListStart(Module.MakeFileLibs);
+
+ foreach (RBuildModule dependency in Module.Libraries)
+ {
+ if (dependency.IsDLL || dependency.IsLibrary || dependency.IsRPC)
+ {
+ if (dependency.Type == ModuleType.ObjectLibrary ||
+ dependency.Type == ModuleType.RpcClient ||
+ dependency.Type == ModuleType.RpcServer ||
+ dependency.Type == ModuleType.RpcProxy)
+ {
+ Makefile.WriteIndentedLine(dependency.MakeFileTargetMacro);
+ }
+ else
+ {
+ Makefile.WriteIndentedLine(ResolveRBuildFilePath(dependency.Dependency));
+ }
+ }
+ }
+
+ Makefile.WritePropertyListEnd();
+ }
+
+ protected void WriteModuleCommon()
+ {
+ WriteLibs();
+ WriteWidl();
+
+ if (Module.Host == false)
+ {
+ Makefile.WritePropertyAppend(Module.MakeFileCFlags, Project.MakeFileCFlagsMacro);
+ Makefile.WritePropertyAppend(Module.MakeFileRCFlags, Project.MakeFileRCFlagsMacro);
+ Makefile.WritePropertyAppend(Module.MakeFileLFlags, Project.MakeFileLFlagsMacro);
+ }
+ else
+ {
+ Makefile.WritePropertyAppend(Module.MakeFileLFlags, "$(HOST_LFLAGS)");
+ }
+
+ WriteLinkDeps();
+
+ if (Module.AssemblyFlags.Count > 0)
+ {
+ Makefile.WritePropertyListStart(Module.MakeFileNASMFlags);
+ WriteModuleAssemblyFlags(Makefile, Module);
+ Makefile.WritePropertyListEnd();
+ }
+
+ Makefile.WritePropertyAppendListStart(Module.MakeFileCFlags);
+ WriteCompilerFlags(Makefile, Module);
+ Makefile.WritePropertyListEnd();
+
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteLinkDeps()
+ {
+ Makefile.WritePropertyAppend(Module.MakeFileLinkDeps, Module.MakeFileLibsMacro);
+ }
+
+ public virtual string RpcHeaderDependencies
+ {
+ get
+ {
+ string dependencies = string.Empty;
+
+ foreach (RBuildModule module in Module.Libraries)
+ {
+ if ((module.Type == ModuleType.RpcClient) ||
+ (module.Type == ModuleType.RpcServer) ||
+ (module.Type == ModuleType.IdlHeader)) /// se puede eliminar esta linea?
+ {
+ foreach (RBuildSourceFile file in module.SourceFiles)
+ {
+ SourceFile sourceFile = new SourceFile(file, module, SysGen);
+
+ if (file.IsWidl)
+ {
+ if (module.Type == ModuleType.RpcClient)
+ dependencies += " " + sourceFile.SourceRpcClientHeaderFile.IntermediateFullPath;
+
+ if (module.Type == ModuleType.RpcServer)
+ dependencies += " " + sourceFile.SourceRpcServerHeaderFile.IntermediateFullPath;
+
+ //dependencies += " " + sourceFile.SourceCodeHeaderFile.IntermediateFullPath;
+ }
+ }
+ }
+ }
+
+ return dependencies;
+ }
+ }
+
+ public virtual string DefinitionDependencies
+ {
+ get
+ {
+ string dependencies = string.Empty;
+
+ foreach (RBuildSourceFile file in Module.SourceFiles)
+ {
+ SourceFile sourceFile = new SourceFile(file, Module, SysGen);
+
+ if (file.IsWineBuild)
+ {
+ dependencies += " " + CompilableModule.Definition.OriginalFullPath;
+ dependencies += " " + sourceFile.SourceCodeActualFile.IntermediateFullPath;
+ }
+ else if (file.IsWidl)
+ {
+ if (Module.Type == ModuleType.RpcClient ||
+ Module.Type == ModuleType.RpcServer)
+ {
+ dependencies += " " + sourceFile.SourceCodeActualFile.IntermediateFullPath;
+ }
+ }
+ }
+
+ return dependencies;
+ }
+ }
+
+ public string Linker
+ {
+ get
+ {
+ if (Module.CPlusPlus)
+ return CPPCompiler;
+
+ return CCompiler;
+ }
+ }
+
+ public string PCHCompiler
+ {
+ get
+ {
+ if (Module.CPlusPlus)
+ return CPPCompiler;
+
+ return CCompiler;
+ }
+ }
+
+ public string CCompiler
+ {
+ get { return (Module.Host ? "$(host_gcc)" : "$(gcc)"); }
+ }
+
+ public string CPPCompiler
+ {
+ get { return (Module.Host ? "$(host_gpp)" : "$(gpp)"); }
+ }
+
+ public string ArchiveCompiler
+ {
+ get { return (Module.Host ? "$(host_ar)" : "$(ar)"); }
+ }
+
+ protected virtual void WriteAr()
+ {
+ Makefile.WriteLine(m_CompModule.Target.IntermediateFullPath + ": " + Module.MakeFileObjsMacro + " | " + ModuleFolder.IntermediateFullPath);
+ Makefile.WriteLine("\t$(ECHO_AR)");
+
+ if (Module.Type == ModuleType.StaticLibrary ||
+ Module.Type == ModuleType.HostStaticLibrary)
+ {
+ if (Module.ImportLibrary != null)
+ {
+ Makefile.WriteLine("\t${dlltool} --dllname " + Module.ImportLibrary.DllName + " --def " + CompilableModule.Definition.OriginalFullPath + " --output-lib $@ " + MangledSymbols + " " + UnderscoreSymbols);
+ }
+ }
+
+ Makefile.WriteLine("\t${ar} -rc $@ " + Module.MakeFileObjsMacro);
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteWindResCompiler(SourceFile sourceFile)
+ {
+ Makefile.WriteLine(sourceFile.SourceCodeObjectFile.IntermediateFullPath + ": " + sourceFile.SourceCodeFile.OriginalFullPath + " $(wrc_TARGET) " + " | " + sourceFile.SourceCodeFile.IntermediateFolderFullPath);
+ Makefile.WriteLine("\t$(ECHO_WRC)");
+ Makefile.WriteLine("\t" + CCompiler + " -xc -E -DRC_INVOKED " + Module.MakeFileRCFlagsMacro + " " + sourceFile.SourceCodeFile.OriginalFullPath + " > " + CompilableModule.RcTempFileNameFullPath);
+ Makefile.WriteLine("\t$(Q)$(wrc_TARGET) " + Module.MakeFileRCFlagsMacro + " " + CompilableModule.RcTempFileNameFullPath + " " + CompilableModule.ResTempFileNameFullPath);
+ Makefile.WriteLine("\t-@${rm} " + CompilableModule.RcTempFileNameFullPath + " 2>$(NUL)");
+ Makefile.WriteLine("\t${windres} " + CompilableModule.ResTempFileNameFullPath + " -o $@");
+ Makefile.WriteLine("\t-@${rm} " + CompilableModule.ResTempFileNameFullPath + " 2>$(NUL)");
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteWIDLTypeLibrary(SourceFile file)
+ {
+ Makefile.WriteLine(file.Target.IntermediateFullPath + ": " + file.SourceCodeFile.OriginalFullPath + " $(widl_TARGET) " + " | " + ModuleFolder.IntermediateFullPath);
+ Makefile.WriteLine("\t$(ECHO_WIDL)");
+ Makefile.WriteLine("\t$(Q)$(widl_TARGET) " + Module.MakeFileWIDLFlagsMacro + " -t -T " + file.Target.IntermediateFullPath + " " + file.SourceCodeFile.OriginalFullPath);
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteWIDLHeader(SourceFile file)
+ {
+ Makefile.WriteLine(file.SourceCodeObjectFile.IntermediateFullPath + ": " + file.SourceCodeFile.OriginalFullPath + " $(widl_TARGET) " + " | " + ModuleFolder.IntermediateFullPath);
+ Makefile.WriteLine("\t$(ECHO_WIDL)");
+ Makefile.WriteLine("\t$(Q)$(widl_TARGET) " + Module.MakeFileWIDLFlagsMacro + " -h -H " + file.SourceCodeObjectFile.IntermediateFullPath + " " + file.SourceCodeFile.OriginalFullPath);
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteWIDLRpcHeader(SourceFile file)
+ {
+ Makefile.WriteLine(file.SourceCodeActualFile.IntermediateFullPath + " " + file.SourceCodeHeaderFile.IntermediateFullPath + ": " + file.SourceCodeFile.OriginalFullPath + " $(widl_TARGET) | " + ModuleFolder.IntermediateFullPath);
+ Makefile.WriteLine("\t$(ECHO_WIDL)");
+
+ if (Module.Type == ModuleType.RpcServer)
+ {
+ Makefile.WriteLine("\t$(Q)$(widl_TARGET) " + file.File.Switches + " " + Module.MakeFileWIDLFlagsMacro + " -h -H " + file.SourceCodeHeaderFile.IntermediateFullPath + " -s -S " + file.SourceCodeActualFile.IntermediateFullPath + " " + file.SourceCodeFile.OriginalFullPath);
+ Makefile.WriteLine();
+ }
+ else if (Module.Type == ModuleType.RpcClient)
+ {
+ Makefile.WriteLine("\t$(Q)$(widl_TARGET) " + file.File.Switches + " " + Module.MakeFileWIDLFlagsMacro + " -h -H " + file.SourceCodeHeaderFile.IntermediateFullPath + " -c -C " + file.SourceCodeActualFile.IntermediateFullPath + " " + file.SourceCodeFile.OriginalFullPath);
+ Makefile.WriteLine();
+ }
+ else if (Module.Type == ModuleType.RpcProxy)
+ {
+ Makefile.WriteLine("\t$(Q)$(widl_TARGET) " + file.File.Switches + " " + Module.MakeFileWIDLFlagsMacro + " -h -H " + file.SourceCodeHeaderFile.IntermediateFullPath + " -p -P " + file.SourceCodeActualFile.IntermediateFullPath + " " + file.SourceCodeFile.OriginalFullPath);
+ Makefile.WriteLine();
+ }
+
+ if (Module.Type == ModuleType.RpcServer ||
+ Module.Type == ModuleType.RpcClient)
+ {
+ Makefile.WriteLine(file.SourceCodeObjectFile.IntermediateFullPath + ": " + file.SourceCodeActualFile.IntermediateFullPath + " " + file.SourceRpcServerHeaderFile.IntermediateFullPath + " " + file.SourceRpcClientHeaderFile.IntermediateFullPath + " | " + ModuleFolder.IntermediateFullPath);
+ Makefile.WriteLine("\t$(ECHO_CC)");
+ Makefile.WriteLine("\t" + CCompiler + " -c $< -o $@ " + Module.MakeFileCFlagsMacro);
+ Makefile.WriteLine();
+ }
+ else if (Module.Type == ModuleType.RpcProxy)
+ {
+ Makefile.WriteLine(file.SourceCodeObjectFile.IntermediateFullPath + ": " + file.SourceCodeActualFile.IntermediateFullPath + " " + file.SourceCodeHeaderFile.IntermediateFullPath + " | " + ModuleFolder.IntermediateFullPath);
+ Makefile.WriteLine("\t$(ECHO_CC)");
+ Makefile.WriteLine("\t" + CCompiler + " -c $< -o $@ " + Module.MakeFileCFlagsMacro);
+ Makefile.WriteLine();
+ }
+ }
+
+ protected virtual void WriteWineBuild(SourceFile sourceFile)
+ {
+ Makefile.WriteLine(CompilableModule.Definition.IntermediateFullPath + ": " + sourceFile.SourceCodeFile.OriginalFullPath + " $(winebuild_TARGET) | " + ModuleFolder.IntermediateFullPath);
+ Makefile.WriteLine("\t$(ECHO_WINEBLD)");
+ Makefile.WriteLine("\t$(Q)$(winebuild_TARGET) $(WINEBUILD_FLAGS) -o " + CompilableModule.Definition.IntermediateFullPath + " --def -E " + sourceFile.SourceCodeFile.OriginalFullPath);
+ Makefile.WriteLine();
+
+ Makefile.WriteLine(sourceFile.SourceCodeActualFile.IntermediateFullPath + ": " + sourceFile.SourceCodeFile.OriginalFullPath + " $(winebuild_TARGET)");
+ Makefile.WriteLine("\t$(ECHO_WINEBLD)");
+ Makefile.WriteLine("\t$(Q)$(winebuild_TARGET) $(WINEBUILD_FLAGS) -o " + sourceFile.SourceCodeActualFile.IntermediateFullPath + " --pedll " + sourceFile.SourceCodeFile.OriginalFullPath);
+ Makefile.WriteLine();
+
+ Makefile.WriteLine(sourceFile.SourceCodeObjectFile.IntermediateFullPath + ": " + sourceFile.SourceCodeActualFile.IntermediateFullPath + " | " + ModuleFolder.IntermediateFullPath);
+ Makefile.WriteLine("\t$(ECHO_CC)");
+ Makefile.WriteLine("\t" + CCompiler + " -c $< -o $@ " + Module.MakeFileCFlagsMacro);
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WritePCH(SourceFile sourceFile)
+ {
+ Makefile.WriteLine(sourceFile.SourceCodeObjectFile.IntermediateFullPath + ": " + sourceFile.SourceCodeFile.OriginalFullPath + " " + RpcHeaderDependencies + " | " + sourceFile.SourceCodeFile.IntermediateFolderFullPath);
+ Makefile.WriteLine("\t$(ECHO_PCH)");
+ Makefile.WriteLine("\t" + PCHCompiler + " -o " + sourceFile.SourceCodeObjectFile.IntermediateFullPath + " " + Module.MakeFileCFlagsMacro + " -g " + sourceFile.SourceCodeFile.OriginalFullPath);
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteCCompiler(SourceFile sourceFile)
+ {
+ Makefile.WriteLine(sourceFile.SourceCodeObjectFile.IntermediateFullPath + ": " + sourceFile.SourceCodeFile.OriginalFullPath + " " + Module.MakeFileHeadersMacro + " " + PrecompiledHeader + " " + RpcHeaderDependencies + " | " + sourceFile.SourceCodeFile.IntermediateFolderFullPath);
+ Makefile.WriteLine("\t$(ECHO_CC)");
+ Makefile.WriteLine("\t" + CCompiler + " -c $< -o $@ " + Module.MakeFileCFlagsMacro);
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteWMC(SourceFile sourceFile)
+ {
+ Makefile.WriteLine(sourceFile.MessageTableHeaderFile.IntermediateFullPath + " " + sourceFile.MessageTableResourceFile.IntermediateFullPath + ": " + "$(wmc_TARGET)" + " " + sourceFile.SourceCodeFile.OriginalFullPath + " | " + sourceFile.MessageTableHeaderFile.IntermediateFolderFullPath + " " + sourceFile.MessageTableResourceFile.IntermediateFolderFullPath);
+ Makefile.WriteLine("\t$(ECHO_WMC)");
+ Makefile.WriteLine("\t$(Q)$(wmc_TARGET) -i -H " + sourceFile.MessageTableHeaderFile.IntermediateFullPath + " -o " + sourceFile.MessageTableResourceFile.IntermediateFullPath + " " + sourceFile.SourceCodeFile.OriginalFullPath);
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteCPPCompiler(SourceFile sourceFile)
+ {
+ Makefile.WriteLine(sourceFile.SourceCodeObjectFile.IntermediateFullPath + ": " + sourceFile.SourceCodeFile.OriginalFullPath + " " + Module.MakeFileHeadersMacro + " " + PrecompiledHeader + " " + RpcHeaderDependencies + " | " + sourceFile.SourceCodeFile.IntermediateFolderFullPath);
+ Makefile.WriteLine("\t$(ECHO_CC)");
+ Makefile.WriteLine("\t" + CPPCompiler + " -c $< -o $@ " + Module.MakeFileCFlagsMacro);
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteNASMCompiler(SourceFile sourceFile)
+ {
+ Makefile.WriteLine(sourceFile.SourceCodeObjectFile.IntermediateFullPath + ": " + sourceFile.SourceCodeFile.OriginalFullPath + " | " + sourceFile.SourceCodeFile.IntermediateFolderFullPath /*+ ModuleFolder.IntermediateFullPath*/);
+ Makefile.WriteLine("\t$(ECHO_NASM)");
+ Makefile.WriteLine("\t$(Q)${nasm} -f win32 $< -o $@ " + Module.MakeFileNASMMacro);
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteASMCompiler(SourceFile sourceFile)
+ {
+ Makefile.WriteLine(sourceFile.SourceCodeObjectFile.IntermediateFullPath + ": " + sourceFile.SourceCodeFile.OriginalFullPath + " | " + sourceFile.SourceCodeFile.IntermediateFolderFullPath /*+ ModuleFolder.IntermediateFullPath*/);
+ Makefile.WriteLine("\t$(ECHO_GAS)");
+ Makefile.WriteLine("\t" + CCompiler + " -x assembler-with-cpp -c $< -o $@ -D__ASM__ " + Module.MakeFileCFlagsMacro);
+ Makefile.WriteLine();
+ }
+
+ protected override void WriteRsym()
+ {
+ Makefile.WriteLine("\t$(ECHO_RSYM)");
+ Makefile.WriteLine("\t$(Q)$(RSYM_TARGET) $@ $@");
+ Makefile.WriteLine();
+ }
+
+ protected override void WriteStrip()
+ {
+ if (SysGen.Project.Properties["ROS_LEAN_AND_MEAN"] != null)
+ {
+ //No s'ha provat
+ Makefile.WriteLine("\t$(ECHO_STRIP)");
+ Makefile.WriteLine("\t${strip} -s -x -X $@");
+ Makefile.WriteLine();
+ }
+ }
+
+ protected override void WriteNonSymbolStripped()
+ {
+ if (SysGen.Project.Properties["ROS_BUILDNOSTRIP"] != null)
+ {
+ //No s'ha provat
+ Makefile.WriteLine("\t$(ECHO_CP)");
+ Makefile.WriteLine("\t$(cp) " + m_CompModule.TargetNoStrip.OutputFullPath + " 1>$(NUL)");
+ Makefile.WriteLine();
+ }
+ }
+
+ protected override void WriteLinker()
+ {
+ //Makefile.WriteLine(Module.MakeFileTargetMacro + ": " + CompilableModule.Definition.OriginalFullPath + " " + Module.MakeFileLinkDepsMacro + " " + Module.MakeFileObjsMacro + " $(RSYM_TARGET) $(PEFIXUP_TARGET) | " + /*ModuleFolder.TemporaryFullPath*/ ModuleFolder.OutputFullPath);
+ Makefile.WriteLine(Module.MakeFileTargetMacro + ": " + Definition + " " + Module.MakeFileLinkDepsMacro + " " + Module.MakeFileObjsMacro + " $(RSYM_TARGET) $(PEFIXUP_TARGET) | " + ModuleFolder.OutputFullPath);
+ Makefile.WriteLine("\t$(ECHO_LD)");
+
+ if (Module.IsDLL)
+ {
+ Makefile.WriteLine("\t${dlltool} --dllname " + Module.TargetName + " --def " + CompilableModule.Definition.OriginalFullPath + " --output-exp " + m_CompModule.ExpTempFileNameFullPath + " " + MangledSymbols + " " + UnderscoreSymbols);
+ }
+
+ Makefile.WriteLine("\t" + Linker + " " + LinkerParameters);
+
+ if (Module.IsDLL)
+ {
+ Makefile.WriteLine("\t$(Q)$(PEFIXUP_TARGET) " + Module.MakeFileTargetMacro + " -exports" + " " + PefixupParameters);
+ Makefile.WriteLine("\t-@${rm} " + m_CompModule.ExpTempFileNameFullPath + " 2>$(NUL)");
+ }
+
+ Makefile.WriteLine();
+
+ WriteRsym();
+ WriteStrip();
+ WriteNonSymbolStripped();
+ }
+
+ public string Definition
+ {
+ get
+ {
+ if (Module.ImportLibrary != null)
+ return CompilableModule.Definition.OriginalFullPath;
+
+ return string.Empty;
+ }
+ }
+
+ public virtual string PefixupParameters
+ {
+ get
+ {
+ if ((Module.Type == ModuleType.Kernel) ||
+ (Module.Type == ModuleType.KernelModeDLL) ||
+ (Module.Type == ModuleType.KernelModeDriver) ||
+ (Module.Type == ModuleType.KeyboardLayout))
+ {
+ return "-sections";
+ }
+
+ return string.Empty;
+ }
+ }
+
+ public string LinkerScript
+ {
+ get
+ {
+ if (Module.LinkerScript != null)
+ return string.Format("-Wl,-T,{0}", Module.LinkerScript.FullPath);
+
+ return string.Empty;
+ }
+ }
+
+ public string MangledSymbols
+ {
+ get
+ {
+ if (Module.MangledSymbols)
+ return string.Empty;
+
+ return "--kill-at";
+ }
+ }
+
+ public string UnderscoreSymbols
+ {
+ get
+ {
+ if (Module.UnderscoreSymbols)
+ return "--add-underscore";
+
+ return string.Empty;
+ }
+ }
+
+
+ protected string PrecompiledHeader
+ {
+ get
+ {
+ if (Module.PreCompiledHeader != null)
+ return Module.MakeFilePCHMacro;
+
+ return string.Empty;
+ }
+ }
+
+ protected override void WriteCleanTarget()
+ {
+ Makefile.WritePhonyTarget(Module.MakeFileCleanTarget);
+ Makefile.WriteSingleLineTarget(Module.MakeFileCleanTarget);
+
+ if (Module.Type != ModuleType.Cabinet) //Hack:
+ {
+ foreach (RBuildSourceFile file in Module.SourceFiles)
+ {
+ SourceFile cFile = new SourceFile(file, Module, SysGen);
+
+ Makefile.WriteLine("\t-@$(rm) " + cFile.SourceCodeObjectFile.IntermediateFullPath + " 2>$(NUL)");
+ }
+ }
+
+ Makefile.WriteLine("\t-@$(rm) " + Module.MakeFileTargetMacro + " 2>$(NUL)");
+ Makefile.WriteLine();
+ }
+
+ protected override void WriteImportLibrary ()
+ {
+ if (Module.HasImportLibrary)
+ {
+ Makefile.WriteComment("IMPORT LIBRARY RULE");
+ Makefile.WriteLine(ResolveRBuildFilePath(Module.Dependency) + ": " + CompilableModule.Definition.OriginalFullPath + " " + DefinitionDependencies + " | " + ModuleFolder.IntermediateFullPath);
+ Makefile.WriteLine("\t$(ECHO_DLLTOOL)");
+ Makefile.WriteLine("\t$(dlltool) --dllname " + Module.TargetName + " --def " + CompilableModule.Definition.OriginalFullPath + " --output-lib " + /*CompilableModule.Dependency.IntermediateFullPath*/ ResolveRBuildFilePath(Module.Dependency) + " " + MangledSymbols + " " + UnderscoreSymbols);
+ Makefile.WriteLine();
+ }
+ }
+
+ protected virtual string LinkerParameters
+ {
+ get
+ {
+ return string.Format("-Wl,--subsystem," + SubSystem + " -Wl,--entry,{0} -Wl,--image-base,{1} " + AdditionalParameters2 + " -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 " + " " + NoStartFiles + " " + Shared + " " + LinkerScript + " " + AdditionalParamters + " -o {2} {3} {4} {5}",
+ Module.LinkerEntryPoint,
+ Module.BaseAddress,
+ Module.MakeFileTargetMacro,
+ Module.MakeFileObjsMacro,
+ Module.MakeFileLibsMacro,
+ Module.MakeFileLFlagsMacro);
+ }
+ }
+
+ protected virtual string AdditionalParameters2
+ {
+ get { return string.Empty; }
+ }
+
+ //Fixme:
+ protected virtual LinkerSubSystem LinkerSubsystem
+ {
+ get { return LinkerSubSystem.Console; }
+ }
+
+ protected virtual string SubSystem
+ {
+ get { return "console"; }
+ }
+
+ protected virtual string NoStartFiles
+ {
+ get
+ {
+ if (Module.Type == ModuleType.NativeCUI ||
+ Module.Type == ModuleType.NativeDLL ||
+ Module.Type == ModuleType.Kernel ||
+ Module.Type == ModuleType.KernelModeDLL ||
+ Module.Type == ModuleType.KernelModeDriver ||
+ Module.Type == ModuleType.KeyboardLayout)
+ {
+ return "-nostartfiles";
+ }
+
+ return string.Empty;
+ }
+ }
+
+ protected virtual string Shared
+ {
+ get
+ {
+ if (Module.IsDLL)
+ return "-shared";
+
+ return string.Empty;
+ }
+ }
+
+ protected virtual string AdditionalParamters
+ {
+ get
+ {
+ if (Module.IsDLL)
+ return m_CompModule.ExpTempFileNameFullPath;
+
+ return string.Empty;
+ }
+ }
+
+ public RBuildModule Module
+ {
+ get { return m_BuildElement as RBuildModule; }
+ }
+
+ public RBuildProject Project
+ {
+ get { return m_Project; }
+ set { m_Project = value; }
+ }
+
+ public BackendBuildModule CompilableModule
+ {
+ get { return m_CompModule; }
+ }
+
+ public BackedBuildFolder ModuleFolder
+ {
+ get { return m_Folder; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/Misc/MakefileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/Misc/MakefileWriter.cs
new file mode 100644
index 00000000000..5dbb01e08fb
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/Misc/MakefileWriter.cs
@@ -0,0 +1,99 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MakefileWriter : StreamWriter
+ {
+ public MakefileWriter(string path)
+ : base(path)
+ {
+ }
+
+ public void WriteComment(string text)
+ {
+ WriteLine("# {0}" , text);
+ }
+
+ public void WriteComplexComment(string text, params object[] args)
+ {
+ WriteComplexComment(string.Format(text, args));
+ }
+
+ public void WriteComplexComment(string text)
+ {
+ WriteLine();
+ WriteLine("#===================================================================================");
+ WriteLine("# {0}", text);
+ WriteLine("#===================================================================================");
+ WriteLine();
+ }
+
+ public void WriteIndentedLine(string text , params object[] args)
+ {
+ WriteIndentedLine(string.Format(text, args));
+ WriteLine();
+ }
+
+ public void WriteSingleLineIndented(string text)
+ {
+ WriteLine("\t{0}", text);
+ }
+
+ public void WriteIndentedLine(string text)
+ {
+ WriteLine("\t{0} \\", text);
+ }
+
+ public void WriteProperty(string propertyName , string propertyValue)
+ {
+ WriteLine("{0} := {1}" ,
+ propertyName ,
+ propertyValue);
+ }
+
+ public void WritePropertyAppend(string propertyName, string propertyValue)
+ {
+ WriteLine("{0} += {1}",
+ propertyName,
+ propertyValue);
+ }
+
+ public void WritePropertyAppendListStart(string propertyName)
+ {
+ WriteLine("{0} += \\", propertyName);
+ }
+
+ public void WritePropertyListStart(string propertyName)
+ {
+ WriteLine("{0} := \\", propertyName);
+ }
+
+ public void WritePropertyListEnd()
+ {
+ WriteLine();
+ }
+
+ public void WritePhonyTarget(string targetName)
+ {
+ WriteLine(".PHONY: {0}", targetName);
+ }
+
+ public void WriteSingleLineTarget(string targetName)
+ {
+ WriteLine("{0}:", targetName);
+ }
+
+ public void WriteTarget(string targetName)
+ {
+ WriteLine("{0}: \\", targetName);
+ }
+
+ public void WriteRule(string targetName , string targetName2)
+ {
+ WriteLine("{0}: {1}", targetName, targetName2);
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/Base/MingwRBuildModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/Base/MingwRBuildModuleHandler.cs
new file mode 100644
index 00000000000..d599896ff49
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/Base/MingwRBuildModuleHandler.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwBootLoaderModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwBootLoaderModuleHandler.cs
new file mode 100644
index 00000000000..a3642c0d0e4
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwBootLoaderModuleHandler.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwBootLoaderModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwBootLoaderModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return false;
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ }
+
+ protected override void WriteLinker()
+ {
+ Makefile.WriteLine(Module.MakeFileTargetMacro + ": " + Module.MakeFileObjsMacro + " " + Module.MakeFileLinkDepsMacro + " | " + ModuleFolder.OutputFullPath);
+ Makefile.WriteLine("\t$(ECHO_LD)");
+ //Makefile.WriteLine("\t$(ld) {0} -N -Ttext=0x8000 -o {1} {2} {3}", Module.MakeFileLFlagsMacro, CompilableModule.JunkTempFileNameFullPath, Module.MakeFileObjsMacro, Module.MakeFileLinkDepsMacro);
+ Makefile.WriteLine("\t$(gcc) -Wl,--subsystem,native -Wl,-N -Ttext=0x8000 -o {0} {1} {2} {3}", CompilableModule.JunkTempFileNameFullPath, Module.MakeFileObjsMacro, Module.MakeFileLinkDepsMacro, Module.MakeFileLFlagsMacro);
+ Makefile.WriteLine("\t$(objcopy) -O binary {0} $@", CompilableModule.JunkTempFileNameFullPath);
+ Makefile.WriteLine("\t-@$(rm) {0} 2>$(NUL)", CompilableModule.JunkTempFileNameFullPath);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwBootSectorModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwBootSectorModuleHandler.cs
new file mode 100644
index 00000000000..8db44129cf8
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwBootSectorModuleHandler.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwBootSectorModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwBootSectorModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsNASM);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsNASM)
+ {
+ WriteNASMCompiler(sourceFile);
+ }
+ }
+
+ protected override void WriteLinker()
+ {
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwBuildToolModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwBuildToolModuleHandler.cs
new file mode 100644
index 00000000000..ac8a70ff4a9
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwBuildToolModuleHandler.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwBuildToolModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwBuildToolModuleHandler(RBuildModule module)
+ : base(module)
+
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsC || file.IsCPP);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsC)
+ {
+ WriteCCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsCPP)
+ {
+ WriteCPPCompiler(sourceFile);
+ }
+ }
+
+ protected override void WriteLinker()
+ {
+ Makefile.WriteLine(Module.MakeFileTargetMacro + ": " + Module.MakeFileObjsMacro + " " + Module.MakeFileLinkDepsMacro + " | " + ModuleFolder.OutputFullPath);
+ Makefile.WriteLine("\t$(ECHO_LD)");
+ Makefile.WriteLine("\t" + Linker + " " + Module.MakeFileLFlagsMacro + " -o $@ " + Module.MakeFileObjsMacro + " " + Module.MakeFileLibsMacro );
+ Makefile.WriteLine();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwCabinetModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwCabinetModuleHandler.cs
new file mode 100644
index 00000000000..8bc979878c7
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwCabinetModuleHandler.cs
@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwCabinetModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwCabinetModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return true;
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ }
+
+ protected override void WriteLinker()
+ {
+ }
+
+ protected override void WriteSpecific()
+ {
+ base.WriteSpecific();
+
+ Makefile.WriteLine(Module.MakeFileTargetMacro + ": $(cabman_TARGET) " + ModuleFolder.OutputFullPath);
+ Makefile.WriteLine("\t$(ECHO_CABMAN)");
+ Makefile.WriteLine("\t$(Q)$(cabman_TARGET) -M raw -S " + Module.MakeFileTargetMacro + " " + Module.MakeFileSourcesMacro);
+ Makefile.WriteLine();
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwEmbeddedTypeLibModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwEmbeddedTypeLibModuleHandler.cs
new file mode 100644
index 00000000000..752cfaf896b
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwEmbeddedTypeLibModuleHandler.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwEmbeddedTypeLibModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwEmbeddedTypeLibModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override void CheckSourceFiles()
+ {
+ if (Module.SourceFiles.Count > 1)
+ {
+ throw new BuildException("Modules of type 'EmbeddedTypeLib' can only contain 1 source file , this module contains '{0}", Module.SourceFiles.Count);
+ }
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsWidl);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsWidl)
+ {
+ WriteWIDLTypeLibrary(sourceFile);
+ }
+ }
+
+ protected override void WriteLinker()
+ {
+ //WriteAr();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwHostStaticLibraryModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwHostStaticLibraryModuleHandler.cs
new file mode 100644
index 00000000000..3a70452326f
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwHostStaticLibraryModuleHandler.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwHostStaticLibraryModuleHandler : MingwStaticLibraryModuleHandler
+ {
+ public MingwHostStaticLibraryModuleHandler(RBuildModule module)
+ : base(module)
+
+ {
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwIdlHeaderModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwIdlHeaderModuleHandler.cs
new file mode 100644
index 00000000000..f831d9b6199
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwIdlHeaderModuleHandler.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Backends;
+
+namespace SysGen.BuildEngine
+{
+ public class MingwMessageHeaderModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwMessageHeaderModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override void WriteCommon()
+ {
+ }
+
+ protected override void WriteLinker()
+ {
+ }
+
+ protected override void WriteSpecific()
+ {
+ WritePreconditions();
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsMessageTable);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsMessageTable)
+ {
+ WriteWMC(sourceFile);
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwKernelModeDLLModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwKernelModeDLLModuleHandler.cs
new file mode 100644
index 00000000000..e0d03fe16d0
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwKernelModeDLLModuleHandler.cs
@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwKernelModeDLLModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwKernelModeDLLModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsHeader || file.IsC || file.IsCPP || file.IsWindResource || file.IsAssembler || file.IsWidl || file.IsNASM || file.IsWineBuild);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsHeader)
+ {
+ WritePCH(sourceFile);
+ }
+
+ if (sourceFile.File.IsC)
+ {
+ WriteCCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsCPP)
+ {
+ WriteCPPCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsWindResource)
+ {
+ WriteWindResCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsNASM)
+ {
+ WriteNASMCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsAssembler)
+ {
+ WriteASMCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsWidl)
+ {
+ WriteWIDLHeader(sourceFile);
+ }
+
+ if (sourceFile.File.IsWineBuild)
+ {
+ WriteWineBuild(sourceFile);
+ }
+ }
+
+ protected override string SubSystem
+ {
+ get { return "native"; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwKernelModeDriverModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwKernelModeDriverModuleHandler.cs
new file mode 100644
index 00000000000..ebbda411189
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwKernelModeDriverModuleHandler.cs
@@ -0,0 +1,59 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwKernelModeDriverModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwKernelModeDriverModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsC || file.IsWindResource || file.IsCPP || file.IsAssembler || file.IsWineBuild || file.IsHeader);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsHeader)
+ {
+ WritePCH(sourceFile);
+ }
+
+ if (sourceFile.File.IsWineBuild)
+ {
+ WriteWineBuild(sourceFile);
+ }
+
+ if (sourceFile.File.IsC)
+ {
+ WriteCCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsWindResource)
+ {
+ WriteWindResCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsCPP)
+ {
+ WriteCPPCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsAssembler)
+ {
+ WriteASMCompiler(sourceFile);
+ }
+ }
+
+ protected override string SubSystem
+ {
+ get { return "native"; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwKernelModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwKernelModuleHandler.cs
new file mode 100644
index 00000000000..c432f7f0c3c
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwKernelModuleHandler.cs
@@ -0,0 +1,68 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwKernelModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwKernelModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsHeader || file.IsC || file.IsWindResource || file.IsCPP || file.IsAssembler || file.IsMessageTable);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsHeader)
+ {
+ WritePCH(sourceFile);
+ }
+
+ if (sourceFile.File.IsC)
+ {
+ WriteCCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsWindResource)
+ {
+ WriteWindResCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsCPP)
+ {
+ WriteCPPCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsAssembler)
+ {
+ WriteASMCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsMessageTable)
+ {
+ WriteWMC(sourceFile);
+ }
+ }
+
+ protected override string AdditionalParameters2
+ {
+ get
+ {
+ return "";
+ //return "-Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -shared";
+ }
+ }
+
+ protected override string SubSystem
+ {
+ get { return "native"; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwMessageHeaderModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwMessageHeaderModuleHandler.cs
new file mode 100644
index 00000000000..c08b9098994
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwMessageHeaderModuleHandler.cs
@@ -0,0 +1,50 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Backends;
+
+namespace SysGen.BuildEngine
+{
+ public class MingwIdlHeaderModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwIdlHeaderModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override void WriteCommon()
+ {
+ }
+
+ protected override void WriteLinker()
+ {
+ }
+
+ protected override void WriteSpecific()
+ {
+ WriteWIDLFlags();
+// WriteTarget();
+ WritePreconditions();
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsWidl);
+ }
+
+ protected override void WriteWIDLFlags()
+ {
+ Makefile.WriteLine(Module.MakeFileWIDLFlags + " := " + Project.MakeFileWIDLFlagsMacro + " -I" + ModuleFolder.BaseFullPath);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsWidl)
+ {
+ WriteWIDLHeader(sourceFile);
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwNativeCUIModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwNativeCUIModuleHandler.cs
new file mode 100644
index 00000000000..4a8f5ee3436
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwNativeCUIModuleHandler.cs
@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwNativeCUIModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwNativeCUIModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsHeader || file.IsC || file.IsWindResource);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsHeader)
+ {
+ WritePCH(sourceFile);
+ }
+
+ if (sourceFile.File.IsC)
+ {
+ WriteCCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsWindResource)
+ {
+ WriteWindResCompiler(sourceFile);
+ }
+ }
+
+ protected override string SubSystem
+ {
+ get { return "native"; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwNativeDLLModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwNativeDLLModuleHandler.cs
new file mode 100644
index 00000000000..3f23397da34
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwNativeDLLModuleHandler.cs
@@ -0,0 +1,49 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwNativeDLLModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwNativeDLLModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsC || file.IsWindResource || file.IsAssembler || file.IsMessageTable);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsC)
+ {
+ WriteCCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsMessageTable)
+ {
+ WriteWMC(sourceFile);
+ }
+
+ if (sourceFile.File.IsWindResource)
+ {
+ WriteWindResCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsAssembler)
+ {
+ WriteASMCompiler(sourceFile);
+ }
+ }
+
+ protected override string SubSystem
+ {
+ get { return "native"; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwObjectLibraryModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwObjectLibraryModuleHandler.cs
new file mode 100644
index 00000000000..b95d425e431
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwObjectLibraryModuleHandler.cs
@@ -0,0 +1,58 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwObjectLibraryModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwObjectLibraryModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsHeader || file.IsC || file.IsNASM || file.IsAssembler || file.IsMessageTable);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsHeader)
+ {
+ WritePCH(sourceFile);
+ }
+
+ if (sourceFile.File.IsC)
+ {
+ WriteCCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsAssembler)
+ {
+ WriteASMCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsNASM)
+ {
+ WriteNASMCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsMessageTable)
+ {
+ WriteWMC(sourceFile);
+ }
+ }
+
+ protected override void WriteLinker()
+ {
+ }
+
+ protected override string SubSystem
+ {
+ get { return "console"; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwPackageModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwPackageModuleHandler.cs
new file mode 100644
index 00000000000..ce2f83a2108
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwPackageModuleHandler.cs
@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwPackageModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwPackageModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return true;
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ }
+
+ protected override void WriteLinker()
+ {
+ }
+
+ protected override void WriteSpecific()
+ {
+ base.WriteSpecific();
+
+ //Makefile.WriteLine(Module.MakeFileTargetMacro + ": $(cabman_TARGET) " + ModuleFolder.OutputFullPath);
+ //Makefile.WriteLine("\t$(ECHO_CABMAN)");
+ //Makefile.WriteLine("\t$(Q)$(cabman_TARGET) -M raw -S " + Module.MakeFileTargetMacro + " " + Module.MakeFileSourcesMacro);
+ //Makefile.WriteLine();
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRBuildProjectHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRBuildProjectHandler.cs
new file mode 100644
index 00000000000..4f7cfaaff47
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRBuildProjectHandler.cs
@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwRBuildProjectHandler : MingwRBuildElementHandler
+ {
+ public MingwRBuildProjectHandler(RBuildProject project)
+ : base(project)
+ {
+ }
+
+ protected override void WriteSpecific()
+ {
+ Makefile.WritePropertyListStart(Project.MakeFileGCCOptions);
+ WriteCompilerFlags(Makefile, Project);
+ Makefile.WritePropertyListEnd();
+
+ Makefile.WritePropertyAppend(Project.MakeFileCFlags, "-Wall");
+
+ if (Project.Properties["OARCH"].Value != string.Empty)
+ {
+ Makefile.WritePropertyAppend(Project.MakeFileCFlags, "-march=$(OARCH)");
+ }
+
+ Makefile.WritePropertyAppend(Project.MakeFileCFlags, Project.MakeFileGCCOptionsMacro);
+ }
+
+ public RBuildProject Project
+ {
+ get { return m_BuildElement as RBuildProject; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRpcClientHeaderModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRpcClientHeaderModuleHandler.cs
new file mode 100644
index 00000000000..c4fa641f31e
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRpcClientHeaderModuleHandler.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwRpcClientHeaderModuleHandler : MingwRpcServerHeaderModuleHandler
+ {
+ public MingwRpcClientHeaderModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsWidl);
+ }
+
+ protected override void WriteCleanTarget()
+ {
+ base.WriteCleanTarget();
+
+ foreach (RBuildSourceFile file in Module.SourceFiles)
+ {
+ SourceFile cFile = new SourceFile(file, Module, SysGen);
+
+ Makefile.WriteLine("\t-@$(rm) " + cFile.SourceCodeHeaderFile.IntermediateFullPath + " 2>$(NUL)");
+ Makefile.WriteLine("\t-@$(rm) " + cFile.SourceCodeObjectFile.IntermediateFullPath + " 2>$(NUL)");
+ }
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsWidl)
+ {
+ WriteWIDLRpcHeader(sourceFile);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRpcProxyModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRpcProxyModuleHandler.cs
new file mode 100644
index 00000000000..f15d03d9301
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRpcProxyModuleHandler.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwRpcProxyModuleHandler : MingwRpcServerHeaderModuleHandler
+ {
+ public MingwRpcProxyModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsWidl);
+ }
+
+ protected override void WriteCleanTarget()
+ {
+ base.WriteCleanTarget();
+
+ foreach (RBuildSourceFile file in Module.SourceFiles)
+ {
+ SourceFile cFile = new SourceFile(file, Module, SysGen);
+
+ Makefile.WriteLine("\t-@$(rm) " + cFile.SourceCodeHeaderFile.IntermediateFullPath + " 2>$(NUL)");
+ Makefile.WriteLine("\t-@$(rm) " + cFile.SourceCodeObjectFile.IntermediateFullPath + " 2>$(NUL)");
+ }
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsWidl)
+ {
+ WriteWIDLRpcHeader(sourceFile);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRpcServerHeaderModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRpcServerHeaderModuleHandler.cs
new file mode 100644
index 00000000000..a09bbb3069a
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRpcServerHeaderModuleHandler.cs
@@ -0,0 +1,49 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwRpcServerHeaderModuleHandler : MingwIdlHeaderModuleHandler
+ {
+ public MingwRpcServerHeaderModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override void WriteSpecific()
+ {
+ WriteCFlags();
+ base.WriteSpecific();
+ WriteModuleCommon();
+ }
+
+ protected override void WriteCleanTarget()
+ {
+ base.WriteCleanTarget();
+
+ foreach (RBuildSourceFile file in Module.SourceFiles)
+ {
+ SourceFile cFile = new SourceFile(file, Module, SysGen);
+
+ Makefile.WriteLine("\t-@$(rm) " + cFile.SourceCodeHeaderFile.IntermediateFullPath + " 2>$(NUL)");
+ Makefile.WriteLine("\t-@$(rm) " + cFile.SourceCodeActualFile.IntermediateFullPath + " 2>$(NUL)");
+ }
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsWidl);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsWidl)
+ {
+ WriteWIDLRpcHeader(sourceFile);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwStaticLibraryModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwStaticLibraryModuleHandler.cs
new file mode 100644
index 00000000000..f915a86b2f0
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwStaticLibraryModuleHandler.cs
@@ -0,0 +1,61 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwStaticLibraryModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwStaticLibraryModuleHandler(RBuildModule module)
+ : base(module)
+
+ {
+ }
+
+ /*
+ protected override void WriteLibs(RBuildModule module)
+ {
+ }
+ */
+
+ protected override void WriteCFlags()
+ {
+ base.WriteCFlags();
+
+ if (Module.IsStartupLib)
+ {
+ Makefile.WritePropertyAppend(Module.MakeFileCFlags, "-Wno-main");
+ }
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsHeader ||file.IsC || file.IsAssembler);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsHeader)
+ {
+ WritePCH(sourceFile);
+ }
+
+ if (sourceFile.File.IsC)
+ {
+ WriteCCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsAssembler)
+ {
+ WriteASMCompiler(sourceFile);
+ }
+ }
+
+ protected override void WriteLinker()
+ {
+ WriteAr();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32CUIModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32CUIModuleHandler.cs
new file mode 100644
index 00000000000..5097b3971c0
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32CUIModuleHandler.cs
@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Backends;
+
+namespace SysGen.BuildEngine
+{
+ public class MingwWin32CUIModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwWin32CUIModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsHeader || file.IsC || file.IsCPP || file.IsWindResource);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsHeader)
+ {
+ WritePCH(sourceFile);
+ }
+
+ if (sourceFile.File.IsC)
+ {
+ WriteCCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsCPP)
+ {
+ WriteCPPCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsWindResource)
+ {
+ WriteWindResCompiler(sourceFile);
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32DLLModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32DLLModuleHandler.cs
new file mode 100644
index 00000000000..a8b29f0a082
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32DLLModuleHandler.cs
@@ -0,0 +1,64 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwWin32DLLModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwWin32DLLModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsHeader || file.IsC || file.IsCPP || file.IsWindResource || file.IsAssembler || file.IsWineBuild || file.IsWidl || file.IsMessageTable);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsHeader)
+ {
+ WritePCH(sourceFile);
+ }
+
+ if (sourceFile.File.IsWineBuild)
+ {
+ WriteWineBuild(sourceFile);
+ }
+
+ if (sourceFile.File.IsC)
+ {
+ WriteCCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsCPP)
+ {
+ WriteCPPCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsWindResource)
+ {
+ WriteWindResCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsAssembler)
+ {
+ WriteASMCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsMessageTable)
+ {
+ WriteWMC(sourceFile);
+ }
+
+ if (sourceFile.File.IsWidl)
+ {
+ WriteWIDLHeader(sourceFile);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32GUIModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32GUIModuleHandler.cs
new file mode 100644
index 00000000000..b6687778a5d
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32GUIModuleHandler.cs
@@ -0,0 +1,54 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwWin32GUIModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwWin32GUIModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsHeader || file.IsC || file.IsCPP || file.IsWindResource || file.IsWineBuild);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsHeader)
+ {
+ WritePCH(sourceFile);
+ }
+
+ if (sourceFile.File.IsC)
+ {
+ WriteCCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsCPP)
+ {
+ WriteCPPCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsWindResource)
+ {
+ WriteWindResCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsWineBuild)
+ {
+ WriteWineBuild(sourceFile);
+ }
+ }
+
+ protected override string SubSystem
+ {
+ get { return "windows"; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32OCXModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32OCXModuleHandler.cs
new file mode 100644
index 00000000000..7fe4f0b9c1a
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32OCXModuleHandler.cs
@@ -0,0 +1,54 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwWin32OCXModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwWin32OCXModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsHeader ||file.IsC || file.IsWindResource || file.IsCPP || file.IsWineBuild);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsHeader)
+ {
+ WritePCH(sourceFile);
+ }
+
+ if (sourceFile.File.IsC)
+ {
+ WriteCCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsWindResource)
+ {
+ WriteWindResCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsCPP)
+ {
+ WriteCPPCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsWineBuild)
+ {
+ WriteWineBuild(sourceFile);
+ }
+ }
+
+ protected override string SubSystem
+ {
+ get { return "native"; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/TargetsHandlers/Base/MingwRBuildTargetHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/TargetsHandlers/Base/MingwRBuildTargetHandler.cs
new file mode 100644
index 00000000000..b99413d3724
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/TargetsHandlers/Base/MingwRBuildTargetHandler.cs
@@ -0,0 +1,307 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwLiveCDTargetHandler : MingwRBuildIsoModuleHandler
+ {
+ public MingwLiveCDTargetHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override void AddAditionalFiles()
+ {
+ //RBuildCDFile livecdBootIni = new RBuildCDFile();
+
+ //livecdBootIni.Base = "boot\bootdata";
+ //livecdBootIni.Name = "livecd.ini";
+ //livecdBootIni.NewName = "";
+ }
+
+ protected override void WriteCabinetManager()
+ {
+ // Not required
+ }
+
+ protected override void WriteMakeHive()
+ {
+ Makefile.WriteLine("\t$(ECHO_MKHIVE)");
+ Makefile.WriteLine("\t$(mkhive_TARGET) boot\bootdata " + @"$(OUTPUT)\livecd\reactos\system32\config boot\bootdata\livecd.inf boot\bootdata\hiveinst.inf");
+ }
+
+ protected override void WriteCopyCDFiles()
+ {
+ foreach (RBuildOutputFile platformFile in SysGen.Project.Files)
+ {
+ if (platformFile is RBuildPlatformFile || platformFile is RBuildCDFile)
+ {
+ }
+ else
+ {
+ RBuildCDFile cdFile = new RBuildCDFile();
+
+ cdFile.Root = PathRoot.LiveCD;
+ cdFile.Name = platformFile.Name;
+ cdFile.Base = platformFile.InstallBase;
+
+ Makefile.WriteLine("\t$(ECHO_CP)");
+ Makefile.WriteLine("\t$(cp) " + ResolveRBuildFilePath(platformFile) + " " + ResolveRBuildFilePath(cdFile) + " 1>$(NUL)");
+ }
+ }
+
+ foreach (RBuildModule module in SysGen.Project.Modules)
+ {
+ if (module.IsInstallable)
+ {
+ RBuildCDFile cdFile = new RBuildCDFile();
+
+ cdFile.Root = PathRoot.LiveCD;
+ cdFile.Name = module.TargetFile.Name;
+ cdFile.Base = "reactos" + "//" + module.InstallBase;
+
+ Makefile.WriteLine("\t$(ECHO_CP)");
+ Makefile.WriteLine("\t$(cp) " + ResolveRBuildFilePath(module.TargetFile) + " " + ResolveRBuildFilePath(cdFile) + " 1>$(NUL)");
+ }
+ }
+
+ Makefile.WriteLine("\t$(ECHO_CP)");
+ Makefile.WriteLine("\t${cp} " + @"boot\bootdata\livecd.ini $(OUTPUT)\livecd\freeldr.ini 1>$(NUL)");
+ }
+
+ public override RBuildFolder WorkingFolder
+ {
+ get { return new RBuildFolder(PathRoot.Output, "LiveCD"); }
+ }
+
+ protected override string ResolveRBuildFilePath(RBuildFile file)
+ {
+ if (file.Root == PathRoot.CDOutput)
+ return Path.Combine(SysGen.LiveCDOutputDirectory, file.FullPath);
+
+ return SysGen.ResolveRBuildFilePath(file);
+ }
+ }
+
+ public class MingwLiveCDRegTestTargetHandler : MingwLiveCDTargetHandler
+ {
+ public MingwLiveCDRegTestTargetHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+ public override RBuildFolder WorkingFolder
+ {
+ get { return new RBuildFolder(PathRoot.Output, "livecdregtest"); }
+ }
+ }
+
+ public class MingwBootCDRegTestTargetHandler : MingwBootCDTargetHandler
+ {
+ public MingwBootCDRegTestTargetHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ public override RBuildFolder WorkingFolder
+ {
+ get { return new RBuildFolder(PathRoot.Output , "cdregtest"); }
+ }
+ }
+
+ public class MingwBootCDTargetHandler : MingwRBuildIsoModuleHandler
+ {
+ public MingwBootCDTargetHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override void WriteCopyCDFiles()
+ {
+ base.WriteCopyCDFiles();
+
+ foreach (RBuildModule module in SysGen.Project.Platform.Modules)
+ {
+ if ((module.Enabled) && (module.IsBootstrap))
+ {
+ RBuildBootstrapFile bootstrapFile = module.Bootstrap;
+
+ if (bootstrapFile != null)
+ {
+ Makefile.WriteLine("\t$(ECHO_CP)");
+ Makefile.WriteLine("\t$(cp) " + ResolveRBuildFilePath(bootstrapFile) + " " + ResolveRBuildFilePath(bootstrapFile.CDNewFile) + " 1>$(NUL)");
+ }
+ }
+ }
+
+ foreach (RBuildOutputFile file in SysGen.Project.Files)
+ {
+ RBuildBootstrapFile bootstrapFile = file as RBuildBootstrapFile;
+
+ if (bootstrapFile != null)
+ {
+ Makefile.WriteLine("\t$(ECHO_CP)");
+ Makefile.WriteLine("\t$(cp) " + ResolveRBuildFilePath(bootstrapFile) + " " + ResolveRBuildFilePath(bootstrapFile.CDNewFile) + " 1>$(NUL)");
+ }
+ }
+ }
+
+ protected override void AddFolders()
+ {
+ //Ensure folder exists
+ base.AddFolders();
+
+ Module.Folders.Add(new RBuildFolder(WorkingFolder, "loader"));
+ Module.Folders.Add(new RBuildFolder(WorkingFolder, "reactos"));
+ Module.Folders.Add(new RBuildFolder(WorkingFolder, "reactos/system32"));
+ }
+
+ protected override string ResolveRBuildFilePath(RBuildFile file)
+ {
+ if (file.Root == PathRoot.CDOutput)
+ return SysGen.NormalizePath(Path.Combine(SysGen.BootCDOutputDirectory, file.FullPath));
+
+ return SysGen.ResolveRBuildFilePath(file);
+ }
+
+ public override RBuildFolder WorkingFolder
+ {
+ get { return new RBuildFolder(PathRoot.Output , "cd"); }
+ }
+ }
+
+ public abstract class MingwRBuildIsoModuleHandler : MingwRBuildModuleHandler
+ {
+ private const string PROFILES_FOLDER = "Profiles";
+ private const string ALL_USERS_FOLDER = "All Users";
+ private const string DEFAULT_USER_FOLDER = "Default User";
+ private const string DESKTOP_FOLDER = "Desktop";
+ private const string MY_DOCUMENTS_FOLDER = "My Documents";
+
+ protected List m_BuildTools = new List();
+
+ public MingwRBuildIsoModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected List BuildTools
+ {
+ get { return m_BuildTools; }
+ }
+
+ public override void GenerateMakeFile()
+ {
+ AddAditionalFiles();
+ AddFolders();
+
+ WriteFolders();
+ WriteTarget();
+ WriteCabinetManager();
+ WriteCopyCDFiles();
+ WriteMakeRegistryHives();
+ WriteMakeHive();
+ WriteCDMake();
+ WriteCleanTarget();
+ }
+
+ protected virtual void AddAditionalFiles()
+ {
+ }
+
+ protected virtual void WriteMakeHive()
+ {
+ }
+
+ protected virtual void AddFolders()
+ {
+ Module.Folders.Add(WorkingFolder);
+ }
+
+ protected virtual void WriteTarget()
+ {
+ Makefile.WriteTarget(Module.MakeFileTargetMacro);
+ Makefile.WriteIndentedLine("all");
+ Makefile.WriteIndentedLine("$(cabman_TARGET)");
+ Makefile.WriteIndentedLine("$(cdmake_TARGET)");
+ Makefile.WriteIndentedLine("$(mkhive_TARGET)");
+ Makefile.WriteIndentedLine(Module.MakeFileFoldersMacro);
+
+ foreach (RBuildModule module in SysGen.Project.Platform.Modules)
+ {
+ if ((module.Enabled) && (module.IsBootstrap))
+ {
+ Makefile.WriteIndentedLine(module.MakeFileTargetMacro);
+ }
+ }
+
+ Makefile.WriteIndentedLine(BootModule.MakeFileTargetMacro);
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteMakeRegistryHives()
+ {
+ }
+
+ protected virtual void WriteCabinetManager()
+ {
+ Makefile.WriteLine("\t$(ECHO_CABMAN)");
+ Makefile.WriteLine("\t$(Q)$(cabman_TARGET) -C " + SysGen.Project.PackagesFile + @" -L $(OUTPUT)\cd\reactos -I -P $(OUTPUT)");
+ Makefile.WriteLine("\t$(Q)$(cabman_TARGET) -C " + SysGen.Project.PackagesFile + @" -RC $(OUTPUT)\cd\reactos\reactos.inf -L $(OUTPUT)\cd\reactos -N -P $(OUTPUT)");
+ Makefile.WriteLine("\t-@${rm} " + @"$(OUTPUT)\cd\reactos\reactos.inf" + " 2>$(NUL)");
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteCDMake()
+ {
+ Makefile.WriteLine("\t$(ECHO_CDMAKE)");
+ Makefile.WriteLine("\t$(Q)$(cdmake_TARGET) -v -j -m -b " + ResolveRBuildFilePath(BootModule.TargetFile) + " " + ResolveRBuildFolderPath(WorkingFolder) + " " + CDLabel + " " + IsoImage);
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteCopyCDFiles()
+ {
+ foreach (RBuildOutputFile file in SysGen.Project.Files)
+ {
+ RBuildCDFile cdFile = file as RBuildCDFile;
+
+ if (cdFile != null)
+ {
+ Makefile.WriteLine("\t$(ECHO_CP)");
+ Makefile.WriteLine("\t$(cp) " + ResolveRBuildFilePath(cdFile) + " " + ResolveRBuildFilePath(cdFile.CDNewFile) + " 1>$(NUL)");
+ }
+ }
+ }
+
+ protected virtual RBuildModule BootModule
+ {
+ get { return Module.BootSector; }
+ }
+
+ public abstract RBuildFolder WorkingFolder { get; }
+
+ public virtual string IsoImage
+ {
+ get { return ResolveRBuildFilePath(Module.TargetFile); }
+ }
+
+ public virtual string CDLabel
+ {
+ get { return Module.CDLabel; }
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return false;
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ throw new Exception("The method or operation is not implemented.");
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/ProjectTreeReport/ProjectTreeReport.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/ProjectTreeReport/ProjectTreeReport.cs
new file mode 100644
index 00000000000..3952090f289
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/ProjectTreeReport/ProjectTreeReport.cs
@@ -0,0 +1,66 @@
+using System;
+using System.Web.UI;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+using SysGen.BuildEngine.Backends;
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class ProjectTreeReport : Backend
+ {
+ public ProjectTreeReport(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ }
+
+ protected override string FriendlyName
+ {
+ get { return "Tree Report"; }
+ }
+
+ protected override void Generate()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\resTree.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteModule(SysGen.RootTask , writer);
+ }
+ }
+ }
+
+ private void WriteModule(Task task, HtmlTextWriter writer)
+ {
+ ITaskContainer container = task as ITaskContainer;
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Cellpadding, "5");
+ writer.AddAttribute(HtmlTextWriterAttribute.Cellspacing, "5");
+ writer.AddAttribute(HtmlTextWriterAttribute.Border, "1");
+ writer.AddAttribute(HtmlTextWriterAttribute.Bordercolor, "#000000");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(task.Name);
+
+ if (container != null)
+ {
+ if (container.ChildTasks.Count > 0)
+ {
+ foreach (Task childTask in container.ChildTasks)
+ {
+ WriteModule(childTask, writer);
+ }
+ }
+ }
+
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/RBuildDB/RBuildDBBackend.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/RBuildDB/RBuildDBBackend.cs
new file mode 100644
index 00000000000..032af573ba7
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/RBuildDB/RBuildDBBackend.cs
@@ -0,0 +1,102 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+using SysGen.BuildEngine.Backends;
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class RBuildDBBackend : Backend
+ {
+ public RBuildDBBackend(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ }
+
+ protected override string FriendlyName
+ {
+ get { return "RBuild Database"; }
+ }
+
+ private string RBuildDBFile
+ {
+ get { return Path.Combine(SysGen.BaseDirectory, "rbuilddb.xml"); }
+ }
+
+ protected override void Generate()
+ {
+ // Creates an XML file is not exist
+ using (XmlTextWriter writer = new XmlTextWriter(RBuildDBFile, Encoding.ASCII))
+ {
+ writer.Indentation = 4;
+ writer.Formatting = Formatting.Indented;
+
+ // Starts a new document
+ writer.WriteStartDocument();
+ writer.WriteComment("File autogenerated by SysGen");
+ writer.WriteStartElement("catalog");
+
+ writer.WriteStartElement("modules");
+ foreach (RBuildModule module in Project.Modules)
+ {
+ writer.WriteStartElement("module");
+ writer.WriteAttributeString("name", module.Name);
+ writer.WriteAttributeString("type", module.Type.ToString());
+ writer.WriteAttributeString("base", module.Base);
+ writer.WriteAttributeString("desc", module.Description);
+ writer.WriteAttributeString("path", module.CatalogPath);
+ writer.WriteAttributeString("enabled", module.Enabled.ToString());
+
+ writer.WriteStartElement("libraries");
+
+ foreach (RBuildModule library in module.Libraries)
+ writer.WriteElementString("library", library.Name);
+
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("dependencies");
+
+ foreach (RBuildModule dependency in module.Dependencies)
+ writer.WriteElementString("dependency", dependency.Name);
+
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("requeriments");
+
+ foreach (RBuildModule requirement in module.Requeriments)
+ writer.WriteElementString("requires", requirement.Name);
+
+ writer.WriteEndElement();
+
+ writer.WriteEndElement();
+ }
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("languages");
+ foreach (RBuildLanguage language in Project.Languages)
+ {
+ writer.WriteStartElement("language");
+ writer.WriteAttributeString("name", language.Name);
+ writer.WriteEndElement();
+ }
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("debugchannels");
+ foreach (RBuildDebugChannel language in Project.DebugChannels)
+ {
+ writer.WriteStartElement("debugchannel");
+ writer.WriteAttributeString("name", language.Name);
+ writer.WriteEndElement();
+ }
+ writer.WriteEndElement();
+ writer.WriteEndElement();
+
+ writer.WriteEndDocument();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/RGenStats/RGenStatBackend.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/RGenStats/RGenStatBackend.cs
new file mode 100644
index 00000000000..113f0fd290c
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/RGenStats/RGenStatBackend.cs
@@ -0,0 +1,110 @@
+using System;
+using System.Text.RegularExpressions;
+using System.Web.UI;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Tasks;
+using SysGen.BuildEngine.Backends;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class RGenStatBackend : Backend
+ {
+ public RGenStatBackend(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ }
+
+ protected override string FriendlyName
+ {
+ get { return "RGenStat Report"; }
+ }
+
+ protected override void Generate()
+ {
+ using (StreamWriter sw = new StreamWriter(Directory.GetCurrentDirectory() + "\\apistatus.lst"))
+ {
+ sw.WriteLine("; Format:");
+ sw.WriteLine("; COMPONENT_NAME PATH_TO_COMPONENT_SOURCES");
+ sw.WriteLine();
+ sw.WriteLine("; Where:");
+ sw.WriteLine("; COMPONENT_NAME - Name of the module. Eg. kernel32.");
+ sw.WriteLine("; PATH_TO_COMPONENT_SOURCES - Relative path to sources (relative to where rgenstat is run from).");
+ sw.WriteLine();
+
+ foreach (RBuildModule module in Project.Modules)
+ {
+ if (module.Type == ModuleType.Kernel ||
+ module.Type == ModuleType.KernelModeDLL ||
+ module.Type == ModuleType.KernelModeDriver ||
+ module.Type == ModuleType.StaticLibrary ||
+ module.Type == ModuleType.ObjectLibrary ||
+ module.Type == ModuleType.Win32DLL ||
+ module.Type == ModuleType.Win32OCX ||
+ module.Type == ModuleType.KeyboardLayout)
+ {
+ sw.WriteLine("{0} {1}",
+ module.Name,
+ module.BaseURI.ToString().Replace("\\", "/"));
+ }
+ }
+ }
+
+ //using (StreamWriter sw = new StreamWriter(Directory.GetCurrentDirectory() + "\\descriptions.rbuild"))
+ //{
+ // sw.WriteLine("");
+ // sw.WriteLine("");
+ // sw.WriteLine("");
+ // sw.WriteLine("");
+
+ // foreach (RBuildModule module in Project.Modules)
+ // {
+ // if (module.Type == ModuleType.Kernel ||
+ // module.Type == ModuleType.KernelModeDLL ||
+ // module.Type == ModuleType.KernelModeDriver ||
+ // module.Type == ModuleType.BootLoader ||
+ // module.Type == ModuleType.BootProgram ||
+ // module.Type == ModuleType.BootSector ||
+ // module.Type == ModuleType.BuildTool ||
+ // module.Type == ModuleType.Cabinet ||
+ // module.Type == ModuleType.EmbeddedTypeLib ||
+ // module.Type == ModuleType.HostStaticLibrary ||
+ // module.Type == ModuleType.IdlHeader ||
+ // module.Type == ModuleType.NativeCUI ||
+ // module.Type == ModuleType.NativeDLL ||
+ // module.Type == ModuleType.ObjectLibrary ||
+ // module.Type == ModuleType.Package ||
+ // module.Type == ModuleType.RpcClient ||
+ // module.Type == ModuleType.RpcProxy ||
+ // module.Type == ModuleType.RpcServer ||
+ // module.Type == ModuleType.StaticLibrary ||
+ // module.Type == ModuleType.Win32CUI ||
+ // module.Type == ModuleType.Win32DLL ||
+ // module.Type == ModuleType.Win32GUI ||
+ // module.Type == ModuleType.Win32OCX ||
+ // module.Type == ModuleType.Win32SCR ||
+ // module.Type == ModuleType.KeyboardLayout)
+
+ // {
+ // sw.WriteLine("",
+ // module.Name.ToUpper(),
+ // module.Name);
+ // }
+ // }
+
+ // sw.WriteLine("");
+ //}
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/WarningReport/WarningReport.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/WarningReport/WarningReport.cs
new file mode 100644
index 00000000000..5b48f103ae1
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/WarningReport/WarningReport.cs
@@ -0,0 +1,82 @@
+using System;
+using System.Web.UI;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+using SysGen.BuildEngine.Backends;
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class WarningReport : Backend
+ {
+ public WarningReport(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ }
+
+ protected override string FriendlyName
+ {
+ get { return "Warning report"; }
+ }
+
+ protected override void Generate()
+ {
+ //using (StreamWriter sw = new StreamWriter(@"C:\roswarning.txt"))
+ //{
+ // foreach (RBuildModule module in Project.Modules)
+ // {
+ // if (module.Unicode == false)
+ // {
+ // if ((module.Defines.ContainsKey("UNICODE")) ||
+ // (module.Defines.ContainsKey("_UNICODE")) ||
+ // (module.Defines.ContainsKey("_UNICODE_")))
+ // {
+ // sw.WriteLine("- Module '{0}' has unicode defines but 'Unicode' property set to 'False'", module.Name);
+ // }
+ // }
+
+ // foreach (KeyValuePair define in Project.Defines)
+ // {
+ // if (module.Defines.ContainsKey(define.Key))
+ // {
+ // sw.WriteLine("- Module '{0}' already define '{1}' inherited from project ", module.Name, define.Key);
+ // }
+ // }
+
+ // foreach (string flag in Project.CompilerFlags)
+ // {
+ // if (module.CompilerFlags.Contains(flag))
+ // {
+ // sw.WriteLine("- Module '{0}' already has compiler flag '{1}' inherited from project ", module.Name, flag);
+ // }
+ // }
+
+ // foreach (string flag in Project.LinkerFlags)
+ // {
+ // if (module.LinkerFlags.Contains(flag))
+ // {
+ // sw.WriteLine("- Module '{0}' already has linker flag '{1}' inherited from project ", module.Name, flag);
+ // }
+ // }
+
+ // foreach (RBuildFolder include in module.IncludeFolders)
+ // {
+ // if (Project.IncludeFolders.Contains(include))
+ // {
+ // sw.WriteLine("- Module '{0}' already has include folder '{1}' inherited from project ", module.Name, include.RelativePath);
+ // }
+
+ // if (SysGen.RBuildFolderExists(include) == false)
+ // {
+ // sw.WriteLine("- Module '{0}' includes folder '{1}' which could not be found ", module.Name, include.RelativePath);
+ // }
+ // }
+ // }
+ //}
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Collections/BackendCollection.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Collections/BackendCollection.cs
new file mode 100644
index 00000000000..c2df8997b68
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Collections/BackendCollection.cs
@@ -0,0 +1,22 @@
+using System;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+using SysGen.BuildEngine.Log;
+using SysGen.BuildEngine.Backends;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine
+{
+ public sealed class BackendCollection : List
+ {
+ public void Generate()
+ {
+ foreach (Backend backend in this)
+ {
+ backend.Run();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Collections/DefineCollection.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Collections/DefineCollection.cs
new file mode 100644
index 00000000000..e05ada2c171
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Collections/DefineCollection.cs
@@ -0,0 +1,23 @@
+using System;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine
+{
+ public class DefineCollection : Dictionary
+ {
+ public void Add(string name)
+ {
+ Add(name, string.Empty);
+ }
+
+ public void Add(string name , string value)
+ {
+ if (!ContainsKey(name))
+ base.Add(name, value);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Collections/FileHandlerCollection.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Collections/FileHandlerCollection.cs
new file mode 100644
index 00000000000..ec7b65a5c86
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Collections/FileHandlerCollection.cs
@@ -0,0 +1,24 @@
+using System;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+using SysGen.BuildEngine.Log;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine
+{
+ public sealed class FileHandlerCollection : List
+ {
+ public void ProcessFiles(RBuildPlatformFileCollection files)
+ {
+ foreach (RBuildFile file in files)
+ {
+ foreach (IFileHandler handler in this)
+ {
+ handler.Process(file);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Collections/LogListenerCollection.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Collections/LogListenerCollection.cs
new file mode 100644
index 00000000000..7d907c3fe93
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Collections/LogListenerCollection.cs
@@ -0,0 +1,14 @@
+using System;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+using SysGen.BuildEngine.Log;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine
+{
+ public sealed class LogListenerCollection : List
+ {
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Collections/TaskBuilderCollection.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Collections/TaskBuilderCollection.cs
new file mode 100644
index 00000000000..386c0b04c24
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Collections/TaskBuilderCollection.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace SysGen.BuildEngine
+{
+ public class TaskBuilderCollection : List
+ {
+ public bool Add(TaskBuilder builder)
+ {
+ // prevent adding duplicate builders with the same task name
+ if (FindBuilderForTask(builder.TaskName) == null)
+ {
+ base.Add(builder);
+ return true;
+ }
+
+ return false;
+ }
+
+ public TaskBuilder FindBuilderForTask(string taskName)
+ {
+ foreach (TaskBuilder builder in this)
+ {
+ if (builder.TaskName == taskName)
+ {
+ return builder;
+ }
+ }
+ return null;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Collections/TaskCollection.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Collections/TaskCollection.cs
new file mode 100644
index 00000000000..a10cf92f4f1
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Collections/TaskCollection.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace SysGen.BuildEngine
+{
+ public sealed class TaskCollection : List
+ {
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Elements/Base/Element.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Elements/Base/Element.cs
new file mode 100644
index 00000000000..3de1765b291
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Elements/Base/Element.cs
@@ -0,0 +1,306 @@
+using System;
+using System.IO;
+using System.Reflection;
+using System.Xml;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Log;
+using SysGen.BuildEngine.Attributes;
+using SysGen.BuildEngine.Tasks;
+
+namespace SysGen.BuildEngine
+{
+ /// Models a NAnt XML element in the build file.
+ ///
+ /// Automatically validates attributes in the element based on Attribute settings in the derived class.
+ ///
+ public class Element : IElement
+ {
+ protected Location _location = Location.UnknownLocation;
+ protected SysGenEngine _sysgen = null;
+ protected RBuildProject _project = null;
+ protected XmlNode _xmlNode = null;
+ protected IElement _parent = null;
+ protected bool m_FailOnMissingRequired = true;
+
+ ///
+ /// The default contstructor.
+ ///
+ public Element()
+ {
+ }
+
+ /// A copy contstructor.
+ protected Element(Element element) : this()
+ {
+ _location = element._location;
+ _sysgen = element._sysgen;
+ _xmlNode = element._xmlNode;
+ }
+
+ /// in the build file where the element is defined.
+ protected virtual Location Location {
+ get { return _location; }
+ set { _location = value; }
+ }
+
+ ///
+ /// The Parent object. This will be your parent Task, Target, or Project depeding on where the element is defined.
+ ///
+ public IElement Parent { get { return _parent; } set { _parent = value; } }
+
+ /// Name of the XML element used to initialize this element.
+ public virtual string Name
+ {
+ get {
+ ElementNameAttribute elementNameAttribute = (ElementNameAttribute)
+ Attribute.GetCustomAttribute(GetType(), typeof(ElementNameAttribute));
+
+ string name = null;
+ if (elementNameAttribute != null) {
+ name = elementNameAttribute.Name;
+ }
+ return name;
+ }
+ }
+
+ ///
+ /// The this element belongs to.
+ ///
+ public virtual SysGenEngine SysGen
+ {
+ get { return _sysgen; }
+ set { _sysgen = value; }
+ }
+
+ public RBuildProject Project
+ {
+ get { return _project; }
+ set { _project = value; }
+ }
+
+ public RBuildModule Module
+ {
+ get
+ {
+ RBuildModule module = RBuildElement as RBuildModule;
+
+ if (module == null)
+ throw new BuildException(String.Format("Task <{0} ... \\> is not child of any ModuleTask." , Name), Location);
+
+ return module;
+ }
+ }
+
+ ///
+ /// this element belongs to.
+ ///
+ public virtual RBuildElement RBuildElement
+ {
+ get
+ {
+ IElement element = this;
+ while (element != null)
+ {
+ if (element is ISysGenObject)
+ return ((ISysGenObject)element).RBuildElement;
+
+ //Set to his parent
+ element = element.Parent;
+ }
+
+ return SysGen.Project;
+ }
+ }
+
+ public string BaseBuildLocation
+ {
+ get { return Path.GetDirectoryName(new Uri(_xmlNode.BaseURI).LocalPath); }
+ }
+
+ public XmlNode XmlNode
+ {
+ get { return _xmlNode; }
+ }
+
+ ///
+ /// Initializes all build attributes.
+ ///
+ private void InitializeProperties(XmlNode elementNode)
+ {
+ // Get the current element Type
+ Type currentType = GetType();
+
+ PropertyInfo[] propertyInfoArray = currentType.GetProperties(BindingFlags.Public|BindingFlags.Instance);
+ foreach (PropertyInfo propertyInfo in propertyInfoArray )
+ {
+ // process all TaskPropertyAttribute attributes
+ TaskPropertyAttribute[] propertyAttributes = (TaskPropertyAttribute[])
+ Attribute.GetCustomAttributes(propertyInfo, typeof(TaskPropertyAttribute) , false);
+
+ foreach(TaskPropertyAttribute propertyAttribute in propertyAttributes)
+ {
+ string propertyValue = null;
+
+ if (propertyAttribute.Location == TaskPropertyLocation.Attribute)
+ {
+ if (elementNode.Attributes[propertyAttribute.Name] != null)
+ {
+ propertyValue = elementNode.Attributes[propertyAttribute.Name].Value;
+ }
+ }
+ else if (propertyAttribute.Location == TaskPropertyLocation.Node)
+ {
+ propertyValue = elementNode.InnerText;
+ }
+
+ // check if its required
+ if (propertyValue == null && propertyAttribute.Required && m_FailOnMissingRequired)
+ {
+ throw new BuildException(String.Format("'{0}' is a required '{1}' of <{2} ... \\>.", propertyAttribute.Name, propertyAttribute.Location , Name), Location);
+ }
+
+ if (propertyValue != null)
+ {
+ //string attrValue = attributeNode.Value;
+ if (propertyAttribute.ExpandProperties)
+ {
+ // expand attribute properites
+ propertyValue = SysGen.ExpandProperties(propertyValue);
+ }
+
+ if (propertyInfo.CanWrite)
+ {
+ // set the property value instead
+ MethodInfo info = propertyInfo.GetSetMethod();
+ object[] paramaters = new object[1];
+
+ Type propertyType = propertyInfo.PropertyType;
+
+ // If the object is an emum
+ if (propertyType.IsSubclassOf(typeof(System.Enum)))
+ {
+ try
+ {
+ paramaters[0] = Enum.Parse(propertyType, propertyValue, true);
+ }
+ catch (Exception)
+ {
+ // catch type conversion exceptions here
+ string message = string.Format("Invalid value '{0}'. Valid values for this attribute are:\n", propertyValue);
+ foreach (object value in Enum.GetValues(propertyType))
+ {
+ message += string.Format("\t{0}\n", value.ToString());
+ }
+ throw new BuildException(message, Location);
+ }
+ }
+ else
+ {
+ //validate attribute value with custom ValidatorAttribute(ors)
+ ValidatorAttribute[] validateAttributes = (ValidatorAttribute[])
+ Attribute.GetCustomAttributes(propertyInfo, typeof(ValidatorAttribute));
+ try
+ {
+ foreach (ValidatorAttribute validator in validateAttributes)
+ validator.Validate(propertyValue);
+ }
+ catch (ValidationException ve)
+ {
+ throw new ValidationException(ve.Message, Location);
+ }
+
+ if (propertyType == typeof(System.Boolean))
+ {
+ paramaters[0] = Convert.ChangeType(SysGenConversion.ToBolean(propertyValue), propertyInfo.PropertyType);
+ }
+ else
+ {
+ paramaters[0] = Convert.ChangeType(propertyValue, propertyInfo.PropertyType);
+ }
+ }
+
+ info.Invoke(this, paramaters);
+ }
+ else
+ {
+ new BuildException(string.Format("Property '{0}' was found but '{1}' does no implement Set", propertyAttribute.Name, Name));
+ }
+ }
+ }
+
+ // now do nested BuildElements
+ BuildElementAttribute buildElementAttribute = (BuildElementAttribute)
+ Attribute.GetCustomAttribute(propertyInfo, typeof(BuildElementAttribute));
+
+ if (buildElementAttribute != null)
+ {
+ // get value from xml node
+ XmlNode nestedElementNode = elementNode[buildElementAttribute.Name, elementNode.OwnerDocument.DocumentElement.NamespaceURI];
+ // check if its required
+ if (nestedElementNode == null && buildElementAttribute.Required) {
+ throw new BuildException(String.Format("'{0}' is a required element of <{1} ...//>.", buildElementAttribute.Name, this.Name), Location);
+ }
+ if (nestedElementNode != null) {
+ Element childElement = (Element)propertyInfo.GetValue(this, null);
+ // Sanity check: Ensure property wasn't null.
+ if ( childElement == null )
+ throw new BuildException(String.Format("Property '{0}' value cannot be null for <{1} ...//>", propertyInfo.Name, this.Name), Location);
+ childElement.SysGen = SysGen;
+ childElement.Initialize(nestedElementNode);
+ }
+ }
+ }
+ }
+
+ /// Performs default initialization.
+ ///
+ /// Derived classes that wish to add custom initialization should override .
+ ///
+ public void Initialize(XmlNode elementNode)
+ {
+ if (SysGen == null)
+ throw new InvalidOperationException("Element has invalid BuildFileLoader property.");
+
+ // Save the element node
+ _xmlNode = elementNode;
+
+ // Save position in buildfile for reporting useful error messages.
+ try
+ {
+ _location = SysGen.LocationMap.GetLocation(elementNode);
+ }
+ catch(ArgumentException ae)
+ {
+ BuildLog.WriteLineIf(SysGen.Verbose, ae.ToString());
+ }
+
+ InitializeProperties(elementNode);
+
+ OnInit();
+
+ // Allow inherited classes a chance to do some custom initialization.
+ InitializeElement(elementNode);
+
+ // The Element has been completly initialized
+ OnLoad();
+ }
+
+ ///
+ /// Allows derived classes to provide extra initialization and validation not covered by the base class.
+ ///
+ /// The xml node of the element to use for initialization.
+ protected virtual void InitializeElement(XmlNode elementNode)
+ {
+ }
+
+ protected virtual void OnLoad()
+ {
+ }
+
+ protected virtual void OnInit()
+ {
+ }
+
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Exceptions/BuildException.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Exceptions/BuildException.cs
new file mode 100644
index 00000000000..b8b422221be
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Exceptions/BuildException.cs
@@ -0,0 +1,101 @@
+using System;
+using System.Runtime.Serialization;
+
+namespace SysGen.BuildEngine
+{
+ ///
+ /// Thrown whenever an error occurs during the build.
+ ///
+ [Serializable]
+ public class BuildException : ApplicationException
+ {
+ private Location _location = Location.UnknownLocation;
+
+ ///
+ /// Constructs a build exception with no descriptive information.
+ ///
+ public BuildException() : base() {
+ }
+
+ public BuildException(String message, params object[] args)
+ : base(string.Format(message, args))
+ {
+ }
+
+ ///
+ /// Constructs an exception with a descriptive message.
+ ///
+ public BuildException(String message) : base(message) {
+ }
+
+ ///
+ /// Constructs an exception with a descriptive message and an
+ /// instance of the Exception that is the cause of the current Exception.
+ ///
+ public BuildException(Exception e, String message) : base(message, e) {
+ }
+
+ ///
+ /// Constructs an exception with a descriptive message and an
+ /// instance of the Exception that is the cause of the current Exception.
+ ///
+ public BuildException(Exception e, String message,params object[] args)
+ : base(string.Format(message , args), e)
+ {
+ }
+
+ ///
+ /// Constructs an exception with a descriptive message and location
+ /// in the build file that caused the exception.
+ ///
+ /// The error message that explains the reason for the exception.
+ /// Location in the build file where the exception occured.
+ public BuildException(String message, Location location) : base(message) {
+ _location = location;
+ }
+
+ ///
+ /// Constructs an exception with the given descriptive message, the
+ /// location in the build file and an instance of the Exception that
+ /// is the cause of the current Exception.
+ ///
+ /// The error message that explains the reason for the exception.
+ /// Location in the build file where the exception occured.
+ /// An instance of Exception that is the cause of the current Exception.
+ public BuildException(String message, Location location, Exception e) : base(message, e) {
+ _location = location;
+ }
+
+ /// Initializes a new instance of the BuildException class with serialized data.
+ public BuildException(SerializationInfo info, StreamingContext context) : base(info, context) {
+ /*
+ string fileName = info.GetString("Location.FileName");
+ int lineNumber = info.GetInt32("Location.LineNumber");
+ int columnNumber = info.GetInt32("Location.ColumnNumber");
+ */
+ _location = info.GetValue("Location", _location.GetType()) as Location;
+ }
+
+ /// Sets the SerializationInfo object with information about the exception.
+ /// The object that holds the serialized object data.
+ /// The contextual information about the source or destination.
+ /// For more information, see SerializationInfo in the Microsoft documentation.
+ public override void GetObjectData(SerializationInfo info, StreamingContext context) {
+ base.GetObjectData(info, context);
+ info.AddValue("Location", _location);
+ }
+
+ public override string Message {
+ get {
+ string message = base.Message;
+
+ // only include location string if not empty
+ string locationString = _location.ToString();
+ if (locationString != String.Empty) {
+ message = locationString + "\n " + message;
+ }
+ return message;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Exceptions/ValidationException.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Exceptions/ValidationException.cs
new file mode 100644
index 00000000000..0150c5c79f0
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Exceptions/ValidationException.cs
@@ -0,0 +1,62 @@
+using System;
+using System.Runtime.Serialization;
+
+namespace SysGen.BuildEngine
+{
+ ///
+ /// This exception indicates that an error has occured while performing a validate operation.
+ /// The ValidationEventHandler can cause this exception to be thrown during the validate operations
+ ///
+ [Serializable]
+ public class ValidationException : BuildException
+ {
+ ///
+ /// Constructs a build exception with no descriptive information.
+ ///
+ public ValidationException() : base() {}
+
+ ///
+ /// Constructs an exception with a descriptive message.
+ ///
+ public ValidationException(String message) : base(message) {}
+
+ ///
+ /// Constructs an exception with a descriptive message and an
+ /// instance of the Exception that is the cause of the current Exception.
+ ///
+ public ValidationException(String message, Exception e) : base(e, message) {}
+
+ ///
+ /// Constructs an exception with a descriptive message and location
+ /// in the build file that caused the exception.
+ ///
+ /// The error message that explains the reason for the exception.
+ /// Location in the build file where the exception occured.
+ public ValidationException(String message, Location location) : base(message, location) {}
+
+ ///
+ /// Constructs an exception with the given descriptive message, the
+ /// location in the build file and an instance of the Exception that
+ /// is the cause of the current Exception.
+ ///
+ /// The error message that explains the reason for the exception.
+ /// Location in the build file where the exception occured.
+ /// An instance of Exception that is the cause of the current Exception.
+ public ValidationException(String message, Location location, Exception e) : base(message, location, e) {}
+
+ /// Initializes a new instance of the ValidationException class with serialized data.
+ public ValidationException(SerializationInfo info, StreamingContext context) : base(info, context) {}
+
+ /// Sets the SerializationInfo object with information about the exception.
+ /// The object that holds the serialized object data.
+ /// The contextual information about the source or destination.
+ /// For more information, see SerializationInfo in the Microsoft documentation.
+ public override void GetObjectData(SerializationInfo info, StreamingContext context) {}
+
+ public override string Message {
+ get {
+ return base.Message;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/Base/AutoGeneratedCFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/Base/AutoGeneratedCFileWriter.cs
new file mode 100644
index 00000000000..9f37bd4c0e5
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/Base/AutoGeneratedCFileWriter.cs
@@ -0,0 +1,30 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.BuildEngine.Framework;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public abstract class AutoGeneratedCFileWriter : AutoGeneratedFileWriter
+ {
+ public AutoGeneratedCFileWriter(RBuildModule module, string file)
+ : base(module , file)
+ {
+ }
+
+ protected virtual void WriteHeader()
+ {
+ WriteLine("/* This file is automatically generated. */");
+ WriteLine();
+ }
+
+ protected virtual void WriteFooter()
+ {
+ WriteLine("/* EOF */");
+ WriteLine();
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/Base/AutoGeneratedFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/Base/AutoGeneratedFileWriter.cs
new file mode 100644
index 00000000000..02a03e04fe3
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/Base/AutoGeneratedFileWriter.cs
@@ -0,0 +1,39 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public abstract class AutoGeneratedFileWriter : StreamWriter
+ {
+ RBuildProject m_Project = null;
+ RBuildModule m_Module = null;
+
+ public AutoGeneratedFileWriter(RBuildProject project, string file)
+ : base(file)
+ {
+ m_Project = project;
+ }
+
+ public AutoGeneratedFileWriter(RBuildModule module, string file)
+ : base(file)
+ {
+ m_Module = module;
+ }
+
+ protected RBuildProject Project
+ {
+ get { return m_Project; }
+ }
+
+ protected RBuildModule Module
+ {
+ get { return m_Module; }
+ }
+
+ public abstract void WriteFile();
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/Base/AutoGeneratedInfFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/Base/AutoGeneratedInfFileWriter.cs
new file mode 100644
index 00000000000..93135c8771b
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/Base/AutoGeneratedInfFileWriter.cs
@@ -0,0 +1,54 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public abstract class AutoGeneratedInfFileWriter : AutoGeneratedFileWriter
+ {
+ public AutoGeneratedInfFileWriter(RBuildProject project, string file)
+ : base(project , file)
+ {
+ }
+
+ protected virtual void WriteHeader()
+ {
+ WriteSection("Version");
+ WriteLine("Signature = \"$Windows NT$\"");
+ WriteLine("ClassGUID = {00000000-0000-0000-0000-000000000000}");
+ WriteLine();
+ }
+
+ protected void WriteSection(string sectionName)
+ {
+ WriteLine("[{0}]", sectionName);
+ }
+
+ protected void WriteComment (string comment)
+ {
+ WriteLine("; {0}", comment);
+ }
+
+ protected void WriteAssignment(string name , string value)
+ {
+ WriteLine("{0} = {1}",
+ name ,
+ value);
+ }
+
+ protected void WriteBooleanAssignment(string name, bool value)
+ {
+ if (value)
+ {
+ WriteAssignment(name, "yes");
+ }
+ else
+ {
+ WriteAssignment(name, "no");
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/BuildNumberFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/BuildNumberFileWriter.cs
new file mode 100644
index 00000000000..330c9162ded
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/BuildNumberFileWriter.cs
@@ -0,0 +1,45 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.Framework;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.Framework
+{
+ public class BuildNumberFileWriter : AutoGeneratedCFileWriter
+ {
+ public BuildNumberFileWriter(RBuildProject project, string file)
+ : base(project , file)
+ {
+ }
+
+ public override void WriteFile()
+ {
+ WriteHeader();
+ WriteCompilationUnit();
+ WriteFooter();
+ }
+
+ private void WriteBuildNumber()
+ {
+ WriteLine("#ifndef _INC_REACTOS_BUILDNO");
+ WriteLine("#define _INC_REACTOS_BUILDNO");
+ WriteLine("#define KERNEL_VERSION_BUILD 20080427");
+ WriteLine("#define KERNEL_VERSION_BUILD_HEX 0x8187");
+ WriteLine("#define KERNEL_VERSION_BUILD_STR \"20080427-r33159\"");
+ WriteLine("#define KERNEL_VERSION_BUILD_RC \"20080427-r33159\0\"");
+ WriteLine("#define KERNEL_RELEASE_RC \"0.4-SVN\0\"");
+ WriteLine("#define KERNEL_RELEASE_STR \"0.4-SVN\"");
+ WriteLine("#define KERNEL_VERSION_RC \"0.4-SVN\0\"");
+ WriteLine("#define KERNEL_VERSION_STR \"0.4-SVN\"");
+ WriteLine("#define REACTOS_DLL_VERSION_MAJOR 42");
+ WriteLine("#define REACTOS_DLL_RELEASE_RC \"42.4-SVN\0\"");
+ WriteLine("#define REACTOS_DLL_RELEASE_STR \"42.4-SVN\"");
+ WriteLine("#define REACTOS_DLL_VERSION_RC \"42.4-SVN\0\"");
+ WriteLine("#define REACTOS_DLL_VERSION_STR \"42.4-SVN\"");
+ WriteLine("#endif");
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/CompilationUnitFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/CompilationUnitFileWriter.cs
new file mode 100644
index 00000000000..e0dd0063b8c
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/CompilationUnitFileWriter.cs
@@ -0,0 +1,42 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public class CompilationUnitFileWriter : AutoGeneratedCFileWriter
+ {
+ private RBuildCompilationUnitFile m_CompilationUnit = null;
+
+ public CompilationUnitFileWriter(RBuildModule module, RBuildCompilationUnitFile unit , string file)
+ : base(module , file)
+ {
+ m_CompilationUnit = unit;
+ }
+
+ protected override void WriteHeader()
+ {
+ base.WriteHeader();
+
+ WriteLine("#define ONE_COMPILATION_UNIT");
+ WriteLine();
+ }
+
+ public override void WriteFile()
+ {
+ WriteHeader();
+ WriteCompilationUnit();
+ }
+
+ private void WriteCompilationUnit()
+ {
+ foreach (RBuildSourceFile file in m_CompilationUnit.SourceFiles)
+ {
+ WriteLine("#include <{0}>", file.FullPath);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/DefinitionFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/DefinitionFileWriter.cs
new file mode 100644
index 00000000000..d0d11a5073b
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/DefinitionFileWriter.cs
@@ -0,0 +1,21 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public class DefinitionFileWriter : AutoGeneratedFileWriter
+ {
+ public DefinitionFileWriter(RBuildProject project, string file)
+ : base(project , file)
+ {
+ }
+
+ public override void WriteFile()
+ {
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/DffFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/DffFileWriter.cs
new file mode 100644
index 00000000000..ce146aca3bf
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/DffFileWriter.cs
@@ -0,0 +1,139 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public class DffFileWriter : AutoGeneratedFileWriter
+ {
+ public DffFileWriter(RBuildProject project , string file)
+ : base(project , file)
+ {
+ }
+
+ public override void WriteFile()
+ {
+ WriteHeader();
+ WriteModuleTargets();
+ }
+
+ protected void WriteHeader()
+ {
+ WriteLine("; Main ReactOS package");
+ WriteLine();
+ WriteLine(".Set DiskLabelTemplate=\"ReactOS\" ; Label of disk");
+ WriteLine(".Set CabinetNameTemplate=\"reactos.cab\" ; reactos.cab");
+ WriteLine(".Set InfFileName=\"reactos.inf\" ; reactos.inf");
+ WriteLine();
+ WriteLine(";.Set Cabinet=on");
+ WriteLine(";.Set Compress=on");
+ WriteLine();
+ WriteLine(".InfBegin");
+ WriteLine("[Version]");
+ WriteLine("Signature = \"$ReactOS$\"");
+ WriteLine();
+ WriteLine("[Directories]");
+
+ foreach (RBuildInstallFolder folder in Project.InstallFolders)
+ {
+ if (folder.Name == string.Empty ||
+ folder.Name == ".")
+ {
+ WriteLine("{0} =",
+ folder.ID);
+ }
+ else
+ WriteLine("{0} = {1}",
+ folder.ID,
+ folder.Name);
+ }
+
+ WriteLine(".InfEnd");
+ WriteLine();
+ WriteLine("; Contents of disk");
+ WriteLine(".InfBegin");
+ WriteLine("[SourceFiles]");
+ WriteLine(".InfEnd");
+ }
+
+ protected void WriteModuleTargets()
+ {
+ RBuildInstallFolder installFolder = null;
+
+ WriteLine();
+ WriteLine(";Module targets");
+ WriteLine();
+
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Enabled)
+ {
+ if ((module.IsInstallable) && (module.HasInstallBase))
+ {
+ if ((!module.IsBootstrap || module.IsSpecialIncludedBootStrap) && !module.IsSpecialExcludedBootStrap)
+ {
+ //Get the install folder
+ installFolder = Project.InstallFolders.GetByName(module.InstallBase);
+
+ if (installFolder == null)
+ throw new BuildException("InstallBase '{0}' for module '{1}' references a non existant install folder",
+ module.InstallBase,
+ module.Name);
+
+ WriteLine("{0,-90}\t{1,10}",
+ module.TargetFile.FullPath,
+ installFolder.ID);
+ }
+ }
+
+ foreach (RBuildOutputFile file in module.Files)
+ {
+ RBuildPlatformFile platformFile = file as RBuildPlatformFile;
+
+ if (platformFile != null)
+ {
+ //Get the install folder
+ installFolder = Project.InstallFolders.GetByName(file.InstallBase);
+
+ if (installFolder == null)
+ throw new BuildException("InstallBase '{0}' for file '{1}' references a non existant install folder",
+ platformFile.InstallBase,
+ platformFile.FullPath);
+
+ WriteLine("{0,-90}\t{1,10}",
+ platformFile.FullPath,
+ installFolder.ID);
+ }
+ }
+ }
+ }
+
+ WriteLine();
+ WriteLine(";Install files");
+ WriteLine();
+
+ foreach (RBuildOutputFile file in Project.Files)
+ {
+ RBuildPlatformFile platformFile = file as RBuildPlatformFile;
+
+ if (platformFile != null)
+ {
+ //Get the install folder
+ installFolder = Project.InstallFolders.GetByName(file.InstallBase);
+
+ if (installFolder == null)
+ throw new BuildException("InstallBase '{0}' for file '{1}' references a non existant install folder",
+ platformFile.InstallBase,
+ platformFile.FullPath);
+
+ WriteLine("{0,-90}\t{1,10}",
+ platformFile.FullPath,
+ installFolder.ID);
+ }
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/HeaderCreditsFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/HeaderCreditsFileWriter.cs
new file mode 100644
index 00000000000..aa453d2ec5f
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/HeaderCreditsFileWriter.cs
@@ -0,0 +1,36 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public class HeaderCreditsFileWriter : AutoGeneratedFileWriter
+ {
+ public HeaderCreditsFileWriter(RBuildProject project, string file)
+ : base(project , file)
+ {
+ }
+
+ public override void WriteFile()
+ {
+ WriteLine("/* This file is autogenerated */");
+ WriteLine();
+ WriteLine("const char* szAutoContributors[]=");
+ WriteLine("{");
+
+ foreach (RBuildContributor contributor in Project.Contributors)
+ {
+ WriteLine("\t\t{0},", contributor.FullName);
+ }
+
+ WriteLine("\t0");
+ WriteLine("};");
+
+ // Adds a blank line
+ WriteLine();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/HeaderRosCfgFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/HeaderRosCfgFileWriter.cs
new file mode 100644
index 00000000000..5f9a2693b60
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/HeaderRosCfgFileWriter.cs
@@ -0,0 +1,26 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public class HeaderRosCfgFileWriter : AutoGeneratedFileWriter
+ {
+ public HeaderRosCfgFileWriter(RBuildProject project, string file)
+ : base(project , file)
+ {
+ }
+
+ public override void WriteFile()
+ {
+ WriteLine("/* This file is autogenerated */");
+ WriteLine();
+
+ // Adds a blank line
+ WriteLine();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/SysSetupComponentSetupFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/SysSetupComponentSetupFileWriter.cs
new file mode 100644
index 00000000000..f3eaa983bdb
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/SysSetupComponentSetupFileWriter.cs
@@ -0,0 +1,84 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public abstract class SysSetupComponentSetupFileWriter : AutoGeneratedInfFileWriter
+ {
+ public SysSetupComponentSetupFileWriter(RBuildProject project, string file)
+ : base(project , file)
+ {
+ }
+
+ protected virtual void WriteHeader()
+ {
+ WriteSection("Version");
+ WriteLine("Signature = \"$Windows NT$\"");
+ WriteLine();
+ }
+
+ protected virtual void WriteaAddRegDirective()
+ {
+ WriteSection("DefaultInstall");
+ WriteLine("AddReg=Install.Reg");
+ WriteLine();
+ }
+
+ public override void WriteFile()
+ {
+ WriteHeader();
+ WriteaAddRegDirective();
+ WriteContent();
+ }
+
+ protected abstract void WriteContent();
+ }
+
+ public class DesktopComponentSetupFileWriter : SysSetupComponentSetupFileWriter
+ {
+ public DesktopComponentSetupFileWriter(RBuildProject project, string file)
+ : base(project, file)
+ {
+ }
+
+ protected override void WriteContent()
+ {
+ WriteLine("[Install.Reg]");
+
+ if (Project.Platform.Screensaver != null)
+ {
+ WriteLine("HKU,\"Control Panel\\Desktop\",\"1SCRNSAVE.EXE\",0x00000000,\"{0}\"",
+ Project.Platform.Screensaver.PlatformInstall.FullPath);
+ }
+
+ if (Project.Platform.Wallpaper != null)
+ {
+ WriteLine("HKU,\"Control Panel\\Desktop\",\"1Wallpaper\",0x00000000,\"{0}\"",
+ Project.Platform.Wallpaper.PlatformInstall.FullPath);
+ }
+ }
+ }
+
+ public class ShellComponentSetupFileWriter : SysSetupComponentSetupFileWriter
+ {
+ public ShellComponentSetupFileWriter(RBuildProject project, string file)
+ : base(project, file)
+ {
+ }
+
+ protected override void WriteContent()
+ {
+ WriteLine("[Install.Reg]");
+
+ if (Project.Platform.Shell != null)
+ {
+ WriteLine("HKLM,\"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\\",\"Shell\",0x00020000,\"{0}\"",
+ Project.Platform.Shell.PlatformInstall.FullPath);
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/SysSetupFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/SysSetupFileWriter.cs
new file mode 100644
index 00000000000..e18646da744
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/SysSetupFileWriter.cs
@@ -0,0 +1,92 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public class SysSetupFileWriter : AutoGeneratedInfFileWriter
+ {
+ public SysSetupFileWriter(RBuildProject project, string file)
+ : base(project , file)
+ {
+ }
+
+ public override void WriteFile()
+ {
+ WriteHeader();
+ WriteInfDevicesSection();
+ WriteInfRegistrationPhase2Section();
+ WriteInfOleControlDllsSection();
+ WriteInfAlwaysSection();
+ }
+
+ protected void WriteInfDevicesSection()
+ {
+ WriteLine("[DeviceInfsToInstall]");
+ WriteLine("cdrom.inf");
+ WriteLine("display.inf");
+ WriteLine("hdc.inf");
+ WriteLine("keyboard.inf");
+ WriteLine("machine.inf");
+ WriteLine("msmouse.inf");
+ WriteLine("NET_NIC.inf");
+ WriteLine("ports.inf");
+ WriteLine("scsi.inf");
+ WriteLine("usbport.inf");
+ WriteLine();
+ }
+
+ protected void WriteInfRegistrationPhase2Section()
+ {
+ WriteLine("[RegistrationPhase2]");
+ WriteLine("RegisterDlls=OleControlDlls");
+ WriteLine();
+ }
+
+ protected void WriteInfOleControlDllsSection()
+ {
+ WriteLine("[OleControlDlls]");
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.AutoRegister != null)
+ {
+ WriteLine("{0},,{1},{2}",
+ "11",
+ module.TargetName,
+ module.AutoRegister.RegistrationType);
+ }
+ }
+ WriteLine();
+ }
+
+ protected void WriteInfAlwaysSection()
+ {
+ WriteLine("[Infs.Always]");
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Setup != null)
+ {
+ WriteLine("{0},{1}",
+ module.Setup.Name,
+ module.Setup.InstallSection);
+ }
+ }
+
+ foreach (RBuildOutputFile file in Project.Files)
+ {
+ RBuildSetupFile setup = file as RBuildSetupFile;
+
+ if (setup != null)
+ {
+ WriteLine("{0},{1}",
+ setup.Name,
+ setup.InstallSection);
+ }
+ }
+ WriteLine();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/TxtCreditsFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/TxtCreditsFileWriter.cs
new file mode 100644
index 00000000000..280bdba0074
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/TxtCreditsFileWriter.cs
@@ -0,0 +1,52 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public class TxtCreditsFileWriter : AutoGeneratedFileWriter
+ {
+ public TxtCreditsFileWriter(RBuildProject project, string file)
+ : base(project , file)
+ {
+ }
+
+ public override void WriteFile()
+ {
+ WriteLine("ReactOS is available thanks to the work of:");
+ WriteLine();
+
+ foreach (RBuildContributor contributor in Project.Contributors)
+ {
+ if (contributor.HasAlias)
+ {
+ WriteLine("\t{0} ({1})",
+ contributor.FullName,
+ contributor.Alias);
+ }
+ else
+ {
+ WriteLine("\t{0}", contributor.FullName);
+ }
+
+ if (contributor.HasMail)
+ {
+ WriteLine("\t\t{0}", contributor.Mail);
+ }
+
+ if (contributor.HasLocation)
+ {
+ WriteLine("\t\t{0}, {1}",
+ contributor.City ,
+ contributor.Country);
+ }
+
+ // Adds a blank line
+ WriteLine();
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/TxtSetupFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/TxtSetupFileWriter.cs
new file mode 100644
index 00000000000..f1f55d52d56
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/TxtSetupFileWriter.cs
@@ -0,0 +1,137 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public class TxtSetupFileWriter : AutoGeneratedInfFileWriter
+ {
+ public TxtSetupFileWriter(RBuildProject project, string file)
+ : base(project , file)
+ {
+ }
+
+ public override void WriteFile()
+ {
+ WriteHeader();
+ WriteDirectories();
+ WriteSourceDiskDiles();
+ WriteLanguages();
+ WriteKeyboardLayouts();
+ WriteKeyboardLayoutFiles();
+ WriteRegistryInstall();
+ }
+
+ protected override void WriteHeader()
+ {
+ WriteSection("Version");
+ WriteLine("Signature = \"$ReactOS$\"");
+ WriteLine();
+ }
+
+ public void WriteDirectories()
+ {
+ WriteLine("[Directories]");
+ WriteLine("; = ");
+
+ foreach (RBuildInstallFolder folder in Project.InstallFolders)
+ {
+ WriteLine("{0} = {1}",
+ folder.ID,
+ folder.Name);
+ }
+ }
+
+ public void WriteSourceDiskDiles()
+ {
+ RBuildInstallFolder installFolder = null;
+
+ WriteLine("[SourceDisksFiles]");
+
+ foreach (RBuildModule module in Project.Modules)
+ {
+ if (module.Bootstrap != null)
+ {
+ if (module.Type == ModuleType.KernelModeDriver ||
+ module.Type == ModuleType.KernelModeDLL)
+ {
+ //Get the install folder
+ installFolder = Project.InstallFolders.GetByName(module.InstallBase);
+
+ if (installFolder == null)
+ throw new BuildException("InstallBase '{0}' for module '{1}' references a non existant install folder",
+ module.InstallBase,
+ module.Name);
+
+ WriteLine("{0,-50}\t{1,50}",
+ module.TargetFile.FullPath,
+ installFolder.ID);
+ }
+ }
+ }
+
+ WriteLine();
+ }
+
+ protected void WriteLanguages()
+ {
+ WriteSection("Languages");
+
+ foreach (RBuildLanguage language in Project.Platform.Languages)
+ {
+ WriteLine("{0} = \"{1}\"",
+ language.LCID,
+ language.Name);
+ }
+
+ WriteLine();
+ }
+
+ protected void WriteKeyboardLayouts()
+ {
+ WriteSection("KeyboardLayout");
+
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Type == ModuleType.KeyboardLayout)
+ {
+ WriteLine("{0} = \"{1}\"",
+ module.LCID ,
+ module.Description);
+ }
+ }
+
+ WriteLine();
+ }
+
+ protected void WriteKeyboardLayoutFiles()
+ {
+ WriteSection("Files.KeyboardLayout");
+
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Type == ModuleType.KeyboardLayout)
+ {
+ WriteLine("{0} = {1}",
+ module.LCID,
+ module.TargetName);
+ }
+ }
+
+ WriteLine();
+ }
+
+ protected void WriteRegistryInstall()
+ {
+ WriteLine("[HiveInfs.Install]");
+ WriteLine("AddReg=hivecls.inf,AddReg");
+ WriteLine("AddReg=hivedef.inf,AddReg");
+ WriteLine("AddReg=hivesft.inf,AddReg");
+ WriteLine("AddReg=hivesys.inf,AddReg");
+ WriteLine();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/TxtSetupHiveFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/TxtSetupHiveFileWriter.cs
new file mode 100644
index 00000000000..2a510834d9f
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/TxtSetupHiveFileWriter.cs
@@ -0,0 +1,59 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public class TxtSetupHiveFileWriter : AutoGeneratedInfFileWriter
+ {
+ public TxtSetupHiveFileWriter(RBuildProject project, string file)
+ : base(project , file)
+ {
+ }
+
+ public override void WriteFile()
+ {
+ WriteHeader();
+ WriteDirectories();
+ }
+
+ protected override void WriteHeader()
+ {
+ WriteSection("Version");
+ WriteLine("Signature = \"$ReactOS$\"");
+ WriteLine();
+ }
+
+ public void WriteDirectories()
+ {
+ WriteLine("[AddReg]");
+
+ if (Project.Platform.Shell != null)
+ {
+ WriteLine("HKLM,\"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\\",\"Shell\",0x00020000,\"{0}\"",
+ Project.Platform.Shell.PlatformInstall.FullPath);
+ }
+
+ if (Project.Platform.Screensaver != null)
+ {
+ WriteLine("HKCU,\"Control Panel\\Desktop\",\"SCRNSAVE.EXE\",0x00000000,\"{0}\"",
+ Project.Platform.Screensaver.PlatformInstall.FullPath);
+ }
+
+ if (Project.Platform.Wallpaper != null)
+ {
+ WriteLine("HKCU,\"Control Panel\\Desktop\",\"Wallpaper\",0x00000000,\"{0}\"",
+ Project.Platform.Wallpaper.PlatformInstall.FullPath);
+ }
+
+ if (Project.Platform.DebugChannels.Count > 0)
+ {
+ WriteLine("HKCU,\"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment\",\"DEBUGCHANNEL\",0x00020000,\"{0}\"",
+ Project.Platform.DebugChannels.Text);
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/UnAttendSetupFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/UnAttendSetupFileWriter.cs
new file mode 100644
index 00000000000..7f6ae75f7e4
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/UnAttendSetupFileWriter.cs
@@ -0,0 +1,46 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public class UnAttendSetupFileWriter : AutoGeneratedInfFileWriter
+ {
+ public UnAttendSetupFileWriter(RBuildProject project, string file)
+ : base(project , file)
+ {
+ }
+
+ public override void WriteFile()
+ {
+ WriteHeader();
+ WriteUnAttendFile();
+ }
+
+ protected override void WriteHeader()
+ {
+ WriteSection("Unattend");
+ WriteLine("Signature = \"$ReactOS$\"");
+ WriteLine();
+ }
+
+ protected void WriteUnAttendFile()
+ {
+ WriteBooleanAssignment("UnattendSetupEnabled", false);
+ WriteAssignment("DestinationDiskNumber", "0");
+ WriteAssignment("DestinationPartitionNumber", "1");
+ WriteAssignment("MBRInstallType", "2");
+ WriteAssignment("FullName", "MyName");
+ WriteAssignment("OrgName", "MyOrg");
+ WriteAssignment("ComputerName", "MyComputer");
+ WriteAssignment("AdminPassword", "MyPassword");
+ WriteAssignment("TimeZoneIndex", "85");
+ WriteAssignment("FormatPartition", "1");
+ WriteAssignment("AutoPartition", "1");
+ WriteAssignment("DisableVmwInst", "1");
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Handlers/SysSetupFileHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Handlers/SysSetupFileHandler.cs
new file mode 100644
index 00000000000..0ae911e0fc6
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Handlers/SysSetupFileHandler.cs
@@ -0,0 +1,138 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.BuildEngine;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Handlers
+{
+ public abstract class AutoGeneratedFileHandler : IFileHandler
+ {
+ protected SysGenEngine m_SysGenEngine = null;
+ protected RBuildFile m_OriginalFile = null;
+ protected RBuildFile m_DestFile = null;
+
+ public AutoGeneratedFileHandler(SysGenEngine engine)
+ {
+ m_SysGenEngine = engine;
+ }
+
+ public void Process(RBuildFile file)
+ {
+ m_OriginalFile = file;
+
+ if (file.Name == FileName)
+ {
+ // Set the generated file to the temporary path
+ m_DestFile = new RBuildFile();
+ m_DestFile.Root = PathRoot.Intermediate;
+ m_DestFile.Base = file.Base;
+ m_DestFile.Name = file.Name;
+
+ // Auto generate this file
+ AutoGenerate();
+
+ file = m_DestFile;
+ }
+ }
+
+ protected abstract void AutoGenerate();
+
+ protected abstract string FileName { get; }
+ }
+
+ public class HiveAutoGeneratedFileHandler : AutoGeneratedFileHandler
+ {
+ public HiveAutoGeneratedFileHandler(SysGenEngine engine)
+ : base(engine)
+ {
+ }
+
+ protected override string FileName
+ {
+ get { return "hivedef.inf"; }
+ }
+
+ protected override void AutoGenerate()
+ {
+ File.Copy(
+ m_SysGenEngine.ResolveRBuildFilePath(m_OriginalFile),
+ m_SysGenEngine.ResolveRBuildFilePath(m_DestFile));
+
+ File.WriteAllText (m_SysGenEngine.ResolveRBuildFilePath(m_DestFile) ,
+ "; Set default wallpaper\n" +
+ "HKCU,\"Control Panel\\Desktop\",\"Wallpaper\",0000000000,\"%SystemRoot%\\Green.bmp\"" +
+ "HKCU,\"Control Panel\\Desktop\",\"WallpaperStyle\",0x00000002,0x00000000\n" +
+ "HKCU,\"Control Panel\\Desktop\",\"TileWallpaper\",0x00000002,0x00000000\n");
+
+ }
+ }
+
+ public class AutorunFileHandler : IFileHandler
+ {
+ public void Process(RBuildFile file)
+ {
+ if (file.Name == "autorun.inf")
+ {
+ int i = 0;
+ }
+ }
+ }
+
+ public class SysSetupFileHandler : IFileHandler
+ {
+ public void Process(RBuildFile file)
+ {
+ if (file.Name == "syssetup.inf")
+ {
+ int i = 0;
+ }
+ }
+ }
+
+ public class TxtSetupFileHandler : IFileHandler
+ {
+ public void Process(RBuildFile file)
+ {
+ if (file.Name == "txtsetup.sif")
+ {
+ int i = 0;
+ }
+ }
+ }
+
+ public class UnattendFileHandler : IFileHandler
+ {
+ public void Process(RBuildFile file)
+ {
+ if (file.Name == "unattend.inf")
+ {
+ int i = 0;
+ }
+ }
+ }
+
+ public class DownloaderFileHandler : IFileHandler
+ {
+ public void Process(RBuildFile file)
+ {
+ if (file.Name == "downloader.xml")
+ {
+ int i = 0;
+ }
+ }
+ }
+
+ public class UnAttendedSetupFileHandler : IFileHandler
+ {
+ public void Process(RBuildFile file)
+ {
+ if (file.Name == "unattend.inf")
+ {
+ int i = 0;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IBuildStatusMailReporter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IBuildStatusMailReporter.cs
new file mode 100644
index 00000000000..4d156d6cc5b
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IBuildStatusMailReporter.cs
@@ -0,0 +1,10 @@
+using System;
+
+namespace SysGen.BuildEngine
+{
+ public interface IBuildStatusMailReporter
+ {
+ string MailAdress { get; }
+ string Subject { get; }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IDirectory.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IDirectory.cs
new file mode 100644
index 00000000000..9db7825e601
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IDirectory.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine
+{
+ public interface IDirectory
+ {
+ PathRoot Root { get; }
+ string BasePath { get; }
+
+ RBuildFolder Folder { get;}
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IElement.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IElement.cs
new file mode 100644
index 00000000000..58ca260b44d
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IElement.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Xml;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine
+{
+ public interface IElement
+ {
+ string BaseBuildLocation { get; }
+ void Initialize(System.Xml.XmlNode elementNode);
+ RBuildModule Module { get; }
+ string Name { get; }
+ IElement Parent { get; set; }
+ RBuildProject Project { get; set; }
+ //PropertyCollection Properties { get; }
+ RBuildElement RBuildElement { get; }
+ SysGenEngine SysGen { get; set; }
+ XmlNode XmlNode { get; }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IFileHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IFileHandler.cs
new file mode 100644
index 00000000000..8aa1e081b57
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IFileHandler.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine
+{
+ public interface IFileHandler
+ {
+ void Process(RBuildFile file);
+ }
+
+ public abstract class NamedFileHandler : IFileHandler
+ {
+ public abstract string FileName { get; }
+
+ public void Process(RBuildFile file)
+ {
+ if (file.Name == FileName)
+ {
+ }
+ }
+
+ protected abstract void Process();
+ }
+
+ public abstract class RegenerateFileHandler : NamedFileHandler
+ {
+ public virtual void Generate()
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IRBuildInstallable.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IRBuildInstallable.cs
new file mode 100644
index 00000000000..f3c94193996
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IRBuildInstallable.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class IRBuildInstallable
+ {
+ string InstallBase;
+
+ RBuildInstallFolder InstallFolder;
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/ISysGenObject.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/ISysGenObject.cs
new file mode 100644
index 00000000000..20c3246615a
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/ISysGenObject.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine
+{
+ ///
+ /// Represent one of the root element object types for SysGen : Project and Module
+ ///
+ public interface ISysGenObject
+ {
+ RBuildElement RBuildElement { get; }
+ }
+
+ public interface ISysGenObjectFileContainer
+ {
+ RBuildFileCollection Files { get; }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/ITask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/ITask.cs
new file mode 100644
index 00000000000..7e2e4f4eabe
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/ITask.cs
@@ -0,0 +1,18 @@
+using System;
+
+namespace SysGen.BuildEngine
+{
+ public interface ITask : IElement
+ {
+ void Execute();
+ bool FailOnError { get; set; }
+ bool IfDefined { get; set; }
+ bool IfNotDefined { get; set; }
+ string LogPrefix { get; }
+ string Name { get; }
+ void PostExecute();
+ void PreExecute();
+ string ToString();
+ bool Verbose { get; set; }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/ITaskContainer.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/ITaskContainer.cs
new file mode 100644
index 00000000000..053c6d2b849
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/ITaskContainer.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.BuildEngine
+{
+ public interface ITaskContainer : ITask
+ {
+ bool ExecuteChilds { get; }
+ TaskCollection ChildTasks { get; }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Location.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Location.cs
new file mode 100644
index 00000000000..d030fe2b0d5
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Location.cs
@@ -0,0 +1,89 @@
+using System;
+using System.IO;
+using System.Text;
+
+namespace SysGen.BuildEngine
+{
+ ///
+ /// Stores the file name, line number and column number to record a position in a text file.
+ ///
+ [Serializable]
+ public class Location {
+ string _fileName = null;
+ int _lineNumber = 0;
+ int _columnNumber = 0;
+
+ public static readonly Location UnknownLocation = new Location();
+
+ /// Creates a location consisting of a file name, line number and column number.
+ /// fileName can be a local URI resource, e.g., file:///C:/WINDOWS/setuplog.txt
+ public Location(string fileName, int lineNumber, int columnNumber) {
+ Init(fileName, lineNumber, columnNumber);
+ }
+
+ /// Creates a location consisting of a file name.
+ /// fileName can be a local URI resource, e.g., file:///C:/WINDOWS/setuplog.txt
+ public Location(string fileName) {
+ Init(fileName, 0, 0);
+ }
+
+ /// Creates an "unknown" location.
+ private Location() {
+ Init(null, 0, 0);
+ }
+
+ /// Private Init function.
+ private void Init(string fileName, int lineNumber, int columnNumber) {
+ if (fileName != null) {
+ try {
+ // first check to see if fileName is a URI
+ Uri uri = new Uri(fileName);
+ fileName = uri.LocalPath;
+ } catch {
+ // must be a simple filename
+ fileName = Path.GetFullPath(fileName);
+ }
+ }
+ _fileName = fileName;
+ _lineNumber = lineNumber;
+ _columnNumber = columnNumber;
+ }
+
+ /// Gets a string containing the file name for the location.
+ /// The file name includes both the file path and the extension.
+ public string FileName {
+ get { return _fileName; }
+ }
+
+ /// Gets the line number for the location.
+ /// Lines start at 1. Will be zero if not specified.
+ public int LineNumber {
+ get { return _lineNumber; }
+ }
+
+ /// Gets the column number for the location.
+ /// Columns start a 1. Will be zero if not specified.
+ public int ColumnNumber {
+ get { return _columnNumber; }
+ }
+
+ ///
+ /// Returns the file name, line number and a trailing space. An error
+ /// message can be appended easily. For unknown locations, returns
+ /// an empty string.
+ ///
+ public override string ToString() {
+ StringBuilder sb = new StringBuilder("");
+
+ if (_fileName != null) {
+ sb.Append(_fileName);
+ if (_lineNumber != 0) {
+ sb.Append(String.Format("({0},{1})", _lineNumber, _columnNumber));
+ }
+ sb.Append(":");
+ }
+
+ return sb.ToString();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/LocationMap.cs b/reactos/tools/sysgen/SysGen.BuildEngine/LocationMap.cs
new file mode 100644
index 00000000000..ad6c73e2900
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/LocationMap.cs
@@ -0,0 +1,211 @@
+using System;
+using System.IO;
+using System.Text.RegularExpressions;
+using System.Xml;
+using System.Xml.XPath;
+using System.Collections;
+
+namespace SysGen.BuildEngine
+{
+ ///
+ /// Maps XML nodes to the text positions from their original source.
+ ///
+ public class LocationMap {
+
+ struct TextPosition {
+ public static readonly TextPosition InvalidPosition = new TextPosition(-1,-1);
+
+ public TextPosition(int line, int column) {
+ Line = line;
+ Column = column;
+ }
+
+ public int Line;
+ public int Column;
+ }
+
+ // The LocationMap uses a hash table to map filenames to resolve specific maps.
+ Hashtable _fileMap = new Hashtable();
+
+ public LocationMap() {
+ }
+
+ /// Add a XmlDocument to the map.
+ ///
+ /// A document can only be added to the map once.
+ ///
+ public void Add(XmlDocument doc) {
+ // prevent duplicate mapping
+ // NOTE: if this becomes a liability then just return when a duplicate map has happened
+ string fileName = doc.BaseURI;
+
+ //check for non-backed documents
+ if(fileName == "")
+ return;
+
+ if (_fileMap.ContainsKey(fileName)) {
+ throw new ArgumentException(String.Format("XmlDocument '{0}' already mapped.", fileName), "doc");
+ }
+
+ Hashtable map = new Hashtable();
+
+ string parentXPath = "/"; // default to root
+ string previousXPath = "";
+ int previousDepth = 0;
+
+ // Load text reader.
+ XmlTextReader reader = new XmlTextReader(fileName);
+
+ reader.XmlResolver = null;
+
+ try {
+ map.Add((object) "/", (object) new TextPosition(1, 1));
+
+ ArrayList indexAtDepth = new ArrayList();
+
+ // loop thru all nodes in the document
+ while (reader.Read()) {
+ // Ignore nodes we aren't interested in
+ if ((reader.NodeType != XmlNodeType.Whitespace) &&
+ (reader.NodeType != XmlNodeType.EndElement) &&
+ (reader.NodeType != XmlNodeType.ProcessingInstruction) &&
+ (reader.NodeType != XmlNodeType.XmlDeclaration)) {
+
+ int level = reader.Depth;
+ string currentXPath = "";
+
+ // If we are higher than before
+ if (reader.Depth < previousDepth) {
+ // Clear vars for new depth
+ string[] list = parentXPath.Split('/');
+ string newXPath = ""; // once appended to / will be root node ...
+
+ for (int j = 1; j < level+1; j++) {
+ newXPath += "/" + list[j];
+ }
+
+ // higher than before so trim xpath\
+ parentXPath = newXPath; // one up from before
+
+ // clear indexes for depth greater than ours
+ indexAtDepth.RemoveRange(level+1, indexAtDepth.Count - (level+1));
+
+ } else if (reader.Depth > previousDepth) {
+ // we are lower
+ parentXPath = previousXPath;
+ }
+
+ // End depth setup
+ // Setup up index array
+ // add any needed extra items ( usually only 1 )
+ // would have used array but not sure what maximum depth will be beforehand
+ for (int index = indexAtDepth.Count; index < level+1; index++) {
+ indexAtDepth.Add(0);
+ }
+ // Set child index
+ if ((int) indexAtDepth[level] == 0) {
+ // first time thru
+ indexAtDepth[level] = 1;
+ } else {
+ indexAtDepth[level] = (int) indexAtDepth[level] + 1; // lower so append to xpath
+ }
+
+ // Do actual XPath generation
+ if (parentXPath.EndsWith("/")) {
+ currentXPath = parentXPath;
+ } else {
+ currentXPath = parentXPath + "/"; // add seperator
+ }
+
+ // Set the final XPath
+ currentXPath += "child::node()[" + indexAtDepth[level] + "]";
+
+ // Add to our hash structures
+ map.Add((object) currentXPath, (object) new TextPosition(reader.LineNumber, reader.LinePosition));
+
+ // setup up loop vars for next iteration
+ previousXPath = currentXPath;
+ previousDepth = reader.Depth;
+ }
+ }
+ } finally {
+ reader.Close();
+ }
+
+ // add map at the end to prevent adding maps that had errors
+ _fileMap.Add(fileName, map);
+
+ }
+
+ /// Return the in the xml file for the given node.
+ ///
+ /// The node passed in must be from a XmlDocument that has been added to the map.
+ ///
+ public Location GetLocation(XmlNode node) {
+ // find hashtable this node's file is mapped under
+ string fileName = node.BaseURI;
+ if (fileName == "" ) {
+ return new Location(null, 0, 0 ); // return null location because we have a fileless node.
+ }
+ if (!_fileMap.ContainsKey(fileName)) {
+ //throw new ArgumentException("Xml node has not been mapped.");
+ return new Location(null, 0, 0);
+ }
+
+ // find xpath for node
+ Hashtable map = (Hashtable) _fileMap[fileName];
+ string xpath = GetXPathFromNode(node);
+ if (!map.ContainsKey(xpath)) {
+ //throw new ArgumentException("Xml node has not been mapped.");
+ return new Location(null, 0, 0);
+ }
+
+ TextPosition pos = (TextPosition) map[xpath];
+ Location location = new Location(fileName, pos.Line, pos.Column);
+ return location;
+ }
+
+ private string GetXPathFromNode(XmlNode node) {
+ // IM TODO review this algorithm - tidy up
+ XPathNavigator nav = node.CreateNavigator();
+
+ string xpath = "";
+ int index = 0;
+
+ while (nav != null && nav.NodeType.ToString() != "Root")
+ {
+ // loop thru children until we find ourselves
+ XPathNavigator navParent = nav.Clone();
+ navParent.MoveToParent();
+ int parentIndex = 0;
+ navParent.MoveToFirstChild();
+ if (navParent.IsSamePosition(nav)) {
+ index = parentIndex;
+ }
+ while (navParent.MoveToNext()) {
+ parentIndex++;
+ if (navParent.IsSamePosition(nav)) {
+ index = parentIndex;
+ }
+ }
+
+ nav.MoveToParent(); // do loop condition here
+ index++; // Convert to 1 based index
+
+ string thisNode = "child::node()[" + index + "]";
+
+ if (xpath == "") {
+ xpath = thisNode;
+ } else {
+ // build xpath string
+ xpath = thisNode + "/" + xpath;
+ }
+ }
+
+ // prepend slash to ...
+ xpath = "/" + xpath;
+
+ return xpath;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Log/Log.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Log/Log.cs
new file mode 100644
index 00000000000..96de3e19a2a
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Log/Log.cs
@@ -0,0 +1,215 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Text;
+
+namespace SysGen.BuildEngine.Log
+{
+ public class BuildEventArgs : EventArgs
+ {
+ protected string _name = string.Empty;
+
+ public BuildEventArgs(string name)
+ {
+ _name = name;
+ }
+
+ public string Name
+ {
+ get { return _name; }
+ set { _name = value; }
+ }
+ }
+
+ /// Delegate to handle Build events
+ public delegate void BuildEventHandler(object sender, BuildEventArgs e);
+
+ public interface IBuildEventConsumer
+ {
+ /// Signals that a build has started. This event is fired before any targets have started.
+ void BuildStarted(object sender, BuildEventArgs e);
+
+ /// Signals that the last target has finished. This event will still be fired if an error occurred during the build.
+ void BuildFinished(object sender, BuildEventArgs e);
+
+ /// Signals that a target has started.
+ void TargetStarted(object sender, BuildEventArgs e);
+
+ /// Signals that a target has finished. This event will still be fired if an error occurred during the build.
+ void TargetFinished(object sender, BuildEventArgs e);
+
+ /// Signals that a task has started.
+ void TaskStarted(object sender, BuildEventArgs e);
+
+ /// Signals that a task has finished. This event will still be fired if an error occurred during the build.
+ void TaskFinished(object sender, BuildEventArgs e);
+ }
+
+ public abstract class LogListener {
+ public abstract void Write(string message);
+ public abstract void WriteLine(string message);
+ public virtual void WriteLine(string message, string messageType) {
+ WriteLine(message);
+ }
+
+ public virtual void Flush() {
+ }
+ }
+
+ /// Provides a set of methods and properties that log the execution of the build process. This class cannot be inherited.
+ public sealed class BuildLog
+ {
+ private static bool _autoFlush;
+ private static int _indentLevel;
+ private static int _indentSize;
+ private static bool _needIndent; // true if the output should be indented; otherwise, false
+ private static LogListenerCollection _listeners;
+
+ static BuildLog()
+ {
+ _autoFlush = false;
+ _indentLevel = 0;
+ _indentSize = 4;
+ _needIndent = true;
+ _listeners = new LogListenerCollection();
+ _listeners.Add(new ConsoleLogger());
+ }
+
+ /// Gets or sets whether Flush should be called on the Listeners after every write.
+ public static bool AutoFlush {
+ get { return _autoFlush; }
+ set { _autoFlush = value; }
+ }
+
+ /// Gets or sets the indent level. Default is zero.
+ public static int IndentLevel {
+ get { return _indentLevel; }
+ set { _indentLevel = value; }
+ }
+
+ /// Gets or sets the number of spaces in an indent. Default is four.
+ public static int IndentSize {
+ get { return _indentSize; }
+ set { _indentSize = value; }
+ }
+
+ /// Gets the collection of listeners that is monitoring the log output.
+ public static LogListenerCollection Listeners {
+ get { return _listeners; }
+ }
+
+ /// Flushes the output buffer, and causes buffered data to be written to the Listeners.
+ public static void Flush() {
+ foreach (LogListener l in _listeners) {
+ l.Flush();
+ }
+ }
+
+ /// Increases the current IndentLevel by one.
+ public static void Indent() {
+ _indentLevel++;
+ }
+
+ /// Decreases the current IndentLevel by one.
+ public static void Unindent() {
+ if (_indentLevel > 0) {
+ _indentLevel--;
+ }
+ }
+
+ /// Indents the message if needed.
+ private static string FormatMessage(string message) {
+ // if we are starting a new line then first indent the string
+ if (_needIndent) {
+ if (IndentLevel > 0) {
+ StringBuilder sb = new StringBuilder(message);
+ sb.Insert(0, " ", IndentLevel * IndentSize);
+ message = sb.ToString();
+ }
+ _needIndent = false;
+ }
+ return message;
+ }
+
+ /// Writes the given message to the log.
+ public static void Write(string message) {
+ message = FormatMessage(message);
+ foreach (LogListener l in _listeners) {
+ l.Write(message);
+ }
+
+ if (AutoFlush) {
+ Flush();
+ }
+ }
+
+ /// Writes the given message to the log.
+ public static void Write(string format, params object[] arg) {
+ Write(String.Format(format, arg));
+ }
+
+ /// Writes the given message to the log if condition is true.
+ public static void WriteIf(bool condition, string message) {
+ if (condition) {
+ Write(message);
+ }
+ }
+
+ /// Writes the given message to the log if condition is true.
+ public static void WriteIf(bool condition, string format, params object[] arg) {
+ if (condition) {
+ Write(String.Format(format, arg));
+ }
+ }
+
+ /// Writes the given message to the log.
+ public static void WriteLine(string message) {
+ Write(message + Environment.NewLine);
+ _needIndent = true;
+ }
+
+ /// Writes the given message to the log.
+ public static void WriteLine() {
+ WriteLine(String.Empty);
+ }
+
+ /// Writes the given message to the log.
+ public static void WriteLine(string format, params object[] arg) {
+ WriteLine(String.Format(format, arg));
+ }
+
+ public static void WriteMessage(string message, string messageType) {
+ message = FormatMessage(message);
+ foreach (LogListener l in _listeners) {
+ l.WriteLine(message, messageType);
+ }
+
+ if (AutoFlush) {
+ Flush();
+ }
+ }
+
+ /// Writes the given message to the log if condition is true.
+ public static void WriteLineIf(bool condition, string message) {
+ if (condition) {
+ WriteLine(message);
+ }
+ }
+
+ /// Writes the given message to the log if condition is true.
+ public static void WriteLineIf(bool condition, string format, params object[] arg) {
+ if (condition) {
+ WriteLine(String.Format(format, arg));
+ }
+ }
+ }
+
+ public class LogWriter : StringWriter {
+ public override void Close() {
+ BuildLog.Write(GetStringBuilder().ToString());
+ base.Close();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Log/Loggers/ConsoleLogger.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Log/Loggers/ConsoleLogger.cs
new file mode 100644
index 00000000000..8ffa3fee74c
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Log/Loggers/ConsoleLogger.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.BuildEngine.Log
+{
+ ///
+ /// The standard logger that will suffice for any command line based nant runner.
+ ///
+ public class ConsoleLogger : LogListener
+ {
+ public override void Write(string message)
+ {
+ Console.Write(message);
+ }
+
+ public override void WriteLine(string message)
+ {
+ Console.WriteLine(message);
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Log/Loggers/StringLogger.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Log/Loggers/StringLogger.cs
new file mode 100644
index 00000000000..0a6319873b8
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Log/Loggers/StringLogger.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections;
+using System.Diagnostics;
+using System.IO;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Xml;
+
+namespace SysGen.BuildEngine.Log
+{
+ ///
+ /// Used for test classes to check output.
+ ///
+ public class StringLogger : LogListener
+ {
+ private StringWriter _writer = new StringWriter();
+
+ public override void Write(string message)
+ {
+ _writer.Write(message);
+ }
+
+ public override void WriteLine(string message)
+ {
+ _writer.WriteLine(message);
+ }
+
+ ///
+ /// Returns the contents of log captured.
+ ///
+ public override string ToString()
+ {
+ return _writer.ToString();
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Log/Loggers/XmlLogger.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Log/Loggers/XmlLogger.cs
new file mode 100644
index 00000000000..bc2da4f0e44
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Log/Loggers/XmlLogger.cs
@@ -0,0 +1,193 @@
+using System;
+using System.Collections;
+using System.Diagnostics;
+using System.IO;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Xml;
+
+namespace SysGen.BuildEngine.Log
+{
+ ///
+ /// Used to wrap log messages in xml <message/> elements
+ ///
+ public class XmlLogger : LogListener, IBuildEventConsumer
+ {
+ public class Elements
+ {
+ public const string BUILD_RESULTS = "buildresults";
+ public const string MESSAGE = "message";
+ public const string TARGET = "target";
+ public const string TASK = "task";
+ public const string STATUS = "status";
+ }
+
+ public class Attributes
+ {
+ public const string PROJECT = "project";
+ public const string MESSAGETYPE = "type";
+ }
+
+ private TextWriter _writer = Console.Out;
+ private XmlTextWriter _xmlWriter = new XmlTextWriter(Console.Out);
+
+ public XmlLogger()
+ {
+
+ }
+
+ public XmlLogger(TextWriter writer)
+ {
+ _writer = writer;
+ _xmlWriter = new XmlTextWriter(_writer);
+ _xmlWriter.Formatting = Formatting.Indented;
+ }
+
+ public string StripFormatting(string message)
+ {
+ //looking for zero or more white space from front of line followed by
+ //one or more of just about anything between [ and ] followed by a message
+ //which we will capture. ' [blah]
+ Regex r = new Regex(@"(?ms)^\s*?\[[\s\w\d]+\](.+)");
+
+ Match m = r.Match(message);
+ if (m.Success)
+ {
+ return m.Groups[1].Captures[0].Value.Trim();
+ }
+ return message;
+ }
+
+ public bool IsJustWhiteSpace(string message)
+ {
+ Regex r = new Regex(@"^\s*$");
+
+ return r.Match(message).Success;
+ }
+
+ #region LogListener Overrides
+
+ public override void Write(string formattedMessage)
+ {
+ WriteLine(formattedMessage, null);
+ }
+
+ public override void WriteLine(string message)
+ {
+ WriteLine(message, null);
+ }
+
+ public override void WriteLine(string message, string messageType)
+ {
+ string rawMessage = StripFormatting(message.Trim());
+ if (IsJustWhiteSpace(rawMessage))
+ {
+ return;
+ }
+
+ _xmlWriter.WriteStartElement(Elements.MESSAGE);
+
+ if (messageType != null && messageType != String.Empty)
+ {
+ _xmlWriter.WriteAttributeString(Attributes.MESSAGETYPE, messageType);
+ }
+
+ if (IsValidXml(rawMessage))
+ {
+ rawMessage = Regex.Replace(rawMessage, @"<\?.*\?>", String.Empty);
+ _xmlWriter.WriteRaw(rawMessage);
+ }
+ else
+ {
+ _xmlWriter.WriteCData(StripCData(rawMessage));
+ }
+ _xmlWriter.WriteEndElement();
+ _xmlWriter.Flush();
+ }
+
+ private bool IsValidXml(string message)
+ {
+ if (Regex.Match(message, @"^<.*>").Success)
+ {
+ // validate xml
+ XmlValidatingReader reader = new XmlValidatingReader(message, XmlNodeType.Element, null);
+ try { while (reader.Read()) { } }
+ catch (Exception) { return false; }
+ finally { reader.Close(); }
+ return true;
+ }
+ return false;
+ }
+
+ private string StripCData(string message)
+ {
+ string strippedMessage = Regex.Replace(message, @"", String.Empty);
+ }
+
+ public override void Flush()
+ {
+ _writer.Flush();
+ }
+
+ /// Returns the contents of log captured.
+ public override string ToString()
+ {
+ return _writer.ToString();
+ }
+
+ #endregion
+
+ #region IBuildEventConsumer Implementation
+
+ public void BuildStarted(object obj, BuildEventArgs args)
+ {
+ _xmlWriter.WriteStartElement(Elements.BUILD_RESULTS);
+ _xmlWriter.WriteAttributeString(Attributes.PROJECT, args.Name);
+ }
+
+ public void BuildFinished(object obj, BuildEventArgs args)
+ {
+ _xmlWriter.WriteEndElement();
+ }
+
+ public void TargetStarted(object obj, BuildEventArgs args)
+ {
+ _xmlWriter.WriteStartElement(Elements.TARGET);
+ WriteNameAttribute(args.Name);
+ _xmlWriter.Flush();
+ }
+
+ public void TargetFinished(object obj, BuildEventArgs args)
+ {
+ _xmlWriter.WriteEndElement();
+ _xmlWriter.Flush();
+ }
+
+ public void TaskStarted(object obj, BuildEventArgs args)
+ {
+ _xmlWriter.WriteStartElement(Elements.TASK);
+ WriteNameAttribute(args.Name);
+ _xmlWriter.Flush();
+ }
+
+ public void TaskFinished(object obj, BuildEventArgs args)
+ {
+ _xmlWriter.WriteEndElement();
+ _xmlWriter.Flush();
+ }
+
+ private void WriteNameAttribute(string name)
+ {
+ _xmlWriter.WriteAttributeString("name", name);
+ }
+
+ private void WriteStatus(string status)
+ {
+ _xmlWriter.WriteStartElement(Elements.STATUS);
+ _xmlWriter.WriteAttributeString("value", status);
+ _xmlWriter.WriteEndElement();
+ }
+ #endregion
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Plugins/TaskBuilder.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Plugins/TaskBuilder.cs
new file mode 100644
index 00000000000..6fbe2b65424
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Plugins/TaskBuilder.cs
@@ -0,0 +1,72 @@
+using System;
+using System.Reflection;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine
+{
+ public class TaskBuilder
+ {
+ private string _className;
+ private string _assemblyFileName;
+ private string _taskName;
+
+ public TaskBuilder(string className) : this(className, null) {
+ }
+
+ public TaskBuilder(string className, string assemblyFileName) {
+ _className = className;
+ _assemblyFileName = assemblyFileName;
+
+ // get task name from attribute
+ Assembly assembly = GetAssembly();
+ TaskNameAttribute taskNameAttribute = (TaskNameAttribute)
+ Attribute.GetCustomAttribute(assembly.GetType(ClassName), typeof(TaskNameAttribute));
+
+ _taskName = taskNameAttribute.FullTaskName; // Name;
+ }
+
+ public string ClassName
+ {
+ get { return _className; }
+ }
+
+ public string AssemblyFileName
+ {
+ get { return _assemblyFileName; }
+ }
+
+ public string TaskName
+ {
+ get { return _taskName; }
+ }
+
+ private Assembly GetAssembly() {
+ Assembly assembly = null;
+ if (AssemblyFileName == null) {
+ assembly = Assembly.GetExecutingAssembly();
+ } else {
+ //check to see if it is loaded already
+ Assembly [] ass = AppDomain.CurrentDomain.GetAssemblies();
+ for (int i = 0; i < ass.Length; i++){
+ try {
+ if(ass[i].Location.Equals(AssemblyFileName)) {
+ assembly = ass[i];
+ return assembly;
+ }
+ }
+ // System.Reflection.Emit.Assembly have no location and will fail
+ catch{}
+ }
+ //load if not loaded
+ if(assembly == null)
+ assembly = Assembly.LoadFrom(AssemblyFileName);
+ }
+ return assembly;
+ }
+
+ public Task CreateTask()
+ {
+ return (Task)GetAssembly().CreateInstance(ClassName, true);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Plugins/TaskFactory.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Plugins/TaskFactory.cs
new file mode 100644
index 00000000000..66c14ff3a17
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Plugins/TaskFactory.cs
@@ -0,0 +1,136 @@
+using System;
+using System.IO;
+using System.Xml;
+using System.Reflection;
+using System.Collections;
+
+namespace SysGen.BuildEngine
+{
+ ///
+ /// The TaskFactory comprises all of the loaded, and available, tasks.
+ /// Use these static methods to register, initialize and create a task.
+ ///
+ public class TaskFactory
+ {
+ static TaskBuilderCollection _builders = new TaskBuilderCollection();
+ static ArrayList _projects = new ArrayList();
+
+ ///
+ /// Initializes the tasks in the executing assembly, and basedir of the current domain.
+ ///
+ static TaskFactory()
+ {
+ // initialize builtin tasks
+ AddTasks(Assembly.GetExecutingAssembly());
+ AddTasks(Assembly.GetCallingAssembly());
+
+
+ //string nantBinDir = Path.GetFullPath(AppDomain.CurrentDomain.BaseDirectory);
+ //ScanDir(nantBinDir);
+ //ScanDir(Path.Combine(nantBinDir, "tasks"));
+ }
+
+ /*
+ /// Scans the path for any Tasks assemblies and adds them.
+ /// The directory to scan in.
+ protected static void ScanDir(string path) {
+ // Don't do anything if we don't have a valid directory path
+ if(path == null || path == string.Empty) {
+ return;
+ }
+
+ // intialize tasks found in assemblies that end in Tasks.dll
+ DirectoryScanner scanner = new DirectoryScanner();
+ scanner.BaseDirectory = path;
+ scanner.Includes.Add("*Tasks.dll");
+
+ //needed for testing
+ scanner.Includes.Add("*Tests.dll");
+ scanner.Includes.Add("*Test.dll");
+
+ foreach(string assemblyFile in scanner.FileNames) {
+ //Log.WriteLine("{0}:Add Tasks from {1}", AppDomain.CurrentDomain.FriendlyName, assemblyFile);
+
+ AddTasks(Assembly.LoadFrom(assemblyFile));
+ //AddTasks(AppDomain.CurrentDomain.Load(assemblyFile.Replace(AppDomain.CurrentDomain.BaseDirectory,"").Replace(".dll","")));
+ }
+
+ }
+ */
+
+ /*
+ /// Adds any Task Assemblies in the Project.BaseDirectory.
+ /// The project to work from.
+ public static void AddProject(SysGenEngine project) {
+ if(project.BaseDirectory != null && !project.BaseDirectory.Equals(string.Empty)) {
+ ScanDir(project.BaseDirectory);
+ ScanDir(Path.Combine(project.BaseDirectory, "tasks"));
+ }
+ //create weakref to project. It is possible that project may go away, we don't want to hold it.
+ _projects.Add(new WeakReference(project));
+ foreach(TaskBuilder tb in Builders) {
+ UpdateProjectWithBuilder(project, tb);
+ }
+ }*/
+
+ /// Returns the list of loaded TaskBuilders
+ public static TaskBuilderCollection Builders {
+ get { return _builders; }
+ }
+ /// Scans the given assembly for any classes derived from Task and adds a new builder for them.
+ /// The Assembly containing the new tasks to be loaded.
+ /// The count of tasks found in the assembly.
+ public static int AddTasks(Assembly assembly) {
+ int taskCount = 0;
+ try {
+ foreach(Type type in assembly.GetTypes()) {
+ if (type.IsSubclassOf(typeof(Task)) && !type.IsAbstract) {
+ TaskBuilder tb = new TaskBuilder(type.FullName, assembly.Location);
+ if (_builders.Add(tb)) {
+ foreach(WeakReference wr in _projects) {
+ if(!wr.IsAlive)
+ continue;
+ SysGenEngine p = wr.Target as SysGenEngine;
+ if(p == null)
+ continue;
+ UpdateProjectWithBuilder(p, tb);
+ }
+ taskCount++;
+ }
+ }
+ }
+ }
+ // For assemblies that don't have types
+ catch{};
+
+ return taskCount;
+ }
+
+ protected static void UpdateProjectWithBuilder(SysGenEngine sysGen, TaskBuilder taskBuilder)
+ {
+ // add a true property for each task (use in build to test for task existence).
+ // add a property for each task with the assembly location.
+ sysGen.Properties.AddReadOnly("SysGen.Tasks." + taskBuilder.TaskName + ".Available", Boolean.TrueString);
+ sysGen.Properties.AddReadOnly("SysGen.Tasks." + taskBuilder.TaskName + ".Assembly", taskBuilder.AssemblyFileName);
+ }
+
+ /// Creates a new Task instance for the given xml and project.
+ /// The XML to initialize the task with.
+ /// The Project that the Task belongs to.
+ /// The Task instance.
+ public static Task CreateTask(XmlNode taskNode, SysGenEngine proj)
+ {
+ string taskName = taskNode.Name;
+
+ TaskBuilder builder = _builders.FindBuilderForTask(taskName);
+ if (builder == null && proj != null) {
+ Location location = proj.LocationMap.GetLocation(taskNode);
+ throw new BuildException(String.Format("Unknown task <{0}>", taskName), location);
+ }
+
+ Task task = builder.CreateTask();
+ task.SysGen = proj;
+ return task;
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Properties/AssemblyInfo.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..be7575e9d01
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Properties/AssemblyInfo.cs
@@ -0,0 +1,15 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+[assembly: AssemblyTitle("SysGen")]
+[assembly: AssemblyDescription("SysGen ReactOS Build Tool")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("SysGen")]
+[assembly: AssemblyCopyright("Copyright (C) 2007 J.Marc Piulachs")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+[assembly: AssemblyVersion("0.1.0.*")]
+
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyName("")]
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/SysGen.Framework.csproj b/reactos/tools/sysgen/SysGen.BuildEngine/SysGen.Framework.csproj
new file mode 100644
index 00000000000..515cf8ded34
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/SysGen.Framework.csproj
@@ -0,0 +1,381 @@
+
+
+ Local
+ 9.0.30729
+ 2.0
+ {8F5F8375-4097-4952-B860-784EB9961ABE}
+ Debug
+ AnyCPU
+
+
+
+
+ SysGen.Framework
+
+
+ JScript
+ Grid
+ IE50
+ false
+ Library
+ SysGen.Framework
+
+
+
+
+
+
+ 2.0
+ publish\
+ true
+ Disk
+ false
+ Foreground
+ 7
+ Days
+ false
+ false
+ true
+ 0
+ 1.0.0.%2a
+ false
+ false
+ true
+
+
+ bin\Debug\
+ false
+ 285212672
+ false
+
+
+
+
+
+
+ true
+ 4096
+ false
+ false
+ false
+ false
+ 1
+ full
+ prompt
+
+
+ bin\Debug\
+ false
+ 285212672
+ false
+
+
+
+
+
+
+ true
+ 4096
+ false
+ false
+ false
+ false
+ 1
+ full
+ prompt
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+
+
+
+
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+
+ Code
+
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+
+
+
+
+
+ Code
+
+
+ Code
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+
+
+
+
+
+
+
+
+
+
+ {88D9BED7-30C5-4683-A6C6-6F2EB55B8F26}
+ SysGen.RBuild.Framework
+
+
+
+
+ False
+ .NET Framework Client Profile
+ false
+
+
+ False
+ .NET Framework 2.0 %28x86%29
+ true
+
+
+ False
+ .NET Framework 3.0 %28x86%29
+ false
+
+
+ False
+ .NET Framework 3.5
+ false
+
+
+ False
+ .NET Framework 3.5 SP1
+ false
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/SysGen.Framework.csproj.user b/reactos/tools/sysgen/SysGen.BuildEngine/SysGen.Framework.csproj.user
new file mode 100644
index 00000000000..ef20f1c8f95
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/SysGen.Framework.csproj.user
@@ -0,0 +1,19 @@
+
+
+ ShowAllFiles
+
+
+
+
+
+
+
+
+
+
+
+
+ en-US
+ false
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/SysGenConversion.cs b/reactos/tools/sysgen/SysGen.BuildEngine/SysGenConversion.cs
new file mode 100644
index 00000000000..e9fe9b97686
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/SysGenConversion.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.BuildEngine
+{
+ class SysGenConversion
+ {
+ public static bool ToBolean(object value)
+ {
+ switch (value.ToString().ToLower())
+ {
+ case "yes":
+ case "true":
+ case "1":
+ return true;
+ case "no":
+ case "false":
+ case "0":
+ return false;
+ }
+
+ throw new ValidationException(String.Format("Cannot resolve to '{0}' to Boolean value.", value.ToString()));
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/SysGenDependencyTracker.cs b/reactos/tools/sysgen/SysGen.BuildEngine/SysGenDependencyTracker.cs
new file mode 100644
index 00000000000..1f49363684b
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/SysGenDependencyTracker.cs
@@ -0,0 +1,118 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Framework;
+
+namespace SysGen.BuildEngine
+{
+ public class SysGenDependencyTracker
+ {
+ RBuildProject m_Project = null;
+ RBuildModuleCollection m_Modules = new RBuildModuleCollection();
+ RBuildModuleCollection m_DependsOn = new RBuildModuleCollection();
+ RBuildModuleCollection m_DependencyOf = new RBuildModuleCollection();
+
+ public SysGenDependencyTracker(RBuildProject project)
+ {
+ m_Project = project;
+ }
+
+ public SysGenDependencyTracker(RBuildProject project, RBuildModule module)
+ : this(project)
+ {
+ m_Modules.Add(module);
+ Calculate();
+ }
+
+ public SysGenDependencyTracker(RBuildProject project, RBuildModuleCollection modules)
+ : this(project)
+ {
+ m_Modules.Add(modules);
+ Calculate();
+ }
+
+ public void Calculate()
+ {
+ m_DependsOn.Clear();
+ m_DependencyOf.Clear();
+
+ foreach (RBuildModule module in m_Modules)
+ {
+ GetModuleDependencies(module);
+ }
+
+ foreach (RBuildModule projectModule in m_Project.Modules)
+ {
+ foreach (RBuildModule module in m_Modules)
+ {
+ if (projectModule.Needs.Contains(module))
+ {
+ m_DependencyOf.Add(projectModule);
+ }
+ }
+ }
+ }
+
+ private void GetModuleDependencies(RBuildModule module)
+ {
+ foreach (RBuildModule library in module.Needs)
+ {
+ if (m_DependsOn.Contains(library) == false)
+ {
+ if (m_Modules.Contains(library) == false)
+ {
+ //Add it to the list of dependencies
+ m_DependsOn.Add(library);
+
+ //Investigate the module to find its dependencies
+ GetModuleDependencies(library);
+ }
+ }
+ }
+ }
+
+ public RBuildModuleCollection DependsOn
+ {
+ get { return m_DependsOn; }
+ }
+
+ public RBuildModuleCollection DependencyOf
+ {
+ get { return m_DependencyOf; }
+ }
+
+ public RBuildModuleCollection Missing
+ {
+ get
+ {
+ RBuildModuleCollection missing = new RBuildModuleCollection();
+
+ foreach (RBuildModule dependency in DependsOn)
+ {
+ if (m_Project.Platform.Modules.Contains(dependency) == false)
+ missing.Add(dependency);
+ }
+
+ return missing;
+ }
+ }
+
+ public RBuildModuleCollection Using
+ {
+ get
+ {
+ RBuildModuleCollection missing = new RBuildModuleCollection();
+
+ foreach (RBuildModule dependency in DependencyOf)
+ {
+ if (m_Project.Platform.Modules.Contains(dependency) == true)
+ missing.Add(dependency);
+ }
+
+ return missing;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/SysGenEngine.cs b/reactos/tools/sysgen/SysGen.BuildEngine/SysGenEngine.cs
new file mode 100644
index 00000000000..70d8b470285
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/SysGenEngine.cs
@@ -0,0 +1,825 @@
+using System;
+using System.Text.RegularExpressions;
+using System.Diagnostics;
+using System.IO;
+using System.Reflection;
+using System.Xml;
+using System.Xml.XPath;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Log;
+using SysGen.BuildEngine.Tasks;
+using SysGen.BuildEngine.Handlers;
+using SysGen.BuildEngine.Backends;
+
+namespace SysGen.BuildEngine
+{
+ public class SysGenEngine
+ {
+ private Task m_RootTask = null;
+
+ private RBuildProject m_Project = null;
+ private RBuildPlatform m_Platform = null;
+
+ //private TargetCollection m_Targets = new TargetCollection();
+ private FileHandlerCollection m_FileHandlers = new FileHandlerCollection();
+ private BackendCollection m_Backends = new BackendCollection();
+ private RBuildPropertyCollection m_Properties = new RBuildPropertyCollection();
+ private StringCollection m_XmlBuildFiles = new StringCollection();
+
+ //xml element and attribute names that are not defined in metadata
+ protected const string PROJECT_XMLROOT = "project";
+ protected const string PROJECT_NAME_ATTRIBUTE = "name";
+ protected const string PROJECT_DEFAULT_ATTRIBUTE = "default";
+ protected const string PROJECT_BASEDIR_ATTRIBUTE = "basedir";
+
+ public const string SYSGEN_PROPERTY_FILENAME = "SysGen.Filename";
+ public const string SYSGEN_PROPERTY_VERSION = "SysGen.Version";
+ public const string SYSGEN_PROPERTY_LOCATION = "SysGen.Location";
+ public const string SYSGEN_PROPERTY_PROJECT_NAME = "SysGen.Project.Name";
+ public const string SYSGEN_PROPERTY_PROJECT_BUILDFILE = "SysGen.Project.File";
+ public const string SYSGEN_PROPERTY_PROJECT_BASEDIR = "SysGen.Project.BaseDir";
+
+ private string m_BaseDir = null;
+ private bool m_Verbose = false;
+ private bool m_ExecuteBackends = true;
+ private bool m_SetDefaults = true;
+
+ private LocationMap _locationMap = new LocationMap();
+ private XmlDocument _doc = null; // set in ctorHelper
+
+ public static event BuildEventHandler BuildStarted;
+ public static event BuildEventHandler BuildFinished;
+ public static event BuildEventHandler TargetStarted;
+ public static event BuildEventHandler TargetFinished;
+ public static event BuildEventHandler TaskStarted;
+ public static event BuildEventHandler TaskFinished;
+ public static event BuildEventHandler TaskException;
+ public static event BuildEventHandler BuildFileLoaded;
+
+ public static void OnBuildFileLoaded(object o, BuildEventArgs e)
+ {
+ if (BuildFileLoaded != null)
+ BuildFileLoaded(o, e);
+ }
+
+ public static void OnBuildStarted(object o, BuildEventArgs e)
+ {
+ if (BuildStarted != null)
+ BuildStarted(o, e);
+ }
+
+ public static void OnBuildFinished(object o, BuildEventArgs e)
+ {
+ if (BuildFinished != null)
+ BuildFinished(o, e);
+ }
+
+ public static void OnTargetStarted(object o, BuildEventArgs e)
+ {
+ if (TargetStarted != null)
+ TargetStarted(o, e);
+ }
+
+ public static void OnTargetFinished(object o, BuildEventArgs e)
+ {
+ if (TargetFinished != null)
+ TargetFinished(o, e);
+ }
+
+ public static void OnTaskStarted(object o, BuildEventArgs e)
+ {
+ if (TaskStarted != null)
+ TaskStarted(o, e);
+ }
+
+ public static void OnTaskFinished(object o, BuildEventArgs e)
+ {
+ if (TaskFinished != null)
+ TaskFinished(o, e);
+ }
+
+ public static void OnTaskException(object o, BuildEventArgs e)
+ {
+ if (TaskException != null)
+ TaskException(o, e);
+ }
+
+ public RBuildProject Project
+ {
+ get { return m_Project; }
+ set
+ {
+ if (m_Project != null)
+ throw new BuildException("Only one ProjectTask is allowed per project");
+
+ m_Project = value;
+
+ InitializeEnvironment();
+ }
+ }
+
+ public Task RootTask
+ {
+ get { return m_RootTask; }
+ set { m_RootTask = value; }
+ }
+
+ public StringCollection BuildFiles
+ {
+ get { return m_XmlBuildFiles; }
+ }
+
+ public bool SetDefaults
+ {
+ get { return m_SetDefaults; }
+ set { m_SetDefaults = value; }
+ }
+
+ public SysGenEngine(string path, string project) : this (Path.Combine (path , project))
+ {
+ }
+
+ ///
+ /// Constructs a new Project with the given source.
+ ///
+ ///
+ /// The Source should be the full path to the build file.
+ /// This can be of any form that XmlDocument.Load(string url) accepts.
+ ///
+ /// If the source is a uri of form 'file:///path' then use the path part.
+ public SysGenEngine(string source)
+ {
+ string path = source;
+ //if the source is not a valid uri, pass it thru.
+ //if the source is a file uri, pass the localpath of it thru.
+ try
+ {
+ Uri testURI = new Uri(source);
+ if (testURI.IsFile)
+ {
+ path = testURI.LocalPath;
+ }
+ }
+ catch (Exception e)
+ {
+ //do nothing.
+ e.ToString();
+ }
+ finally
+ {
+ if (path == null)
+ path = source;
+ }
+
+ ctorHelper(LoadBuildFile(path));
+ }
+
+ ///
+ /// Inits stuff:
+ /// TaskFactory: Calls Initialize and AddProject
+ /// Log.IndentSize set to 12
+ /// Project properties are initialized ("nant.* stuff set")
+ ///
+ /// NAnt Props:
+ /// - nant.filename
+ /// - nant.version
+ /// - nant.location
+ /// - nant.project.name
+ /// - nant.project.buildfile (if doc has baseuri)
+ /// - nant.project.basedir
+ /// - nant.project.default = defaultTarget
+ /// - nant.tasks.[name] = true
+ /// - nant.tasks.[name].location = AssemblyFileName
+ ///
+ ///
+ /// The Project Document.
+ protected virtual void ctorHelper(XmlDocument doc)
+ {
+ //TaskFactory.AddProject(this);
+ BuildLog.IndentSize = 12;
+ _doc = doc;
+
+ string newBaseDir = null;
+
+ //check to make sure that the root element in named correctly
+ if(!doc.DocumentElement.Name.Equals(PROJECT_XMLROOT))
+ throw new ApplicationException("Root Element must be named " + PROJECT_XMLROOT + " in " + doc.BaseURI);
+
+ /*
+ // get project attributes
+ if(doc.DocumentElement.HasAttribute(PROJECT_NAME_ATTRIBUTE))
+ _projectName = doc.DocumentElement.GetAttribute(PROJECT_NAME_ATTRIBUTE);
+
+ if(doc.DocumentElement.HasAttribute(PROJECT_BASEDIR_ATTRIBUTE))
+ newBaseDir = doc.DocumentElement.GetAttribute(PROJECT_BASEDIR_ATTRIBUTE);
+
+ if(doc.DocumentElement.HasAttribute(PROJECT_DEFAULT_ATTRIBUTE))
+ _defaultTargetName = doc.DocumentElement.GetAttribute(PROJECT_DEFAULT_ATTRIBUTE);
+ */
+
+ // give the project a meaningful base directory
+ if (newBaseDir == null) {
+ if (BuildFileLocalName != null) {
+ newBaseDir = Path.GetDirectoryName(BuildFileLocalName);
+ }
+ else {
+ newBaseDir = Environment.CurrentDirectory;
+ }
+ }
+
+ newBaseDir = Path.GetFullPath(newBaseDir);
+ //BaseDirectory must be rooted.
+ BaseDirectory = newBaseDir;
+
+ }
+
+ internal void InitializeBuildFile(XmlDocument doc, ITaskContainer parent)
+ {
+ // load line and column number information into position map
+ LocationMap.Add(doc);
+
+ // initialize targets and global tasks
+ foreach (XmlNode childNode in doc.ChildNodes)
+ {
+ if (CanProcessNode(childNode))
+ {
+ LoadChildTask(childNode, parent);
+ }
+ }
+ }
+
+ internal bool CanProcessNode(XmlNode childNode)
+ {
+ if ((childNode.NodeType == XmlNodeType.Element) &&
+ (childNode.Name.StartsWith("#") == false) &&
+ (childNode.Name.StartsWith("xml") == false) &&
+ (childNode.Name.StartsWith("!") == false) &&
+ (childNode.NamespaceURI.Equals(string.Empty) ||
+ (childNode.NamespaceURI.Equals("http://www.w3.org/2001/XInclude"))))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ internal Task LoadChildTask(XmlNode taskNode, ITaskContainer parent)
+ {
+ try
+ {
+ Task task = TaskFactory.CreateTask(taskNode, this);
+
+ task.Parent = parent;
+ task.Project = m_Project;
+ task.SysGen = this;
+ task.Initialize(taskNode);
+
+ if (task != RootTask)
+ parent.ChildTasks.Add(task);
+
+ return task;
+ }
+ catch (BuildException be)
+ {
+ BuildLog.WriteLine("{0} Failed to created Task for '{1}' xml element for reason: \n {2}", parent.LogPrefix, taskNode.Name, be.Message);
+ }
+
+ return null;
+ }
+
+ ///
+ /// Creates a new XmlDocument based on the project definition.
+ ///
+ /// The source of the document. Any form that is valid for XmlDocument.Load(string url) can be used here.
+ /// The project document.
+ private XmlDocument LoadBuildFile(string source)
+ {
+ XmlDocument doc = new XmlDocument();
+
+ try
+ {
+ OnBuildFileLoaded(this, new BuildEventArgs(source));
+
+ doc.XmlResolver = null;
+ doc.Load(source);
+
+ //Add the build file to the collection of readed xml build files
+ m_XmlBuildFiles.Add(source);
+ }
+ catch (XmlException e)
+ {
+ string message = "Error loading buildfile";
+ Location location = new Location(source, e.LineNumber, e.LinePosition);
+ throw new BuildException(message, location, e);
+ }
+ catch (Exception e)
+ {
+ string message = "Error loading buildfile";
+ Location location = new Location(source);
+ throw new BuildException(message, location, e);
+ }
+ return doc;
+ }
+
+ public virtual bool RBuildFolderExists(RBuildFolder folder)
+ {
+ return Directory.Exists(ResolveRBuildFilePath(folder));
+ }
+
+ public virtual bool RBuildFileExists(RBuildFile file)
+ {
+ return File.Exists(ResolveRBuildFilePath(file));
+ }
+
+ public virtual string ResolveRBuildFilePath(RBuildFileSystemInfo file)
+ {
+ return NormalizePath(Path.Combine(GetPathRoot(file.Root), file.FullPath));
+ }
+
+ public virtual string ResolveRBuildFolderPath(RBuildFolder folder)
+ {
+ return NormalizePath(Path.Combine(GetPathRoot(folder.Root), folder.FullPath));
+ }
+
+ public virtual string ResolveRBuildFilePath(PathRoot root, RBuildFileSystemInfo file)
+ {
+ return NormalizePath(Path.Combine(GetPathRoot(root), file.FullPath));
+ }
+
+ public string NormalizePath(string path)
+ {
+ return path.Replace(
+ Path.AltDirectorySeparatorChar,
+ Path.DirectorySeparatorChar);
+ }
+
+ public string IntermediateDirectory
+ {
+ get { return Path.Combine(BaseDirectory, "obj-i386"); }
+ }
+
+ public string DocumentationDirectory
+ {
+ get { return Path.Combine(BaseDirectory, "doc-i386"); }
+ }
+
+ public string ISODirectory
+ {
+ get { return Path.Combine(BaseDirectory, "iso-i386"); }
+ }
+
+ public string OutputDirectory
+ {
+ get { return Path.Combine(BaseDirectory, "output-i386"); }
+ }
+
+ public string BootCDOutputDirectory
+ {
+ get { return Path.Combine(OutputDirectory, "cd"); }
+ }
+
+ public string LiveCDOutputDirectory
+ {
+ get { return Path.Combine(OutputDirectory, "livecd"); }
+ }
+
+ public string TemporaryDirectory
+ {
+ get { return Path.Combine(BaseDirectory, "obj-i386"); }
+ }
+
+ public string InstallDirectory
+ {
+ get { return Path.Combine(BaseDirectory, "reactos"); }
+ }
+
+ public string GetPathRoot(PathRoot root)
+ {
+ switch (root)
+ {
+ case PathRoot.Default:
+ case PathRoot.SourceCode:
+ return BaseDirectory;
+ break;
+ case PathRoot.LiveCD:
+ return LiveCDOutputDirectory;
+ break;
+ case PathRoot.BootCD:
+ return BootCDOutputDirectory;
+ break;
+ case PathRoot.Intermediate:
+ return IntermediateDirectory;
+ break;
+ case PathRoot.Install:
+ return InstallDirectory;
+ break;
+ case PathRoot.Output:
+ return OutputDirectory;
+ break;
+ case PathRoot.Temporary:
+ return TemporaryDirectory;
+ break;
+ case PathRoot.Platform:
+ return "%SystemRoot%";
+ break;
+ default:
+ throw new Exception("Unknown PathRoot");
+ }
+ }
+
+ ///
+ /// The Base Directory used for relative references.
+ ///
+ ///
+ /// The directory must be rooted. (must start with drive letter, unc, etc.)
+ /// The BaseDirectory sets and gets the special property named 'nant.project.basedir'.
+ ///
+ public string BaseDirectory
+ {
+ get
+ {
+ //string basedir = null; // = Properties[NANT_PROPERTY_PROJECT_BASEDIR];
+
+ if (m_BaseDir == null)
+ return null;
+
+ if (!Path.IsPathRooted(m_BaseDir))
+ throw new BuildException("BaseDirectory must be rooted! " + m_BaseDir);
+
+ return m_BaseDir;
+ }
+ set
+ {
+ if (!Path.IsPathRooted(value))
+ throw new BuildException("BaseDirectory must be rooted! " + value);
+
+ m_BaseDir = value;
+
+ //Properties[NANT_PROPERTY_PROJECT_BASEDIR] = value;
+ }
+ }
+
+ ///
+ /// The URI form of the current Document
+ ///
+ public Uri BuildFileURI {
+ get {
+ //TODO: Need to remove this.
+ if(Doc == null || Doc.BaseURI == "") {
+ return null;//new Uri("http://localhost");
+ }
+ else {
+ return new Uri(Doc.BaseURI);
+ }
+ }
+ }
+
+ ///
+ /// If the build document is not file backed then null will be returned.
+ ///
+ public string BuildFileLocalName {
+ get {
+ if (BuildFileURI != null && BuildFileURI.IsFile) {
+ return BuildFileURI.LocalPath;
+ }
+ else {
+ return null;
+ }
+ }
+ }
+
+ /// Returns the active build file
+ public virtual XmlDocument Doc {
+ get { return _doc; }
+ }
+
+ ///
+ /// When true tasks should output more build log messages.
+ ///
+ public bool Verbose
+ {
+ get { return m_Verbose; }
+ set { m_Verbose = value; }
+ }
+
+ public bool RunBackends
+ {
+ get { return m_ExecuteBackends; }
+ set { m_ExecuteBackends = value; }
+ }
+
+ public RBuildPlatform Platform
+ {
+ get { return m_Platform; }
+ }
+
+ public RBuildPropertyCollection Properties
+ {
+ get { return m_Properties; }
+ }
+
+ internal LocationMap LocationMap {
+ get { return _locationMap; }
+ }
+
+ /////
+ ///// The targets defined in the this project.
+ /////
+ //public TargetCollection Targets
+ //{
+ // get { return m_Targets; }
+ //}
+
+ /// Executes the default target.
+ ///
+ /// No top level error handling is done. Any BuildExceptions will make it out of this method.
+ ///
+ public virtual void Execute()
+ {
+ //InitializeEnvironment();
+
+ //will initialize the list of Targets, and execute any global tasks.
+ InitializeBuildFile(Doc, null);
+
+ RegisterBackends();
+
+ if (Project.InstallFolders.Count == 0)
+ {
+ Project.InstallFolders.Add(new RBuildInstallFolder("1", @"."));
+ Project.InstallFolders.Add(new RBuildInstallFolder("2", @"system32"));
+ Project.InstallFolders.Add(new RBuildInstallFolder("3", @"system32\config"));
+ Project.InstallFolders.Add(new RBuildInstallFolder("4", @"system32\drivers"));
+ Project.InstallFolders.Add(new RBuildInstallFolder("5", @"system"));
+ Project.InstallFolders.Add(new RBuildInstallFolder("17", @"system32\drivers\etc"));
+ Project.InstallFolders.Add(new RBuildInstallFolder("20", @"inf"));
+ Project.InstallFolders.Add(new RBuildInstallFolder("22", @"fonts"));
+ Project.InstallFolders.Add(new RBuildInstallFolder("201", @"system32\bin"));
+ Project.InstallFolders.Add(new RBuildInstallFolder("202", @"media\fonts"));
+ Project.InstallFolders.Add(new RBuildInstallFolder("203", @"bin"));
+ Project.InstallFolders.Add(new RBuildInstallFolder("204", @"media"));
+ }
+
+ if (Project.DebugChannels.Count == 0)
+ {
+ Project.DebugChannels.Add(new RBuildDebugChannel("ole"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("rpc"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("gdi"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("crtdll"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("mshtml"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("setupapi"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("typelib"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("shdocvw"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("combo"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("listview"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("ntdll"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("richedit"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("statusbar"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("text"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("toolbar"));
+ }
+
+ if (Project.Languages.Count == 0)
+ {
+ Project.Languages.Add(new RBuildLanguage("en-us"));
+ Project.Languages.Add(new RBuildLanguage("es-es"));
+ }
+
+ m_RootTask.PreExecute();
+ m_RootTask.Execute();
+ m_RootTask.PostExecute();
+
+ SetPlatformDefaults();
+
+ //m_FileHandlers.Add(new TxtSetupFileHandler(this));
+ //m_FileHandlers.Add(new SysSetupFileHandler(this));
+ //m_FileHandlers.Add(new UnattendFileHandler(this));
+ //m_FileHandlers.Add(new DownloaderFileHandler(this));
+ //m_FileHandlers.Add(new AutorunFileHandler(this));
+ //m_FileHandlers.Add(new HiveAutoGeneratedFileHandler(this));
+ m_FileHandlers.ProcessFiles(Project.Files);
+
+ if (RunBackends)
+ Backends.Generate();
+ }
+
+ private void SetPlatformDefaults()
+ {
+ if (SetDefaults)
+ {
+ if (Project.Platform.Modules.Count == 0)
+ {
+ foreach (RBuildModule module in Project.Modules)
+ {
+ Project.Platform.Modules.Add(module);
+ }
+ }
+
+ if (Project.Languages.Count == 0)
+ {
+ foreach (RBuildLanguage language in Project.Languages)
+ {
+ Project.Platform.Languages.Add(language);
+ }
+ }
+
+ if (Project.DebugChannels.Count == 0)
+ {
+ foreach (RBuildDebugChannel channel in Project.DebugChannels)
+ {
+ Project.Platform.DebugChannels.Add(channel);
+ }
+ }
+ }
+ }
+
+ private void RegisterBackends()
+ {
+ //m_Backends.Add(new CatalogBackend(this));
+ //m_Backends.Add(new MingwBackend(this));
+ m_Backends.Add(new HtmlBackend(this));
+ //m_Backends.Add(new RGenStatBackend(this));
+ //m_Backends.Add(new BaseAddressReportBackend(this));
+ //m_Backends.Add(new BuildLogReport(this));
+ //m_Backends.Add(new ProjectTreeReport(this));
+ m_Backends.Add(new RBuildDBBackend(this));
+ //m_Backends.Add(new APIDocumentation(this));
+ }
+
+ public void CleanCustomConfigs()
+ {
+ Directory.SetCurrentDirectory (BaseDirectory);
+
+ if (File.Exists("config.rbuild"))
+ File.Delete("config.rbuild");
+
+ if (File.Exists("config-arm.rbuild"))
+ File.Delete("config-arm.rbuild");
+
+ if (File.Exists("config-ppc.rbuild"))
+ File.Delete("config-ppc.rbuild");
+ }
+
+ public BackendCollection Backends
+ {
+ get { return m_Backends; }
+ }
+
+ private void InitializeEnvironment()
+ {
+ Assembly ass = Assembly.GetExecutingAssembly();
+
+ Properties.AddReadOnly(SYSGEN_PROPERTY_FILENAME, ass.CodeBase);
+ Properties.AddReadOnly(SYSGEN_PROPERTY_VERSION, ass.GetName().Version.ToString());
+ Properties.AddReadOnly(SYSGEN_PROPERTY_LOCATION, AppDomain.CurrentDomain.BaseDirectory);
+
+ Project.Properties.AddReadOnly("CDOUTPUT", BootCDOutputDirectory + @"\reactos");
+ Project.Properties.AddReadOnly("INTERMEDIATE", IntermediateDirectory);
+ Project.Properties.AddReadOnly("SOURCECODE", BaseDirectory);
+ Project.Properties.AddReadOnly("OUTPUT", OutputDirectory);
+ Project.Properties.AddReadOnly("INSTALL", InstallDirectory);
+ Project.Properties.AddReadOnly("TEMP", TemporaryDirectory);
+ Project.Properties.AddReadOnly("DOC", DocumentationDirectory);
+ }
+
+ ///
+ /// Does Execute() and wraps in error handling and time stamping.
+ ///
+ /// Indication of success
+ public bool ReadBuildFiles()
+ {
+ //SysGenEngine.OnBuildStarted(this, new BuildEventArgs(_projectName));
+
+ bool success = true;
+ try
+ {
+ // Remember when the build was started
+ DateTime startTime = DateTime.Now;
+
+ BuildLog.WriteLine();
+ BuildLog.WriteLine("SysGen 0.2");
+ BuildLog.WriteLine();
+ BuildLog.WriteLine("Running on {0}", Environment.OSVersion.VersionString);
+ BuildLog.WriteLine();
+ BuildLog.WriteLine("Buildfile: {0}", BuildFileURI.AbsolutePath);
+ BuildLog.WriteLine("Base Directory: {0}", BaseDirectory);
+ BuildLog.WriteLine();
+ BuildLog.WriteLine("Reading rbuild files :");
+ BuildLog.WriteLine();
+
+ Execute();
+
+ TimeSpan buildTime = DateTime.Now - startTime;
+
+ BuildLog.WriteLine();
+ BuildLog.WriteLine("{0} SysGen Module(s) detected.", Project.Modules.Count);
+ BuildLog.WriteLine("{0} Platform Module(s) detected.", Project.Platform.Modules.Count);
+ BuildLog.WriteLine();
+ BuildLog.WriteLine("SysGen COMPLETED in {0} second(s)", (int)buildTime.TotalSeconds);
+ BuildLog.WriteLine();
+
+ //SysGenEngine.OnBuildFinished(this, new BuildEventArgs(_projectName));
+
+ success = true;
+ return true;
+
+ }
+ catch (BuildException e)
+ {
+ BuildLog.WriteMessage("Build Failed" , "error");
+ BuildLog.WriteLine();
+ BuildLog.WriteLine(e.Message);
+
+ if (e.InnerException != null)
+ {
+ BuildLog.WriteLine( e.InnerException.Message);
+ }
+
+ success = false;
+ return false;
+
+ }
+ catch (Exception e)
+ {
+ //throw;
+ // all other exceptions should have been caught
+ string message = "\nINTERNAL ERROR\n" + e.ToString() + "\nPlease send bug report to nant-developers@lists.sourceforge.net";
+ BuildLog.WriteMessage(message, "error");
+ success = false;
+ return false;
+ }
+ finally
+ {
+ //SysGenEngine.OnBuildFinished(this, new BuildEventArgs(_projectName));
+ }
+ }
+
+ /// Combine with project's to form a full path to file or directory.
+ ///
+ /// If it is possible for the path to contain property macros the path call first.
+ ///
+ ///
+ /// A rooted path.
+ ///
+ /// The relative or absolute path.
+ public string GetFullPath(string path) {
+ if (path == null) {
+ return BaseDirectory;
+ }
+
+ //Docs above read we should do this. But it should be done before it gets here.
+ //path = this.ExpandProperties(path);
+
+ if (!Path.IsPathRooted(path)) {
+ path = Path.Combine(BaseDirectory, path);
+ }
+ return path;
+ }
+
+ public string GetRelativePath(string path)
+ {
+ return path.Replace(BaseDirectory +"\\" , string.Empty);
+ }
+
+ ///
+ /// Expands a string from known properties
+ ///
+ /// The string with replacement tokens
+ /// The expanded and replaced string
+ public string ExpandProperties(string input)
+ {
+ string output = input;
+ if (input != null)
+ {
+ //matches ${abc} and $(abc) style properties
+ const string pattern = @"\$\{(?([^\}]*))\}|\$\(((?[^\}]*))\)";
+ foreach (Match m in Regex.Matches(input, pattern))
+ {
+ if (m.Length > 0)
+ {
+ try
+ {
+ string token = m.ToString();
+ string propertyName = m.Groups["name"].Value;
+
+ if (Project.Properties[propertyName] != null)
+ {
+ output = output.Replace(token, Project.Properties[propertyName].Value);
+ }
+ else
+ throw new BuildException(String.Format("Property '{0}' has not been set!", propertyName));
+ }
+ catch (ArgumentException ae)
+ {
+ throw new BuildException(String.Format("Bad formed property"));
+ }
+ }
+ }
+ }
+ return output;
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/SysGenPathResolver.cs b/reactos/tools/sysgen/SysGen.BuildEngine/SysGenPathResolver.cs
new file mode 100644
index 00000000000..1c1947b6d70
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/SysGenPathResolver.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+//using SysGen.RBuild.Framework;
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Attributes;
+using SysGen.BuildEngine.Tasks;
+
+namespace SysGen.BuildEngine
+{
+ class SysGenPathResolver
+ {
+ //public static string GetPath(Task current)
+ //{
+ // return GetPath(current, SysGen.ProjectTask);
+ //}
+
+ public static string GetPath(Task current, Task root)
+ {
+ IElement task = current.Parent;
+ while (task != root)
+ {
+ DirectoryTask directory = task as DirectoryTask;
+
+ if (directory != null)
+ return directory.Folder.FullPath;
+
+ task = task.Parent;
+ }
+
+ return string.Empty;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/Base/Task.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/Base/Task.cs
new file mode 100644
index 00000000000..5bee2d549d5
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/Base/Task.cs
@@ -0,0 +1,257 @@
+using System;
+using System.IO;
+using System.Reflection;
+using System.Xml;
+
+using SysGen.RBuild.Framework;
+
+using SysGen.BuildEngine.Log;
+using SysGen.BuildEngine.Attributes;
+using SysGen.BuildEngine.Tasks;
+
+namespace SysGen.BuildEngine
+{
+ public enum TaskExecuteStage
+ {
+ PreExecute,
+ Execute,
+ PostExecute
+ }
+
+ ///
+ /// Provides the abstract base class for tasks.
+ ///
+ ///
+ /// A task is a piece of code that can be executed.
+ ///
+ public abstract class Task : Element, ITask
+ {
+ protected bool _failOnError = true;
+ protected bool _verbose = false;
+ protected bool _ifDefined = true;
+ protected bool _ifNotDefined = false;
+
+ TaskExecuteStage _stage = TaskExecuteStage.PreExecute;
+
+ ///
+ /// Determines if task failure stops the build, or is just reported. Default is "true".
+ ///
+ [TaskAttribute("failonerror")]
+ [BooleanValidator()]
+ public bool FailOnError {
+ get { return _failOnError; }
+ set { _failOnError = value; }
+ }
+
+ ///
+ /// Task reports detailed build log messages. Default is "false".
+ ///
+ [TaskAttribute("verbose")]
+ [BooleanValidator()]
+ public bool Verbose {
+ get { return (_verbose || SysGen.Verbose); }
+ set { _verbose = value; }
+ }
+
+ ///
+ /// If true then the task will be executed; otherwise skipped. Default is "true".
+ ///
+ [TaskAttribute("if")]
+ [BooleanValidator()]
+ public bool IfDefined {
+ get { return _ifDefined; }
+ set { _ifDefined = value; }
+ }
+
+ ///
+ /// Opposite of if. If false then the task will be executed; otherwise skipped. Default is "false".
+ ///
+ [TaskAttribute("ifnot")]
+ [BooleanValidator()]
+ public bool IfNotDefined
+ {
+ get { return _ifNotDefined; }
+ set { _ifNotDefined = value; }
+ }
+
+ public string XmlFile
+ {
+ get { return new Uri(_xmlNode.OwnerDocument.BaseURI).LocalPath; }
+ }
+
+ public string RBuildFile
+ {
+ get { return Path.GetFileName(XmlFile); }
+ }
+
+ /// The name of the task.
+ public override string Name {
+ get {
+ string name = null;
+ TaskNameAttribute taskName = (TaskNameAttribute) Attribute.GetCustomAttribute(GetType(), typeof(TaskNameAttribute));
+ if (taskName != null) {
+ name = taskName.Name;
+ }
+ return name;
+ }
+ }
+
+ public RBuildFolder InFolder
+ {
+ get
+ {
+ IElement task = Parent;
+ while (task != SysGen.RootTask)
+ {
+ DirectoryTask directory = task as DirectoryTask;
+
+ if (directory != null)
+ return directory.Folder;
+
+ task = task.Parent;
+ }
+
+ return SysGen.Project.Folder;
+ }
+ }
+
+ ///
+ /// The prefix used when sending messages to the log.
+ ///
+ public string LogPrefix {
+ get {
+ string prefix = "[" + Name + "] ";
+ return prefix.PadLeft(BuildLog.IndentSize);
+ }
+ }
+
+ private TaskExecuteStage ExecutionStage
+ {
+ get { return _stage; }
+ }
+
+ ///
+ /// Executes the task unless it is skipped. Do not ovveride/new this method. Use ExecuteTask instead.
+ ///
+ public void Execute()
+ {
+ RunTask(TaskExecuteStage.Execute);
+ }
+
+ public void PostExecute()
+ {
+ RunTask(TaskExecuteStage.PostExecute);
+ }
+
+ public void PreExecute()
+ {
+ RunTask(TaskExecuteStage.PreExecute);
+ }
+
+ private void RunTask (TaskExecuteStage stage)
+ {
+ // Save the current execution stage
+ _stage = stage;
+
+ if (IfDefined && !IfNotDefined)
+ {
+ try
+ {
+ SysGenEngine.OnTaskStarted(this, new BuildEventArgs(Name));
+
+ switch (stage)
+ {
+ case TaskExecuteStage.PreExecute:
+ PreExecuteTask();
+ break;
+ case TaskExecuteStage.Execute:
+ ExecuteTask();
+ break;
+ case TaskExecuteStage.PostExecute:
+ PostExecuteTask();
+ break;
+ }
+
+ if (this is ITaskContainer)
+ {
+ ITaskContainer taskContainer = this as ITaskContainer;
+
+ if (taskContainer.ExecuteChilds)
+ {
+ foreach (Task taskChild in taskContainer.ChildTasks)
+ {
+ taskChild.RunTask(stage);
+ }
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ SysGenEngine.OnTaskException(this, new BuildEventArgs(Name));
+
+ if (FailOnError)
+ {
+ throw;
+ }
+ else
+ {
+ BuildLog.WriteLine(e.Message);
+ if (e.InnerException != null)
+ {
+ BuildLog.WriteLine(e.InnerException.Message);
+ }
+ }
+ }
+ finally
+ {
+ SysGenEngine.OnTaskFinished(this, new BuildEventArgs(Name));
+ }
+ }
+ }
+
+ protected override void InitializeElement(XmlNode elementNode)
+ {
+ if (this is ITaskContainer)
+ {
+ ITaskContainer taskContainer = this as ITaskContainer;
+
+ foreach (XmlNode childNode in elementNode.ChildNodes)
+ {
+ if (SysGen.CanProcessNode(childNode))
+ SysGen.LoadChildTask(childNode, taskContainer);
+ }
+ }
+
+ // Just defer for now so that everything just works
+ InitializeTask(elementNode);
+ }
+
+ /// Initializes the task.
+ protected virtual void InitializeTask(XmlNode taskNode)
+ {
+ }
+
+ protected virtual void PostExecuteTask()
+ {
+ }
+
+ ///
+ /// Executes the task.
+ ///
+ protected virtual void ExecuteTask()
+ {
+ }
+
+ ///
+ /// Executes the task.
+ ///
+ protected virtual void PreExecuteTask()
+ {
+ }
+
+ public override string ToString()
+ {
+ return Name;
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/Base/TaskContainer.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/Base/TaskContainer.cs
new file mode 100644
index 00000000000..2de6d0e28ca
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/Base/TaskContainer.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine
+{
+ ///
+ /// A Generic Task Container
+ ///
+ public abstract class TaskContainer : Task , ITaskContainer
+ {
+ protected bool m_ExecuteChilds = true;
+ protected TaskCollection _childTasks = new TaskCollection();
+
+ ///
+ /// Available child instances.
+ ///
+ public TaskCollection ChildTasks
+ {
+ get { return _childTasks; }
+ }
+
+ public bool ExecuteChilds
+ {
+ get { return m_ExecuteChilds; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Build/XIFallbackTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Build/XIFallbackTask.cs
new file mode 100644
index 00000000000..535407ef36f
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Build/XIFallbackTask.cs
@@ -0,0 +1,11 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("fallback", Namespace = "xi")]
+ public class XIFallbackTask : TaskContainer
+ {
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Build/XIIncludeTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Build/XIIncludeTask.cs
new file mode 100644
index 00000000000..66b66c028df
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Build/XIIncludeTask.cs
@@ -0,0 +1,148 @@
+using System;
+using System.IO;
+using System.Xml;
+using System.Collections;
+using System.Collections.Specialized;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.BuildEngine.Log;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ ///
+ /// Include an external build file.
+ ///
+ [TaskName("include", Namespace = "xi")]
+ public class XIIncludeTask : FileSystemInfoBaseTask, ITaskContainer //TaskContainer
+ {
+ private TaskCollection m_ChildTasks = new TaskCollection();
+
+ ///
+ /// Used to check for recursived includes.
+ ///
+ private static Stack _includedFiles = new Stack();
+
+ /////
+ ///// The file to be included
+ /////
+ //private string _href = null;
+
+ /// Build file to include.
+ [TaskAttribute("href", Required = true)]
+ public string BuildFileName
+ {
+ get { return m_FileSystemInfo.Name; }
+ set { m_FileSystemInfo.Name = value; }
+ }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildFile();
+ }
+
+ public TaskCollection ChildTasks
+ {
+ get { return m_ChildTasks; }
+ }
+
+ public bool ExecuteChilds
+ {
+ get { return true; }
+ }
+
+ protected override void OnInit()
+ {
+ base.OnInit();
+
+ Base = SysGenPathResolver.GetPath(this, SysGen.RootTask);
+ }
+
+ /// Verify parameters.
+ /// Xml taskNode used to define this task instance.
+ protected override void InitializeTask(XmlNode taskNode)
+ {
+ //base.InitializeTask(taskNode);
+
+ FailOnError = false;
+
+ /*
+ // Task can only be included as a global task.
+ // This might not be a firm requirement but you could get some real
+ // funky errors if you start including targets wily-nily.
+ if (Parent != null )
+ {
+ if ((!(Parent is RbuildTask)) || (!(Parent is ProjectTask)))
+ throw new BuildException("Task not allowed in targets. Must be at project level.", Location);
+ }
+ */
+
+ // Check for recursive include.
+ string buildFileName = Path.Combine(BaseBuildLocation, BuildFileName);
+ foreach (string currentFileName in _includedFiles) {
+ if (currentFileName == buildFileName) {
+ throw new BuildException("Recursive includes are not allowed.", Location);
+ }
+ }
+
+ string includedFileName = Path.Combine(BaseBuildLocation , BuildFileName);
+ string includeRelative = SysGen.GetRelativePath(includedFileName);
+
+ // push ourselves onto the stack (prevents recursive includes)
+ _includedFiles.Push(includedFileName);
+
+ BuildLog.WriteLine("Including {0}", includeRelative);
+
+ try
+ {
+ XmlDocument doc = new XmlDocument();
+ doc.XmlResolver = null;
+ doc.Load(includedFileName);
+
+ SysGen.InitializeBuildFile(doc, this);
+
+ SysGen.BuildFiles.Add(includedFileName);
+ }
+ catch (BuildException)
+ {
+ throw;
+ }
+ catch (IOException e)
+ {
+ try
+ {
+ if (ChildTasks.Count == 0)
+ throw new BuildException("Could not include build file " + includedFileName, Location, e);
+
+ BuildLog.WriteLine("Including {0} Failed. Fallback present and executed", includeRelative);
+ //BuildLog.WriteLine("Include {0} not found. Fallback executed", includeRelative);
+ }
+ catch (Exception fallbackException)
+ {
+ throw new BuildException("Could not include build file " + includedFileName + " fallback also failed", Location, fallbackException);
+ }
+ }
+ catch (ArgumentException e)
+ {
+ //Puede pasar
+ }
+ catch (Exception e)
+ {
+ throw new BuildException("Could not include build file " + includedFileName + " " + e.Message, Location, e);
+ }
+ finally
+ {
+ // pop off the stack
+ _includedFiles.Pop();
+ }
+ }
+
+ protected override void ExecuteTask()
+ {
+ }
+
+ protected override void PreExecuteTask()
+ {
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Logic/IfNotTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Logic/IfNotTask.cs
new file mode 100644
index 00000000000..b1530a34756
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Logic/IfNotTask.cs
@@ -0,0 +1,49 @@
+using System;
+using System.IO;
+using System.Collections;
+using System.Collections.Specialized;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.BuildEngine.Log;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ ///
+ /// The opposite of the if task.
+ ///
+ ///
+ /// Check existence of a property
+ ///
+ ///
+ ///
+ ///
+ /// ]]>
+ ///
+ /// Check that a property value is not true
+ ///
+ ///
+ ///
+ ///
+ /// ]]>
+ ///
+ ///
+ ///
+ /// Check that a target does not exist
+ ///
+ ///
+ ///
+ ///
+ /// ]]>
+ ///
+ [TaskName("ifnot")]
+ public class IfNotTask : IfTask
+ {
+ protected override bool ConditionsTrue
+ {
+ get { return !base.ConditionsTrue; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Logic/IfTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Logic/IfTask.cs
new file mode 100644
index 00000000000..a9bff9a22e6
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Logic/IfTask.cs
@@ -0,0 +1,134 @@
+using System;
+using System.IO;
+using System.Collections;
+using System.Collections.Specialized;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.BuildEngine.Log;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("if")]
+ public class IfTask : TaskContainer
+ {
+ protected string _propName = null;
+ protected string _propValue = null;
+ protected string _propNameTrue = null;
+ protected string _propNameExists = null;
+
+ ///
+ /// Used to test whether a property is true.
+ ///
+ [TaskAttribute("propertytrue")]
+ public string PropertyNameTrue {
+ set {_propNameTrue = value;}
+ }
+
+ ///
+ /// Used to test whether a property exists.
+ ///
+ [TaskAttribute("propertyexists")]
+ public string PropertyNameExists {
+ set {_propNameExists = value;}
+ }
+
+ ///
+ /// Used to test whether a property exists.
+ ///
+ [TaskAttribute("property")]
+ public string PropertyName
+ {
+ set { _propName = value; }
+ }
+
+ ///
+ /// Used to test whether a property exists.
+ ///
+ [TaskAttribute("value")]
+ public string PropertyValue
+ {
+ set { _propValue = value; }
+ }
+
+ protected override void PreExecuteTask()
+ {
+ if (!ConditionsTrue)
+ {
+ m_ExecuteChilds = false;
+ }
+ }
+
+ /*
+ protected override void ExecuteTask() {
+ if(!ConditionsTrue) {
+ m_ExecuteChilds = false;
+ }
+ }*/
+
+ protected virtual bool ConditionsTrue
+ {
+ get
+ {
+ bool ret = true;
+
+ if (_propName != null)
+ {
+ if (_propValue != null)
+ {
+ if (SysGen.Project.Properties.PropertyExists(_propName))
+ {
+ return (SysGen.Project.Properties[_propName].Value == _propValue);
+ }
+
+ return false;
+ }
+ else
+ {
+ ret = ret && SysGen.Project.Properties.PropertyExists(_propNameExists);
+ }
+ }
+
+ ////check for target
+ //if(_targetName != null) {
+ // ret = ret && (SysGen.Targets.Find(_targetName) != null);
+ // if (!ret) return false;
+ //}
+
+ //Check for the Property value of true.
+ if (_propNameTrue != null)
+ {
+ try
+ {
+ ret = ret && bool.Parse(SysGen.Project.Properties[_propNameTrue].Value);
+ }
+ catch (Exception e)
+ {
+ throw new BuildException("Property True test failed for '" + _propNameTrue + "'", Location, e);
+ }
+ }
+
+ //Check for Property existence
+ if(_propNameExists != null)
+ {
+ ret = ret && SysGen.Project.Properties.PropertyExists(_propNameExists);
+ }
+
+ ////check for uptodate file
+ //if(_uptodateFile != null) {
+ // FileInfo primaryFile = new FileInfo(_uptodateFile);
+ // if(primaryFile == null) {
+ // ret = true;
+ // }
+ // else {
+ // string newerFile = FileSet.FindMoreRecentLastWriteTime(_compareFiles.FileNames, primaryFile.LastWriteTime);
+ // bool bNeedsAnUpdate = (null == newerFile);
+ // BuildLog.WriteLineIf(SysGen.Verbose && bNeedsAnUpdate, "{0) is newer than {1}" , newerFile, primaryFile.Name);
+ // ret = !bNeedsAnUpdate;
+ // }
+ //}
+
+ return ret;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoFilesTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoFilesTask.cs
new file mode 100644
index 00000000000..6e74be382a7
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoFilesTask.cs
@@ -0,0 +1,63 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ public abstract class AutoFilesBaseTask : AutoResolvableFileSystemInfoBaseTask
+ {
+ private string m_Pattern = "*.*";
+
+ public AutoFilesBaseTask()
+ {
+ }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildFolder();
+ }
+
+ public RBuildFolder Folder
+ {
+ get { return m_FileSystemInfo as RBuildFolder; }
+ }
+
+ [TaskAttribute("pattern")]
+ public string Pattern { get { return m_Pattern; } set { m_Pattern = value; } }
+
+ protected override void ExecuteTask()
+ {
+ base.ExecuteTask();
+
+ foreach(string file in Directory.GetFiles (SysGen.ResolveRBuildFolderPath(Folder) , Pattern))
+ {
+ AddFile(file);
+ }
+ }
+
+ protected abstract void AddFile (string file);
+ }
+
+ [TaskName("autoinstallfiles")]
+ public class AutoInstallFiles : AutoFilesBaseTask
+ {
+ private string m_InstallBase = ".";
+
+ [TaskAttribute("installbase")]
+ public string InstallBase { get { return m_InstallBase; } set { m_InstallBase = value; } }
+
+ protected override void AddFile(string file)
+ {
+ RBuildInstallFile autoFile = new RBuildInstallFile();
+
+ autoFile.Root = Root;
+ autoFile.Base = Folder.Base;
+ autoFile.Name = Path.GetFileName(file);
+ autoFile.InstallBase = InstallBase;
+
+ RBuildElement.Files.Add(autoFile);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoInstallFilesTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoInstallFilesTask.cs
new file mode 100644
index 00000000000..9548900348d
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoInstallFilesTask.cs
@@ -0,0 +1,15 @@
+using System;
+using System.IO;
+
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ //[TaskName("autoinstallfiles")]
+ //public class AutoInstallFilesTask : AutoFilesTask
+ //{
+ // protected override void ExecuteTask()
+ // {
+ // }
+ //}
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoManifest.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoManifest.cs
new file mode 100644
index 00000000000..866d06eb058
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoManifest.cs
@@ -0,0 +1,15 @@
+using System;
+using System.IO;
+
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("automanifest")]
+ public class AutoManifest : ValueBaseTask
+ {
+ protected override void ExecuteTask()
+ {
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoRegisterTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoRegisterTask.cs
new file mode 100644
index 00000000000..045fdb851ac
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoRegisterTask.cs
@@ -0,0 +1,33 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("autoregister")]
+ public class AutoRegisterTask : Task
+ {
+ RBuildAutoRegister m_AutoRegister = new RBuildAutoRegister();
+
+ [TaskAttribute("type", Required = true)]
+ public AutoRegisterType Type { get { return m_AutoRegister.Type; } set { m_AutoRegister.Type = value; } }
+
+ [TaskAttribute("infsection", Required = true)]
+ public string InfSection { get { return m_AutoRegister.InfSection; } set { m_AutoRegister.InfSection = value; } }
+
+ protected override void ExecuteTask()
+ {
+ if ((Module.Type == ModuleType.Win32DLL) ||
+ (Module.Type == ModuleType.Win32OCX))
+ {
+ if (Module.AutoRegister != null)
+ throw new BuildException("There can be only one element for a module", Location);
+
+ Module.AutoRegister = m_AutoRegister;
+ }
+ else
+ throw new BuildException(" is not applicable for this module type", Location);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoResource.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoResource.cs
new file mode 100644
index 00000000000..359132395d1
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoResource.cs
@@ -0,0 +1,15 @@
+using System;
+using System.IO;
+
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ //[TaskName("autoresource")]
+ //public class AutoResourceTask : AutoFilesTask
+ //{
+ // protected override void ExecuteTask()
+ // {
+ // }
+ //}
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/AuthorBaseTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/AuthorBaseTask.cs
new file mode 100644
index 00000000000..a12ea2f5202
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/AuthorBaseTask.cs
@@ -0,0 +1,26 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ public abstract class AuthorBaseTask : Task
+ {
+ protected string m_Alias = null;
+ protected RBuildAuthor m_Author = new RBuildAuthor();
+
+ [TaskValue(Required=true)]
+ public virtual string Alias { get { return m_Alias; } set { m_Alias = value; } }
+
+ protected override void ExecuteTask()
+ {
+ m_Author.Contributor = Project.Contributors.GetByName(Alias);
+
+ if (m_Author.Contributor == null)
+ throw new BuildException(string.Format("Could not resolve contributor '{0}' referenced by module '{1}'", Alias, Module.Name, Location));
+
+ Module.Authors.Add(m_Author);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/AutoFilesTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/AutoFilesTask.cs
new file mode 100644
index 00000000000..7a4dc70523b
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/AutoFilesTask.cs
@@ -0,0 +1,19 @@
+using System;
+using System.IO;
+
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ //public abstract class AutoFilesTask : Task
+ //{
+ // FileSet files = new FileSet();
+
+ // [FileSet("files")]
+ // public FileSet Files
+ // {
+ // get { return files; }
+ // set { files = value; }
+ // }
+ //}
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/CDFileBaseTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/CDFileBaseTask.cs
new file mode 100644
index 00000000000..869df983965
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/CDFileBaseTask.cs
@@ -0,0 +1,42 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ public abstract class CDFileBaseTask : FileBaseTask //PlatformFileBaseTask
+ {
+ public CDFileBaseTask()
+ {
+ }
+
+ [TaskAttribute("installbase")]
+ public string InstallBase { get { return CDFile.InstallBase; } set { CDFile.InstallBase = value; } }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildCDFile();
+ }
+
+ ///
+ /// The name of the define to set.
+ ///
+ [TaskAttribute("nameoncd")]
+ public string NameOnCD { get { return CDFile.NewName; } set { CDFile.NewName = value; } }
+
+ private RBuildCDFileBase CDFile
+ {
+ get { return m_FileSystemInfo as RBuildCDFileBase; }
+ }
+
+ protected override void ExecuteTask()
+ {
+ //Call the base class
+ base.ExecuteTask();
+
+ //Add the file
+ RBuildElement.Files.Add(CDFile);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/FileBaseTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/FileBaseTask.cs
new file mode 100644
index 00000000000..67773a31bed
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/FileBaseTask.cs
@@ -0,0 +1,47 @@
+using System;
+using System.IO;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ public abstract class FileBaseTask : FileSystemInfoBaseTask
+ {
+ public FileBaseTask()
+ {
+ }
+
+ ///
+ /// The define value.
+ ///
+ [TaskValue]
+ public virtual string FileName { get { return m_FileSystemInfo.Name; } set { m_FileSystemInfo.Name = value; } }
+
+ /////
+ ///// Get the underlying .
+ /////
+ //public RBuildPlatformFile PlatformFile
+ //{
+ // get { return m_FileSystemInfo as RBuildPlatformFile; }
+ //}
+
+ //public override string BasePath
+ //{
+ // get
+ // {
+ // IElement task = this;
+ // while (task != SysGen.ProjectTask)
+ // {
+ // if (task is IDirectory)
+ // return ((IDirectory)task).BasePath;
+
+ // task = task.Parent;
+ // }
+
+ // //Is in the root
+ // return string.Empty;
+ // }
+ //}
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/FileSystemInfoBaseTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/FileSystemInfoBaseTask.cs
new file mode 100644
index 00000000000..3046065d483
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/FileSystemInfoBaseTask.cs
@@ -0,0 +1,119 @@
+using System;
+using System.IO;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ public abstract class AutoResolvableFileSystemInfoBaseTask : FileSystemInfoBaseTask
+ {
+ protected override bool TryToResolveBasePath()
+ {
+ if (Base == "eventlog_server")
+ {
+ int i = 10;
+ }
+
+ if ((Base != null) && (Base != string.Empty))
+ {
+ if (Base != Project.Name)
+ {
+ // Get the referenced module
+ RBuildModule module = Project.Modules.GetByName(Base);
+
+ if (module == null)
+ throw new BuildException(string.Format("Could not resolve module base '{0}' for module '{1}'", Base, Module.Name, Location));
+
+ // If no path has been specified by the user
+ // set the module default path
+ if (Root == PathRoot.Default)
+ Root = module.IncludeDefaultRoot;
+
+ // Set the base to the module root
+ m_FileSystemInfo.Base = module.Folder.FullPath;
+ }
+ else
+ {
+ // Set the base to the project root
+ m_FileSystemInfo.Base = Project.Base;
+ }
+ }
+ else
+ {
+ // Set the base to the folder containing the module
+ m_FileSystemInfo.Base = InFolder.FullPath;
+ }
+
+ if (m_FileSystemInfo.Base == null || m_FileSystemInfo.Name == null)
+ {
+ int i = 10;
+ }
+
+ return true;
+ }
+ }
+
+ public abstract class FileSystemInfoBaseTask : Task
+ {
+ protected RBuildFileSystemInfo m_FileSystemInfo = null;
+
+ public FileSystemInfoBaseTask()
+ {
+ CreateFileSystemObject();
+ }
+
+ protected abstract void CreateFileSystemObject();
+
+ ///
+ /// The name of the define to set.
+ ///
+ [TaskAttribute("base")]
+ public string Base { get { return m_FileSystemInfo.Base; } set { m_FileSystemInfo.Base = value; } }
+
+ ///
+ /// The name of the define to set.
+ ///
+ [TaskAttribute("root")]
+ public PathRoot Root { get { return m_FileSystemInfo.Root; } set { m_FileSystemInfo.Root = value; } }
+
+ ///
+ /// Get the underlying .
+ ///
+ public RBuildFileSystemInfo FileSystemInfo
+ {
+ get { return m_FileSystemInfo; }
+ }
+
+ protected virtual void SetRBuildElement()
+ {
+ //m_FileSystemInfo.Element = RBuildElement;
+ }
+
+ protected virtual void SetRootFromParent()
+ {
+ }
+
+ protected virtual bool TryToResolveBasePath ()
+ {
+ return false;
+ }
+
+ protected override void PreExecuteTask()
+ {
+ SetRootFromParent();
+ SetRBuildElement();
+ }
+
+ protected override void ExecuteTask()
+ {
+ // Give the oportunity to subclasses to resolve the path
+ if (!TryToResolveBasePath())
+ {
+ // If no base path has been specified default to current
+ if (string.IsNullOrEmpty(Base))
+ Base = SysGenPathResolver.GetPath(this, SysGen.RootTask);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/FolderBaseTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/FolderBaseTask.cs
new file mode 100644
index 00000000000..c17c86473f2
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/FolderBaseTask.cs
@@ -0,0 +1,15 @@
+//using System;
+
+//using SysGen.BuildEngine.Attributes;
+//using SysGen.RBuild.Framework;
+
+//namespace SysGen.BuildEngine.Tasks
+//{
+// public abstract class FolderBaseTask : Task
+// {
+// protected override void CreateFileSystemObject()
+// {
+// m_FileSystemInfo = new RBuildFolder();
+// }
+// }
+//}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/PlatformFileBaseTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/PlatformFileBaseTask.cs
new file mode 100644
index 00000000000..2bfa1c70702
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/PlatformFileBaseTask.cs
@@ -0,0 +1,37 @@
+using System;
+using System.IO;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ public abstract class PlatformFileBaseTask : FileBaseTask
+ {
+ ///
+ /// The define value.
+ ///
+ [TaskValue]
+ public string FileName { get { return m_FileSystemInfo.Name; } set { m_FileSystemInfo.Name = value; } }
+
+ [TaskAttribute("installbase")]
+ public string InstallBase { get { return PlatformFile.InstallBase; } set { PlatformFile.InstallBase = value; } }
+
+ ///
+ /// Get the underlying .
+ ///
+ public RBuildPlatformFile PlatformFile
+ {
+ get { return m_FileSystemInfo as RBuildPlatformFile; }
+ }
+
+ protected override void ExecuteTask()
+ {
+ //Call the base class
+ base.ExecuteTask();
+
+ //Add the file
+ RBuildElement.Files.Add(PlatformFile);
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/PropertyBaseTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/PropertyBaseTask.cs
new file mode 100644
index 00000000000..cc9e8fd8c55
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/PropertyBaseTask.cs
@@ -0,0 +1,38 @@
+using System;
+using System.Xml;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ public abstract class PropertyBaseTask : Task
+ {
+ protected string m_Name = null;
+ protected string m_Value = String.Empty;
+ protected bool m_ReadOnly = false;
+ protected bool m_Internal = false;
+
+ /// the name of the property to set.
+ [TaskAttribute("name", Required=true)]
+ public string PropName { get { return m_Name; } set { m_Name = value; } }
+
+ /// the value of the property.
+ [TaskAttribute("value", Required=true)]
+ public string Value { get { return m_Value; } set { m_Value = value; } }
+
+ /// the value of the property.
+ [TaskAttribute("readonly")]
+ [BooleanValidator()]
+ public bool ReadOnly { get { return m_ReadOnly; } set { m_ReadOnly = value; } }
+
+ [TaskAttribute("internal")]
+ [BooleanValidator()]
+ public bool Internal { get { return m_Internal; } set { m_Internal = value; } }
+
+ protected override void OnLoad()
+ {
+ Project.Properties.Add(new RBuildProperty(m_Name, m_Value, m_ReadOnly, m_Internal));
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/RbuildElementBaseTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/RbuildElementBaseTask.cs
new file mode 100644
index 00000000000..7afe7a5f9ab
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/RbuildElementBaseTask.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Xml;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ public abstract class RbuildElementBaseTask : Task
+ {
+ protected override void OnLoad()
+ {
+
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/ValueBaseTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/ValueBaseTask.cs
new file mode 100644
index 00000000000..ae1c1137c7f
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/ValueBaseTask.cs
@@ -0,0 +1,16 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ public abstract class ValueBaseTask : Task
+ {
+ protected string _value = null;
+
+ ///
+ /// The define value.
+ ///
+ [TaskValue]
+ public virtual string Value { get { return _value; } set { _value = value; } }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BaseAdressTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BaseAdressTask.cs
new file mode 100644
index 00000000000..39ea6a8c071
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BaseAdressTask.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Xml;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("baseadress")]
+ public class BaseAdressTask : PropertyBaseTask
+ {
+ protected override void OnLoad()
+ {
+ Project.Properties.Add(new RBuildBaseAdress(m_Name, m_Value));
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BootSector.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BootSector.cs
new file mode 100644
index 00000000000..05ce34d2b35
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BootSector.cs
@@ -0,0 +1,44 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("bootsector")]
+ public class BootSector : ValueBaseTask
+ {
+ protected override void ExecuteTask()
+ {
+ RBuildModule bootModule = Project.Modules.GetByName(Value);
+
+ if (bootModule != null)
+ {
+ if (bootModule.Type == ModuleType.BootSector)
+ {
+ if (Module.Type == ModuleType.Iso ||
+ Module.Type == ModuleType.IsoRegTest ||
+ Module.Type == ModuleType.LiveIso ||
+ Module.Type == ModuleType.LiveIsoRegTest)
+ {
+ if (Module.BootSector == null)
+ Module.BootSector = bootModule;
+ }
+ else
+ throw new BuildException(" is not applicable for this module type.", Location);
+ }
+ else
+ throw new BuildException(" for module '{0}' is referencing a non BootSector module '{1}'",
+ Module.Name,
+ bootModule.Name,
+ Location);
+ }
+ else
+ throw new BuildException(" for module '{0}' is referencing a non existing module '{1}'",
+ Module.Name,
+ Value,
+ Location);
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BootstrapFileTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BootstrapFileTask.cs
new file mode 100644
index 00000000000..7d68ee9fc99
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BootstrapFileTask.cs
@@ -0,0 +1,40 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("bootstrapfile")]
+ public class BootstrapFileTask : CDFileBaseTask //FileBaseTask ///PlatformFileBaseTask
+ {
+ public BootstrapFileTask()
+ {
+ }
+
+ [TaskValue]
+ public string FileName { get { return m_FileSystemInfo.Name; } set { m_FileSystemInfo.Name = value; } }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildBootstrapFile();
+ }
+
+ public RBuildBootstrapFile BootStrapFile
+ {
+ get { return m_FileSystemInfo as RBuildBootstrapFile; }
+ }
+
+ protected override bool TryToResolveBasePath()
+ {
+ Base = "i386";
+ return true;
+ }
+
+ protected override void ExecuteTask()
+ {
+ //Call the base class
+ base.ExecuteTask();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BootstrapTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BootstrapTask.cs
new file mode 100644
index 00000000000..a3713de30bf
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BootstrapTask.cs
@@ -0,0 +1,52 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("bootstrap")]
+ public class BootstrapTask : CDFileBaseTask
+ {
+ public BootstrapTask()
+ {
+ m_FileSystemInfo = new RBuildBootstrapFile();
+ }
+
+ private RBuildBootstrapFile BootstrapFile
+ {
+ get { return m_FileSystemInfo as RBuildBootstrapFile; }
+ }
+
+ protected override void ExecuteTask()
+ {
+ if ((Module.Type == ModuleType.Kernel) ||
+ (Module.Type == ModuleType.KernelModeDLL) ||
+ (Module.Type == ModuleType.KeyboardLayout) ||
+ (Module.Type == ModuleType.KernelModeDriver) ||
+ (Module.Type == ModuleType.NativeDLL) ||
+ (Module.Type == ModuleType.NativeCUI) ||
+ (Module.Type == ModuleType.Win32DLL) ||
+ (Module.Type == ModuleType.Win32OCX) ||
+ (Module.Type == ModuleType.Win32CUI) ||
+ (Module.Type == ModuleType.Win32SCR) ||
+ (Module.Type == ModuleType.Win32GUI) ||
+ (Module.Type == ModuleType.BootSector) ||
+ (Module.Type == ModuleType.BootLoader) ||
+ (Module.Type == ModuleType.BootProgram) ||
+ (Module.Type == ModuleType.Cabinet))
+ {
+ BootstrapFile.Element = RBuildElement;
+ BootstrapFile.Name = Module.TargetName;
+ BootstrapFile.Root = Module.TargetDefaultRoot;
+ BootstrapFile.Base = Module.Folder.FullPath;
+
+ Module.Bootstrap = BootstrapFile;
+
+ //Project.Files.Add(BootstrapFile);
+ }
+ else
+ throw new BuildException(" is not applicable for this module type.", Location);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BuildFamilyTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BuildFamilyTask.cs
new file mode 100644
index 00000000000..29d2ead87aa
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BuildFamilyTask.cs
@@ -0,0 +1,27 @@
+using System;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ ///
+ /// Just a task container
+ ///
+ [TaskName("buildfamily")]
+ public class BuildFamilyTask : Task
+ {
+ private RBuildBuildFamily m_BuildFamily = new RBuildBuildFamily();
+
+ [TaskAttribute("name", Required = true)]
+ public string FamilyName { get { return m_BuildFamily.Name; } set { m_BuildFamily.Name = value; } }
+
+ [TaskAttribute("description")]
+ public string FamilyDescription { get { return m_BuildFamily.Description; } set { m_BuildFamily.Description = value; } }
+
+ protected override void PreExecuteTask()
+ {
+ Project.BuildFamilies.Add(m_BuildFamily);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/CDFileTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/CDFileTask.cs
new file mode 100644
index 00000000000..6f9b6bcf13a
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/CDFileTask.cs
@@ -0,0 +1,20 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("cdfile")]
+ public class CDFileTask : CDFileBaseTask
+ {
+ public CDFileTask()
+ {
+ }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildCDFile();
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/CompilationUnitTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/CompilationUnitTask.cs
new file mode 100644
index 00000000000..d08a5005ed7
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/CompilationUnitTask.cs
@@ -0,0 +1,58 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("compilationunit")]
+ public class CompilationUnitTask : FileSystemInfoBaseTask, ITaskContainer, IRBuildSourceFilesContainer
+ {
+ private TaskCollection m_ChildTasks = new TaskCollection();
+
+ public CompilationUnitTask()
+ {
+ Root = PathRoot.Intermediate;
+ }
+
+ public TaskCollection ChildTasks
+ {
+ get { return m_ChildTasks; }
+ }
+
+ public bool ExecuteChilds
+ {
+ get { return true; }
+ }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildCompilationUnitFile();
+ }
+
+ public RBuildCompilationUnitFile CompilationUnit
+ {
+ get { return m_FileSystemInfo as RBuildCompilationUnitFile; }
+ }
+
+ public RBuildSourceFileCollection SourceFiles
+ {
+ get { return CompilationUnit.SourceFiles; }
+ }
+
+ ///
+ /// The name of the compilation unit to set.
+ ///
+ [TaskAttribute("name")]
+ public string FileName { get { return m_FileSystemInfo.Name; } set { m_FileSystemInfo.Name = value; } }
+
+ protected override void ExecuteTask()
+ {
+ base.ExecuteTask();
+
+ // Add the compilation unit to the current module
+ Module.CompilationUnits.Add(CompilationUnit);
+ }
+
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/CompilerFlagTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/CompilerFlagTask.cs
new file mode 100644
index 00000000000..87eb278d232
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/CompilerFlagTask.cs
@@ -0,0 +1,14 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("compilerflag")]
+ public class CompilerFlagTask : ValueBaseTask
+ {
+ protected override void ExecuteTask()
+ {
+ RBuildElement.CompilerFlags.Add(Value);
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ComponentTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ComponentTask.cs
new file mode 100644
index 00000000000..7063b105a2d
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ComponentTask.cs
@@ -0,0 +1,12 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("component")]
+ public class ComponentTask : Task
+ {
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ContributorTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ContributorTask.cs
new file mode 100644
index 00000000000..a6528adddea
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ContributorTask.cs
@@ -0,0 +1,42 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("contributor")]
+ public class ContributorTask : Task
+ {
+ private RBuildContributor m_Contributor = new RBuildContributor();
+
+ [TaskAttribute("firstname", Required = true)]
+ public string FirstName { get { return m_Contributor.FirstName; } set { m_Contributor.FirstName = value; } }
+
+ [TaskAttribute("city")]
+ public string City { get { return m_Contributor.City; } set { m_Contributor.City = value; } }
+
+ [TaskAttribute("country")]
+ public string Country { get { return m_Contributor.Country; } set { m_Contributor.Country = value; } }
+
+ [TaskAttribute("lastname")]
+ public string LastName { get { return m_Contributor.LastName; } set { m_Contributor.LastName = value; } }
+
+ [TaskAttribute("alias")]
+ public string Alias { get { return m_Contributor.Alias; } set { m_Contributor.Alias = value; } }
+
+ [TaskAttribute("mail")]
+ public string Mail { get { return m_Contributor.Mail; } set { m_Contributor.Mail = value; } }
+
+ [TaskAttribute("website")]
+ public string Website { get { return m_Contributor.Website; } set { m_Contributor.Website = value; } }
+
+ [TaskAttribute("active")]
+ public bool Active { get { return m_Contributor.Active; } set { m_Contributor.Active = value; } }
+
+ protected override void ExecuteTask()
+ {
+ Project.Contributors.Add(m_Contributor);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DebugChannelTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DebugChannelTask.cs
new file mode 100644
index 00000000000..886d0489155
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DebugChannelTask.cs
@@ -0,0 +1,54 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("debugchannel")]
+ public class DebugChannelTask : Task
+ {
+ RBuildDebugChannel m_DebugChannel = new RBuildDebugChannel();
+
+ [TaskAttribute("name")]
+ [TaskValue]
+ public string ChannelName
+ {
+ get { return m_DebugChannel.Name; }
+ set { m_DebugChannel.Name = value; }
+ }
+
+ [TaskAttribute("warning")]
+ public bool Warning
+ {
+ get { return m_DebugChannel.Warn; }
+ set { m_DebugChannel.Warn = value; }
+ }
+
+ [TaskAttribute("trace")]
+ public bool Trace
+ {
+ get { return m_DebugChannel.Trace; }
+ set { m_DebugChannel.Trace = value; }
+ }
+
+ [TaskAttribute("fixme")]
+ public bool Fixme
+ {
+ get { return m_DebugChannel.Fixme; }
+ set { m_DebugChannel.Fixme = value; }
+ }
+
+ [TaskAttribute("error")]
+ public bool Error
+ {
+ get { return m_DebugChannel.Error; }
+ set { m_DebugChannel.Error = value; }
+ }
+
+ protected override void ExecuteTask()
+ {
+ Project.DebugChannels.Add(m_DebugChannel);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DefineTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DefineTask.cs
new file mode 100644
index 00000000000..071ff49d50f
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DefineTask.cs
@@ -0,0 +1,45 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("define")]
+ public class DefineTask : Task
+ {
+ private string _name = null;
+ private string _value = String.Empty;
+ private string _backend = String.Empty;
+ private bool _empty = false;
+
+ ///
+ /// The name of the define to set.
+ ///
+ [TaskAttribute("name", Required=true)]
+ public string DefineName { get { return _name; } set { _name = value; } }
+
+ ///
+ /// The define value.
+ ///
+ [TaskAttribute("value")]
+ [TaskValue]
+ public string DefineValue { get { return _value; } set { _value = value; } }
+
+ ///
+ /// The name of the define to set.
+ ///
+ [TaskAttribute("empty")]
+ [BooleanValidator]
+ public bool Empty { get { return _empty; } set { _empty = value; } }
+
+ // TODO : Remove ?
+ [TaskAttribute("backend")]
+ public string Backend { get { return _backend; } set { _backend = value; } }
+
+ protected override void ExecuteTask()
+ {
+ RBuildElement.Defines.Add(new RBuildDefine(DefineName, DefineValue));
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DependencyTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DependencyTask.cs
new file mode 100644
index 00000000000..d9a90606f42
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DependencyTask.cs
@@ -0,0 +1,27 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("dependency")]
+ public class DependencyTask : ValueBaseTask
+ {
+ ///
+ /// The define value.
+ ///
+ [TaskValue(Required = true)]
+ public virtual string Value { get { return _value; } set { _value = value; } }
+
+ protected override void ExecuteTask()
+ {
+ RBuildModule dependency = Project.Modules.GetByName(Value);
+
+ if (dependency == null)
+ throw new BuildException("Unknown dependency '{0}' referenced by module '{1}'", Value, Module.Name);
+
+ Module.Dependencies.Add(dependency);
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DeveloperTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DeveloperTask.cs
new file mode 100644
index 00000000000..1c2a6a4fe61
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DeveloperTask.cs
@@ -0,0 +1,16 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("developer")]
+ public class DeveloperTask : AuthorBaseTask
+ {
+ public DeveloperTask()
+ {
+ m_Author.Role = AuthorRole.Developer;
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DirectoryTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DirectoryTask.cs
new file mode 100644
index 00000000000..efc632767c8
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DirectoryTask.cs
@@ -0,0 +1,59 @@
+using System.IO;
+using System.Collections.Generic;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("directory")]
+ public class DirectoryTask : FileSystemInfoBaseTask, ITaskContainer//, IDirectory
+ {
+ private TaskCollection m_ChildTasks = new TaskCollection();
+
+ public DirectoryTask()
+ {
+ }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildFolder();
+ }
+
+ public TaskCollection ChildTasks
+ {
+ get { return m_ChildTasks; }
+ }
+
+ public bool ExecuteChilds
+ {
+ get { return true; }
+ }
+
+ ///
+ /// The directory name.
+ ///
+ [TaskAttribute("name", Required = true)]
+ public virtual string Name { get { return m_FileSystemInfo.Name; } set { m_FileSystemInfo.Name = value; } }
+
+ public RBuildFolder Folder
+ {
+ get { return m_FileSystemInfo as RBuildFolder; }
+ }
+
+ protected override void OnInit()
+ {
+ base.OnInit();
+
+ Base = SysGenPathResolver.GetPath(this, SysGen.RootTask);
+ }
+
+ protected override void ExecuteTask()
+ {
+ base.ExecuteTask();
+
+ if (RBuildElement.Folders.Contains(Folder) == false)
+ RBuildElement.Folders.Add(Folder);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/FamilyTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/FamilyTask.cs
new file mode 100644
index 00000000000..6051c9b52c8
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/FamilyTask.cs
@@ -0,0 +1,28 @@
+using System;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("family")]
+ public class FamilyTask : Task
+ {
+ private RBuildFamily m_Family = new RBuildFamily();
+
+ [TaskValue(Required = true)]
+ public string FamilyName { get { return m_Family.Name; } set { m_Family.Name = value; } }
+
+ protected override void ExecuteTask()
+ {
+ RBuildBuildFamily buildFamily = Project.BuildFamilies.GetByName(FamilyName);
+
+ if (buildFamily == null)
+ throw new BuildException("Module '{0}' references a no existant family '{1}'",
+ Module.Name,
+ FamilyName);
+
+ Module.Families.Add(m_Family);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/FileTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/FileTask.cs
new file mode 100644
index 00000000000..0b3e3af243d
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/FileTask.cs
@@ -0,0 +1,50 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("file")]
+ public class FileTask : FileBaseTask
+ {
+ public FileTask()
+ {
+ }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildSourceFile();
+ }
+
+ [TaskAttribute("switches")]
+ public string Switches { get { return SourceFile.Switches; } set { SourceFile.Switches = value; } }
+
+ [TaskAttribute("first")]
+ [BooleanValidator]
+ public bool First { get { return SourceFile.First; } set { SourceFile.First = value; } }
+
+ ///
+ /// Set the root to the same as the containing folder
+ ///
+ protected override void SetRootFromParent()
+ {
+ Root = InFolder.Root;
+ }
+
+ public RBuildSourceFile SourceFile
+ {
+ get { return m_FileSystemInfo as RBuildSourceFile; }
+ }
+
+ protected override void ExecuteTask()
+ {
+ //Call the base class
+ base.ExecuteTask();
+
+ //Add the file
+ Module.SourceFiles.Add(SourceFile);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/GroupTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/GroupTask.cs
new file mode 100644
index 00000000000..f98029aa1fd
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/GroupTask.cs
@@ -0,0 +1,13 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ ///
+ /// Just a simple task container
+ ///
+ [TaskName("group")]
+ public class GroupTask : TaskContainer
+ {
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ImportLibraryTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ImportLibraryTask.cs
new file mode 100644
index 00000000000..31e212c0a7a
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ImportLibraryTask.cs
@@ -0,0 +1,50 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("importlibrary")]
+ public class ImportLibraryTask : AutoResolvableFileSystemInfoBaseTask //FileBaseTask
+ {
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildImportLibrary();
+ }
+
+ public RBuildImportLibrary ImportLibrary
+ {
+ get { return m_FileSystemInfo as RBuildImportLibrary; }
+ }
+
+ ///
+ /// The directory name.
+ ///
+ [TaskAttribute("dllname")]
+ public string DllName { get { return ImportLibrary.DllName; } set { ImportLibrary.DllName = value; } }
+
+ ///
+ /// The directory name.
+ ///
+ [TaskAttribute("definition", Required = true)]
+ public string Definition { get { return ImportLibrary.Name; } set { ImportLibrary.Name = value; } }
+
+ protected override void ExecuteTask()
+ {
+ base.ExecuteTask();
+
+ //Hack::
+ if (ImportLibrary.IsSpecFile)
+ ImportLibrary.Root = PathRoot.Intermediate;
+
+ if ((DllName == null) && (Module.Type == ModuleType.StaticLibrary))
+ throw new BuildException(" dllname attribute is required.", Location);
+
+ if (Module.ImportLibrary != null)
+ throw new BuildException("Only one is allowed per module.", Location);
+
+ Module.ImportLibrary = ImportLibrary;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/IncludeTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/IncludeTask.cs
new file mode 100644
index 00000000000..b923ecf157b
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/IncludeTask.cs
@@ -0,0 +1,42 @@
+using System;
+using System.IO;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("include")]
+ public class IncludeTask : AutoResolvableFileSystemInfoBaseTask //FileSystemInfoBaseTask
+ {
+ public IncludeTask()
+ {
+ }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildFolder();
+ }
+
+ [TaskValue]
+ public virtual string IncludePath
+ {
+ get { return m_FileSystemInfo.Name; }
+ set { m_FileSystemInfo.Name = value; }
+ }
+
+ public RBuildFolder IncludeFolder
+ {
+ get { return m_FileSystemInfo as RBuildFolder; }
+ }
+
+ protected override void ExecuteTask()
+ {
+ //Call the base class
+ base.ExecuteTask();
+
+ //Add include folder...
+ RBuildElement.IncludeFolders.Add(IncludeFolder);
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstalFolder.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstalFolder.cs
new file mode 100644
index 00000000000..f395b8efda9
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstalFolder.cs
@@ -0,0 +1,31 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("installfolder")]
+ public class InstalFolder : Task
+ {
+ RBuildInstallFolder m_InstallFolder = new RBuildInstallFolder();
+
+ ///
+ /// The name of the define to set.
+ ///
+ [TaskAttribute("id")]
+ public string ID { get { return m_InstallFolder.ID; } set { m_InstallFolder.ID = value; } }
+
+ ///
+ /// The name of the define to set.
+ ///
+ [TaskAttribute("name")]
+ [TaskValue(Required = true)]
+ public string Name { get { return m_InstallFolder.Name; } set { m_InstallFolder.Name = value; } }
+
+ protected override void ExecuteTask()
+ {
+ Project.InstallFolders.Add(m_InstallFolder);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstallComponent.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstallComponent.cs
new file mode 100644
index 00000000000..36fc4567114
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstallComponent.cs
@@ -0,0 +1,39 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("installcomponent")]
+ public class InstallComponent : FileBaseTask
+ {
+ public InstallComponent()
+ {
+ }
+
+ [TaskAttribute("section")]
+ public string InstallSection { get { return InstallComponentFile.InstallSection; } set { InstallComponentFile.InstallSection = value; } }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildInfInstallerFile();
+ }
+
+ public RBuildInfInstallerFile InstallComponentFile
+ {
+ get { return m_FileSystemInfo as RBuildInfInstallerFile; }
+ }
+
+ protected override void ExecuteTask()
+ {
+ //Call the base class
+ base.ExecuteTask();
+
+ if (Module.LinkerScript != null)
+ throw new BuildException("Only one is allowed per module", Location);
+
+ //Module.InfInstall = InstallComponentFile;
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstallFileTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstallFileTask.cs
new file mode 100644
index 00000000000..ec7bb2a3154
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstallFileTask.cs
@@ -0,0 +1,31 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("installfile")]
+ public class InstallFileTask : PlatformFileBaseTask
+ {
+ public InstallFileTask()
+ {
+ }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildInstallFile();
+ }
+
+ ///
+ /// The name of the define to set.
+ ///
+ [TaskAttribute("newname")]
+ public string NewName { get { return InstallFile.NewName; } set { InstallFile.NewName = value; } }
+
+ private RBuildInstallFile InstallFile
+ {
+ get { return m_FileSystemInfo as RBuildInstallFile; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstallWallPaperFileTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstallWallPaperFileTask.cs
new file mode 100644
index 00000000000..d8e8e4a774f
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstallWallPaperFileTask.cs
@@ -0,0 +1,16 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("installwallpaperfile")]
+ public class InstallWallPaperFileTask : PlatformFileBaseTask
+ {
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildInstallWallpaperFile();
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LanguageTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LanguageTask.cs
new file mode 100644
index 00000000000..4acf0a8788c
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LanguageTask.cs
@@ -0,0 +1,24 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("language")]
+ public class LanguageTask : Task
+ {
+ RBuildLanguage m_Language = new RBuildLanguage();
+
+ [TaskAttribute("isoname")]
+ public string IsoName { get { return m_Language.Name; } set { m_Language.Name = value; } }
+
+ [TaskAttribute("lcid")]
+ public string LCID { get { return m_Language.LCID; } set { m_Language.LCID = value; } }
+
+ protected override void ExecuteTask()
+ {
+ Project.Languages.Add(m_Language);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LibraryTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LibraryTask.cs
new file mode 100644
index 00000000000..79c3f159b1a
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LibraryTask.cs
@@ -0,0 +1,51 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("library")]
+ public class LibraryTask : ValueBaseTask
+ {
+ ///
+ /// The define value.
+ ///
+ [TaskValue(Required=true)]
+ public override string Value { get { return _value; } set { _value = value; } }
+
+ protected override void ExecuteTask()
+ {
+ RBuildModule libModule = Project.Modules.GetByName(Value);
+
+ if (libModule == null)
+ throw new BuildException("Unknown library dependency '{0}' referenced by module '{1}'", Value, Module.Name);
+
+ if (Module.Host != libModule.Host)
+ throw new BuildException("Module '{0}' is trying to link against library '{1}' but can't mix target and hosts",
+ Module.Name,
+ libModule.Name);
+
+ if ((libModule.Type != ModuleType.NativeDLL) &&
+ (libModule.Type != ModuleType.Win32DLL) &&
+ (libModule.Type != ModuleType.StaticLibrary) &&
+ (libModule.Type != ModuleType.ObjectLibrary) &&
+ (libModule.Type != ModuleType.Kernel) &&
+ (libModule.Type != ModuleType.KernelModeDLL) &&
+ (libModule.Type != ModuleType.KernelModeDriver) &&
+ (libModule.Type != ModuleType.KeyboardLayout) &&
+ (libModule.Type != ModuleType.RpcServer) &&
+ (libModule.Type != ModuleType.RpcClient) &&
+ (libModule.Type != ModuleType.RpcProxy) &&
+ (libModule.Type != ModuleType.HostStaticLibrary))
+ {
+ throw new BuildException("Module '{0}' is trying to use Module '{1}' as a library but it is a '{2}'",
+ Module.Name,
+ libModule.Name,
+ libModule.Type);
+ }
+
+ Module.Libraries.Add(libModule);
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LinkerFlagTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LinkerFlagTask.cs
new file mode 100644
index 00000000000..7a12e3fae3a
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LinkerFlagTask.cs
@@ -0,0 +1,14 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("linkerflag")]
+ public class LinkerFlagTask : ValueBaseTask
+ {
+ protected override void ExecuteTask()
+ {
+ RBuildElement.LinkerFlags.Add(Value);
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LinkerScriptTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LinkerScriptTask.cs
new file mode 100644
index 00000000000..e52c49ab9ff
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LinkerScriptTask.cs
@@ -0,0 +1,36 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("linkerscript")]
+ public class LinkerScriptTask : FileBaseTask
+ {
+ public LinkerScriptTask()
+ {
+ }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildFile();
+ }
+
+ public RBuildFile ScriptFile
+ {
+ get { return m_FileSystemInfo as RBuildFile; }
+ }
+
+ protected override void ExecuteTask()
+ {
+ //Call the base class
+ base.ExecuteTask();
+
+ if (Module.LinkerScript != null)
+ throw new BuildException("Only one is allowed per module", Location);
+
+ Module.LinkerScript = ScriptFile;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LocalizationTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LocalizationTask.cs
new file mode 100644
index 00000000000..907505d86ca
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LocalizationTask.cs
@@ -0,0 +1,41 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("localization")]
+ public class LocalizationTask : FileBaseTask
+ {
+ public LocalizationTask()
+ {
+ }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildLocalizationFile();
+ }
+
+ [TaskAttribute("isoname")]
+ public string IsoName { get { return LocalizationFile.IsoName; } set { LocalizationFile.IsoName = value; } }
+
+ [TaskAttribute("dirty")]
+ public bool Dirty { get { return LocalizationFile.Dirty; } set { LocalizationFile.Dirty = value; } }
+
+ private RBuildLocalizationFile LocalizationFile
+ {
+ get { return m_FileSystemInfo as RBuildLocalizationFile; }
+ }
+
+ protected override void ExecuteTask()
+ {
+ RBuildLanguage language = Project.Languages.GetByName(IsoName);
+
+ if (language == null)
+ throw new BuildException("Unknown language '{0}' referenced by module '{1}'", IsoName, Module.Name);
+
+ Module.LocalizationFiles.Add(LocalizationFile);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/MantainterTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/MantainterTask.cs
new file mode 100644
index 00000000000..91f61db53a1
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/MantainterTask.cs
@@ -0,0 +1,16 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("mantainer")]
+ public class MantainterTask : AuthorBaseTask
+ {
+ public MantainterTask()
+ {
+ m_Author.Role = AuthorRole.Mantainer;
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/MetadataTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/MetadataTask.cs
new file mode 100644
index 00000000000..3e2b4b67053
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/MetadataTask.cs
@@ -0,0 +1,27 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("metadata")]
+ public class MetadataTask : Task
+ {
+ RBuildMetadata m_Metadata = new RBuildMetadata();
+
+ ///
+ /// The module description.
+ ///
+ [TaskAttribute("description")]
+ public string Description { get { return m_Metadata.Description; } set { m_Metadata.Description = value; } }
+
+ protected override void ExecuteTask()
+ {
+ if (Module.Metadata != null)
+ throw new BuildException("Only one is allowed per module.", Location);
+
+ Module.Metadata = m_Metadata;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ModuleStateTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ModuleStateTask.cs
new file mode 100644
index 00000000000..f15b47bf9dc
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ModuleStateTask.cs
@@ -0,0 +1,34 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("modulestate")]
+ public class ModuleStateTask : Task
+ {
+ private string m_ModuleName = null;
+ private bool m_Enabled = true;
+
+ [TaskAttribute("name")]
+ public string ModuleName { get { return m_ModuleName; } set { m_ModuleName = value; } }
+
+ [TaskAttribute("enabled")]
+ [BooleanValidator]
+ public bool Enabled { get { return m_Enabled; } set { m_Enabled = value; } }
+
+ protected override void ExecuteTask()
+ {
+ if (ModuleName != null)
+ {
+ RBuildModule module = Project.Modules.GetByName(ModuleName);
+
+ if (module == null)
+ throw new BuildException(string.Format("Could not change state for module '{0}'", ModuleName, Location));
+
+ module.Enabled = Enabled;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ModuleTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ModuleTask.cs
new file mode 100644
index 00000000000..1a790f41d11
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ModuleTask.cs
@@ -0,0 +1,588 @@
+using System;
+using System.IO;
+using System.Xml;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("module")]
+ public class ModuleTask : TaskContainer /*AutoResolvableFileSystemInfoBaseTask ,, ITaskContainer,*/ /*TaskContainer,*/ , ISysGenObject/*, IDirectory,*/, IRBuildSourceFilesContainer
+ {
+ protected RBuildModule m_Module = new RBuildModule();
+
+ [TaskAttribute("name", Required = true)]
+ [StringValidator(AllowEmpty = false, AllowSpaces = false)]
+ public string ModuleName
+ {
+ get { return m_Module.Name; }
+ set { m_Module.Name = value; }
+ }
+
+ [TaskAttribute("type", Required = true)]
+ public ModuleType Type
+ {
+ get { return m_Module.Type; }
+ set { m_Module.Type = value; }
+ }
+
+ [TaskAttribute("buildtype")]
+ public string BuildType
+ {
+ get { return m_Module.BuildType; }
+ set { m_Module.BuildType = value; }
+ }
+
+ [TaskAttribute("description", ExpandProperties = true)]
+ public string Description
+ {
+ get { return m_Module.Description; }
+ set { m_Module.Description = value; }
+ }
+
+ [TaskAttribute("lcid")]
+ public string LCID
+ {
+ get { return m_Module.LCID; }
+ set { m_Module.LCID = value; }
+ }
+
+ [TaskAttribute("installname")]
+ public string InstallName
+ {
+ get { return m_Module.InstallName; }
+ set { m_Module.InstallName = value; }
+ }
+
+ [TaskAttribute("installbase")]
+ [UriValidatorAttribute]
+ public string InstallBase
+ {
+ get { return m_Module.InstallBase; }
+ set { m_Module.InstallBase = value; }
+ }
+
+ [TaskAttribute("output")]
+ public string Output
+ {
+ get { return m_Module.OutputName; }
+ set { m_Module.OutputName = value; }
+ }
+
+ [TaskAttribute("baseaddress")]
+ public string BaseAdress
+ {
+ get { return m_Module.BaseAddress; }
+ set { m_Module.BaseAddress = value; }
+ }
+
+ [TaskAttribute("entrypoint")]
+ public string EntryPoint
+ {
+ get { return m_Module.EntryPoint; }
+ set { m_Module.EntryPoint = value; }
+ }
+
+ [TaskAttribute("aliasof")]
+ public string AliasOf
+ {
+ get { return m_Module.AliasOf; }
+ set { m_Module.AliasOf = value; }
+ }
+
+ [TaskAttribute("extension")]
+ public string Extension
+ {
+ get { return m_Module.Extension; }
+ set { m_Module.Extension = value; }
+ }
+
+ [TaskAttribute("unicode")]
+ [BooleanValidator()]
+ public bool Unicode
+ {
+ get { return m_Module.Unicode; }
+ set { m_Module.Unicode = value; }
+ }
+
+ [TaskAttribute("host")]
+ [BooleanValidator()]
+ public bool Host
+ {
+ get { return m_Module.Host; }
+ set { m_Module.Host = value; }
+ }
+
+ [TaskAttribute("isstartuplib")]
+ [BooleanValidator()]
+ public bool IsStartupLib
+ {
+ get { return m_Module.IsStartupLib; }
+ set { m_Module.IsStartupLib = value; }
+ }
+
+ [TaskAttribute("underscoresymbols")]
+ [BooleanValidator()]
+ public bool UnderscoreSymbols
+ {
+ get { return m_Module.UnderscoreSymbols; }
+ set { m_Module.UnderscoreSymbols = value; }
+ }
+
+ [TaskAttribute("mangledsymbols")]
+ [BooleanValidator()]
+ public bool MangledSymbols
+ {
+ get { return m_Module.MangledSymbols; }
+ set { m_Module.MangledSymbols = value; }
+ }
+
+ [TaskAttribute("allowwarnings")]
+ [BooleanValidator()]
+ public bool AllowWarnings
+ {
+ get { return m_Module.AllowWarnings; }
+ set { m_Module.AllowWarnings = value; }
+ }
+
+ public RBuildModule Module
+ {
+ get { return m_Module; }
+ }
+
+ public RBuildElement RBuildElement
+ {
+ get { return m_Module; }
+ }
+
+ public PathRoot Root
+ {
+ get { return PathRoot.Default; }
+ }
+
+ public RBuildSourceFileCollection SourceFiles
+ {
+ get { return Module.SourceFiles; }
+ }
+
+ protected override void OnLoad()
+ {
+ base.OnLoad();
+
+ if ((Module.Type == ModuleType.BootLoader) ||
+ (Module.Type == ModuleType.BootProgram) ||
+ (Module.Type == ModuleType.BootSector) ||
+ (Module.Type == ModuleType.EmbeddedTypeLib) ||
+ (Module.Type == ModuleType.IdlHeader) ||
+ (Module.Type == ModuleType.Kernel) ||
+ (Module.Type == ModuleType.KernelModeDLL) ||
+ (Module.Type == ModuleType.KernelModeDriver) ||
+ (Module.Type == ModuleType.NativeCUI) ||
+ (Module.Type == ModuleType.NativeDLL) ||
+ (Module.Type == ModuleType.ObjectLibrary) ||
+ (Module.Type == ModuleType.StaticLibrary) ||
+ (Module.Type == ModuleType.RpcClient) ||
+ (Module.Type == ModuleType.RpcServer) ||
+ (Module.Type == ModuleType.RpcProxy) ||
+ (Module.Type == ModuleType.Win32CUI) ||
+ (Module.Type == ModuleType.Win32DLL) ||
+ (Module.Type == ModuleType.Win32GUI) ||
+ (Module.Type == ModuleType.Win32OCX) ||
+ (Module.Type == ModuleType.Win32SCR) ||
+ //(Module.Type == ModuleType.Alias) ||
+ (Module.Type == ModuleType.HostStaticLibrary) ||
+ (Module.Type == ModuleType.BuildTool) ||
+ (Module.Type == ModuleType.Cabinet) ||
+ (Module.Type == ModuleType.KeyboardLayout) ||
+ (Module.Type == ModuleType.Iso) ||
+ (Module.Type == ModuleType.IsoRegTest) ||
+ (Module.Type == ModuleType.LiveIso) ||
+ (Module.Type == ModuleType.LiveIsoRegTest) ||
+ (Module.Type == ModuleType.MessageHeader) ||
+ (Module.Type == ModuleType.Package) ||
+ (Module.Type == ModuleType.ModuleGroup) ||
+ (Module.Type == ModuleType.PlatformProfile))
+ {
+ Module.Folder.Base = SysGenPathResolver.GetPath(this, SysGen.RootTask);
+ //Module.Base = SysGenPathResolver.GetPath(this, SysGen.ProjectTask); //BasePath;
+ Module.Path = SysGen.BaseDirectory;
+ Module.XmlFile = XmlFile;
+ Module.RBuildFile = RBuildFile;
+ Module.Enabled = false;
+
+ //HACK:
+ if (Type == ModuleType.HostStaticLibrary ||
+ Type == ModuleType.BuildTool)
+ {
+ Module.Host = true;
+ }
+
+ // Add the module to the project
+ Project.Modules.Add(Module);
+ }
+ else
+ {
+ Console.WriteLine("WARNING: modules of type '{0}' are being omited" , Module.Type);
+ }
+ }
+
+ private void AddModuleDefines()
+ {
+ switch (Type)
+ {
+ case ModuleType.NativeCUI:
+ {
+ Module.Defines.Add("__NTAPP__");
+ }
+ break;
+ case ModuleType.KernelModeDriver:
+ {
+ Module.Defines.Add("__NTDRIVER__");
+ }
+ break;
+ }
+
+ if (Unicode)
+ {
+ Module.Defines.Add("UNICODE");
+ Module.Defines.Add("_UNICODE");
+ }
+ }
+
+ private void AddModuleLinkerFlags()
+ {
+ switch (Type)
+ {
+ case ModuleType.Win32DLL:
+ case ModuleType.Win32OCX:
+ case ModuleType.Win32CUI:
+ case ModuleType.Win32GUI:
+ case ModuleType.Win32SCR:
+ {
+ Module.LinkerFlags.Add("-nostartfiles");
+ Module.LinkerFlags.Add("-lgcc");
+
+ if (Module.CPlusPlus)
+ Module.LinkerFlags.Add("-nostdlib");
+ }
+ break;
+ case ModuleType.Kernel:
+ {
+ break;
+ }
+ case ModuleType.KeyboardLayout:
+ case ModuleType.KernelModeDLL:
+ case ModuleType.KernelModeDriver:
+ case ModuleType.NativeCUI:
+ case ModuleType.NativeDLL:
+ case ModuleType.Test:
+ case ModuleType.BootLoader:
+ case ModuleType.BootProgram:
+ {
+ Module.LinkerFlags.Add("-nostartfiles");
+ Module.LinkerFlags.Add("-nostdlib");
+ }
+ break;
+ }
+
+ Module.LinkerFlags.Add("-g");
+ }
+
+ private void AddDebugSupportLibraries()
+ {
+ switch (Type)
+ {
+ case ModuleType.Win32DLL:
+ case ModuleType.Win32OCX:
+ case ModuleType.Win32CUI:
+ case ModuleType.Win32GUI:
+ case ModuleType.Win32SCR:
+ case ModuleType.NativeCUI:
+ case ModuleType.NativeDLL:
+ {
+ Module.Libraries.Add(Project.Modules.GetByName("debugsup_ntdll"));
+ }
+ break;
+ case ModuleType.KeyboardLayout:
+ case ModuleType.KernelModeDLL:
+ case ModuleType.KernelModeDriver:
+ {
+ Module.Libraries.Add(Project.Modules.GetByName("debugsup_ntoskrnl"));
+ }
+ break;
+ }
+ }
+
+ private void AddModuleCompilerFlags()
+ {
+ if (!AllowWarnings)
+ {
+ Module.CompilerFlags.Add("-Werror");
+ }
+
+ // Always force disabling of sibling calls optimisation for GCC
+ // (TODO: Move to version-specific once this bug is fixed in GCC)
+ Module.CompilerFlags.Add("-fno-optimize-sibling-calls");
+ Module.CompilerFlags.Add("-g");
+ Module.CompilerFlags.Add("-pipe");
+ }
+
+ private void AddRequiredBuildTools()
+ {
+ switch (Module.Type)
+ {
+ case ModuleType.BootLoader:
+ case ModuleType.BootProgram:
+ case ModuleType.BootSector:
+ case ModuleType.EmbeddedTypeLib:
+ case ModuleType.IdlHeader:
+ case ModuleType.MessageHeader:
+ case ModuleType.Kernel:
+ case ModuleType.KernelModeDLL:
+ case ModuleType.KernelModeDriver:
+ case ModuleType.NativeCUI:
+ case ModuleType.NativeDLL:
+ case ModuleType.ObjectLibrary:
+ case ModuleType.StaticLibrary:
+ case ModuleType.RpcClient:
+ case ModuleType.RpcServer:
+ case ModuleType.RpcProxy:
+ case ModuleType.Win32CUI:
+ case ModuleType.Win32DLL:
+ case ModuleType.Win32GUI:
+ case ModuleType.Win32OCX:
+ case ModuleType.Win32SCR:
+ case ModuleType.HostStaticLibrary:
+ case ModuleType.KeyboardLayout:
+ Module.Requeriments.Add(Project.Modules.GetByName("wrc"));
+ Module.Requeriments.Add(Project.Modules.GetByName("wmc"));
+ Module.Requeriments.Add(Project.Modules.GetByName("widl"));
+ Module.Requeriments.Add(Project.Modules.GetByName("winebuild"));
+ Module.Requeriments.Add(Project.Modules.GetByName("winebuild"));
+ break;
+ case ModuleType.Cabinet:
+ Module.Requeriments.Add(Project.Modules.GetByName("cabman"));
+ break;
+ case ModuleType.Iso:
+ Module.Requeriments.Add(Project.Modules.GetByName("cdmake"));
+ Module.Requeriments.Add(Project.Modules.GetByName("cabman"));
+ break;
+ case ModuleType.IsoRegTest:
+ Module.Requeriments.Add(Project.Modules.GetByName("cdmake"));
+ Module.Requeriments.Add(Project.Modules.GetByName("cabman"));
+ Module.Requeriments.Add(Project.Modules.GetByName("sysreg"));
+ break;
+ case ModuleType.LiveIso:
+ Module.Requeriments.Add(Project.Modules.GetByName("cdmake"));
+ Module.Requeriments.Add(Project.Modules.GetByName("mkhive"));
+ break;
+ case ModuleType.LiveIsoRegTest:
+ Module.Requeriments.Add(Project.Modules.GetByName("cdmake"));
+ Module.Requeriments.Add(Project.Modules.GetByName("mkhive"));
+ Module.Requeriments.Add(Project.Modules.GetByName("sysreg"));
+ break;
+ }
+ }
+
+ private void AddDefaultDependencies()
+ {
+ if (Module.Type != ModuleType.BuildTool &&
+ Module.Type != ModuleType.HostStaticLibrary &&
+ Module.Host == false)
+ {
+ if (Module.Name != "psdk" &&
+ Module.Name != "dxsdk" &&
+ Module.Name != "errcodes" &&
+ Module.Name != "bugcodes" &&
+ Module.Name != "ntstatus")
+ {
+ Module.Dependencies.Add(Project.Modules.GetByName("psdk"));
+ Module.Dependencies.Add(Project.Modules.GetByName("dxsdk"));
+ Module.Dependencies.Add(Project.Modules.GetByName("errcodes"));
+ Module.Dependencies.Add(Project.Modules.GetByName("bugcodes"));
+ Module.Dependencies.Add(Project.Modules.GetByName("ntstatus"));
+ }
+ }
+ }
+
+ //public RBuildFolder Folder
+ //{
+ // get { return null; }
+ //}
+
+ private void AddModuleLibraryDependencies()
+ {
+ // Add mingw and msvcrt implicit libraries only if it's
+ // a Win32 target.
+
+ if ((Module.Type == ModuleType.Win32CUI) ||
+ (Module.Type == ModuleType.Win32DLL) ||
+ (Module.Type == ModuleType.Win32GUI) ||
+ (Module.Type == ModuleType.Win32OCX) ||
+ (Module.Type == ModuleType.Win32SCR))
+ {
+ if (!Module.IsDefaultEntryPoint)
+ {
+ if (Module.NoEntryPoint)
+ {
+ if (Module.LinksToCRuntimeLibrary == false)
+ {
+ Module.Libraries.Add(0, Project.Modules.GetByName("mingw_common"));
+ }
+ }
+ }
+ else
+ {
+ if (!Module.IsDLL)
+ {
+ if (Unicode)
+ {
+ Module.Libraries.Add(0, Project.Modules.GetByName("mingw_wmain"));
+ }
+ else
+ {
+ Module.Libraries.Add(0, Project.Modules.GetByName("mingw_main"));
+ }
+ }
+
+ //Is it correct ?
+ if (Module.Libraries.Count > 0)
+ {
+ Module.Libraries.Add(1, Project.Modules.GetByName("mingw_common"));
+ }
+ else
+ {
+ Module.Libraries.Add(0, Project.Modules.GetByName("mingw_common"));
+ }
+ }
+ }
+ }
+
+ private void AddCRuntimeLibrary()
+ {
+ if ((Module.Type == ModuleType.Win32CUI) ||
+ (Module.Type == ModuleType.Win32DLL) ||
+ (Module.Type == ModuleType.Win32GUI) ||
+ (Module.Type == ModuleType.Win32OCX) ||
+ (Module.Type == ModuleType.Win32SCR))
+ {
+ if (Module.IsDefaultEntryPoint || Module.NoEntryPoint)
+ {
+ if (Module.LinksToCRuntimeLibrary == false)
+ {
+ if (Module.Name != "msvcrt")
+ {
+ // Link msvcrt to get the basic routines
+ Module.Libraries.Add(Project.Modules.GetByName("msvcrt"));
+ }
+ }
+ }
+ }
+ }
+
+ private void AddModuleAssemblyFlags()
+ {
+ if (Type == ModuleType.BootSector)
+ {
+ Module.AssemblyFlags.Add("-f bin");
+ }
+ }
+
+ private void AddModuleIncludeFolders()
+ {
+ if (Module.Type == ModuleType.RpcClient ||
+ Module.Type == ModuleType.RpcServer ||
+ Module.Type == ModuleType.RpcProxy ||
+ Module.Type == ModuleType.EmbeddedTypeLib)
+ {
+ Module.IncludeFolders.Add(new RBuildFolder(PathRoot.Intermediate, Module.Folder.FullPath)); //Hace falta?
+ Module.IncludeFolders.Add(new RBuildFolder(PathRoot.SourceCode, Module.Folder.FullPath));
+ }
+ }
+
+ private void AddModuleProperties()
+ {
+ Project.Properties.Add(string.Format("SysGen.Module.{0}.Enabled", Module.Name), Module.Enabled.ToString(), true, true);
+ Project.Properties.Add(string.Format("SysGen.Module.{0}.BasePath", Module.Name), Module.Base, true, true);
+ Project.Properties.Add(string.Format("SysGen.Module.{0}.RBuildFile", Module.Name), Module.RBuildFile, true, true);
+ }
+
+ protected override void PostExecuteTask()
+ {
+ if (m_Module.RBuildFile == "mstask.rbuild")
+ {
+ int i = 0;
+ }
+
+ AddModuleLibraryDependencies();
+ AddCRuntimeLibrary();
+ AddDebugSupportLibraries();
+ AddDefaultDependencies();
+ AddModuleProperties();
+
+ if (m_Module.Host)
+ {
+ if (m_Module.CPlusPlus)
+ {
+ m_Module.CompilerFlags.Add("$(HOST_CPPFLAGS)");
+ }
+ else
+ {
+ m_Module.CompilerFlags.Add("$(HOST_CFLAGS)");
+ m_Module.CompilerFlags.Add("-Wno-strict-aliasing");
+ }
+ }
+ else
+ {
+ if (m_Module.CPlusPlus)
+ {
+ m_Module.CompilerFlags.Add("$(HOST_CPPFLAGS)");
+ }
+ else
+ {
+ m_Module.CompilerFlags.Add("-nostdinc");
+ }
+ }
+
+ //Sort source code files only when necessary
+ if (Module.SourceFiles.ContainsASM)
+ Module.SourceFiles.Sort(new SourceCodePreferenceComparer());
+ }
+
+ protected override void ExecuteTask()
+ {
+ Module.Enabled = true;
+
+ //AddModuleLibraryDependencies();
+ AddModuleDefines();
+ AddModuleLinkerFlags();
+ AddModuleCompilerFlags();
+ AddModuleIncludeFolders();
+ AddModuleAssemblyFlags();
+ AddRequiredBuildTools();
+
+ //if (Type == ModuleType.Alias)
+ //{
+ // if (Module.Name == "halupalias")
+ // {
+ // int i = 10;
+ // }
+
+ // RBuildModule alisedModule = Project.Modules.GetByName(AliasOf);
+
+ // if (alisedModule == null)
+ // throw new BuildException("module '" + ModuleName + "' trying to alias non-existant module '" + AliasOf + "'", Location);
+
+ // if (Module.Name == AliasOf)
+ // throw new BuildException("Module '" + ModuleName + "' cannot link against itself", Location);
+
+ // alisedModule = Module;
+ // alisedModule.Enabled = true;
+
+ // Module.Enabled = false;
+ //}
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/BuildTool.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/BuildTool.cs
new file mode 100644
index 00000000000..67d0755580d
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/BuildTool.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("buildtool")]
+ public class BuildTool : ModuleTask
+ {
+ public BuildTool()
+ {
+ Type = ModuleType.BuildTool;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Cabinet.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Cabinet.cs
new file mode 100644
index 00000000000..715fbcc4952
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Cabinet.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("cabinet")]
+ public class Cabinet : ModuleTask
+ {
+ public Cabinet()
+ {
+ Type = ModuleType.Cabinet;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Kernel.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Kernel.cs
new file mode 100644
index 00000000000..7cafd130411
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Kernel.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("kernel")]
+ public class Kernel : ModuleTask
+ {
+ public Kernel()
+ {
+ Type = ModuleType.Kernel;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/KernelModeDLL.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/KernelModeDLL.cs
new file mode 100644
index 00000000000..22d238b739e
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/KernelModeDLL.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("kernelmodell")]
+ public class KernelModeDLL : ModuleTask
+ {
+ public KernelModeDLL()
+ {
+ Type = ModuleType.KernelModeDLL;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/KernelModeDriver.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/KernelModeDriver.cs
new file mode 100644
index 00000000000..b223cf5897b
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/KernelModeDriver.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("kernelmodedriver")]
+ public class KernelModeDriver : ModuleTask
+ {
+ public KernelModeDriver()
+ {
+ Type = ModuleType.KernelModeDriver;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/NativeCUI.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/NativeCUI.cs
new file mode 100644
index 00000000000..ac9e84a3d82
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/NativeCUI.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("nativecui")]
+ public class NativeCUI : ModuleTask
+ {
+ public NativeCUI()
+ {
+ Type = ModuleType.NativeCUI;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/NativeDLL.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/NativeDLL.cs
new file mode 100644
index 00000000000..bdaabee1bfc
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/NativeDLL.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("nativedll")]
+ public class NativeDLL : ModuleTask
+ {
+ public NativeDLL()
+ {
+ Type = ModuleType.NativeDLL;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/ObjectLibrary.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/ObjectLibrary.cs
new file mode 100644
index 00000000000..a34279d68a7
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/ObjectLibrary.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("objectlibrary")]
+ public class ObjectLibrary : ModuleTask
+ {
+ public ObjectLibrary()
+ {
+ Type = ModuleType.ObjectLibrary;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Package.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Package.cs
new file mode 100644
index 00000000000..68bdbcb0212
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Package.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("package")]
+ public class Package : ModuleTask
+ {
+ public Package()
+ {
+ Type = ModuleType.Package;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/StaticLibrary.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/StaticLibrary.cs
new file mode 100644
index 00000000000..0abe2820982
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/StaticLibrary.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("staticlibrary")]
+ public class StaticLibrary : ModuleTask
+ {
+ public StaticLibrary()
+ {
+ Type = ModuleType.StaticLibrary;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32CUI.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32CUI.cs
new file mode 100644
index 00000000000..5fba4c1bc44
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32CUI.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("win32cui")]
+ public class Win32CUI : ModuleTask
+ {
+ public Win32CUI()
+ {
+ Type = ModuleType.Win32CUI;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32Dll.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32Dll.cs
new file mode 100644
index 00000000000..320e1a00ebe
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32Dll.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("win32dll")]
+ public class Win32DLL : ModuleTask
+ {
+ public Win32DLL()
+ {
+ Type = ModuleType.Win32DLL;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32GUI.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32GUI.cs
new file mode 100644
index 00000000000..9bffa1ba55e
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32GUI.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("win32gui")]
+ public class Win32GUI : ModuleTask
+ {
+ public Win32GUI()
+ {
+ Type = ModuleType.Win32GUI;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32OCX.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32OCX.cs
new file mode 100644
index 00000000000..2b8051591fa
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32OCX.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("win32ocx")]
+ public class Win32OCX : ModuleTask
+ {
+ public Win32OCX()
+ {
+ Type = ModuleType.Win32OCX;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32SCR.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32SCR.cs
new file mode 100644
index 00000000000..5199e32fab6
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32SCR.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("win32scr")]
+ public class Win32SCR : ModuleTask
+ {
+ public Win32SCR()
+ {
+ Type = ModuleType.Win32SCR;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/OverrideModuleTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/OverrideModuleTask.cs
new file mode 100644
index 00000000000..612d4e6dc02
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/OverrideModuleTask.cs
@@ -0,0 +1,52 @@
+using System;
+using System.Xml;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("overridemodule")]
+ public class OverrideModuleTask : ModuleTask
+ {
+ public OverrideModuleTask()
+ {
+ m_FailOnMissingRequired = false;
+ }
+
+ protected override void OnLoad()
+ {
+ //Evitamos actualizar la información del módulo de verdad
+ }
+
+ protected override void PostExecuteTask()
+ {
+ //Evitamos actualizar la información del módulo de verdad
+ }
+
+ protected override void PreExecuteTask()
+ {
+ //Evitamos actualizar la información del módulo de verdad
+ }
+
+ protected override void ExecuteTask()
+ {
+ //Evitamos actualizar la información del módulo de verdad
+ }
+
+ protected override void InitializeTask(XmlNode taskNode)
+ {
+ base.InitializeTask(taskNode);
+
+ if (taskNode.Attributes["name"] == null)
+ throw new BuildException("Missing 'name' attribute");
+
+ string moduleName = taskNode.Attributes["name"].Value;
+
+ m_Module = Project.Modules.GetByName(moduleName);
+
+ if (m_Module == null)
+ throw new BuildException("Overrided module '{0}' not found" , moduleName);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/PCHTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/PCHTask.cs
new file mode 100644
index 00000000000..c7700d7018f
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/PCHTask.cs
@@ -0,0 +1,43 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ ///
+ /// PreCompiled Header task
+ ///
+ [TaskName("pch")]
+ public class PCHTask : FileTask
+ {
+ ///
+ /// Creates a new instance of the class.
+ ///
+ public PCHTask()
+ {
+ }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildSourceFile();
+ }
+
+ public RBuildSourceFile SourceFile
+ {
+ get { return m_FileSystemInfo as RBuildSourceFile; }
+ }
+
+ protected override void ExecuteTask()
+ {
+ if (Module.PreCompiledHeader != null)
+ throw new BuildException("Only one is allowed per module", Location);
+
+ //Call the base class
+ base.ExecuteTask();
+
+ //Add the folder where the PCH is present as a include folder
+ Module.IncludeFolders.Add(new RBuildFolder(PathRoot.Intermediate, Base));
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformAutorunTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformAutorunTask.cs
new file mode 100644
index 00000000000..a298818f62c
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformAutorunTask.cs
@@ -0,0 +1,21 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("platformautorun")]
+ public class PlatformAutorunTask : ValueBaseTask
+ {
+ protected override void ExecuteTask()
+ {
+ RBuildModule module = Project.Platform.Modules.GetByName(Value);
+
+ if (module == null)
+ throw new BuildException("Unknown module '{0}' referenced by ", Value);
+
+ Project.Platform.AutorunModules.Add(module);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformDebugChannelTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformDebugChannelTask.cs
new file mode 100644
index 00000000000..3a6bd35f029
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformDebugChannelTask.cs
@@ -0,0 +1,66 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("platformdebugchannel")]
+ public class PlatformDebugChannelTask : ValueBaseTask
+ {
+ //private RBuildDebugChannel m_DebugChannel = null;
+
+ //[TaskAttribute("name")]
+ //public string ChannelName
+ //{
+ // get { return m_DebugChannel.Name; }
+ // set { m_DebugChannel.Name = value; }
+ //}
+
+ //[TaskAttribute("warning")]
+ //public bool Warning
+ //{
+ // get { return m_DebugChannel.Warn; }
+ // set { m_DebugChannel.Warn = value; }
+ //}
+
+ //[TaskAttribute("trace")]
+ //public bool Trace
+ //{
+ // get { return m_DebugChannel.Trace; }
+ // set { m_DebugChannel.Trace = value; }
+ //}
+
+ //[TaskAttribute("fixme")]
+ //public bool Fixme
+ //{
+ // get { return m_DebugChannel.Fixme; }
+ // set { m_DebugChannel.Fixme = value; }
+ //}
+
+ //[TaskAttribute("error")]
+ //public bool Error
+ //{
+ // get { return m_DebugChannel.Error; }
+ // set { m_DebugChannel.Error = value; }
+ //}
+
+ //protected override void PreExecuteTask()
+ //{
+ // m_DebugChannel = Project.DebugChannels.GetByName(ChannelName);
+ //}
+
+ protected override void ExecuteTask()
+ {
+ RBuildDebugChannel channel = Project.DebugChannels.GetByName(Value);
+
+ if (channel == null)
+ throw new BuildException("Unknown debug channel '{0}' referenced by ", Value);
+
+ if (Project.Platform.DebugChannels.Contains(channel))
+ throw new BuildException("Only one debug channel '{0}' can be present per ", Value);
+
+ Project.Platform.DebugChannels.Add(channel);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformDescriptionTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformDescriptionTask.cs
new file mode 100644
index 00000000000..ee5d8f1cdfc
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformDescriptionTask.cs
@@ -0,0 +1,16 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("platformdescription")]
+ public class PlatformDescriptionTask : ValueBaseTask
+ {
+ protected override void ExecuteTask()
+ {
+ Project.Platform.Description = Value;
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformLanguageTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformLanguageTask.cs
new file mode 100644
index 00000000000..8362e09be64
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformLanguageTask.cs
@@ -0,0 +1,25 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("platformlanguage")]
+ public class PlatformLanguageTask : ValueBaseTask
+ {
+ public PlatformLanguageTask()
+ {
+ }
+
+ protected override void ExecuteTask()
+ {
+ RBuildLanguage language = Project.Languages.GetByName(Value);
+
+ if (language == null)
+ throw new BuildException("Unknown language '{0}' referenced by ", Value);
+
+ Project.Platform.Languages.Add(language);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformModuleTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformModuleTask.cs
new file mode 100644
index 00000000000..3bb3190f0bb
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformModuleTask.cs
@@ -0,0 +1,25 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("platformmodule")]
+ public class PlatformModuleTask : ValueBaseTask
+ {
+ public PlatformModuleTask()
+ {
+ }
+
+ protected override void ExecuteTask()
+ {
+ RBuildModule module = Project.Modules.GetByName(Value);
+
+ if (module == null)
+ throw new BuildException("Unknown module '{0}' referenced by ", Value);
+
+ Project.Platform.Modules.Add(module);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformNameTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformNameTask.cs
new file mode 100644
index 00000000000..88890e81e88
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformNameTask.cs
@@ -0,0 +1,16 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("platformname")]
+ public class PlatformNameTask : ValueBaseTask
+ {
+ protected override void ExecuteTask()
+ {
+ Project.Platform.Name = Value;
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformScreenSaverTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformScreenSaverTask.cs
new file mode 100644
index 00000000000..e396774a3e7
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformScreenSaverTask.cs
@@ -0,0 +1,28 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("platformscreensaver")]
+ public class PlatformScreenSaverTask : ValueBaseTask
+ {
+ protected override void ExecuteTask()
+ {
+ RBuildModule module = Project.Modules.GetByName(Value);
+
+ if (module == null)
+ throw new BuildException("Unknown module '{0}' referenced by ", Value);
+
+ if (module.Type != ModuleType.Win32SCR)
+ throw new BuildException("Shell can only be of type win32scr");
+
+ if (Project.Platform.Screensaver != null)
+ throw new BuildException("Only one screensaver can be set per platform");
+
+ /* set the shell to use */
+ Project.Platform.Screensaver = module;
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformShellTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformShellTask.cs
new file mode 100644
index 00000000000..b97c9f5b469
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformShellTask.cs
@@ -0,0 +1,29 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("platformshell")]
+ public class PlatformShellTask : ValueBaseTask
+ {
+ protected override void ExecuteTask()
+ {
+ RBuildModule module = Project.Modules.GetByName(Value);
+
+ if (module == null)
+ throw new BuildException("Unknown module '{0}' referenced by ", Value);
+
+ if (module.Type != ModuleType.Win32CUI &&
+ module.Type != ModuleType.Win32GUI)
+ throw new BuildException("Shell can only be of type win32gui");
+
+ if (Project.Platform.Shell != null)
+ throw new BuildException("Only one shell can be set per platform");
+
+ /* set the shell to use */
+ Project.Platform.Shell = module;
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformWallpaperTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformWallpaperTask.cs
new file mode 100644
index 00000000000..fc7776062aa
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformWallpaperTask.cs
@@ -0,0 +1,37 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("platformwallpaper")]
+ public class PlatformWallpaperTask : ValueBaseTask
+ {
+ protected override void PostExecuteTask()
+ {
+ if (Project.Platform.Wallpaper != null)
+ throw new BuildException("Only one wallpaper can be set per platform");
+
+ foreach (RBuildModule module in Project.Modules)
+ {
+ foreach (RBuildFile file in module.Files)
+ {
+ RBuildWallpaperFile wallpaper = file as RBuildWallpaperFile;
+
+ if (wallpaper != null)
+ {
+ if (wallpaper.ID.ToLower() == Value.ToLower())
+ {
+ /* set the shell to use */
+ Project.Platform.Wallpaper = wallpaper;
+ }
+ }
+ }
+ }
+
+ if (Project.Platform.Wallpaper == null)
+ throw new BuildException("Unknown wallpaper '{0}' referenced by ", Value);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ProjectTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ProjectTask.cs
new file mode 100644
index 00000000000..bb09d9342a1
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ProjectTask.cs
@@ -0,0 +1,70 @@
+using System;
+using System.Xml;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("project")]
+ public class ProjectTask : TaskContainer, ISysGenObject
+ {
+ RBuildProject _project = new RBuildProject();
+
+ public ProjectTask()
+ {
+ }
+
+ [TaskAttribute("name", Required = true)]
+ public string Name
+ {
+ get { return _project.Name; }
+ set { _project.Name = value; }
+ }
+
+ [TaskAttribute("makefile", Required = true)]
+ public string MakeFile
+ {
+ get { return _project.MakeFile; }
+ set { _project.MakeFile = value; }
+ }
+
+ public RBuildProject Project
+ {
+ get { return _project; }
+ }
+
+ public RBuildElement RBuildElement
+ {
+ get { return _project; }
+ }
+
+ protected override void OnInit()
+ {
+ SysGen.Project = Project;
+ SysGen.RootTask = this;
+ Project.RBuildFile = RBuildFile;
+
+
+ Project.Properties.Add("ARCH", "i386");/*
+ Project.Defines.Add("_M_IX86");
+ Project.Defines.Add("_X86_");
+ Project.Defines.Add("__i386__");*/
+ }
+
+ protected override void OnLoad()
+ {
+ base.OnLoad();
+
+ Project.Folder = new RBuildFolder(PathRoot.SourceCode , "");
+ }
+
+ protected override void PreExecuteTask()
+ {
+ ///Project.Base = string.Empty;
+ Project.Path = SysGen.BaseDirectory;
+ Project.XmlFile = XmlFile;
+ }
+ }
+}
+
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/PropertyTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/PropertyTask.cs
new file mode 100644
index 00000000000..1b143c0dd16
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/PropertyTask.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Xml;
+
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ /// Sets a property in the current project.
+ ///
+ /// NAnt uses a number of predefined properties.
+ ///
+ ///
+ /// Define a debug property with the value true.
+ /// ]]>
+ /// Use the user-defined debug property.
+ /// ]]>
+ /// Define a Read-Only property.This is just like passing in the param on the command line.
+ /// ]]>
+ ///
+ [TaskName("property")]
+ public class PropertyTask : PropertyBaseTask
+ {
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/RBuildTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/RBuildTask.cs
new file mode 100644
index 00000000000..12feafedce4
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/RBuildTask.cs
@@ -0,0 +1,10 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("rbuild")]
+ public class RBuildTask : TaskContainer
+ {
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ReDefineTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ReDefineTask.cs
new file mode 100644
index 00000000000..f41f0aae4ce
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ReDefineTask.cs
@@ -0,0 +1,16 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("redefine")]
+ public class ReDefineTask : Task
+ {
+ protected override void ExecuteTask()
+ {
+// RBuildElement.Defines.Add(new RBuildDefine(DefineName, DefineValue));
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/RequiresTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/RequiresTask.cs
new file mode 100644
index 00000000000..f68ffe5f00d
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/RequiresTask.cs
@@ -0,0 +1,27 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("requires")]
+ public class RequiresTask : ValueBaseTask
+ {
+ ///
+ /// The define value.
+ ///
+ [TaskValue(Required = true)]
+ public virtual string Value { get { return _value; } set { _value = value; } }
+
+ protected override void ExecuteTask()
+ {
+ RBuildModule requeriment = Project.Modules.GetByName(Value);
+
+ if (requeriment == null)
+ throw new BuildException("Unknown requeriment '{0}' referenced by module '{1}'", Value, Module.Name);
+
+ Module.Requeriments.Add(requeriment);
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/SetupTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/SetupTask.cs
new file mode 100644
index 00000000000..83d2056b8f4
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/SetupTask.cs
@@ -0,0 +1,45 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("setup")]
+ public class SetupTask : PlatformFileBaseTask
+ {
+ [TaskAttribute("installsection", Required = true)]
+ public string InstallSection { get { return Setup.InstallSection; } set { Setup.InstallSection = value; } }
+
+ [TaskAttribute("type")]
+ public SetupType SetupType { get { return Setup.SetupType; } set { Setup.SetupType = value; } }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildSetupFile();
+ }
+
+ ///
+ /// Get the underlying .
+ ///
+ public RBuildSetupFile Setup
+ {
+ get { return m_FileSystemInfo as RBuildSetupFile; }
+ }
+
+ protected override void ExecuteTask()
+ {
+ base.ExecuteTask();
+
+ if (Module.IsInstallable || Module.Type == ModuleType.Package)
+ {
+ if (Module.Setup != null)
+ throw new BuildException("There can be only one element for a module", Location);
+
+ Module.Setup = Setup;
+ }
+ else
+ throw new BuildException(" is not applicable for this module type", Location);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/TargetTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/TargetTask.cs
new file mode 100644
index 00000000000..15b1c70d212
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/TargetTask.cs
@@ -0,0 +1,18 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("target")]
+ public class TargetTask : Task
+ {
+ protected RBuildTarget m_Target = new RBuildTarget();
+
+ protected override void ExecuteTask()
+ {
+ SysGen.Targets.Add(m_Target);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/WallPaperTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/WallPaperTask.cs
new file mode 100644
index 00000000000..31ea0d9930d
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/WallPaperTask.cs
@@ -0,0 +1,26 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("wallpaper")]
+ public class WallPaperTask : PlatformFileBaseTask
+ {
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildWallpaperFile();
+ }
+
+ protected override void ExecuteTask()
+ {
+ if (Module != null)
+ {
+ base.ExecuteTask();
+ }
+ else
+ throw new BuildException(" is only applicable for modules", Location);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.Make/Program.cs b/reactos/tools/sysgen/SysGen.Make/Program.cs
new file mode 100644
index 00000000000..de3ba818cd9
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.Make/Program.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Framework;
+
+namespace SysGen.Make
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ SysGenEngine engine = new SysGenEngine(@"C:\ros\trunk\reactos\ReactOS-i386.rbuild");
+
+ engine.ReadBuildFiles();
+
+ /*
+ Console.WriteLine("Generates project files for buildsystems\n\n");
+ Console.WriteLine(" rbuild [switches] -r{rootfile.rbuild} buildsystem\n\n");
+ Console.WriteLine("Switches:\n");
+ Console.WriteLine(" -v Be verbose.\n");
+ Console.WriteLine(" -c Clean as you go. Delete generated files as soon as they are not\n");
+ Console.WriteLine(" needed anymore.\n");
+ Console.WriteLine(" -dd Disable automatic dependencies.\n");
+ Console.WriteLine(" -dm{module} Check only automatic dependencies for this module.\n");
+ Console.WriteLine(" -ud Disable multiple source files per compilation unit.\n");
+ Console.WriteLine(" -mi Let make handle creation of install directories. Rbuild will\n");
+ Console.WriteLine(" not generate the directories.\n");
+ Console.WriteLine(" -ps Generate proxy makefiles in source tree instead of the output.\n");
+ Console.WriteLine(" tree.\n");
+ Console.WriteLine(" -vs{version} Version of MS VS project files. Default is %s.\n", MS_VS_DEF_VERSION);
+ Console.WriteLine(" -vo{version|configuration} Adds subdirectory path to the default Intermediate-Outputdirectory.\n");
+ Console.WriteLine(" -Dvar=val Set the value of 'var' variable to 'val'.\n");
+ Console.WriteLine("\n");
+ Console.WriteLine(" buildsystem Target build system. Can be one of:\n");
+ */
+
+ Console.ReadLine();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.Make/Properties/AssemblyInfo.cs b/reactos/tools/sysgen/SysGen.Make/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..9012ef9b0c1
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.Make/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("SysGen.Make")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Sand")]
+[assembly: AssemblyProduct("SysGen.Make")]
+[assembly: AssemblyCopyright("Copyright © Sand 2008")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("00432ce1-5d82-4afb-9a3a-dc2ce95edc4e")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/reactos/tools/sysgen/SysGen.Make/SysGen.Make.csproj b/reactos/tools/sysgen/SysGen.Make/SysGen.Make.csproj
new file mode 100644
index 00000000000..89de06851a4
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.Make/SysGen.Make.csproj
@@ -0,0 +1,58 @@
+
+
+ Debug
+ AnyCPU
+ 8.0.50727
+ 2.0
+ {8B1229C7-6188-4621-A648-843CB9B5C72E}
+ Exe
+ Properties
+ SysGen.Make
+ SysGen.Make
+
+
+ 2.0
+
+
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+ {8F5F8375-4097-4952-B860-784EB9961ABE}
+ SysGen.Framework
+
+
+
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.Make/SysGen.Make.csproj.user b/reactos/tools/sysgen/SysGen.Make/SysGen.Make.csproj.user
new file mode 100644
index 00000000000..1a4ff357ca6
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.Make/SysGen.Make.csproj.user
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.Make/SysGen.Make.sln b/reactos/tools/sysgen/SysGen.Make/SysGen.Make.sln
new file mode 100644
index 00000000000..d9d1e258355
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.Make/SysGen.Make.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SysGen.Make", "SysGen.Make\SysGen.Make.csproj", "{8B1229C7-6188-4621-A648-843CB9B5C72E}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {8B1229C7-6188-4621-A648-843CB9B5C72E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8B1229C7-6188-4621-A648-843CB9B5C72E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8B1229C7-6188-4621-A648-843CB9B5C72E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8B1229C7-6188-4621-A648-843CB9B5C72E}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/reactos/tools/sysgen/SysGen.Make/SysGen.Make.suo b/reactos/tools/sysgen/SysGen.Make/SysGen.Make.suo
new file mode 100644
index 0000000000000000000000000000000000000000..b55bbbea00f579acf50698899f55a4f332327c08
GIT binary patch
literal 182272
zcmeFa37lkCSvFn?`!0(tA}~PMnP#>mlYqc%NhX;|hUv*776Fl~(lcv8|i6zJJqgTDSDB-wf~1(&ry)wa)H-{{Brj
z-K5LU3k2<;(g
z4@MgU4LuF*VR-*=v`3&l5^Xcu2-;4xEofWOwxMlD+ktj2+IeW_qdgSu0<;U!9*y=G
zv>!uzEZXDH9*?#QZ8zE;w7qEi&@Mu|80`|Y{b-k>U50i5?I7CaXjh;eLVE(*VYE@S
zBWPEm9Ywne?HJk<(Vm3%WVANgQ_!A@b~W15(8kcl(I(I)(WcO*(Pq$&qs^i{9qk0#
z9NIkE0@@PNAJfy9Vurx&q4cfw8Q9W5x?Ao
zkuTtNIr{~^sQK^ipcs)kX{YSpru%&R=5Kt@$IrSMZu%gJ3jYoP;vz=4AJC`qZeNDA
zeOKr2-64eppRaX(!+S`({C5N^(825;z)W{A{wwi!3OMOH=e6wLIe<^TAkWl=e-`c~
zZ}HzTtmqtOVGI;-0)J-!{R*t?3h-IPoYa7SR@3p{9&lelCc!`QVB9#CBL3&^$p5^b
z{Lj~z|2Y@xuZsUSb?=o7;O{5{^n1OM|M~uZ{|$czZux{aT=CWa_|C33?D*xWk6rhr
z8!^?5{(Wl?HAMga$P4km&Ze=2$xWkED=V`LGoAKTi_0h42NoyB=G?U-Q}avhwe8zZ
z@b}aQdm!c8kiw_IF&Be}7NSohklbV7u&GQ66XNpt>g?Pk^%eiMJ1dLJV>46jiMg>(
zr#(5_Ig$MtvDrG<7=W4)X3$t@`W9{Xsv56H-z~tOqdu?_B9ZW2*@PoZ1dbyz6
z%LJe+Z+3m@er#;#2B3#96ErA)AbX%gM
z-byA1Ha2;3X>8&|yZhRAKb@(C&e+myyZf5xr~VX8Ok#@oC(%>&lFb7htem|hdJ#S+
zlk>B@gf-uB^}^Iz+uruk)8y>()Wpguu-wAZ>dH>NCVILwL5$;LovHTN($d`Q#MsL0
z;zFn0nOL6Uv}g1+Ken>Wa9r@!5r`mG*?aCi>Z&pw7b-nOBT%o|#&hTArOq
z{91x7=C|?1#g+CnsCjO3xjj8OHNHC2eMxlm*aR9B(qcCZYl`A~YI6IeUK8D=Mm0A(
z-tJ7EpxkFm{CZacnF5Yom^`^S2Qut*-z0iW&J$%oXKG~?_QBNL#Ns>#Xs?Nms+WDf
zGd3|#Iccwnergfn*u+GpX(v+4|M)j2UX3BI@21X|U@o0*(l
znp^F(yRV6U#HOL@&Zv@qCdXFB+Io}dqFR-#tx!W^s`Vz(lNP@KnI4OXRqQp;@Uk!?5@!dz-wn^Y(=k$et#^{uj3*Jz4`g}{Osf`tRKB5
zdaItt3D_FYEufL?HPO%ZO04GR#ujGU+22GTvIvTZ!<1BKWfG`t8(EoyVD7#zc4DgW
z8Jn1cjgtLM;8QL2R+s1I7Z=+0lIW#+h9}2oAon2b>^0HPqq;L3%7x=&b8WPxrHMAQ
z0^Y5rY@}*&Fm`elZVH%KZxWd7PONpFXC~$+S661|I_>#Ia18$>x_nsS;O3_$XUEzL
z_&r+Umt_l0(+?)|+UzymmqZ^j`(nb&4`_L61~|bQ00E*U`YXf92zj-$v~>$a6aFUp
zs3x1v@wv6k=d#zn`&pZt9HVXAeNFUJO+K*uj>Fj6*4CRuPt~&nul+cdjDHh-)bf%T
zy!as66G2>i7bjNdrxsS4#9ts$uikcIduM6e$mr(fsgv8cZaaU=Nay6jmMvRGR^W^<
zFdl?Xc67E>Q{91}7u`HRZIlkJNTb!AlXzNX)uSXP0
zDvo3!ixFji6TdwtF%R=&C#D!68Ue{O`4P}mL#vtkh*mRR6Ij&uS7ew>u3?V(C(&bl
z`8jcXY?($$_chVqdF5<0J2}-}U6`d+ZZC;$M0O$3m{L(tZE9trjh5&^qAKiRb^)dX
za8R6Zc5<$bmgu8eaE>o8u63qhjOb0Gr{)&r%JSI66r9)YYocFCt#Fi?@-t@>CNzCc
zdr5SXa>=b5`gQH8Q%iF&0hTv2oTd+n?y6@EhTzijBGirEBzj7@9Nze}kloirN7d%w
z;`q}$Q;0TYFNt1?NlN5s6Fok+I@RW%L?6|Y11n=?d9|~`z(@8b(NhJdbtXEqnRL{f
zL^o13u>s|LlKG|OHd^BMeOQ#!v(SJ1ljyQ~ju7)Uhg@$GJ*6ny4Xziq=**3so?33(
zOQO4K#Gnj~4)i9`Q?-f6&@f`f?e1%$pBfmE|1(>&`zF!TV<5N>EicY2kIiqoh#8Oe
z!P$xB#m?gN%BG{UomHl}R#qox7dP!}AKlZIAnhP%y}+t~K=D=3rX{l`CYKlIktx96
z1Wwhnl*OqbNV>0yeyV3F`+XKeW#Aic5Bder3C~*Av#LDvA$l}DQ
zwtJgEum(GKW)U)+P5i!ksuYK>3dl=^7YP(>5(Qm~TiJW`7fXRZly#Tb8uwzV^{iZ`zEKEJv5_o;&3U$TunC+ovAA%
zZxTHf8<-M!8O@!TL=3u}{jKOEW@OKf>uOEvs6;2lV-hAx@YTu7NjpWe<1#e$jLKtJ
z`+j2+Cub2ZR%l|!x#yRLCPZWrzJBJ7OWQ%JI?HwNO=1#9y7U@$1*>=S>~@3|JYN_b
zo)3~FX08yE+0Nql3NmkF9To=$=7E+nrUz%1Wm)oG2ollNC72n=Ep^`{Mpw$^K?2?~
z0+2mZ^U5{yO`_j2X-46{w7534JTX1fdz0v=N{P_<&msVc-b@qBQGBDAH8Sl;!G3af
zGL!3gO>|U7g*MyA(Fa=M_w{EPsl=7#MZ|vXHPK%g6&gNZPGFS%P4rPVrY!P2HoJhL
zso7Mlw3-4}PpurELLo-?HGxM1mrtcmRW(nNqT#xiO3{?G%3J-%kHbq$jHUiMW0kVR
zX7@GG-~FKuMo)Jxo?7U>jEo*cK%6PN5m3nVY%VfTuENa9JuyCM5dytQKu_>;vrg_)
zXc2J~)TgoK(kP;Ta$;!}wS!aHYhnzkb#?P5QcqJsLZi1QlBGlpGQ?dw;
zTD6bh4}!t*1l7~_ib^v*6vcCxw5~j0rI_i~$NoB;Qv*${koCnh)e%yUc;L|`9EG|zjjiC_F
zUK9PLmMSlx=I1AnFihob9@^!{u7d8;aE&5~`U8U2QPB=HP+~yUoM~mn<<-UFhs1g<
zpPWSutBvy5g{90c>%K|gl(K$p^|Kmv#`dO8O<{`dHPKTUNmIKXpIl?@g}o&DIEbZ6
zIKY=KjxB6DIJP`dxI^Ob*z!4h_iwpiWXJaNGs~vPNlX!xlZ*>1^JB}%Bz9jDSXRX$
z5viY?Z)blKJ*3vqVFHFj+148BxtSsDz9xFB9v4<_o&|Z`*F--lT5wpwEnP;QZJKUr
z_9oF&HAYz^3mA1@6a6&LPA?&M(B_{+k7Ya<$bS?6ee{Br!?>WM$$j>c=%tK~te3fK
z&=vnAdMLMj6u~mnr>fGVdiBj^R;GGy68-cMm(J#Uo+ZPW
z{`r(37W;+9O&ma|n^P(ie71~TW+qD~hFU%Oo#WGsbCb*`cHbm=dSs~WdV|W6_Eov$
z`uv7WKxU1D7VJ#|od!B|ab=1|0V3plP4rhiQCZ@RB1>-)Jw3!GYWKeOj*+b++k5%P
ziAOx5d*vjeo{QXbTszd*lOR(krxsS{Nrrq)V8EXL_um^h`%n9UZ&(dy
z|7#QYT$u^X2lwW>eZ=A1_VcN`6v0mixfXO(@gYrrr?KwiphBKHk^V>e=UD;V>tC1t
zxR+l_$hfX6FHw=TKbL<%LC@W|5Lbj|6br3q%QpPK0Mm6oj%qm%pLgQ_W*p6O9>5
zZ`#6d5UvGg&&)O`8|l&?k8`O@|Kyb)?RG{zM~NyLH$IyN)z9E6&ri@dMbLRB
z(An7;MLe6NF8q7o-jiJcdj(|N(=mfw=$OZkV#%uhJpkh;m+(B4y72Fhd*9LRcn?O;
z6KFa(<6#!0x|YMDdt>4S=g*u)8n`Q3UHHEI8I)B=AUf8v6Du6u+4(g-)p2%;Y15=D
z@4a<)?vqcOgW~pRuwO{+gZ4Or^OB~pVzf|sPSCZ0umCZ$39EJpX9tbIQrex-EG_8W
zxRZj_ao^*Hj*ruyO>rT|?gHof2F_OTZ|;C=hve&OdPUh|z(_u;(u&nV
z|N8WY-?GoHe&cQr`qSTh-~%sy_t(DitcQ%xQ#|3{Xlv*6-9G&N58wB|TV6l;j#uCJ
zn->hDSL-|c`-DwA?`s$e!#f)<1X23w98d{Q;5w11q-DHzKut%XD7HXdj%0t?!6;T}
zC0nZntP;&rsJLUfWqS273Wxo&z=)0UPoyXJP%}UyUX{_+
zi3SvEV>c?;3p~a$Eklc78t>_$Z^IdSN5K(ez>yM}Cfa6vKLu&F9lS%+b33kf@OdHQ
zr!Dxjl8u%3LMB0Rzpy(V->?kNks1MqY7X|Hr=>NGh;@Z#)?k=A3B>u89pThIq
z{BO;$Y_)z9xIC>87oO190ae;rQnV1rqnt}0CT$n4BG<~;R
zBkuzIr5=1ck83R(;S^*MXWG2OHcow{uIF5`Khl}W+nL@gT@A_%(hpBkBu~#|GFj0z
zLH!Jv@0DGsw!S>w%j^m|E9{+Az5+<>&&g|}Cp$fC445xv-&0zh%p?idpTDp>)^L3s
z_i)ART*LG?#I4o()3Y{?LbhUtcjYML;Twq2cDSbJaJ6H^d8m=1k33VYM
zQ^(9;Y+K^v3z3
zR$I*AFfeT=oIC5jY(|Ro`F@OW7WT7omg!FS*{GRN<}mL~c!)CmIvE;jPu!=sHR~hv*wxeHol;K
zSb|-sXvzA=!tZ8
z8oxXVNzE+F2om#KV1;kXEOFx=^Ik?^r(c2Z3754ZSK*h8snS-}y8RGn?Gr;ERfxq^
zfH)3_rfKS7uHRgVF^u4OHnf@M3P(cPq+M+Gz+Ew(r*_99NnE9ioGdPiy;uxp5+g7u
zc;XFUytfOZT$a_7BF>YxSl2Qjk;gh1w{KyZ#F5@`zw)&fXG6aaf2|q%IItgvjbQcy
z<(=uH@N=xGFM);}22}dN)O3`qj2wlZW2n=B`t06HHII+@a?hV-N_4G*u?X{_;w!O?oWvX|!lMyZX-xTyghJnOA%kb~nAgTYv%de+
zYW+N*#D1}V2Xpw&YamU;p0Kl~E!%J26aOlPA9Hm0ImYN$Fyo3!)E&1Ug&qfI(^H+q
z=of+S66WAI#!dh0&KT`nL^XBi)c3!V|L0Ta%>q){g)3BC_4D^0J}EaOwgvBtBpg;dAf<_UbqJR~W(
z4XE)I`{rugwSYT_nep(Sfui2gw>&J@^Ul*O)AG%A<)eV}(;HGM$IZFbZUSZJ$f3;J
zFK4_!2{(_qIgL-usu*W{6WpOlZ*$vO@}Ke{w8su(HN}s*i>tzz+-K3=)*a)S^G#V@
z$_g=Jp_s6hQnS$9j|sC{&c%dL>pUb~V3Nda5K2>7F78Uq%XxFptP8W)xvyG_&LVn9l+v6
zJ$d0vPQ$4vYeP$g@miDCdeUad4YZ-S-l|aGFRUuC=-1+sW00WlFT}>THq#Nga`{D`
zlwZ0&e(g=b|HgI0ziuwvs`71h!iY_}2d%)JVNb`gi_mW=izEA%&??s7*+ui2WF!fGt63*9m5!^`5DZl
zv3i(1JKeKy{2oLdBcSguba5Lr{mLdGZTN*y!cT;8}B0K-E{QpF#GbJ%k6?u
zJehj5_oURk)CsSs{}J>r`>?$KB2O{w)4XOsTTUO;{~X>g9Jue($@`|%MF~pXlDB;b
z&FHIaruBPa^DST#OPl&SusTwD3HqOeC3CDxv(mF=R=G4feewMJSbx45y~}fLzNVTF
z&gT(O)Cy*i(Rp3hJl$qUHW9TjqZ;%Vp9+|OkW=rzvq18AJ$ZSDhO3nDN6AzP)DDZ`(QkQwT7p$2DHrlPw~7T#=J`w35Tj!
zh10gI>0bpD)?(PZxc~b?lDqs~J-g5Mc6>`hR6346pWo#)-(IU59SkK_EMuDF!mj})
zhYB&Vxh%43{n3RLgc{!q(5vD{{fy6lPBnR5PpRe;sz+gcFdMfW@5rU(P_wKB{SAPA
zP2re)T++6&WJ)}*Vf@}?5bXioFZkaEd~t;jvF_?#gfT6Ezceo5;cJcX+fiV!()(UG
zJO;K=zP_?5svbx6rZKZcRhG0-8Es*#i&B!aK*+7uF9Pm+yK|qndwi>uIoaZTE3>0J
z*WKFT`Z1cs3INU8^MJi{lw?V0)3e?tj8rn>maoa-8d(i!J6lb^9`reY;w%eaqWIL3
zrcc=ozTHV0xg=W)`HsYru|j4hi+-Uo{|Tt|lgSlpnknCbT=_PvosGn@GR<n{FABl;|~Qh#34AexxCaaW|_$66BN<6=pi7tT(~
zYa;ht3(Vi%lU!vs=MnTj+qHvC261MlARldaH?5@dJNDvkRx-4E)ZwpL)vq=YMPg^vUkbI$2~kXwlxS
zA}Qo-H;e9>N8JH;S+t3(h%-e%b;^JE5~!}eN^9$shJGfIjL#V}WW6QrWB$h0l)F~R|BN8=TG8FM=0}0k-kzjM>!49o9_R=Y!;8OX
z{*{opkN>0SDW7w#vNXbY4=by=U!yqQW6_?M0?zu-3}qcFcg)MMir$!Jo(1T|Hf7pQ
zX4HhT+3h9fO6?DFA-;Fe!Fr@J+kXt2l|5JPJ*V;U?RM2^lXkDc=w)llQV_3v5#E*H
zN(xnbcwv@q4b;fYB)w@`B-A+_$XimdyAo#D9}c)L?$YO(_NLFxw6x3dFe~*?;Pb&A
zzm(~MdJ!pC>l1nvmt>SkSuW0YcUD#J`m_}Gqt*NdB)y_Yi{HJQ%UaT!Df|CboJQv_nTZv)&LdYl!W0#<&S#~|Jq
z&nYmjIEl=D-WTKXXyINjKZC_p`WWzz?QdEN&T8{VT^t24E$7c2Eu7f?{&zrHh^VwG
zf*I~RqNPWl*i~J{SK?K92<(YLY<}9=;m&kf-WIEJ--#E09uO6c4!w+eyiRM%&76OF
zjv)LJAc)dJ2>z#ZTqQpyr+e#b>8r2~wlk}4+FdEpsDtoT3az{
zdgSg?4DFWy?b>MVtE^N}53OHXrraTH(8$5`XIO))db{{ajKQx1gXi{*LE3`1>PELy
z*FLi@o|&{5i}wJFOCl^n9tfj%wgb(wlD5m9F~Za6mlFBE(c9~~y_L&{wC*pe3nZ2D
z`Vt^*!s|5t`Vz!ErQ`U9@xr1WMALVM<{nl=|6Eihu>GJ!^zVhSiKatK%m0+N5XJwT
zZGUz{>yY0%D{vIEeK=cv#*uyxwq8h0yCGfL@J2?UPevf!@=;Kp8_6BzCNU`QcsDEH
z9);ed|H`SUNZaJ?U01ix_}~oiF5VZN|5nuV8BgZck?VPjCcYB$E$BQ&STXN9
zYnj*4X=}sc1w7G-R;5*R@&NV&(DP&2f5zh+b)V@NFk^Uou@0ei_Xf~j91{q2K^PO@
zPH=il+-nurR#4Y4=V7lgmH#dv^}9pJw=5>W$2^s84%}?^MSLZO{9I@#(OjKXcRD|<
zaq~Kn*(2^m;Tc`_j#Srb{a--u|BMh(FeR{LnRY4aGhtTK{;i=Y7lx5oD|z>4kT>P)Mwd7q9+D~#8heNS7>|7^7L7HGpk>aNnW>BkGWn)&_N
z8u5F9gJfnrM~5(H<>$N>>xnp`R&R?I&+quR3m{nZ3&+*8Q0FPnlQf7ASiDi>rT^e7BA-6ql9ApM;
zPqF64{}e-fHXxQq6hm*7x|bHG)dTUn&LoYf@)3WH9|#`kM=Yc6m?g`c*^e5&L$De_Fam@LQP0ID%O%CE^N`dC)99
zWWHKGmeK1&K(8O}Vcb+7=B1vK|IWfJ(i75_ip99!?S>v*1jW*awx>}n*Erqf3P|sF
zY`{1i-Y%k1H?Or7ILEYEy|R|)R=kpw$@5NahpzuAmVB?oO24c-Lz1;+zM12MwBN!r
z9B8jH-(j)5IIqm=KXD6n(q_o0QE&^NT!1(la8d-b+)4>$mCrLg7wj;`MY>@ogp|d-
z`h;p{f?tJMUc_A%*K^;A!yXL|b2h2ZwINg|f%awmPc1-OKeS~it?YN^%h1P=l@{J9
z_|E`*RUY^d)sIC%`jOD#?vvO?d=B6`U$XhQ)n6>1wFaqEc=S7s|7E~qkf>vk{3lMK
zbSk<_7`zr3yr?HVn$LvRH{Nk@B`9PUsFFS*sWDFx{x5{ht)N95S2V}QAW{R2XS_+i
zqlZnM=XT8)F8Ofz1cUOusl`tvkko|z}Xq<6M!{5JxZ
zd@QSK{Iv0zceYpB`>gDwq;PRWeXD)iF9DwgD6anzy84y%sk$5lg=
z#WSFJtE**pgY+@~1o%LjleOPe;X4EO