Compare commits

...

14 Commits

Author SHA1 Message Date
Hermès Bélusca-Maïto
552610d60d [CLT-2017]: The very last sync!
[SHUTDOWN]: shutdown -t causes crash. Patch by Michael Fritscher. (r74131 by Eric).
<@dreimer> OMG!!!!
<@hbelusca> hm dreimer?
<@dreimer> ITS SO IMPORTANT!!!!
<@hbelusca> ah you want it? <@hbelusca> ok <@hbelusca> let's add it :D
<@dreimer> jkjkjk

svn path=/branches/ReactOS-0.4.4-CLT2017/; revision=74133
2017-03-08 22:34:01 +00:00
Hermès Bélusca-Maïto
c036b65fcd [CLT-2017]: Add the lstrlenA/W fixes from r74117,r74118,r74119.
svn path=/branches/ReactOS-0.4.4-CLT2017/; revision=74130
2017-03-08 22:22:13 +00:00
Hermès Bélusca-Maïto
46c0880849 [CLT-2017]: For this 0.4.4 release, let's play safe & revert the USB stack import from r73605, as the latter need more real-hardware testing & fixes.
svn path=/branches/ReactOS-0.4.4-CLT2017/; revision=74129
2017-03-08 22:20:11 +00:00
Daniel Reimer
79d74debe5 [CLT2017]
Make CLT logo a bit more... on screen

svn path=/branches/ReactOS-0.4.4-CLT2017/; revision=74124
2017-03-07 22:34:08 +00:00
Daniel Reimer
3eeb4124c8 [CLT2017]
Add wallpapers to ISO

svn path=/branches/ReactOS-0.4.4-CLT2017/; revision=74122
2017-03-07 22:13:23 +00:00
Hermès Bélusca-Maïto
7fbaac54b4 [NTOS]: Modify the ReactOS boot logo for the CLT 2017 edition, similarly to what was done for FOSDEM 2017.
svn path=/branches/ReactOS-0.4.4-CLT2017/; revision=74121
2017-03-06 23:37:31 +00:00
Hermès Bélusca-Maïto
f66503f65f [REACTOS-CLT2017]: Cherry-pick few trunk improvements/fixes:
- [UXTHME] Implement drawing themed text with shadows, by Giannis (r74083)
- [MKISOFS] Update mkisofs to schily-2017-02-16, by Colin (r74112)

svn path=/branches/ReactOS-0.4.4-CLT2017/; revision=74115
2017-03-06 00:13:43 +00:00
Hermès Bélusca-Maïto
a9ebf1a4d9 [REACTOS-CLT2017]: Sync with ROS 0.4.4 release branch. In particular the following fixes/hacks:
- Apply the Wordpad related hack from CORE-5823 by Jared Smudde (r73624).
- Disable COMMAND.COM debugging messages. CORE-10710 (r73625).
- Add a hack by Thomas to avoid MmGetPhysicalAddress failures during USB transfers. CORE-9224 (r73627).
- Apply the patch that allows us to dynamically change the resolution by resizing in VirtualBox. CORE-6742 (r73628).
- Mask WndProc exceptions CORE-11915 (r73631).

svn path=/branches/ReactOS-0.4.4-CLT2017/; revision=74114
2017-03-06 00:05:13 +00:00
Hermès Bélusca-Maïto
896701f5ca [EXPLORER]: Update the Start Menu banner for CLT 2017.
svn path=/branches/ReactOS-0.4.4-CLT2017/; revision=74113
2017-03-05 23:05:49 +00:00
Hermès Bélusca-Maïto
8348d716cd [INF]: Disable hdaudbus.inf registration, because the driver currently crashes on the demo laptops Dell Latitude D531.
svn path=/branches/ReactOS-0.4.4-CLT2017/; revision=74084
2017-03-05 19:43:33 +00:00
Hermès Bélusca-Maïto
5849d40c93 [FREELDR]: HACK: Manually reduce the size of the temporary heap from 32MB down to 10MB, because, in some situations (e.g. Bochs, or real HW, see CORE-12694), FreeLDR fails when creating the temporary heap with an "out of memory" error.
See also r73653 for other details.

svn path=/branches/ReactOS-0.4.4-CLT2017/; revision=74082
2017-03-05 17:03:57 +00:00
Hermès Bélusca-Maïto
d358fe320a [BOOTDATA][FREELDR]
- By default, boot the livecd without the kernel debugger enabled, but...
- ... augment the FreeLdr "Debugging Mode" option with serial+screen debug ports, so that, if someone wants to run ReactOS with the kernel debugger on real hardware, without serial port, (s)he still can do it and see the debug output.
I do that, until FreeLdr can support run-time editing boot options of existing boot menu entries.

svn path=/branches/ReactOS-0.4.4-CLT2017/; revision=74081
2017-03-05 17:01:37 +00:00
Hermès Bélusca-Maïto
311ee91e5d [BOOTDATA]
- Add user-friendly boot menu.
[README]
- Update the ReadMe.txt for CLT 2017.
[WELCOME]
- Add the welcome.exe localized customizations for CLT 2017.
[VERSION]
- Adjust version to 0.4.4 CLT 2017.

svn path=/branches/ReactOS-0.4.4-CLT2017/; revision=74080
2017-03-05 16:58:55 +00:00
Hermès Bélusca-Maïto
ea00f5ba6c [BOOTDATA]
- Flatten out the ISO layout for hybridcd (otherwise some problems appear for the livecd: see r66114 for more details).

svn path=/branches/ReactOS-0.4.4-CLT2017/; revision=74079
2017-03-05 16:38:33 +00:00
79 changed files with 874 additions and 915 deletions

View File

@@ -56,12 +56,11 @@ ParseArguments(struct CommandLineOptions* pOpts, int argc, WCHAR *argv[])
break;
case L'c': /* Comment on reason for shutdown */
if (index+1 > argc)
return ERROR_INVALID_DATA;
if(CheckCommentLength(argv[index+1]))
{
if (index+1 <= argc)
pOpts->message = argv[index+1];
else
return ERROR_INVALID_DATA;
index++;
}
else
@@ -72,10 +71,9 @@ ParseArguments(struct CommandLineOptions* pOpts, int argc, WCHAR *argv[])
break;
case L'd': /* Reason code [p|u:]xx:yy */
if (index+1 <= argc)
pOpts->reason = ParseReasonCode(argv[index+1]);
else
if (index+1 >= argc)
return ERROR_INVALID_DATA;
pOpts->reason = ParseReasonCode(argv[index+1]);
index++;
break;
@@ -101,7 +99,10 @@ ParseArguments(struct CommandLineOptions* pOpts, int argc, WCHAR *argv[])
break;
case L'm': /* Target remote systems (UNC name/IP address) */
if (index+1 >= argc)
return ERROR_INVALID_DATA;
pOpts->remote_system = argv[index+1];
index++;
break;
case L'p': /* Turn off local computer with no warning/time-out */
@@ -118,9 +119,12 @@ ParseArguments(struct CommandLineOptions* pOpts, int argc, WCHAR *argv[])
break;
case L't': /* Shutdown delay */
if (index+1 >= argc)
return ERROR_INVALID_DATA;
pOpts->shutdown_delay = _wtoi(argv[index+1]);
if (pOpts->shutdown_delay > 0)
pOpts->force = TRUE;
index++;
break;
default:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -16,8 +16,8 @@
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="Logo.svg"
inkscape:export-filename="F:\reactos\Logo.png"
sodipodi:docname="start_menu_banner.svg"
inkscape:export-filename="start_menu_banner.png"
inkscape:export-xdpi="72"
inkscape:export-ydpi="72">
<defs
@@ -79,9 +79,13 @@
<filter
style="color-interpolation-filters:sRGB;"
inkscape:label="Drop Shadow"
id="filter4197">
id="filter4197"
x="-0.02"
y="-0.10"
width="1.05"
height="1.25">
<feFlood
flood-opacity="0.68999999999999995"
flood-opacity="0.7"
flood-color="rgb(0,0,0)"
result="flood"
id="feFlood4199" />
@@ -93,11 +97,11 @@
id="feComposite4201" />
<feGaussianBlur
in="composite1"
stdDeviation="1"
stdDeviation="0.5"
result="blur"
id="feGaussianBlur4203" />
<feOffset
dx="-0.1"
dx="0.5"
dy="1"
result="offset"
id="feOffset4205" />
@@ -117,17 +121,17 @@
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="2.4967109"
inkscape:cx="-34.214085"
inkscape:cy="142.13217"
inkscape:cx="-34.417137"
inkscape:cy="166.47739"
inkscape:document-units="px"
inkscape:current-layer="svg2"
showgrid="false"
units="pt"
inkscape:window-width="1397"
inkscape:window-height="974"
inkscape:window-x="437"
inkscape:window-y="214"
inkscape:window-maximized="0" />
inkscape:window-width="1600"
inkscape:window-height="838"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1" />
<metadata
id="metadata7">
<rdf:RDF>
@@ -162,20 +166,20 @@
id="text4707"
y="34.69656"
x="-1058.8489"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:18.14050674px;line-height:100%;font-family:'AvantGarde Bk BT';-inkscape-font-specification:'AvantGarde Bk BT, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4197)"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:18.14050674px;line-height:100%;font-family:'AvantGarde Bk BT';-inkscape-font-specification:'AvantGarde Bk BT, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:0.40488964;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter4197)"
xml:space="preserve"><tspan
y="34.69656"
x="-1058.8489"
id="tspan4709"
sodipodi:role="line"><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:20.00007629px;line-height:100%;font-family:'AvantGarde Bk BT';-inkscape-font-specification:'AvantGarde Bk BT, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:19.99142647px;line-height:100%;font-family:'AvantGarde Bk BT';-inkscape-font-specification:'AvantGarde Bk BT, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;stroke:#ffffff;stroke-width:0.40488964;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="tspan4213">ReactOS</tspan><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:17.50006676px;line-height:100%;font-family:'AvantGarde Bk BT';-inkscape-font-specification:'AvantGarde Bk BT, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start"
id="tspan4209"> 0.5 - SVN</tspan></tspan></text>
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:17.20780945px;line-height:100%;font-family:'AvantGarde Bk BT';-inkscape-font-specification:'AvantGarde Bk BT, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;stroke:#ffffff;stroke-width:0.40488964;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="tspan4209"> 0.4.4 - CLT 2017</tspan></tspan></text>
<g
style="fill:#ffffff;fill-opacity:1"
id="layer1-2"
transform="matrix(-4.4824609e-5,-0.056,0.05634648,-4.4824609e-5,-16.777709,291.46496)">
transform="matrix(-4.4824609e-5,-0.056,0.05634648,-4.4824609e-5,-16.57728,291.46496)">
<g
style="fill:#ffffff;fill-opacity:1"
id="g5951"

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -131,32 +131,32 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "${CMAKE_CURRENT_BINARY_DIR}/empty\n")
# Create the empty Desktop, Favorites, and Start Menu folders. And many more.
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/All Users/Application Data=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/All Users/Documents/My Music=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/All Users/Documents/My Pictures=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/All Users/Documents/My Videos=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/All Users/Favorites=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/All Users/My Documents=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/All Users/Start Menu/Programs/StartUp=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/All Users/Templates=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Application Data=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Cookies=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Desktop=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Favorites=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Local Settings/Application Data=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Local Settings/History=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Local Settings/Temporary Internet Files=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/My Music=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/My Pictures=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/My Videos=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/NetHood=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/PrintHood=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Recent=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/SendTo=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Start Menu/Programs=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Start Menu/Programs/Administrative Tools=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Start Menu/Programs/StartUp=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "livecd/Profiles/Default User/Templates=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/All Users/Application Data=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/All Users/Documents/My Music=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/All Users/Documents/My Pictures=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/All Users/Documents/My Videos=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/All Users/Favorites=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/All Users/My Documents=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/All Users/Start Menu/Programs/StartUp=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/All Users/Templates=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/Application Data=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/Cookies=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/Desktop=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/Favorites=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/Local Settings/Application Data=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/Local Settings/History=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/Local Settings/Temporary Internet Files=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/My Music=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/My Pictures=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/My Videos=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/NetHood=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/PrintHood=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/Recent=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/SendTo=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/Start Menu/Programs=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/Start Menu/Programs/Administrative Tools=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/Start Menu/Programs/StartUp=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.lst "Profiles/Default User/Templates=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
add_custom_target(hybridcd
COMMAND native-mkisofs -quiet -o ${REACTOS_BINARY_DIR}/hybridcd.iso -iso-level 4

View File

@@ -32,7 +32,7 @@ add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/readme.txt DESTINATION reactos FOR
# Welcome.exe optional custom configuration (only for HybridCD)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/welcome_config/)
# Copy the main configuration file
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/welcome_config/welcome.ini DESTINATION bootcd/reactos NO_CAB FOR hybridcd)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/welcome_config/welcome.ini DESTINATION setup/reactos NO_CAB FOR hybridcd)
# Convert the translation files (name format: xx-YY.ini) into UTF-16
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/welcome_config)
@@ -43,7 +43,7 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/welcome_config/)
add_custom_command(OUTPUT "${_converted_file}"
COMMAND native-utf16le "${_source_file}" "${_converted_file}"
DEPENDS native-utf16le "${_source_file}")
add_cd_file(TARGET converted_welcome_i18n_files FILE ${_converted_file} DESTINATION bootcd/reactos/welcome NO_CAB NAME_ON_CD ${_file} FOR hybridcd)
add_cd_file(TARGET converted_welcome_i18n_files FILE ${_converted_file} DESTINATION setup/reactos/welcome NO_CAB NAME_ON_CD ${_file} FOR hybridcd)
list(APPEND _converted_welcome_i18n_files ${_converted_file})
endforeach(_file)
add_custom_target(converted_welcome_i18n_files DEPENDS ${_converted_welcome_i18n_files})

View File

@@ -1,3 +1,3 @@
[autorun]
open=bootcd\reactos\welcome.exe
open=setup\reactos\welcome.exe
icon=icon.ico

View File

@@ -64,9 +64,9 @@ HKCU,"Control Panel\Desktop","ScreenSaverIsSecure",2,"1"
HKCU,"Control Panel\Desktop","ScreenSaveTimeOut",0,"600"
HKCU,"Control Panel\Desktop","WaitToKillAppTimeout",2,"20000"
HKCU,"Control Panel\Desktop","Pattern",2,"(None)"
HKCU,"Control Panel\Desktop","Wallpaper",0x00000000,""
HKCU,"Control Panel\Desktop","Wallpaper",0x00000000,"%SystemRoot%\Web\Wallpaper\ReactOS_CLT_1.bmp"
HKCU,"Control Panel\Desktop","TileWallpaper",2,"0"
HKCU,"Control Panel\Desktop","WallpaperStyle",2,"2"
HKCU,"Control Panel\Desktop","WallpaperStyle",2,"0"
HKCU,"Control Panel\Desktop","FontSmoothing",0,"1"
HKCU,"Control Panel\Desktop","FontSmoothingOrientation",0x00010003,0x00000001
HKCU,"Control Panel\Desktop","FontSmoothingType",0x00010003,0x00000001

View File

@@ -1,9 +1,9 @@
[FREELOADER]
DefaultOS=Setup
TimeOut=5
DefaultOS=LiveCD_RamDisk
TimeOut=20
[Display]
TitleText=ReactOS Hybrid-CD
TitleText=ReactOS 0.4.4 for CLT 2017
StatusBarColor=Cyan
StatusBarTextColor=Black
BackdropTextColor=White
@@ -13,62 +13,33 @@ TitleBoxTextColor=White
TitleBoxColor=Red
MessageBoxTextColor=White
MessageBoxColor=Blue
MenuTextColor=Gray
MenuColor=Black
TextColor=Gray
MenuTextColor=White
MenuColor=Blue
TextColor=Yellow
SelectedTextColor=Black
SelectedColor=Gray
ShowTime=No
MenuBox=No
CenterMenu=No
MinimalUI=Yes
TimeText=Seconds until highlighted choice will be started automatically:
SpecialEffects=Yes
[Operating Systems]
Setup="Setup"
LiveCD="LiveCD"
LiveCD_Debug="LiveCD (Debug)"
LiveCD_Screen="LiveCD (Screen)"
LiveCD_LogFile="LiveCD (Log file)"
LiveCD_RamDisk="LiveCD in RAM"
LiveCD_RamDisk_Debug="LiveCD in RAM (Debug)"
LiveCD_RamDisk_Screen="LiveCD in RAM (Screen)"
Setup="ReactOS Setup"
LiveCD="ReactOS Live"
LiveCD_RamDisk="ReactOS Live in RAM"
HddBoot="Boot from first hard disk"
[Setup]
BootType=ReactOSSetup
SystemPath=\bootcd
SystemPath=\setup
[LiveCD]
BootType=Windows2003
SystemPath=\livecd\reactos
SystemPath=\reactos
Options=/MININT
[LiveCD_Debug]
BootType=Windows2003
SystemPath=\livecd\reactos
Options=/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /MININT
[LiveCD_Screen]
BootType=Windows2003
SystemPath=\livecd\reactos
Options=/DEBUG /DEBUGPORT=SCREEN /SOS /MININT
[LiveCD_LogFile]
BootType=Windows2003
SystemPath=\livecd\reactos
Options=/DEBUG /DEBUGPORT=FILE:\Device\HarddiskX\PartitionY\debug.log /SOS /MININT
[LiveCD_RamDisk]
BootType=Windows2003
SystemPath=ramdisk(0)\reactos
Options=/MININT /RDPATH=livecd\livecd.iso /RDEXPORTASCD
Options=/MININT /RDPATH=livecd.iso /RDEXPORTASCD
[LiveCD_RamDisk_Debug]
BootType=Windows2003
SystemPath=ramdisk(0)\reactos
Options=/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /MININT /RDPATH=livecd\livecd.iso /RDEXPORTASCD
[LiveCD_RamDisk_Screen]
BootType=Windows2003
SystemPath=ramdisk(0)\reactos
Options=/DEBUG /DEBUGPORT=SCREEN /SOS /MININT /RDPATH=livecd\livecd.iso /RDEXPORTASCD
[HddBoot]
BootType=Drive
BootDrive=hd0

View File

@@ -1,7 +1,30 @@
========================
ReactOS<EFBFBD> Version 0.4.x
Updated August 31, 2016
========================
================================================================================
ReactOS<EFBFBD> Version 0.4.4
f<EFBFBD>r die Chemnitzer Linux-Tage 2017
================================================================================
Willkommen zu ReactOS!
0. CD-ROM Inhalt
----------------
* ReactOS Live-System/Installation
* ReactOS in einer virtuellen QEMU-Maschine
* ReactOS Build Environment (RosBE)
* Quellcode
Diese CD-ROM sollte unter Windows ein AutoRun-Programm starten. Alternativ
k<EFBFBD>nnen Sie sich den CD-ROM Inhalt <20>ber einen Dateibrowser anschauen.
Die Ordnernamen sollten selbsterkl<6B>rend sein.
Der gesamte Quellcode des Betriebssystems l<>sst sich unter Einsatz des
ReactOS Build Environments sowohl unter Windows als auch unter
Unix-<2D>hnlichen Betriebssystemen wie Linux kompilieren.
Weitere Informationen <20>ber ReactOS finden Sie unter www.reactos.org!
================================================================================
1. What is ReactOS?
-------------------

View File

@@ -0,0 +1,47 @@
[Defaults]
AppTitle = "ReactOS 0.4.4 für CLT 2017"
DefaultTopicTitle = "ReactOS"
DefaultTopicDescription = "ReactOS ist ein modernes Open-Source-Betriebssystem, welches auf dem Design von Windows® XP/2003 basiert. Dazu gehört sowohl die volle Kompatibilität mit Windows-Anwendungen und -Treibern als auch eine ähnliche Benutzeroberfläche, damit sich die meisten Anwender sofort zurechtfinden. Der Quellcode des gesamten Systems ist frei verfügbar und steht größtenteils unter der GNU General Public License."
[Topic0]
Button = "ReactOS installieren"
Title = "ReactOS installieren"
Description = "Installiert ReactOS auf ihrem Computer.\n\nBitte beachten Sie, dass Sie Ihren Computer mit der ReactOS-CD im Laufwerk neu starten müssen, um die Installation zu starten.\n\nAlternativ können Sie ReactOS problemlos in einer virtuellen QEMU-Maschine ausprobieren, wenn Sie den entsprechenden Menüpunkt auf der linken Seite wählen."
Action = "<msg>Sie müssen Ihren Computer mit der ReactOS-CD im Laufwerk neu starten, um die Installation zu starten.\n\nBITTE BEACHTEN SIE: Es wird dringend davon abgeraten, ReactOS auf einem Computer zu installieren, welcher wichtige Daten enthält!"
[Topic1]
Button = "ReactOS in QEMU ausprobieren"
Title = "ReactOS in QEMU ausprobieren"
Description = "Möglicherweise möchten Sie ein Betriebssystem im Alpha-Stadium nicht auf Ihrem eigenen Computer testen oder es gibt Probleme bei der Installation. Daher haben wir ReactOS auf einer virtuellen QEMU-Maschine vorinstalliert, mit der Sie das Betriebssystem problemlos testen können, ohne dass es direkt auf Ihrem Computer installiert werden muss.\n\nEin Klick auf diesen Menüpunkt öffnet das QEMU-Paket in 7-Zip."
Action = "\extras\ReactOS on QEMU\ReactOS-044-CLT2017-QEMU.7z"
[Topic2]
Button = "ReactOS Build Environment installieren"
Title = "ReactOS Build Environment installieren"
Description = "Damit ReactOS so einfach wie möglich kompiliert werden kann, wurde das ReactOS Build Environment geschaffen. Dieses enthält die passenden Compiler-Versionen und alle nötigen Tools, um den gesamten ReactOS-Quellcode zu kompilieren.\n\nDie Windows-Version des Build Environments ist kompatibel mit Windows XP oder neueren Versionen. Sie wird über diesen Menüpunkt installiert.\nDie CD enthält auch das Build Environment für Unix-ähnliche Betriebssysteme, wie z.B. Linux oder Mac OS X.\n\nZusätzlich befindet sich auf dieser CD der Quellcode dieser ReactOS-Version."
Action = "\extras\ReactOS Build Environment\RosBE-2.1.3.exe"
[Topic3]
Button = "ReactOS-Quellcodepaket öffnen"
Title = "ReactOS-Quellcodepaket öffnen"
Description = "Die CD enthält auch den gesamten Quellcode dieser ReactOS-Version, welcher mit dem ReactOS Build Environment kompiliert werden kann.\n\nEin Klick auf diesen Menüpunkt öffnet ihn in 7-Zip."
Action = "\extras\ReactOS Source Code\ReactOS-044-CLT2017-Source.7z"
[Topic4]
Button = "Die ReactOS-Website besuchen"
Title = "Die ReactOS-Website besuchen"
Description = "Die ReactOS-Website liefert viele weitere Informationen über das Projekt. Hier finden Sie die neusten ReactOS-Versionen und Neuigkeiten bezüglich der Entwicklung."
Action = "https://www.reactos.org/"
[Topic5]
Button = "Die CD durchsuchen"
Title = "Die CD durchsuchen"
Description = "Durchsuchen Sie den Inhalt dieser CD."
Action = "explorer.exe"
[Topic6]
Button = "Beenden"
Title = "Beenden"
Description = "Beendet das AutoRun-Programm."
Action = "<exit>"

View File

@@ -0,0 +1,47 @@
[Defaults]
AppTitle = "ReactOS 0.4.4 for CLT 2017"
DefaultTopicTitle = "ReactOS"
DefaultTopicDescription = "ReactOS is a modern open source operating system based on the design of Windows® XP/2003. This encompasses full compatibility with Windows applications and drivers as well as a familiar user interface, such that people accustomed to Windows would find using ReactOS straightforward. The source code of the entire system is available for free under several open source licenses, mostly the GNU General Public License."
[Topic0]
Button = "Install ReactOS"
Title = "Install ReactOS"
Description = "Installs ReactOS on your computer.\n\nPlease note that you have to restart your computer with the ReactOS CD in the drive to start the installation.\n\nAlternatively, you can easily try out ReactOS in a QEMU virtual machine by choosing the respective menu entry on the left side."
Action = "<msg>You have to restart your computer with the ReactOS CD in the drive to start the installation.\n\nPLEASE NOTE: You're highly advised to not install ReactOS on a computer that contains important data!"
[Topic1]
Button = "Try out ReactOS in QEMU"
Title = "Try out ReactOS in QEMU"
Description = "Perhaps you don't want to try out an alpha-stage operating system on your own computer or you face problems during the installation. For these cases, we have preinstalled ReactOS on a QEMU virtual machine. This way, you can try out the operating system without needing to install it on your computer.\n\nA click on this menu entry opens the QEMU package in 7-Zip."
Action = "\extras\ReactOS on QEMU\ReactOS-044-CLT2017-QEMU.7z"
[Topic2]
Button = "Install ReactOS Build Environment"
Title = "Install ReactOS Build Environment"
Description = "To make building ReactOS as easy as possible, the ReactOS Build Environment has been created. This contains the right compiler versions and all needed tools to compile the entire ReactOS Source Code.\n\nThe Windows version of the Build Environment is compatible with Windows XP or newer versions. It is installed using this menu entry.\n\nAdditionally, the source code of this ReactOS version is included on this CD."
Action = "\extras\ReactOS Build Environment\RosBE-2.1.3.exe"
[Topic3]
Button = "Open the ReactOS Source Code Package"
Title = "Open the ReactOS Source Code Package"
Description = "The CD also contains the entire source code of this ReactOS version, which can be compiled using the ReactOS Build Environment.\n\nA click on this menu entry opens it in 7-Zip."
Action = "\extras\ReactOS Source Code\ReactOS-044-CLT2017-Source.7z"
[Topic4]
Button = "Visit the ReactOS Website"
Title = "Visit the ReactOS Website"
Description = "The ReactOS Website offers many more information about the project. Here you find the latest ReactOS releases and news regarding the development."
Action = "https://www.reactos.org/"
[Topic5]
Button = "Browse the CD"
Title = "Browse the CD"
Description = "Browse the contents of this CD."
Action = "explorer.exe"
[Topic6]
Button = "Exit"
Title = "Exit"
Description = "Exits the AutoRun program."
Action = "<exit>"

View File

@@ -121,7 +121,7 @@ PVOID MmAllocateHighestMemoryBelowAddress(SIZE_T MemorySize, PVOID DesiredAdd
/* Heap */
#define DEFAULT_HEAP_SIZE (1024 * 1024)
#define TEMP_HEAP_SIZE (32 * 1024 * 1024)
#define TEMP_HEAP_SIZE (10 * 1024 * 1024)
extern PVOID FrLdrDefaultHeap;
extern PVOID FrLdrTempHeap;

View File

@@ -277,5 +277,9 @@ VOID AppendBootTimeOptions(PCHAR BootOptions)
strcat(BootOptions, " /BASEVIDEO");
if (DebuggingMode)
#if 0
strcat(BootOptions, " /DEBUG");
#else
strcat(BootOptions, " /DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /DEBUGPORT=SCREEN /SOS");
#endif
}

View File

@@ -27,7 +27,8 @@ lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
return 1;
Result = CompareStringA(GetThreadLocale(), 0, lpString1, -1, lpString2, -1);
if (Result) Result -= 2;
if (Result)
Result -= 2;
return Result;
}
@@ -56,6 +57,7 @@ lstrcmpiA(LPCSTR lpString1, LPCSTR lpString2)
return Result;
}
/*
* @implemented
*/
@@ -144,6 +146,9 @@ lstrlenA(LPCSTR lpString)
{
INT Ret = 0;
if (lpString == NULL)
return 0;
_SEH2_TRY
{
Ret = strlen(lpString);
@@ -292,6 +297,9 @@ lstrlenW(LPCWSTR lpString)
{
INT Ret = 0;
if (lpString == NULL)
return 0;
_SEH2_TRY
{
Ret = wcslen(lpString);

View File

@@ -1617,6 +1617,9 @@ HRESULT WINAPI DrawThemeIcon(HTHEME hTheme, HDC hdc, int iPartId, int iStateId,
return E_NOTIMPL;
}
typedef int (WINAPI * DRAWSHADOWTEXT)(HDC hdc, LPCWSTR pszText, UINT cch, RECT *prc, DWORD dwFlags,
COLORREF crText, COLORREF crShadow, int ixOffset, int iyOffset);
/***********************************************************************
* DrawThemeText (UXTHEME.@)
*/
@@ -1630,34 +1633,89 @@ HRESULT WINAPI DrawThemeText(HTHEME hTheme, HDC hdc, int iPartId, int iStateId,
LOGFONTW logfont;
COLORREF textColor;
COLORREF oldTextColor;
COLORREF shadowColor;
POINT ptShadowOffset;
int oldBkMode;
RECT rt;
int iShadowType;
TRACE("%d %d: stub\n", iPartId, iStateId);
if(!hTheme)
return E_HANDLE;
hr = GetThemeFont(hTheme, hdc, iPartId, iStateId, TMT_FONT, &logfont);
if(SUCCEEDED(hr)) {
if(SUCCEEDED(hr))
{
hFont = CreateFontIndirectW(&logfont);
if(!hFont)
TRACE("Failed to create font\n");
{
ERR("Failed to create font\n");
}
}
CopyRect(&rt, pRect);
if(hFont)
oldFont = SelectObject(hdc, hFont);
oldBkMode = SetBkMode(hdc, TRANSPARENT);
if(dwTextFlags2 & DTT_GRAYED)
textColor = GetSysColor(COLOR_GRAYTEXT);
else {
if(FAILED(GetThemeColor(hTheme, iPartId, iStateId, TMT_TEXTCOLOR, &textColor)))
textColor = GetTextColor(hdc);
}
oldTextColor = SetTextColor(hdc, textColor);
oldBkMode = SetBkMode(hdc, TRANSPARENT);
hr = GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_TEXTSHADOWTYPE, &iShadowType);
if (SUCCEEDED(hr))
{
ERR("Got shadow type %d\n", iShadowType);
hr = GetThemeColor(hTheme, iPartId, iStateId, TMT_TEXTSHADOWCOLOR, &shadowColor);
if (FAILED(hr))
{
ERR("GetThemeColor failed\n");
}
hr = GetThemePosition(hTheme, iPartId, iStateId, TMT_TEXTSHADOWOFFSET, &ptShadowOffset);
if (FAILED(hr))
{
ERR("GetThemePosition failed\n");
}
if (iShadowType == TST_SINGLE)
{
oldTextColor = SetTextColor(hdc, shadowColor);
OffsetRect(&rt, ptShadowOffset.x, ptShadowOffset.y);
DrawTextW(hdc, pszText, iCharCount, &rt, dwTextFlags);
SetBkMode(hdc, oldBkMode);
OffsetRect(&rt, -ptShadowOffset.x, -ptShadowOffset.y);
SetTextColor(hdc, oldTextColor);
}
else if (iShadowType == TST_CONTINUOUS)
{
HANDLE hcomctl32 = GetModuleHandleW(L"comctl32.dll");
DRAWSHADOWTEXT pDrawShadowText;
if (!hcomctl32)
{
hcomctl32 = LoadLibraryW(L"comctl32.dll");
if (!hcomctl32)
ERR("Failed to load comctl32\n");
}
pDrawShadowText = (DRAWSHADOWTEXT)GetProcAddress(hcomctl32, "DrawShadowText");
if (pDrawShadowText)
{
pDrawShadowText(hdc, pszText, iCharCount, &rt, dwTextFlags, textColor, shadowColor, ptShadowOffset.x, ptShadowOffset.y);
goto cleanup;
}
}
}
oldTextColor = SetTextColor(hdc, textColor);
DrawTextW(hdc, pszText, iCharCount, &rt, dwTextFlags);
SetTextColor(hdc, oldTextColor);
cleanup:
SetBkMode(hdc, oldBkMode);
if(hFont) {
SelectObject(hdc, oldFont);

View File

@@ -136,7 +136,7 @@ HRESULT WINAPI ThemeDrawCaptionText(HTHEME hTheme, HDC hdc, int iPartId, int iSt
oldTextColor = SetTextColor(hdc, textColor);
oldBkMode = SetBkMode(hdc, TRANSPARENT);
DrawTextW(hdc, pszText, iCharCount, &rt, dwTextFlags);
DrawThemeText(hTheme, hdc, iPartId, iStateId, pszText, iCharCount, dwTextFlags, dwTextFlags, pRect);
SetBkMode(hdc, oldBkMode);
SetTextColor(hdc, oldTextColor);

View File

@@ -125,29 +125,6 @@ HidP_GetCaps(
return HidParser_GetCaps(&Parser, PreparsedData, Capabilities);
}
NTSTATUS
TranslateStatusForUpperLayer(
IN HIDPARSER_STATUS Status)
{
//
// now we are handling only this values, for others just return
// status as it is.
//
switch (Status)
{
case HIDPARSER_STATUS_INSUFFICIENT_RESOURCES:
return STATUS_INSUFFICIENT_RESOURCES;
case HIDPARSER_STATUS_INVALID_REPORT_TYPE:
return HIDP_STATUS_INVALID_REPORT_TYPE;
case HIDPARSER_STATUS_BUFFER_TOO_SMALL:
return STATUS_BUFFER_TOO_SMALL;
case HIDPARSER_STATUS_COLLECTION_NOT_FOUND:
return STATUS_NO_DATA_DETECTED;
default:
return Status;
}
}
NTSTATUS
NTAPI
HidP_GetCollectionDescription(
@@ -157,7 +134,6 @@ HidP_GetCollectionDescription(
OUT PHIDP_DEVICE_DESC DeviceDescription)
{
HID_PARSER Parser;
NTSTATUS Status;
//
// init parser
@@ -167,8 +143,7 @@ HidP_GetCollectionDescription(
//
// get description;
//
Status = HidParser_GetCollectionDescription(&Parser, ReportDesc, DescLength, PoolType, DeviceDescription);
return TranslateStatusForUpperLayer(Status);
return HidParser_GetCollectionDescription(&Parser, ReportDesc, DescLength, PoolType, DeviceDescription);
}
HIDAPI

View File

@@ -601,6 +601,7 @@ CUSBRequest::InitDescriptor(
//
// get address
//
*(volatile char *)TransferBuffer; // HACK for CORE-9224
Address = MmGetPhysicalAddress(TransferBuffer);
//

View File

@@ -1,6 +1,5 @@
add_definitions(-DDEBUG_MODE)
add_definitions(-DNTDDI_VERSION=0x05020400)
include_directories(${REACTOS_SOURCE_DIR}/ntoskrnl/include)
list(APPEND SOURCE

View File

@@ -569,11 +569,6 @@ QueryInterface(
Stack->Parameters.QueryInterface.Interface = Interface;
Stack->Parameters.QueryInterface.InterfaceSpecificData = NULL;
//
// Initialize the status block before sending the IRP
//
Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
Status = IoCallDriver(DeviceObject, Irp);
if (Status == STATUS_PENDING)
@@ -1094,7 +1089,8 @@ DestroyUsbChildDeviceObject(
PDEVICE_OBJECT ChildDeviceObject = NULL;
ULONG Index = 0;
KeAcquireGuardedMutex(&HubDeviceExtension->HubMutexLock);
DPRINT("Removing device on port %d (Child index: %d)\n", PortId, Index);
for (Index = 0; Index < USB_MAXCHILDREN; Index++)
{
if (HubDeviceExtension->ChildDeviceObject[Index])
@@ -1115,17 +1111,12 @@ DestroyUsbChildDeviceObject(
if (!ChildDeviceObject)
{
DPRINT1("Removal request for non-existant device!\n");
KeReleaseGuardedMutex(&HubDeviceExtension->HubMutexLock);
return STATUS_UNSUCCESSFUL;
}
DPRINT("Removing device on port %d (Child index: %d)\n", PortId, Index);
/* Remove the device from the table */
HubDeviceExtension->ChildDeviceObject[Index] = NULL;
KeReleaseGuardedMutex(&HubDeviceExtension->HubMutexLock);
/* Invalidate device relations for the root hub */
IoInvalidateDeviceRelations(HubDeviceExtension->RootHubPhysicalDeviceObject, BusRelations);
@@ -1156,6 +1147,26 @@ CreateUsbChildDeviceObject(
HubInterface = &HubDeviceExtension->HubInterface;
RootHubDeviceObject = HubDeviceExtension->RootHubPhysicalDeviceObject;
HubInterfaceBusContext = HubDeviceExtension->UsbDInterface.BusContext;
//
// Find an empty slot in the child device array
//
for (ChildDeviceCount = 0; ChildDeviceCount < USB_MAXCHILDREN; ChildDeviceCount++)
{
if (HubDeviceExtension->ChildDeviceObject[ChildDeviceCount] == NULL)
{
DPRINT("Found unused entry at %d\n", ChildDeviceCount);
break;
}
}
//
// Check if the limit has been reached for maximum usb devices
//
if (ChildDeviceCount == USB_MAXCHILDREN)
{
DPRINT1("USBHUB: Too many child devices!\n");
return STATUS_UNSUCCESSFUL;
}
while (TRUE)
{
@@ -1215,6 +1226,10 @@ CreateUsbChildDeviceObject(
UsbChildExtension->ParentDeviceObject = UsbHubDeviceObject;
UsbChildExtension->PortNumber = PortId;
// copy device interface
RtlCopyMemory(&UsbChildExtension->DeviceInterface, &HubDeviceExtension->DeviceInterface, sizeof(USB_BUS_INTERFACE_USBDI_V2));
//
// Create the UsbDeviceObject
//
@@ -1229,6 +1244,12 @@ CreateUsbChildDeviceObject(
goto Cleanup;
}
// copy device interface
RtlCopyMemory(&UsbChildExtension->DeviceInterface, &HubDeviceExtension->DeviceInterface, sizeof(USB_BUS_INTERFACE_USBDI_V2));
// FIXME replace buscontext
UsbChildExtension->DeviceInterface.BusContext = UsbChildExtension->UsbDeviceHandle;
//
// Initialize UsbDevice
//
@@ -1318,43 +1339,8 @@ CreateUsbChildDeviceObject(
goto Cleanup;
}
// copy device interface
RtlCopyMemory(&UsbChildExtension->DeviceInterface, &HubDeviceExtension->UsbDInterface, sizeof(USB_BUS_INTERFACE_USBDI_V2));
UsbChildExtension->DeviceInterface.InterfaceReference(UsbChildExtension->DeviceInterface.BusContext);
INITIALIZE_PNP_STATE(UsbChildExtension->Common);
IoInitializeRemoveLock(&UsbChildExtension->Common.RemoveLock, 'pbuH', 0, 0);
KeAcquireGuardedMutex(&HubDeviceExtension->HubMutexLock);
//
// Find an empty slot in the child device array
//
for (ChildDeviceCount = 0; ChildDeviceCount < USB_MAXCHILDREN; ChildDeviceCount++)
{
if (HubDeviceExtension->ChildDeviceObject[ChildDeviceCount] == NULL)
{
DPRINT("Found unused entry at %d\n", ChildDeviceCount);
break;
}
}
//
// Check if the limit has been reached for maximum usb devices
//
if (ChildDeviceCount == USB_MAXCHILDREN)
{
DPRINT1("USBHUB: Too many child devices!\n");
Status = STATUS_UNSUCCESSFUL;
KeReleaseGuardedMutex(&HubDeviceExtension->HubMutexLock);
UsbChildExtension->DeviceInterface.InterfaceDereference(UsbChildExtension->DeviceInterface.BusContext);
goto Cleanup;
}
HubDeviceExtension->ChildDeviceObject[ChildDeviceCount] = NewChildDeviceObject;
HubDeviceExtension->InstanceCount++;
KeReleaseGuardedMutex(&HubDeviceExtension->HubMutexLock);
IoInvalidateDeviceRelations(RootHubDeviceObject, BusRelations);
return STATUS_SUCCESS;
@@ -1398,20 +1384,16 @@ Cleanup:
NTSTATUS
USBHUB_FdoQueryBusRelations(
IN PDEVICE_OBJECT DeviceObject,
IN PDEVICE_RELATIONS RelationsFromTop,
OUT PDEVICE_RELATIONS* pDeviceRelations)
{
PHUB_DEVICE_EXTENSION HubDeviceExtension;
PDEVICE_RELATIONS DeviceRelations;
ULONG i;
ULONG ChildrenFromTop = 0;
ULONG Children = 0;
ULONG NeededSize;
HubDeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
KeAcquireGuardedMutex(&HubDeviceExtension->HubMutexLock);
//
// Count the number of children
//
@@ -1425,19 +1407,9 @@ USBHUB_FdoQueryBusRelations(
Children++;
}
if (RelationsFromTop)
{
ChildrenFromTop = RelationsFromTop->Count;
if (!Children)
{
// We have nothing to add
*pDeviceRelations = RelationsFromTop;
KeReleaseGuardedMutex(&HubDeviceExtension->HubMutexLock);
return STATUS_SUCCESS;
}
}
NeededSize = sizeof(DEVICE_RELATIONS) + (Children + ChildrenFromTop - 1) * sizeof(PDEVICE_OBJECT);
NeededSize = sizeof(DEVICE_RELATIONS);
if (Children > 1)
NeededSize += (Children - 1) * sizeof(PDEVICE_OBJECT);
//
// Allocate DeviceRelations
@@ -1446,22 +1418,9 @@ USBHUB_FdoQueryBusRelations(
NeededSize);
if (!DeviceRelations)
{
KeReleaseGuardedMutex(&HubDeviceExtension->HubMutexLock);
if (!RelationsFromTop)
return STATUS_INSUFFICIENT_RESOURCES;
else
return STATUS_NOT_SUPPORTED;
}
// Copy the objects coming from top
if (ChildrenFromTop)
{
RtlCopyMemory(DeviceRelations->Objects, RelationsFromTop->Objects,
ChildrenFromTop * sizeof(PDEVICE_OBJECT));
}
DeviceRelations->Count = Children + ChildrenFromTop;
Children = ChildrenFromTop;
DeviceRelations->Count = Children;
Children = 0;
//
// Fill in return structure
@@ -1470,19 +1429,12 @@ USBHUB_FdoQueryBusRelations(
{
if (HubDeviceExtension->ChildDeviceObject[i])
{
// The PnP Manager removes the reference when appropriate.
ObReferenceObject(HubDeviceExtension->ChildDeviceObject[i]);
HubDeviceExtension->ChildDeviceObject[i]->Flags &= ~DO_DEVICE_INITIALIZING;
DeviceRelations->Objects[Children++] = HubDeviceExtension->ChildDeviceObject[i];
}
}
KeReleaseGuardedMutex(&HubDeviceExtension->HubMutexLock);
// We should do this, because replaced this with our's one
if (RelationsFromTop)
ExFreePool(RelationsFromTop);
ASSERT(Children == DeviceRelations->Count);
*pDeviceRelations = DeviceRelations;
@@ -1599,8 +1551,7 @@ USBHUB_FdoStartDevice(
if (!Urb)
{
// no memory
Status = STATUS_INSUFFICIENT_RESOURCES;
goto cleanup;
return STATUS_INSUFFICIENT_RESOURCES;
}
// zero urb
@@ -1615,7 +1566,8 @@ USBHUB_FdoStartDevice(
{
// failed to obtain hub pdo
DPRINT1("IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO failed with %x\n", Status);
goto cleanup;
ExFreePool(Urb);
return Status;
}
// sanity checks
@@ -1626,13 +1578,14 @@ USBHUB_FdoStartDevice(
RootHubDeviceObject = HubDeviceExtension->RootHubPhysicalDeviceObject;
// Send the StartDevice to RootHub
Status = ForwardIrpAndWait(HubDeviceExtension->LowerDeviceObject, Irp);
Status = ForwardIrpAndWait(RootHubDeviceObject, Irp);
if (!NT_SUCCESS(Status))
{
// failed to start pdo
DPRINT1("Failed to start the RootHub PDO\n");
goto cleanup;
ExFreePool(Urb);
return Status;
}
// Get the current number of hubs
@@ -1643,7 +1596,8 @@ USBHUB_FdoStartDevice(
{
// failed to get number of hubs
DPRINT1("IOCTL_INTERNAL_USB_GET_HUB_COUNT failed with %x\n", Status);
goto cleanup;
ExFreePool(Urb);
return Status;
}
// Get the Hub Interface
@@ -1657,7 +1611,8 @@ USBHUB_FdoStartDevice(
{
// failed to get root hub interface
DPRINT1("Failed to get HUB_GUID interface with status 0x%08lx\n", Status);
goto cleanup;
ExFreePool(Urb);
return Status;
}
HubInterfaceBusContext = HubDeviceExtension->HubInterface.BusContext;
@@ -1673,7 +1628,8 @@ USBHUB_FdoStartDevice(
{
// failed to get usbdi interface
DPRINT1("Failed to get USBDI_GUID interface with status 0x%08lx\n", Status);
goto cleanup;
ExFreePool(Urb);
return Status;
}
// Get Root Hub Device Handle
@@ -1686,7 +1642,8 @@ USBHUB_FdoStartDevice(
{
// failed
DPRINT1("IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE failed with status 0x%08lx\n", Status);
goto cleanup;
ExFreePool(Urb);
return Status;
}
//
@@ -1730,7 +1687,8 @@ USBHUB_FdoStartDevice(
{
// failed to get device descriptor of hub
DPRINT1("Failed to get HubDeviceDescriptor!\n");
goto cleanup;
ExFreePool(Urb);
return Status;
}
// build configuration request
@@ -1757,7 +1715,8 @@ USBHUB_FdoStartDevice(
{
// failed to get configuration descriptor
DPRINT1("Failed to get RootHub Configuration with status %x\n", Status);
goto cleanup;
ExFreePool(Urb);
return Status;
}
// sanity checks
@@ -1783,15 +1742,16 @@ USBHUB_FdoStartDevice(
{
// failed to get hub information
DPRINT1("Failed to extended hub information. Unable to determine the number of ports!\n");
goto cleanup;
ExFreePool(Urb);
return Status;
}
if (!HubDeviceExtension->UsbExtHubInfo.NumberOfPorts)
{
// bogus port driver
DPRINT1("Failed to retrieve the number of ports\n");
Status = STATUS_UNSUCCESSFUL;
goto cleanup;
ExFreePool(Urb);
return STATUS_UNSUCCESSFUL;
}
DPRINT("HubDeviceExtension->UsbExtHubInfo.NumberOfPorts %x\n", HubDeviceExtension->UsbExtHubInfo.NumberOfPorts);
@@ -1822,8 +1782,8 @@ USBHUB_FdoStartDevice(
if (!NT_SUCCESS(Status))
{
DPRINT1("Failed to get Hub Descriptor!\n");
Status = STATUS_UNSUCCESSFUL;
goto cleanup;
ExFreePool(Urb);
return STATUS_UNSUCCESSFUL;
}
// sanity checks
@@ -1851,8 +1811,8 @@ USBHUB_FdoStartDevice(
{
// failed to get hub status
DPRINT1("Failed to get Hub Status!\n");
Status = STATUS_UNSUCCESSFUL;
goto cleanup;
ExFreePool(Urb);
return STATUS_UNSUCCESSFUL;
}
// Allocate memory for PortStatusChange to hold 2 USHORTs for each port on hub
@@ -1860,13 +1820,6 @@ USBHUB_FdoStartDevice(
sizeof(ULONG) * HubDeviceExtension->UsbExtHubInfo.NumberOfPorts,
USB_HUB_TAG);
if (!HubDeviceExtension->PortStatusChange)
{
DPRINT1("Failed to allocate pool for PortStatusChange!\n");
Status = STATUS_INSUFFICIENT_RESOURCES;
goto cleanup;
}
// Get the first Configuration Descriptor
Pid = USBD_ParseConfigurationDescriptorEx(&HubDeviceExtension->HubConfigDescriptor,
&HubDeviceExtension->HubConfigDescriptor,
@@ -1875,8 +1828,8 @@ USBHUB_FdoStartDevice(
{
// failed parse hub descriptor
DPRINT1("Failed to parse configuration descriptor\n");
Status = STATUS_UNSUCCESSFUL;
goto cleanup;
ExFreePool(Urb);
return STATUS_UNSUCCESSFUL;
}
// create configuration request
@@ -1887,8 +1840,8 @@ USBHUB_FdoStartDevice(
{
// failed to build urb
DPRINT1("Failed to allocate urb\n");
Status = STATUS_INSUFFICIENT_RESOURCES;
goto cleanup;
ExFreePool(Urb);
return STATUS_INSUFFICIENT_RESOURCES;
}
// send request
@@ -1900,7 +1853,9 @@ USBHUB_FdoStartDevice(
{
// failed to select configuration
DPRINT1("Failed to select configuration with %x\n", Status);
goto cleanup;
ExFreePool(Urb);
ExFreePool(ConfigUrb);
return Status;
}
// store configuration & pipe handle
@@ -1908,6 +1863,12 @@ USBHUB_FdoStartDevice(
HubDeviceExtension->PipeHandle = ConfigUrb->UrbSelectConfiguration.Interface.Pipes[0].PipeHandle;
DPRINT("Configuration Handle %x\n", HubDeviceExtension->ConfigurationHandle);
FDO_QueryInterface(DeviceObject, &HubDeviceExtension->DeviceInterface);
// free urb
ExFreePool(ConfigUrb);
// check if function is available
if (HubDeviceExtension->UsbDInterface.IsDeviceHighSpeed)
{
@@ -1947,7 +1908,8 @@ USBHUB_FdoStartDevice(
if (!NT_SUCCESS(Status))
{
DPRINT1("Failed to set callback\n");
goto cleanup;
ExFreePool(Urb);
return Status;
}
}
else
@@ -1999,30 +1961,8 @@ USBHUB_FdoStartDevice(
// free urb
ExFreePool(Urb);
// free ConfigUrb
ExFreePool(ConfigUrb);
// done
return Status;
cleanup:
if (Urb)
ExFreePool(Urb);
// Dereference interfaces
if (HubDeviceExtension->HubInterface.Size)
HubDeviceExtension->HubInterface.InterfaceDereference(HubDeviceExtension->HubInterface.BusContext);
if (HubDeviceExtension->UsbDInterface.Size)
HubDeviceExtension->UsbDInterface.InterfaceDereference(HubDeviceExtension->UsbDInterface.BusContext);
if (HubDeviceExtension->PortStatusChange)
ExFreePool(HubDeviceExtension->PortStatusChange);
if (ConfigUrb)
ExFreePool(ConfigUrb);
return Status;
}
NTSTATUS
@@ -2032,31 +1972,17 @@ USBHUB_FdoHandlePnp(
{
PIO_STACK_LOCATION Stack;
NTSTATUS Status = STATUS_SUCCESS;
PDEVICE_OBJECT ChildDeviceObject;
ULONG_PTR Information = 0;
PHUB_DEVICE_EXTENSION HubDeviceExtension;
PUSB_BUS_INTERFACE_HUB_V5 HubInterface;
PHUB_CHILDDEVICE_EXTENSION ChildDeviceExtension;
HubDeviceExtension = (PHUB_DEVICE_EXTENSION) DeviceObject->DeviceExtension;
HubInterface = &HubDeviceExtension->HubInterface;
Stack = IoGetCurrentIrpStackLocation(Irp);
Status = IoAcquireRemoveLock(&HubDeviceExtension->Common.RemoveLock, Irp);
if (!NT_SUCCESS(Status))
{
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
}
switch (Stack->MinorFunction)
{
int i;
case IRP_MN_START_DEVICE:
{
DPRINT("IRP_MN_START_DEVICE\n");
if (USBHUB_IsRootHubFDO(DeviceObject))
{
// start root hub fdo
@@ -2066,13 +1992,7 @@ USBHUB_FdoHandlePnp(
{
Status = USBHUB_ParentFDOStartDevice(DeviceObject, Irp);
}
SET_NEW_PNP_STATE(HubDeviceExtension->Common, Started);
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
IoReleaseRemoveLock(&HubDeviceExtension->Common.RemoveLock, Irp);
return Status;
break;
}
case IRP_MN_QUERY_DEVICE_RELATIONS:
@@ -2082,197 +2002,66 @@ USBHUB_FdoHandlePnp(
case BusRelations:
{
PDEVICE_RELATIONS DeviceRelations = NULL;
PDEVICE_RELATIONS RelationsFromTop = (PDEVICE_RELATIONS)Irp->IoStatus.Information;
DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n");
Status = USBHUB_FdoQueryBusRelations(DeviceObject, RelationsFromTop, &DeviceRelations);
Status = USBHUB_FdoQueryBusRelations(DeviceObject, &DeviceRelations);
if (!NT_SUCCESS(Status))
{
if (Status == STATUS_NOT_SUPPORTED)
{
// We should process this to not lose relations from top.
Irp->IoStatus.Status = STATUS_SUCCESS;
break;
}
// We should fail an IRP
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
IoReleaseRemoveLock(&HubDeviceExtension->Common.RemoveLock, Irp);
return Status;
}
Irp->IoStatus.Information = (ULONG_PTR)DeviceRelations;
Irp->IoStatus.Status = Status;
Information = (ULONG_PTR)DeviceRelations;
break;
}
case RemovalRelations:
{
DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / RemovalRelations\n");
break;
return ForwardIrpAndForget(DeviceObject, Irp);
}
default:
DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
Stack->Parameters.QueryDeviceRelations.Type);
break;
return ForwardIrpAndForget(DeviceObject, Irp);
}
break;
}
case IRP_MN_QUERY_STOP_DEVICE:
{
//
// We should fail this request, because we're not handling
// IRP_MN_STOP_DEVICE for now.We'll receive this IRP ONLY when
// PnP manager rebalances resources.
//
Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_NOT_SUPPORTED;
}
case IRP_MN_QUERY_REMOVE_DEVICE:
case IRP_MN_QUERY_STOP_DEVICE:
{
// No action is required from FDO because it have nothing to free.
DPRINT("IRP_MN_QUERY_REMOVE_DEVICE\n");
SET_NEW_PNP_STATE(HubDeviceExtension->Common, RemovePending);
Irp->IoStatus.Status = STATUS_SUCCESS;
break;
}
case IRP_MN_CANCEL_REMOVE_DEVICE:
{
DPRINT("IRP_MN_CANCEL_REMOVE_DEVICE\n");
if (HubDeviceExtension->Common.PnPState == RemovePending)
RESTORE_PREVIOUS_PNP_STATE(HubDeviceExtension->Common);
Irp->IoStatus.Status = STATUS_SUCCESS;
break;
}
case IRP_MN_SURPRISE_REMOVAL:
{
//
// We'll receive this IRP on HUB unexpected removal, or on USB
// controller removal from PCI port. Here we should "let know" all
// our children that their parent is removed and on next removal
// they also can be removed.
//
SET_NEW_PNP_STATE(HubDeviceExtension->Common, SurpriseRemovePending);
KeAcquireGuardedMutex(&HubDeviceExtension->HubMutexLock);
for (i = 0; i < USB_MAXCHILDREN; i++)
{
ChildDeviceObject = HubDeviceExtension->ChildDeviceObject[i];
if (ChildDeviceObject)
{
ChildDeviceExtension = (PHUB_CHILDDEVICE_EXTENSION)ChildDeviceObject->DeviceObjectExtension;
ChildDeviceExtension->ParentDeviceObject = NULL;
}
}
KeReleaseGuardedMutex(&HubDeviceExtension->HubMutexLock);
// This IRP can't be failed
Irp->IoStatus.Status = STATUS_SUCCESS;
break;
return ForwardIrpAndForget(DeviceObject, Irp);
}
case IRP_MN_REMOVE_DEVICE:
{
DPRINT("IRP_MN_REMOVE_DEVICE\n");
SET_NEW_PNP_STATE(HubDeviceExtension->Common, Deleted);
IoReleaseRemoveLockAndWait(&HubDeviceExtension->Common.RemoveLock, Irp);
//
// Here we should remove all child PDOs. At this point all children
// received and returned from IRP_MN_REMOVE so remove synchronization
// isn't needed here
//
KeAcquireGuardedMutex(&HubDeviceExtension->HubMutexLock);
for (i = 0; i < USB_MAXCHILDREN; i++)
{
ChildDeviceObject = HubDeviceExtension->ChildDeviceObject[i];
if (ChildDeviceObject)
{
PHUB_CHILDDEVICE_EXTENSION UsbChildExtension = (PHUB_CHILDDEVICE_EXTENSION)ChildDeviceObject->DeviceExtension;
SET_NEW_PNP_STATE(UsbChildExtension->Common, Deleted);
// Remove the usb device
if (UsbChildExtension->UsbDeviceHandle)
{
Status = HubInterface->RemoveUsbDevice(HubInterface->BusContext, UsbChildExtension->UsbDeviceHandle, 0);
ASSERT(Status == STATUS_SUCCESS);
}
// Free full configuration descriptor
if (UsbChildExtension->FullConfigDesc)
ExFreePool(UsbChildExtension->FullConfigDesc);
// Free ID buffers
if (UsbChildExtension->usCompatibleIds.Buffer)
ExFreePool(UsbChildExtension->usCompatibleIds.Buffer);
if (UsbChildExtension->usDeviceId.Buffer)
ExFreePool(UsbChildExtension->usDeviceId.Buffer);
if (UsbChildExtension->usHardwareIds.Buffer)
ExFreePool(UsbChildExtension->usHardwareIds.Buffer);
if (UsbChildExtension->usInstanceId.Buffer)
ExFreePool(UsbChildExtension->usInstanceId.Buffer);
DPRINT("Deleting child PDO\n");
IoDeleteDevice(DeviceObject);
ChildDeviceObject = NULL;
}
}
KeReleaseGuardedMutex(&HubDeviceExtension->HubMutexLock);
Irp->IoStatus.Status = STATUS_SUCCESS;
Status = ForwardIrpAndForget(DeviceObject, Irp);
IoCompleteRequest(Irp, IO_NO_INCREMENT);
IoDetachDevice(HubDeviceExtension->LowerDeviceObject);
DPRINT("Deleting FDO 0x%p\n", DeviceObject);
IoDeleteDevice(DeviceObject);
return Status;
return STATUS_SUCCESS;
}
case IRP_MN_QUERY_BUS_INFORMATION:
{
// Function drivers and filter drivers do not handle this IRP.
DPRINT("IRP_MN_QUERY_BUS_INFORMATION\n");
break;
}
case IRP_MN_QUERY_ID:
{
DPRINT("IRP_MN_QUERY_ID\n");
// Function drivers and filter drivers do not handle this IRP.
break;
}
case IRP_MN_QUERY_CAPABILITIES:
{
//
// If a function or filter driver does not handle this IRP, it
// should pass that down.
//
DPRINT("IRP_MN_QUERY_CAPABILITIES\n");
break;
}
default:
{
DPRINT(" IRP_MJ_PNP / unknown minor function 0x%lx\n", Stack->MinorFunction);
break;
return ForwardIrpAndForget(DeviceObject, Irp);
}
}
Status = ForwardIrpAndForget(DeviceObject, Irp);
IoReleaseRemoveLock(&HubDeviceExtension->Common.RemoveLock, Irp);
Irp->IoStatus.Information = Information;
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
}
@@ -2297,25 +2086,6 @@ USBHUB_FdoHandleDeviceControl(
// get device extension
HubDeviceExtension = (PHUB_DEVICE_EXTENSION) DeviceObject->DeviceExtension;
Status = IoAcquireRemoveLock(&HubDeviceExtension->Common.RemoveLock, Irp);
if (!NT_SUCCESS(Status))
{
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
}
// Prevent handling of control requests in remove pending state
if (HubDeviceExtension->Common.PnPState == RemovePending)
{
DPRINT1("[USBHUB] Request for removed device object %p\n", DeviceObject);
Irp->IoStatus.Status = STATUS_DEVICE_NOT_CONNECTED;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
IoReleaseRemoveLock(&HubDeviceExtension->Common.RemoveLock, Irp);
return STATUS_DEVICE_NOT_CONNECTED;
}
if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_USB_GET_NODE_INFORMATION)
{
// is the buffer big enough
@@ -2361,7 +2131,6 @@ USBHUB_FdoHandleDeviceControl(
// sanity checks
ASSERT(NodeConnectionInfo);
KeAcquireGuardedMutex(&HubDeviceExtension->HubMutexLock);
for(Index = 0; Index < USB_MAXCHILDREN; Index++)
{
if (HubDeviceExtension->ChildDeviceObject[Index] == NULL)
@@ -2388,7 +2157,6 @@ USBHUB_FdoHandleDeviceControl(
}
break;
}
KeReleaseGuardedMutex(&HubDeviceExtension->HubMutexLock);
// done
Irp->IoStatus.Information = sizeof(USB_NODE_INFORMATION);
Status = STATUS_SUCCESS;
@@ -2409,7 +2177,6 @@ USBHUB_FdoHandleDeviceControl(
// sanity checks
ASSERT(NodeKey);
KeAcquireGuardedMutex(&HubDeviceExtension->HubMutexLock);
for(Index = 0; Index < USB_MAXCHILDREN; Index++)
{
if (HubDeviceExtension->ChildDeviceObject[Index] == NULL)
@@ -2449,7 +2216,6 @@ USBHUB_FdoHandleDeviceControl(
NodeKey->ActualLength = Length + sizeof(USB_NODE_CONNECTION_DRIVERKEY_NAME);
break;
}
KeReleaseGuardedMutex(&HubDeviceExtension->HubMutexLock);
}
}
else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_USB_GET_NODE_CONNECTION_NAME)
@@ -2481,7 +2247,6 @@ USBHUB_FdoHandleDeviceControl(
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
IoReleaseRemoveLock(&HubDeviceExtension->Common.RemoveLock, Irp);
return Status;
}

View File

@@ -211,3 +211,84 @@ SubmitRequestToRootHub(
return Status;
}
NTSTATUS
NTAPI
FDO_QueryInterfaceCompletionRoutine(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp,
IN PVOID Context)
{
/* Set event */
KeSetEvent((PRKEVENT)Context, 0, FALSE);
/* Completion is done in the HidClassFDO_QueryCapabilities routine */
return STATUS_MORE_PROCESSING_REQUIRED;
}
NTSTATUS
FDO_QueryInterface(
IN PDEVICE_OBJECT DeviceObject,
IN OUT PUSB_BUS_INTERFACE_USBDI_V2 Interface)
{
PIRP Irp;
KEVENT Event;
NTSTATUS Status;
PIO_STACK_LOCATION IoStack;
PHUB_DEVICE_EXTENSION HubDeviceExtension;
/* Get device extension */
HubDeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
ASSERT(HubDeviceExtension->Common.IsFDO);
/* Init event */
KeInitializeEvent(&Event, NotificationEvent, FALSE);
/* Now allocate the irp */
Irp = IoAllocateIrp(DeviceObject->StackSize, FALSE);
if (!Irp)
{
/* No memory */
return STATUS_INSUFFICIENT_RESOURCES;
}
/* Get next stack location */
IoStack = IoGetNextIrpStackLocation(Irp);
/* Init stack location */
IoStack->MajorFunction = IRP_MJ_PNP;
IoStack->MinorFunction = IRP_MN_QUERY_INTERFACE;
IoStack->Parameters.QueryInterface.Interface = (PINTERFACE)Interface;
IoStack->Parameters.QueryInterface.InterfaceType = &USB_BUS_INTERFACE_USBDI_GUID;
IoStack->Parameters.QueryInterface.Version = USB_BUSIF_USBDI_VERSION_2;
IoStack->Parameters.QueryInterface.Size = sizeof(USB_BUS_INTERFACE_USBDI_V2);
/* Set completion routine */
IoSetCompletionRoutine(Irp,
FDO_QueryInterfaceCompletionRoutine,
(PVOID)&Event,
TRUE,
TRUE,
TRUE);
/* Pnp irps have default completion code */
Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
/* Call lower device */
Status = IoCallDriver(HubDeviceExtension->LowerDeviceObject, Irp);
if (Status == STATUS_PENDING)
{
/* Wait for completion */
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
}
/* Get status */
Status = Irp->IoStatus.Status;
/* Complete request */
IoFreeIrp(Irp);
/* Done */
return Status;
}

View File

@@ -146,25 +146,16 @@ IsValidPDO(
ChildDeviceExtension = (PHUB_CHILDDEVICE_EXTENSION)DeviceObject->DeviceExtension;
ASSERT(ChildDeviceExtension->Common.IsFDO == FALSE);
// This can happen when parent device was surprise removed.
if (ChildDeviceExtension->ParentDeviceObject == NULL)
return FALSE;
HubDeviceExtension = (PHUB_DEVICE_EXTENSION)ChildDeviceExtension->ParentDeviceObject->DeviceExtension;
KeAcquireGuardedMutex(&HubDeviceExtension->HubMutexLock);
for(Index = 0; Index < USB_MAXCHILDREN; Index++)
{
if (HubDeviceExtension->ChildDeviceObject[Index] == DeviceObject)
{
KeReleaseGuardedMutex(&HubDeviceExtension->HubMutexLock);
/* PDO exists */
return TRUE;
}
}
KeReleaseGuardedMutex(&HubDeviceExtension->HubMutexLock);
/* invalid pdo */
return FALSE;
@@ -199,31 +190,18 @@ USBHUB_PdoHandleInternalDeviceControl(
ChildDeviceExtension = (PHUB_CHILDDEVICE_EXTENSION)DeviceObject->DeviceExtension;
ASSERT(ChildDeviceExtension->Common.IsFDO == FALSE);
HubDeviceExtension = (PHUB_DEVICE_EXTENSION)ChildDeviceExtension->ParentDeviceObject->DeviceExtension;
RootHubDeviceObject = HubDeviceExtension->RootHubPhysicalDeviceObject;
Status = IoAcquireRemoveLock(&ChildDeviceExtension->Common.RemoveLock, Irp);
if (!NT_SUCCESS(Status))
if(!IsValidPDO(DeviceObject))
{
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
}
if (ChildDeviceExtension->Common.PnPState == SurpriseRemovePending ||
ChildDeviceExtension->Common.PnPState == RemovePending ||
ChildDeviceExtension->ParentDeviceObject == NULL)
{
// Parent or child device was surprise removed.
DPRINT1("[USBHUB] Request for removed device object %p\n", DeviceObject);
Irp->IoStatus.Status = STATUS_DEVICE_NOT_CONNECTED;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
IoReleaseRemoveLock(&ChildDeviceExtension->Common.RemoveLock, Irp);
return STATUS_DEVICE_NOT_CONNECTED;
}
HubDeviceExtension = (PHUB_DEVICE_EXTENSION)ChildDeviceExtension->ParentDeviceObject->DeviceExtension;
RootHubDeviceObject = HubDeviceExtension->RootHubPhysicalDeviceObject;
switch (Stack->Parameters.DeviceIoControl.IoControlCode)
{
case IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO:
@@ -323,7 +301,6 @@ USBHUB_PdoHandleInternalDeviceControl(
// Send the request to RootHub
//
Status = ForwardUrbToRootHub(RootHubDeviceObject, IOCTL_INTERNAL_USB_SUBMIT_URB, Irp, Urb, NULL);
IoReleaseRemoveLock(&ChildDeviceExtension->Common.RemoveLock, Irp);
return Status;
}
//
@@ -420,7 +397,6 @@ USBHUB_PdoHandleInternalDeviceControl(
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
}
IoReleaseRemoveLock(&ChildDeviceExtension->Common.RemoveLock, Irp);
return Status;
}
@@ -445,8 +421,6 @@ USBHUB_PdoStartDevice(
IoRegisterDeviceInterface(DeviceObject, &GUID_DEVINTERFACE_USB_DEVICE, NULL, &ChildDeviceExtension->SymbolicLinkName);
IoSetDeviceInterfaceState(&ChildDeviceExtension->SymbolicLinkName, TRUE);
SET_NEW_PNP_STATE(ChildDeviceExtension->Common, Started);
UNIMPLEMENTED;
return STATUS_SUCCESS;
}
@@ -589,20 +563,15 @@ USBHUB_PdoHandlePnp(
PIO_STACK_LOCATION Stack;
ULONG_PTR Information = 0;
PHUB_CHILDDEVICE_EXTENSION UsbChildExtension;
ULONG Index;
ULONG bFound;
PDEVICE_RELATIONS DeviceRelation;
PDEVICE_OBJECT ParentDevice;
UsbChildExtension = (PHUB_CHILDDEVICE_EXTENSION)DeviceObject->DeviceExtension;
Stack = IoGetCurrentIrpStackLocation(Irp);
MinorFunction = Stack->MinorFunction;
Status = IoAcquireRemoveLock(&UsbChildExtension->Common.RemoveLock, Irp);
if (!NT_SUCCESS(Status))
{
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
}
switch (MinorFunction)
{
case IRP_MN_START_DEVICE:
@@ -659,20 +628,17 @@ USBHUB_PdoHandlePnp(
}
case IRP_MN_QUERY_DEVICE_TEXT:
{
DPRINT("IRP_MN_QUERY_DEVICE_TEXT\n");
Status = USBHUB_PdoQueryDeviceText(DeviceObject, Irp, &Information);
break;
}
case IRP_MN_QUERY_ID:
{
DPRINT("IRP_MN_QUERY_ID\n");
Status = USBHUB_PdoQueryId(DeviceObject, Irp, &Information);
break;
}
case IRP_MN_QUERY_BUS_INFORMATION:
{
PPNP_BUS_INFORMATION BusInfo;
DPRINT("IRP_MN_QUERY_BUS_INFORMATION\n");
BusInfo = (PPNP_BUS_INFORMATION)ExAllocatePool(PagedPool, sizeof(PNP_BUS_INFORMATION));
RtlCopyMemory(&BusInfo->BusTypeGuid,
&GUID_BUS_TYPE_USB,
@@ -688,58 +654,42 @@ USBHUB_PdoHandlePnp(
{
PHUB_DEVICE_EXTENSION HubDeviceExtension = (PHUB_DEVICE_EXTENSION)UsbChildExtension->ParentDeviceObject->DeviceExtension;
PUSB_BUS_INTERFACE_HUB_V5 HubInterface = &HubDeviceExtension->HubInterface;
ParentDevice = UsbChildExtension->ParentDeviceObject;
DPRINT("IRP_MJ_PNP / IRP_MN_REMOVE_DEVICE\n");
ASSERT((UsbChildExtension->Common.PnPState == RemovePending) ||
(UsbChildExtension->Common.PnPState == SurpriseRemovePending));
SET_NEW_PNP_STATE(UsbChildExtension->Common, NotStarted);
if (!IsValidPDO(DeviceObject))
/* remove us from pdo list */
bFound = FALSE;
for(Index = 0; Index < USB_MAXCHILDREN; Index++)
{
// Parent or child device was surprise removed, freeing resources allocated for child device.
SET_NEW_PNP_STATE(UsbChildExtension->Common, Deleted);
IoReleaseRemoveLockAndWait(&UsbChildExtension->Common.RemoveLock, Irp);
// Remove the usb device
if (UsbChildExtension->UsbDeviceHandle)
if (HubDeviceExtension->ChildDeviceObject[Index] == DeviceObject)
{
Status = HubInterface->RemoveUsbDevice(HubInterface->BusContext, UsbChildExtension->UsbDeviceHandle, 0);
/* Remove the device */
Status = HubInterface->RemoveUsbDevice(HubDeviceExtension->UsbDInterface.BusContext, UsbChildExtension->UsbDeviceHandle, 0);
/* FIXME handle error */
ASSERT(Status == STATUS_SUCCESS);
/* remove us */
HubDeviceExtension->ChildDeviceObject[Index] = NULL;
bFound = TRUE;
break;
}
// Free full configuration descriptor
if (UsbChildExtension->FullConfigDesc)
ExFreePool(UsbChildExtension->FullConfigDesc);
// Free ID buffers
if (UsbChildExtension->usCompatibleIds.Buffer)
ExFreePool(UsbChildExtension->usCompatibleIds.Buffer);
if (UsbChildExtension->usDeviceId.Buffer)
ExFreePool(UsbChildExtension->usDeviceId.Buffer);
if (UsbChildExtension->usHardwareIds.Buffer)
ExFreePool(UsbChildExtension->usHardwareIds.Buffer);
if (UsbChildExtension->usInstanceId.Buffer)
ExFreePool(UsbChildExtension->usInstanceId.Buffer);
DPRINT("Deleting child PDO\n");
IoDeleteDevice(DeviceObject);
}
else
{
IoReleaseRemoveLock(&UsbChildExtension->Common.RemoveLock, Irp);
}
// If device is physically presented, we leave its PDO undeleted.
/* Complete the IRP */
Irp->IoStatus.Status = STATUS_SUCCESS;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
/* delete device */
IoDeleteDevice(DeviceObject);
if (bFound)
{
/* invalidate device relations */
IoInvalidateDeviceRelations(ParentDevice, BusRelations);
}
return STATUS_SUCCESS;
}
case IRP_MN_QUERY_DEVICE_RELATIONS:
@@ -749,7 +699,6 @@ USBHUB_PdoHandlePnp(
{
/* not supported */
Status = Irp->IoStatus.Status;
Information = Irp->IoStatus.Information;
break;
}
@@ -773,46 +722,13 @@ USBHUB_PdoHandlePnp(
break;
}
case IRP_MN_QUERY_STOP_DEVICE:
{
//
// We should fail this request, because we're not handling IRP_MN_STOP_DEVICE for now.
// We'll receive this IRP ONLY when the PnP manager rebalances resources.
//
Status = STATUS_NOT_SUPPORTED;
break;
}
case IRP_MN_QUERY_REMOVE_DEVICE:
{
//
// Free interface obtained from bottom, according MSDN we should
// check interfaces provided to top, but here we are not checking.
// All checking will be performed in roothub driver's
// IRP_MN_QUERY_REMOVE_DEVICE handler. This will make problems when
// buggy driver is loaded on top of us. But we decided to keep source
// simpler, because in any case buggy driver will prevent removing of
// whole stack.
//
UsbChildExtension->DeviceInterface.InterfaceDereference(UsbChildExtension->DeviceInterface.BusContext);
SET_NEW_PNP_STATE(UsbChildExtension->Common, RemovePending);
/* Sure, no problem */
Status = STATUS_SUCCESS;
Information = 0;
break;
}
case IRP_MN_CANCEL_REMOVE_DEVICE:
{
// Check to see have we received query-remove before
if (UsbChildExtension->Common.PnPState == RemovePending)
{
RESTORE_PREVIOUS_PNP_STATE(UsbChildExtension->Common);
UsbChildExtension->DeviceInterface.InterfaceReference(UsbChildExtension->DeviceInterface.BusContext);
}
Status = STATUS_SUCCESS;
break;
}
case IRP_MN_QUERY_INTERFACE:
{
DPRINT1("IRP_MN_QUERY_INTERFACE\n");
@@ -820,28 +736,17 @@ USBHUB_PdoHandlePnp(
{
DPRINT1("USB_BUS_INTERFACE_USBDI_GUID\n");
RtlCopyMemory(Stack->Parameters.QueryInterface.Interface, &UsbChildExtension->DeviceInterface, Stack->Parameters.QueryInterface.Size);
UsbChildExtension->DeviceInterface.InterfaceReference(UsbChildExtension->DeviceInterface.BusContext);
Status = STATUS_SUCCESS;
break;
}
// pass irp down
IoSkipCurrentIrpStackLocation(Irp);
Status = IoCallDriver(UsbChildExtension->ParentDeviceObject, Irp);
IoReleaseRemoveLock(&UsbChildExtension->Common.RemoveLock, Irp);
return Status;
return IoCallDriver(UsbChildExtension->ParentDeviceObject, Irp);
}
case IRP_MN_SURPRISE_REMOVAL:
{
DPRINT("[USBHUB] HandlePnp IRP_MN_SURPRISE_REMOVAL\n");
//
// Here we should free all resources and stop all access, lets just set
// the flag and do further clean-up in subsequent IRP_MN_REMOVE_DEVICE
// We can receive this IRP when device is physically connected (on stop/start fail).
//
SET_NEW_PNP_STATE(UsbChildExtension->Common, SurpriseRemovePending);
Status = STATUS_SUCCESS;
break;
}
@@ -853,8 +758,6 @@ USBHUB_PdoHandlePnp(
}
}
IoReleaseRemoveLock(&UsbChildExtension->Common.RemoveLock, Irp);
Irp->IoStatus.Information = Information;
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);

View File

@@ -62,7 +62,7 @@ USBHUB_AddDevice(
PDEVICE_OBJECT DeviceObject;
PHUB_DEVICE_EXTENSION HubDeviceExtension;
NTSTATUS Status;
DPRINT("USBHUB: AddDevice (%p)\n", PhysicalDeviceObject);
DPRINT("USBHUB: AddDevice\n");
//
// Create the Device Object
//
@@ -86,20 +86,12 @@ USBHUB_AddDevice(
HubDeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
RtlZeroMemory(HubDeviceExtension, sizeof(HUB_DEVICE_EXTENSION));
INITIALIZE_PNP_STATE(HubDeviceExtension->Common);
//
// Set this to Fdo
//
HubDeviceExtension->Common.IsFDO = TRUE;
DeviceObject->Flags |= DO_POWER_PAGABLE;
// initialize mutex
KeInitializeGuardedMutex(&HubDeviceExtension->HubMutexLock);
// initialize remove lock
IoInitializeRemoveLock(&HubDeviceExtension->Common.RemoveLock, 'buH', 0, 0);
//
// initialize reset complete event
//
@@ -166,18 +158,6 @@ USBHUB_DispatchDeviceControl(
return USBHUB_IrpStub(DeviceObject, Irp);
}
NTSTATUS NTAPI
USBHUB_DispatchSystemControl(
PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
DPRINT("Usbhub: DispatchSystemControl\n");
if (((PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->Common.IsFDO)
return USBHUB_IrpStub(DeviceObject, Irp);
else
return USBHUB_IrpStub(DeviceObject, Irp);
}
NTSTATUS NTAPI
USBHUB_DispatchInternalDeviceControl(
PDEVICE_OBJECT DeviceObject,
@@ -208,59 +188,37 @@ USBHUB_DispatchPower(
PIRP Irp)
{
PIO_STACK_LOCATION IoStack;
PHUB_DEVICE_EXTENSION DeviceExtension;
NTSTATUS Status;
IoStack = IoGetCurrentIrpStackLocation(Irp);
DeviceExtension = DeviceObject->DeviceExtension;
Status = IoAcquireRemoveLock(&DeviceExtension->Common.RemoveLock, Irp);
if (!NT_SUCCESS(Status))
{
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
}
DPRINT1("Power Function %x\n", IoStack->MinorFunction);
if (DeviceExtension->Common.IsFDO)
if (IoStack->MinorFunction == IRP_MN_SET_POWER)
{
PoStartNextPowerIrp(Irp);
IoSkipCurrentIrpStackLocation(Irp);
Status = PoCallDriver(DeviceExtension->LowerDeviceObject, Irp);
IoReleaseRemoveLock(&DeviceExtension->Common.RemoveLock, Irp);
return Status;
}
switch (IoStack->MinorFunction)
{
case IRP_MN_SET_POWER:
{
DPRINT("IRP_MN_SET_POWER\n");
break;
}
case IRP_MN_QUERY_POWER:
{
DPRINT("IRP_MN_QUERY_POWER\n");
break;
}
case IRP_MN_WAIT_WAKE:
{
DPRINT("IRP_MN_WAIT_WAKE\n");
break;
}
default:
{
DPRINT1("PDO IRP_MJ_POWER / unknown minor function 0x%lx\n", IoStack->MinorFunction);
Irp->IoStatus.Status = STATUS_SUCCESS;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Irp->IoStatus.Status;
return STATUS_SUCCESS;
}
else if (IoStack->MinorFunction == IRP_MN_QUERY_POWER)
{
PoStartNextPowerIrp(Irp);
Irp->IoStatus.Status = STATUS_SUCCESS;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_SUCCESS;
}
else if (IoStack->MinorFunction == IRP_MN_WAIT_WAKE)
{
PoStartNextPowerIrp(Irp);
Irp->IoStatus.Status = STATUS_SUCCESS;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_SUCCESS;
}
PoStartNextPowerIrp(Irp);
Irp->IoStatus.Status = STATUS_SUCCESS;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
IoReleaseRemoveLock(&DeviceExtension->Common.RemoveLock, Irp);
return STATUS_SUCCESS;
}
@@ -287,7 +245,6 @@ DriverEntry(
DriverObject->MajorFunction[IRP_MJ_CLOSE] = USBHUB_Close;
DriverObject->MajorFunction[IRP_MJ_CLEANUP] = USBHUB_Cleanup;
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = USBHUB_DispatchDeviceControl;
DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = USBHUB_DispatchSystemControl;
DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = USBHUB_DispatchInternalDeviceControl;
DriverObject->MajorFunction[IRP_MJ_PNP] = USBHUB_DispatchPnp;
DriverObject->MajorFunction[IRP_MJ_POWER] =USBHUB_DispatchPower;

View File

@@ -39,43 +39,9 @@ typedef struct _WORK_ITEM_DATA
PVOID Context;
} WORK_ITEM_DATA, *PWORK_ITEM_DATA;
//
// Definitions for device's PnP state tracking, all this states are described
// in PnP Device States diagram of DDK documentation.
//
typedef enum _DEVICE_PNP_STATE {
NotStarted = 0, // Not started
Started, // After handling of START_DEVICE IRP
StopPending, // After handling of QUERY_STOP IRP
Stopped, // After handling of STOP_DEVICE IRP
RemovePending, // After handling of QUERY_REMOVE IRP
SurpriseRemovePending, // After handling of SURPRISE_REMOVE IRP
Deleted, // After handling of REMOVE_DEVICE IRP
UnKnown // Unknown state
} DEVICE_PNP_STATE;
#define INITIALIZE_PNP_STATE(Data) \
(Data).PnPState = NotStarted;\
(Data).PreviousPnPState = NotStarted;
#define SET_NEW_PNP_STATE(Data, state) \
(Data).PreviousPnPState = (Data).PnPState;\
(Data).PnPState = (state);
#define RESTORE_PREVIOUS_PNP_STATE(Data) \
(Data).PnPState = (Data).PreviousPnPState;
typedef struct
{
BOOLEAN IsFDO;
// We'll track device PnP state via this variables
DEVICE_PNP_STATE PnPState;
DEVICE_PNP_STATE PreviousPnPState;
// Remove lock
IO_REMOVE_LOCK RemoveLock;
} COMMON_DEVICE_EXTENSION, *PCOMMON_DEVICE_EXTENSION;
typedef struct _HUB_CHILDDEVICE_EXTENSION
@@ -106,8 +72,6 @@ typedef struct _HUB_DEVICE_EXTENSION
PDEVICE_OBJECT RootHubPhysicalDeviceObject;
PDEVICE_OBJECT RootHubFunctionalDeviceObject;
KGUARDED_MUTEX HubMutexLock;
ULONG NumberOfHubs;
KEVENT ResetComplete;
@@ -130,6 +94,7 @@ typedef struct _HUB_DEVICE_EXTENSION
USBD_CONFIGURATION_HANDLE ConfigurationHandle;
USBD_PIPE_HANDLE PipeHandle;
PVOID RootHubHandle;
USB_BUS_INTERFACE_USBDI_V2 DeviceInterface;
UNICODE_STRING SymbolicLinkName;
ULONG InstanceCount;

View File

@@ -771,6 +771,7 @@ CUSBRequest::BuildIsochronousEndpoint(
//
// get physical page
//
*(volatile char *)Buffer; // HACK for CORE-9224
Page = MmGetPhysicalAddress(Buffer).LowPart;
//

View File

@@ -13,7 +13,7 @@ list(APPEND INF_FILES
fdc.inf
flpydisk.inf
hal.inf
hdaudbus.inf
# hdaudbus.inf
hdc.inf
input.inf
keyboard.inf

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View File

@@ -0,0 +1,32 @@
list(APPEND WALLPAPER_FILES
Angelus_DeepSea_16-9_1920x1080.jpg
Angelus_DeepSea_4-3_1440x1080.jpg
Angelus_ReactOS_Blue_16-9.jpg
Angelus_ReactOS_Blue_4-3.jpg
Angelus_ReactOS_Dark_16-9.jpg
Angelus_ReactOS_Dark_4-3.jpg
Angelus_ReactOS_Light_16-9.jpg
Angelus_ReactOS_Light_4-3.jpg
Angelus_ROSWP_16-9_1920x1080.jpg
Angelus_ROSWP_4-3_1024x768.jpg
Angelus_ROSWP_4-3_1440x1080.jpg
Angelus_Sky4_16x9.jpg
Angelus_Sky4_4x3.jpg
Angelus_Sky5_16x9.jpg
Angelus_Sky5_4x3.jpg
Angelus_Sky7_16x9.jpg
Angelus_Sky7_4x3.jpg
lake.jpg
ReactOS_CirclesBlue_1.jpg
ReactOS_CirclesBlue_2.jpg
ReactOS_CirclesGold_1.jpg
ReactOS_CirclesGold_2.jpg
ReactOS_CLT_1.bmp
ReactOS_CLT_1.jpg
ReactOS_CLT_2.jpg
ReadMe.txt)
foreach(item ${WALLPAPER_FILES})
add_cd_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/${item}" DESTINATION reactos/Web/Wallpaper FOR all)
endforeach(item)

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View File

@@ -0,0 +1,21 @@
Wallpapers
===========
Most of the wallpapers are adapted from the original ones for the CLT 2017.
File Name | Author | Origin
--------------------------------------------------------------------------------------------------------------------------------------------------
Angelus collection | Forum user "Angelus" (jedi.knight@wanadoo.es) | http://www.reactos.org/forum/viewtopic.php?p=50543#p50543
lake.jpg | Andreas Bjerkeholt (harteex@gmail.com) | http://www.reactos.org/forum/viewtopic.php?p=17732#p17732
ReactOS_CirclesBlue_1.jpg | Forum user "henrytang5247" (Henry Tang) | http://www.reactos.org/forum/viewtopic.php?p=109529#p109529
ReactOS_CirclesBlue_2.jpg | See above | See above
ReactOS_CirclesGold_1.jpg | See above | See above
ReactOS_CirclesGold_2.jpg | See above | See above
ReactOS_CLT_1.jpg | CLT version of ReactOS_CirclesGold_1.jpg | See above
ReactOS_CLT_2.jpg | CLT version of ReactOS_CirclesGold_2.jpg | See above
Angelus' Wallpapers
===================
Forum User "Angelus" (jedi.knight@wanadoo.es)
Under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
See forum thread: http://www.reactos.org/forum/viewtopic.php?f=25&t=6153

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 730 B

After

Width:  |  Height:  |  Size: 772 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 886 B

After

Width:  |  Height:  |  Size: 996 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 B

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 B

After

Width:  |  Height:  |  Size: 156 B

View File

@@ -318,7 +318,7 @@ function(add_cd_file)
set_property(GLOBAL APPEND PROPERTY BOOTCD_FILE_LIST "${_CD_DESTINATION}/${__file}=${item}")
# add it also into the hybridcd if not specified otherwise
if(NOT _CD_NOT_IN_HYBRIDCD)
set_property(GLOBAL APPEND PROPERTY HYBRIDCD_FILE_LIST "bootcd/${_CD_DESTINATION}/${__file}=${item}")
set_property(GLOBAL APPEND PROPERTY HYBRIDCD_FILE_LIST "setup/${_CD_DESTINATION}/${__file}=${item}")
endif()
endforeach()
# manage dependency
@@ -357,7 +357,7 @@ function(add_cd_file)
set_property(GLOBAL APPEND PROPERTY LIVECD_FILE_LIST "${_CD_DESTINATION}/${__file}=${item}")
# add it also into the hybridcd if not specified otherwise
if(NOT _CD_NOT_IN_HYBRIDCD)
set_property(GLOBAL APPEND PROPERTY HYBRIDCD_FILE_LIST "livecd/${_CD_DESTINATION}/${__file}=${item}")
set_property(GLOBAL APPEND PROPERTY HYBRIDCD_FILE_LIST "${_CD_DESTINATION}/${__file}=${item}")
endif()
endforeach()
endif() #end livecd
@@ -437,7 +437,7 @@ function(create_iso_lists)
add_cd_file(
FILE ${CMAKE_CURRENT_BINARY_DIR}/livecd.iso
DESTINATION livecd
DESTINATION root
FOR hybridcd)
get_property(_filelist GLOBAL PROPERTY BOOTCD_FILE_LIST)

View File

@@ -619,15 +619,26 @@ RtlAddVectoredExceptionHandler(
_In_ PVECTORED_EXCEPTION_HANDLER VectoredHandler
);
__analysis_noreturn
NTSYSAPI
VOID
ULONG
NTAPI
RtlAssert(
_In_ PVOID FailedAssertion,
_In_ PVOID FileName,
_In_ ULONG LineNumber,
_In_opt_z_ PCHAR Message
RtlRemoveVectoredExceptionHandler(
_In_ PVOID VectoredHandlerHandle
);
NTSYSAPI
PVOID
NTAPI
RtlAddVectoredContinueHandler(
_In_ ULONG FirstHandler,
_In_ PVECTORED_EXCEPTION_HANDLER VectoredHandler
);
NTSYSAPI
ULONG
NTAPI
RtlRemoveVectoredContinueHandler(
_In_ PVOID VectoredHandlerHandle
);
NTSYSAPI
@@ -644,6 +655,17 @@ RtlUnhandledExceptionFilter(
_In_ struct _EXCEPTION_POINTERS* ExceptionInfo
);
__analysis_noreturn
NTSYSAPI
VOID
NTAPI
RtlAssert(
_In_ PVOID FailedAssertion,
_In_ PVOID FileName,
_In_ ULONG LineNumber,
_In_opt_z_ PCHAR Message
);
NTSYSAPI
PVOID
NTAPI

View File

@@ -1467,6 +1467,7 @@ void WINAPI AddRefActCtx(_Inout_ HANDLE);
#endif
#if (_WIN32_WINNT >= 0x0500)
_Ret_maybenull_ PVOID WINAPI AddVectoredExceptionHandler(_In_ ULONG, _In_ PVECTORED_EXCEPTION_HANDLER);
_Ret_maybenull_ PVOID WINAPI AddVectoredContinueHandler(_In_ ULONG, _In_ PVECTORED_EXCEPTION_HANDLER);
#endif
BOOL WINAPI AccessCheckByType(PSECURITY_DESCRIPTOR,PSID,HANDLE,DWORD,POBJECT_TYPE_LIST,DWORD,PGENERIC_MAPPING,PPRIVILEGE_SET,LPDWORD,LPDWORD,LPBOOL);
BOOL WINAPI AdjustTokenGroups(HANDLE,BOOL,PTOKEN_GROUPS,DWORD,PTOKEN_GROUPS,PDWORD);
@@ -2882,6 +2883,7 @@ BOOL WINAPI RemoveDirectoryA(LPCSTR);
BOOL WINAPI RemoveDirectoryW(LPCWSTR);
#if (_WIN32_WINNT >= 0x0500)
ULONG WINAPI RemoveVectoredExceptionHandler(_In_ PVOID);
ULONG WINAPI RemoveVectoredContinueHandler(_In_ PVOID);
#endif
#if (_WIN32_WINNT >= 0x0500)
BOOL WINAPI ReplaceFileA(_In_ LPCSTR, _In_ LPCSTR, _In_opt_ LPCSTR, _In_ DWORD, _Reserved_ LPVOID, _Reserved_ LPVOID);

View File

@@ -17,15 +17,15 @@ endmacro()
string(TIMESTAMP KERNEL_VERSION_BUILD %Y%m%d UTC)
set(KERNEL_VERSION_MAJOR "0")
set(KERNEL_VERSION_MINOR "5")
set(KERNEL_VERSION_PATCH_LEVEL "0")
set(KERNEL_VERSION_MINOR "4")
set(KERNEL_VERSION_PATCH_LEVEL "4")
set(COPYRIGHT_YEAR "2017")
# KERNEL_VERSION_BUILD_TYPE is "SVN" or "" (for the release)
set(KERNEL_VERSION_BUILD_TYPE "SVN")
set(KERNEL_VERSION_BUILD_TYPE "")
# KERNEL_VERSION_RELEASE_TYPE is "RC1", "RC2" or "" (for the final one)
set(KERNEL_VERSION_RELEASE_TYPE "")
set(KERNEL_VERSION_RELEASE_TYPE "CLT2017")
set(KERNEL_VERSION "${KERNEL_VERSION_MAJOR}.${KERNEL_VERSION_MINOR}")
if(KERNEL_VERSION_PATCH_LEVEL)

View File

@@ -163,7 +163,7 @@ HidParser_StoreCollection(
//
// store offset
//
TargetCollection->Offsets[Collection->ReportCount + Index] = CurrentOffset;
TargetCollection->Offsets[Collection->NodeCount + Index] = CurrentOffset;
//
// store sub collections
@@ -254,7 +254,7 @@ HidParser_SearchReportInCollection(
//
// get collection
//
SubCollection = (PHID_COLLECTION)(CollectionContext->RawData + Collection->Offsets[Collection->ReportCount + Index]);
SubCollection = (PHID_COLLECTION)(CollectionContext->RawData + Collection->Offsets[Collection->NodeCount + Index]);
//
// recursively search collection
@@ -314,7 +314,7 @@ HidParser_GetCollectionCount(
//
// get offset to sub collection
//
SubCollection = (PHID_COLLECTION)(CollectionContext->RawData + Collection->Offsets[Collection->ReportCount + Index]);
SubCollection = (PHID_COLLECTION)(CollectionContext->RawData + Collection->Offsets[Collection->NodeCount + Index]);
//
// count collection for sub nodes

View File

@@ -68,7 +68,7 @@ HidParser_GetCollectionDescription(
// failed to parse report descriptor
//
Parser->Debug("[HIDPARSER] Failed to parse report descriptor with %x\n", ParserStatus);
return ParserStatus;
return TranslateHidParserStatus(ParserStatus);
}
//
@@ -126,9 +126,7 @@ HidParser_GetCollectionDescription(
//
// no memory
//
Parser->Free(DeviceDescription->CollectionDesc);
Parser->Free(DeviceDescription->ReportIDs);
return ParserStatus;
return TranslateHidParserStatus(ParserStatus);
}
//
@@ -155,13 +153,6 @@ HidParser_GetCollectionDescription(
// get collection usage page
//
ParserStatus = HidParser_GetCollectionUsagePage((PVOID)DeviceDescription->CollectionDesc[Index].PreparsedData, &DeviceDescription->CollectionDesc[Index].Usage, &DeviceDescription->CollectionDesc[Index].UsagePage);
if (ParserStatus != HIDPARSER_STATUS_SUCCESS)
{
// collection not found
Parser->Free(DeviceDescription->CollectionDesc);
Parser->Free(DeviceDescription->ReportIDs);
return ParserStatus;
}
//
// windows seems to prepend the report id, regardless if it is required

View File

@@ -713,6 +713,30 @@ HidParser_AddMainItem(
return HIDPARSER_STATUS_SUCCESS;
}
HIDPARSER_STATUS
AllocateParserContext(
IN PHID_PARSER Parser,
OUT PHID_PARSER_CONTEXT *OutParserContext)
{
PHID_PARSER_CONTEXT ParserContext;
ParserContext = Parser->Alloc(sizeof(HID_PARSER_CONTEXT));
if (!ParserContext)
{
//
// failed
//
return HIDPARSER_STATUS_INSUFFICIENT_RESOURCES;
}
//
// store result
//
*OutParserContext = ParserContext;
return HIDPARSER_STATUS_SUCCESS;
}
HIDPARSER_STATUS
HidParser_ParseReportDescriptor(
IN PHID_PARSER Parser,
@@ -736,18 +760,12 @@ HidParser_ParseReportDescriptor(
PMAIN_ITEM_DATA MainItemData;
PHID_PARSER_CONTEXT ParserContext;
CurrentOffset = ReportDescriptor;
ReportEnd = ReportDescriptor + ReportLength;
if (ReportDescriptor >= ReportEnd)
return HIDPARSER_STATUS_COLLECTION_NOT_FOUND;
//
// allocate parser
//
ParserContext = Parser->Alloc(sizeof(HID_PARSER_CONTEXT));;
if (!ParserContext)
return HIDPARSER_STATUS_INSUFFICIENT_RESOURCES;
Status = AllocateParserContext(Parser, &ParserContext);
if (Status != HIDPARSER_STATUS_SUCCESS)
return Status;
//
@@ -760,7 +778,6 @@ HidParser_ParseReportDescriptor(
//
// no memory
//
Parser->Free(ParserContext);
return HIDPARSER_STATUS_INSUFFICIENT_RESOURCES;
}
@@ -775,7 +792,6 @@ HidParser_ParseReportDescriptor(
//
Parser->Free(ParserContext->LocalItemState.UsageStack);
ParserContext->LocalItemState.UsageStack = NULL;
Parser->Free(ParserContext);
return HIDPARSER_STATUS_INSUFFICIENT_RESOURCES;
}
@@ -783,6 +799,8 @@ HidParser_ParseReportDescriptor(
// start parsing
//
CurrentCollection = ParserContext->RootCollection;
CurrentOffset = ReportDescriptor;
ReportEnd = ReportDescriptor + ReportLength;
do
{
@@ -1212,6 +1230,7 @@ HidParser_ParseReportDescriptor(
//
CurrentOffset += CurrentItemSize + sizeof(ITEM_PREFIX);
}while(CurrentOffset < ReportEnd);

View File

@@ -568,8 +568,7 @@ CHubController::HandlePnp(
break;
}
}
// Here we should leave Status as is.
Status = Irp->IoStatus.Status;
Status = STATUS_SUCCESS;
break;
}
case IRP_MN_QUERY_CAPABILITIES:
@@ -612,14 +611,6 @@ CHubController::HandlePnp(
// handle device interface requests
//
Status = HandleQueryInterface(IoStack);
//
// If a bus driver does not export the requested interface, it
// should leave Status as is.
//
if (Status == STATUS_NOT_SUPPORTED)
Status = Irp->IoStatus.Status;
break;
}
case IRP_MN_REMOVE_DEVICE:
@@ -3745,7 +3736,6 @@ CHubController::HandleQueryInterface(
InterfaceHub->SetDeviceHandleData = USBHI_SetDeviceHandleData;
}
InterfaceHub->InterfaceReference(InterfaceHub->BusContext);
//
// request completed
//
@@ -3800,7 +3790,6 @@ CHubController::HandleQueryInterface(
InterfaceDI->EnumLogEntry = USBDI_EnumLogEntry;
}
InterfaceDI->InterfaceReference(InterfaceDI->BusContext);
//
// request completed
//

View File

@@ -1,6 +1,6 @@
/* @(#)version.h 1.92 16/01/26 Copyright 2007-2016 J. Schilling */
/* @(#)version.h 1.93 16/12/15 Copyright 2007-2016 J. Schilling */
/*
* The version for cdrtools programs
*/
#define VERSION "3.02a06"
#define VERSION "3.02a07"

View File

@@ -1,4 +1,4 @@
/* @(#)schily.h 1.121 16/11/04 Copyright 1985-2016 J. Schilling */
/* @(#)schily.h 1.122 16/12/18 Copyright 1985-2016 J. Schilling */
/*
* Definitions for libschily
*
@@ -543,7 +543,7 @@ extern int _openfd64 __PR((const char *, int));
#ifdef __never__
#undef error
#define error js_error
#endif
#endif /* __never__ */
#undef dprintf
#define dprintf js_dprintf
#undef fprintf
@@ -558,9 +558,9 @@ extern int _openfd64 __PR((const char *, int));
#ifndef HAVE_SNPRINTF
#undef snprintf
#define snprintf js_snprintf
#endif
#endif
#endif
#endif /* HAVE_SNPRINTF */
#endif /* SCHILY_PRINT */
#endif /* NO_SCHILY_PRINT */
#ifndef NO_SCHILY_GETLINE /* Define to disable *getline() redirect */
#undef getline

View File

@@ -1,11 +1,11 @@
/* @(#)dirent.c 1.3 12/03/20 Copyright 2011 J. Schilling */
/* @(#)dirent.c 1.4 17/02/02 Copyright 2011-2017 J. Schilling */
#include <schily/mconfig.h>
#ifndef lint
static UConst char sccsid[] =
"@(#)dirent.c 1.3 12/03/20 Copyright 2011 J. Schilling";
"@(#)dirent.c 1.4 17/02/02 Copyright 2011-2017 J. Schilling";
#endif
/*
* Copyright (c) 2011 J. Schilling
* Copyright (c) 2011-2017 J. Schilling
*/
/*
* The contents of this file are subject to the terms of the
@@ -14,6 +14,8 @@ static UConst char sccsid[] =
* with the License.
*
* See the file CDDL.Schily.txt in this distribution for details.
* A copy of the CDDL is also available via the Internet at
* http://www.opensource.org/licenses/cddl1.txt
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file CDDL.Schily.txt from this distribution.
@@ -84,7 +86,8 @@ opendir(dname)
dp->dd_dirname[len] = '\\';
len++;
}
dp->dd_dirname[len] = '*';
dp->dd_dirname[len++] = '*';
dp->dd_dirname[len] = '\0';
dp->dd_handle = -1;
dp->dd_state = 0;

View File

@@ -1,8 +1,8 @@
/* @(#)mkisofs.c 1.288 16/12/13 joerg */
/* @(#)mkisofs.c 1.289 17/01/05 joerg */
#include <schily/mconfig.h>
#ifndef lint
static UConst char sccsid[] =
"@(#)mkisofs.c 1.288 16/12/13 joerg";
"@(#)mkisofs.c 1.289 17/01/05 joerg";
#endif
/*
* Program mkisofs.c - generate iso9660 filesystem based upon directory
@@ -11,7 +11,7 @@ static UConst char sccsid[] =
* Written by Eric Youngdale (1993).
*
* Copyright 1993 Yggdrasil Computing, Incorporated
* Copyright (c) 1997-2016 J. Schilling
* Copyright (c) 1997-2017 J. Schilling
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -132,14 +132,13 @@ BOOL legacy = FALSE; /* Implement legacy support for historic CLI */
int all_files = 1; /* New default is to include all files */
BOOL Hflag = FALSE; /* Follow links on cmdline (-H) */
BOOL follow_links = FALSE; /* Follow all links (-L) */
#if defined(IS_CYGWIN) || defined(__MINGW32__) || defined(_MSC_VER)
#if defined(__MINGW32__) || defined(_MSC_VER)
/*
* Do not cache inodes on Cygwin by default
* See below in main(), cache for 64bit ino_t
* Never cache inodes on DOS or Win-DOS.
*/
int cache_inodes = 0;
#else
int cache_inodes = 1; /* Cache inodes if OS has unique inodes */
int cache_inodes = -1; /* Cache inodes if OS has unique inodes */
#endif
int rationalize = 0; /* Need to call stat_fix() */
int rationalize_uid = 0;
@@ -2088,14 +2087,6 @@ main(argc, argv)
modification_date.l_usec = tv_begun.tv_usec;
modification_date.l_gmtoff = -100;
#if defined(IS_CYGWIN)
/*
* If we have 64 bit inode numbers, Cygwin should be able to work
* correctly on NTFS.
*/
if (sizeof (ino_t) >= 8)
cache_inodes = 1;
#endif
cac--;
cav++;
c = getvargs(&cac, &cav, GA_NO_PROPS, flags);
@@ -2119,7 +2110,7 @@ args_ok:
if (pversion) {
printf(_("mkisofs %s (%s-%s-%s)\n\n\
Copyright (C) 1993-1997 %s\n\
Copyright (C) 1997-2016 %s\n"),
Copyright (C) 1997-2017 %s\n"),
version_string,
HOST_CPU, HOST_VENDOR, HOST_OS,
_("Eric Youngdale"),
@@ -2212,6 +2203,25 @@ Copyright (C) 1997-2016 %s\n"),
(Llong)strlen(biblio));
}
}
#ifdef DUPLICATES_ONCE
/*
* If -duplicates-once was specified, do not implicitly enable
* -cache-inodes.
*/
if (cache_inodes < 0 && duplicates_once)
cache_inodes = 0;
#endif
#if defined(IS_CYGWIN)
/*
* If we have 64 bit inode numbers, Cygwin should be able to work
* correctly on NTFS, otherwise disable caching unless it has
* been enforced via -cache-inodes.
*/
if (cache_inodes < 0 && sizeof (ino_t) < 8)
cache_inodes = 0;
#endif
if (cache_inodes < 0)
cache_inodes = 1;
#ifdef DUPLICATES_ONCE
if (!cache_inodes && !duplicates_once) {
#else

View File

@@ -17,7 +17,7 @@
#include "asmxtras.inc"
#include <isvbop.inc>
// #define NDEBUG
#define NDEBUG
/* DEFINES ********************************************************************/

View File

@@ -30,6 +30,132 @@ InitDeviceImpl(VOID)
return STATUS_SUCCESS;
}
BOOLEAN
EngpPopulateDeviceModeList(
_Inout_ PGRAPHICS_DEVICE pGraphicsDevice,
_In_ PDEVMODEW pdmDefault)
{
PWSTR pwsz;
PLDEVOBJ pldev;
PDEVMODEINFO pdminfo;
PDEVMODEW pdm, pdmEnd;
ULONG i, cModes = 0;
BOOLEAN bModeMatch = FALSE;
ASSERT(pGraphicsDevice->pdevmodeInfo == NULL);
ASSERT(pGraphicsDevice->pDevModeList == NULL);
pwsz = pGraphicsDevice->pDiplayDrivers;
/* Loop through the driver names
* This is a REG_MULTI_SZ string */
for (; *pwsz; pwsz += wcslen(pwsz) + 1)
{
TRACE("trying driver: %ls\n", pwsz);
/* Try to load the display driver */
pldev = EngLoadImageEx(pwsz, LDEV_DEVICE_DISPLAY);
if (!pldev)
{
ERR("Could not load driver: '%ls'\n", pwsz);
continue;
}
/* Get the mode list from the driver */
pdminfo = LDEVOBJ_pdmiGetModes(pldev, pGraphicsDevice->DeviceObject);
if (!pdminfo)
{
ERR("Could not get mode list for '%ls'\n", pwsz);
continue;
}
/* Attach the mode info to the device */
pdminfo->pdmiNext = pGraphicsDevice->pdevmodeInfo;
pGraphicsDevice->pdevmodeInfo = pdminfo;
/* Loop all DEVMODEs */
pdmEnd = (DEVMODEW*)((PCHAR)pdminfo->adevmode + pdminfo->cbdevmode);
for (pdm = pdminfo->adevmode;
(pdm + 1 <= pdmEnd) && (pdm->dmSize != 0);
pdm = (DEVMODEW*)((PCHAR)pdm + pdm->dmSize + pdm->dmDriverExtra))
{
/* Count this DEVMODE */
cModes++;
/* Some drivers like the VBox driver don't fill the dmDeviceName
with the name of the display driver. So fix that here. */
wcsncpy(pdm->dmDeviceName, pwsz, CCHDEVICENAME);
pdm->dmDeviceName[CCHDEVICENAME - 1] = 0;
}
// FIXME: release the driver again until it's used?
}
if (!pGraphicsDevice->pdevmodeInfo || cModes == 0)
{
ERR("No devmodes\n");
return FALSE;
}
/* Allocate an index buffer */
pGraphicsDevice->cDevModes = cModes;
pGraphicsDevice->pDevModeList = ExAllocatePoolWithTag(PagedPool,
cModes * sizeof(DEVMODEENTRY),
GDITAG_GDEVICE);
if (!pGraphicsDevice->pDevModeList)
{
ERR("No devmode list\n");
return FALSE;
}
TRACE("Looking for mode %lux%lux%lu(%lu Hz)\n",
pdmDefault->dmPelsWidth,
pdmDefault->dmPelsHeight,
pdmDefault->dmBitsPerPel,
pdmDefault->dmDisplayFrequency);
/* Loop through all DEVMODEINFOs */
for (pdminfo = pGraphicsDevice->pdevmodeInfo, i = 0;
pdminfo;
pdminfo = pdminfo->pdmiNext)
{
/* Calculate End of the DEVMODEs */
pdmEnd = (DEVMODEW*)((PCHAR)pdminfo->adevmode + pdminfo->cbdevmode);
/* Loop through the DEVMODEs */
for (pdm = pdminfo->adevmode;
(pdm + 1 <= pdmEnd) && (pdm->dmSize != 0);
pdm = (PDEVMODEW)((PCHAR)pdm + pdm->dmSize + pdm->dmDriverExtra))
{
TRACE(" %S has mode %lux%lux%lu(%lu Hz)\n",
pdm->dmDeviceName,
pdm->dmPelsWidth,
pdm->dmPelsHeight,
pdm->dmBitsPerPel,
pdm->dmDisplayFrequency);
/* Compare with the default entry */
if (!bModeMatch &&
pdm->dmBitsPerPel == pdmDefault->dmBitsPerPel &&
pdm->dmPelsWidth == pdmDefault->dmPelsWidth &&
pdm->dmPelsHeight == pdmDefault->dmPelsHeight)
{
pGraphicsDevice->iDefaultMode = i;
pGraphicsDevice->iCurrentMode = i;
TRACE("Found default entry: %lu '%ls'\n", i, pdm->dmDeviceName);
if (pdm->dmDisplayFrequency == pdmDefault->dmDisplayFrequency)
{
/* Uh oh, even the display frequency matches. */
bModeMatch = TRUE;
}
}
/* Initialize the entry */
pGraphicsDevice->pDevModeList[i].dwFlags = 0;
pGraphicsDevice->pDevModeList[i].pdm = pdm;
i++;
}
}
return TRUE;
}
PGRAPHICS_DEVICE
NTAPI
@@ -44,13 +170,9 @@ EngpRegisterGraphicsDevice(
PFILE_OBJECT pFileObject;
NTSTATUS Status;
PWSTR pwsz;
ULONG i, cj, cModes = 0;
ULONG cj;
SIZE_T cjWritten;
BOOL bEnable = TRUE;
PDEVMODEINFO pdminfo;
PDEVMODEW pdm, pdmEnd;
PLDEVOBJ pldev;
BOOLEAN bModeMatch = FALSE;
TRACE("EngpRegisterGraphicsDevice(%wZ)\n", pustrDeviceName);
@@ -124,116 +246,14 @@ EngpRegisterGraphicsDevice(
// FIXME: initialize state flags
pGraphicsDevice->StateFlags = 0;
/* Loop through the driver names
* This is a REG_MULTI_SZ string */
for (; *pwsz; pwsz += wcslen(pwsz) + 1)
/* Create the mode list */
pGraphicsDevice->pDevModeList = NULL;
if (!EngpPopulateDeviceModeList(pGraphicsDevice, pdmDefault))
{
TRACE("trying driver: %ls\n", pwsz);
/* Try to load the display driver */
pldev = EngLoadImageEx(pwsz, LDEV_DEVICE_DISPLAY);
if (!pldev)
{
ERR("Could not load driver: '%ls'\n", pwsz);
continue;
}
/* Get the mode list from the driver */
pdminfo = LDEVOBJ_pdmiGetModes(pldev, pDeviceObject);
if (!pdminfo)
{
ERR("Could not get mode list for '%ls'\n", pwsz);
continue;
}
/* Attach the mode info to the device */
pdminfo->pdmiNext = pGraphicsDevice->pdevmodeInfo;
pGraphicsDevice->pdevmodeInfo = pdminfo;
/* Loop all DEVMODEs */
pdmEnd = (DEVMODEW*)((PCHAR)pdminfo->adevmode + pdminfo->cbdevmode);
for (pdm = pdminfo->adevmode;
(pdm + 1 <= pdmEnd) && (pdm->dmSize != 0);
pdm = (DEVMODEW*)((PCHAR)pdm + pdm->dmSize + pdm->dmDriverExtra))
{
/* Count this DEVMODE */
cModes++;
/* Some drivers like the VBox driver don't fill the dmDeviceName
with the name of the display driver. So fix that here. */
wcsncpy(pdm->dmDeviceName, pwsz, CCHDEVICENAME);
pdm->dmDeviceName[CCHDEVICENAME - 1] = 0;
}
// FIXME: release the driver again until it's used?
}
if (!pGraphicsDevice->pdevmodeInfo || cModes == 0)
{
ERR("No devmodes\n");
ExFreePoolWithTag(pGraphicsDevice, GDITAG_GDEVICE);
return NULL;
}
/* Allocate an index buffer */
pGraphicsDevice->cDevModes = cModes;
pGraphicsDevice->pDevModeList = ExAllocatePoolWithTag(PagedPool,
cModes * sizeof(DEVMODEENTRY),
GDITAG_GDEVICE);
if (!pGraphicsDevice->pDevModeList)
{
ERR("No devmode list\n");
ExFreePoolWithTag(pGraphicsDevice, GDITAG_GDEVICE);
return NULL;
}
TRACE("Looking for mode %lux%lux%lu(%lu Hz)\n",
pdmDefault->dmPelsWidth,
pdmDefault->dmPelsHeight,
pdmDefault->dmBitsPerPel,
pdmDefault->dmDisplayFrequency);
/* Loop through all DEVMODEINFOs */
for (pdminfo = pGraphicsDevice->pdevmodeInfo, i = 0;
pdminfo;
pdminfo = pdminfo->pdmiNext)
{
/* Calculate End of the DEVMODEs */
pdmEnd = (DEVMODEW*)((PCHAR)pdminfo->adevmode + pdminfo->cbdevmode);
/* Loop through the DEVMODEs */
for (pdm = pdminfo->adevmode;
(pdm + 1 <= pdmEnd) && (pdm->dmSize != 0);
pdm = (PDEVMODEW)((PCHAR)pdm + pdm->dmSize + pdm->dmDriverExtra))
{
TRACE(" %S has mode %lux%lux%lu(%lu Hz)\n",
pdm->dmDeviceName,
pdm->dmPelsWidth,
pdm->dmPelsHeight,
pdm->dmBitsPerPel,
pdm->dmDisplayFrequency);
/* Compare with the default entry */
if (!bModeMatch &&
pdm->dmBitsPerPel == pdmDefault->dmBitsPerPel &&
pdm->dmPelsWidth == pdmDefault->dmPelsWidth &&
pdm->dmPelsHeight == pdmDefault->dmPelsHeight)
{
pGraphicsDevice->iDefaultMode = i;
pGraphicsDevice->iCurrentMode = i;
TRACE("Found default entry: %lu '%ls'\n", i, pdm->dmDeviceName);
if (pdm->dmDisplayFrequency == pdmDefault->dmDisplayFrequency)
{
/* Uh oh, even the display frequency matches. */
bModeMatch = TRUE;
}
}
/* Initialize the entry */
pGraphicsDevice->pDevModeList[i].dwFlags = 0;
pGraphicsDevice->pDevModeList[i].pdm = pdm;
i++;
}
}
/* Lock loader */
EngAcquireSemaphore(ghsemGraphicsDeviceList);
@@ -250,7 +270,7 @@ EngpRegisterGraphicsDevice(
/* Unlock loader */
EngReleaseSemaphore(ghsemGraphicsDeviceList);
TRACE("Prepared %lu modes for %ls\n", cModes, pGraphicsDevice->pwszDescription);
TRACE("Prepared %lu modes for %ls\n", pGraphicsDevice->cDevModes, pGraphicsDevice->pwszDescription);
return pGraphicsDevice;
}

View File

@@ -3,6 +3,11 @@
#define TAG_GDEV 'gdev'
VOID
NTAPI
PDEVOBJ_vRefreshModeList(
PPDEVOBJ ppdev);
extern PGRAPHICS_DEVICE gpPrimaryGraphicsDevice;
extern PGRAPHICS_DEVICE gpVgaGraphicsDevice;
@@ -29,6 +34,11 @@ EngpRegisterGraphicsDevice(
_In_ PUNICODE_STRING pustrDescription,
_In_ PDEVMODEW pdmDefault);
BOOLEAN
EngpPopulateDeviceModeList(
_Inout_ PGRAPHICS_DEVICE pGraphicsDevice,
_In_ PDEVMODEW pdmDefault);
INIT_FUNCTION
NTSTATUS
NTAPI

View File

@@ -251,6 +251,45 @@ PDEVOBJ_pSurface(
return ppdev->pSurface;
}
VOID
NTAPI
PDEVOBJ_vRefreshModeList(
PPDEVOBJ ppdev)
{
PGRAPHICS_DEVICE pGraphicsDevice;
PDEVMODEINFO pdminfo, pdmiNext;
DEVMODEW dmDefault;
/* Lock the PDEV */
EngAcquireSemaphore(ppdev->hsemDevLock);
pGraphicsDevice = ppdev->pGraphicsDevice;
/* Remember our default mode */
dmDefault = *pGraphicsDevice->pDevModeList[pGraphicsDevice->iDefaultMode].pdm;
/* Clear out the modes */
for (pdminfo = pGraphicsDevice->pdevmodeInfo;
pdminfo;
pdminfo = pdmiNext)
{
pdmiNext = pdminfo->pdmiNext;
ExFreePoolWithTag(pdminfo, GDITAG_DEVMODE);
}
pGraphicsDevice->pdevmodeInfo = NULL;
ExFreePoolWithTag(pGraphicsDevice->pDevModeList, GDITAG_GDEVICE);
pGraphicsDevice->pDevModeList = NULL;
/* Now re-populate the list */
if (!EngpPopulateDeviceModeList(pGraphicsDevice, &dmDefault))
{
DPRINT1("FIXME: EngpPopulateDeviceModeList failed, we just destroyed a perfectly good mode list\n");
}
/* Unlock PDEV */
EngReleaseSemaphore(ppdev->hsemDevLock);
}
PDEVMODEW
NTAPI
PDEVOBJ_pdmMatchDevMode(

View File

@@ -463,20 +463,28 @@ UserEnumDisplaySettings(
PGRAPHICS_DEVICE pGraphicsDevice;
PDEVMODEENTRY pdmentry;
ULONG i, iFoundMode;
PPDEVOBJ ppdev;
TRACE("Enter UserEnumDisplaySettings('%wZ', %lu)\n",
pustrDevice, iModeNum);
/* Ask GDI for the GRAPHICS_DEVICE */
pGraphicsDevice = EngpFindGraphicsDevice(pustrDevice, 0, 0);
ppdev = EngpGetPDEV(pustrDevice);
if (!pGraphicsDevice)
if (!pGraphicsDevice || !ppdev)
{
/* No device found */
ERR("No device found!\n");
return STATUS_INVALID_PARAMETER_1;
}
/* let's politely ask the driver for an updated mode list,
just in case there's something new in there (vbox) */
PDEVOBJ_vRefreshModeList(ppdev);
PDEVOBJ_vRelease(ppdev);
iFoundMode = 0;
for (i = 0; i < pGraphicsDevice->cDevModes; i++)
{

View File

@@ -1464,20 +1464,15 @@ IntCallWindowProcW(BOOL IsAnsiProc,
if (PreResult) goto Exit;
if (!Dialog)
Result = CALL_EXTERN_WNDPROC(WndProc, AnsiMsg.hwnd, AnsiMsg.message, AnsiMsg.wParam, AnsiMsg.lParam);
else
{
_SEH2_TRY
{
Result = CALL_EXTERN_WNDPROC(WndProc, AnsiMsg.hwnd, AnsiMsg.message, AnsiMsg.wParam, AnsiMsg.lParam);
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
ERR("Exception Dialog Ansi %p Msg %d pti %p Wndpti %p\n",WndProc,Msg,GetW32ThreadInfo(),pWnd->head.pti);
ERR("Exception when calling Ansi WndProc %p Msg %d pti %p Wndpti %p\n",WndProc,Msg,GetW32ThreadInfo(),pWnd->head.pti);
}
_SEH2_END;
}
if (Hook && MsgOverride)
{
@@ -1518,20 +1513,15 @@ IntCallWindowProcW(BOOL IsAnsiProc,
if (PreResult) goto Exit;
if (!Dialog)
Result = CALL_EXTERN_WNDPROC(WndProc, hWnd, Msg, wParam, lParam);
else
{
_SEH2_TRY
{
Result = CALL_EXTERN_WNDPROC(WndProc, hWnd, Msg, wParam, lParam);
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
ERR("Exception Dialog unicode %p Msg %d pti %p Wndpti %p\n",WndProc, Msg,GetW32ThreadInfo(),pWnd->head.pti);
ERR("Exception when calling unicode WndProc %p Msg %d pti %p Wndpti %p\n",WndProc, Msg,GetW32ThreadInfo(),pWnd->head.pti);
}
_SEH2_END;
}
if (Hook && MsgOverride)
{
@@ -1611,20 +1601,15 @@ IntCallWindowProcA(BOOL IsAnsiProc,
if (PreResult) goto Exit;
if (!Dialog)
Result = CALL_EXTERN_WNDPROC(WndProc, hWnd, Msg, wParam, lParam);
else
{
_SEH2_TRY
{
Result = CALL_EXTERN_WNDPROC(WndProc, hWnd, Msg, wParam, lParam);
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
ERR("Exception Dialog Ansi %p Msg %d pti %p Wndpti %p\n",WndProc,Msg,GetW32ThreadInfo(),pWnd->head.pti);
ERR("Exception when calling Ansi WndProc %p Msg %d pti %p Wndpti %p\n",WndProc,Msg,GetW32ThreadInfo(),pWnd->head.pti);
}
_SEH2_END;
}
if (Hook && MsgOverride)
{
@@ -1672,20 +1657,15 @@ IntCallWindowProcA(BOOL IsAnsiProc,
if (PreResult) goto Exit;
if (!Dialog)
Result = CALL_EXTERN_WNDPROC(WndProc, UnicodeMsg.hwnd, UnicodeMsg.message, UnicodeMsg.wParam, UnicodeMsg.lParam);
else
{
_SEH2_TRY
{
Result = CALL_EXTERN_WNDPROC(WndProc, UnicodeMsg.hwnd, UnicodeMsg.message, UnicodeMsg.wParam, UnicodeMsg.lParam);
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
ERR("Exception Dialog unicode %p Msg %d pti %p Wndpti %p\n",WndProc, Msg,GetW32ThreadInfo(),pWnd->head.pti);
ERR("Exception when calling unicode WndProc %p Msg %d pti %p Wndpti %p\n",WndProc, Msg,GetW32ThreadInfo(),pWnd->head.pti);
}
_SEH2_END;
}
if (Hook && MsgOverride)
{