ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
February 2014
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
17 participants
464 discussions
Start a n
N
ew thread
[tkreuzer] 62352: [NTOSKRNL] Silence 2 annoying UNIMPLEMENTED messages
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri Feb 28 14:08:55 2014 New Revision: 62352 URL:
http://svn.reactos.org/svn/reactos?rev=62352&view=rev
Log: [NTOSKRNL] Silence 2 annoying UNIMPLEMENTED messages Modified: branches/kernel-fun/reactos/ntoskrnl/se/audit.c Modified: branches/kernel-fun/reactos/ntoskrnl/se/audit.c URL:
http://svn.reactos.org/svn/reactos/branches/kernel-fun/reactos/ntoskrnl/se/…
============================================================================== --- branches/kernel-fun/reactos/ntoskrnl/se/audit.c [iso-8859-1] (original) +++ branches/kernel-fun/reactos/ntoskrnl/se/audit.c [iso-8859-1] Fri Feb 28 14:08:55 2014 @@ -351,7 +351,7 @@ ResultListLength = UseResultList ? ObjectTypeListLength : 1; /// FIXME: we should do some real work here... - UNIMPLEMENTED; + //UNIMPLEMENTED; /// HACK: we just pretend all access is granted! for (i = 0; i < ResultListLength; i++) @@ -1394,7 +1394,7 @@ IN PPRIVILEGE_SET Privileges, IN BOOLEAN AccessGranted) { - UNIMPLEMENTED; + //UNIMPLEMENTED; return STATUS_NOT_IMPLEMENTED; }
10 years, 9 months
1
0
0
0
[tkreuzer] 62351: [NTOSKRNL] In debug builds add an array of system service name strings to assist in debugging
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri Feb 28 14:06:36 2014 New Revision: 62351 URL:
http://svn.reactos.org/svn/reactos?rev=62351&view=rev
Log: [NTOSKRNL] In debug builds add an array of system service name strings to assist in debugging Added: branches/kernel-fun/reactos/ntoskrnl/ke/servicenames.c (with props) Modified: branches/kernel-fun/reactos/ntoskrnl/ntos.cmake Added: branches/kernel-fun/reactos/ntoskrnl/ke/servicenames.c URL:
http://svn.reactos.org/svn/reactos/branches/kernel-fun/reactos/ntoskrnl/ke/…
============================================================================== --- branches/kernel-fun/reactos/ntoskrnl/ke/servicenames.c (added) +++ branches/kernel-fun/reactos/ntoskrnl/ke/servicenames.c [iso-8859-1] Fri Feb 28 14:06:36 2014 @@ -0,0 +1,11 @@ + + +#define SVC_(name, argcount) "Nt" #name, + +const char * DbgSyscallNames[] = +{ +#include <sysfuncs.h> +}; + +const unsigned int DbgNumberOfSyscalls = sizeof(DbgSyscallNames) / sizeof(DbgSyscallNames[0]); + Propchange: branches/kernel-fun/reactos/ntoskrnl/ke/servicenames.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: branches/kernel-fun/reactos/ntoskrnl/ntos.cmake URL:
http://svn.reactos.org/svn/reactos/branches/kernel-fun/reactos/ntoskrnl/nto…
============================================================================== --- branches/kernel-fun/reactos/ntoskrnl/ntos.cmake [iso-8859-1] (original) +++ branches/kernel-fun/reactos/ntoskrnl/ntos.cmake [iso-8859-1] Fri Feb 28 14:06:36 2014 @@ -276,6 +276,10 @@ list(APPEND ASM_SOURCE ${REACTOS_SOURCE_DIR}/ntoskrnl/ex/zw.S) +if (DBG) + list(APPEND SOURCE ${REACTOS_SOURCE_DIR}/ntoskrnl/ke/servicenames.c) +endif() + if(ARCH STREQUAL "i386") list(APPEND ASM_SOURCE ${REACTOS_SOURCE_DIR}/ntoskrnl/ex/i386/fastinterlck_asm.S
10 years, 9 months
1
0
0
0
[tkreuzer] 62350: [NTOSKRNL] Implement KeyNameInformation case in CmQueryKey
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri Feb 28 13:33:01 2014 New Revision: 62350 URL:
http://svn.reactos.org/svn/reactos?rev=62350&view=rev
Log: [NTOSKRNL] Implement KeyNameInformation case in CmQueryKey Modified: branches/kernel-fun/reactos/ntoskrnl/config/cmapi.c Modified: branches/kernel-fun/reactos/ntoskrnl/config/cmapi.c URL:
http://svn.reactos.org/svn/reactos/branches/kernel-fun/reactos/ntoskrnl/con…
============================================================================== --- branches/kernel-fun/reactos/ntoskrnl/config/cmapi.c [iso-8859-1] (original) +++ branches/kernel-fun/reactos/ntoskrnl/config/cmapi.c [iso-8859-1] Fri Feb 28 13:33:01 2014 @@ -1498,7 +1498,7 @@ _In_ PCM_KEY_CONTROL_BLOCK Kcb, _Out_ PKEY_USER_FLAGS_INFORMATION KeyFlagsInfo, _In_ ULONG Length, - _In_ PULONG ResultLength) + _Out_ PULONG ResultLength) { /* Validate the buffer size */ *ResultLength = sizeof(*KeyFlagsInfo); @@ -1511,6 +1511,59 @@ KeyFlagsInfo->UserFlags = Kcb->KcbUserFlags; return STATUS_SUCCESS; +} + +static +NTSTATUS +CmpQueryKeyNameInformation( + _In_ PCM_KEY_CONTROL_BLOCK Kcb, + _Out_writes_bytes_to_(BufferLength, *ResultLength) PKEY_NAME_INFORMATION KeyNameInformation, + _In_ ULONG BufferLength, + _Out_ PULONG ResultLength) +{ + PUNICODE_STRING KeyName; + ULONG ActualLength; + + /* Check if the KCB doesn't have a name block */ + if (Kcb->NameBlock == NULL) + { + /* Nothing to copy, just return the status */ + return Kcb->Delete ? STATUS_KEY_DELETED : STATUS_SUCCESS; + } + + /* Get the name */ + KeyName = CmpConstructName(Kcb); + if (KeyName == NULL) + { + return STATUS_INSUFFICIENT_RESOURCES; + } + + /* Set the returned length */ + *ResultLength = FIELD_OFFSET(KEY_NAME_INFORMATION, Name) + KeyName->Length; + + /* Check if the provided buffer is too small to fit even anything */ + if (BufferLength < FIELD_OFFSET(KEY_NAME_INFORMATION, Name)) + { + ExFreePoolWithTag(KeyName, TAG_CM); + return STATUS_BUFFER_TOO_SMALL; + } + + /* Set the full key name length */ + KeyNameInformation->NameLength = KeyName->Length; + + /* Calculate the size that we can copy */ + ActualLength = min(*ResultLength, BufferLength); + + /* Copy the name */ + RtlCopyMemory(KeyNameInformation->Name, + KeyName->Buffer, + ActualLength - FIELD_OFFSET(KEY_NAME_INFORMATION, Name)); + + /* Free the key name */ + ExFreePoolWithTag(KeyName, TAG_CM); + + /* Return the status */ + return Kcb->Delete ? STATUS_KEY_DELETED : STATUS_SUCCESS; } NTSTATUS @@ -1587,12 +1640,12 @@ ResultLength); break; - /* Unsupported class for now */ case KeyNameInformation: - - /* Print message and fail */ - DPRINT1("Unsupported class: %d!\n", KeyInformationClass); - Status = STATUS_NOT_IMPLEMENTED; + /* Call the internal API */ + Status = CmpQueryKeyNameInformation(Kcb, + KeyInformation, + Length, + ResultLength); break; /* Illegal classes */
10 years, 9 months
1
0
0
0
[aandrejevic] 62349: [BASESRV] Implement BaseSrvIsVdmAllowed.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Thu Feb 27 22:44:56 2014 New Revision: 62349 URL:
http://svn.reactos.org/svn/reactos?rev=62349&view=rev
Log: [BASESRV] Implement BaseSrvIsVdmAllowed. Modified: branches/ntvdm/subsystems/win/basesrv/basesrv.h branches/ntvdm/subsystems/win/basesrv/vdm.c branches/ntvdm/subsystems/win/basesrv/vdm.h Modified: branches/ntvdm/subsystems/win/basesrv/basesrv.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/win/basesrv/ba…
============================================================================== --- branches/ntvdm/subsystems/win/basesrv/basesrv.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/win/basesrv/basesrv.h [iso-8859-1] Thu Feb 27 22:44:56 2014 @@ -22,6 +22,7 @@ #include <ndk/psfuncs.h> #include <ndk/exfuncs.h> #include <ndk/umfuncs.h> +#include <ndk/cmfuncs.h> /* PSEH for SEH Support */ #include <pseh/pseh2.h> Modified: branches/ntvdm/subsystems/win/basesrv/vdm.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/win/basesrv/vd…
============================================================================== --- branches/ntvdm/subsystems/win/basesrv/vdm.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/win/basesrv/vdm.c [iso-8859-1] Thu Feb 27 22:44:56 2014 @@ -69,6 +69,103 @@ return SessionId; } +BOOLEAN NTAPI BaseSrvIsVdmAllowed(VOID) +{ + NTSTATUS Status; + BOOLEAN VdmAllowed = TRUE; + HANDLE RootKey, KeyHandle; + UNICODE_STRING KeyName, ValueName, MachineKeyName; + OBJECT_ATTRIBUTES Attributes; + UCHAR ValueBuffer[sizeof(KEY_VALUE_PARTIAL_INFORMATION) + sizeof(ULONG)]; + PKEY_VALUE_PARTIAL_INFORMATION ValueInfo = (PKEY_VALUE_PARTIAL_INFORMATION)ValueBuffer; + ULONG ActualSize; + + /* Initialize the unicode strings */ + RtlInitUnicodeString(&MachineKeyName, L"\\Registry\\Machine"); + RtlInitUnicodeString(&KeyName, VDM_POLICY_KEY_NAME); + RtlInitUnicodeString(&ValueName, VDM_DISALLOWED_VALUE_NAME); + + InitializeObjectAttributes(&Attributes, + &MachineKeyName, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + + /* Open the local machine key */ + Status = NtOpenKey(&RootKey, KEY_READ, &Attributes); + if (!NT_SUCCESS(Status)) return FALSE; + + InitializeObjectAttributes(&Attributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + RootKey, + NULL); + + /* Open the policy key in the local machine hive, if it exists */ + if (NT_SUCCESS(NtOpenKey(&KeyHandle, KEY_READ, &Attributes))) + { + /* Read the value, if it's set */ + if (NT_SUCCESS(NtQueryValueKey(KeyHandle, + &ValueName, + KeyValuePartialInformation, + ValueInfo, + sizeof(ValueBuffer), + &ActualSize))) + { + if (*((PULONG)ValueInfo->Data)) + { + /* The VDM has been disabled in the registry */ + VdmAllowed = FALSE; + } + } + + NtClose(KeyHandle); + } + + /* Close the local machine key */ + NtClose(RootKey); + + /* If it's disabled system-wide, there's no need to check the user key */ + if (!VdmAllowed) return FALSE; + + /* Open the current user key of the client */ + if (!CsrImpersonateClient(NULL)) return VdmAllowed; + Status = RtlOpenCurrentUser(KEY_READ, &RootKey); + CsrRevertToSelf(); + + /* If that fails, return the system-wide setting */ + if (!NT_SUCCESS(Status)) return VdmAllowed; + + InitializeObjectAttributes(&Attributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + RootKey, + NULL); + + /* Open the policy key in the current user hive, if it exists */ + if (NT_SUCCESS(NtOpenKey(&KeyHandle, KEY_READ, &Attributes))) + { + /* Read the value, if it's set */ + if (NT_SUCCESS(NtQueryValueKey(KeyHandle, + &ValueName, + KeyValuePartialInformation, + ValueInfo, + sizeof(ValueBuffer), + &ActualSize))) + { + if (*((PULONG)ValueInfo->Data)) + { + /* The VDM has been disabled in the registry */ + VdmAllowed = FALSE; + } + } + + NtClose(KeyHandle); + } + + return VdmAllowed; +} + VOID NTAPI BaseInitializeVDM(VOID) { /* Initialize the list head */ @@ -87,6 +184,9 @@ PBASE_CHECK_VDM CheckVdmRequest = &((PBASE_API_MESSAGE)ApiMessage)->Data.CheckVDMRequest; PRTL_CRITICAL_SECTION CriticalSection = NULL; PVDM_CONSOLE_RECORD ConsoleRecord = NULL; + + /* Don't do anything if the VDM has been disabled in the registry */ + if (!BaseSrvIsVdmAllowed()) return STATUS_ACCESS_DENIED; /* Validate the message buffers */ if (!CsrValidateMessageBuffer(ApiMessage, Modified: branches/ntvdm/subsystems/win/basesrv/vdm.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/win/basesrv/vd…
============================================================================== --- branches/ntvdm/subsystems/win/basesrv/vdm.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/win/basesrv/vdm.h [iso-8859-1] Thu Feb 27 22:44:56 2014 @@ -12,6 +12,9 @@ #include <win/vdm.h> /* DEFINITIONS ****************************************************************/ + +#define VDM_POLICY_KEY_NAME L"Software\\Policies\\Microsoft\\Windows\\AppCompat" +#define VDM_DISALLOWED_VALUE_NAME L"VDMDisallowed" typedef struct _VDM_CONSOLE_RECORD {
10 years, 9 months
1
0
0
0
[jimtabor] 62348: - Remove debug print.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Thu Feb 27 13:20:59 2014 New Revision: 62348 URL:
http://svn.reactos.org/svn/reactos?rev=62348&view=rev
Log: - Remove debug print. Modified: trunk/reactos/drivers/filesystems/ext2/src/fsctrl.c Modified: trunk/reactos/drivers/filesystems/ext2/src/fsctrl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ext2/s…
============================================================================== --- trunk/reactos/drivers/filesystems/ext2/src/fsctrl.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/ext2/src/fsctrl.c [iso-8859-1] Thu Feb 27 13:20:59 2014 @@ -535,7 +535,6 @@ else { DebugTrace(DEBUG_TRACE_MOUNT, "Failing mount. Partition not Ext2...", 0); - DbgPrint("Supper Blk Magic %x\n",SuperBlock->s_magic); } try_exit: NOTHING;
10 years, 10 months
1
0
0
0
[dquintana] 62347: [RSHELL] * Improve hot-tracking behaviour. CORE-7881
by dquintana@svn.reactos.org
Author: dquintana Date: Thu Feb 27 11:56:28 2014 New Revision: 62347 URL:
http://svn.reactos.org/svn/reactos?rev=62347&view=rev
Log: [RSHELL] * Improve hot-tracking behaviour. CORE-7881 Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp branches/shell-experiments/base/shell/rshell/CMenuBand.h branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp branches/shell-experiments/base/shell/rshell/CMenuToolbars.h Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] Thu Feb 27 11:56:28 2014 @@ -54,8 +54,7 @@ m_subMenuChild(NULL), m_useBigIcons(FALSE), m_hotBar(NULL), - m_hotItem(-1), - m_popupItem(-1) + m_hotItem(-1) { m_focusManager = CMenuFocusManager::AcquireManager(); } @@ -625,12 +624,10 @@ HRESULT CMenuBand::_OnHotItemChanged(CMenuToolbarBase * tb, INT id) { - if (m_hotBar && m_hotBar != tb) - m_hotBar->ChangeHotItem(-1); m_hotBar = tb; m_hotItem = id; - if (m_staticToolbar) m_staticToolbar->InvalidateDraw(); - if (m_SFToolbar) m_SFToolbar->InvalidateDraw(); + if (m_staticToolbar) m_staticToolbar->OnHotItemChanged(tb, id); + if (m_SFToolbar) m_SFToolbar->OnHotItemChanged(tb, id); return S_OK; } @@ -717,7 +714,7 @@ return S_OK; } -HRESULT CMenuBand::_OnPopupSubMenu(INT popupItem, IMenuPopup * popup, POINTL * pAt, RECTL * pExclude) +HRESULT CMenuBand::_OnPopupSubMenu(IMenuPopup * popup, POINTL * pAt, RECTL * pExclude, CMenuToolbarBase * toolbar, INT item) { if (m_subMenuChild) { @@ -725,7 +722,8 @@ if (FAILED(hr)) return hr; } - m_popupItem = popupItem; + if (m_staticToolbar) m_staticToolbar->OnPopupItemChanged(toolbar, item); + if (m_SFToolbar) m_SFToolbar->OnPopupItemChanged(toolbar, item); m_subMenuChild = popup; if (popup) { @@ -733,8 +731,6 @@ popup->Popup(pAt, pExclude, MPPF_RIGHT); } - if (m_staticToolbar) m_staticToolbar->InvalidateDraw(); - if (m_SFToolbar) m_SFToolbar->InvalidateDraw(); return S_OK; } Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuBand.h [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuBand.h [iso-8859-1] Thu Feb 27 11:56:28 2014 @@ -60,7 +60,6 @@ CMenuToolbarBase * m_hotBar; INT m_hotItem; - INT m_popupItem; public: CMenuBand(); @@ -176,7 +175,7 @@ HRESULT _GetTopLevelWindow(HWND*topLevel); HRESULT _OnHotItemChanged(CMenuToolbarBase * tb, INT id); HRESULT _MenuItemHotTrack(DWORD changeType); - HRESULT _OnPopupSubMenu(INT popupItem, IMenuPopup * popup, POINTL * pAt, RECTL * pExclude); + HRESULT _OnPopupSubMenu(IMenuPopup * popup, POINTL * pAt, RECTL * pExclude, CMenuToolbarBase * toolbar, INT item); BOOL UseBigIcons() { Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] Thu Feb 27 11:56:28 2014 @@ -55,6 +55,7 @@ COLORREF clrText; COLORREF clrTextHighlight; SIZE tbs; + bool isHot, isPopup; *theResult = 0; switch (uMsg) @@ -112,8 +113,10 @@ rc = cdraw->nmcd.rc; hdc = cdraw->nmcd.hdc; - if (((INT) cdraw->nmcd.dwItemSpec == m_hotItem || - (m_hotItem < 0 && (INT) cdraw->nmcd.dwItemSpec == m_popupItem))) + isHot = m_hotBar == this && m_hotItem == (INT) cdraw->nmcd.dwItemSpec; + isPopup = m_popupBar == this && m_popupItem == (INT) cdraw->nmcd.dwItemSpec; + + if (isHot || (m_hotItem < 0 && isPopup)) { cdraw->nmcd.uItemState = CDIS_HOT; } @@ -168,11 +171,11 @@ m_menuBand(menuBand), m_hwndToolbar(NULL), m_dwMenuFlags(0), - m_hotItem(-1), - m_popupItem(-1), m_SubclassOld(NULL), m_hasIdealSize(FALSE), - m_usePager(usePager) + m_usePager(usePager), + m_hotItem(-1), + m_popupItem(-1) { m_marlett = CreateFont( 0, 0, 0, 0, 0, 0, 0, 0, DEFAULT_CHARSET, @@ -370,7 +373,7 @@ { KillTimer(hWnd, TIMERID_HOTTRACK); - m_menuBand->_OnPopupSubMenu(-1, NULL, NULL, NULL); + m_menuBand->_OnPopupSubMenu(NULL, NULL, NULL, NULL, -1); if (HasSubMenu(m_hotItem) == S_OK) { @@ -404,7 +407,23 @@ return S_OK; } -HRESULT CMenuToolbarBase::PopupSubMenu(UINT itemId, UINT index, IShellMenu* childShellMenu) +HRESULT CMenuToolbarBase::OnHotItemChanged(CMenuToolbarBase * toolbar, INT item) +{ + m_hotBar = toolbar; + m_hotItem = item; + InvalidateDraw(); + return S_OK; +} + +HRESULT CMenuToolbarBase::OnPopupItemChanged(CMenuToolbarBase * toolbar, INT item) +{ + m_popupBar = toolbar; + m_popupItem = item; + InvalidateDraw(); + return S_OK; +} + +HRESULT CMenuToolbarBase::PopupSubMenu(UINT uItem, UINT index, IShellMenu* childShellMenu) { IBandSite* pBandSite; IDeskBar* pDeskBar; @@ -469,8 +488,7 @@ if (FAILED(hr)) return hr; - m_popupItem = itemId; - m_menuBand->_OnPopupSubMenu(itemId, popup, &pt, &rcl); + m_menuBand->_OnPopupSubMenu(popup, &pt, &rcl, this, m_popupItem); return S_OK; } @@ -746,7 +764,7 @@ return m_menuBand->_CallCBWithItemId(wParam, SMC_EXEC, 0, 0); } -HRESULT CMenuStaticToolbar::PopupItem(UINT uItem) +HRESULT CMenuStaticToolbar::PopupItem(INT uItem) { TBBUTTONINFO info = { 0 }; info.cbSize = sizeof(TBBUTTONINFO); @@ -777,7 +795,7 @@ } } -HRESULT CMenuStaticToolbar::HasSubMenu(UINT uItem) +HRESULT CMenuStaticToolbar::HasSubMenu(INT uItem) { TBBUTTONINFO info = { 0 }; info.cbSize = sizeof(TBBUTTONINFO); @@ -909,7 +927,7 @@ return hr; } -LPITEMIDLIST CMenuSFToolbar::GetPidlFromId(UINT uItem, INT* pIndex) +LPITEMIDLIST CMenuSFToolbar::GetPidlFromId(INT uItem, INT* pIndex) { TBBUTTONINFO info = { 0 }; info.cbSize = sizeof(TBBUTTONINFO); @@ -955,7 +973,7 @@ return m_menuBand->_CallCBWithItemPidl(GetPidlFromId(wParam), SMC_SFEXEC, 0, 0); } -HRESULT CMenuSFToolbar::PopupItem(UINT uItem) +HRESULT CMenuSFToolbar::PopupItem(INT uItem) { HRESULT hr; UINT uId; @@ -1005,7 +1023,7 @@ return PopupSubMenu(uItem, index, shellMenu); } -HRESULT CMenuSFToolbar::HasSubMenu(UINT uItem) +HRESULT CMenuSFToolbar::HasSubMenu(INT uItem) { HRESULT hr; LPCITEMIDLIST pidl = GetPidlFromId(uItem); Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuToolbars.h [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.h [iso-8859-1] Thu Feb 27 11:56:28 2014 @@ -33,12 +33,14 @@ CMenuBand * m_menuBand; HWND m_hwndToolbar; DWORD m_dwMenuFlags; - INT m_hotItem; - INT m_popupItem; WNDPROC m_SubclassOld; BOOL m_hasIdealSize; SIZE m_idealSize; BOOL m_usePager; + CMenuToolbarBase * m_hotBar; + INT m_hotItem; + CMenuToolbarBase * m_popupBar; + INT m_popupItem; private: static LRESULT CALLBACK s_SubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); @@ -55,10 +57,8 @@ HRESULT OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult); - virtual HRESULT FillToolbar() = 0; - virtual HRESULT PopupItem(UINT uItem) = 0; - virtual HRESULT HasSubMenu(UINT uItem) = 0; - virtual HRESULT OnContextMenu(NMMOUSE * rclick) = 0; + HRESULT OnHotItemChanged(CMenuToolbarBase * toolbar, INT item); + HRESULT OnPopupItemChanged(CMenuToolbarBase * toolbar, INT item); HRESULT PopupSubMenu(UINT itemId, UINT index, IShellMenu* childShellMenu); HRESULT PopupSubMenu(UINT index, HMENU menu); @@ -71,6 +71,11 @@ HRESULT SetPosSize(int x, int y, int cx, int cy); void InvalidateDraw(); + + virtual HRESULT FillToolbar() = 0; + virtual HRESULT PopupItem(INT uItem) = 0; + virtual HRESULT HasSubMenu(INT uItem) = 0; + virtual HRESULT OnContextMenu(NMMOUSE * rclick) = 0; protected: virtual HRESULT OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult); @@ -94,8 +99,8 @@ HRESULT GetMenu(HMENU *phmenu, HWND *phwnd, DWORD *pdwFlags); virtual HRESULT FillToolbar(); - virtual HRESULT PopupItem(UINT uItem); - virtual HRESULT HasSubMenu(UINT uItem); + virtual HRESULT PopupItem(INT uItem); + virtual HRESULT HasSubMenu(INT uItem); virtual HRESULT OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult); virtual HRESULT OnContextMenu(NMMOUSE * rclick); @@ -117,11 +122,11 @@ HRESULT GetShellFolder(DWORD *pdwFlags, LPITEMIDLIST *ppidl, REFIID riid, void **ppv); virtual HRESULT FillToolbar(); - virtual HRESULT PopupItem(UINT uItem); - virtual HRESULT HasSubMenu(UINT uItem); + virtual HRESULT PopupItem(INT uItem); + virtual HRESULT HasSubMenu(INT uItem); virtual HRESULT OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult); virtual HRESULT OnContextMenu(NMMOUSE * rclick); private: - LPITEMIDLIST GetPidlFromId(UINT uItem, INT* pIndex = NULL); + LPITEMIDLIST GetPidlFromId(INT uItem, INT* pIndex = NULL); };
10 years, 10 months
1
0
0
0
[aandrejevic] 62346: [FAST486] The FPU function number is actually just the REG component of a mod-reg-r/m byte.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Thu Feb 27 06:11:05 2014 New Revision: 62346 URL:
http://svn.reactos.org/svn/reactos?rev=62346&view=rev
Log: [FAST486] The FPU function number is actually just the REG component of a mod-reg-r/m byte. Modified: branches/ntvdm/lib/fast486/fpu.c Modified: branches/ntvdm/lib/fast486/fpu.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/fpu.c?rev=623…
============================================================================== --- branches/ntvdm/lib/fast486/fpu.c [iso-8859-1] (original) +++ branches/ntvdm/lib/fast486/fpu.c [iso-8859-1] Thu Feb 27 06:11:05 2014 @@ -35,10 +35,11 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeD8) { - UCHAR Function; - - /* Fetch the function number */ - if (!Fast486FetchByte(State, &Function)) + FAST486_MOD_REG_RM ModRegRm; + BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; + + /* Get the operands */ + if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm)) { /* Exception occurred */ return FALSE; @@ -59,10 +60,11 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeD9) { - UCHAR Function; - - /* Fetch the function number */ - if (!Fast486FetchByte(State, &Function)) + FAST486_MOD_REG_RM ModRegRm; + BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; + + /* Get the operands */ + if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm)) { /* Exception occurred */ return FALSE; @@ -83,10 +85,11 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDA) { - UCHAR Function; - - /* Fetch the function number */ - if (!Fast486FetchByte(State, &Function)) + FAST486_MOD_REG_RM ModRegRm; + BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; + + /* Get the operands */ + if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm)) { /* Exception occurred */ return FALSE; @@ -107,10 +110,11 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDB) { - UCHAR Function; - - /* Fetch the function number */ - if (!Fast486FetchByte(State, &Function)) + FAST486_MOD_REG_RM ModRegRm; + BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; + + /* Get the operands */ + if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm)) { /* Exception occurred */ return FALSE; @@ -131,10 +135,11 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDC) { - UCHAR Function; - - /* Fetch the function number */ - if (!Fast486FetchByte(State, &Function)) + FAST486_MOD_REG_RM ModRegRm; + BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; + + /* Get the operands */ + if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm)) { /* Exception occurred */ return FALSE; @@ -155,10 +160,11 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDD) { - UCHAR Function; - - /* Fetch the function number */ - if (!Fast486FetchByte(State, &Function)) + FAST486_MOD_REG_RM ModRegRm; + BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; + + /* Get the operands */ + if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm)) { /* Exception occurred */ return FALSE; @@ -179,10 +185,11 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDE) { - UCHAR Function; - - /* Fetch the function number */ - if (!Fast486FetchByte(State, &Function)) + FAST486_MOD_REG_RM ModRegRm; + BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; + + /* Get the operands */ + if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm)) { /* Exception occurred */ return FALSE; @@ -203,10 +210,11 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDF) { - UCHAR Function; - - /* Fetch the function number */ - if (!Fast486FetchByte(State, &Function)) + FAST486_MOD_REG_RM ModRegRm; + BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; + + /* Get the operands */ + if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm)) { /* Exception occurred */ return FALSE;
10 years, 10 months
1
0
0
0
[aandrejevic] 62345: [FAST486] Fix the previous commit. FPU_CHECK should be called after the fetch.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Thu Feb 27 03:57:20 2014 New Revision: 62345 URL:
http://svn.reactos.org/svn/reactos?rev=62345&view=rev
Log: [FAST486] Fix the previous commit. FPU_CHECK should be called after the fetch. Modified: branches/ntvdm/lib/fast486/fpu.c Modified: branches/ntvdm/lib/fast486/fpu.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/fpu.c?rev=623…
============================================================================== --- branches/ntvdm/lib/fast486/fpu.c [iso-8859-1] (original) +++ branches/ntvdm/lib/fast486/fpu.c [iso-8859-1] Thu Feb 27 03:57:20 2014 @@ -37,14 +37,14 @@ { UCHAR Function; - FPU_CHECK(); - - /* Fetch the function number */ - if (!Fast486FetchByte(State, &Function)) - { - /* Exception occurred */ - return FALSE; - } + /* Fetch the function number */ + if (!Fast486FetchByte(State, &Function)) + { + /* Exception occurred */ + return FALSE; + } + + FPU_CHECK(); #ifndef FAST486_NO_FPU // TODO: NOT IMPLEMENTED @@ -61,14 +61,14 @@ { UCHAR Function; - FPU_CHECK(); - - /* Fetch the function number */ - if (!Fast486FetchByte(State, &Function)) - { - /* Exception occurred */ - return FALSE; - } + /* Fetch the function number */ + if (!Fast486FetchByte(State, &Function)) + { + /* Exception occurred */ + return FALSE; + } + + FPU_CHECK(); #ifndef FAST486_NO_FPU // TODO: NOT IMPLEMENTED @@ -85,14 +85,14 @@ { UCHAR Function; - FPU_CHECK(); - - /* Fetch the function number */ - if (!Fast486FetchByte(State, &Function)) - { - /* Exception occurred */ - return FALSE; - } + /* Fetch the function number */ + if (!Fast486FetchByte(State, &Function)) + { + /* Exception occurred */ + return FALSE; + } + + FPU_CHECK(); #ifndef FAST486_NO_FPU // TODO: NOT IMPLEMENTED @@ -109,14 +109,14 @@ { UCHAR Function; - FPU_CHECK(); - - /* Fetch the function number */ - if (!Fast486FetchByte(State, &Function)) - { - /* Exception occurred */ - return FALSE; - } + /* Fetch the function number */ + if (!Fast486FetchByte(State, &Function)) + { + /* Exception occurred */ + return FALSE; + } + + FPU_CHECK(); #ifndef FAST486_NO_FPU // TODO: NOT IMPLEMENTED @@ -133,14 +133,14 @@ { UCHAR Function; - FPU_CHECK(); - - /* Fetch the function number */ - if (!Fast486FetchByte(State, &Function)) - { - /* Exception occurred */ - return FALSE; - } + /* Fetch the function number */ + if (!Fast486FetchByte(State, &Function)) + { + /* Exception occurred */ + return FALSE; + } + + FPU_CHECK(); #ifndef FAST486_NO_FPU // TODO: NOT IMPLEMENTED @@ -157,14 +157,14 @@ { UCHAR Function; - FPU_CHECK(); - - /* Fetch the function number */ - if (!Fast486FetchByte(State, &Function)) - { - /* Exception occurred */ - return FALSE; - } + /* Fetch the function number */ + if (!Fast486FetchByte(State, &Function)) + { + /* Exception occurred */ + return FALSE; + } + + FPU_CHECK(); #ifndef FAST486_NO_FPU // TODO: NOT IMPLEMENTED @@ -181,14 +181,14 @@ { UCHAR Function; - FPU_CHECK(); - - /* Fetch the function number */ - if (!Fast486FetchByte(State, &Function)) - { - /* Exception occurred */ - return FALSE; - } + /* Fetch the function number */ + if (!Fast486FetchByte(State, &Function)) + { + /* Exception occurred */ + return FALSE; + } + + FPU_CHECK(); #ifndef FAST486_NO_FPU // TODO: NOT IMPLEMENTED @@ -205,14 +205,14 @@ { UCHAR Function; - FPU_CHECK(); - - /* Fetch the function number */ - if (!Fast486FetchByte(State, &Function)) - { - /* Exception occurred */ - return FALSE; - } + /* Fetch the function number */ + if (!Fast486FetchByte(State, &Function)) + { + /* Exception occurred */ + return FALSE; + } + + FPU_CHECK(); #ifndef FAST486_NO_FPU // TODO: NOT IMPLEMENTED
10 years, 10 months
1
0
0
0
[aandrejevic] 62344: [FAST486] All of the FPU opcodes fetch another byte which is the function number. This is done by the CPU and it occurs even if there is no FPU attached.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Thu Feb 27 03:54:43 2014 New Revision: 62344 URL:
http://svn.reactos.org/svn/reactos?rev=62344&view=rev
Log: [FAST486] All of the FPU opcodes fetch another byte which is the function number. This is done by the CPU and it occurs even if there is no FPU attached. Modified: branches/ntvdm/lib/fast486/fpu.c Modified: branches/ntvdm/lib/fast486/fpu.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/fpu.c?rev=623…
============================================================================== --- branches/ntvdm/lib/fast486/fpu.c [iso-8859-1] (original) +++ branches/ntvdm/lib/fast486/fpu.c [iso-8859-1] Thu Feb 27 03:54:43 2014 @@ -35,7 +35,16 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeD8) { - FPU_CHECK(); + UCHAR Function; + + FPU_CHECK(); + + /* Fetch the function number */ + if (!Fast486FetchByte(State, &Function)) + { + /* Exception occurred */ + return FALSE; + } #ifndef FAST486_NO_FPU // TODO: NOT IMPLEMENTED @@ -50,7 +59,16 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeD9) { - FPU_CHECK(); + UCHAR Function; + + FPU_CHECK(); + + /* Fetch the function number */ + if (!Fast486FetchByte(State, &Function)) + { + /* Exception occurred */ + return FALSE; + } #ifndef FAST486_NO_FPU // TODO: NOT IMPLEMENTED @@ -65,7 +83,16 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDA) { - FPU_CHECK(); + UCHAR Function; + + FPU_CHECK(); + + /* Fetch the function number */ + if (!Fast486FetchByte(State, &Function)) + { + /* Exception occurred */ + return FALSE; + } #ifndef FAST486_NO_FPU // TODO: NOT IMPLEMENTED @@ -80,7 +107,16 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDB) { - FPU_CHECK(); + UCHAR Function; + + FPU_CHECK(); + + /* Fetch the function number */ + if (!Fast486FetchByte(State, &Function)) + { + /* Exception occurred */ + return FALSE; + } #ifndef FAST486_NO_FPU // TODO: NOT IMPLEMENTED @@ -95,7 +131,16 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDC) { - FPU_CHECK(); + UCHAR Function; + + FPU_CHECK(); + + /* Fetch the function number */ + if (!Fast486FetchByte(State, &Function)) + { + /* Exception occurred */ + return FALSE; + } #ifndef FAST486_NO_FPU // TODO: NOT IMPLEMENTED @@ -110,7 +155,16 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDD) { - FPU_CHECK(); + UCHAR Function; + + FPU_CHECK(); + + /* Fetch the function number */ + if (!Fast486FetchByte(State, &Function)) + { + /* Exception occurred */ + return FALSE; + } #ifndef FAST486_NO_FPU // TODO: NOT IMPLEMENTED @@ -125,7 +179,16 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDE) { - FPU_CHECK(); + UCHAR Function; + + FPU_CHECK(); + + /* Fetch the function number */ + if (!Fast486FetchByte(State, &Function)) + { + /* Exception occurred */ + return FALSE; + } #ifndef FAST486_NO_FPU // TODO: NOT IMPLEMENTED @@ -140,7 +203,16 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDF) { - FPU_CHECK(); + UCHAR Function; + + FPU_CHECK(); + + /* Fetch the function number */ + if (!Fast486FetchByte(State, &Function)) + { + /* Exception occurred */ + return FALSE; + } #ifndef FAST486_NO_FPU // TODO: NOT IMPLEMENTED
10 years, 10 months
1
0
0
0
[hbelusca] 62343: [NTVDM] Be able to load an external DOS BIOS file (at 70:0000) and, in case it is the DOS BIOS file of the NT VDM, load the DOS kernel file ntdos.sys when the ntio.sys calls BOP D...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Thu Feb 27 03:08:23 2014 New Revision: 62343 URL:
http://svn.reactos.org/svn/reactos?rev=62343&view=rev
Log: [NTVDM] Be able to load an external DOS BIOS file (at 70:0000) and, in case it is the DOS BIOS file of the NT VDM, load the DOS kernel file ntdos.sys when the ntio.sys calls BOP DOS function 0x11 (and put the kernel at DI:0000). Work in progress... Modified: branches/ntvdm/subsystems/ntvdm/dos/dem.c Modified: branches/ntvdm/subsystems/ntvdm/dos/dem.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/dos/dem.…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/dos/dem.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/dos/dem.c [iso-8859-1] Thu Feb 27 03:08:23 2014 @@ -15,6 +15,7 @@ #define NDEBUG #include "emulator.h" +#include "utils.h" #include "dem.h" #include "bop.h" @@ -40,7 +41,54 @@ BYTE FuncNum = *(PBYTE)SEG_OFF_TO_PTR(getCS(), getIP()); setIP(getIP() + 1); - DPRINT1("Unknown DOS System BOP Function: 0x%02X\n", FuncNum); + switch (FuncNum) + { + case 0x11: // Load the DOS kernel + { + BOOLEAN Success; + HANDLE hDosKernel; + ULONG ulDosKernelSize = 0; + + DPRINT1("You are loading Windows NT DOS!\n"); + + /* Open the DOS kernel file */ + hDosKernel = FileOpen("ntdos.sys", &ulDosKernelSize); + + /* If we failed, bail out */ + if (hDosKernel == NULL) goto Quit; + + /* + * Attempt to load the DOS kernel into memory. + * The segment where to load the DOS kernel is defined + * by the DOS BIOS and is found in DI:0000 . + */ + Success = FileLoadByHandle(hDosKernel, + REAL_TO_PHYS(TO_LINEAR(getDI(), 0x0000)), + ulDosKernelSize, + &ulDosKernelSize); + DPRINT1("DOS loading %s ; GetLastError() = %u\n", Success ? "succeeded" : "failed", GetLastError()); + + /* Close the DOS kernel file */ + FileClose(hDosKernel); + +Quit: + if (!Success) + { + /* We failed everything, stop the VDM */ + VdmRunning = FALSE; + } + + break; + } + + default: + { + + DPRINT1("Unknown DOS System BOP Function: 0x%02X\n", FuncNum); + // setCF(1); // Disable, otherwise we enter an infinite loop + break; + } + } } static VOID WINAPI DosCmdInterpreterBop(LPWORD Stack) @@ -51,7 +99,7 @@ switch (FuncNum) { - case 0x08: // Launch external command + case 0x08: // Launch external command { #define CMDLINE_LENGTH 1024 @@ -132,16 +180,42 @@ /* PUBLIC FUNCTIONS ***********************************************************/ -BOOLEAN DosInitialize(IN LPCSTR DosKernelFileNames) +BOOLEAN DosInitialize(IN LPCSTR DosKernelFileName) { /* Register the DOS BOPs */ RegisterBop(BOP_DOS, DosSystemBop ); RegisterBop(BOP_CMD, DosCmdInterpreterBop); - if (DosKernelFileNames) - { - DisplayMessage(L"NTVDM: Loading DOS kernel from external files is currently unsupported"); - return FALSE; + if (DosKernelFileName) + { + BOOLEAN Success; + HANDLE hDosBios; + ULONG ulDosBiosSize = 0; + + /* Open the DOS BIOS file */ + hDosBios = FileOpen(DosKernelFileName, &ulDosBiosSize); + + /* If we failed, bail out */ + if (hDosBios == NULL) return FALSE; + + /* Attempt to load the DOS BIOS into memory */ + Success = FileLoadByHandle(hDosBios, + REAL_TO_PHYS(TO_LINEAR(0x0070, 0x0000)), + ulDosBiosSize, + &ulDosBiosSize); + DPRINT1("DOS BIOS loading %s ; GetLastError() = %u\n", Success ? "succeeded" : "failed", GetLastError()); + + /* Close the DOS BIOS file */ + FileClose(hDosBios); + + if (Success) + { + /* Position execution pointers and return */ + setCS(0x0070); + setIP(0x0000); + } + + return Success; } else {
10 years, 10 months
1
0
0
0
← Newer
1
2
3
4
5
...
47
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Results per page:
10
25
50
100
200