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
January 2015
----- 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
207 discussions
Start a n
N
ew thread
[dquintana] 66015: [STOBJECT] * Fix resource strings so they compile correctly. * Make use of the resource strings for the tooltip. * Implement a context menu for the volume icon, using resource st...
by dquintana@svn.reactos.org
Author: dquintana Date: Fri Jan 9 16:25:49 2015 New Revision: 66015 URL:
http://svn.reactos.org/svn/reactos?rev=66015&view=rev
Log: [STOBJECT] * Fix resource strings so they compile correctly. * Make use of the resource strings for the tooltip. * Implement a context menu for the volume icon, using resource strings. NOTE: I have a strange issue where the cursor disappears while the popup is open. No idea if it's my fault or win32k. Modified: trunk/reactos/dll/shellext/stobject/lang/de-DE.rc trunk/reactos/dll/shellext/stobject/lang/en-US.rc trunk/reactos/dll/shellext/stobject/lang/es-ES.rc trunk/reactos/dll/shellext/stobject/lang/tr-TR.rc trunk/reactos/dll/shellext/stobject/stobject.rc trunk/reactos/dll/shellext/stobject/volume.cpp Modified: trunk/reactos/dll/shellext/stobject/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/stobject/lang…
============================================================================== --- trunk/reactos/dll/shellext/stobject/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/reactos/dll/shellext/stobject/lang/de-DE.rc [iso-8859-1] Fri Jan 9 16:25:49 2015 @@ -1,5 +1,6 @@ LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL +#if 0 IDD_POWER_METER DIALOGEX 0, 0, 252, 218 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_CONTEXTHELP @@ -11,6 +12,7 @@ CONTROL "&Details für jede Batterie anzeigen", 1002, BUTTON, BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 129, 6, 123, 10 CONTROL "", 1000, STATIC, SS_LEFT | WS_CHILD | WS_GROUP, 11, 29, 229, 178 END +#endif STRINGTABLE BEGIN @@ -34,7 +36,7 @@ IDS_HOTPLUG_DRIVE " - Laufwerk (%s)" IDS_HOTPLUG_DRIVES " - Laufwerke (%s)" IDS_HOTPLUG_A "A:" - IDS_HOTPLUG_REQUIERES "Diese Hardware erfordert \"Sicheres Entfernen\"" + IDS_HOTPLUG_REQUIERES "Diese Hardware erfordert ""Sicheres Entfernen""" IDS_HOTPLUG_CLICK "Klicken Sie auf dieses Symbol, und wählen Sie die zu entfernende Hardware, bevor Sie diese Hardware entfernen." //Volume related strings @@ -48,4 +50,4 @@ IDS_KEYS_STICKY "Einrastfunktion" IDS_KEYS_MOUSE "Tastaturmaus" IDS_KEYS_FILTER "Anschlagverzögerung" -END +END Modified: trunk/reactos/dll/shellext/stobject/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/stobject/lang…
============================================================================== --- trunk/reactos/dll/shellext/stobject/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/dll/shellext/stobject/lang/en-US.rc [iso-8859-1] Fri Jan 9 16:25:49 2015 @@ -1,5 +1,6 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#if 0 IDD_POWER_METER DIALOGEX 0, 0, 252, 218 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_CONTEXTHELP @@ -11,6 +12,7 @@ CONTROL "Show details for each &battery.", 1003, BUTTON, BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 135, 6, 120, 8 CONTROL "", 1000, STATIC, SS_LEFT | WS_CHILD | WS_GROUP, 11, 29, 229, 178 END +#endif STRINGTABLE BEGIN @@ -34,7 +36,7 @@ IDS_HOTPLUG_DRIVE " - Drive(%s)" IDS_HOTPLUG_DRIVES " - Drives(%s)" IDS_HOTPLUG_A "A:" - IDS_HOTPLUG_REQUIERES "This hardware requires \"Safe Removal\"" + IDS_HOTPLUG_REQUIERES "This hardware requires ""Safe Removal""" IDS_HOTPLUG_CLICK "Before removing this hardware, click on this icon and select the hardware you want to remove." //Volume related strings @@ -49,4 +51,3 @@ IDS_KEYS_MOUSE "MouseKeys" IDS_KEYS_FILTER "FilterKeys" END - Modified: trunk/reactos/dll/shellext/stobject/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/stobject/lang…
============================================================================== --- trunk/reactos/dll/shellext/stobject/lang/es-ES.rc [iso-8859-1] (original) +++ trunk/reactos/dll/shellext/stobject/lang/es-ES.rc [iso-8859-1] Fri Jan 9 16:25:49 2015 @@ -1,6 +1,7 @@ /* Spanish translation created by Ismael Ferreras Morezuelas (2014-12-30) */ LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL +#if 0 IDD_POWER_METER DIALOGEX 0, 0, 252, 218 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_CONTEXTHELP @@ -12,6 +13,7 @@ CONTROL "Mostrar un estado detallado para cada &baterÃa.", 1003, BUTTON, BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 135, 6, 120, 8 CONTROL "", 1000, STATIC, SS_LEFT | WS_CHILD | WS_GROUP, 11, 29, 229, 178 END +#endif STRINGTABLE BEGIN @@ -35,7 +37,7 @@ IDS_HOTPLUG_DRIVE " - Unidad(%s)" IDS_HOTPLUG_DRIVES " - Unidades(%s)" IDS_HOTPLUG_A "A:" - IDS_HOTPLUG_REQUIERES "Este dispositivo necesita una \"desconexión segura\"" + IDS_HOTPLUG_REQUIERES "Este dispositivo necesita una ""desconexión segura""" IDS_HOTPLUG_CLICK "Antes de desconectar el dispositivo, haga clic en este icono y eliga el dispositivo a desconectar." //Volume related strings @@ -50,4 +52,3 @@ IDS_KEYS_MOUSE "MouseKeys" IDS_KEYS_FILTER "FilterKeys" END - Modified: trunk/reactos/dll/shellext/stobject/lang/tr-TR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/stobject/lang…
============================================================================== --- trunk/reactos/dll/shellext/stobject/lang/tr-TR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/shellext/stobject/lang/tr-TR.rc [iso-8859-1] Fri Jan 9 16:25:49 2015 @@ -2,6 +2,7 @@ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT +#if 0 IDD_POWER_METER DIALOGEX 0, 0, 252, 218 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_CONTEXTHELP @@ -13,6 +14,7 @@ CONTROL "&Tüm Piller İçin Ayrıntıları Göster", 1003, BUTTON, BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 135, 6, 120, 8 CONTROL "", 1000, STATIC, SS_LEFT | WS_CHILD | WS_GROUP, 11, 29, 229, 178 END +#endif STRINGTABLE BEGIN @@ -51,4 +53,3 @@ IDS_KEYS_MOUSE "Fâre DüÄmeleri" IDS_KEYS_FILTER "Süzgeç DüÄmeleri" END - Modified: trunk/reactos/dll/shellext/stobject/stobject.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/stobject/stob…
============================================================================== --- trunk/reactos/dll/shellext/stobject/stobject.rc [iso-8859-1] (original) +++ trunk/reactos/dll/shellext/stobject/stobject.rc [iso-8859-1] Fri Jan 9 16:25:49 2015 @@ -16,7 +16,6 @@ /* UTF-8 */ #pragma code_page(65001) -#if 0 #ifdef LANGUAGE_DE_DE #include "lang/de-DE.rc" #endif @@ -32,4 +31,3 @@ #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif -#endif Modified: trunk/reactos/dll/shellext/stobject/volume.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/stobject/volu…
============================================================================== --- trunk/reactos/dll/shellext/stobject/volume.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/shellext/stobject/volume.cpp [iso-8859-1] Fri Jan 9 16:25:49 2015 @@ -11,6 +11,9 @@ #include <mmsystem.h> #include <mmddk.h> +#define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp)) +#define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp)) + WINE_DEFAULT_DEBUG_CHANNEL(stobject); HICON g_hIconVolume; @@ -28,13 +31,13 @@ static HRESULT __stdcall Volume_FindMixerControl(CSysTray * pSysTray) { MMRESULT result; - UINT mixerId = 0; + UINT mixerId = 0; DWORD waveOutId = 0; - DWORD param2 = 0; + DWORD param2 = 0; TRACE("Volume_FindDefaultMixerID\n"); - result = waveOutMessage((HWAVEOUT) WAVE_MAPPER, DRVM_MAPPER_PREFERRED_GET, (DWORD_PTR) &waveOutId, (DWORD_PTR) ¶m2); + result = waveOutMessage((HWAVEOUT)WAVE_MAPPER, DRVM_MAPPER_PREFERRED_GET, (DWORD_PTR)&waveOutId, (DWORD_PTR)¶m2); if (result) return E_FAIL; @@ -48,7 +51,7 @@ { TRACE("waveOut default device is %d\n", waveOutId); - result = mixerGetID((HMIXEROBJ) waveOutId, &mixerId, MIXER_OBJECTF_WAVEOUT); + result = mixerGetID((HMIXEROBJ)waveOutId, &mixerId, MIXER_OBJECTF_WAVEOUT); if (result) return E_FAIL; @@ -79,7 +82,7 @@ { mixerLine.cbStruct = sizeof(mixerLine); mixerLine.dwDestination = idx; - if (!mixerGetLineInfoW((HMIXEROBJ) g_mixerId, &mixerLine, 0)) + if (!mixerGetLineInfoW((HMIXEROBJ)g_mixerId, &mixerLine, 0)) { if (mixerLine.dwComponentType >= MIXERLINE_COMPONENTTYPE_DST_SPEAKERS && mixerLine.dwComponentType <= MIXERLINE_COMPONENTTYPE_DST_HEADPHONES) @@ -102,11 +105,11 @@ mixerLineControls.pamxctrl = &mixerControl; mixerLineControls.cbmxctrl = sizeof(mixerControl); - if (mixerGetLineControlsW((HMIXEROBJ) g_mixerId, &mixerLineControls, MIXER_GETLINECONTROLSF_ONEBYTYPE)) + if (mixerGetLineControlsW((HMIXEROBJ)g_mixerId, &mixerLineControls, MIXER_GETLINECONTROLSF_ONEBYTYPE)) return E_FAIL; TRACE("Found control id %d for mute: %d\n", mixerControl.dwControlID); - + g_muteControlID = mixerControl.dwControlID; return S_OK; @@ -172,13 +175,18 @@ Volume_IsMute(); + WCHAR strTooltip[128]; HICON icon; - if (g_IsMute) + if (g_IsMute) { icon = g_hIconMute; - else + LoadStringW(g_hInstance, IDS_VOL_MUTED, strTooltip, _countof(strTooltip)); + } + else { icon = g_hIconVolume; - - return pSysTray->NotifyIcon(NIM_MODIFY, ID_ICON_VOLUME, icon, L"Placeholder"); + LoadStringW(g_hInstance, IDS_VOL_VOLUME, strTooltip, _countof(strTooltip)); + } + + return pSysTray->NotifyIcon(NIM_MODIFY, ID_ICON_VOLUME, icon, strTooltip); } HRESULT STDMETHODCALLTYPE Volume_Shutdown(_In_ CSysTray * pSysTray) @@ -191,6 +199,49 @@ HRESULT Volume_OnDeviceChange(_In_ CSysTray * pSysTray, WPARAM wParam, LPARAM lParam) { return Volume_FindMixerControl(pSysTray); +} + +static void _RunVolume() +{ + // FIXME: ensure we are loading the right one + ShellExecuteW(NULL, NULL, L"sndvol32.exe", NULL, NULL, SW_SHOWNORMAL); +} + +static void _RunMMCpl() +{ + ShellExecuteW(NULL, NULL, L"mmsys.cpl", NULL, NULL, SW_NORMAL); +} + +static void _ShowContextMenu(CSysTray * pSysTray) +{ + WCHAR strAdjust[128]; + WCHAR strOpen[128]; + LoadStringW(g_hInstance, IDS_VOL_ADJUST, strAdjust, _countof(strAdjust)); + LoadStringW(g_hInstance, IDS_VOL_OPEN, strOpen, _countof(strOpen)); + + HMENU hPopup = CreatePopupMenu(); + AppendMenuW(hPopup, MF_STRING, IDS_VOL_ADJUST, strAdjust); + AppendMenuW(hPopup, MF_STRING, IDS_VOL_OPEN, strOpen); + + DWORD flags = TPM_RETURNCMD | TPM_NONOTIFY | TPM_RIGHTALIGN | TPM_BOTTOMALIGN; + DWORD msgPos = GetMessagePos(); + + SetForegroundWindow(pSysTray->GetHWnd()); + DWORD id = TrackPopupMenuEx(hPopup, flags, + GET_X_LPARAM(msgPos), GET_Y_LPARAM(msgPos), + pSysTray->GetHWnd(), NULL); + + DestroyMenu(hPopup); + + switch (id) + { + case IDS_VOL_OPEN: + _RunVolume(); + break; + case IDS_VOL_ADJUST: + _RunMMCpl(); + break; + } } HRESULT STDMETHODCALLTYPE Volume_Message(_In_ CSysTray * pSysTray, UINT uMsg, WPARAM wParam, LPARAM lParam) @@ -216,13 +267,12 @@ TRACE("TODO: display volume slider\n"); break; case WM_LBUTTONDBLCLK: - // FIXME: ensure we are loading the right one - ShellExecute(NULL, NULL, L"sndvol32.exe", NULL, NULL, SW_SHOWNORMAL); + _RunVolume(); break; case WM_RBUTTONDOWN: break; case WM_RBUTTONUP: - break; + _ShowContextMenu(pSysTray); case WM_RBUTTONDBLCLK: break; case WM_MOUSEMOVE:
9 years, 11 months
1
0
0
0
[hbelusca] 66014: [ramdisk]: improve again the dprints.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Fri Jan 9 14:17:39 2015 New Revision: 66014 URL:
http://svn.reactos.org/svn/reactos?rev=66014&view=rev
Log: [ramdisk]: improve again the dprints. Modified: trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c Modified: trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/class/ramd…
============================================================================== --- trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c [iso-8859-1] Fri Jan 9 14:17:39 2015 @@ -1473,7 +1473,7 @@ // // We don't handle anything else yet // - UNIMPLEMENTED_DBGBREAK("IOCTL: %lx\n", IoStackLocation->Parameters.DeviceIoControl.IoControlCode); + UNIMPLEMENTED_DBGBREAK("FSCTL: 0x%lx is UNSUPPORTED!\n", IoStackLocation->Parameters.DeviceIoControl.IoControlCode); } } } @@ -1631,7 +1631,7 @@ case IOCTL_VOLUME_GET_GPT_ATTRIBUTES: case IOCTL_VOLUME_OFFLINE: { - UNIMPLEMENTED_DBGBREAK("IOCTL: %lx\n", IoStackLocation->Parameters.DeviceIoControl.IoControlCode); + UNIMPLEMENTED_DBGBREAK("IOCTL: 0x%lx is UNIMPLEMENTED!\n", IoStackLocation->Parameters.DeviceIoControl.IoControlCode); break; } @@ -1640,7 +1640,7 @@ // // Drive code not emulated // - DPRINT1("IOCTL: %lx\n", IoStackLocation->Parameters.DeviceIoControl.IoControlCode); + DPRINT1("IOCTL: 0x%lx is UNSUPPORTED!\n", IoStackLocation->Parameters.DeviceIoControl.IoControlCode); break; } } @@ -2952,7 +2952,7 @@ // Are we being booted from setup? Not yet supported // if (KeLoaderBlock->SetupLdrBlock) - DPRINT1("FIXME: RamdiskAddDevice unsupported when being started from SETUPLDR!\n"); + DPRINT1("FIXME: RamdiskAddDevice is UNSUPPORTED when being started from SETUPLDR!\n"); // ASSERT(!KeLoaderBlock->SetupLdrBlock); }
9 years, 11 months
1
0
0
0
[hbelusca] 66013: [RAMDISK] - Whitespace fixes, - Add braces for long "case blah: ..." code blocks, - Add more informational messages when a feature is unimplemented (some control codes and cases h...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Fri Jan 9 14:09:34 2015 New Revision: 66013 URL:
http://svn.reactos.org/svn/reactos?rev=66013&view=rev
Log: [RAMDISK] - Whitespace fixes, - Add braces for long "case blah: ..." code blocks, - Add more informational messages when a feature is unimplemented (some control codes and cases happening when using ramdisk with bootcd). Modified: trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c Modified: trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/class/ramd…
============================================================================== --- trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c [iso-8859-1] Fri Jan 9 14:09:34 2015 @@ -34,10 +34,10 @@ #define RAMDISK_SESSION_SIZE \ FIELD_OFFSET(CDROM_TOC, TrackData) + sizeof(TRACK_DATA) - + #define RAMDISK_TOC_SIZE \ FIELD_OFFSET(CDROM_TOC, TrackData) + 2 * sizeof(TRACK_DATA) - + #define TOC_DATA_TRACK (0x04) typedef enum _RAMDISK_DEVICE_TYPE @@ -58,16 +58,16 @@ } RAMDISK_DEVICE_STATE; DEFINE_GUID(RamdiskBusInterface, - 0x5DC52DF0, - 0x2F8A, - 0x410F, - 0x80, 0xE4, 0x05, 0xF8, 0x10, 0xE7, 0xA8, 0x8A); + 0x5DC52DF0, + 0x2F8A, + 0x410F, + 0x80, 0xE4, 0x05, 0xF8, 0x10, 0xE7, 0xA8, 0x8A); DEFINE_GUID(RamdiskDiskInterface, - 0x31D909F0, - 0x2CDF, - 0x4A20, - 0x9E, 0xD4, 0x7D, 0x65, 0x47, 0x6C, 0xA7, 0x68); + 0x31D909F0, + 0x2CDF, + 0x4A20, + 0x9E, 0xD4, 0x7D, 0x65, 0x47, 0x6C, 0xA7, 0x68); typedef struct _RAMDISK_EXTENSION { @@ -94,7 +94,7 @@ // Inherited base class // RAMDISK_EXTENSION; - + // // Data we get from the creator // @@ -107,7 +107,7 @@ LONG DiskOffset; WCHAR DriveLetter; ULONG BasePage; - + // // Data we get from the disk // @@ -140,7 +140,7 @@ { ULONG MinView, DefView, MinViewLength, DefViewLength, MaxViewLength; RTL_QUERY_REGISTRY_TABLE QueryTable[10]; - + // // Set defaults // @@ -153,7 +153,7 @@ MaximumViewCount = 64; MinimumViewLength = 0x10000u; DefaultViewLength = 0x100000u; - + // // Setup the query table and query the registry // @@ -192,7 +192,7 @@ QueryTable, NULL, NULL); - + // // Parse minimum view count, cannot be bigger than 256 or smaller than 2 // @@ -220,7 +220,7 @@ DefView = MinView; } DefaultViewCount = DefView; - + // // Parse maximum view count, cannot be bigger than 256 or smaller than default // @@ -232,7 +232,7 @@ { MaximumViewCount = DefView; } - + // // Parse minimum view length, cannot be bigger than 1GB or smaller than 64KB // @@ -301,52 +301,52 @@ SIZE_T ActualLength; LARGE_INTEGER ActualOffset; LARGE_INTEGER ActualPages; - + // // We only support boot disks for now // ASSERT(DeviceExtension->DiskType == RAMDISK_BOOT_DISK); - + // // Calculate the actual offset in the drive // ActualOffset.QuadPart = DeviceExtension->DiskOffset + Offset.QuadPart; - + // // Convert to pages // ActualPages.QuadPart = ActualOffset.QuadPart >> PAGE_SHIFT; - + // // Now add the base page // ActualPages.QuadPart = DeviceExtension->BasePage + ActualPages.QuadPart; - + // // Calculate final amount of bytes // PhysicalAddress.QuadPart = ActualPages.QuadPart << PAGE_SHIFT; - + // // Calculate pages spanned for the mapping // ActualLength = ADDRESS_AND_SIZE_TO_SPAN_PAGES(ActualOffset.QuadPart, Length); - + // // And convert this back to bytes // ActualLength <<= PAGE_SHIFT; - + // // Get the offset within the page // PageOffset = BYTE_OFFSET(ActualOffset.QuadPart); - + // // Map the I/O Space from the loader // MappedBase = MmMapIoSpace(PhysicalAddress, ActualLength, MmCached); - + // // Return actual offset within the page as well as the length // @@ -365,37 +365,37 @@ LARGE_INTEGER ActualOffset; SIZE_T ActualLength; ULONG PageOffset; - + // // We only support boot disks for now // ASSERT(DeviceExtension->DiskType == RAMDISK_BOOT_DISK); - + // // Calculate the actual offset in the drive // ActualOffset.QuadPart = DeviceExtension->DiskOffset + Offset.QuadPart; - + // // Calculate pages spanned for the mapping // ActualLength = ADDRESS_AND_SIZE_TO_SPAN_PAGES(ActualOffset.QuadPart, Length); - + // // And convert this back to bytes // ActualLength <<= PAGE_SHIFT; - + // // Get the offset within the page // PageOffset = BYTE_OFFSET(ActualOffset.QuadPart); - + // // Calculate actual base address where we mapped this // BaseAddress = (PVOID)((ULONG_PTR)BaseAddress - PageOffset); - + // // Unmap the I/O space we got from the loader // @@ -432,7 +432,7 @@ { // // Check if we're an ISO - // + // if (DiskType == RAMDISK_BOOT_DISK) { // @@ -440,7 +440,7 @@ // BasePage = Input->BasePage; if (!BasePage) return STATUS_INVALID_PARAMETER; - + // // Sanitize disk options // @@ -467,8 +467,8 @@ // // Read the view count instead // - //ViewCount = Input->ViewCount; - + // ViewCount = Input->ViewCount; + // // Sanitize disk options // @@ -512,8 +512,8 @@ Status = STATUS_INSUFFICIENT_RESOURCES; goto FailCreate; } - - // + + // // Build the device name string // DeviceName.Buffer = Buffer; @@ -521,7 +521,7 @@ DeviceName.MaximumLength = Length; wcsncpy(Buffer, L"\\Device\\Ramdisk", Length / sizeof(WCHAR)); wcsncat(Buffer, GuidString.Buffer, Length / sizeof(WCHAR)); - + // // Create the drive device // @@ -534,12 +534,12 @@ 0, &DeviceObject); if (!NT_SUCCESS(Status)) goto FailCreate; - + // // Grab the drive extension // DriveExtension = DeviceObject->DeviceExtension; - + // // Check if we need a DOS device // @@ -583,7 +583,7 @@ // Input->Options.NoDosDevice = TRUE; } - + // // It this an ISO boot ramdisk? // @@ -604,14 +604,14 @@ RtlInitUnicodeString(&DriveString, LocalBuffer); IoDeleteSymbolicLink(&DriveString); IoCreateSymbolicLink(&DriveString, &DeviceName); - + // // Save the drive letter // DriveExtension->DriveLetter = Input->DriveLetter; } } - + } // @@ -619,7 +619,7 @@ // DeviceObject->Flags |= (DO_XIP | DO_POWER_PAGABLE | DO_DIRECT_IO); DeviceObject->AlignmentRequirement = 1; - + // // Build the drive FDO // @@ -628,9 +628,9 @@ DiskLength = Input->DiskLength; ExInitializeFastMutex(&DriveExtension->DiskListLock); IoInitializeRemoveLock(&DriveExtension->RemoveLock, - 'dmaR', - 1, - 0); + 'dmaR', + 1, + 0); DriveExtension->DriveDeviceName = DeviceName; DriveExtension->SymbolicLinkName = SymbolicLinkName; DriveExtension->GuidString = GuidString; @@ -646,14 +646,14 @@ DriveExtension->BytesPerSector = 0; DriveExtension->SectorsPerTrack = 0; DriveExtension->NumberOfHeads = 0; - + // // Make sure we don't free it later // DeviceName.Buffer = NULL; SymbolicLinkName.Buffer = NULL; GuidString.Buffer = NULL; - + // // Check if this is an boot disk, or a registry ram drive // @@ -679,14 +679,14 @@ BytesPerSector = BiosBlock.BytesPerSector; SectorsPerTrack = BiosBlock.SectorsPerTrack; Heads = BiosBlock.Heads; - + // // Save it // DriveExtension->BytesPerSector = BytesPerSector; DriveExtension->SectorsPerTrack = SectorsPerTrack; DriveExtension->NumberOfHeads = Heads; - + // // Unmap now // @@ -705,7 +705,7 @@ goto FailCreate; } } - + // // Check if the drive settings haven't been set yet // @@ -735,7 +735,7 @@ DriveExtension->NumberOfHeads = 16; } } - + // // Calculate the cylinder size // @@ -752,31 +752,31 @@ // DriveExtension->Cylinders++; } - + // // Acquire the disk lock // KeEnterCriticalRegion(); ExAcquireFastMutex(&DeviceExtension->DiskListLock); - + // // Insert us // InsertTailList(&DeviceExtension->DiskList, &DriveExtension->DiskList); - + // // Release the lock // ExReleaseFastMutex(&DeviceExtension->DiskListLock); KeLeaveCriticalRegion(); - + // // Clear init flag // DeviceObject->Flags &= ~DO_DEVICE_INITIALIZING; return STATUS_SUCCESS; } - + FailCreate: UNIMPLEMENTED_DBGBREAK(); return STATUS_SUCCESS; @@ -791,95 +791,95 @@ PRAMDISK_CREATE_INPUT Input; ULONG Length; PRAMDISK_BUS_EXTENSION DeviceExtension; - PRAMDISK_DRIVE_EXTENSION DriveExtension; + PRAMDISK_DRIVE_EXTENSION DriveExtension; ULONG DiskType; PWCHAR FileNameStart, FileNameEnd; NTSTATUS Status; PIO_STACK_LOCATION IoStackLocation = IoGetCurrentIrpStackLocation(Irp); - + // // Get the device extension and our input data // DeviceExtension = DeviceObject->DeviceExtension; Length = IoStackLocation->Parameters.DeviceIoControl.InputBufferLength; Input = (PRAMDISK_CREATE_INPUT)Irp->AssociatedIrp.SystemBuffer; - + // // Validate input parameters // if ((Length < sizeof(RAMDISK_CREATE_INPUT)) || - (Input->Version != sizeof(RAMDISK_CREATE_INPUT))) - { - // - // Invalid input - // - return STATUS_INVALID_PARAMETER; - } - + (Input->Version != sizeof(RAMDISK_CREATE_INPUT))) + { + // + // Invalid input + // + return STATUS_INVALID_PARAMETER; + } + // // Validate the disk type // DiskType = Input->DiskType; if (DiskType == RAMDISK_WIM_DISK) return STATUS_INVALID_PARAMETER; - + // // Look at the disk type // if (DiskType == RAMDISK_BOOT_DISK) { - // - // We only allow this as an early-init boot - // - if (!KeLoaderBlock) return STATUS_INVALID_PARAMETER; - - // - // Save command-line flags - // - if (ExportBootDiskAsCd) Input->Options.ExportAsCd = TRUE; - if (IsWinPEBoot) Input->Options.NoDriveLetter = TRUE; - } - + // + // We only allow this as an early-init boot + // + if (!KeLoaderBlock) return STATUS_INVALID_PARAMETER; + + // + // Save command-line flags + // + if (ExportBootDiskAsCd) Input->Options.ExportAsCd = TRUE; + if (IsWinPEBoot) Input->Options.NoDriveLetter = TRUE; + } + // // Validate the disk type // if ((Input->Options.ExportAsCd) && (DiskType != RAMDISK_BOOT_DISK)) { - // - // If the type isn't CDFS, it has to at least be raw CD - // - if (DiskType != RAMDISK_MEMORY_MAPPED_DISK) return STATUS_INVALID_PARAMETER; - } - + // + // If the type isn't CDFS, it has to at least be raw CD + // + if (DiskType != RAMDISK_MEMORY_MAPPED_DISK) return STATUS_INVALID_PARAMETER; + } + // // Check if this is an actual file // if (DiskType <= RAMDISK_MEMORY_MAPPED_DISK) { - // - // Validate the file name - // - FileNameStart = (PWCHAR)((ULONG_PTR)Input + Length); - FileNameEnd = Input->FileName + 1; - while ((FileNameEnd < FileNameStart) && *(FileNameEnd)) FileNameEnd++; - if (FileNameEnd == FileNameStart) return STATUS_INVALID_PARAMETER; - } - + // + // Validate the file name + // + FileNameStart = (PWCHAR)((ULONG_PTR)Input + Length); + FileNameEnd = Input->FileName + 1; + while ((FileNameEnd < FileNameStart) && *(FileNameEnd)) FileNameEnd++; + if (FileNameEnd == FileNameStart) return STATUS_INVALID_PARAMETER; + } + // // Create the actual device // Status = RamdiskCreateDiskDevice(DeviceExtension, - Input, + Input, ValidateOnly, &DriveExtension); if (NT_SUCCESS(Status)) { - // - // Invalidate and set success - // - IoInvalidateDeviceRelations(DeviceExtension->PhysicalDeviceObject, 0); - Irp->IoStatus.Information = STATUS_SUCCESS; - } - + // + // Invalidate and set success + // + IoInvalidateDeviceRelations(DeviceExtension->PhysicalDeviceObject, 0); + Irp->IoStatus.Information = STATUS_SUCCESS; + } + // // We're done // @@ -897,7 +897,7 @@ LARGE_INTEGER Zero = {{0, 0}}; ULONG Length; PIO_STACK_LOCATION IoStackLocation; - + // // Validate the length // @@ -913,7 +913,7 @@ Irp->IoStatus.Information = 0; return Status; } - + // // Map the partition table // @@ -928,7 +928,7 @@ Irp->IoStatus.Information = 0; return Status; } - + // // Fill out the information // @@ -951,7 +951,7 @@ // Unmap the partition table // RamdiskUnmapPages(DeviceExtension, BaseAddress, Zero, Length); - + // // Done // @@ -1020,17 +1020,17 @@ NTSTATUS Status; PIO_STACK_LOCATION IoStackLocation; PIRP Irp = Context; - + // // Get the stack location // IoStackLocation = IoGetCurrentIrpStackLocation(Irp); - + // // Free the work item // IoFreeWorkItem(Irp->Tail.Overlay.DriverContext[0]); - + // // Grab the device extension and lock it // @@ -1047,7 +1047,7 @@ // Device control // case IRP_MJ_DEVICE_CONTROL: - + { // // Let's take a look at the IOCTL // @@ -1057,61 +1057,60 @@ // Ramdisk create request // case FSCTL_CREATE_RAM_DISK: - + { // // This time we'll do it for real // Status = RamdiskCreateRamdisk(DeviceObject, Irp, FALSE); break; - + } + case IOCTL_DISK_SET_PARTITION_INFO: - + { Status = RamdiskSetPartitionInfo(Irp, (PRAMDISK_DRIVE_EXTENSION)DeviceExtension); break; + } case IOCTL_DISK_GET_DRIVE_LAYOUT: - UNIMPLEMENTED_DBGBREAK("Get drive layout request\n"); break; - + case IOCTL_DISK_GET_PARTITION_INFO: - + { Status = RamdiskGetPartitionInfo(Irp, (PRAMDISK_DRIVE_EXTENSION)DeviceExtension); break; + } default: - UNIMPLEMENTED_DBGBREAK("Invalid request\n"); break; } - + // // We're here // break; - + } + // // Read or write request // case IRP_MJ_READ: case IRP_MJ_WRITE: - UNIMPLEMENTED_DBGBREAK("Read/Write request\n"); break; - + // // Internal request (SCSI?) // case IRP_MJ_INTERNAL_DEVICE_CONTROL: - UNIMPLEMENTED_DBGBREAK("SCSI request\n"); break; - + // // Flush request // case IRP_MJ_FLUSH_BUFFERS: - UNIMPLEMENTED_DBGBREAK("Flush request\n"); break; @@ -1119,11 +1118,10 @@ // Anything else // default: - UNIMPLEMENTED_DBGBREAK("Invalid request: %lx\n", IoStackLocation->MajorFunction); break; } - + // // Complete the I/O // @@ -1133,7 +1131,7 @@ IoCompleteRequest(Irp, IO_DISK_INCREMENT); return; } - + // // Fail the I/O // @@ -1148,12 +1146,12 @@ IN PIRP Irp) { PIO_WORKITEM WorkItem; - + // // Mark the IRP pending // IoMarkIrpPending(Irp); - + // // Allocate a work item // @@ -1188,7 +1186,7 @@ ULONG BytesRead, BytesLeft, CopyLength; PVOID Source, Destination; NTSTATUS Status; - + // // Get the MDL and check if it's mapped // @@ -1209,21 +1207,21 @@ 0, MmCached, NULL, - 0, + 0, NormalPagePriority); } - + // // Make sure we were able to map it // CurrentBase = SystemVa; if (!SystemVa) return STATUS_INSUFFICIENT_RESOURCES; - + // // Initialize default // Irp->IoStatus.Information = 0; - + // // Get the I/O Stack Location and capture the data // @@ -1231,7 +1229,7 @@ CurrentOffset = IoStackLocation->Parameters.Read.ByteOffset; BytesLeft = IoStackLocation->Parameters.Read.Length; if (!BytesLeft) return STATUS_INVALID_PARAMETER; - + // // Do the copy loop // @@ -1245,13 +1243,13 @@ BytesLeft, &BytesRead); if (!BaseAddress) return STATUS_INSUFFICIENT_RESOURCES; - + // // Update our lengths // Irp->IoStatus.Information += BytesRead; CopyLength = BytesRead; - + // // Check if this was a read or write // @@ -1286,7 +1284,7 @@ BytesLeft = CopyLength; Status = STATUS_INVALID_PARAMETER; } - + // // Unmap the pages // @@ -1294,14 +1292,14 @@ BaseAddress, CurrentOffset, BytesRead); - + // // Update offset and bytes left // BytesLeft -= BytesRead; CurrentOffset.QuadPart += BytesRead; CurrentBase = (PVOID)((ULONG_PTR)CurrentBase + BytesRead); - + // // Check if we're done // @@ -1329,8 +1327,8 @@ IN PIRP Irp) { PRAMDISK_DRIVE_EXTENSION DeviceExtension; - //ULONG Length; - //LARGE_INTEGER ByteOffset; + // ULONG Length; + // LARGE_INTEGER ByteOffset; PIO_STACK_LOCATION IoStackLocation; NTSTATUS Status, ReturnStatus; @@ -1346,22 +1344,22 @@ Status = STATUS_INVALID_DEVICE_REQUEST; goto Complete; } - + // // Capture parameters // IoStackLocation = IoGetCurrentIrpStackLocation(Irp); - //Length = IoStackLocation->Parameters.Read.Length; - //ByteOffset = IoStackLocation->Parameters.Read.ByteOffset; - + // Length = IoStackLocation->Parameters.Read.Length; + // ByteOffset = IoStackLocation->Parameters.Read.ByteOffset; + // // FIXME: Validate offset // - + // // FIXME: Validate sector // - + // // Validate write // @@ -1374,7 +1372,7 @@ Status = STATUS_MEDIA_WRITE_PROTECTED; goto Complete; } - + // // See if we want to do this sync or async // @@ -1386,13 +1384,13 @@ Status = RamdiskReadWriteReal(Irp, DeviceExtension); goto Complete; } - + // // Queue it to the worker // Status = SendIrpToThread(DeviceObject, Irp); ReturnStatus = STATUS_PENDING; - + // // Check if we're pending or not // @@ -1406,7 +1404,7 @@ IoCompleteRequest(Irp, IO_DISK_INCREMENT); ReturnStatus = Status; } - + // // Return to caller // @@ -1425,7 +1423,7 @@ ULONG Information; PCDROM_TOC Toc; PDISK_GEOMETRY DiskGeometry; - + // // Grab the remove lock // @@ -1440,13 +1438,13 @@ IoCompleteRequest(Irp, IO_NO_INCREMENT); return Status; } - + // // Setup some defaults // Status = STATUS_INVALID_DEVICE_REQUEST; Information = 0; - + // // Check if this is an bus device or the drive // @@ -1461,20 +1459,22 @@ // Request to create a ramdisk // case FSCTL_CREATE_RAM_DISK: - + { // // Do it // Status = RamdiskCreateRamdisk(DeviceObject, Irp, TRUE); if (!NT_SUCCESS(Status)) goto CompleteRequest; break; - + } + default: - + { // // We don't handle anything else yet // - UNIMPLEMENTED_DBGBREAK(); + UNIMPLEMENTED_DBGBREAK("IOCTL: %lx\n", IoStackLocation->Parameters.DeviceIoControl.IoControlCode); + } } } else @@ -1488,18 +1488,19 @@ case IOCTL_STORAGE_CHECK_VERIFY: case IOCTL_STORAGE_CHECK_VERIFY2: case IOCTL_CDROM_CHECK_VERIFY: - + { // // Just pretend it's OK, don't do more // Status = STATUS_SUCCESS; break; + } case IOCTL_STORAGE_GET_MEDIA_TYPES: case IOCTL_DISK_GET_MEDIA_TYPES: case IOCTL_DISK_GET_DRIVE_GEOMETRY: case IOCTL_CDROM_GET_DRIVE_GEOMETRY: - + { // // Validate the length // @@ -1512,7 +1513,7 @@ Status = STATUS_BUFFER_TOO_SMALL; break; } - + // // Fill it out // @@ -1523,16 +1524,17 @@ DiskGeometry->TracksPerCylinder = DriveExtension->NumberOfHeads; DiskGeometry->MediaType = DriveExtension->DiskOptions.Fixed ? FixedMedia : RemovableMedia; - + // // We're done // Status = STATUS_SUCCESS; Information = sizeof(DISK_GEOMETRY); break; - + } + case IOCTL_CDROM_READ_TOC: - + { // // Validate the length // @@ -1545,13 +1547,13 @@ Status = STATUS_BUFFER_TOO_SMALL; break; } - + // // Clear the TOC // Toc = Irp->AssociatedIrp.SystemBuffer; RtlZeroMemory(Toc, sizeof(CDROM_TOC)); - + // // Fill it out // @@ -1562,21 +1564,23 @@ Toc->TrackData[0].Adr = 1; Toc->TrackData[0].Control = TOC_DATA_TRACK; Toc->TrackData[0].TrackNumber = 1; - + // // We're done // Status = STATUS_SUCCESS; Information = RAMDISK_TOC_SIZE; break; - + } + case IOCTL_DISK_SET_PARTITION_INFO: - + { Status = RamdiskSetPartitionInfo(Irp, DriveExtension); break; - + } + case IOCTL_DISK_GET_PARTITION_INFO: - + { // // Validate the length // @@ -1589,7 +1593,7 @@ Status = STATUS_BUFFER_TOO_SMALL; break; } - + // // Check if we need to do this sync or async // @@ -1607,75 +1611,38 @@ // goto CallWorker; } - + // // We're done // Information = Irp->IoStatus.Information; break; - + } + case IOCTL_DISK_GET_DRIVE_LAYOUT: - - UNIMPLEMENTED_DBGBREAK(); + case IOCTL_DISK_GET_LENGTH_INFO: + case IOCTL_DISK_IS_WRITABLE: + case IOCTL_SCSI_MINIPORT: + case IOCTL_STORAGE_QUERY_PROPERTY: + case IOCTL_MOUNTDEV_QUERY_UNIQUE_ID: + case IOCTL_MOUNTDEV_QUERY_STABLE_GUID: + case IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS: + case IOCTL_VOLUME_SET_GPT_ATTRIBUTES: + case IOCTL_VOLUME_GET_GPT_ATTRIBUTES: + case IOCTL_VOLUME_OFFLINE: + { + UNIMPLEMENTED_DBGBREAK("IOCTL: %lx\n", IoStackLocation->Parameters.DeviceIoControl.IoControlCode); break; - - case IOCTL_DISK_GET_LENGTH_INFO: - - UNIMPLEMENTED_DBGBREAK(); + } + + default: + { + // + // Drive code not emulated + // + DPRINT1("IOCTL: %lx\n", IoStackLocation->Parameters.DeviceIoControl.IoControlCode); break; - - case IOCTL_DISK_IS_WRITABLE: - - UNIMPLEMENTED_DBGBREAK(); - break; - - case IOCTL_SCSI_MINIPORT: - - UNIMPLEMENTED_DBGBREAK(); - break; - - case IOCTL_STORAGE_QUERY_PROPERTY: - - UNIMPLEMENTED_DBGBREAK(); - break; - - case IOCTL_MOUNTDEV_QUERY_UNIQUE_ID: - - UNIMPLEMENTED_DBGBREAK(); - break; - - case IOCTL_MOUNTDEV_QUERY_STABLE_GUID: - - UNIMPLEMENTED_DBGBREAK(); - break; - - case IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS: - - UNIMPLEMENTED_DBGBREAK(); - break; - - case IOCTL_VOLUME_SET_GPT_ATTRIBUTES: - - UNIMPLEMENTED_DBGBREAK(); - break; - - case IOCTL_VOLUME_GET_GPT_ATTRIBUTES: - - UNIMPLEMENTED_DBGBREAK(); - break; - - case IOCTL_VOLUME_OFFLINE: - - UNIMPLEMENTED_DBGBREAK(); - break; - - default: - - // - // Drive code not emulated - // - DPRINT1("IOCTL: %lx\n", IoStackLocation->Parameters.DeviceIoControl.IoControlCode); - break; + } } // @@ -1683,13 +1650,13 @@ // goto CompleteRequest; } - + // // Queue the request to our worker thread // CallWorker: Status = SendIrpToThread(DeviceObject, Irp); - + CompleteRequest: // // Release the lock @@ -1704,7 +1671,7 @@ Irp->IoStatus.Information = Information; IoCompleteRequest(Irp, IO_NO_INCREMENT); } - + // // Return status // @@ -1724,7 +1691,7 @@ PLIST_ENTRY ListHead, NextEntry; PDEVICE_OBJECT* DriveDeviceObject; RAMDISK_DEVICE_STATE State; - + // // Get the device extension and check if this is a drive // @@ -1771,18 +1738,18 @@ IoCompleteRequest(Irp, IO_NO_INCREMENT); return Status; } - + // // Anything but bus relations, we don't handle // if (Type != BusRelations) goto PassToNext; - + // // Acquire the disk list lock // KeEnterCriticalRegion(); ExAcquireFastMutex(&DeviceExtension->DiskListLock); - + // // Did a device already fill relations? // @@ -1801,7 +1768,7 @@ // Count = 0; } - + // // Now loop our drives // @@ -1817,18 +1784,18 @@ RAMDISK_DRIVE_EXTENSION, DiskList); if (DriveExtension->State < RamdiskStateBusRemoved) DiskCount++; - + // // Move to the next one // NextEntry = NextEntry->Flink; } - + // // Now we know our final count // FinalCount = Count + DiskCount; - + // // Allocate the structure // @@ -1849,7 +1816,7 @@ IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_INSUFFICIENT_RESOURCES; } - + // // Check if we already had some relations // @@ -1862,12 +1829,12 @@ DeviceRelations->Objects, Count * sizeof(PDEVICE_OBJECT)); } - + // // Save the count // OurDeviceRelations->Count = FinalCount; - + // // Now loop our drives again // @@ -1879,7 +1846,7 @@ // Go to the end of the list // DriveDeviceObject = &OurDeviceRelations->Objects[Count]; - + // // Get the drive state // @@ -1887,7 +1854,7 @@ RAMDISK_DRIVE_EXTENSION, DiskList); State = DriveExtension->State; - + // // If it was removed or enumerated, we don't touch the device object // @@ -1910,15 +1877,15 @@ // First time it's enumerated, reference the device object // ObReferenceObject(DriveExtension->DeviceObject); - + // // Save the object pointer, and move on // *DriveDeviceObject++ = DriveExtension->PhysicalDeviceObject; } - + if (DriveExtension->State < RamdiskStateBusRemoved) DiskCount++; - + // // Move to the next one // @@ -1930,24 +1897,24 @@ // ExReleaseFastMutex(&DeviceExtension->DiskListLock); KeLeaveCriticalRegion(); - + // // Cleanup old relations // if (DeviceRelations) ExFreePool(DeviceRelations); - + // // Complete our IRP // Irp->IoStatus.Information = (ULONG_PTR)OurDeviceRelations; Irp->IoStatus.Status = STATUS_SUCCESS; - + // // Pass to the next driver // PassToNext: IoCopyCurrentIrpStackLocationToNext(Irp); - return IoCallDriver(DeviceExtension->AttachedDevice, Irp); + return IoCallDriver(DeviceExtension->AttachedDevice, Irp); } NTSTATUS @@ -2082,7 +2049,7 @@ switch (IoStackLocation->Parameters.QueryId.IdType) { case BusQueryDeviceID: - + { // // Allocate a buffer long enough to receive Ramdisk\RamDisk in any case // In case we don't have RAMDISK_REGISTRY_DISK, we then need two more @@ -2107,9 +2074,10 @@ } break; + } case BusQueryHardwareIDs: - + { // // Allocate a buffer long enough to receive Ramdisk\RamDisk in any case // In case we don't have RAMDISK_REGISTRY_DISK, we then need two more @@ -2138,9 +2106,10 @@ OutputString[(StringLength / sizeof(WCHAR)) - 1] = UNICODE_NULL; break; + } case BusQueryCompatibleIDs: - + { if (DriveExtension->DiskType != RAMDISK_REGISTRY_DISK) { Status = STATUS_INVALID_DEVICE_REQUEST; @@ -2159,9 +2128,10 @@ OutputString[(StringLength / sizeof(WCHAR)) - 1] = UNICODE_NULL; break; + } case BusQueryInstanceID: - + { OutputString = ExAllocatePoolWithTag(PagedPool, DriveExtension->GuidString.MaximumLength, 'dmaR'); if (OutputString == NULL) { @@ -2172,14 +2142,15 @@ wcsncpy(OutputString, DriveExtension->GuidString.Buffer, DriveExtension->GuidString.MaximumLength / sizeof(WCHAR)); break; + } case BusQueryDeviceSerialNumber: - + { // // Nothing to do // - break; + } } Irp->IoStatus.Status = Status; @@ -2248,7 +2219,7 @@ switch (DeviceTextType) { case DeviceTextDescription: - + { OutputString = ExAllocatePoolWithTag(PagedPool, sizeof(L"RamDisk"), 'dmaR'); if (OutputString == NULL) { @@ -2259,9 +2230,10 @@ wcsncpy(OutputString, L"RamDisk", sizeof(L"RamDisk") / sizeof(WCHAR)); break; + } case DeviceTextLocationInformation: - + { OutputString = ExAllocatePoolWithTag(PagedPool, sizeof(L"RamDisk\\0"), 'dmaR'); if (OutputString == NULL) { @@ -2272,6 +2244,7 @@ wcsncpy(OutputString, L"RamDisk\\0", sizeof(L"RamDisk\\0") / sizeof(WCHAR)); break; + } } Irp->IoStatus.Status = Status; @@ -2344,7 +2317,7 @@ DeviceExtension = DeviceObject->DeviceExtension; IoStackLocation = IoGetCurrentIrpStackLocation(Irp); Minor = IoStackLocation->MinorFunction; - + // // Check if the bus is removed // @@ -2364,7 +2337,7 @@ return Status; } } - + // // Acquire the remove lock // @@ -2379,14 +2352,14 @@ IoCompleteRequest(Irp, IO_NO_INCREMENT); return Status; } - + // // Query the IRP type // switch (Minor) { case IRP_MN_START_DEVICE: - + { if (DeviceExtension->Type == RamdiskDrive) { ULONG ResultLength; @@ -2493,34 +2466,20 @@ Irp->IoStatus.Status = Status; break; - + } + case IRP_MN_QUERY_STOP_DEVICE: - + case IRP_MN_CANCEL_STOP_DEVICE: + case IRP_MN_STOP_DEVICE: + case IRP_MN_QUERY_REMOVE_DEVICE: + case IRP_MN_CANCEL_REMOVE_DEVICE: + { UNIMPLEMENTED_DBGBREAK("PnP IRP: %lx\n", Minor); break; - - case IRP_MN_CANCEL_STOP_DEVICE: - - UNIMPLEMENTED_DBGBREAK("PnP IRP: %lx\n", Minor); - break; - - case IRP_MN_STOP_DEVICE: - - UNIMPLEMENTED_DBGBREAK("PnP IRP: %lx\n", Minor); - break; - - case IRP_MN_QUERY_REMOVE_DEVICE: - - UNIMPLEMENTED_DBGBREAK("PnP IRP: %lx\n", Minor); - break; - - case IRP_MN_CANCEL_REMOVE_DEVICE: - - UNIMPLEMENTED_DBGBREAK("PnP IRP: %lx\n", Minor); - break; - + } + case IRP_MN_REMOVE_DEVICE: - + { // // Remove the proper device // @@ -2547,14 +2506,14 @@ IoCompleteRequest(Irp, IO_NO_INCREMENT); return Status; } + } case IRP_MN_SURPRISE_REMOVAL: - UNIMPLEMENTED_DBGBREAK("PnP IRP: %lx\n", Minor); break; - + case IRP_MN_QUERY_ID: - + { // // Are we a drive? // @@ -2563,9 +2522,10 @@ Status = RamdiskQueryId((PRAMDISK_DRIVE_EXTENSION)DeviceExtension, Irp); } break; - + } + case IRP_MN_QUERY_BUS_INFORMATION: - + { // // Are we a drive? // @@ -2574,14 +2534,14 @@ Status = RamdiskQueryBusInformation(DeviceObject, Irp); } break; - + } + case IRP_MN_EJECT: - UNIMPLEMENTED_DBGBREAK("PnP IRP: %lx\n", Minor); break; - + case IRP_MN_QUERY_DEVICE_TEXT: - + { // // Are we a drive? // @@ -2590,9 +2550,10 @@ Status = RamdiskQueryDeviceText((PRAMDISK_DRIVE_EXTENSION)DeviceExtension, Irp); } break; - + } + case IRP_MN_QUERY_DEVICE_RELATIONS: - + { // // Call our main routine // @@ -2602,9 +2563,10 @@ DeviceObject, Irp); goto ReleaseAndReturn; - + } + case IRP_MN_QUERY_CAPABILITIES: - + { // // Are we a drive? // @@ -2613,22 +2575,23 @@ Status = RamdiskQueryCapabilities(DeviceObject, Irp); } break; - + } + case IRP_MN_QUERY_RESOURCES: case IRP_MN_QUERY_RESOURCE_REQUIREMENTS: - + { // // Complete immediately without touching it // IoCompleteRequest(Irp, IO_NO_INCREMENT); goto ReleaseAndReturn; - + } + default: - DPRINT1("Illegal IRP: %lx\n", Minor); break; } - + // // Are we the bus? // @@ -2646,7 +2609,7 @@ Status = IoCallDriver(DeviceExtension->AttachedDevice, Irp); } } - + // // Release the lock and return status // @@ -2702,6 +2665,7 @@ switch (IoStackLocation->MinorFunction) { case IRP_MN_SET_POWER: + { // // If setting device power state // it's all fine and return success @@ -2718,8 +2682,10 @@ PoStartNextPowerIrp(Irp); IoCompleteRequest(Irp, IO_NO_INCREMENT); break; + } case IRP_MN_QUERY_POWER: + { // // We can obviously accept all states // So just return success @@ -2729,8 +2695,10 @@ PoStartNextPowerIrp(Irp); IoCompleteRequest(Irp, IO_NO_INCREMENT); break; + } default: + { // // Just complete and save status for return // @@ -2738,6 +2706,7 @@ PoStartNextPowerIrp(Irp); IoCompleteRequest(Irp, IO_NO_INCREMENT); break; + } } return Status; @@ -2884,20 +2853,20 @@ NTSTATUS NTAPI -RamdiskAddDevice(IN PDRIVER_OBJECT DriverObject, +RamdiskAddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PhysicalDeviceObject) { PRAMDISK_BUS_EXTENSION DeviceExtension; PDEVICE_OBJECT AttachedDevice; - NTSTATUS Status; + NTSTATUS Status; UNICODE_STRING DeviceName; PDEVICE_OBJECT DeviceObject; - + // // Only create the bus FDO once // if (RamdiskBusFdo) return STATUS_DEVICE_ALREADY_ATTACHED; - + // // Create the bus FDO // @@ -2911,34 +2880,34 @@ &DeviceObject); if (NT_SUCCESS(Status)) { - // - // Initialize the bus FDO extension - // + // + // Initialize the bus FDO extension + // DeviceExtension = DeviceObject->DeviceExtension; RtlZeroMemory(DeviceObject->DeviceExtension, sizeof(RAMDISK_BUS_EXTENSION)); - - // - // Set bus FDO flags - // + + // + // Set bus FDO flags + // DeviceObject->Flags |= DO_POWER_PAGABLE | DO_DIRECT_IO; - - // - // Setup the bus FDO extension - // + + // + // Setup the bus FDO extension + // DeviceExtension->Type = RamdiskBus; - ExInitializeFastMutex(&DeviceExtension->DiskListLock); + ExInitializeFastMutex(&DeviceExtension->DiskListLock); IoInitializeRemoveLock(&DeviceExtension->RemoveLock, 'dmaR', 1, 0); - InitializeListHead(&DeviceExtension->DiskList); + InitializeListHead(&DeviceExtension->DiskList); DeviceExtension->PhysicalDeviceObject = PhysicalDeviceObject; DeviceExtension->DeviceObject = DeviceObject; - - // - // Register the RAM disk device interface - // + + // + // Register the RAM disk device interface + // Status = IoRegisterDeviceInterface(PhysicalDeviceObject, &RamdiskBusInterface, NULL, @@ -2951,47 +2920,49 @@ IoDeleteDevice(DeviceObject); return Status; } - - // - // Attach us to the device stack - // + + // + // Attach us to the device stack + // AttachedDevice = IoAttachDeviceToDeviceStack(DeviceObject, PhysicalDeviceObject); DeviceExtension->AttachedDevice = AttachedDevice; if (!AttachedDevice) { - // - // Fail - // - IoSetDeviceInterfaceState(&DeviceExtension->BusDeviceName, 0); - RtlFreeUnicodeString(&DeviceExtension->BusDeviceName); - IoDeleteDevice(DeviceObject); - return STATUS_NO_SUCH_DEVICE; - } - - // - // Bus FDO is initialized - // + // + // Fail + // + IoSetDeviceInterfaceState(&DeviceExtension->BusDeviceName, 0); + RtlFreeUnicodeString(&DeviceExtension->BusDeviceName); + IoDeleteDevice(DeviceObject); + return STATUS_NO_SUCH_DEVICE; + } + + // + // Bus FDO is initialized + // RamdiskBusFdo = DeviceObject; - - // - // Loop for loader block - // + + // + // Loop for loader block + // if (KeLoaderBlock) { - // - // Are we being booted from setup? Not yet supported - // - //ASSERT(!KeLoaderBlock->SetupLdrBlock); - } - - // - // All done - // + // + // Are we being booted from setup? Not yet supported + // + if (KeLoaderBlock->SetupLdrBlock) + DPRINT1("FIXME: RamdiskAddDevice unsupported when being started from SETUPLDR!\n"); + // ASSERT(!KeLoaderBlock->SetupLdrBlock); + } + + // + // All done + // DeviceObject->Flags &= DO_DEVICE_INITIALIZING; Status = STATUS_SUCCESS; } - + // // Return status // @@ -3007,12 +2978,12 @@ PDEVICE_OBJECT PhysicalDeviceObject = NULL; NTSTATUS Status; DPRINT("RAM Disk Driver Initialized\n"); - + // // Query ramdisk parameters // QueryParameters(RegistryPath); - + // // Save the registry path // @@ -3023,7 +2994,7 @@ 'dmaR'); if (!DriverRegistryPath.Buffer) return STATUS_INSUFFICIENT_RESOURCES; RtlCopyUnicodeString(&DriverRegistryPath, RegistryPath); - + // // Set device routines // @@ -3039,7 +3010,7 @@ DriverObject->MajorFunction[IRP_MJ_FLUSH_BUFFERS] = RamdiskFlushBuffers; DriverObject->DriverExtension->AddDevice = RamdiskAddDevice; DriverObject->DriverUnload = RamdiskUnload; - + // // Check for a loader block // @@ -3061,7 +3032,7 @@ // We'll have to tell the PnP Manager // ReportDetectedDevice = TRUE; - + // // Check for a command line // @@ -3078,7 +3049,7 @@ // ExportBootDiskAsCd = TRUE; } - + // // Check if this is PE boot // @@ -3091,15 +3062,17 @@ } } } - - } - } - + + } + } + // // Installing from Ramdisk isn't supported yet // - //ASSERT(!KeLoaderBlock->SetupLdrBlock); - + if (KeLoaderBlock->SetupLdrBlock) + DPRINT1("FIXME: Installing from RamDisk is UNSUPPORTED!\n"); + // ASSERT(!KeLoaderBlock->SetupLdrBlock); + // // Are we reporting the device // @@ -3117,7 +3090,7 @@ 0, &PhysicalDeviceObject); if (NT_SUCCESS(Status)) - { + { // // Create the device object //
9 years, 11 months
1
0
0
0
[hbelusca] 66012: [INSTALL_FREELDR] Instead of keeping binary C arrays for FAT bootsectors (that by the way were completely out of date and were broken) in header files, just generate them out of o...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Fri Jan 9 00:12:51 2015 New Revision: 66012 URL:
http://svn.reactos.org/svn/reactos?rev=66012&view=rev
Log: [INSTALL_FREELDR] Instead of keeping binary C arrays for FAT bootsectors (that by the way were completely out of date and were broken) in header files, just generate them out of our ASM-compiled bootsectors, with bin2c (as we do for PCI data for the HAL) and use them instead! So now we can use installfreeldr.exe to install e.g. a correct bootsector on a USB key that will work for loading freeldr! (and thus get rid of the Syslinux hack I presented in my video). Removed: trunk/reactos/boot/freeldr/bootsect/fat.h trunk/reactos/boot/freeldr/bootsect/fat32.h Modified: trunk/reactos/boot/freeldr/install/CMakeLists.txt trunk/reactos/boot/freeldr/install/install.c Removed: trunk/reactos/boot/freeldr/bootsect/fat.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/bootsect/fat.…
============================================================================== --- trunk/reactos/boot/freeldr/bootsect/fat.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/bootsect/fat.h (removed) @@ -1,35 +0,0 @@ -unsigned char fat_data[] = { - -0xeb, 0x3c, 0x90, 0x46, 0x72, 0x4c, 0x64, 0x72, 0x31, 0x2e, 0x30, 0x00, 0x02, 0x01, 0x01, 0x00, -0x02, 0xe0, 0x00, 0x40, 0x0b, 0xf0, 0x09, 0x00, 0x12, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x4f, 0x20, 0x4e, 0x41, -0x4d, 0x45, 0x20, 0x20, 0x20, 0x20, 0x46, 0x41, 0x54, 0x31, 0x32, 0x20, 0x20, 0x20, 0x31, 0xc0, -0x8e, 0xd0, 0xbd, 0x00, 0x7c, 0xbc, 0xf2, 0x7b, 0x8e, 0xd8, 0x8e, 0xc0, 0x80, 0x7e, 0x24, 0xff, -0x75, 0x03, 0x88, 0x56, 0x24, 0xb4, 0x08, 0x8a, 0x56, 0x24, 0xcd, 0x13, 0x73, 0x05, 0xb9, 0xff, -0xff, 0x88, 0xce, 0x88, 0xeb, 0x88, 0xcf, 0xc0, 0xef, 0x06, 0x80, 0xe1, 0x3f, 0x66, 0x0f, 0xb6, -0xc6, 0x66, 0x0f, 0xb7, 0xdb, 0x66, 0x0f, 0xb6, 0xc9, 0x66, 0x40, 0x66, 0x43, 0x66, 0xf7, 0xe1, -0x66, 0xf7, 0xe3, 0x66, 0x89, 0x46, 0xf8, 0x31, 0xc0, 0x31, 0xc9, 0x8a, 0x46, 0x10, 0xf7, 0x66, -0x16, 0x03, 0x46, 0x1c, 0x13, 0x56, 0x1e, 0x03, 0x46, 0x0e, 0x11, 0xca, 0x89, 0x46, 0xfc, 0x89, -0x56, 0xfe, 0x8b, 0x76, 0x11, 0x60, 0x31, 0xd2, 0xb8, 0x20, 0x00, 0xf7, 0xe6, 0x8b, 0x5e, 0x0b, -0x01, 0xd8, 0x48, 0xf7, 0xf3, 0x01, 0x46, 0xfc, 0x11, 0x4e, 0xfe, 0x61, 0xbb, 0xe0, 0x07, 0x8e, -0xc3, 0x31, 0xdb, 0x31, 0xc9, 0x41, 0x31, 0xff, 0x06, 0xe8, 0x78, 0x00, 0x07, 0x26, 0x38, 0x2d, -0x74, 0x38, 0x60, 0xb1, 0x0b, 0xbe, 0xef, 0x7d, 0xf3, 0xa6, 0x61, 0x74, 0x0e, 0x4e, 0x74, 0x2a, -0x83, 0xc7, 0x20, 0x81, 0xff, 0x00, 0x02, 0x72, 0xe4, 0xeb, 0xd1, 0x26, 0x8b, 0x45, 0x1a, 0x50, -0x68, 0x00, 0x08, 0x07, 0xe8, 0x3c, 0x00, 0x58, 0xc7, 0x46, 0xf6, 0x44, 0x7d, 0xc7, 0x46, 0xf4, -0x33, 0x7d, 0xc7, 0x46, 0xf2, 0x1c, 0x7d, 0xe9, 0xf9, 0x02, 0xbe, 0xc7, 0x7d, 0xe8, 0x0c, 0x00, -0xbe, 0xdf, 0x7d, 0xe8, 0x06, 0x00, 0x31, 0xc0, 0xcd, 0x16, 0xcd, 0x19, 0xac, 0x08, 0xc0, 0x74, -0x09, 0xb4, 0x0e, 0xbb, 0x07, 0x00, 0xcd, 0x10, 0xeb, 0xf2, 0xc3, 0xbe, 0xba, 0x7d, 0xe8, 0xeb, -0xff, 0xeb, 0xdd, 0x48, 0x48, 0x30, 0xed, 0x8a, 0x4e, 0x0d, 0xf7, 0xe1, 0x03, 0x46, 0xfc, 0x13, -0x56, 0xfe, 0x31, 0xdb, 0x60, 0x49, 0x01, 0xc8, 0x83, 0xd2, 0x00, 0x3b, 0x56, 0xfa, 0x77, 0x07, -0x72, 0x31, 0x3b, 0x46, 0xf8, 0x76, 0x2c, 0x61, 0x60, 0x66, 0x6a, 0x00, 0x52, 0x50, 0x06, 0x53, -0x6a, 0x01, 0x6a, 0x10, 0x89, 0xe6, 0x8a, 0x56, 0x24, 0xb4, 0x42, 0xcd, 0x13, 0x72, 0xbc, 0x83, -0xc4, 0x10, 0x61, 0x40, 0x83, 0xd2, 0x00, 0x53, 0x8c, 0xc3, 0x83, 0xc3, 0x20, 0x8e, 0xc3, 0x5b, -0xe2, 0xd6, 0xc3, 0x61, 0x60, 0x91, 0x92, 0x31, 0xd2, 0xf7, 0x76, 0x18, 0x91, 0xf7, 0x76, 0x18, -0x42, 0x87, 0xca, 0xf7, 0x76, 0x1a, 0x88, 0xd6, 0x8a, 0x56, 0x24, 0x88, 0xc5, 0xc0, 0xcc, 0x02, -0x08, 0xe1, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0x72, 0x82, 0x61, 0x40, 0x75, 0x01, 0x42, 0x53, 0x8c, -0xc3, 0x83, 0xc3, 0x20, 0x8e, 0xc3, 0x5b, 0xe2, 0xcb, 0xc3, 0x44, 0x69, 0x73, 0x6b, 0x20, 0x65, -0x72, 0x72, 0x6f, 0x72, 0x0d, 0x0a, 0x00, 0x66, 0x72, 0x65, 0x65, 0x6c, 0x64, 0x72, 0x2e, 0x73, -0x79, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x0d, 0x0a, 0x00, 0x50, -0x72, 0x65, 0x73, 0x73, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x0d, 0x0a, 0x00, 0x46, -0x52, 0x45, 0x45, 0x4c, 0x44, 0x52, 0x20, 0x53, 0x59, 0x53, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa -}; Removed: trunk/reactos/boot/freeldr/bootsect/fat32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/bootsect/fat3…
============================================================================== --- trunk/reactos/boot/freeldr/bootsect/fat32.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/bootsect/fat32.h (removed) @@ -1,67 +0,0 @@ -unsigned char fat32_data[] = { - -0xeb, 0x58, 0x90, 0x46, 0x72, 0x4c, 0x64, 0x72, 0x31, 0x2e, 0x30, 0x00, 0x02, 0x00, 0x20, 0x00, -0x02, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x4f, 0x20, 0x4e, 0x41, 0x4d, 0x45, 0x20, 0x20, -0x20, 0x20, 0x46, 0x41, 0x54, 0x33, 0x32, 0x20, 0x20, 0x20, 0x31, 0xc0, 0x8e, 0xd8, 0x8e, 0xc0, -0x8e, 0xd0, 0xbd, 0x00, 0x7c, 0xbc, 0x00, 0x7c, 0x80, 0x7e, 0x40, 0xff, 0x75, 0x03, 0x88, 0x56, -0x40, 0x83, 0x7e, 0x16, 0x00, 0x75, 0x0d, 0x66, 0x83, 0x7e, 0x11, 0x00, 0x75, 0x06, 0x83, 0x7e, -0x2a, 0x00, 0x76, 0x03, 0xe9, 0xff, 0x00, 0xb8, 0x00, 0x08, 0x8a, 0x56, 0x40, 0xcd, 0x13, 0x73, -0x05, 0xb9, 0xff, 0xff, 0x88, 0xce, 0x88, 0xeb, 0x88, 0xcf, 0xc0, 0xef, 0x06, 0x80, 0xe1, 0x3f, -0x66, 0x0f, 0xb6, 0xc6, 0x66, 0x0f, 0xb7, 0xdb, 0x66, 0x0f, 0xb6, 0xc9, 0x66, 0x40, 0x66, 0x43, -0x66, 0xf7, 0xe1, 0x66, 0xf7, 0xe3, 0x66, 0xa3, 0xa7, 0x7d, 0x66, 0xb8, 0x0e, 0x00, 0x00, 0x00, -0x66, 0x03, 0x46, 0x1c, 0xb9, 0x01, 0x00, 0x31, 0xdb, 0x8e, 0xc3, 0xbb, 0x00, 0x7e, 0xe8, 0x03, -0x00, 0xe9, 0x2c, 0x01, 0x66, 0x3b, 0x06, 0xa7, 0x7d, 0x73, 0x1b, 0x66, 0x60, 0xb4, 0x41, 0xbb, -0xaa, 0x55, 0x8a, 0x56, 0x40, 0xcd, 0x13, 0x72, 0x55, 0x81, 0xfb, 0x55, 0xaa, 0x75, 0x4f, 0xf6, -0xc1, 0x01, 0x74, 0x4a, 0x66, 0x61, 0x66, 0x60, 0x81, 0xf9, 0x40, 0x00, 0x76, 0x03, 0xb9, 0x40, -0x00, 0x89, 0x0e, 0x3a, 0x7d, 0x66, 0x6a, 0x00, 0x66, 0x50, 0x06, 0x53, 0x51, 0x6a, 0x10, 0x89, -0xe6, 0x8a, 0x56, 0x40, 0xb4, 0x42, 0xcd, 0x13, 0x72, 0x63, 0x83, 0xc4, 0x10, 0x66, 0x61, 0x53, -0x66, 0x8b, 0x1e, 0x3a, 0x7d, 0x66, 0x01, 0xd8, 0x66, 0xc1, 0xe3, 0x05, 0x8c, 0xc2, 0x01, 0xda, -0x8e, 0xc2, 0x5b, 0x2b, 0x0e, 0x3a, 0x7d, 0x75, 0xbd, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x66, 0x61, -0x66, 0x60, 0x66, 0x31, 0xd2, 0x66, 0x0f, 0xb7, 0x4e, 0x18, 0x66, 0xf7, 0xf1, 0xfe, 0xc2, 0x88, -0xd1, 0x66, 0x89, 0xc2, 0x66, 0xc1, 0xea, 0x10, 0xf7, 0x76, 0x1a, 0x88, 0xd6, 0x8a, 0x56, 0x40, -0x88, 0xc5, 0xd0, 0xcc, 0xd0, 0xcc, 0x08, 0xe1, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0x72, 0x0e, 0x66, -0x61, 0x66, 0x40, 0x8c, 0xc2, 0x83, 0xc2, 0x20, 0x8e, 0xc2, 0xe2, 0xc4, 0xc3, 0xbe, 0xab, 0x7d, -0xe8, 0x15, 0x00, 0xe9, 0x06, 0x00, 0xbe, 0xb8, 0x7d, 0xe8, 0x0c, 0x00, 0xbe, 0xcc, 0x7d, 0xe8, -0x06, 0x00, 0x31, 0xc0, 0xcd, 0x16, 0xcd, 0x19, 0xac, 0x08, 0xc0, 0x74, 0x09, 0xb4, 0x0e, 0xbb, -0x07, 0x00, 0xcd, 0x10, 0xeb, 0xf2, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x44, 0x69, 0x73, 0x6b, 0x20, -0x65, 0x72, 0x72, 0x6f, 0x72, 0x0d, 0x0a, 0x00, 0x46, 0x69, 0x6c, 0x65, 0x20, 0x73, 0x79, 0x73, -0x74, 0x65, 0x6d, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x0d, 0x0a, 0x00, 0x50, 0x72, 0x65, 0x73, -0x73, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65, 0x73, -0x74, 0x61, 0x72, 0x74, 0x0d, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa, -0x66, 0x8b, 0x46, 0x2c, 0x66, 0x3d, 0xf8, 0xff, 0xff, 0x0f, 0x72, 0x03, 0xe9, 0x67, 0x01, 0xbb, -0x00, 0x20, 0x8e, 0xc3, 0xe8, 0x27, 0x01, 0x31, 0xdb, 0x8a, 0x5e, 0x0d, 0xc1, 0xe3, 0x04, 0xb8, -0x00, 0x20, 0x8e, 0xc0, 0x31, 0xff, 0xbe, 0x9d, 0x7f, 0xb9, 0x0b, 0x00, 0xf3, 0xa6, 0x74, 0x2a, -0x4b, 0x75, 0x03, 0xe9, 0x40, 0x01, 0x8c, 0xc0, 0x05, 0x02, 0x00, 0x8e, 0xc0, 0x31, 0xff, 0xbe, -0x9d, 0x7f, 0xb9, 0x0b, 0x00, 0xf3, 0xa6, 0x74, 0x11, 0x4b, 0x75, 0xea, 0x66, 0x8b, 0x46, 0x2c, -0xe8, 0x6f, 0x00, 0x66, 0x89, 0x46, 0x2c, 0xe9, 0xa6, 0xff, 0xbe, 0xa8, 0x7f, 0xe8, 0x38, 0xff, -0x31, 0xff, 0x31, 0xd2, 0x26, 0x8b, 0x45, 0x14, 0x66, 0xc1, 0xe0, 0x10, 0x26, 0x8b, 0x45, 0x1a, -0x66, 0x3d, 0x02, 0x00, 0x00, 0x00, 0x73, 0x03, 0xe9, 0x0b, 0xff, 0x66, 0x3d, 0xf8, 0xff, 0xff, -0x0f, 0x72, 0x03, 0xe9, 0x00, 0xff, 0xbb, 0x00, 0x08, 0x8e, 0xc3, 0x66, 0x3d, 0xf8, 0xff, 0xff, -0x0f, 0x73, 0x21, 0x66, 0x50, 0x31, 0xdb, 0x06, 0xe8, 0xa3, 0x00, 0x07, 0x31, 0xdb, 0x8a, 0x5e, -0x0d, 0xc1, 0xe3, 0x05, 0x8c, 0xc0, 0x01, 0xd8, 0x8e, 0xc0, 0x66, 0x58, 0x06, 0xe8, 0x12, 0x00, -0x07, 0xe9, 0xd7, 0xff, 0x8a, 0x56, 0x40, 0x8a, 0x36, 0xfd, 0x7d, 0x31, 0xc0, 0x50, 0x68, 0x00, -0x80, 0xcb, 0x66, 0xc1, 0xe0, 0x02, 0x66, 0x89, 0xc1, 0x66, 0x31, 0xd2, 0x66, 0x0f, 0xb7, 0x5e, -0x0b, 0x66, 0x53, 0x66, 0xf7, 0xf3, 0x66, 0x0f, 0xb7, 0x5e, 0x0e, 0x66, 0x01, 0xd8, 0x66, 0x8b, -0x5e, 0x1c, 0x66, 0x01, 0xd8, 0x66, 0x5b, 0x66, 0x4b, 0x66, 0x21, 0xd9, 0x66, 0x0f, 0xb7, 0x5e, -0x28, 0x81, 0xe3, 0x0f, 0x00, 0x74, 0x16, 0x3a, 0x5e, 0x10, 0x72, 0x03, 0xe9, 0x87, 0xfe, 0x66, -0x50, 0x66, 0x8b, 0x46, 0x24, 0x66, 0xf7, 0xe3, 0x66, 0x5a, 0x66, 0x01, 0xd0, 0x66, 0x51, 0x66, -0x3b, 0x06, 0x3a, 0x7f, 0x74, 0x11, 0x66, 0xa3, 0x3a, 0x7f, 0xbb, 0x00, 0x70, 0x8e, 0xc3, 0x31, -0xdb, 0xb9, 0x01, 0x00, 0xe8, 0xad, 0xfd, 0xbb, 0x00, 0x70, 0x8e, 0xc3, 0x66, 0x59, 0x26, 0x66, -0x67, 0x8b, 0x01, 0x66, 0x25, 0xff, 0xff, 0xff, 0x0f, 0xc3, 0xff, 0xff, 0xff, 0xff, 0x66, 0x48, -0x66, 0x48, 0x66, 0x31, 0xd2, 0x66, 0x0f, 0xb6, 0x5e, 0x0d, 0x66, 0xf7, 0xe3, 0x66, 0x50, 0x66, -0x31, 0xd2, 0x66, 0x0f, 0xb6, 0x46, 0x10, 0x66, 0xf7, 0x66, 0x24, 0x66, 0x0f, 0xb7, 0x5e, 0x0e, -0x66, 0x01, 0xd8, 0x66, 0x03, 0x46, 0x1c, 0x66, 0x5b, 0x66, 0x01, 0xd8, 0x31, 0xdb, 0x0f, 0xb6, -0x4e, 0x0d, 0xe8, 0x5f, 0xfd, 0xc3, 0xbe, 0x85, 0x7f, 0xe8, 0x1c, 0xfe, 0xbe, 0xcc, 0x7d, 0xe8, -0x16, 0xfe, 0xe9, 0x07, 0xfe, 0x66, 0x72, 0x65, 0x65, 0x6c, 0x64, 0x72, 0x2e, 0x73, 0x79, 0x73, -0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x0d, 0x0a, 0x00, 0x46, 0x52, 0x45, -0x45, 0x4c, 0x44, 0x52, 0x20, 0x53, 0x59, 0x53, 0x4c, 0x6f, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x20, -0x46, 0x72, 0x65, 0x65, 0x4c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x2e, 0x2e, 0x0d, 0x0a, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa -}; Modified: trunk/reactos/boot/freeldr/install/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/install/CMake…
============================================================================== --- trunk/reactos/boot/freeldr/install/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/install/CMakeLists.txt [iso-8859-1] Fri Jan 9 00:12:51 2015 @@ -1,7 +1,23 @@ + +##################################### +# Generate the FAT bootsector source files +# +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/fat.c ${CMAKE_CURRENT_BINARY_DIR}/fat.h + COMMAND native-bin2c ${CMAKE_CURRENT_BINARY_DIR}/../bootsect/fat.bin ${CMAKE_CURRENT_BINARY_DIR}/fat.c ${CMAKE_CURRENT_BINARY_DIR}/fat.h fat_data + DEPENDS native-bin2c fat) + +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/fat32.c ${CMAKE_CURRENT_BINARY_DIR}/fat32.h + COMMAND native-bin2c ${CMAKE_CURRENT_BINARY_DIR}/../bootsect/fat32.bin ${CMAKE_CURRENT_BINARY_DIR}/fat32.c ${CMAKE_CURRENT_BINARY_DIR}/fat32.h fat32_data + DEPENDS native-bin2c fat32) +##################################### add_executable(installfreeldr EXCLUDE_FROM_ALL install.c - volume.c) + volume.c + ${CMAKE_CURRENT_BINARY_DIR}/fat.c + ${CMAKE_CURRENT_BINARY_DIR}/fat32.c) set_module_type(installfreeldr win32cui) add_importlibs(installfreeldr msvcrt kernel32) Modified: trunk/reactos/boot/freeldr/install/install.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/install/insta…
============================================================================== --- trunk/reactos/boot/freeldr/install/install.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/install/install.c [iso-8859-1] Fri Jan 9 00:12:51 2015 @@ -23,8 +23,13 @@ #include <stdio.h> #include "install.h" #include "volume.h" -#include "../bootsect/fat.h" -#include "../bootsect/fat32.h" + +/* + * These includes are required to define + * the fat_data and fat32_data arrays. + */ +#include "fat.h" +#include "fat32.h" BOOL BackupBootSector(LPCTSTR lpszVolumeName); BOOL InstallBootSector(LPCTSTR lpszVolumeType);
9 years, 11 months
1
0
0
0
[jimtabor] 66011: [Win32ss] - Fix remaining DDE issues, re-sync DDE code from wine. Add QOS startup. Moved error debug prints to traces. Over all improvement with test results.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Thu Jan 8 22:57:09 2015 New Revision: 66011 URL:
http://svn.reactos.org/svn/reactos?rev=66011&view=rev
Log: [Win32ss] - Fix remaining DDE issues, re-sync DDE code from wine. Add QOS startup. Moved error debug prints to traces. Over all improvement with test results. Modified: trunk/reactos/win32ss/include/callback.h trunk/reactos/win32ss/user/ntuser/dde.c trunk/reactos/win32ss/user/ntuser/message.c trunk/reactos/win32ss/user/ntuser/userfuncs.h trunk/reactos/win32ss/user/user32/misc/dde.c trunk/reactos/win32ss/user/user32/misc/ddeclient.c trunk/reactos/win32ss/user/user32/misc/ddemisc.c trunk/reactos/win32ss/user/user32/misc/ddeserver.c Modified: trunk/reactos/win32ss/include/callback.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/include/callback.h…
============================================================================== --- trunk/reactos/win32ss/include/callback.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/include/callback.h [iso-8859-1] Thu Jan 8 22:57:09 2015 @@ -122,6 +122,7 @@ INT Type; MSG; int size; + PVOID pvData; BYTE buffer[1]; } DDEPOSTGET_CALLBACK_ARGUMENTS, *PDDEPOSTGET_CALLBACK_ARGUMENTS; Modified: trunk/reactos/win32ss/user/ntuser/dde.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/dde.c?…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/dde.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/dde.c [iso-8859-1] Thu Jan 8 22:57:09 2015 @@ -1,9 +1,29 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Win32k subsystem + * PURPOSE: Dynamic Data Exchange + * FILE: win32ss/user/ntuser/dde.c + * PROGRAMER: + */ #include <win32k.h> #include <dde.h> DBG_DEFAULT_CHANNEL(UserMisc); + +// +// Default information used to support client impersonation. +// +SECURITY_QUALITY_OF_SERVICE gqosDefault = {sizeof(SECURITY_QUALITY_OF_SERVICE),SecurityImpersonation,SECURITY_STATIC_TRACKING,TRUE}; + +typedef struct _DDEIMP +{ + SECURITY_QUALITY_OF_SERVICE qos; + SECURITY_CLIENT_CONTEXT ClientContext; + WORD cRefInit; + WORD cRefConv; +} DDEIMP, *PDDEIMP; typedef struct _DDE_DATA { @@ -16,10 +36,13 @@ { PWND spwnd; PWND spwndPartner; + PDDEIMP pddei; } DDE_PROP, *PDDE_PROP; - +// +// DDE Posting message callback to user side. +// int APIENTRY IntDDEPostCallback( @@ -27,17 +50,15 @@ IN UINT Msg, IN WPARAM wParam, IN OUT LPARAM *lParam, - IN PVOID Buffer, - IN int size) + IN OUT PVOID *Buffer) { NTSTATUS Status; ULONG ArgumentLength, ResultLength; PVOID Argument, ResultPointer; PDDEPOSTGET_CALLBACK_ARGUMENTS Common; - int origSize = size; - + int size = 0; ResultPointer = NULL; - ResultLength = ArgumentLength = sizeof(DDEPOSTGET_CALLBACK_ARGUMENTS)+size; + ResultLength = ArgumentLength = sizeof(DDEPOSTGET_CALLBACK_ARGUMENTS); Argument = IntCbAllocateMemory(ArgumentLength); if (NULL == Argument) @@ -47,12 +68,12 @@ Common = (PDDEPOSTGET_CALLBACK_ARGUMENTS) Argument; - Common->size = size; + Common->pvData = 0; + Common->size = 0; Common->hwnd = UserHMGetHandle(pWnd); Common->message = Msg; Common->wParam = wParam; Common->lParam = *lParam; - RtlCopyMemory(&Common->buffer, Buffer, size); UserLeaveCo(); @@ -73,19 +94,26 @@ RtlCopyMemory(Common, ResultPointer, ArgumentLength); - if (Common->size != 0 && size <= origSize) - { - RtlCopyMemory(Buffer, &Common->buffer, size); // ResultLength); + ///// HAX! + if ( Common->size == 0xdeadbeef ) + { + ERR("DDE Post callback failed! 2 status %p\n",Status); + IntCbFreeMemory(Argument); + return 0; } size = Common->size; *lParam = Common->lParam; + *Buffer = Common->pvData; IntCbFreeMemory(Argument); return size ? size : -1; } +// +// DDE Get/Peek message callback to user side. +// BOOL APIENTRY IntDDEGetCallback( @@ -118,7 +146,6 @@ if (size && Buffer) RtlCopyMemory(&Common->buffer, Buffer, size); - UserLeaveCo(); Status = KeUserModeCallback(USER32_CALLBACK_DDEGET, @@ -138,6 +165,14 @@ RtlMoveMemory(Common, ResultPointer, ArgumentLength); + ///// HAX! + if ( Common->size == 0xdeadbeef ) + { + ERR("DDE Get callback failed! 2 status %p\n",Status); + IntCbFreeMemory(Argument); + return FALSE; + } + pMsg->lParam = Common->lParam; IntCbFreeMemory(Argument); @@ -145,8 +180,9 @@ return TRUE; } - - +// +// DDE Post message hook, intercept DDE messages before going on to the target Processes Thread queue. +// BOOL APIENTRY IntDdePostMessageHook( @@ -158,14 +194,15 @@ { PWND pWndClient; PDDE_DATA pddeData; + int size; HGDIOBJ Object = NULL; + PVOID userBuf = NULL; PVOID Buffer = NULL; - int size = 128; LPARAM lp = *lParam; if (pWnd->head.pti->ppi != gptiCurrent->ppi) { - ERR("Posting long DDE 0x%x\n",Msg); + TRACE("Posting long DDE 0x%x\n",Msg); // Initiate is sent only across borders. if (Msg == WM_DDE_INITIATE) { @@ -178,14 +215,14 @@ // This is terminating so post it. if ( Msg == WM_DDE_TERMINATE) { - ERR("DDE Posted WM_DDE_TERMINATE\n"); + TRACE("DDE Posted WM_DDE_TERMINATE\n"); return TRUE; } - ERR("Invalid DDE Client Window handle\n"); - return FALSE; - } - - if (Msg == WM_DDE_TERMINATE ) + TRACE("Invalid DDE Client Window handle\n"); + return FALSE; + } + + if ( Msg == WM_DDE_TERMINATE ) { //// FIXME Remove Stuff if any... @@ -193,26 +230,34 @@ return TRUE; } - Buffer = ExAllocatePoolWithTag(PagedPool, size, USERTAG_DDE); - - if ((size = IntDDEPostCallback(pWnd, Msg, wParam, &lp, Buffer, size)) == 0) + if ( Msg == WM_DDE_EXECUTE && *lParam == 0) + { + // Do not bother to do a callback. + TRACE("DDE Post EXECUTE lParam 0\n"); + return FALSE; + } + + // Callback. + if ((size = IntDDEPostCallback(pWnd, Msg, wParam, &lp, &userBuf)) == 0) { ERR("DDE Post Callback return 0 0x%x\n", Msg); - } - - if (size != -1 && size > 128) - { - ERR("FIXME: DDE Post need more bytes %d\n",size); - } - + return FALSE; + } + + // No error HACK. if (size == -1) { size = 0; - ExFreePoolWithTag(Buffer, USERTAG_DDE); - Buffer = NULL; - } - - ERR("DDE Post size %d 0x%x\n",size, Msg); + } + else + { + // Set buffer with users data size. + Buffer = ExAllocatePoolWithTag(PagedPool, size, USERTAG_DDE); + // No SEH? Yes, the user memory is freed after the Acknowledgment or at Termination. + RtlCopyMemory(Buffer, userBuf, size); + } + + TRACE("DDE Post size %d 0x%x\n",size, Msg); switch(Msg) { @@ -245,8 +290,7 @@ break; } break; - - } + } default: break; } @@ -257,13 +301,13 @@ GreSetObjectOwner(Object, pWnd->head.pti->ppi->W32Pid); } - pddeData = ExAllocatePoolWithTag(PagedPool, sizeof(DDE_DATA), USERTAG_DDE2); + pddeData = ExAllocatePoolWithTag(PagedPool, sizeof(DDE_DATA), USERTAG_DDE5); pddeData->cbSize = size; pddeData->pvBuffer = Buffer; pddeData->lParam = lp; - ERR("DDE Post lParam c=%08lx\n",lp); + TRACE("DDE Post lParam c=%08lx\n",lp); *lParam = lp; // Attach this data packet to the user message. @@ -272,7 +316,10 @@ return TRUE; } -VOID APIENTRY +// +// DDE Get/Peek message hook, take preprocessed information and recombined it for the current Process Thread. +// +BOOL APIENTRY IntDdeGetMessageHook(PMSG pMsg, LONG_PTR ExtraInfo) { PWND pWnd, pWndClient; @@ -284,7 +331,7 @@ if (pWnd == NULL) { ERR("DDE Get Window is dead. %p\n", pMsg->hwnd); - return; + return TRUE; } if (pMsg->message == WM_DDE_TERMINATE) @@ -301,37 +348,37 @@ IntRemoveProp(pWnd, AtomDDETrack); ExFreePoolWithTag(pddeProp, USERTAG_DDE1); } - return; - } - - ERR("DDE Get Msg 0x%x\n",pMsg->message); + return TRUE; + } + + TRACE("DDE Get Msg 0x%x\n",pMsg->message); pddeData = (PDDE_DATA)ExtraInfo; if ( pddeData ) { - ERR("DDE Get 1 size %d lParam c=%08lx lp c=%08lx\n",pddeData->cbSize, pMsg->lParam, pddeData->lParam); - - pMsg->lParam = pddeData->lParam; // This might be a hack... Need to backtrace lParam from post queue. - + TRACE("DDE Get size %d lParam c=%08lx lp c=%08lx\n",pddeData->cbSize, pMsg->lParam, pddeData->lParam); + + // Callback. Ret = IntDDEGetCallback( pWnd, pMsg, pddeData->pvBuffer, pddeData->cbSize); if (!Ret) { ERR("DDE Get CB failed\n"); } - ERR("DDE Get 2 size %d lParam c=%08lx\n",pddeData->cbSize, pMsg->lParam); - if (pddeData->pvBuffer) ExFreePoolWithTag(pddeData->pvBuffer, USERTAG_DDE); - ExFreePoolWithTag(pddeData, USERTAG_DDE2); - - return; - } - ERR("DDE Get No DDE Data found!\n"); - return; -} - + ExFreePoolWithTag(pddeData, USERTAG_DDE5); + + return Ret; + } + TRACE("DDE Get No DDE Data found!\n"); + return TRUE; +} + +// +// DDE Send message hook, intercept DDE messages and associate them in a partnership with property. +// BOOL FASTCALL IntDdeSendMessageHook(PWND pWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { @@ -340,12 +387,12 @@ if (Msg == WM_DDE_ACK) { - ERR("Sending WM_DDE_ACK Client hwnd %p\n",pWnd->head.h); + TRACE("Sending WM_DDE_ACK Client hwnd %p\n",pWnd->head.h); } if (pWnd->head.pti->ppi != gptiCurrent->ppi) { - ERR("Sending long DDE 0x%x\n",Msg); + TRACE("Sending long DDE 0x%x\n",Msg); // Allow only Acknowledge and Initiate to be sent across borders. if (Msg != WM_DDE_ACK ) @@ -354,7 +401,7 @@ return FALSE; } - ERR("Sending long WM_DDE_ACK\n"); + TRACE("Sending long WM_DDE_ACK\n"); pWndServer = UserGetWindowObject((HWND)wParam); if (pWndServer == NULL) @@ -381,6 +428,29 @@ IN HWND hwndClient, IN HWND hWndServer, OUT PSECURITY_QUALITY_OF_SERVICE pqosPrev) +{ + STUB + + return 0; +} + +BOOL +APIENTRY +NtUserDdeSetQualityOfService( + IN HWND hwndClient, + IN PSECURITY_QUALITY_OF_SERVICE pqosNew, + OUT PSECURITY_QUALITY_OF_SERVICE pqosPrev) +{ + STUB + + return 0; +} + +BOOL +APIENTRY +NtUserImpersonateDdeClientWindow( + HWND hWndClient, + HWND hWndServer) { STUB @@ -401,26 +471,3 @@ return 0; } -BOOL -APIENTRY -NtUserDdeSetQualityOfService( - IN HWND hwndClient, - IN PSECURITY_QUALITY_OF_SERVICE pqosNew, - OUT PSECURITY_QUALITY_OF_SERVICE pqosPrev) -{ - STUB - - return 0; -} - -BOOL -APIENTRY -NtUserImpersonateDdeClientWindow( - HWND hWndClient, - HWND hWndServer) -{ - STUB - - return 0; -} - Modified: trunk/reactos/win32ss/user/ntuser/message.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/messag…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/message.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/message.c [iso-8859-1] Thu Jan 8 22:57:09 2015 @@ -1017,7 +1017,11 @@ if ( pMsg->message >= WM_DDE_FIRST && pMsg->message <= WM_DDE_LAST ) { - IntDdeGetMessageHook(pMsg, ExtraInfo); + if (!IntDdeGetMessageHook(pMsg, ExtraInfo)) + { + TRACE("DDE Get return ERROR\n"); + continue; + } } if (pMsg->message != WM_PAINT && pMsg->message != WM_QUIT) @@ -1204,10 +1208,10 @@ { if (!IntDdePostMessageHook(Window, Msg, wParam, &lParam, &ExtraInfo)) { - ERR("Posting Exit DDE 0x%x\n",Msg); + TRACE("Posting Exit DDE 0x%x\n",Msg); return FALSE; } - ERR("DDE Post lParam c=%08lx\n",lParam); + Message.lParam = lParam; } if (WM_QUIT == Msg) Modified: trunk/reactos/win32ss/user/ntuser/userfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/userfu…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/userfuncs.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/userfuncs.h [iso-8859-1] Thu Jan 8 22:57:09 2015 @@ -44,7 +44,7 @@ BOOL FASTCALL IntDdeSendMessageHook(PWND,UINT,WPARAM,LPARAM); BOOL APIENTRY IntDdePostMessageHook(IN PWND,IN UINT,IN WPARAM,IN OUT LPARAM*,IN OUT LONG_PTR*); -VOID APIENTRY IntDdeGetMessageHook(PMSG,LONG_PTR); +BOOL APIENTRY IntDdeGetMessageHook(PMSG,LONG_PTR); /*************** MAIN.C ***************/ Modified: trunk/reactos/win32ss/user/user32/misc/dde.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/misc/d…
============================================================================== --- trunk/reactos/win32ss/user/user32/misc/dde.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/misc/dde.c [iso-8859-1] Thu Jan 8 22:57:09 2015 @@ -1,3 +1,10 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS user32.dll + * PURPOSE: Dynamic Data Exchange + * FILE: win32ss/user/user32/misc/dde.c + * PROGRAMER: + */ #include <user32.h> #include <wine/debug.h> @@ -13,9 +20,9 @@ struct packed_message { //union packed_structs ps; - int count; - const void *data; - int size; + int count; + const void *data; + int size; }; /* add a data field to a packed message */ @@ -79,13 +86,13 @@ /* send back the value of h on the other side */ push_data( data, &hpack, sizeof(hpack) ); *lp = uiLo; - ERR( "send dde-ack %lx %08lx => %p\n", uiLo, uiHi, h ); + TRACE( "send dde-ack %lx %08lx => %p\n", uiLo, uiHi, h ); } } else { /* uiHi should contain either an atom or 0 */ - ERR( "send dde-ack %lx atom=%lx\n", uiLo, uiHi ); + TRACE( "send dde-ack %lx atom=%lx\n", uiLo, uiHi ); *lp = MAKELONG( uiLo, uiHi ); } break; @@ -96,12 +103,17 @@ if (uiLo) { size = GlobalSize( (HGLOBAL)uiLo ) ; + TRACE("WM_DDE_A D P size %d\n",size); if ( (message == WM_DDE_ADVISE && size < sizeof(DDEADVISE)) || (message == WM_DDE_DATA && size < FIELD_OFFSET(DDEDATA, Value)) || (message == WM_DDE_POKE && size < FIELD_OFFSET(DDEPOKE, Value)) ) return FALSE; } - else if (message != WM_DDE_DATA) return FALSE; + else if (message != WM_DDE_DATA) + { + TRACE("WM_DDE uiLo 0\n"); + return FALSE; + } *lp = uiHi; if (uiLo) @@ -109,14 +121,14 @@ if ((ptr = GlobalLock( (HGLOBAL)uiLo) )) { DDEDATA *dde_data = ptr; - ERR("unused %d, fResponse %d, fRelease %d, fDeferUpd %d, fAckReq %d, cfFormat %d\n", + TRACE("unused %d, fResponse %d, fRelease %d, fDeferUpd %d, fAckReq %d, cfFormat %d\n", dde_data->unused, dde_data->fResponse, dde_data->fRelease, dde_data->reserved, dde_data->fAckReq, dde_data->cfFormat); push_data( data, ptr, size ); hunlock = (HGLOBAL)uiLo; } } - ERR( "send ddepack %u %lx\n", size, uiHi ); + TRACE( "send ddepack %u %lx\n", size, uiHi ); break; case WM_DDE_EXECUTE: if (lParam) @@ -128,7 +140,7 @@ /* so that the other side can send it back on ACK */ *lp = lParam; hunlock = (HGLOBAL)lParam; - ERR("WM_DDE_EXECUTE text size %d\n",GlobalSize( (HGLOBAL)lParam )); + TRACE("WM_DDE_EXECUTE text size %d\n",GlobalSize( (HGLOBAL)lParam )); } } break; @@ -152,7 +164,7 @@ HGLOBAL hMem = 0; void* ptr; - ERR("udm : Size %d\n",size); + TRACE("udm : Size %d\n",size); switch (message) { @@ -167,13 +179,13 @@ memcpy( &hpack, buffer, size ); hMem = unpack_ptr( hpack ); uiHi = (UINT_PTR)hMem; - ERR("recv dde-ack %lx mem=%lx[%lx]\n", uiLo, uiHi, GlobalSize( hMem )); + TRACE("recv dde-ack %lx mem=%lx[%lx]\n", uiLo, uiHi, GlobalSize( hMem )); } else { uiLo = LOWORD( *lparam ); uiHi = HIWORD( *lparam ); - ERR("recv dde-ack %lx atom=%lx\n", uiLo, uiHi); + TRACE("recv dde-ack %lx atom=%lx\n", uiLo, uiHi); } *lparam = PackDDElParam( WM_DDE_ACK, uiLo, uiHi ); break; @@ -210,78 +222,90 @@ { memcpy( ptr, buffer, size ); GlobalUnlock( hMem ); - ERR( "exec: pairing c=%08lx s=%p\n", *lparam, hMem ); + TRACE( "exec: pairing c=%08lx s=%p\n", *lparam, hMem ); if (!DdeAddPair( (HGLOBAL)*lparam, hMem )) { GlobalFree( hMem ); - ERR("udm exec: GF 1\n"); + TRACE("udm exec: GF 1\n"); return FALSE; } } else { GlobalFree( hMem ); - ERR("udm exec: GF 2\n"); + TRACE("udm exec: GF 2\n"); return FALSE; } } else - { - ERR("udm exec: No Size\n"); + { + TRACE("udm exec: No Size\n"); return FALSE; } - ERR( "exec: exit c=%08lx s=%p\n", *lparam, hMem ); + TRACE( "exec: exit c=%08lx s=%p\n", *lparam, hMem ); *lparam = (LPARAM)hMem; break; } return TRUE; } +// +// DDE Post kernel callback. +// NTSTATUS WINAPI User32CallDDEPostFromKernel(PVOID Arguments, ULONG ArgumentLength) { struct packed_message data; BOOL Ret; + NTSTATUS Status = STATUS_SUCCESS; PDDEPOSTGET_CALLBACK_ARGUMENTS Common = Arguments; data.data = 0; data.size = 0; - ERR("DDE Post CB\n"); + TRACE("DDE Post CB\n"); Ret = post_dde_message( &data, Common->message, Common->lParam, &Common->lParam); if (Ret) { - if (Common->size >= data.size) - { - if (data.data) RtlCopyMemory(&Common->buffer, data.data, data.size); - } + Common->pvData = (PVOID)data.data; Common->size = data.size; - ERR("DDE Post CB size %d\n",data.size); + TRACE("DDE Post CB size %d\n",data.size); } else { - ERR("Return bad msg 0x%x Size %d\n",Common->message,Common->size); + ERR("DDE Post CB Return bad msg 0x%x Size %d\n",Common->message,Common->size); + Common->size = 0xdeadbeef; // HACKSSS!! Return status does not work! + Status = STATUS_UNSUCCESSFUL; } - return ZwCallbackReturn(Arguments, ArgumentLength, Ret ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL); -} - + return ZwCallbackReturn(Arguments, ArgumentLength, Status); +} + +// +// DDE Get/Peek kernel callback. +// NTSTATUS WINAPI User32CallDDEGetFromKernel(PVOID Arguments, ULONG ArgumentLength) { BOOL Ret; + NTSTATUS Status = STATUS_SUCCESS; PDDEPOSTGET_CALLBACK_ARGUMENTS Common = Arguments; - ERR("DDE Get CB size %d\n",Common->size); + TRACE("DDE Get CB size %d\n",Common->size); Ret = unpack_dde_message( Common->hwnd, Common->message, &Common->lParam, Common->buffer, Common->size ); - return ZwCallbackReturn(Arguments, ArgumentLength, Ret ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL); -} - + if (!Ret) + { + ERR("DDE Get CB Return bad msg 0x%x\n",Common->message); + Common->size = 0xdeadbeef; // HACKSSS!! Return status does not work! + Status = STATUS_UNSUCCESSFUL; + } + return ZwCallbackReturn(Arguments, ArgumentLength, Status); +} /* Modified: trunk/reactos/win32ss/user/user32/misc/ddeclient.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/misc/d…
============================================================================== --- trunk/reactos/win32ss/user/user32/misc/ddeclient.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/misc/ddeclient.c [iso-8859-1] Thu Jan 8 22:57:09 2015 @@ -31,7 +31,7 @@ static LRESULT CALLBACK WDML_ClientProc(HWND, UINT, WPARAM, LPARAM); /* only for one client, not conv list */ const char WDML_szClientConvClassA[] = "DDEMLAnsiClient"; -const WCHAR WDML_szClientConvClassW[] = {'D','D','E','M','L','U','n','i','c','o','d','e','C','l','i','e','n','t',0}; +const WCHAR WDML_szClientConvClassW[] = L"DDEMLUnicodeClient"; /****************************************************************************** * DdeConnectList [USER32.@] Establishes conversation with DDE servers @@ -91,7 +91,7 @@ WDML_CONV* pConv = NULL; ATOM aSrv = 0, aTpc = 0; - ERR("(0x%x,%p,%p,%p)\n", idInst, hszService, hszTopic, pCC); + TRACE("(0x%x,%p,%p,%p)\n", idInst, hszService, hszTopic, pCC); pInstance = WDML_GetInstance(idInst); if (!pInstance) @@ -180,12 +180,12 @@ pConv = WDML_GetConvFromWnd(hwndClient); if (pConv == NULL || pConv->hwndServer == 0) { - ERR("Done with INITIATE, but no Server window available %p\n", (pConv ? pConv->hwndServer : NULL)); + WARN("Done with INITIATE, but no Server window available\n"); pConv = NULL; pInstance->lastError = DMLERR_NO_CONV_ESTABLISHED; goto theEnd; } - ERR("Connected to Server window (%p)\n", pConv->hwndServer); + TRACE("Connected to Server window (%p)\n", pConv->hwndServer); pConv->wConvst = XST_CONNECTED; /* finish init of pConv */ @@ -1012,7 +1012,7 @@ DWORD err; WDML_CONV* pConv; - ERR("Starting wait for a timeout of %d ms\n", dwTimeout); + TRACE("Starting wait for a timeout of %d ms\n", dwTimeout); start = GetTickCount(); while ((elapsed = GetTickCount() - start) < dwTimeout) @@ -1032,18 +1032,16 @@ pConv = WDML_GetConv(hConv, FALSE); if (pConv == NULL) { - ERR("conversation no longer available\n"); /* conversation no longer available... return failure */ return 0; } - ERR("Msg hWnd %p & Client %p\n",msg.hwnd,pConv->hwndClient); if (msg.hwnd == pConv->hwndClient) { /* check that either pXAct has been processed or no more xActions are pending */ BOOL ret = (pConv->transactions == pXAct); if (WDML_HandleReply(pConv, &msg, &hdd, ack) == WDML_QS_HANDLED) { - ERR("WDML_HandleReply returned WDML_QS_HANDLED\n"); + TRACE("WDML_HandleReply returned WDML_QS_HANDLED\n"); ret = TRUE; } else @@ -1057,14 +1055,13 @@ } else { - ERR("Dispatching message\n"); DispatchMessageW(&msg); } } } } - ERR("Timeout !!\n"); + TRACE("Timeout !!\n"); pConv = WDML_GetConv(hConv, FALSE); if (pConv != NULL) @@ -1144,7 +1141,6 @@ if (pConv == NULL) { /* cannot set error... cannot get back to DDE instance */ - ERR("No Conv!\n"); return 0; } @@ -1287,18 +1283,16 @@ UINT uiLo, uiHi; WDML_CONV* pConv = NULL; HSZ hszSrv, hszTpc; - char buf[256]; - WDML_INSTANCE* pInstance; - - ERR("%p %04x %08lx %08lx\n", hwnd, iMsg, wParam , lParam); - + + TRACE("%p %04x %08lx %08lx\n", hwnd, iMsg, wParam , lParam); + + if (iMsg == WM_DDE_ACK && /* in the initial WM_INITIATE sendmessage */ - if (iMsg == WM_DDE_ACK && - (!(pConv = WDML_GetConvFromWnd(hwnd)) || pConv->wStatus == XST_INIT1)) - { - - ERR("WM_DDE_ACK\n"); + ((pConv = WDML_GetConvFromWnd(hwnd)) == NULL || pConv->wStatus == XST_INIT1)) + { /* In response to WM_DDE_INITIATE, save server window */ + char buf[256]; + WDML_INSTANCE* pInstance; /* note: sent messages do not need packing */ uiLo = LOWORD(lParam); Modified: trunk/reactos/win32ss/user/user32/misc/ddemisc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/misc/d…
============================================================================== --- trunk/reactos/win32ss/user/user32/misc/ddemisc.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/misc/ddemisc.c [iso-8859-1] Thu Jan 8 22:57:09 2015 @@ -36,11 +36,11 @@ static WDML_INSTANCE* WDML_InstanceList = NULL; static LONG WDML_MaxInstanceID = 0; /* OK for present, have to worry about wrap-around later */ -const WCHAR WDML_szEventClass[] = {'D','D','E','M','L','E','v','e','n','t',0}; +const WCHAR WDML_szEventClass[] = L"DDEMLEvent"; /* protection for instance list */ CRITICAL_SECTION WDML_CritSect; -CRITICAL_SECTION_DEBUG critsect_debug = +static CRITICAL_SECTION_DEBUG critsect_debug = { 0, 0, &WDML_CritSect, { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, @@ -797,8 +797,8 @@ /* confirm connection... * lookup for this conv handle */ - HWND client = (HWND)wParam; - HWND server = (HWND)lParam; + HWND client = WIN_GetFullHandle( (HWND)wParam ); + HWND server = WIN_GetFullHandle( (HWND)lParam ); for (pConv = pInstance->convs[WDML_SERVER_SIDE]; pConv != NULL; pConv = pConv->next) { if (pConv->hwndClient == client && pConv->hwndServer == server) @@ -840,7 +840,7 @@ { ERR("Reserved value not zero? What does this mean?\n"); /* trap this and no more until we know more */ - return DMLERR_INVALIDPARAMETER; + return DMLERR_NO_ERROR; } /* grab enough heap for one control struct - not really necessary for re-initialise @@ -883,12 +883,12 @@ (pInstance->CBFflags & CBF_FAIL_ALLSVRXACTIONS) == CBF_FAIL_ALLSVRXACTIONS; } - ERR("instance created - checking validity\n"); + TRACE("instance created - checking validity\n"); if (*pidInst == 0) { /* Initialisation of new Instance Identifier */ - ERR("new instance, callback %p flags %X\n",pfnCallback,afCmd); + TRACE("new instance, callback %p flags %X\n",pfnCallback,afCmd); EnterCriticalSection(&WDML_CritSect); @@ -907,7 +907,7 @@ */ pInstance->CBFflags = pInstance->CBFflags|APPCMD_FILTERINITS; - ERR("First application instance detected OK\n"); + TRACE("First application instance detected OK\n"); /* allocate new instance ID */ WDML_IncrementInstanceId(pInstance); } @@ -916,7 +916,7 @@ /* really need to chain the new one in to the latest here, but after checking conditions * such as trying to start a conversation from an application trying to monitor */ reference_inst = WDML_InstanceList; - ERR("Subsequent application instance - starting checks\n"); + TRACE("Subsequent application instance - starting checks\n"); while (reference_inst->next != NULL) { /* @@ -932,7 +932,6 @@ if (pInstance->clientOnly != reference_inst->clientOnly) { - ERR("WDML_Initialize Mustbe Client-only\n"); ret = DMLERR_DLL_USAGE; goto theError; } @@ -941,7 +940,6 @@ if (pInstance->monitor != reference_inst->monitor) { - ERR("WDML_Initialize cannot use monitor w/any modes\n"); ret = DMLERR_INVALIDPARAMETER; goto theError; } @@ -958,7 +956,7 @@ } /* All cleared, add to chain */ - ERR("Application Instance checks finished\n"); + TRACE("Application Instance checks finished\n"); WDML_IncrementInstanceId(pInstance); reference_inst->next = pInstance; } @@ -988,18 +986,17 @@ SetWindowLongPtrW(pInstance->hwndEvent, GWL_WDML_INSTANCE, (ULONG_PTR)pInstance); - ERR("New application instance processing finished OK\n"); + TRACE("New application instance processing finished OK\n"); } else { /* Reinitialisation situation --- FIX */ - ERR("reinitialisation of (%p,%p,0x%x,%d): stub\n", pidInst, pfnCallback, afCmd, ulRes); + TRACE("reinitialisation of (%p,%p,0x%x,%d): stub\n", pidInst, pfnCallback, afCmd, ulRes); EnterCriticalSection(&WDML_CritSect); if (WDML_InstanceList == NULL) { - ERR("WDML_Initialize No instance list\n"); ret = DMLERR_INVALIDPARAMETER; goto theError; } @@ -1024,7 +1021,6 @@ if (!(afCmd & APPCMD_CLIENTONLY)) { - ERR("WDML_Initialize AppCmd Client-only 2\n"); ret = DMLERR_INVALIDPARAMETER; goto theError; } @@ -1034,7 +1030,6 @@ if (pInstance->monitor != reference_inst->monitor) { - ERR("WDML_Initialize cannot change monitor modes 2\n"); ret = DMLERR_INVALIDPARAMETER; goto theError; } @@ -1043,7 +1038,6 @@ if ((afCmd&APPCMD_CLIENTONLY) && !reference_inst->clientOnly) { - ERR("WDML_Initialize trying to set Client-only via APPCMD\n"); ret = DMLERR_INVALIDPARAMETER; goto theError; } @@ -1053,7 +1047,6 @@ } if (reference_inst->next == NULL) { - ERR("WDML_Initialize Nothing Next\n"); ret = DMLERR_INVALIDPARAMETER; goto theError; } @@ -1070,7 +1063,6 @@ return DMLERR_NO_ERROR; theError: - ERR("WDML_Initialize error %x\n",ret); HeapFree(GetProcessHeap(), 0, pInstance); LeaveCriticalSection(&WDML_CritSect); return ret; Modified: trunk/reactos/win32ss/user/user32/misc/ddeserver.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/misc/d…
============================================================================== --- trunk/reactos/win32ss/user/user32/misc/ddeserver.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/misc/ddeserver.c [iso-8859-1] Thu Jan 8 22:57:09 2015 @@ -380,12 +380,12 @@ LOWORD(lParam) -- application atom HIWORD(lParam) -- topic atom */ - ERR("WM_DDE_INITIATE message received!\n"); + TRACE("WM_DDE_INITIATE message received!\n"); hwndClient = (HWND)wParam; pInstance = WDML_GetInstanceFromWnd(hwndServer); if (!pInstance) return 0; - ERR("idInst=%d, threadID=0x%x\n", pInstance->instanceID, GetCurrentThreadId()); + TRACE("idInst=%d, threadID=0x%x\n", pInstance->instanceID, GetCurrentThreadId()); /* don't free DDEParams, since this is a broadcast */ UnpackDDElParam(WM_DDE_INITIATE, lParam, &uiLo, &uiHi);
9 years, 11 months
1
0
0
0
[hbelusca] 66010: [NTGDI]: #if'ed 0 unused pdcattr variable. Associated code with it went away in revision 65912. Timo, was it on purpose? Because in other NTGDI functions (in the same file) this c...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Thu Jan 8 20:35:51 2015 New Revision: 66010 URL:
http://svn.reactos.org/svn/reactos?rev=66010&view=rev
Log: [NTGDI]: #if'ed 0 unused pdcattr variable. Associated code with it went away in revision 65912. Timo, was it on purpose? Because in other NTGDI functions (in the same file) this code remained... (I'm talking about the if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY)) { DC_vUpdateFillBrush(dc); } things). Modified: trunk/reactos/win32ss/gdi/ntgdi/fillshap.c Modified: trunk/reactos/win32ss/gdi/ntgdi/fillshap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/fillshap…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/fillshap.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/fillshap.c [iso-8859-1] Thu Jan 8 20:35:51 2015 @@ -1071,7 +1071,9 @@ UINT FillType) { PDC dc; +#if 0 PDC_ATTR pdcattr; +#endif SURFACE *psurf = NULL; EXLATEOBJ exlo; BOOL Ret = FALSE; @@ -1098,7 +1100,9 @@ goto cleanup; } +#if 0 pdcattr = dc->pdcattr; +#endif Pt.x = XStart; Pt.y = YStart;
9 years, 11 months
1
0
0
0
[pschweitzer] 66009: [NTFS] - Move directory enumeration into its own routine to prevent code duplication. - Also, only take care of sub-node at the end of the enumeration. It doesn't make sense be...
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Thu Jan 8 20:30:10 2015 New Revision: 66009 URL:
http://svn.reactos.org/svn/reactos?rev=66009&view=rev
Log: [NTFS] - Move directory enumeration into its own routine to prevent code duplication. - Also, only take care of sub-node at the end of the enumeration. It doesn't make sense before. - Supporting sub-nodes is still to be done. Modified: trunk/reactos/drivers/filesystems/ntfs/mft.c Modified: trunk/reactos/drivers/filesystems/ntfs/mft.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/m…
============================================================================== --- trunk/reactos/drivers/filesystems/ntfs/mft.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/ntfs/mft.c [iso-8859-1] Thu Jan 8 20:30:10 2015 @@ -501,6 +501,45 @@ } } +NTSTATUS +BrowseIndexEntries(PINDEX_ENTRY_ATTRIBUTE FirstEntry, + PINDEX_ENTRY_ATTRIBUTE LastEntry, + PUNICODE_STRING FileName, + PULONG StartEntry, + PULONG CurrentEntry, + BOOLEAN DirSearch, + ULONGLONG *OutMFTIndex) +{ + PINDEX_ENTRY_ATTRIBUTE IndexEntry; + + IndexEntry = FirstEntry; + while (IndexEntry < LastEntry && + !(IndexEntry->Flags & NTFS_INDEX_ENTRY_END)) + { + UNICODE_STRING EntryName; + EntryName.Buffer = IndexEntry->FileName.Name; + EntryName.Length = + EntryName.MaximumLength = IndexEntry->FileName.NameLength * sizeof(WCHAR); + + if ((IndexEntry->Data.Directory.IndexedFile & NTFS_MFT_MASK) > 0x10 && + *CurrentEntry >= *StartEntry && + CompareFileName(FileName, IndexEntry, DirSearch)) + { + *StartEntry = *CurrentEntry; + *OutMFTIndex = (IndexEntry->Data.Directory.IndexedFile & NTFS_MFT_MASK); + return STATUS_SUCCESS; + } + + (*CurrentEntry) += 1; + ASSERT(IndexEntry->Length >= sizeof(INDEX_ENTRY_ATTRIBUTE)); + IndexEntry = (PINDEX_ENTRY_ATTRIBUTE)((PCHAR)IndexEntry + IndexEntry->Length); + } + + if (IndexEntry->Flags & NTFS_INDEX_ENTRY_NODE) + DPRINT1("Sub-node available\n"); + + return STATUS_OBJECT_PATH_NOT_FOUND; +} NTSTATUS NtfsFindMftRecord(PDEVICE_EXTENSION Vcb, @@ -563,30 +602,12 @@ DPRINT("IndexRecordSize: %x IndexBlockSize: %x\n", Vcb->NtfsInfo.BytesPerIndexRecord, IndexRoot->SizeOfEntry); - while (IndexEntry < IndexEntryEnd && - !(IndexEntry->Flags & NTFS_INDEX_ENTRY_END)) - { - UNICODE_STRING EntryName; - EntryName.Buffer = IndexEntry->FileName.Name; - EntryName.Length = - EntryName.MaximumLength = IndexEntry->FileName.NameLength * sizeof(WCHAR); - - if (IndexEntry->Flags & NTFS_INDEX_ENTRY_NODE) - DPRINT1("Warning: sub-node browsing unimplemented! (%wZ)\n", &EntryName); - - if ((IndexEntry->Data.Directory.IndexedFile & NTFS_MFT_MASK) > 0x10 && - CurrentEntry >= *FirstEntry && - CompareFileName(FileName, IndexEntry, DirSearch)) - { - *OutMFTIndex = (IndexEntry->Data.Directory.IndexedFile & NTFS_MFT_MASK); - *FirstEntry = CurrentEntry; - ExFreePoolWithTag(IndexRecord, TAG_NTFS); - ExFreePoolWithTag(MftRecord, TAG_NTFS); - return STATUS_SUCCESS; - } - - ++CurrentEntry; - IndexEntry = (PINDEX_ENTRY_ATTRIBUTE)((PCHAR)IndexEntry + IndexEntry->Length); + Status = BrowseIndexEntries(IndexEntry, IndexEntryEnd, FileName, FirstEntry, &CurrentEntry, DirSearch, OutMFTIndex); + if (NT_SUCCESS(Status)) + { + ExFreePoolWithTag(IndexRecord, TAG_NTFS); + ExFreePoolWithTag(MftRecord, TAG_NTFS); + return Status; } if (IndexRoot->Header.Flags & INDEX_ROOT_LARGE) @@ -662,34 +683,14 @@ IndexEntryEnd = (PINDEX_ENTRY_ATTRIBUTE)((ULONG_PTR)&IndexBuffer->Header + IndexBuffer->Header.TotalSizeOfEntries); ASSERT(IndexEntryEnd <= (PINDEX_ENTRY_ATTRIBUTE)((ULONG_PTR)IndexBuffer + IndexBlockSize)); - while (IndexEntry < IndexEntryEnd && - !(IndexEntry->Flags & NTFS_INDEX_ENTRY_END)) + Status = BrowseIndexEntries(IndexEntry, IndexEntryEnd, FileName, FirstEntry, &CurrentEntry, DirSearch, OutMFTIndex); + if (NT_SUCCESS(Status)) { - UNICODE_STRING EntryName; - EntryName.Buffer = IndexEntry->FileName.Name; - EntryName.Length = - EntryName.MaximumLength = IndexEntry->FileName.NameLength * sizeof(WCHAR); - - if (IndexEntry->Flags & NTFS_INDEX_ENTRY_NODE) - DPRINT1("Warning: sub-node browsing unimplemented! (%wZ)\n", &EntryName); - - if ((IndexEntry->Data.Directory.IndexedFile & NTFS_MFT_MASK) > 0x10 && - CurrentEntry >= *FirstEntry && - CompareFileName(FileName, IndexEntry, DirSearch)) - { - DPRINT("File found\n"); - *OutMFTIndex = (IndexEntry->Data.Directory.IndexedFile & NTFS_MFT_MASK); - *FirstEntry = CurrentEntry; - ExFreePoolWithTag(BitmapData, TAG_NTFS); - ExFreePoolWithTag(IndexRecord, TAG_NTFS); - ExFreePoolWithTag(MftRecord, TAG_NTFS); - ReleaseAttributeContext(IndexAllocationCtx); - return STATUS_SUCCESS; - } - - ++CurrentEntry; - ASSERT(IndexEntry->Length >= sizeof(INDEX_ENTRY_ATTRIBUTE)); - IndexEntry = (PINDEX_ENTRY_ATTRIBUTE)((PCHAR)IndexEntry + IndexEntry->Length); + ExFreePoolWithTag(BitmapData, TAG_NTFS); + ExFreePoolWithTag(IndexRecord, TAG_NTFS); + ExFreePoolWithTag(MftRecord, TAG_NTFS); + ReleaseAttributeContext(IndexAllocationCtx); + return Status; } RecordOffset += IndexBlockSize;
9 years, 11 months
1
0
0
0
[pschweitzer] 66008: [NTFS] Also return MFT index in case of FileDirectoryInformation query
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Thu Jan 8 20:29:04 2015 New Revision: 66008 URL:
http://svn.reactos.org/svn/reactos?rev=66008&view=rev
Log: [NTFS] Also return MFT index in case of FileDirectoryInformation query Modified: trunk/reactos/drivers/filesystems/ntfs/dirctl.c Modified: trunk/reactos/drivers/filesystems/ntfs/dirctl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/d…
============================================================================== --- trunk/reactos/drivers/filesystems/ntfs/dirctl.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/ntfs/dirctl.c [iso-8859-1] Thu Jan 8 20:29:04 2015 @@ -157,6 +157,7 @@ NtfsGetDirectoryInformation(PDEVICE_EXTENSION DeviceExt, PFILE_RECORD_HEADER FileRecord, PNTFS_ATTR_CONTEXT DataContext, + ULONGLONG MFTIndex, PFILE_DIRECTORY_INFORMATION Info, ULONG BufferLength) { @@ -192,7 +193,7 @@ Info->EndOfFile.QuadPart = FileName->AllocatedSize; Info->AllocationSize.QuadPart = ROUND_UP(FileName->AllocatedSize, DeviceExt->NtfsInfo.BytesPerCluster); -// Info->FileIndex=; + Info->FileIndex = MFTIndex; return STATUS_SUCCESS; } @@ -443,6 +444,7 @@ Status = NtfsGetDirectoryInformation(DeviceExtension, FileRecord, DataContext, + MFTRecord, (PFILE_DIRECTORY_INFORMATION)Buffer, BufferLength); break;
9 years, 11 months
1
0
0
0
[pschweitzer] 66007: [NTFS] Also retrieve $STANDARD_INFORMATION attribute on directory enumeration to get the right file attributes. This fixes improper display in cmd & in explorer due to missing ...
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Thu Jan 8 20:28:25 2015 New Revision: 66007 URL:
http://svn.reactos.org/svn/reactos?rev=66007&view=rev
Log: [NTFS] Also retrieve $STANDARD_INFORMATION attribute on directory enumeration to get the right file attributes. This fixes improper display in cmd & in explorer due to missing file attributes flags Modified: trunk/reactos/drivers/filesystems/ntfs/dirctl.c Modified: trunk/reactos/drivers/filesystems/ntfs/dirctl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/d…
============================================================================== --- trunk/reactos/drivers/filesystems/ntfs/dirctl.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/ntfs/dirctl.c [iso-8859-1] Thu Jan 8 20:28:25 2015 @@ -162,11 +162,15 @@ { ULONG Length; PFILENAME_ATTRIBUTE FileName; + PSTANDARD_INFORMATION StdInfo; DPRINT("NtfsGetDirectoryInformation() called\n"); FileName = GetBestFileNameFromRecord(FileRecord); ASSERT(FileName != NULL); + + StdInfo = GetStandardInformationFromRecord(FileRecord); + ASSERT(StdInfo != NULL); Length = FileName->NameLength * sizeof (WCHAR); if ((sizeof(FILE_DIRECTORY_INFORMATION) + Length) > BufferLength) @@ -183,7 +187,7 @@ Info->ChangeTime.QuadPart = FileName->ChangeTime; /* Convert file flags */ - NtfsFileFlagsToAttributes(FileName->FileAttributes, &Info->FileAttributes); + NtfsFileFlagsToAttributes(FileName->FileAttributes | StdInfo->FileAttribute, &Info->FileAttributes); Info->EndOfFile.QuadPart = FileName->AllocatedSize; Info->AllocationSize.QuadPart = ROUND_UP(FileName->AllocatedSize, DeviceExt->NtfsInfo.BytesPerCluster); @@ -204,11 +208,15 @@ { ULONG Length; PFILENAME_ATTRIBUTE FileName; + PSTANDARD_INFORMATION StdInfo; DPRINT("NtfsGetFullDirectoryInformation() called\n"); FileName = GetBestFileNameFromRecord(FileRecord); ASSERT(FileName != NULL); + + StdInfo = GetStandardInformationFromRecord(FileRecord); + ASSERT(StdInfo != NULL); Length = FileName->NameLength * sizeof (WCHAR); if ((sizeof(FILE_FULL_DIRECTORY_INFORMATION) + Length) > BufferLength) @@ -225,7 +233,7 @@ Info->ChangeTime.QuadPart = FileName->ChangeTime; /* Convert file flags */ - NtfsFileFlagsToAttributes(FileName->FileAttributes, &Info->FileAttributes); + NtfsFileFlagsToAttributes(FileName->FileAttributes | StdInfo->FileAttribute, &Info->FileAttributes); Info->EndOfFile.QuadPart = FileName->AllocatedSize; Info->AllocationSize.QuadPart = ROUND_UP(FileName->AllocatedSize, DeviceExt->NtfsInfo.BytesPerCluster); @@ -247,12 +255,16 @@ { ULONG Length; PFILENAME_ATTRIBUTE FileName, ShortFileName; + PSTANDARD_INFORMATION StdInfo; DPRINT("NtfsGetBothDirectoryInformation() called\n"); FileName = GetBestFileNameFromRecord(FileRecord); ASSERT(FileName != NULL); ShortFileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_DOS); + + StdInfo = GetStandardInformationFromRecord(FileRecord); + ASSERT(StdInfo != NULL); Length = FileName->NameLength * sizeof (WCHAR); if ((sizeof(FILE_BOTH_DIR_INFORMATION) + Length) > BufferLength) @@ -282,7 +294,7 @@ Info->ChangeTime.QuadPart = FileName->ChangeTime; /* Convert file flags */ - NtfsFileFlagsToAttributes(FileName->FileAttributes, &Info->FileAttributes); + NtfsFileFlagsToAttributes(FileName->FileAttributes | StdInfo->FileAttribute, &Info->FileAttributes); Info->EndOfFile.QuadPart = FileName->AllocatedSize; Info->AllocationSize.QuadPart = ROUND_UP(FileName->AllocatedSize, DeviceExt->NtfsInfo.BytesPerCluster);
9 years, 11 months
1
0
0
0
[akhaldi] 66006: [SHELL32_WINETEST] Enable test_dde() and test_dde_default_app(). CORE-6559
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Jan 8 16:42:35 2015 New Revision: 66006 URL:
http://svn.reactos.org/svn/reactos?rev=66006&view=rev
Log: [SHELL32_WINETEST] Enable test_dde() and test_dde_default_app(). CORE-6559 Modified: trunk/rostests/winetests/shell32/shlexec.c Modified: trunk/rostests/winetests/shell32/shlexec.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/shlexec…
============================================================================== --- trunk/rostests/winetests/shell32/shlexec.c [iso-8859-1] (original) +++ trunk/rostests/winetests/shell32/shlexec.c [iso-8859-1] Thu Jan 8 16:42:35 2015 @@ -2693,16 +2693,8 @@ test_find_executable(); test_lnks(); test_exes(); -if(winetest_interactive) -{ test_dde(); test_dde_default_app(); -} -else -{ - win_skip("Skipping test_dde() until we have a sane DDE implementation. CORE-6559.\n"); - win_skip("Skipping test_dde_default_app() until we have a sane DDE implementation. CORE-6559.\n"); -} test_directory(); cleanup_test();
9 years, 11 months
1
0
0
0
← Newer
1
...
10
11
12
13
14
15
16
...
21
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
Results per page:
10
25
50
100
200