ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
August 2008
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
27 participants
853 discussions
Start a n
N
ew thread
[dchapyshev] 35183: - Add sxs.dll from Wine
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Fri Aug 8 09:32:35 2008 New Revision: 35183 URL:
http://svn.reactos.org/svn/reactos?rev=35183&view=rev
Log: - Add sxs.dll from Wine Added: trunk/reactos/dll/win32/sxs/ (with props) trunk/reactos/dll/win32/sxs/sxs.c (with props) trunk/reactos/dll/win32/sxs/sxs.rbuild (with props) trunk/reactos/dll/win32/sxs/sxs.spec (with props) Modified: trunk/reactos/baseaddress.rbuild trunk/reactos/boot/bootdata/packages/reactos.dff trunk/reactos/dll/win32/win32.rbuild trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/baseaddress.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/baseaddress.rbuild?rev=351…
============================================================================== --- trunk/reactos/baseaddress.rbuild [iso-8859-1] (original) +++ trunk/reactos/baseaddress.rbuild [iso-8859-1] Fri Aug 8 09:32:35 2008 @@ -184,6 +184,7 @@ <property name="BASEADDRESS_KERNEL32" value="0x7c800000" /> <property name="BASEADDRESS_NTDLL" value="0x7c900000" /> <property name="BASEADDRESS_HHCTRL" value="0x7e410000" /> + <property name="BASEADDRESS_SXS" value="0x7e690000" /> <property name="BASEADDRESS_BEEPMIDI" value="0x7ef0000" /> <property name="BASEADDRESS_FREETYPE" value="0x7f000000" /> </group> Modified: trunk/reactos/boot/bootdata/packages/reactos.dff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/packages/rea…
============================================================================== --- trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] Fri Aug 8 09:32:35 2008 @@ -325,6 +325,7 @@ dll\win32\smdll\smdll.dll 1 dll\win32\snmpapi\snmpapi.dll 1 dll\win32\stdole2.tlb\stdole2.tlb 1 +dll\win32\sxs\sxs.dll 1 dll\win32\syssetup\syssetup.dll 1 dll\win32\tapi32\tapi32.dll 1 dll\win32\tapiui\tapiui.dll 1 Propchange: trunk/reactos/dll/win32/sxs/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Fri Aug 8 09:32:35 2008 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/dll/win32/sxs/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/dll/win32/sxs/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/dll/win32/sxs/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/reactos/dll/win32/sxs/sxs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/sxs/sxs.c?rev=35…
============================================================================== --- trunk/reactos/dll/win32/sxs/sxs.c (added) +++ trunk/reactos/dll/win32/sxs/sxs.c [iso-8859-1] Fri Aug 8 09:32:35 2008 @@ -1,0 +1,45 @@ +/* + * sxs main + * + * Copyright 2007 EA Durbin + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(sxs); + + +/*********************************************************************** + * DllMain (SXS.@) + * + */ +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + switch(fdwReason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls( hinstDLL ); + break; + } + return TRUE; +} Propchange: trunk/reactos/dll/win32/sxs/sxs.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/sxs/sxs.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/sxs/sxs.rbuild?r…
============================================================================== --- trunk/reactos/dll/win32/sxs/sxs.rbuild (added) +++ trunk/reactos/dll/win32/sxs/sxs.rbuild [iso-8859-1] Fri Aug 8 09:32:35 2008 @@ -1,0 +1,17 @@ +<?xml version="1.0"?> +<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> +<group> +<module name="sxs" type="win32dll" baseaddress="${BASEADDRESS_SXS}" installbase="system32" installname="sxs.dll" allowwarnings="true" entrypoint="0"> + <importlibrary definition="sxs.spec.def" /> + <include base="sxs">.</include> + <include base="ReactOS">include/reactos/wine</include> + <define name="__WINESRC__" /> + <define name="WINVER">0x600</define> + <define name="_WIN32_WINNT">0x600</define> + <file>sxs.c</file> + <file>sxs.spec</file> + <library>wine</library> + <library>kernel32</library> + <library>ntdll</library> +</module> +</group> Propchange: trunk/reactos/dll/win32/sxs/sxs.rbuild ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/sxs/sxs.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/sxs/sxs.spec?rev…
============================================================================== --- trunk/reactos/dll/win32/sxs/sxs.spec (added) +++ trunk/reactos/dll/win32/sxs/sxs.spec [iso-8859-1] Fri Aug 8 09:32:35 2008 @@ -1,0 +1,2 @@ +@ stub CreateAssemblyCache +@ stub CreateAssemblyNameObject Propchange: trunk/reactos/dll/win32/sxs/sxs.spec ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/win32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/win32.rbuild?rev…
============================================================================== --- trunk/reactos/dll/win32/win32.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/win32.rbuild [iso-8859-1] Fri Aug 8 09:32:35 2008 @@ -313,6 +313,9 @@ <directory name="stdole2.tlb"> <xi:include href="stdole2.tlb/stdole2.rbuild" /> </directory> +<directory name="sxs"> + <xi:include href="sxs/sxs.rbuild" /> +</directory> <directory name="syssetup"> <xi:include href="syssetup/syssetup.rbuild" /> </directory> Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Fri Aug 8 09:32:35 2008 @@ -94,6 +94,7 @@ reactos/dll/win32/shfolder # Autosync reactos/dll/win32/shlwapi # Autosync reactos/dll/win32/stdole2.tlb # Autosync +reactos/dll/win32/sxs # Autosync reactos/dll/win32/tapi32 # Autosync reactos/dll/win32/twain_32 # Out of sync reactos/dll/win32/urlmon # Autosync
16 years, 4 months
1
0
0
0
[janderwald] 35182: - add a key to list installed sys fonts
by janderwald@svn.reactos.org
Author: janderwald Date: Fri Aug 8 09:06:28 2008 New Revision: 35182 URL:
http://svn.reactos.org/svn/reactos?rev=35182&view=rev
Log: - add a key to list installed sys fonts Modified: trunk/reactos/boot/bootdata/hivesft_i386.inf Modified: trunk/reactos/boot/bootdata/hivesft_i386.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivesft_i386…
============================================================================== --- trunk/reactos/boot/bootdata/hivesft_i386.inf [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/hivesft_i386.inf [iso-8859-1] Fri Aug 8 09:06:28 2008 @@ -72,6 +72,7 @@ ; Font substitutes ; SysFontSubstitutes are also returned by EnumFontFamilies, FontSubstitutes aren't +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts",,0x00000012 HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SysFontSubstitutes",,0x00000012 ; Time zone settings
16 years, 4 months
1
0
0
0
[janderwald] 35181: - fix typo
by janderwald@svn.reactos.org
Author: janderwald Date: Fri Aug 8 08:33:50 2008 New Revision: 35181 URL:
http://svn.reactos.org/svn/reactos?rev=35181&view=rev
Log: - fix typo Modified: trunk/reactos/base/applications/regedit/lang/de-DE.rc Modified: trunk/reactos/base/applications/regedit/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/de-DE.rc [iso-8859-1] Fri Aug 8 08:33:50 2008 @@ -363,7 +363,7 @@ STRINGTABLE DISCARDABLE BEGIN IDS_EXPAND "&Expandieren" - IDS_COLLAPSE "&Schlissen" + IDS_COLLAPSE "&Schließen" IDS_GOTO_SUGGESTED_KEY "&Gehe zu '%s'" IDS_FINISHEDFIND "Durchsuchen der Registry beendet." END
16 years, 4 months
1
0
0
0
[fireball] 35180: - Plugin the filesystem checker into vfatlib, however leave its invocation #if0-ed out until all problems are solved.
by fireball@svn.reactos.org
Author: fireball Date: Fri Aug 8 04:53:13 2008 New Revision: 35180 URL:
http://svn.reactos.org/svn/reactos?rev=35180&view=rev
Log: - Plugin the filesystem checker into vfatlib, however leave its invocation #if0-ed out until all problems are solved. Modified: trunk/reactos/lib/fslib/vfatlib/vfatlib.c trunk/reactos/lib/fslib/vfatlib/vfatlib.h trunk/reactos/lib/fslib/vfatlib/vfatlib.rbuild Modified: trunk/reactos/lib/fslib/vfatlib/vfatlib.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/vfatlib/vfatlib.…
============================================================================== --- trunk/reactos/lib/fslib/vfatlib/vfatlib.c [iso-8859-1] (original) +++ trunk/reactos/lib/fslib/vfatlib/vfatlib.c [iso-8859-1] Fri Aug 8 04:53:13 2008 @@ -11,6 +11,11 @@ #define NDEBUG #include <debug.h> + +PFMIFSCALLBACK ChkdskCallback = NULL; +PVOID FsCheckMemQueue; +ULONG FsCheckFlags; +ULONG FsCheckTotalFiles; NTSTATUS NTAPI VfatFormat (PUNICODE_STRING DriveRoot, @@ -50,7 +55,7 @@ FILE_SYNCHRONOUS_IO_ALERT); if (!NT_SUCCESS(Status)) { - DPRINT("NtOpenFile() failed with status 0x%.08x\n", Status); + DPRINT1("NtOpenFile() failed with status 0x%.08x\n", Status); return Status; } @@ -203,6 +208,25 @@ } } +VOID +VfatPrint(PCHAR Format, ...) +{ + TEXTOUTPUT TextOut; + CHAR TextBuf[512]; + va_list valist; + + va_start(valist, Format); + _vsnprintf(TextBuf, sizeof(TextBuf), Format, valist); + va_end(valist); + + /* Prepare parameters */ + TextOut.Lines = 1; + TextOut.Output = TextBuf; + + /* Do the callback */ + if (ChkdskCallback) ChkdskCallback(OUTPUT, 0, &TextOut); +} + NTSTATUS WINAPI VfatChkdsk( IN PUNICODE_STRING DriveRoot, @@ -212,8 +236,74 @@ IN BOOLEAN ScanDrive, IN PFMIFSCALLBACK Callback) { - UNIMPLEMENTED; - return STATUS_SUCCESS; + BOOLEAN verify, salvage_files; + //ULONG free_clusters; + //DOS_FS fs; + + /* Store callback pointer */ + ChkdskCallback = Callback; + FsCheckMemQueue = NULL; + + /* Set parameters */ + FsCheckFlags = 0; + if (Verbose) FsCheckFlags |= FSCHECK_VERBOSE; + + FsCheckTotalFiles = 0; + + verify = TRUE; + salvage_files = TRUE; +#if 0 + /* Open filesystem */ + fs_open(DriveRoot,FixErrors); + + if (CheckOnlyIfDirty && !fs_isdirty(DriveRoot)) + { + /* No need to check FS */ + return fs_close(FALSE); + } + + read_boot(&fs); + if (verify) VfatPrint("Starting check/repair pass.\n"); + while (read_fat(&fs), scan_root(&fs)) qfree(&FsCheckMemQueue); + if (ScanDrive) fix_bad(&fs); + if (salvage_files) + reclaim_file(&fs); + else + reclaim_free(&fs); + free_clusters = update_free(&fs); + file_unused(); + qfree(&FsCheckMemQueue); + if (verify) + { + VfatPrint("Starting verification pass.\n"); + read_fat(&fs); + scan_root(&fs); + reclaim_free(&fs); + qfree(&FsCheckMemQueue); + } + + if (fs_changed()) + { + if (FixErrors) + { + if (FsCheckFlags & FSCHECK_INTERACTIVE) + FixErrors = get_key("yn","Perform changes ? (y/n)") == 'y'; + else + VfatPrint("Performing changes.\n"); + } + else + { + VfatPrint("Leaving file system unchanged.\n"); + } + } + + VfatPrint("%wZ: %u files, %lu/%lu clusters\n", DriveRoot, + FsCheckTotalFiles, fs.clusters - free_clusters, fs.clusters ); + + return fs_close(FixErrors) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; +#else + return STATUS_SUCCESS; +#endif } /* EOF */ Modified: trunk/reactos/lib/fslib/vfatlib/vfatlib.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/vfatlib/vfatlib.…
============================================================================== --- trunk/reactos/lib/fslib/vfatlib/vfatlib.h [iso-8859-1] (original) +++ trunk/reactos/lib/fslib/vfatlib/vfatlib.h [iso-8859-1] Fri Aug 8 04:53:13 2008 @@ -9,6 +9,15 @@ #define NTOS_MODE_USER #include <ndk/ntndk.h> #include <fmifs/fmifs.h> + +#include "check/dosfsck.h" +#include "check/common.h" +#include "check/io.h" +#include "check/lfn.h" +#include "check/boot.h" +#include "check/fat.h" +#include "check/file.h" +#include "check/check.h" #define SECTORSIZE 512 @@ -130,4 +139,7 @@ UpdateProgress (PFORMAT_CONTEXT Context, ULONG Increment); +VOID +VfatPrint(PCHAR Format, ...); + /* EOF */ Modified: trunk/reactos/lib/fslib/vfatlib/vfatlib.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/vfatlib/vfatlib.…
============================================================================== --- trunk/reactos/lib/fslib/vfatlib/vfatlib.rbuild [iso-8859-1] (original) +++ trunk/reactos/lib/fslib/vfatlib/vfatlib.rbuild [iso-8859-1] Fri Aug 8 04:53:13 2008 @@ -7,4 +7,14 @@ <file>fat16.c</file> <file>fat32.c</file> <file>vfatlib.c</file> + + <directory name="check"> + <file>boot.c</file> + <file>check.c</file> + <file>common.c</file> + <file>fat.c</file> + <file>file.c</file> + <file>io.c</file> + <file>lfn.c</file> + </directory> </module>
16 years, 4 months
1
0
0
0
[fireball] 35179: - Fix tamlin's early dosfsck porting attempt (create a temporary buffer for reading 512 bytes, call reading function which creates another buffer for reading 512 bytes, reads data, copies 512 bytes to 512 byte buffer, then the caller copies sizeof(DIR_ENT) out of the last 512 bytes buffer - looks a bit redundant).
by fireball@svn.reactos.org
Author: fireball Date: Fri Aug 8 04:34:23 2008 New Revision: 35179 URL:
http://svn.reactos.org/svn/reactos?rev=35179&view=rev
Log: - Fix tamlin's early dosfsck porting attempt (create a temporary buffer for reading 512 bytes, call reading function which creates another buffer for reading 512 bytes, reads data, copies 512 bytes to 512 byte buffer, then the caller copies sizeof(DIR_ENT) out of the last 512 bytes buffer - looks a bit redundant). Modified: trunk/reactos/lib/fslib/vfatlib/check/check.c Modified: trunk/reactos/lib/fslib/vfatlib/check/check.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/vfatlib/check/ch…
============================================================================== --- trunk/reactos/lib/fslib/vfatlib/check/check.c [iso-8859-1] (original) +++ trunk/reactos/lib/fslib/vfatlib/check/check.c [iso-8859-1] Fri Aug 8 04:34:23 2008 @@ -749,12 +749,8 @@ DIR_ENT de; FD_TYPE type; - char tmpBuffer[512]; // TMN: - if (offset) { -// fs_read(offset,sizeof(DIR_ENT),&de); - fs_read(offset,sizeof(tmpBuffer),&tmpBuffer); // TMN: - memcpy(&de, tmpBuffer, sizeof(DIR_ENT)); // TMN: + fs_read(offset,sizeof(DIR_ENT),&de); } else { memcpy(de.name," ",MSDOS_NAME); de.attr = ATTR_DIR;
16 years, 4 months
1
0
0
0
[fireball] 35178: - Remove atari fs support. - Rename global variables to more meaningful names. - Add fs_isdirty function to determine is a filesystem is marked as dirty.
by fireball@svn.reactos.org
Author: fireball Date: Fri Aug 8 04:13:21 2008 New Revision: 35178 URL:
http://svn.reactos.org/svn/reactos?rev=35178&view=rev
Log: - Remove atari fs support. - Rename global variables to more meaningful names. - Add fs_isdirty function to determine is a filesystem is marked as dirty. Modified: trunk/reactos/lib/fslib/vfatlib/check/boot.c trunk/reactos/lib/fslib/vfatlib/check/check.c trunk/reactos/lib/fslib/vfatlib/check/dosfsck.h trunk/reactos/lib/fslib/vfatlib/check/fat.c trunk/reactos/lib/fslib/vfatlib/check/io.c trunk/reactos/lib/fslib/vfatlib/check/io.h trunk/reactos/lib/fslib/vfatlib/check/lfn.c Modified: trunk/reactos/lib/fslib/vfatlib/check/boot.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/vfatlib/check/bo…
============================================================================== --- trunk/reactos/lib/fslib/vfatlib/check/boot.c [iso-8859-1] (original) +++ trunk/reactos/lib/fslib/vfatlib/check/boot.c [iso-8859-1] Fri Aug 8 04:13:21 2008 @@ -57,20 +57,14 @@ static void dump_boot(DOS_FS *fs,struct boot_sector *b,unsigned lss) { unsigned short sectors; + char id[9]; VfatPrint("Boot sector contents:\n"); - if (!atari_format) { - char id[9]; + strncpy(id,(char*)b->system_id,8); id[8] = 0; VfatPrint("System ID \"%s\"\n",id); - } - else { - /* On Atari, a 24 bit serial number is stored at offset 8 of the boot - * sector */ - VfatPrint("Serial number 0x%x\n", - b->system_id[5] | (b->system_id[6]<<8) | (b->system_id[7]<<16)); - } + VfatPrint("Media byte 0x%02x (%s)\n",b->media,get_media_descr(b->media)); VfatPrint("%10d bytes per logical sector\n",GET_UNALIGNED_W(b->sector_size)); VfatPrint("%10d bytes per cluster\n",fs->cluster_size); @@ -99,12 +93,7 @@ (__u64)fs->clusters*fs->cluster_size); VfatPrint("%u sectors/track, %u heads\n",CF_LE_W(b->secs_track), CF_LE_W(b->heads)); - VfatPrint("%10u hidden sectors\n", - atari_format ? - /* On Atari, the hidden field is only 16 bit wide and unused */ - (((unsigned char *)&b->hidden)[0] | - ((unsigned char *)&b->hidden)[1] << 8) : - CF_LE_L(b->hidden)); + VfatPrint("%10u hidden sectors\n", CF_LE_L(b->hidden)); sectors = GET_UNALIGNED_W( b->sectors ); VfatPrint("%10u sectors total\n", sectors ? sectors : CF_LE_L(b->total_sect)); } @@ -320,27 +309,12 @@ read_fsinfo(fs,&b,logical_sector_size); } - else if (!atari_format) { + else { /* On real MS-DOS, a 16 bit FAT is used whenever there would be too - * much clusers otherwise. */ + * much clusters otherwise. */ fs->fat_bits = (fs->clusters > MSDOS_FAT12) ? 16 : 12; } - else { - /* On Atari, things are more difficult: GEMDOS always uses 12bit FATs - * on floppies, and always 16 bit on harddisks. */ - fs->fat_bits = 16; /* assume 16 bit FAT for now */ - /* If more clusters than fat entries in 16-bit fat, we assume - * it's a real MSDOS FS with 12-bit fat. */ - if (fs->clusters+2 > fat_length*logical_sector_size*8/16 || - /* if it's a floppy disk --> 12bit fat */ - device_no == 2 || - /* if it's a ramdisk or loopback device and has one of the usual - * floppy sizes -> 12bit FAT */ - ((device_no == 1 || device_no == 7) && - (total_sectors == 720 || total_sectors == 1440 || - total_sectors == 2880))) - fs->fat_bits = 12; - } + /* On FAT32, the high 4 bits of a FAT entry are reserved */ fs->eff_fat_bits = (fs->fat_bits == 32) ? 28 : fs->fat_bits; fs->fat_size = fat_length*logical_sector_size; @@ -356,7 +330,7 @@ die("Logical sector size (%d bytes) is not a multiple of the physical " "sector size.",logical_sector_size); /* ++roman: On Atari, these two fields are often left uninitialized */ - if (!atari_format && (!b.secs_track || !b.heads)) + if ((!b.secs_track || !b.heads)) die("Invalid disk format in boot sector."); if (FsCheckFlags & FSCHECK_VERBOSE) dump_boot(fs,&b,logical_sector_size); } Modified: trunk/reactos/lib/fslib/vfatlib/check/check.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/vfatlib/check/ch…
============================================================================== --- trunk/reactos/lib/fslib/vfatlib/check/check.c [iso-8859-1] (original) +++ trunk/reactos/lib/fslib/vfatlib/check/check.c [iso-8859-1] Fri Aug 8 04:13:21 2008 @@ -153,7 +153,7 @@ } vffree(root); } - ++n_files; + ++FsCheckTotalFiles; return offset; } @@ -221,7 +221,7 @@ static int bad_name(unsigned char *name) { int i, spc, suspicious = 0; - char *bad_chars = atari_format ? "*?\\/:" : "*?<>|\"\\/:"; + char *bad_chars = "*?<>|\"\\/:"; /* Do not complain about (and auto-correct) the extended attribute files * of OS/2. */ @@ -260,10 +260,6 @@ return 1; } - /* Under GEMDOS, chars >= 128 are never allowed. */ - if (atari_format && suspicious) - return 1; - /* Only complain about too much suspicious chars in interactive mode, * never correct them automatically. The chars are all basically ok, so we * shouldn't auto-correct such names. */ @@ -281,7 +277,7 @@ for (cluster = FSTART(file,fs); cluster > 0 && cluster < fs->clusters+2; cluster = next_cluster(fs,cluster)) set_owner(fs,cluster,NULL); - --n_files; + --FsCheckTotalFiles; } @@ -780,7 +776,7 @@ lfn_add_slot(&de,offset); return; } - new = qalloc(&mem_queue,sizeof(DOS_FILE)); + new = qalloc(&FsCheckMemQueue,sizeof(DOS_FILE)); new->lfn = lfn_get(&de); new->offset = offset; memcpy(&new->dir_ent,&de,sizeof(de)); @@ -798,7 +794,7 @@ if (offset && strncmp((char*)de.name,MSDOS_DOT,MSDOS_NAME) != 0 && strncmp((char*)de.name,MSDOS_DOTDOT,MSDOS_NAME) != 0) - ++n_files; + ++FsCheckTotalFiles; test_file(fs,new,FsCheckFlags & FSCHECK_TEST_READ); } Modified: trunk/reactos/lib/fslib/vfatlib/check/dosfsck.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/vfatlib/check/do…
============================================================================== --- trunk/reactos/lib/fslib/vfatlib/check/dosfsck.h [iso-8859-1] (original) +++ trunk/reactos/lib/fslib/vfatlib/check/dosfsck.h [iso-8859-1] Fri Aug 8 04:13:21 2008 @@ -165,18 +165,17 @@ #define FSCHECK_IMMEDIATE_WRITE 0x10 extern ULONG FsCheckFlags; -extern int atari_format; -extern unsigned n_files; -extern void *mem_queue; +extern ULONG FsCheckTotalFiles; +extern void *FsCheckMemQueue; /* value to use as end-of-file marker */ -#define FAT_EOF(fs) ((atari_format ? 0xfff : 0xff8) | FAT_EXTD(fs)) +#define FAT_EOF(fs) (0xff8 | FAT_EXTD(fs)) #define FAT_IS_EOF(fs,v) ((unsigned long)(v) >= (0xff8|FAT_EXTD(fs))) /* value to mark bad clusters */ #define FAT_BAD(fs) (0xff7 | FAT_EXTD(fs)) /* range of values used for bad clusters */ -#define FAT_MIN_BAD(fs) ((atari_format ? 0xff0 : 0xff7) | FAT_EXTD(fs)) -#define FAT_MAX_BAD(fs) ((atari_format ? 0xff7 : 0xff7) | FAT_EXTD(fs)) +#define FAT_MIN_BAD(fs) (0xff7 | FAT_EXTD(fs)) +#define FAT_MAX_BAD(fs) (0xff7 | FAT_EXTD(fs)) #define FAT_IS_BAD(fs,v) ((v) >= FAT_MIN_BAD(fs) && (v) <= FAT_MAX_BAD(fs)) /* return -16 as a number with fs->fat_bits bits */ Modified: trunk/reactos/lib/fslib/vfatlib/check/fat.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/vfatlib/check/fa…
============================================================================== --- trunk/reactos/lib/fslib/vfatlib/check/fat.c [iso-8859-1] (original) +++ trunk/reactos/lib/fslib/vfatlib/check/fat.c [iso-8859-1] Fri Aug 8 04:13:21 2008 @@ -97,7 +97,7 @@ //exit(1); } } - fs->fat = qalloc(&mem_queue,sizeof(FAT_ENTRY)*(fs->clusters+2)); + fs->fat = qalloc(&FsCheckMemQueue,sizeof(FAT_ENTRY)*(fs->clusters+2)); for (i = 2; i < fs->clusters+2; i++) get_fat(&fs->fat[i],use,i,fs); for (i = 2; i < fs->clusters+2; i++) if (fs->fat[i].value >= fs->clusters+2 && Modified: trunk/reactos/lib/fslib/vfatlib/check/io.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/vfatlib/check/io…
============================================================================== --- trunk/reactos/lib/fslib/vfatlib/check/io.c [iso-8859-1] (original) +++ trunk/reactos/lib/fslib/vfatlib/check/io.c [iso-8859-1] Fri Aug 8 04:13:21 2008 @@ -16,6 +16,8 @@ #define NDEBUG #include <debug.h> + +#define FSCTL_IS_VOLUME_DIRTY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 30, METHOD_BUFFERED, FILE_ANY_ACCESS) typedef struct _change { void *data; @@ -74,6 +76,63 @@ changes = last = NULL; did_change = 0; +} + +BOOLEAN fs_isdirty(PUNICODE_STRING DriveRoot) +{ + OBJECT_ATTRIBUTES ObjectAttributes; + ULONG DirtyMask = 0; + WCHAR TempRootBuf[128]; + UNICODE_STRING TempRoot; + HANDLE FileSystem; + IO_STATUS_BLOCK IoSb; + NTSTATUS Status; + + /* Add backslash to the end, so FS will be opened */ + TempRoot.Length = 0; + TempRoot.MaximumLength = sizeof(TempRootBuf); + TempRoot.Buffer = TempRootBuf; + RtlCopyUnicodeString(&TempRoot, DriveRoot); + if (TempRoot.Length == (TempRoot.MaximumLength-1)) return FALSE; + wcscat(TempRoot.Buffer, L"\\"); + TempRoot.Length += sizeof(WCHAR); + + InitializeObjectAttributes(&ObjectAttributes, + &TempRoot, + 0, + NULL, + NULL); + + Status = NtOpenFile(&FileSystem, + FILE_GENERIC_READ, + &ObjectAttributes, + &IoSb, + 0, + 0); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtOpenFile() failed with status 0x%.08x\n", Status); + return FALSE; + } + + /* Check if volume is dirty */ + Status = NtFsControlFile(FileSystem, + NULL, NULL, NULL, &IoSb, + FSCTL_IS_VOLUME_DIRTY, + NULL, 0, &DirtyMask, sizeof(DirtyMask)); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtFsControlFile() failed with Status 0x%08x\n", Status); + /* Close FS handle */ + NtClose(FileSystem); + return FALSE; + } + + /* Close FS handle */ + NtClose(FileSystem); + + return (DirtyMask & 1); } Modified: trunk/reactos/lib/fslib/vfatlib/check/io.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/vfatlib/check/io…
============================================================================== --- trunk/reactos/lib/fslib/vfatlib/check/io.h [iso-8859-1] (original) +++ trunk/reactos/lib/fslib/vfatlib/check/io.h [iso-8859-1] Fri Aug 8 04:13:21 2008 @@ -20,6 +20,10 @@ /* Opens the file system PATH. If RW is zero, the file system is opened read-only, otherwise, it is opened read-write. */ + +BOOLEAN fs_isdirty(PUNICODE_STRING DriveRoot); + +/* Checks if filesystem is dirty */ void fs_read(loff_t pos,int size,void *data); Modified: trunk/reactos/lib/fslib/vfatlib/check/lfn.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/vfatlib/check/lf…
============================================================================== --- trunk/reactos/lib/fslib/vfatlib/check/lfn.c [iso-8859-1] (original) +++ trunk/reactos/lib/fslib/vfatlib/check/lfn.c [iso-8859-1] Fri Aug 8 04:13:21 2008 @@ -81,7 +81,7 @@ else len += 4; } - cp = out = use_q ? qalloc( &mem_queue, len+1 ) : vfalloc( len+1 ); + cp = out = use_q ? qalloc( &FsCheckMemQueue, len+1 ) : vfalloc( len+1 ); for( up = uni; (up-uni)/2 < maxlen && (up[0] || up[1]); up += 2 ) { if (UNICODE_CONVERTABLE(up[0],up[1]))
16 years, 4 months
1
0
0
0
[fireball] 35177: - Revert NDEBUG in autochk.
by fireball@svn.reactos.org
Author: fireball Date: Fri Aug 8 03:37:20 2008 New Revision: 35177 URL:
http://svn.reactos.org/svn/reactos?rev=35177&view=rev
Log: - Revert NDEBUG in autochk. Modified: trunk/reactos/base/system/autochk/autochk.c Modified: trunk/reactos/base/system/autochk/autochk.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/autochk/autoch…
============================================================================== --- trunk/reactos/base/system/autochk/autochk.c [iso-8859-1] (original) +++ trunk/reactos/base/system/autochk/autochk.c [iso-8859-1] Fri Aug 8 03:37:20 2008 @@ -16,7 +16,7 @@ #include <ndk/ntndk.h> #include <fmifs/fmifs.h> -//#define NDEBUG +#define NDEBUG #include <debug.h> /* DEFINES ******************************************************************/
16 years, 4 months
1
0
0
0
[weiden] 35176: Very basic (and incomplete) implementation of SHCreateDesktop and SHDesktopMessageLoop to implement the Progman window class for the shell. This patch has not been submitted to WINE.
by weiden@svn.reactos.org
Author: weiden Date: Thu Aug 7 20:38:18 2008 New Revision: 35176 URL:
http://svn.reactos.org/svn/reactos?rev=35176&view=rev
Log: Very basic (and incomplete) implementation of SHCreateDesktop and SHDesktopMessageLoop to implement the Progman window class for the shell. This patch has not been submitted to WINE. Added: trunk/reactos/dll/win32/shell32/desktop.c (with props) Modified: trunk/reactos/dll/win32/shell32/shell32.rbuild trunk/reactos/dll/win32/shell32/shell32.spec trunk/reactos/dll/win32/shell32/undocshell.h Added: trunk/reactos/dll/win32/shell32/desktop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/desktop.…
============================================================================== --- trunk/reactos/dll/win32/shell32/desktop.c (added) +++ trunk/reactos/dll/win32/shell32/desktop.c [iso-8859-1] Thu Aug 7 20:38:18 2008 @@ -1,0 +1,782 @@ +/* + * Shell Desktop + * + * Copyright 2008 Thomas Bluemel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS +#define NONAMELESSUNION +#define NONAMELESSSTRUCT + +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winnls.h" +#include "winuser.h" +#include "shellapi.h" +#include "shlobj.h" +#include "undocshell.h" +#include "shell32_main.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(desktop); + +#define SHDESK_TAG 0x4b534544 + +static const WCHAR szProgmanClassName[] = {'P','r','o','g','m','a','n'}; +static const WCHAR szProgmanWindowName[] = { + 'P','r','o','g','r','a','m',' ','M','a','n','a','g','e','r' +}; + +static const IShellBrowserVtbl SHDESK_Vtbl; +static const ICommDlgBrowserVtbl SHDESK_ICommDlgBrowser_Vtbl; +static const IServiceProviderVtbl SHDESK_IServiceProvider_Vtbl; + +typedef struct _SHDESK +{ + DWORD Tag; + const IShellBrowserVtbl *lpVtbl; + const ICommDlgBrowserVtbl *lpVtblCommDlgBrowser; + const IServiceProviderVtbl *lpVtblServiceProvider; + LONG Ref; + HWND hWnd; + HWND hWndShellView; + HWND hWndDesktopListView; + IShellDesktop *ShellDesk; + IShellView *DesktopView; + IShellBrowser *DefaultShellBrowser; + LPITEMIDLIST pidlDesktopDirectory; + LPITEMIDLIST pidlDesktop; +} SHDESK, *PSHDESK; + +static IUnknown * +IUnknown_from_impl(SHDESK *This) +{ + return (IUnknown *)&This->lpVtbl; +} + +static IShellBrowser * +IShellBrowser_from_impl(SHDESK *This) +{ + return (IShellBrowser *)&This->lpVtbl; +} + +static IOleWindow * +IOleWindow_from_impl(SHDESK *This) +{ + return (IOleWindow *)&This->lpVtbl; +} + +static ICommDlgBrowser * +ICommDlgBrowser_from_impl(SHDESK *This) +{ + return (ICommDlgBrowser *)&This->lpVtblCommDlgBrowser; +} + +static IServiceProvider * +IServiceProvider_from_impl(SHDESK *This) +{ + return (IServiceProvider *)&This->lpVtblServiceProvider; +} + +static SHDESK * +impl_from_IShellBrowser(IShellBrowser *iface) +{ + return (SHDESK *)((ULONG_PTR)iface - FIELD_OFFSET(SHDESK, lpVtbl)); +} + +static SHDESK * +impl_from_ICommDlgBrowser(ICommDlgBrowser *iface) +{ + return (SHDESK *)((ULONG_PTR)iface - FIELD_OFFSET(SHDESK, lpVtblCommDlgBrowser)); +} + +static SHDESK * +impl_from_IServiceProvider(IServiceProvider *iface) +{ + return (SHDESK *)((ULONG_PTR)iface - FIELD_OFFSET(SHDESK, lpVtblServiceProvider)); +} + +static void +SHDESK_Free(SHDESK *This) +{ + if (This->ShellDesk != NULL) + IShellDesktop_Release(This->ShellDesk); + + if (This->DesktopView != NULL) + { + if (This->hWndShellView != NULL) + IShellView_DestroyViewWindow(This->DesktopView); + + IShellView_Release(This->DesktopView); + This->DesktopView = NULL; + This->hWndShellView = NULL; + This->hWndDesktopListView = NULL; + } + + if (This->pidlDesktopDirectory != NULL) + { + ILFree(This->pidlDesktopDirectory); + This->pidlDesktopDirectory = NULL; + } + + if (This->pidlDesktop != NULL) + { + ILFree(This->pidlDesktop); + This->pidlDesktop = NULL; + } + + ZeroMemory(This, sizeof(SHDESK)); + LocalFree((HLOCAL)This); +} + +static ULONG STDMETHODCALLTYPE +SHDESK_Release(IShellBrowser *iface) +{ + SHDESK *This = impl_from_IShellBrowser(iface); + ULONG Ret; + + Ret = InterlockedDecrement(&This->Ref); + if (Ret == 0) + SHDESK_Free(This); + + return Ret; +} + +static ULONG STDMETHODCALLTYPE +SHDESK_AddRef(IShellBrowser *iface) +{ + SHDESK *This = impl_from_IShellBrowser(iface); + + return InterlockedIncrement(&This->Ref); +} + +static HRESULT STDMETHODCALLTYPE +SHDESK_QueryInterface(IShellBrowser *iface, REFIID riid, LPVOID *ppvObj) +{ + SHDESK *This; + + if (ppvObj == NULL) + return E_POINTER; + + This = impl_from_IShellBrowser(iface); + + if (IsEqualIID(riid, &IID_IUnknown)) + { + *ppvObj = IUnknown_from_impl(This); + } + else if (This->DefaultShellBrowser != NULL) + { + return IShellBrowser_QueryInterface(This->DefaultShellBrowser, riid, ppvObj); + } + else if (IsEqualIID(riid, &IID_IOleWindow)) + { + *ppvObj = IOleWindow_from_impl(This); + } + else if (IsEqualIID(riid, &IID_IShellBrowser)) + { + *ppvObj = IShellBrowser_from_impl(This); + } + else if (IsEqualIID(riid, &IID_ICommDlgBrowser)) + { + *ppvObj = ICommDlgBrowser_from_impl(This); + } + else if (IsEqualIID(riid, &IID_IServiceProvider)) + { + *ppvObj = IServiceProvider_from_impl(This); + } + else + { + *ppvObj = NULL; + return E_NOINTERFACE; + } + + SHDESK_AddRef(iface); + return S_OK; +} + +static PSHDESK +SHDESK_Create(HWND hWnd, LPCREATESTRUCT lpCreateStruct) +{ + IShellFolder *psfDesktopFolder; + IShellDesktop *ShellDesk; + CSFV csfv; + SHDESK *This; + HRESULT hRet; + + ShellDesk = (IShellDesktop *)lpCreateStruct->lpCreateParams; + if (ShellDesk == NULL) + { + WARN("No IShellDesk interface provided!"); + return NULL; + } + + This = (PSHDESK)LocalAlloc(LMEM_FIXED, sizeof(SHDESK)); + if (This == NULL) + return NULL; + + ZeroMemory(This, sizeof(SHDESK)); + This->Tag = SHDESK_TAG; + This->lpVtbl = &SHDESK_Vtbl; + This->lpVtblCommDlgBrowser = &SHDESK_ICommDlgBrowser_Vtbl; + This->lpVtblServiceProvider = &SHDESK_IServiceProvider_Vtbl; + This->Ref = 1; + This->hWnd = hWnd; + This->ShellDesk = ShellDesk; + IShellDesktop_AddRef(ShellDesk); + + This->pidlDesktopDirectory = SHCloneSpecialIDList(This->hWnd, CSIDL_DESKTOPDIRECTORY, FALSE); + hRet = SHGetSpecialFolderLocation(This->hWnd, CSIDL_DESKTOP, &This->pidlDesktop); + if (!SUCCEEDED(hRet)) + goto Fail; + + hRet = SHGetDesktopFolder(&psfDesktopFolder); + if (!SUCCEEDED(hRet)) + goto Fail; + + ZeroMemory(&csfv, sizeof(csfv)); + csfv.cbSize = sizeof(csfv); + csfv.pshf = psfDesktopFolder; + csfv.psvOuter = NULL; + + hRet = SHCreateShellFolderViewEx(&csfv, &This->DesktopView); + IShellFolder_Release(psfDesktopFolder); + + if (!SUCCEEDED(hRet)) + { +Fail: + SHDESK_Release(IShellBrowser_from_impl(This)); + return NULL; + } + + return This; +} + +static BOOL +SHDESK_CreateDeskWnd(SHDESK *This) +{ + IShellBrowser *ShellBrowser; + FOLDERSETTINGS fs; + RECT rcClient; + HRESULT hRet; + + if (!GetClientRect(This->hWnd, + &rcClient)) + { + return FALSE; + } + + ShellBrowser = IShellBrowser_from_impl(This); + + fs.ViewMode = FVM_ICON; + fs.fFlags = FWF_DESKTOP | FWF_NOCLIENTEDGE | FWF_NOSCROLL | FWF_TRANSPARENT; + hRet = IShellView_CreateViewWindow(This->DesktopView, NULL, &fs, ShellBrowser, &rcClient, &This->hWndShellView); + if (!SUCCEEDED(hRet)) + return FALSE; + + return TRUE; +} + +static HRESULT STDMETHODCALLTYPE +SHDESK_GetWindow(IShellBrowser *iface, HWND *phwnd) +{ + SHDESK *This = impl_from_IShellBrowser(iface); + + if (This->hWnd != NULL) + { + *phwnd = This->hWnd; + return S_OK; + } + + *phwnd = NULL; + return E_UNEXPECTED; +} + +static HRESULT STDMETHODCALLTYPE +SHDESK_ContextSensitiveHelp(IShellBrowser *iface, BOOL fEnterMode) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE +SHDESK_InsertMenusSB(IShellBrowser *iface, HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE +SHDESK_SetMenuSB(IShellBrowser *iface, HMENU hmenuShared, HOLEMENU holemenuRes, HWND hwndActiveObject) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE +SHDESK_RemoveMenusSB(IShellBrowser *iface, HMENU hmenuShared) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE +SHDESK_SetStatusTextSB(IShellBrowser *iface, LPCOLESTR lpszStatusText) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE +SHDESK_EnableModelessSB(IShellBrowser *iface, BOOL fEnable) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE +SHDESK_TranslateAcceleratorSB(IShellBrowser *iface, LPMSG lpmsg, WORD wID) +{ + return S_FALSE; +} + +static HRESULT STDMETHODCALLTYPE +SHDESK_BrowseObject(IShellBrowser *iface, LPCITEMIDLIST pidl, UINT wFlags) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE +SHDESK_GetViewStateStream(IShellBrowser *iface, DWORD grfMode, IStream **ppStrm) +{ + return E_NOTIMPL; +} + +static HWND +DesktopGetWindowControl(IN SHDESK *This, + IN UINT id) +{ + switch (id) + { + case FCW_TOOLBAR: + case FCW_STATUS: + case FCW_TREE: + case FCW_PROGRESS: + return NULL; + + default: + return NULL; + } + +} + +static HRESULT STDMETHODCALLTYPE +SHDESK_GetControlWindow(IShellBrowser *iface, UINT id, HWND *lphwnd) +{ + SHDESK *This = impl_from_IShellBrowser(iface); + HWND hWnd; + + hWnd = DesktopGetWindowControl(This, + id); + if (hWnd != NULL) + { + *lphwnd = hWnd; + return S_OK; + } + + *lphwnd = NULL; + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE +SHDESK_SendControlMsg(IShellBrowser *iface, UINT id, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pret) +{ + SHDESK *This = impl_from_IShellBrowser(iface); + HWND hWnd; + + if (pret == NULL) + return E_POINTER; + + hWnd = DesktopGetWindowControl(This, + id); + if (hWnd != NULL) + { + *pret = SendMessage(hWnd, + uMsg, + wParam, + lParam); + return S_OK; + } + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE +SHDESK_QueryActiveShellView(IShellBrowser *iface, IShellView **ppshv) +{ + IShellView *ActiveView; + SHDESK *This = impl_from_IShellBrowser(iface); + + ActiveView = This->DesktopView; + SHDESK_AddRef(iface); + *ppshv = ActiveView; + + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE +SHDESK_OnViewWindowActive(IShellBrowser *iface, IShellView *ppshv) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE +SHDESK_SetToolbarItems(IShellBrowser *iface, LPTBBUTTON lpButtons, UINT nButtons, UINT uFlags) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE +SHDESK_ICommDlgBrowser_QueryInterface(ICommDlgBrowser *iface, REFIID riid, LPVOID *ppvObj) +{ + SHDESK *This = impl_from_ICommDlgBrowser(iface); + IShellBrowser *ShellBrowser = IShellBrowser_from_impl(This); + + return SHDESK_QueryInterface(ShellBrowser, riid, ppvObj); +} + +static ULONG STDMETHODCALLTYPE +SHDESK_ICommDlgBrowser_Release(ICommDlgBrowser *iface) +{ + SHDESK *This = impl_from_ICommDlgBrowser(iface); + IShellBrowser *ShellBrowser = IShellBrowser_from_impl(This); + + return SHDESK_Release(ShellBrowser); +} + +static ULONG STDMETHODCALLTYPE +SHDESK_ICommDlgBrowser_AddRef(ICommDlgBrowser *iface) +{ + SHDESK *This = impl_from_ICommDlgBrowser(iface); + IShellBrowser *ShellBrowser = IShellBrowser_from_impl(This); + + return SHDESK_AddRef(ShellBrowser); +} + +static HRESULT STDMETHODCALLTYPE +SHDESK_ICommDlgBrowser_OnDefaultCommand(ICommDlgBrowser *iface, IShellView *ppshv) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE +SHDESK_ICommDlgBrowser_OnStateChange(ICommDlgBrowser *iface, IShellView *ppshv, ULONG uChange) +{ + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE +SHDESK_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *iface, IShellView *ppshv, LPCITEMIDLIST pidl) +{ + return S_OK; +} + +static const ICommDlgBrowserVtbl SHDESK_ICommDlgBrowser_Vtbl = +{ + /* IUnknown */ + SHDESK_ICommDlgBrowser_QueryInterface, + SHDESK_ICommDlgBrowser_AddRef, + SHDESK_ICommDlgBrowser_Release, + /* ICommDlgBrowser */ + SHDESK_ICommDlgBrowser_OnDefaultCommand, + SHDESK_ICommDlgBrowser_OnStateChange, + SHDESK_ICommDlgBrowser_IncludeObject +}; + +static HRESULT STDMETHODCALLTYPE +SHDESK_IServiceProvider_QueryInterface(IServiceProvider *iface, REFIID riid, LPVOID *ppvObj) +{ + SHDESK *This = impl_from_IServiceProvider(iface); + IShellBrowser *ShellBrowser = IShellBrowser_from_impl(This); + + return SHDESK_QueryInterface(ShellBrowser, riid, ppvObj); +} + +static ULONG STDMETHODCALLTYPE +SHDESK_IServiceProvider_Release(IServiceProvider *iface) +{ + SHDESK *This = impl_from_IServiceProvider(iface); + IShellBrowser *ShellBrowser = IShellBrowser_from_impl(This); + + return SHDESK_Release(ShellBrowser); +} + +static ULONG STDMETHODCALLTYPE +SHDESK_IServiceProvider_AddRef(IServiceProvider *iface) +{ + SHDESK *This = impl_from_IServiceProvider(iface); + IShellBrowser *ShellBrowser = IShellBrowser_from_impl(This); + + return SHDESK_AddRef(ShellBrowser); +} + +static HRESULT STDMETHODCALLTYPE +SHDESK_IServiceProvider_QueryService(IServiceProvider *iface, REFGUID guidService, REFIID riid, PVOID *ppv) +{ + /* FIXME - handle guidService */ + return SHDESK_IServiceProvider_QueryInterface(iface, riid, ppv); +} + +static const IServiceProviderVtbl SHDESK_IServiceProvider_Vtbl = +{ + /* IUnknown */ + SHDESK_IServiceProvider_QueryInterface, + SHDESK_IServiceProvider_AddRef, + SHDESK_IServiceProvider_Release, + /* IServiceProvider */ + SHDESK_IServiceProvider_QueryService +}; + +static BOOL +SHDESK_MessageLoop(SHDESK *This) +{ + MSG Msg; + BOOL bRet; + + while ((bRet = GetMessage(&Msg, NULL, 0, 0)) != 0) + { + if (bRet != -1) + { + TranslateMessage(&Msg); + DispatchMessage(&Msg); + } + } + + return TRUE; +} + +static LRESULT CALLBACK +ProgmanWindowProc(IN HWND hwnd, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + SHDESK *This = NULL; + LRESULT Ret = FALSE; + + if (uMsg != WM_NCCREATE) + { + This = (SHDESK*)GetWindowLongPtrW(hwnd, + 0); + if (This == NULL) + goto DefMsgHandler; + } + + if (This != NULL || uMsg == WM_NCCREATE) + { + switch (uMsg) + { + case WM_ERASEBKGND: + PaintDesktop((HDC)wParam); + break; + + case WM_GETISHELLBROWSER: + Ret = (LRESULT)IShellBrowser_from_impl(This); + break; + + case WM_SIZE: + if (wParam == SIZE_MINIMIZED) + { + /* Hey, we're the desktop!!! */ + ShowWindow(hwnd, + SW_RESTORE); + } + else + { + RECT rcDesktop; + + rcDesktop.left = GetSystemMetrics(SM_XVIRTUALSCREEN); + rcDesktop.top = GetSystemMetrics(SM_YVIRTUALSCREEN); + rcDesktop.right = GetSystemMetrics(SM_CXVIRTUALSCREEN); + rcDesktop.bottom = GetSystemMetrics(SM_CYVIRTUALSCREEN); + + /* FIXME: Update work area */ + } + break; + + case WM_SYSCOLORCHANGE: + { + InvalidateRect(This->hWnd, + NULL, + TRUE); + + if (This->hWndShellView != NULL) + { + /* Forward the message */ + SendMessageW(This->hWndShellView, + WM_SYSCOLORCHANGE, + wParam, + lParam); + } + break; + } + + case WM_CREATE: + { + IShellDesktop_RegisterDesktopWindow(This->ShellDesk, + This->hWnd); + + if (!SHDESK_CreateDeskWnd(This)) + WARN("Could not create the desktop view control!\n"); + break; + } + + case WM_NCCREATE: + { + LPCREATESTRUCT CreateStruct = (LPCREATESTRUCT)lParam; + This = SHDESK_Create(hwnd, CreateStruct); + if (This == NULL) + { + WARN("Failed to create desktop structure\n"); + break; + } + + SetWindowLongPtrW(hwnd, + 0, + (LONG_PTR)This); + Ret = TRUE; + break; + } + + case WM_NCDESTROY: + { + SHDESK_Free(This); + break; + } + + default: +DefMsgHandler: + Ret = DefWindowProcW(hwnd, uMsg, wParam, lParam); + break; + } + } + + return Ret; +} + +static BOOL +RegisterProgmanWindowClass(VOID) +{ + WNDCLASSW wcProgman; + + wcProgman.style = CS_DBLCLKS; + wcProgman.lpfnWndProc = ProgmanWindowProc; + wcProgman.cbClsExtra = 0; + wcProgman.cbWndExtra = sizeof(PSHDESK); + wcProgman.hInstance = shell32_hInstance; + wcProgman.hIcon = NULL; + wcProgman.hCursor = LoadCursor(NULL, + IDC_ARROW); + wcProgman.hbrBackground = (HBRUSH)(COLOR_BACKGROUND + 1); + wcProgman.lpszMenuName = NULL; + wcProgman.lpszClassName = szProgmanClassName; + + return RegisterClassW(&wcProgman) != 0; +} + + +/************************************************************************* + * SHCreateDesktop [SHELL32.200] + * + */ +HANDLE WINAPI SHCreateDesktop(IShellDesktop *ShellDesk) +{ + HWND hWndDesk; + RECT rcDesk; + + if (ShellDesk == NULL) + { + SetLastError(ERROR_INVALID_PARAMETER); + return NULL; + } + + if (RegisterProgmanWindowClass() == 0) + { + WARN("Failed to register the Progman window class!\n"); + return NULL; + } + + rcDesk.left = GetSystemMetrics(SM_XVIRTUALSCREEN); + rcDesk.top = GetSystemMetrics(SM_YVIRTUALSCREEN); + rcDesk.right = rcDesk.left + GetSystemMetrics(SM_CXVIRTUALSCREEN); + rcDesk.bottom = rcDesk.top + GetSystemMetrics(SM_CYVIRTUALSCREEN); + + if (IsRectEmpty(&rcDesk)) + { + rcDesk.left = rcDesk.top = 0; + rcDesk.right = GetSystemMetrics(SM_CXSCREEN); + rcDesk.bottom = GetSystemMetrics(SM_CYSCREEN); + } + + hWndDesk = CreateWindowExW(0, szProgmanClassName, szProgmanWindowName, + WS_POPUP | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, + rcDesk.left, rcDesk.top, rcDesk.right, rcDesk.bottom, + NULL, NULL, shell32_hInstance, (LPVOID)ShellDesk); + if (hWndDesk != NULL) + return (HANDLE)GetWindowLongPtr(hWndDesk, 0); + + return NULL; +} + +/************************************************************************* + * SHCreateDesktop [SHELL32.201] + * + */ +BOOL WINAPI SHDesktopMessageLoop(HANDLE hDesktop) +{ + PSHDESK Desk = (PSHDESK)hDesktop; + + if (Desk == NULL || Desk->Tag != SHDESK_TAG) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + return SHDESK_MessageLoop(Desk); +} + +static const IShellBrowserVtbl SHDESK_Vtbl = +{ + /* IUnknown */ + SHDESK_QueryInterface, + SHDESK_AddRef, + SHDESK_Release, + /* IOleWindow */ + SHDESK_GetWindow, + SHDESK_ContextSensitiveHelp, + /* IShellBrowser */ + SHDESK_InsertMenusSB, + SHDESK_SetMenuSB, + SHDESK_RemoveMenusSB, + SHDESK_SetStatusTextSB, + SHDESK_EnableModelessSB, + SHDESK_TranslateAcceleratorSB, + SHDESK_BrowseObject, + SHDESK_GetViewStateStream, + SHDESK_GetControlWindow, + SHDESK_SendControlMsg, + SHDESK_QueryActiveShellView, + SHDESK_OnViewWindowActive, + SHDESK_SetToolbarItems +}; Propchange: trunk/reactos/dll/win32/shell32/desktop.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/shell32/shell32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shell32.…
============================================================================== --- trunk/reactos/dll/win32/shell32/shell32.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shell32.rbuild [iso-8859-1] Thu Aug 7 20:38:18 2008 @@ -35,6 +35,7 @@ <file>dataobject.c</file> <file>dde.c</file> <file>debughlp.c</file> + <file>desktop.c</file> <file>dialogs.c</file> <file>dragdrophelper.c</file> <file>enumidlist.c</file> Modified: trunk/reactos/dll/win32/shell32/shell32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shell32.…
============================================================================== --- trunk/reactos/dll/win32/shell32/shell32.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shell32.spec [iso-8859-1] Thu Aug 7 20:38:18 2008 @@ -189,8 +189,8 @@ 197 stub -noname SHGlobalDefect 198 stdcall -noname SHAbortInvokeCommand() 199 stub SHGetFileIcon - 200 stub SHLocalAlloc - 201 stub SHLocalFree + 200 stdcall SHCreateDesktop(ptr) + 201 stdcall SHDesktopMessageLoop(ptr) 202 stub SHLocalReAlloc 203 stub AddCommasW 204 stub ShortSizeFormatW Modified: trunk/reactos/dll/win32/shell32/undocshell.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/undocshe…
============================================================================== --- trunk/reactos/dll/win32/shell32/undocshell.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/undocshell.h [iso-8859-1] Thu Aug 7 20:38:18 2008 @@ -548,6 +548,37 @@ DEFINE_GUID(CLSID_OpenWith, 0x09799AFB, 0xAD67, 0x11d1, 0xAB,0xCD,0x00,0xC0,0x4F,0xC3,0x09,0x36); DEFINE_GUID(CLSID_StartMenu, 0x4622AD11, 0xFF23, 0x11D0, 0x8D,0x34,0x00,0xA0,0xC9,0x0F,0x27,0x19); +/* Shell Desktop functions */ + +#undef INTERFACE +#define INTERFACE IShellDesktop +DECLARE_INTERFACE_(IShellDesktop,IUnknown) +{ + /*** IUnknown ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IShellDesktopTray ***/ + STDMETHOD_(ULONG,GetState)(THIS) PURE; + STDMETHOD(GetTrayWindow)(THIS_ HWND*) PURE; + STDMETHOD(RegisterDesktopWindow)(THIS_ HWND) PURE; + STDMETHOD(Unknown)(THIS_ DWORD,DWORD) PURE; +}; +#undef INTERFACE + +#define IShellDesktop_QueryInterface(T,a,b) (T)->lpVtbl->QueryInterface(T,a,b) +#define IShellDesktop_AddRef(T) (T)->lpVtbl->AddRef(T) +#define IShellDesktop_Release(T) (T)->lpVtbl->Release(T) +#define IShellDesktop_GetState(T) (T)->lpVtbl->GetState(T) +#define IShellDesktop_GetTrayWindow(T,a) (T)->lpVtbl->GetTrayWindow(T,a) +#define IShellDesktop_RegisterDesktopWindow(T,a) (T)->lpVtbl->RegisterDesktopWindow(T,a) +#define IShellDesktop_Unknown(T,a,b) (T)->lpVtbl->Unknown(T,a,b) + +#define WM_GETISHELLBROWSER (WM_USER+7) + +HANDLE WINAPI SHCreateDesktop(IShellDesktop*); +BOOL WINAPI SHDesktopMessageLoop(HANDLE); + #ifdef __cplusplus } /* extern "C" */ #endif /* defined(__cplusplus) */
16 years, 4 months
1
0
0
0
[tkreuzer] 35175: Implement FLOATOBJ api in assembly. ~~ On x86 (and only there) we must not use the FPU in kernel mode code, because the fpu state is not safed on normal context switches. That's why there's the FLOATOBJ api. It provides the needed fp emulation for win32k and drivers. I wrote it in asm to be fast. It's not yet plugged in.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Aug 7 17:41:36 2008 New Revision: 35175 URL:
http://svn.reactos.org/svn/reactos?rev=35175&view=rev
Log: Implement FLOATOBJ api in assembly. ~~ On x86 (and only there) we must not use the FPU in kernel mode code, because the fpu state is not safed on normal context switches. That's why there's the FLOATOBJ api. It provides the needed fp emulation for win32k and drivers. I wrote it in asm to be fast. It's not yet plugged in. Added: trunk/reactos/subsystems/win32/win32k/eng/i386/ trunk/reactos/subsystems/win32/win32k/eng/i386/floatobj.S (with props) Added: trunk/reactos/subsystems/win32/win32k/eng/i386/floatobj.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/eng/i386/floatobj.S (added) +++ trunk/reactos/subsystems/win32/win32k/eng/i386/floatobj.S [iso-8859-1] Thu Aug 7 17:41:36 2008 @@ -1,0 +1,1155 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Win32 subsystem + * PURPOSE: FLOATOBJ floating point emulation functions for x86 + * FILE: subsystems/win32/win32k/objects/i386/floatobj.S + * PROGRAMMER: Timo Kreuzer + */ + + +/******************************************************************************* + * IEEE 754-1985 single precision floating point + * + * | 31 | 30...23 | 22...0 | + * |sign| exponent | fraction | + * + * mantissa = 1 + (fraction / 2^23) + * f = (-1)^sign * mantissa * 2 ^ (exponent - bias) + * bias = 127 + * + ******************************************************************************* + * win32k x86 floating point emulation + * + * struct _EFLOAT + = { + * LONG lMant; + * LONG lExp; + * }; + * + * f = (lMant / 0x40000000) * 2 ^ (lExp - 2) + * = lMant * 2 ^ (lExp - 32) + * + ******************************************************************************* + * Optimization notes: + * + * - shld is slow (4 cycles) and not pairable, mov + shl is faster + * - esp is used, beacuse it's available earlier + * - bsr is very slow on old cpus (up to 72 cycles on a p1) while being much + * faster on modern cpus (2-11 cycles). Workarounds using branch trees or + * table lookups are of no use nowadays. + ******************************************************************************* + * Compatibility notes: + * - There are issues with very large size values near integer overflow. + * Floating point values are behaving different there. This behavior isn't + * simulated yet. Difference is < 10^-5 % + * - The result of a multiplication can differ from Windows result in the + * least significant bit, that is a difference of 1 / 2^30 or ~10^-9 + ******************************************************************************* + * Implementation status: + * + * FLOATOBJ_SetFloat - implemented, tested + * FLOATOBJ_SetLong - implemented, tested + * FLOATOBJ_GetFloat - implemented, tested + * FLOATOBJ_GetLong - implemented, tested + * FLOATOBJ_Equal - implemented, tested + * FLOATOBJ_EqualLong - implemented + * FLOATOBJ_GreaterThan - implemented + * FLOATOBJ_GreaterThanLong - wrapper + * FLOATOBJ_LessThan - implemented + * FLOATOBJ_LessThanLong - wrapper + * FLOATOBJ_Neg - implemented + * FLOATOBJ_Mul - implemented, tested, optimized + * FLOATOBJ_MulFloat - wrapper + * FLOATOBJ_MulLong - wrapper, could really need optimization + * FLOATOBJ_Div - implemented + * FLOATOBJ_DivFloat - wrapper + * FLOATOBJ_DivLong - wrapper + * FLOATOBJ_Add - implemented, tested + * FLOATOBJ_AddFloat - wrapper + * FLOATOBJ_AddLong - wrapper + * FLOATOBJ_Sub - implemented, tested + * FLOATOBJ_SubFloat - wrapper + * FLOATOBJ_SubLong - wrapper + */ + +.intel_syntax noprefix +.text + +#define lMant 0 +#define lExp 4 + +#define PARAM1 8 +#define PARAM2 12 + +/****************************************************************************** + * VOID + * APIENTRY + * FLOATOBJ_SetFloat(IN OUT PFLOATOBJ pf, IN FLOATL f); + */ +_FLOATOBJ_SetFloat@8: +.global _FLOATOBJ_SetFloat@8 + push ebp + mov ebp, esp + + mov ecx, [esp + PARAM2] /* Load the float into ecx */ + mov eax, ecx /* Copy float to eax for later */ + + test ecx, 0x7f800000 /* Check for zero exponent - 0 or denormal */ + jz SetFloat0 /* If it's all zero, ... */ + + shl ecx, 7 /* Put the bits for the mantissa in place */ + + cdq /* Fill edx with the sign from the FLOATL in eax */ + and ecx, 0x7fffffff /* Mask out invalid field in the mantissa */ + + shr eax, 23 /* Shift the exponent in eax in place */ + or ecx, 0x40000000 /* Set bit for 1 in the mantissa */ + and eax, 0xff /* Mask out invalid fields in the exponent in eax */ + + xor ecx, edx /* Make use of the sign bit expanded to full edx */ + + sub eax, 125 /* Adjust exonent bias */ + + sub ecx, edx /* Substract -1 or add 1 if sign was set */ + + mov edx, [esp + PARAM1] /* Load pf into edx */ + mov [edx + lMant], ecx /* Save back mantissa */ + mov [edx + lExp], eax /* Save back exponent */ + + pop ebp /* Return */ + ret 8 + +SetFloat0: + mov edx, [esp + PARAM1] /* Load pf into edx */ + + mov dword ptr [edx + lMant], 0 /* Set mantissa and exponent to 0 */ + mov dword ptr [edx + lExp], 0 + + pop ebp /* Return */ + ret 8 + + +/******************************************************************************* + * LONG + * APIENTRY + * FLOATOBJ_GetFloat(IN PFLOATOBJ pf); + * + */ +_FLOATOBJ_GetFloat@4: +.global _FLOATOBJ_GetFloat@4 + push ebp + mov ebp, esp + + mov edx, [esp + PARAM1] /* Load pf into edx */ + mov eax, [edx + lMant] /* Load mantissa into eax */ + mov ecx, [edx + lExp] /* Load exponent into ecx */ + + cdq /* Calculate abs(mantissa) */ + xor eax, edx + + add ecx, 125 + + sub eax, edx + jz GetFloatRet + + and ecx, 0xff /* Mask out invalid fields in the exponent */ + and eax, 0x3fffffff /* Mask out invalid fields in mantissa */ + + shl ecx, 23 /* Shift exponent in place */ + shr eax, 7 /* Shift mantissa in place */ + + and edx, 0x80000000 /* Reduce edx to sign bit only */ + + or eax, ecx /* Set exponent in result */ + or eax, edx /* Set sign bit in result */ + +GetFloatRet: + /* Return */ + pop ebp + ret 4 + + + +/****************************************************************************** + * VOID + * APIENTRY + * FLOATOBJ_SetLong(OUT PFLOATOBJ pf, IN LONG l); + * + * Instead of using abs(l), which is 3 + 2 instructions, use a branch. + */ +_FLOATOBJ_SetLong@8: +.global _FLOATOBJ_SetLong@8 + push ebp + mov ebp, esp + + mov eax, [esp + PARAM2] /* Load l into eax */ + mov edx, [esp + PARAM1] /* Load pf into edx */ + + test eax, eax /* different handling for <0, =0 and >0 */ + js SetLongNeg + jz SetLong0 + + bsr ecx, eax /* Get number of most significant bit aka log2(l) */ + mov [edx + lExp], ecx /* Safe log2(l) into exponent */ + + neg ecx /* Calculate necessary shift */ + add ecx, 30 + + add dword ptr [edx + lExp], 2 /* Adjust exponent */ + + shl eax, cl /* Shift mantissa in place */ + mov [edx + lMant], eax /* Save mantissa */ + + pop ebp /* Return */ + ret 8 + +SetLongNeg: + neg eax /* Get absolute value of l */ + bsr ecx, eax /* Get number of most significant bit aka log2(l) */ + neg eax /* Back to negative */ + + mov [edx + lExp], ecx /* Safe log2(-l) into exponent */ + + neg ecx /* Calculate necessary shift */ + add ecx, 30 + + add dword ptr [edx + lExp], 2 /* Adjust exponent */ + + shl eax, cl /* Shift mantissa in place */ + mov [edx + lMant], eax /* Save mantissa */ + + pop ebp /* Return */ + ret 8 + +SetLong0: + mov dword ptr [edx + lMant], 0 /* Set mantissa and exponent to 0 */ + mov dword ptr [edx + lExp], 0 + + pop ebp /* Return */ + ret 8 + + +/******************************************************************************* + * LONG + * APIENTRY + * FLOATOBJ_GetLong(IN PFLOATOBJ pf); + * + */ +_FLOATOBJ_GetLong@4: +.global _FLOATOBJ_GetLong@4 + push ebp + mov ebp, esp + + mov edx, [ebp + PARAM1] /* Load pf into edx */ + mov ecx, 32 /* Load (32 - lExp) into ecx */ + sub ecx, [edx + lExp] + jle short GetLong2 /* Check for Overflow */ + + mov eax, [edx + lMant] /* Load mantissa into eax */ + sar eax, cl /* Signed shift mantissa according to exponent */ + + pop ebp /* Return */ + ret 4 + +GetLong2: + xor eax, eax /* Overflow, return 0 */ + pop ebp + ret 4 + + +/****************************************************************************** + * BOOL + * APIENTRY + * FLOATOBJ_Equal(IN PFLOATOBJ pf1, IN PFLOATOBJ pf2); + */ +_FLOATOBJ_Equal@8: +.global _FLOATOBJ_Equal@8 + push ebp + mov ebp, esp + + mov ecx, [esp + PARAM1] /* Load pf1 into ecx */ + mov eax, [esp + PARAM2] /* Load pf2 into ecx */ + + mov edx, [ecx + lExp] /* Get float1 in ecx, edx */ + mov ecx, [ecx + lMant] + + sub edx, [eax + lExp] /* Calculate diference to float2 */ + sub ecx, [eax + lMant] + + or edx, ecx /* Combine */ + + mov eax, 0 /* Set eax if combination is 0 */ + setz al + + pop ebp /* Return */ + ret 8 + + +/****************************************************************************** + * BOOL + * APIENTRY + * FLOATOBJ_EqualLong(IN PFLOATOBJ pf, IN LONG l); + */ +_FLOATOBJ_EqualLong@8: +.global _FLOATOBJ_EqualLong@8 + push ebp + mov ebp, esp + + mov eax, [esp + PARAM1] /* Load pf into eax */ + mov ecx, 32 /* Load (32 - lExp) into ecx */ + sub ecx, [eax + lExp] + mov edx, [eax + lMant] /* Load mantissa into edx */ + sar edx, cl /* Signed shift mantissa according to exponent */ + shl edx, cl /* Shift the mantissa back */ + cmp edx, [eax + lMant] /* Check whether bits were killed by shifting */ + jnz EqualLongFalse /* We have truncated the mantissa, return 0 */ + + sar edx, cl /* Shift the mantissa again */ + xor eax, eax /* Set return value ... */ + cmp edx, [esp + PARAM2] /* TRUE if shifted mantissa equals the LONG */ + setz al + + pop ebp /* Return */ + ret 8 + +EqualLongFalse: + xor eax, eax /* Return FALSE */ + pop ebp + ret 8 + + +/****************************************************************************** + * BOOL + * APIENTRY + * FLOATOBJ_GreaterThan(IN PFLOATOBJ pf, IN PFLOATOBJ pf1); + * + */ +_FLOATOBJ_GreaterThan@8: +.global _FLOATOBJ_GreaterThan@8 + push ebp + mov ebp, esp + + mov eax, [ebp + PARAM1] /* Load pointer to efloat1 in eax */ + mov edx, [ebp + PARAM2] /* Load pointer to efloat2 in edx */ + + mov ecx, [eax + lMant] /* Load mantissa1 in ecx */ + mov edx, [edx + lMant] /* Load mantissa2 in edx */ + + sar ecx, 31 /* Calculate sign(lMant1) in ecx */ + sar edx, 31 /* Calculate sign(lMant2) in edx */ + + cmp ecx, edx /* Branch if both have the same sign */ + je GreaterThan_2 + + /* Mantissae have different sign */ + mov eax, 0 /* Return (sign(lMant1) > sign(lMant2)) */ + setg al + pop ebp + ret 8 + +GreaterThan_2: + /* Mantissae have the same sign */ + + mov edx, [ebp + PARAM2] /* Reload pointer to float2 in edx */ + test ecx, ecx /* Branch if sign is negative */ + js GreaterThan_neg + + /* Both mantissae are positive or 0 */ + + or ecx, [edx + lMant] /* Branch if one mantissa is 0 */ + jz GreaterThan_pos2 + + /* Both mantissae are positive */ + + mov ecx, [eax + lExp] /* Branch if exponents are equal */ + cmp ecx, [edx + lExp] + je GreaterThan_pos2 + + mov eax, 0 /* Return (lExp1 > lExp2) */ + setg al + pop ebp + ret 8 + +GreaterThan_pos2: + /* Exponents are equal or one mantissa is 0 */ + + mov ecx, [eax + lMant] /* Return (lMant1 > lMant2) */ + cmp ecx, [edx + lMant] + mov eax, 0 + setg al + pop ebp + ret 8 + +GreaterThan_neg: + /* Both mantissae are negative */ + + mov ecx, [eax + lExp] /* Branch if exponents are equal */ + cmp ecx, [edx + lExp] + je GreaterThan_neg2 + + /* Both mantissae negative, exponents are different */ + + mov eax, 0 /* Return (lExp1 < lExp2) */ + setl al + pop ebp + ret 8 + +GreaterThan_neg2: + /* Both mantissae negative, exponents are equal */ + + mov ecx, [eax + lMant] /* Return (lMant1 < lMant2) */ + cmp ecx, [edx + lMant] + mov eax, 0 + setl al + pop ebp + ret 8 + + + +/****************************************************************************** + * VOID + * APIENTRY + * FLOATOBJ_GreaterThanLong(IN OUT PFLOATOBJ pf, IN LONG l); + * + * Currently implemented as a wrapper around FLOATOBJ_SetLong and + * LOATOBJ_GreaterThan + */ +_FLOATOBJ_GreaterThanLong@8: +.global _FLOATOBJ_GreaterThanLong@8 + push ebp + mov ebp, esp + + sub esp, 8 /* Make room for a FLOATOBJ on the stack */ + mov eax, [ebp + PARAM2] /* Load LONG into eax */ + + lea ecx, [ebp -8] /* Load pointer to local FLOATOBJ into ecx */ + + push eax /* Push LONG on the stack */ + push ecx /* Push pointer to local FLOATOBJ on the stack */ + call _FLOATOBJ_SetLong@8 /* Set the local FLOATOBJ */ + + lea ecx, [ebp -8] /* Push pointer to the local FLOATOBJ on the stack */ + push ecx + push [ebp + PARAM1] /* Push the FLOATOBJ param on the stack */ + call _FLOATOBJ_GreaterThan@8 /* Compare */ + + mov esp, ebp /* Cleanup and return */ + pop ebp + ret 8 + + +/****************************************************************************** + * BOOL + * APIENTRY + * FLOATOBJ_LessThan(IN PFLOATOBJ pf, IN PFLOATOBJ pf1); + * + */ +_FLOATOBJ_LessThan@8: +.global _FLOATOBJ_LessThan@8 + push ebp + mov ebp, esp + + mov eax, [ebp + PARAM1] /* Load pointer to floats in eax and edx */ + mov edx, [ebp + PARAM2] + + mov ecx, [eax + lMant] /* Load mantissae in ecx and edx */ + mov edx, [edx + lMant] + + sar ecx, 31 /* Calculate sign(lMant1) and sign(lMant2) */ + sar edx, 31 + + cmp ecx, edx /* Branch if both have the same sign */ + je LessThan_2 + + /* Mantissae have different sign */ + + mov eax, 0 /* Return (sign(lMant1) < sign(lMant2)) */ + setl al + pop ebp + ret 8 + +LessThan_2: + /* Mantissae have the same sign */ + + + mov edx, [ebp + PARAM2] /* Reload pointer to float2 in edx */ + + test ecx, ecx /* Branch if sign is negative */ + js LessThan_neg + + /* Both mantissae are positive or 0 */ + + or ecx, [edx + lMant] /* Branch if one mantissa is 0 */ + jz LessThan_pos2 + + /* Both mantissae are positive */ + + mov ecx, [eax + lExp] /* Branch if exponents are equal */ + cmp ecx, [edx + lExp] + je LessThan_pos2 + + mov eax, 0 /* Return (lExp1 < lExp2) */ + setl al + pop ebp + ret 8 + +LessThan_pos2: + /* Exponents are equal or one mantissa is 0 */ + + mov ecx, [eax + lMant] /* Return (lMant1 < lMant2) */ + cmp ecx, [edx + lMant] + mov eax, 0 + setl al + pop ebp + ret 8 + +LessThan_neg: + /* Both mantissae are negative */ + + mov ecx, [eax + lExp] /* Branch if exponents are equal */ + cmp ecx, [edx + lExp] + je LessThan_neg2 + + /* Both mantissae negative, exponents are different */ + + mov eax, 0 /* Return (lExp1 > lExp2) */ + setg al + pop ebp + ret 8 + +LessThan_neg2: + /* Both mantissae negative, exponents are equal */ + + mov ecx, [eax + lMant] /* Return (lMant1 > lMant2) */ + cmp ecx, [edx + lMant] + mov eax, 0 + setg al + pop ebp + ret 8 + + +/****************************************************************************** + * VOID + * APIENTRY + * FLOATOBJ_LessThanLong(IN OUT PFLOATOBJ pf, IN LONG l); + * + * Currently implemented as a wrapper around FLOATOBJ_SetLong and FLOATOBJ_LessThan + */ +_FLOATOBJ_LessThanLong@8: +.global _FLOATOBJ_LessThanLong@8 + push ebp + mov ebp, esp + + sub esp, 8 /* Make room for a FLOATOBJ on the stack */ + mov eax, [ebp + PARAM2] /* Load LONG into eax */ + + lea ecx, [ebp -8] /* Load pointer to local FLOATOBJ into ecx */ + push eax /* Push LONG on the stack */ + push ecx /* Push pointer to local FLOATOBJ on the stack */ + call _FLOATOBJ_SetLong@8 /* Set the local FLOATOBJ */ + + lea ecx, [ebp -8] /* Push pointer to the local FLOATOBJ on the stack */ + push ecx + push [ebp + PARAM1] /* Push the FLOATOBJ param on the stack */ + call _FLOATOBJ_LessThan@8 /* Compare */ + + mov esp, ebp /* Cleanup and return */ + pop ebp + ret 8 + + + +/****************************************************************************** + * VOID + * APIENTRY + * FLOATOBJ_Mul(IN OUT PFLOATOBJ pf1, IN PFLOATOBJ pf2); + * + * (mant1 * 2^exp1) * (mant2 * 2^exp2) = (mant1 * mant2) * 2^(exp1 + exp2) + * or mant = mant1 * mant2 and exp = exp1 + exp2 + * No special handling for 0, where mantissa is 0 + */ +_FLOATOBJ_Mul@8: +.global _FLOATOBJ_Mul@8 +//jmp _FLOATOBJ_Mul2@8 + push ebp + mov ebp, esp + + mov edx, [esp + PARAM1] /* Load pf1 into edx */ + mov ecx, [esp + PARAM2] /* Load pf2 into ecx */ + mov eax, [ecx + lMant] /* Load mantissa2 into eax */ + mov ecx, [ecx + lExp] /* Load exponent2 into ecx */ + + imul dword ptr [edx + lMant] /* Multiply eax with mantissa 1 */ + + test edx, edx /* Special handling for result < 0 */ + js MulNeg + + shl edx, 2 /* Get new mantissa from bits 30 to 62 */ + shr eax, 30 /* of edx:eax into edx */ + or eax, edx + + mov edx, ecx /* Need ecx for the shift, safe exp2 to free edx */ + mov ecx, 0 /* Check for highest bit */ + sets cl + shr eax, cl /* Normalize mantissa in eax */ + + jz Mul0 /* All 0? */ + + lea edx, [edx + ecx -2] /* Normalize exponent in edx */ + + + mov ecx, [esp + PARAM1] /* Load pf1 into ecx */ + mov [ecx + lMant], eax /* Save back mantissa */ + add [ecx + lExp], edx /* Save back exponent */ + + pop ebp /* Return */ + ret 8 + +MulNeg: + + shl edx, 2 /* Get new mantissa from bits 30 to 62 */ + shr eax, 30 /* of edx:eax into edx */ + or eax, edx + + mov edx, ecx /* Need ecx for the shift, safe exp2 to free edx */ + + mov ecx, 0 /* Check for highest bit */ + setns cl + shr eax, cl /* Normalize mantissa in eax */ + + jz Mul0 /* All 0? */ + + + lea edx, [edx + ecx -2] /* Normalize exponent in edx */ + or eax, 0x80000000 /* Set sign bit */ + + mov ecx, [esp + PARAM1] /* Load pf1 into ecx */ + mov [ecx + lMant], eax /* Save back mantissa */ + add [ecx + lExp], edx /* Save back exponent */ + + pop ebp /* Return */ + ret 8 + +Mul0: + mov ecx, [esp + PARAM1] /* Load pf1 into ecx */ + mov [ecx + lMant], eax /* Store 0 in mantissa */ + mov [ecx + lExp], eax /* Store 0 in exponent */ + + pop ebp /* Return */ + ret 8 + + +/****************************************************************************** + * VOID + * APIENTRY + * FLOATOBJ_MulFloat(IN OUT PFLOATOBJ pf, IN FLOATL f); + * + * Currently implemented as a wrapper around FLOATOBJ_SetFloat and FLOATOBJ_Mul + */ +_FLOATOBJ_MulFloat@8: +.global _FLOATOBJ_MulFloat@8 + push ebp + mov ebp, esp + + sub esp, 8 /* Make room for a FLOATOBJ on the stack */ + mov eax, [ebp + PARAM2] /* Load f into eax */ + lea ecx, [ebp -4] /* Load pointer to local FLOATOBJ into ecx */ + push eax /* Push f on the stack */ + push ecx /* Push pointer to local FLOATOBJ on the stack */ + call _FLOATOBJ_SetFloat@8 /* Set the FLOATOBJ */ + + lea ecx, [ebp -4] /* Push pointer to local FLOATOBJ on the stack */ + push ecx + push [ebp + PARAM1] /* Push the FLOATOBJ param on the stack */ + call _FLOATOBJ_Mul@8 /* Multiply */ + + mov esp, ebp /* Cleanup and return */ + pop ebp + ret 8 + + +/****************************************************************************** + * VOID + * APIENTRY + * FLOATOBJ_MulLong(IN OUT PFLOATOBJ pf, IN LONG l); + * + * Currently implemented as a wrapper around FLOATOBJ_SetLong and FLOATOBJ_Mul + */ +_FLOATOBJ_MulLong@8: +.global _FLOATOBJ_MulLong@8 + push ebp + mov ebp, esp + + sub esp, 8 /* Make room for a FLOATOBJ on the stack */ + mov eax, [ebp + PARAM2] /* Load l into eax */ + lea ecx, [ebp -8] /* Load pointer to local FLOATOBJ into ecx */ + push eax /* Push l on the stack */ + push ecx /* Push pointer to local FLOATOBJ on the stack */ + call _FLOATOBJ_SetLong@8 /* Set the local FLOATOBJ */ + + lea ecx, [ebp -8] /* Push pointer to local FLOATOBJ on the stack */ + push ecx + push [ebp + PARAM1] /* Push the FLOATOBJ param on the stack */ + call _FLOATOBJ_Mul@8 /* Multiply */ + + mov esp, ebp /* Cleanup and return */ + pop ebp + ret 8 + + +/******************************************************************************* + * VOID + * APIENTRY + * FLOATOBJ_Div(IN OUT PFLOATOBJ pf1, IN PFLOATOBJ pf2); + * + */ +_FLOATOBJ_Div@8: +.global _FLOATOBJ_Div@8 + push ebp + mov ebp, esp + push ebx + + mov eax, [ebp + PARAM2] /* Load lMant2 into eax */ + mov eax, [eax + lMant] + + cdq /* Calculate abs(lMant2) */ + xor eax, edx + sub eax, edx + jz DivError /* Divide by zero error! */ + + mov ebx, edx /* Copy sign(lMant2) to ebx */ + mov ecx, eax /* Copy abs(lMant2) to ecx */ + + mov eax, [ebp + PARAM1] /* Load lMant1 into eax */ + mov eax, [eax + lMant] + + cdq /* Calculate abs(lMant1) */ + xor eax, edx + sub eax, edx + + jz Div0 /* Dividend is 0? */ + + xor ebx, edx /* combine both signs in ebx */ + + mov edx, eax /* Prepare edx:eax for integer divide */ + xor eax, eax + shr edx, 1 + div ecx /* Do an unsigned divide */ + + xor ecx, ecx /* Adjust result */ + test eax, 0x80000000 + setnz cl + shr eax, cl + + xor eax, ebx /* Correct the result's sign */ + sub eax, ebx + + mov edx, [ebp + PARAM1] /* Load pf1 into edx */ + mov [edx + lMant], eax /* Safe back the mantissa */ + mov ebx, [ebp + PARAM2] /* Load pf2 into ebx */ + sub ecx, [ebx + lExp] /* Calculate exponent offset */ + inc ecx + add [edx + lExp], ecx /* Safe back exponent */ + + pop ebx /* Return */ + pop ebp + ret 8 + +DivError: +Div0: + mov edx, [ebp + PARAM1] /* Load pf into edx */ + mov [edx + lMant], eax /* Store 0 in mantissa */ + mov [edx + lExp], eax /* Store 0 in exponent */ + + pop ebx /* Return */ + pop ebp + ret 8 + + +/****************************************************************************** + * VOID + * APIENTRY + * FLOATOBJ_DivFloat(IN OUT PFLOATOBJ pf, IN FLOATL f); + * + * Currently implemented as a wrapper around FLOATOBJ_SetFloat and FLOATOBJ_Div + */ +_FLOATOBJ_DivFloat@8: +.global _FLOATOBJ_DivFloat@8 + push ebp + mov ebp, esp + sub esp, 8 /* Make room for a FLOATOBJ on the stack */ + + mov eax, [ebp + PARAM2] /* Load f into eax */ + lea ecx, [ebp -4] /* Load pointer to local FLOATOBJ into ecx */ + push eax /* Push f on the stack */ + push ecx /* Push pointer to local FLOATOBJ on the stack */ + call _FLOATOBJ_SetFloat@8 /* Set the FLOATOBJ */ + + lea ecx, [ebp -4] /* Push pointer to local FLOATOBJ on the stack */ + push ecx + push [ebp + PARAM1] /* Push the FLOATOBJ param on the stack */ + call _FLOATOBJ_Div@8 /* Divide */ + + mov esp, ebp /* Cleanup and return */ + pop ebp + ret 8 + + +/****************************************************************************** + * VOID + * APIENTRY + * FLOATOBJ_DivLong(IN OUT PFLOATOBJ pf, IN LONG l); + * + * Currently implemented as a wrapper around FLOATOBJ_SetLong and FLOATOBJ_Div + */ +_FLOATOBJ_DivLong@8: +.global _FLOATOBJ_DivLong@8 + push ebp + mov ebp, esp + sub esp, 8 /* Make room for a FLOATOBJ on the stack */ + + mov eax, [ebp + PARAM2] /* Load l into eax */ + lea ecx, [ebp -8] /* Load pointer to local FLOATOBJ into ecx */ + push eax /* Push l on the stack */ + push ecx /* Push pointer to local FLOATOBJ on the stack */ + call _FLOATOBJ_SetLong@8 /* Set the local FLOATOBJ */ + + lea ecx, [ebp -8] /* Push pointer to the local FLOATOBJ on the stack */ + push ecx + push [ebp + PARAM1] /* Push the FLOATOBJ param on the stack */ + call _FLOATOBJ_Div@8 /* Divide */ + + pop ebp /* Cleanup and return */ + ret 8 + + +/******************************************************************************* + * VOID + * APIENTRY + * FLOATOBJ_Add(IN OUT PFLOATOBJ pf1, IN PFLOATOBJ pf2); + * + */ +_FLOATOBJ_Add@8: +.global _FLOATOBJ_Add@8 + push ebp + mov ebp, esp + push ebx + + mov eax, [ebp + PARAM1] /* Load pointer to pf1 in eax */ + mov ebx, [ebp + PARAM2] /* Load pointer to pf2 in ebx */ + + mov ecx, [eax + lExp] /* Load float1 in (eax,ecx) */ + mov edx, [ebx + lExp] + mov eax, [eax + lMant] /* Load float2 in (ebx,edx) */ + mov ebx, [ebx + lMant] + + cmp ecx, edx /* Check which one has the bigger lExp */ + jl Add2 + + sub ecx, edx /* Calculate lExp1 - lExp2 */ + sar eax, 1 /* Shift both mantissae 1 bit right */ + sar ebx, 1 + sar ebx, cl /* Shift lMant2 according to exponent difference */ + + add eax, ebx /* Add the manrissae */ + jz AddIs0 + + cdq /* Calculate abs(mantissa) */ + xor eax, edx + sub eax, edx + + bsr ecx, eax /* Find most significant bit */ + neg ecx /* and calculate needed normalize shift */ + add ecx, 30 + shl eax, cl + dec ecx + + xor eax, edx /* Go back to original sign */ + sub eax, edx + + mov edx, [ebp + PARAM1] /* Reload pointer to float1 */ + + pop ebx + + mov dword ptr [edx + lMant], eax /* Safe mantissa */ + sub [edx + lExp], ecx /* Adjust exponent */ + + pop ebp /* Return */ + ret 8 + +Add2: + sub edx, ecx /* Calculate lExp2 - lExp1 and put it into ecx */ + mov ecx, edx + + sar ebx, 1 /* Shift both mantissae 1 bit right */ + sar eax, 1 + sar eax, cl /* Shift lMant2 according to exponent difference */ + + add eax, ebx /* Add the manrissae */ + jz AddIs0 + + mov ebx, [ebp + PARAM1] /* Reload pointer to float1 */ + add [ebx + lExp], ecx /* Adjust exponent part 1 */ + + cdq /* Calculate abs(mantissa) */ + xor eax, edx + sub eax, edx + + bsr ecx, eax /* Find most significant bit */ + neg ecx /* and calculate needed normalize shift */ + add ecx, 30 + shl eax, cl + dec ecx + + xor eax, edx /* Go back to original sign */ + sub eax, edx + + mov dword ptr [ebx + lMant], eax /* Safe mantissa and adjust exponent */ + sub [ebx + lExp], ecx + + pop ebx /* Return */ + pop ebp + ret 8 + +AddIs0: + /* Mantissa is 0, so float to (0,0) */ + mov eax, [ebp + PARAM1] + pop ebx + mov dword ptr [eax + lMant], 0 + mov dword ptr [eax + lExp], 0 + pop ebp + ret 8 + + +/****************************************************************************** + * VOID + * APIENTRY + * FLOATOBJ_AddFloat(IN OUT PFLOATOBJ pf, IN FLOATL f); + * + * Currently implemented as a wrapper around FLOATOBJ_SetFloat and FLOATOBJ_Add + */ +_FLOATOBJ_AddFloat@8: +.global _FLOATOBJ_AddFloat@8 + push ebp + mov ebp, esp + sub esp, 8 /* Make room for a FLOATOBJ on the stack */ + + mov eax, [ebp + PARAM2] /* Load f into eax */ + lea ecx, [ebp -4] /* Load pointer to local FLOATOBJ into ecx */ + push eax /* Push f on the stack */ + push ecx /* Push pointer to local FLOATOBJ on the stack */ + call _FLOATOBJ_SetFloat@8 /* Set the FLOATOBJ */ + + lea ecx, [ebp -4] /* Push pointer to local FLOATOBJ on the stack */ + push ecx + push [ebp + PARAM1] /* Push the FLOATOBJ param on the stack */ + call _FLOATOBJ_Add@8 /* Add */ + + mov esp, ebp /* Cleanup and return */ + pop ebp + ret 8 + + +/****************************************************************************** + * VOID + * APIENTRY + * FLOATOBJ_AddLong(IN OUT PFLOATOBJ pf, IN LONG l); + * + * Currently implemented as a wrapper around FLOATOBJ_SetLong and FLOATOBJ_Add + */ +_FLOATOBJ_AddLong@8: +.global _FLOATOBJ_AddLong@8 + push ebp + mov ebp, esp + sub esp, 8 /* Make room for a FLOATOBJ on the stack */ + + mov eax, [ebp + PARAM2] /* Load l into eax */ + lea ecx, [ebp -8] /* Load pointer to local FLOATOBJ into ecx */ + push eax /* Push l on the stack */ + push ecx /* Push pointer to local FLOATOBJ on the stack */ + call _FLOATOBJ_SetLong@8 /* Set the local FLOATOBJ */ + + lea ecx, [ebp -8] /* Push pointer to the local FLOATOBJ on the stack */ + push ecx + push [ebp + PARAM1] /* Push the FLOATOBJ param on the stack */ + call _FLOATOBJ_Add@8 /* Add */ + + mov esp, ebp /* Cleanup and return */ + pop ebp + ret 8 + + +/******************************************************************************* + * VOID + * APIENTRY + * FLOATOBJ_Sub(IN OUT PFLOATOBJ pf, IN PFLOATOBJ pf1); + * + */ +_FLOATOBJ_Sub@8: +.global _FLOATOBJ_Sub@8 + push ebp + mov ebp, esp + push ebx + + mov eax, [ebp + PARAM1] /* Load pointer to floats in eax and ebx */ + mov ebx, [ebp + PARAM2] + + mov ecx, [eax + lExp] /* Load float1 in (eax,ecx) and float2 in (ebx,edx) */ + mov edx, [ebx + lExp] + mov eax, [eax + lMant] + mov ebx, [ebx + lMant] + + cmp ecx, edx /* Check which one has the bigger lExp */ + jl Sub2 + + sub ecx, edx /* Calculate lExp1 - lExp2 */ + sar eax, 1 /* Shift both mantissae 1 bit right */ + sar ebx, 1 + sar ebx, cl /* Shift lMant2 according to exponent difference */ + + sub eax, ebx /* Substract the manrissae */ + jz SubIs0 + + cdq /* Calculate abs(mantissa) */ + xor eax, edx + sub eax, edx + + bsr ecx, eax /* Find most significant bit */ + neg ecx /* and calculate needed normalize shift */ + add ecx, 30 + shl eax, cl + dec ecx + + xor eax, edx /* Go back to original sign */ + sub eax, edx + + mov edx, [ebp + PARAM1] /* Reload pointer to float1 */ + + pop ebx + + mov dword ptr [edx + lMant], eax /* Safe mantissa and adjust exponent */ + sub [edx + lExp], ecx + + pop ebp + ret 8 + +Sub2: + sub edx, ecx /* Calculate lExp2 - lExp1 and put it into ecx */ + mov ecx, edx + + sar ebx, 1 /* Shift both mantissae 1 bit right */ + sar eax, 1 + sar eax, cl /* Shift lMant2 according to exponent difference */ + + sub eax, ebx /* Substract the manrissae */ + jz AddIs0 + + mov ebx, [ebp + PARAM1] /* Reload pointer to float1 */ + add [ebx + lExp], ecx /* Adjust exponent part 1 */ + + cdq /* Calculate abs(mantissa) */ + xor eax, edx + sub eax, edx + + bsr ecx, eax /* Find most significant bit */ + neg ecx /* and calculate needed normalize shift */ + add ecx, 30 + shl eax, cl + dec ecx + + xor eax, edx /* Go back to original sign */ + sub eax, edx + + mov dword ptr [ebx + lMant], eax /* Safe mantissa */ + sub [ebx + lExp], ecx /* Adjust exponent */ + + pop ebx /* Return */ + pop ebp + ret 8 + +SubIs0: + /* Mantissa is 0, so float to (0,0) */ + mov eax, [ebp + PARAM1] + pop ebx + mov dword ptr [eax + lMant], 0 + mov dword ptr [eax + lExp], 0 + pop ebp + ret 8 + +/****************************************************************************** + * VOID + * APIENTRY + * FLOATOBJ_SubFloat(IN OUT PFLOATOBJ pf, IN FLOATL f); + * + * Currently implemented as a wrapper around FLOATOBJ_SetFloat and FLOATOBJ_Sub + */ +_FLOATOBJ_SubFloat@8: +.global _FLOATOBJ_SubFloat@8 + push ebp + mov ebp, esp + sub esp, 8 /* Make room for a FLOATOBJ on the stack */ + + mov eax, [ebp + PARAM2] /* Load f into eax */ + lea ecx, [ebp -4] /* Load pointer to local FLOATOBJ into ecx */ + push eax /* Push f on the stack */ + push ecx /* Push pointer to local FLOATOBJ on the stack */ + call _FLOATOBJ_SetFloat@8 /* Set the FLOATOBJ */ + + lea ecx, [ebp -4] /* Push pointer to local FLOATOBJ on the stack */ + push ecx + push [ebp + PARAM1] /* Push the FLOATOBJ param on the stack */ + call _FLOATOBJ_Sub@8 /* Substract */ + + mov esp, ebp /* Cleanup and return */ + pop ebp + ret 8 + + +/****************************************************************************** + * VOID + * APIENTRY + * FLOATOBJ_SubLong(IN OUT PFLOATOBJ pf, IN LONG l); + * + * Currently implemented as a wrapper around FLOATOBJ_SetLong and FLOATOBJ_Sub + */ +_FLOATOBJ_SubLong@8: +.global _FLOATOBJ_SubLong@8 + push ebp + mov ebp, esp + sub esp, 8 /* Make room for a FLOATOBJ on the stack */ + + mov eax, [ebp + PARAM2] /* Load l into eax */ + lea ecx, [ebp -8] /* Load pointer to local FLOATOBJ into ecx */ + push eax /* Push l on the stack */ + push ecx /* Push pointer to local FLOATOBJ on the stack */ + call _FLOATOBJ_SetLong@8 /* Set the local FLOATOBJ */ + + lea ecx, [ebp -8] /* Push pointer to the local FLOATOBJ on the stack */ + push ecx + push [ebp + PARAM1] /* Push the FLOATOBJ param on the stack */ + call _FLOATOBJ_Sub@8 /* Substract */ + + mov esp, ebp /* Cleanup and return */ + pop ebp + ret 8 + + +/******************************************************************************* + * VOID + * APIENTRY + * FLOATOBJ_Neg(IN OUT PFLOATOBJ pf); + * + */ +_FLOATOBJ_Neg@4: +.global _FLOATOBJ_Neg@4 + push ebp + mov ebp, esp + + mov ecx, [esp + PARAM1] /* Load pf into ecx */ + neg dword ptr [ecx + lMant] /* Negate lMant1 */ + + pop ebp /* Return */ + ret 4 + + +/* EOF */ Propchange: trunk/reactos/subsystems/win32/win32k/eng/i386/floatobj.S ------------------------------------------------------------------------------ svn:eol-style = native
16 years, 4 months
1
0
0
0
[hpoussin] 35174: Replace .def file by a .spec file
by hpoussin@svn.reactos.org
Author: hpoussin Date: Thu Aug 7 15:47:54 2008 New Revision: 35174 URL:
http://svn.reactos.org/svn/reactos?rev=35174&view=rev
Log: Replace .def file by a .spec file Added: trunk/reactos/dll/cpl/hdwwiz/hdwwiz.spec (with props) Removed: trunk/reactos/dll/cpl/hdwwiz/hdwwiz.def Modified: trunk/reactos/dll/cpl/hdwwiz/hdwwiz.c (props changed) trunk/reactos/dll/cpl/hdwwiz/hdwwiz.h (props changed) trunk/reactos/dll/cpl/hdwwiz/hdwwiz.rbuild (contents, props changed) trunk/reactos/dll/cpl/hdwwiz/hdwwiz.rc (props changed) trunk/reactos/dll/cpl/hdwwiz/resource.h (props changed) Propchange: trunk/reactos/dll/cpl/hdwwiz/hdwwiz.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date revision Removed: trunk/reactos/dll/cpl/hdwwiz/hdwwiz.def URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/hdwwiz.def?…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/hdwwiz.def [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/hdwwiz.def (removed) @@ -1,7 +1,0 @@ -LIBRARY hdwwiz.cpl - -EXPORTS -CPlApplet@16 -InstallNewDevice - -; EOF Propchange: trunk/reactos/dll/cpl/hdwwiz/hdwwiz.h ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date revision Modified: trunk/reactos/dll/cpl/hdwwiz/hdwwiz.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/hdwwiz.rbui…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/hdwwiz.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/hdwwiz.rbuild [iso-8859-1] Thu Aug 7 15:47:54 2008 @@ -1,7 +1,7 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> <module name="hdwwiz" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_HDWWIZ}" installbase="system32" installname="hdwwiz.cpl" unicode="yes"> - <importlibrary definition="hdwwiz.def" /> + <importlibrary definition="hdwwiz.spec.def" /> <include base="hdwwiz">.</include> <define name="_WIN32_IE">0x600</define> <define name="_WIN32_WINNT">0x501</define> @@ -9,4 +9,5 @@ <library>kernel32</library> <file>hdwwiz.c</file> <file>hdwwiz.rc</file> + <file>hdwwiz.spec</file> </module> Propchange: trunk/reactos/dll/cpl/hdwwiz/hdwwiz.rbuild ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date revision Propchange: trunk/reactos/dll/cpl/hdwwiz/hdwwiz.rc ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date revision Added: trunk/reactos/dll/cpl/hdwwiz/hdwwiz.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/hdwwiz.spec…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/hdwwiz.spec (added) +++ trunk/reactos/dll/cpl/hdwwiz/hdwwiz.spec [iso-8859-1] Thu Aug 7 15:47:54 2008 @@ -1,0 +1,2 @@ +@ stdcall CPlApplet(ptr long ptr ptr) +@ stdcall InstallNewDevice(ptr ptr ptr) Propchange: trunk/reactos/dll/cpl/hdwwiz/hdwwiz.spec ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/dll/cpl/hdwwiz/resource.h ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date revision
16 years, 4 months
1
0
0
0
← Newer
1
...
64
65
66
67
68
69
70
...
86
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Results per page:
10
25
50
100
200