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
2025
April
March
February
January
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
March 2006
----- 2025 -----
April 2025
March 2025
February 2025
January 2025
----- 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
2 participants
67 discussions
Start a n
N
ew thread
[gedmurphy] 21411: dropping this defragger in here for safe keeping. It's pretty hard to come by on the net now.
by aleksey@studiocerebral.com
Author: gedmurphy Date: Thu Mar 30 04:09:09 2006 New Revision: 21411 URL:
http://svn.reactos.ru/svn/reactos?rev=21411&view=rev
Log: dropping this defragger in here for safe keeping. It's pretty hard to come by on the net now. Added: trunk/rosapps/fraginator/ trunk/rosapps/fraginator/COPYING trunk/rosapps/fraginator/DefragDialog.cpp trunk/rosapps/fraginator/Defragment.cpp trunk/rosapps/fraginator/Defragment.h trunk/rosapps/fraginator/DriveVolume.cpp trunk/rosapps/fraginator/DriveVolume.h trunk/rosapps/fraginator/Fraginator Motif Icon.bmp (with props) trunk/rosapps/fraginator/Fraginator.cpp trunk/rosapps/fraginator/Fraginator.dsp trunk/rosapps/fraginator/Fraginator.dsw trunk/rosapps/fraginator/Fraginator.exe (with props) trunk/rosapps/fraginator/Fraginator.h trunk/rosapps/fraginator/Fraginator.mak trunk/rosapps/fraginator/Fraginator.rc trunk/rosapps/fraginator/Fraginator.sln trunk/rosapps/fraginator/Fraginator.suo (with props) trunk/rosapps/fraginator/Fraginator.vcproj trunk/rosapps/fraginator/MainDialog.cpp trunk/rosapps/fraginator/MainDialog.h trunk/rosapps/fraginator/Mutex.h trunk/rosapps/fraginator/ReportDialog.cpp trunk/rosapps/fraginator/ReportDialog.h trunk/rosapps/fraginator/Unfrag.cpp trunk/rosapps/fraginator/Unfrag.h trunk/rosapps/fraginator/default1.bin trunk/rosapps/fraginator/icon1.ico (with props) trunk/rosapps/fraginator/resource.h trunk/rosapps/fraginator/unfrag.dsp trunk/rosapps/fraginator/unfrag.exe (with props) trunk/rosapps/fraginator/unfrag.mak trunk/rosapps/fraginator/unfrag.plg trunk/rosapps/fraginator/unfrag.vcproj Added: trunk/rosapps/fraginator/COPYING URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/COPYING?rev=2141…
============================================================================== --- trunk/rosapps/fraginator/COPYING (added) +++ trunk/rosapps/fraginator/COPYING Thu Mar 30 04:09:09 2006 @@ -1,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. Added: trunk/rosapps/fraginator/DefragDialog.cpp URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/DefragDialog.cpp…
============================================================================== --- trunk/rosapps/fraginator/DefragDialog.cpp (added) +++ trunk/rosapps/fraginator/DefragDialog.cpp Thu Mar 30 04:09:09 2006 @@ -1,0 +1,38 @@ +#include "DefragDialog.h" +#include "Defragment.h" +#include "resource.h" + + +void UpdateDefragInfo (HWND Dlg) +{ + Defragment *Defrag; + HWND PercentItem; + char PercentText[100]; + + Defrag = (Defragment *) GetWindowLongPtr (Dlg, GWLP_USERDATA); + + sprintf (PercentText, "%6.2f%%", Defrag->GetStatusPercent()); + PercentItem = GetDlgItem (Dlg, IDC_PERCENT); + SendMessage (GetDlgItem (Dlg, IDC_PERCENT), WM_SETTEXT, 0, (LPARAM) PercentText); + SendMessage (GetDlgItem (Dlg, IDC_STATUS_TEXT), WM_SETTEXT, 0, (LPARAM) Defrag->GetStatusString().c_str()); + + return; +} + + +INT_PTR CALLBACK DefragDialogProc (HWND Dlg, UINT Msg, WPARAM WParam, LPARAM LParam) +{ + switch (Msg) + { + case WM_INITDIALOG: + SetWindowLongPtr (Dlg, GWLP_USERDATA, (LONG_PTR)LParam); + UpdateDefragInfo (Dlg); + return (1); + + case WM_UPDATEINFO: + UpdateDefragInfo (Dlg); + return (1); + } + + return (0); +} Added: trunk/rosapps/fraginator/Defragment.cpp URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Defragment.cpp?r…
============================================================================== --- trunk/rosapps/fraginator/Defragment.cpp (added) +++ trunk/rosapps/fraginator/Defragment.cpp Thu Mar 30 04:09:09 2006 @@ -1,0 +1,459 @@ +#include "Defragment.h" + + +// Ahh yes I ripped this from my old Findupes project :) +// Fits a path name, composed of a path (i.e. "c:\blah\blah\cha\cha") and a filename ("stuff.txt") +// and fits it to a given length. If it has to truncate it will first truncate from the path, +// substituting in periods. So you might end up with something like: +// C:\Program Files\Micro...\Register.exe +int FitName (char *destination, const char *path, const char *filename, uint32 totalWidth) +{ + uint32 pathLen=0; + uint32 fnLen=0; + uint32 halfTotLen=0; + uint32 len4fn=0; /* number of chars remaining for filename after path is applied */ + uint32 len4path=0; /* number of chars for path before filename is applied */ + char fmtStrPath[20]=""; + char fmtStrFile[20]=""; + char fmtString[40]=""; + + /* + assert (destination != NULL); + assert (path != NULL); + assert (filename != NULL); + assert (totalWidth != 0); + */ + + pathLen = strlen(path); + fnLen = strlen(filename); + if (!(totalWidth % 2)) + halfTotLen=totalWidth / 2; + else + halfTotLen=(totalWidth-1) / 2; /* -1 because otherwise (halfTotLen*2) == +(totalWidth+1) which wouldn't be good */ + + /* determine how much width the path and filename each get */ + if ( (pathLen >= halfTotLen) && (fnLen < halfTotLen) ) + { + len4fn = fnLen; + len4path = (totalWidth - len4fn); + } + + if ( (pathLen < halfTotLen) && (fnLen < halfTotLen) ) + { + len4fn = fnLen; + len4path = pathLen; + } + + if ( (pathLen >= halfTotLen) && (fnLen >= halfTotLen) ) + { + len4fn = halfTotLen; + len4path = halfTotLen; + } + + if ( (pathLen < halfTotLen) && (fnLen >= halfTotLen) ) + { + len4path = pathLen; + len4fn = (totalWidth - len4path); + } + /* + if halfTotLen was adjusted above to avoid a rounding error, give the + extra char to the filename + */ + if (halfTotLen < (totalWidth/2)) len4path++; + + if (pathLen > len4path) sprintf (fmtStrPath, "%%.%ds...\\", len4path-4); + else + sprintf (fmtStrPath, "%%s"); + + if (fnLen > len4fn) sprintf (fmtStrFile, "%%.%ds...", len4fn-3); + else + sprintf (fmtStrFile, "%%s"); + + strcpy (fmtString, fmtStrPath); + strcat (fmtString, fmtStrFile); + /*sprintf (fmtString, "%s%s", fmtStrPath, fmtStrFile);*/ + sprintf (destination, fmtString, path,filename); + + return (1); +} + + +Defragment::Defragment (string Name, DefragType DefragMethod) +{ + Method = DefragMethod; + DoLimitLength = true; + Error = false; + Done = false; + PleaseStop = false; + PleasePause = false; + DriveName = Name; + StatusPercent = 0.0f; + LastBMPUpdate = GetTickCount (); + + SetStatusString ("Opening volume " + Name); + if (!Volume.Open (Name)) + { + SetStatusString ("Error opening volume " + Name); + Error = true; + Done = true; + StatusPercent = 100.0f; + } + + return; +} + + +Defragment::~Defragment () +{ + if (!IsDoneYet ()) + { + Stop (); + while (!IsDoneYet() && !HasError()) + { + SetStatusString ("Waiting for thread to stop ..."); + Sleep (150); + } + } + + Volume.Close (); + return; +} + + +void Defragment::SetStatusString (string NewStatus) +{ + Lock (); + StatusString = NewStatus; + Unlock (); + + return; +} + + +string Defragment::GetStatusString (void) +{ + string ReturnVal; + + Lock (); + ReturnVal = StatusString; + Unlock (); + + return (ReturnVal); +} + + +double Defragment::GetStatusPercent (void) +{ + return (StatusPercent); +} + + +bool Defragment::IsDoneYet (void) +{ + return (Done); +} + + +void Defragment::Start (void) +{ + uint32 i; + uint64 FirstFreeLCN; + uint64 TotalClusters; + uint64 ClustersProgress; + char PrintName[80]; + int Width = 70; + + if (Error) + goto DoneDefrag; + + // First thing: build a file list. + SetStatusString ("Getting volume bitmap"); + if (!Volume.GetBitmap()) + { + SetStatusString ("Could not get volume " + DriveName + " bitmap"); + Error = true; + goto DoneDefrag; + } + + LastBMPUpdate = GetTickCount (); + + if (PleaseStop) + goto DoneDefrag; + + SetStatusString ("Obtaining volume geometry"); + if (!Volume.ObtainInfo ()) + { + SetStatusString ("Could not obtain volume " + DriveName + " geometry"); + Error = true; + goto DoneDefrag; + } + + if (PleaseStop) + goto DoneDefrag; + + SetStatusString ("Building file database for volume " + DriveName); + if (!Volume.BuildFileList (PleaseStop, StatusPercent)) + { + SetStatusString ("Could not build file database for volume " + DriveName); + Error = true; + goto DoneDefrag; + } + + if (PleaseStop) + goto DoneDefrag; + + SetStatusString ("Analyzing database for " + DriveName); + TotalClusters = 0; + for (i = 0; i < Volume.GetDBFileCount(); i++) + { + TotalClusters += Volume.GetDBFile(i).Clusters; + } + + // Defragment! + ClustersProgress = 0; + + // Find first free LCN for speedier searches ... + Volume.FindFreeRange (0, 1, FirstFreeLCN); + + if (PleaseStop) + goto DoneDefrag; + + // Analyze? + if (Method == DefragAnalyze) + { + uint32 j; + + Report.RootPath = Volume.GetRootPath (); + + Report.FraggedFiles.clear (); + Report.UnfraggedFiles.clear (); + Report.UnmovableFiles.clear (); + + Report.FilesCount = Volume.GetDBFileCount () - Volume.GetDBDirCount (); + Report.DirsCount = Volume.GetDBDirCount (); + Report.DiskSizeBytes = Volume.GetVolumeInfo().TotalBytes; + + Report.FilesSizeClusters = 0; + Report.FilesSlackBytes = 0; + Report.FilesSizeBytes = 0; + Report.FilesFragments = 0; + + for (j = 0; j < Volume.GetDBFileCount(); j++) + { + FileInfo Info; + + Info = Volume.GetDBFile (j); + + Report.FilesFragments += max (1, Info.Fragments.size()); // add 1 fragment even for 0 bytes/0 cluster files + + if (Info.Attributes.Process == 0) + continue; + + SetStatusString (Volume.GetDBDir (Info.DirIndice) + Info.Name); + + Report.FilesSizeClusters += Info.Clusters; + Report.FilesSizeBytes += Info.Size; + + if (Info.Attributes.Unmovable == 1) + Report.UnmovableFiles.push_back (j); + + if (Info.Fragments.size() > 1) + Report.FraggedFiles.push_back (j); + else + Report.UnfraggedFiles.push_back (j); + + StatusPercent = ((double)j / (double)Report.FilesCount) * 100.0f; + } + + Report.FilesSizeOnDisk = Report.FilesSizeClusters * (uint64)Volume.GetVolumeInfo().ClusterSize; + Report.FilesSlackBytes = Report.FilesSizeOnDisk - Report.FilesSizeBytes; + Report.AverageFragments = (double)Report.FilesFragments / (double)Report.FilesCount; + Report.PercentFragged = 100.0f * ((double)(signed)Report.FraggedFiles.size() / (double)(signed)Report.FilesCount); + + uint64 Percent; + Percent = (10000 * Report.FilesSlackBytes) / Report.FilesSizeOnDisk; + Report.PercentSlack = (double)(signed)Percent / 100.0f; + } + else + // Go through all the files and ... defragment them! + for (i = 0; i < Volume.GetDBFileCount(); i++) + { + FileInfo Info; + bool Result; + uint64 TargetLCN; + uint64 PreviousClusters; + + // What? They want us to pause? Oh ok. + if (PleasePause) + { + SetStatusString ("Paused"); + PleasePause = false; + + while (PleasePause == false) + { + Sleep (50); + } + + PleasePause = false; + } + + if (PleaseStop) + { + SetStatusString ("Stopping"); + break; + } + + // + Info = Volume.GetDBFile (i); + + PreviousClusters = ClustersProgress; + ClustersProgress += Info.Clusters; + + if (Info.Attributes.Process == 0) + continue; + + if (!DoLimitLength) + SetStatusString (Volume.GetDBDir (Info.DirIndice) + Info.Name); + else + { + FitName (PrintName, Volume.GetDBDir (Info.DirIndice).c_str(), Info.Name.c_str(), Width); + SetStatusString (PrintName); + } + + // Calculate percentage complete + StatusPercent = 100.0f * double((double)PreviousClusters / (double)TotalClusters); + + // Can't defrag directories yet + if (Info.Attributes.Directory == 1) + continue; + + // Can't defrag 0 byte files :) + if (Info.Fragments.size() == 0) + continue; + + // If doing fast defrag, skip non-fragmented files + // Note: This assumes that the extents stored in Info.Fragments + // are consolidated. I.e. we assume it is NOT the case that + // two extents account for a sequential range of (non- + // fragmented) clusters. + if (Info.Fragments.size() == 1 && Method == DefragFast) + continue; + + // Otherwise, defrag0rize it! + int Retry = 3; // retry a few times + while (Retry > 0) + { + // Find a place that can fit the file + Result = Volume.FindFreeRange (FirstFreeLCN, Info.Clusters, TargetLCN); + + // If yes, try moving it + if (Result) + { + // If we're doing an extensive defrag and the file is already defragmented + // and if its new location would be after its current location, don't + // move it. + if (Method == DefragExtensive && Info.Fragments.size() == 1 && + TargetLCN > Info.Fragments[0].StartLCN) + { + Retry = 1; + } + else + { + if (Volume.MoveFileDumb (i, TargetLCN)) + { + Retry = 1; // yay, all done with this file. + Volume.FindFreeRange (0, 1, FirstFreeLCN); + } + } + } + + // New: Only update bitmap if it's older than 15 seconds + if ((GetTickCount() - LastBMPUpdate) < 15000) + Retry = 1; + else + if (!Result || Retry != 1) + { // hmm. Wait for a moment, then update the drive bitmap + //SetStatusString ("(Reobtaining volume " + DriveName + " bitmap)"); + + if (!DoLimitLength) + { + SetStatusString (GetStatusString() + string (" .")); + } + + if (Volume.GetBitmap ()) + { + LastBMPUpdate = GetTickCount (); + + if (!DoLimitLength) + SetStatusString (Volume.GetDBDir (Info.DirIndice) + Info.Name); + else + SetStatusString (PrintName); + + Volume.FindFreeRange (0, 1, FirstFreeLCN); + } + else + { + SetStatusString ("Could not re-obtain volume " + DriveName + " bitmap"); + Error = true; + } + } + + Retry--; + } + + if (Error == true) + break; + } + +DoneDefrag: + string OldStatus; + + OldStatus = GetStatusString (); + StatusPercent = 99.999999f; + SetStatusString ("Closing volume " + DriveName); + Volume.Close (); + StatusPercent = 100.0f; + + // If there was an error then the string has already been set + if (Error) + SetStatusString (OldStatus); + else + if (PleaseStop) + SetStatusString ("Volume " + DriveName + " defragmentation was stopped"); + else + SetStatusString ("Finished defragmenting " + DriveName); + + Done = true; + + return; +} + + +void Defragment::TogglePause (void) +{ + Lock (); + SetStatusString ("Pausing ..."); + PleasePause = true; + Unlock (); + + return; +} + + +void Defragment::Stop (void) +{ + Lock (); + SetStatusString ("Stopping ..."); + PleaseStop = true; + Unlock (); + + return; +} + + +bool Defragment::HasError (void) +{ + return (Error); +} + Added: trunk/rosapps/fraginator/Defragment.h URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Defragment.h?rev…
============================================================================== --- trunk/rosapps/fraginator/Defragment.h (added) +++ trunk/rosapps/fraginator/Defragment.h Thu Mar 30 04:09:09 2006 @@ -1,0 +1,92 @@ +/***************************************************************************** + + Defragment + +*****************************************************************************/ + + +#ifndef DEFRAGMENT_H +#define DEFRAGMENT_H + + +#include "Unfrag.h" +#include "DriveVolume.h" +#include "Mutex.h" + + +extern int FitName (char *destination, const char *path, const char *filename, uint32 totalWidth); + + +typedef struct DefragReport +{ + string RootPath; + uint64 DiskSizeBytes; + uint64 DirsCount; + uint64 FilesCount; + uint64 FilesSizeBytes; + uint64 FilesSizeOnDisk; + uint64 FilesSizeClusters; + uint64 FilesSlackBytes; + uint32 FilesFragments; + double AverageFragments; // = FilesFragments / FilesCount + double PercentFragged; + double PercentSlack; + + vector<uint32> FraggedFiles; + vector<uint32> UnfraggedFiles; + vector<uint32> UnmovableFiles; +} DefragReport; + + +class Defragment +{ +public: + Defragment (string Name, DefragType DefragMethod); + ~Defragment (); + + // Commands + void Start (void); + void TogglePause (void); + void Stop (void); + + // Info + bool IsDoneYet (void); + bool HasError (void); + string GetStatusString (void); + double GetStatusPercent (void); + DefragType GetDefragType (void) { return (Method); } + DefragReport &GetDefragReport (void) { return (Report); } + DriveVolume &GetVolume (void) { return (Volume); } + + // Mutex + void Lock (void) { DefragMutex.Lock (); } + void Unlock (void) { DefragMutex.Unlock (); } + + // Limit length of status string to 70 chars? + bool GetDoLimitLength (void) { return (DoLimitLength); } + void SetDoLimitLength (bool L) { DoLimitLength = L; } + +private: + void FastDefrag (void); + void ExtensiveDefrag (void); + void SetStatusString (string NewStatus); + + DWORD LastBMPUpdate; // Last time volume bitmap was updated + DefragReport Report; + bool DoLimitLength; + DefragType Method; + string DriveName; + DriveVolume Volume; + string StatusString; + string ErrorString; + double StatusPercent; + Mutex DefragMutex; + bool Error; + bool Done; + bool PleaseStop; + bool PleasePause; + DefragType DefragMethod; +}; + + +#endif // DEFRAGMENT_H Added: trunk/rosapps/fraginator/DriveVolume.cpp URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/DriveVolume.cpp?…
============================================================================== --- trunk/rosapps/fraginator/DriveVolume.cpp (added) +++ trunk/rosapps/fraginator/DriveVolume.cpp Thu Mar 30 04:09:09 2006 @@ -1,0 +1,806 @@ +#include "DriveVolume.h" + + +DriveVolume::DriveVolume () +{ + Handle = INVALID_HANDLE_VALUE; + BitmapDetail = NULL; + return; +} + + +DriveVolume::~DriveVolume () +{ + Close (); + Directories.clear (); + Files.clear (); + return; +} + + +void DriveVolume::Close (void) +{ + if (Handle != INVALID_HANDLE_VALUE) + { + CloseHandle (Handle); + Handle = INVALID_HANDLE_VALUE; + } + + if (BitmapDetail != NULL) + { + free (BitmapDetail); + BitmapDetail = NULL; + } + + return; +} + + +// "Name" should be the drive letter followed by a colon. ie, "c:" +// It's a string to allow for further expansion (ie, defragging over the network?) +// or some other baloney reason +bool DriveVolume::Open (string Name) +{ + char FileName[100]; + bool ReturnVal; + + sprintf (FileName, "\\\\.\\%s", Name.c_str()); + RootPath = Name.c_str(); + RootPath += "\\"; + + Handle = CreateFile + ( + FileName, + MAXIMUM_ALLOWED, // access + FILE_SHARE_READ | FILE_SHARE_WRITE, // share type + NULL, // security descriptor + OPEN_EXISTING, // open type + NULL, // attributes (none) + NULL // template + ); + + if (Handle == INVALID_HANDLE_VALUE) + ReturnVal = false; + else + { + char VolName[64]; + DWORD VolSN; + DWORD VolMaxFileLen; + DWORD FSFlags; + char FSName[64]; + BOOL Result; + + ReturnVal = true; + Result = GetVolumeInformation + ( + RootPath.c_str(), + VolName, + sizeof (VolName), + &VolSN, + &VolMaxFileLen, + &FSFlags, + FSName, + sizeof (FSName) + ); + + if (Result) + { + char SerialText[10]; + + VolInfo.FileSystem = FSName; + VolInfo.MaxNameLen = VolMaxFileLen; + VolInfo.Name = VolName; + + sprintf (SerialText, "%x-%x", (VolSN & 0xffff0000) >> 16, + VolSN & 0x0000ffff); + + strupr (SerialText); + VolInfo.Serial = SerialText; + } + else + { + VolInfo.FileSystem = "(Unknown)"; + VolInfo.MaxNameLen = 255; + VolInfo.Name = "(Unknown)"; + VolInfo.Serial = "(Unknown)"; + } + } + + return (ReturnVal); +} + + +bool DriveVolume::ObtainInfo (void) +{ + BOOL Result; + DWORD BytesGot; + uint64 nan; + + BytesGot = 0; + ZeroMemory (&Geometry, sizeof (Geometry)); + Result = DeviceIoControl + ( + Handle, + IOCTL_DISK_GET_DRIVE_GEOMETRY, + NULL, + 0, + &Geometry, + sizeof (Geometry), + &BytesGot, + NULL + ); + + // Call failed? Aww :( + if (!Result) + return (false); + + // Get cluster size + DWORD SectorsPerCluster; + DWORD BytesPerSector; + DWORD FreeClusters; + DWORD TotalClusters; + + Result = GetDiskFreeSpace + ( + RootPath.c_str(), + &SectorsPerCluster, + &BytesPerSector, + &FreeClusters, + &TotalClusters + ); + + // Failed? Weird. + if (!Result) + return (false); + + VolInfo.ClusterSize = SectorsPerCluster * BytesPerSector; + + Result = GetDiskFreeSpaceEx + ( + RootPath.c_str(), + (PULARGE_INTEGER)&nan, + (PULARGE_INTEGER)&VolInfo.TotalBytes, + (PULARGE_INTEGER)&VolInfo.FreeBytes + ); + + return (true); +} + + +// Get bitmap, several clusters at a time ... +#define CLUSTERS 4096 +bool DriveVolume::GetBitmap (void) +{ + STARTING_LCN_INPUT_BUFFER StartingLCN; + VOLUME_BITMAP_BUFFER *Bitmap = NULL; + uint32 BitmapSize; + DWORD BytesReturned; + BOOL Result; + + StartingLCN.StartingLcn.QuadPart = 0; + + // Allocate buffer + // Call FSCTL_GET_VOLUME_BITMAP once with a very small buffer + // This will leave the total number of clusters in Bitmap->BitmapSize and we can + // then correctly allocate based off that + // I suppose this won't work if your drive has only 40 clusters on it or so :) + BitmapSize = sizeof (VOLUME_BITMAP_BUFFER) + 4; + Bitmap = (VOLUME_BITMAP_BUFFER *) malloc (BitmapSize); + + Result = DeviceIoControl + ( + Handle, + FSCTL_GET_VOLUME_BITMAP, + &StartingLCN, + sizeof (StartingLCN), + Bitmap, + BitmapSize, + &BytesReturned, + NULL + ); + + // Bad result? + if (Result == FALSE && GetLastError () != ERROR_MORE_DATA) + { + //printf ("\nDeviceIoControl returned false, GetLastError() was not ERROR_MORE_DATA\n"); + free (Bitmap); + return (false); + } + + // Otherwise, we're good + BitmapSize = sizeof (VOLUME_BITMAP_BUFFER) + (Bitmap->BitmapSize.QuadPart / 8) + 1; + Bitmap = (VOLUME_BITMAP_BUFFER *) realloc (Bitmap, BitmapSize); + Result = DeviceIoControl + ( + Handle, + FSCTL_GET_VOLUME_BITMAP, + &StartingLCN, + sizeof (StartingLCN), + Bitmap, + BitmapSize, + &BytesReturned, + NULL + ); + + DWORD LastError = GetLastError (); + + if (Result == FALSE) + { + printf ("\nCouldn't properly read volume bitmap\n"); + free (Bitmap); + return (false); + } + + // Convert to a 'quick use' bitmap + //const int BitShift[] = { 1, 2, 4, 8, 16, 32, 64, 128 }; + + VolInfo.ClusterCount = Bitmap->BitmapSize.QuadPart; + + if (BitmapDetail != NULL) + free (BitmapDetail); + + BitmapDetail = (uint32 *) malloc (sizeof(uint32) * (1 + (VolInfo.ClusterCount / 32))); + memcpy (BitmapDetail, Bitmap->Buffer, sizeof(uint32) * (1 + (VolInfo.ClusterCount / 32))); + + /* + BitmapDetail = (Cluster *) malloc (VolInfo.ClusterCount * sizeof (Cluster)); + for (uint64 i = 0; i < VolInfo.ClusterCount; i++) + { + if (Bitmap->Buffer[i / 8] & BitShift[i % 8]) + BitmapDetail[i].Allocated = true; + else + BitmapDetail[i].Allocated = false; + } + */ + + free (Bitmap); + return (true); +} + + +bool DriveVolume::IsClusterUsed (uint64 Cluster) +{ + return ((BitmapDetail[Cluster / 32] & (1 << (Cluster % 32))) ? true : false); + //return (BitmapDetail[Cluster].Allocated); +} + + +void DriveVolume::SetClusterUsed (uint64 Cluster, bool Used) +{ + if (Used) + BitmapDetail[Cluster / 32] |= (1 << (Cluster % 32)); + else + BitmapDetail[Cluster / 32] &= ~(1 << (Cluster % 32)); + + return; +} + + +typedef struct +{ + DriveVolume *Volume; + double *Percent; + bool *QuitMonitor; + uint64 ClusterCount; + uint64 ClusterProgress; +} BuildDBInfo; + + +bool DriveVolume::BuildFileList (bool &QuitMonitor, double &Percent) +{ + BuildDBInfo Info; + + Files.clear (); + Directories.clear (); + Directories.push_back (RootPath); + + Info.Volume = this; + Info.QuitMonitor = &QuitMonitor; + Info.ClusterCount = (GetVolumeInfo().TotalBytes - GetVolumeInfo().FreeBytes) / (uint64)GetVolumeInfo().ClusterSize; + Info.ClusterProgress = 0; + Info.Percent = &Percent; + + ScanDirectory (RootPath, BuildDBCallback, &Info); + + if (QuitMonitor == true) + { + Directories.resize (0); + Files.resize (0); + } + + return (true); +} + + +// UserData = pointer to BuildDBInfo instance +bool BuildDBCallback (FileInfo &Info, HANDLE &FileHandle, void *UserData) +{ + BuildDBInfo *DBInfo = (BuildDBInfo *) UserData; + DriveVolume *Vol = DBInfo->Volume; + + Vol->Files.push_back (Info); + + if (*(DBInfo->QuitMonitor) == true) + return (false); + + DBInfo->ClusterProgress += (uint64)Info.Clusters; + *(DBInfo->Percent) = + ((double)DBInfo->ClusterProgress / (double)DBInfo->ClusterCount) * 100.0f; + + return (true); +} + + +string &DriveVolume::GetDBDir (uint32 Indice) +{ + return (Directories[Indice]); +} + + +uint32 DriveVolume::GetDBDirCount (void) +{ + return (Directories.size()); +} + + +FileInfo &DriveVolume::GetDBFile (uint32 Indice) +{ + return (Files[Indice]); +} + + +uint32 DriveVolume::GetDBFileCount (void) +{ + return (Files.size()); +} + + +uint32 DriveVolume::RemoveDBFile (uint32 Indice) +{ + vector<FileInfo>::iterator it; + + it = Files.begin() + Indice; + Files.erase (it); + return (GetDBFileCount()); +} + + +bool DriveVolume::ScanDirectory (string DirPrefix, ScanCallback Callback, void *UserData) +{ + WIN32_FIND_DATA FindData; + HANDLE FindHandle; + string SearchString; + uint32 DirIndice; + + DirIndice = Directories.size() - 1; + + SearchString = DirPrefix; + SearchString += "*.*"; + ZeroMemory (&FindData, sizeof (FindData)); + FindHandle = FindFirstFile (SearchString.c_str(), &FindData); + + if (FindHandle == INVALID_HANDLE_VALUE) + return (false); + + do + { + FileInfo Info; + HANDLE Handle; + bool CallbackResult; + + Handle = INVALID_HANDLE_VALUE; + + // First copy over the easy stuff. + Info.Name = FindData.cFileName; + + // Don't ever include '.' and '..' + if (Info.Name == "." || Info.Name == "..") + continue; + + //Info.FullName = DirPrefix + Info.Name; + Info.Size = (uint64)FindData.nFileSizeLow + ((uint64)FindData.nFileSizeHigh << (uint64)32); + Info.DirIndice = DirIndice; + + Info.Attributes.Archive = (FindData.dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE) ? 1 : 0; + Info.Attributes.Compressed = (FindData.dwFileAttributes & FILE_ATTRIBUTE_COMPRESSED) ? 1 : 0; + Info.Attributes.Directory = (FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? 1 : 0; + Info.Attributes.Encrypted = (FindData.dwFileAttributes & FILE_ATTRIBUTE_ENCRYPTED) ? 1 : 0; + Info.Attributes.Hidden = (FindData.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) ? 1 : 0; + Info.Attributes.Normal = (FindData.dwFileAttributes & FILE_ATTRIBUTE_NORMAL) ? 1 : 0; + Info.Attributes.Offline = (FindData.dwFileAttributes & FILE_ATTRIBUTE_OFFLINE) ? 1 : 0; + Info.Attributes.ReadOnly = (FindData.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ? 1 : 0; + Info.Attributes.Reparse = (FindData.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) ? 1 : 0; + Info.Attributes.Sparse = (FindData.dwFileAttributes & FILE_ATTRIBUTE_SPARSE_FILE) ? 1 : 0; + Info.Attributes.System = (FindData.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM) ? 1 : 0; + Info.Attributes.Temporary = (FindData.dwFileAttributes & FILE_ATTRIBUTE_TEMPORARY) ? 1 : 0; + Info.Attributes.AccessDenied = 0; + Info.Attributes.Unmovable = 0; + Info.Attributes.Process = 1; + + Info.Clusters = 0; + if (GetClusterInfo (Info, Handle)) + { + uint64 TotalClusters = 0; + + for (int i = 0; i < Info.Fragments.size(); i++) + { + TotalClusters += Info.Fragments[i].Length; + } + + Info.Clusters = TotalClusters; + } + else + { + Info.Attributes.Unmovable = 1; + Info.Attributes.Process = 0; + } + + if (Info.Attributes.Process == 1) + Info.Attributes.Process = ShouldProcess (Info.Attributes) ? 1 : 0; + + // Run the user-defined callback function + CallbackResult = Callback (Info, Handle, UserData); + + if (Handle != INVALID_HANDLE_VALUE) + CloseHandle (Handle); + + if (!CallbackResult) + break; + + // If directory, perform recursion + if (Info.Attributes.Directory == 1) + { + string Dir; + + Dir = GetDBDir (Info.DirIndice); + Dir += Info.Name; + Dir += "\\"; + + Directories.push_back (Dir); + ScanDirectory (Dir, Callback, UserData); + } + + } while (FindNextFile (FindHandle, &FindData) == TRUE); + + FindClose (FindHandle); + return (false); +} + + +bool DriveVolume::ShouldProcess (FileAttr Attr) +{ + if (Attr.Offline == 1 || Attr.Reparse == 1 || Attr.Temporary == 1) + { + return (false); + } + + return (true); +} + + +// Gets info on a file and returns a valid handle for read/write access +// Name, FullName, Clusters, Attributes, and Size should already be filled out. +// This function fills in the Fragments vector +bool DriveVolume::GetClusterInfo (FileInfo &Info, HANDLE &HandleResult) +{ + BOOL Result; + HANDLE Handle; + string FullName; + BY_HANDLE_FILE_INFORMATION FileInfo; + + Info.Fragments.resize (0); + + /* + if (Info.Attributes.Directory == 1) + return (false); + */ + + FullName = GetDBDir (Info.DirIndice) + Info.Name; + + Handle = CreateFile + ( + FullName.c_str(), + 0, //GENERIC_READ, + FILE_SHARE_READ, + NULL, + OPEN_EXISTING, + (Info.Attributes.Directory == 1) ? FILE_FLAG_BACKUP_SEMANTICS : 0, + NULL + ); + + if (Handle == INVALID_HANDLE_VALUE) + { + LPVOID lpMsgBuf; + + FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, GetLastError(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR) &lpMsgBuf, 0, NULL ); + + + Info.Attributes.AccessDenied = 1; + LocalFree( lpMsgBuf ); + return (false); + } + + ZeroMemory (&FileInfo, sizeof (FileInfo)); + Result = GetFileInformationByHandle (Handle, &FileInfo); + + if (Result == FALSE) + { + Info.Attributes.AccessDenied = 1; + printf ("GetFileInformationByHandle ('%s%s') failed\n", GetDBDir (Info.DirIndice).c_str(), + Info.Name.c_str()); + + CloseHandle (Handle); + return (false); + } + + // Get cluster allocation information + STARTING_VCN_INPUT_BUFFER StartingVCN; + RETRIEVAL_POINTERS_BUFFER *Retrieval; + uint64 RetSize; + uint64 Extents; + DWORD BytesReturned; + + // Grab info one extent at a time, until it's done grabbing all the extent data + // Yeah, well it doesn't give us a way to ask "how many extents?" that I know of ... + // btw, the Extents variable tends to only reflect memory usage, so when we have + // all the extents we look at the structure Win32 gives us for the REAL count! + Extents = 10; + Retrieval = NULL; + RetSize = 0; + StartingVCN.StartingVcn.QuadPart = 0; + + do + { + Extents *= 2; + RetSize = sizeof (RETRIEVAL_POINTERS_BUFFER) + ((Extents - 1) * sizeof (LARGE_INTEGER) * 2); + + if (Retrieval != NULL) + Retrieval = (RETRIEVAL_POINTERS_BUFFER *) realloc (Retrieval, RetSize); + else + Retrieval = (RETRIEVAL_POINTERS_BUFFER *) malloc (RetSize); + + Result = DeviceIoControl + ( + Handle, + FSCTL_GET_RETRIEVAL_POINTERS, + &StartingVCN, + sizeof (StartingVCN), + Retrieval, + RetSize, + &BytesReturned, + NULL + ); + + if (Result == FALSE) + { + if (GetLastError() != ERROR_MORE_DATA) + { + Info.Clusters = 0; + Info.Attributes.AccessDenied = 1; + Info.Attributes.Process = 0; + Info.Fragments.clear (); + CloseHandle (Handle); + free (Retrieval); + + return (false); + } + + Extents++; + } + } while (Result == FALSE); + + // Readjust extents, as it only reflects how much memory was allocated and may not + // be accurate + Extents = Retrieval->ExtentCount; + + // Ok, we have the info. Now translate it. hrmrmr + int i; + Info.Fragments.clear (); + for (i = 0; i < Extents; i++) + { + Extent Add; + + Add.StartLCN = Retrieval->Extents[i].Lcn.QuadPart; + if (i != 0) + Add.Length = Retrieval->Extents[i].NextVcn.QuadPart - Retrieval->Extents[i - 1].NextVcn.QuadPart; + else + Add.Length = Retrieval->Extents[i].NextVcn.QuadPart - Retrieval->StartingVcn.QuadPart; + + Info.Fragments.push_back (Add); + } + + free (Retrieval); + HandleResult = Handle; + return (true); +} + + +bool DriveVolume::FindFreeRange (uint64 StartLCN, uint64 ReqLength, uint64 &LCNResult) +{ + uint64 Max; + uint64 i; + uint64 j; + + // Make sure we don't spill over our array + Max = VolInfo.ClusterCount - ReqLength; + + for (i = StartLCN; i < Max; i++) + { + bool Found = true; + + // First check the first cluster + if (IsClusterUsed (i)) + Found = false; + else + // THen check the last cluster + if (IsClusterUsed (i + ReqLength - 1)) + Found = false; + else + // Check the whole darn range. + for (j = (i + 1); j < (i + ReqLength - 2); j++) + { + if (IsClusterUsed (j) == true) + { + Found = false; + break; + } + } + + if (!Found) + continue; + else + { + LCNResult = i; + return (true); + } + } + + return (false); +} + + +// btw we have to move each fragment of the file, as per the Win32 API +bool DriveVolume::MoveFileDumb (uint32 FileIndice, uint64 NewLCN) +{ + bool ReturnVal = false; + FileInfo Info; + HANDLE FileHandle; + string FullName; + MOVE_FILE_DATA MoveData; + uint64 CurrentLCN; + uint64 CurrentVCN; + + // Set up variables + Info = GetDBFile (FileIndice); + FullName = GetDBDir (Info.DirIndice); + FullName += Info.Name; + CurrentLCN = NewLCN; + CurrentVCN = 0; + + /* + if (Info.Attributes.Directory == 1) + { + // + } + */ + + // Open file + FileHandle = CreateFile + ( + FullName.c_str (), + GENERIC_READ, + FILE_SHARE_READ, + NULL, + OPEN_EXISTING, + (Info.Attributes.Directory == 1) ? FILE_FLAG_BACKUP_SEMANTICS : 0, + NULL + ); + + if (FileHandle == INVALID_HANDLE_VALUE) + { + // + LPVOID lpMsgBuf; + + FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, GetLastError(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR) &lpMsgBuf, 0, NULL ); + + + LocalFree (lpMsgBuf); + // + + ReturnVal = false; + } + else + { + ReturnVal = true; // innocent until proven guilty ... + + for (uint32 i = 0; i < Info.Fragments.size(); i++) + { + BOOL Result; + DWORD BytesReturned; + + //printf ("%3u", i); + + MoveData.ClusterCount = Info.Fragments[i].Length; + MoveData.StartingLcn.QuadPart = CurrentLCN; + MoveData.StartingVcn.QuadPart = CurrentVCN; + + MoveData.FileHandle = FileHandle; + + /* + printf ("\n"); + printf ("StartLCN: %I64u\n", MoveData.StartingLcn.QuadPart); + printf ("StartVCN: %I64u\n", MoveData.StartingVcn.QuadPart); + printf ("Clusters: %u (%I64u-%I64u --> %I64u-%I64u)\n", MoveData.ClusterCount, + Info.Fragments[i].StartLCN, + Info.Fragments[i].StartLCN + MoveData.ClusterCount, + MoveData.StartingLcn.QuadPart, + MoveData.StartingLcn.QuadPart + MoveData.ClusterCount - 1); + printf ("\n"); + */ + + Result = DeviceIoControl + ( + Handle, + FSCTL_MOVE_FILE, + &MoveData, + sizeof (MoveData), + NULL, + 0, + &BytesReturned, + NULL + ); + + //printf ("\b\b\b"); + + if (Result == FALSE) + { + // + LPVOID lpMsgBuf; + + FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, GetLastError(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR) &lpMsgBuf, 0, NULL ); + + + LocalFree( lpMsgBuf ); + // + + ReturnVal = false; + goto FinishUp; // yeah, bite me + } + + // Ok good. Now update our drive bitmap and file infos. + uint64 j; + for (j = 0; + j < Info.Fragments[i].Length; + j++) + { + SetClusterUsed (Info.Fragments[i].StartLCN + j, false); + SetClusterUsed (CurrentLCN + j, true); + //BitmapDetail[Info.Fragments[i].StartLCN + j].Allocated = false; + //BitmapDetail[CurrentLCN + j].Allocated = true; + } + + CurrentLCN += Info.Fragments[i].Length; + CurrentVCN += Info.Fragments[i].Length; + } + + // Update file info either way + FinishUp: + CloseHandle (FileHandle); + FileHandle = INVALID_HANDLE_VALUE; + GetClusterInfo (Files[FileIndice], FileHandle); + CloseHandle (FileHandle); + } + + return (ReturnVal); +} + + Added: trunk/rosapps/fraginator/DriveVolume.h URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/DriveVolume.h?re…
============================================================================== --- trunk/rosapps/fraginator/DriveVolume.h (added) +++ trunk/rosapps/fraginator/DriveVolume.h Thu Mar 30 04:09:09 2006 @@ -1,0 +1,157 @@ +/***************************************************************************** + + DriveVolume + + Class for opening a volume and getting information on it and defragging it + and stuff. + +*****************************************************************************/ + + +#ifndef DRIVEVOLUME_H +#define DRIVEVOLUME_H + + +#include "Unfrag.h" +#include <vector> +#include <string> + + +using namespace std; + +#pragma pack (push, 1) +typedef struct +{ + unsigned int Archive : 1; + unsigned int Compressed : 1; + unsigned int Directory : 1; + unsigned int Encrypted : 1; + unsigned int Hidden : 1; + unsigned int Normal : 1; + unsigned int Offline : 1; + unsigned int ReadOnly : 1; + unsigned int Reparse : 1; + unsigned int Sparse : 1; + unsigned int System : 1; + unsigned int Temporary : 1; + + // For defragmenting purposes and other information + unsigned int Unmovable : 1; // can we even touch it? + unsigned int Process : 1; // should we process it? + unsigned int AccessDenied : 1; // could we not open it? +} FileAttr; + + +typedef struct +{ + uint64 StartLCN; + uint64 Length; +} Extent; + + +typedef struct +{ + string Name; + uint32 DirIndice; // indice into directory list + uint64 Size; + uint64 Clusters; + FileAttr Attributes; + vector<Extent> Fragments; +} FileInfo; + + +typedef vector<FileInfo> FileList; + + +typedef struct +{ + string Name; + string Serial; + DWORD MaxNameLen; + string FileSystem; + uint64 ClusterCount; + uint32 ClusterSize; + uint64 TotalBytes; + uint64 FreeBytes; +} VolumeInfo; +#pragma pack (pop) + + +// Callback function for Scan() +// NOTE: Do *NOT* close the HANDLE given to you. It is provided for convenience, +// and is closed automatically by the function that calls you! +typedef bool (*ScanCallback) (FileInfo &Info, HANDLE &FileHandle, void *UserData); + + +extern bool BuildDBCallback (FileInfo &Info, HANDLE &FileHandle, void *UserData); + + +class DriveVolume +{ +public: + DriveVolume (); + ~DriveVolume (); + + bool Open (string Name); // opens the volume + void Close (void); + bool ObtainInfo (void); // retrieves drive geometry + bool GetBitmap (void); // gets drive bitmap + + // builds list of files on drive + // if QuitMonitor ever becomes true (ie from a separate thread) it will clean up and return + bool BuildFileList (bool &QuitMonitor, double &Progress); + + // Functions for accessing the volume bitmap + bool IsClusterUsed (uint64 Cluster); + void SetClusterUsed (uint64 Cluster, bool Used); + + DISK_GEOMETRY GetGeometry (void) { return (Geometry); } + VolumeInfo GetVolumeInfo (void) { return (VolInfo); } + + string GetRootPath (void) { return (RootPath); } + + // Scans drive starting from the root dir and calls a user defined function + // for each file/directory encountered. void* UserData is passed to this + // function so you can give it some good ol' fashioned context. + bool Scan (ScanCallback Callback, void *UserData); + + // Retrieve a directory string from the file database + string &GetDBDir (uint32 Indice); + uint32 GetDBDirCount (void); + // Retrieve file strings/info from the file database + FileInfo &GetDBFile (uint32 Indice); + uint32 GetDBFileCount (void); + // Kill it! + uint32 RemoveDBFile (uint32 Indice); + + // This is for actual defragmenting! It will automatically update the drive bitmap. + // Will not move any other files out of the way. + // Failure (return value of false) means that something is in the way. + bool MoveFileDumb (uint32 FileIndice, uint64 NewLCN); + + // Look for a range of sequential free clusters + // Returns true if one could be found, false if not + bool FindFreeRange (uint64 StartLCN, uint64 ReqLength, uint64 &LCNResult); + +private: + friend bool BuildDBCallback (FileInfo &Info, HANDLE &FileHandle, void *UserData); + + // DirPrefix should be in the form "drive:\\path\\" ie, C:\CRAP\ . + bool ScanDirectory (string DirPrefix, ScanCallback Callback, void *UserData); + + // given a file's attributes, should it be processed or not? + bool ShouldProcess (FileAttr Attr); + + bool GetClusterInfo (FileInfo &Info, HANDLE &HandleResult); + + VolumeInfo VolInfo; + FileList Files; + vector<string> Directories; // Directories[Files[x].DirIndice] + string RootPath; // ie, C:\ . + HANDLE Handle; + DISK_GEOMETRY Geometry; + uint32 *BitmapDetail; +}; + + +#endif // DRIVEVOLUME_H Added: trunk/rosapps/fraginator/Fraginator Motif Icon.bmp URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Fraginator%20Mot…
============================================================================== Binary file - no diff available. Propchange: trunk/rosapps/fraginator/Fraginator Motif Icon.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/rosapps/fraginator/Fraginator.cpp URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Fraginator.cpp?r…
============================================================================== --- trunk/rosapps/fraginator/Fraginator.cpp (added) +++ trunk/rosapps/fraginator/Fraginator.cpp Thu Mar 30 04:09:09 2006 @@ -1,0 +1,58 @@ +/***************************************************************************** + + Fraginator + +*****************************************************************************/ + + +#include "Fraginator.h" +#include "Mutex.h" +#include "DriveVolume.h" +#include "Defragment.h" +#include "MainDialog.h" +#include "resource.h" +#include <crtdbg.h> + + +HINSTANCE GlobalHInstance = NULL; +Defragment *Defrag = NULL; + + +int WINAPI WinMain (HINSTANCE HInstance, HINSTANCE HPrevInstance, LPSTR CmdLine, int ShowCmd) +{ + INITCOMMONCONTROLSEX InitControls; + + // debugging crap +#ifndef NDEBUG + _CrtSetDbgFlag (_CRTDBG_LEAK_CHECK_DF | _CrtSetDbgFlag (_CRTDBG_REPORT_FLAG)); + _CrtSetReportMode (_CRT_WARN, _CRTDBG_MODE_FILE); + _CrtSetReportFile (_CRT_WARN, _CRTDBG_FILE_STDOUT); + _CrtSetReportMode (_CRT_ERROR, _CRTDBG_MODE_FILE); + _CrtSetReportFile (_CRT_ERROR, _CRTDBG_FILE_STDOUT); + _CrtSetReportMode (_CRT_ASSERT, _CRTDBG_MODE_FILE); + _CrtSetReportFile (_CRT_ASSERT, _CRTDBG_FILE_STDOUT); +#endif + + GlobalHInstance = HInstance; + + // We want our progress bar! NOW! + InitControls.dwSize = sizeof (InitControls); + InitControls.dwICC = ICC_WIN95_CLASSES; + InitCommonControlsEx (&InitControls); + + if (!CheckWinVer()) + { + MessageBox (GetDesktopWindow(), "Sorry, this program requires Windows 2000.", "Error", MB_OK); + return (0); + } + + DialogBox (HInstance, MAKEINTRESOURCE (IDD_MAIN), GetDesktopWindow(), MainDialogProc); + +#if 0 + AllocConsole (); + if (_CrtDumpMemoryLeaks ()) + MessageBox (NULL, "Click OK to quit", "Leaks", MB_OK); +#endif + + return (0); +} Added: trunk/rosapps/fraginator/Fraginator.dsp URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Fraginator.dsp?r…
============================================================================== --- trunk/rosapps/fraginator/Fraginator.dsp (added) +++ trunk/rosapps/fraginator/Fraginator.dsp Thu Mar 30 04:09:09 2006 @@ -1,0 +1,186 @@ +# Microsoft Developer Studio Project File - Name="Fraginator" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=Fraginator - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "Fraginator.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "Fraginator.mak" CFG="Fraginator - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "Fraginator - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE "Fraginator - Win32 Debug" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=xicl6.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "Fraginator - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /G6 /Gr /MT /W3 /GX /Ox /Ot /Og /Oi /Ob2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 +# ADD LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /profile /machine:I386 +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Desc=Copying to Program Files ... +PostBuild_Cmds=copy Release\Fraginator.exe "c:\Program Files\Fraginator\Fraginator.exe" +# End Special Build Tool + +!ELSEIF "$(CFG)" == "Fraginator - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /GZ /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /profile /debug /machine:I386 + +!ENDIF + +# Begin Target + +# Name "Fraginator - Win32 Release" +# Name "Fraginator - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\Defragment.cpp +# End Source File +# Begin Source File + +SOURCE=.\DriveVolume.cpp +# End Source File +# Begin Source File + +SOURCE=.\Fraginator.cpp +# End Source File +# Begin Source File + +SOURCE=.\MainDialog.cpp +# End Source File +# Begin Source File + +SOURCE=.\ReportDialog.cpp +# End Source File +# Begin Source File + +SOURCE=.\Unfrag.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\Defragment.h +# End Source File +# Begin Source File + +SOURCE=.\DriveVolume.h +# End Source File +# Begin Source File + +SOURCE=.\Fraginator.h +# End Source File +# Begin Source File + +SOURCE=.\MainDialog.h +# End Source File +# Begin Source File + +SOURCE=.\Mutex.h +# End Source File +# Begin Source File + +SOURCE=.\ReportDialog.h +# End Source File +# Begin Source File + +SOURCE=.\resource.h +# End Source File +# Begin Source File + +SOURCE=.\Unfrag.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\default1.bin +# End Source File +# Begin Source File + +SOURCE=".\Fraginator Help - Fraginator Icon.bmp" +# End Source File +# Begin Source File + +SOURCE=".\Fraginator Motif Icon.bmp" +# End Source File +# Begin Source File + +SOURCE=.\Fraginator.rc +# End Source File +# Begin Source File + +SOURCE=.\icon1.ico +# End Source File +# End Group +# End Target +# End Project Added: trunk/rosapps/fraginator/Fraginator.dsw URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Fraginator.dsw?r…
============================================================================== --- trunk/rosapps/fraginator/Fraginator.dsw (added) +++ trunk/rosapps/fraginator/Fraginator.dsw Thu Mar 30 04:09:09 2006 @@ -1,0 +1,41 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "Fraginator"=.\Fraginator.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "unfrag"=.\unfrag.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + Added: trunk/rosapps/fraginator/Fraginator.exe URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Fraginator.exe?r…
============================================================================== Binary file - no diff available. Propchange: trunk/rosapps/fraginator/Fraginator.exe ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/rosapps/fraginator/Fraginator.h URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Fraginator.h?rev…
============================================================================== --- trunk/rosapps/fraginator/Fraginator.h (added) +++ trunk/rosapps/fraginator/Fraginator.h Thu Mar 30 04:09:09 2006 @@ -1,0 +1,24 @@ +/***************************************************************************** + + Fraginator !!! + +*****************************************************************************/ + + +#ifndef FRAGINATOR_H +#define FRAGINATOR_H + + +#include "unfrag.h" +#include <CommCtrl.h> + + +int WINAPI WinMain (HINSTANCE HInstance, HINSTANCE HPrevInstance, LPSTR CmdLine, int ShowCmd); +Defragment *StartDefragBox (string Drive, DefragType Method); + + +extern HINSTANCE GlobalHInstance; +extern Defragment *Defrag; + + +#endif // FRAGINATOR_H Added: trunk/rosapps/fraginator/Fraginator.mak URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Fraginator.mak?r…
============================================================================== --- trunk/rosapps/fraginator/Fraginator.mak (added) +++ trunk/rosapps/fraginator/Fraginator.mak Thu Mar 30 04:09:09 2006 @@ -1,0 +1,224 @@ +# Microsoft Developer Studio Generated NMAKE File, Based on Fraginator.dsp +!IF "$(CFG)" == "" +CFG=Fraginator - Win32 Debug +!MESSAGE No configuration specified. Defaulting to Fraginator - Win32 Debug. +!ENDIF + +!IF "$(CFG)" != "Fraginator - Win32 Release" && "$(CFG)" != "Fraginator - Win32 Debug" +!MESSAGE Invalid configuration "$(CFG)" specified. +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "Fraginator.mak" CFG="Fraginator - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "Fraginator - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE "Fraginator - Win32 Debug" (based on "Win32 (x86) Application") +!MESSAGE +!ERROR An invalid configuration is specified. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF + +CPP=xicl6.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "Fraginator - Win32 Release" + +OUTDIR=.\Release +INTDIR=.\Release +# Begin Custom Macros +OutDir=.\Release +# End Custom Macros + +ALL : "$(OUTDIR)\Fraginator.exe" + + +CLEAN : + -@erase "$(INTDIR)\Defragment.obj" + -@erase "$(INTDIR)\DriveVolume.obj" + -@erase "$(INTDIR)\Fraginator.obj" + -@erase "$(INTDIR)\Fraginator.res" + -@erase "$(INTDIR)\MainDialog.obj" + -@erase "$(INTDIR)\ReportDialog.obj" + -@erase "$(INTDIR)\Unfrag.obj" + -@erase "$(INTDIR)\vc60.idb" + -@erase "$(OUTDIR)\Fraginator.exe" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +CPP_PROJ=/nologo /G6 /Gr /MT /W3 /GX /Ox /Ot /Og /Oi /Ob2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Fp"$(INTDIR)\Fraginator.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c +MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 +RSC_PROJ=/l 0x409 /fo"$(INTDIR)\Fraginator.res" /d "NDEBUG" +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\Fraginator.bsc" +BSC32_SBRS= \ + +LINK32=xilink6.exe +LINK32_FLAGS=comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /profile /machine:I386 /out:"$(OUTDIR)\Fraginator.exe" +LINK32_OBJS= \ + "$(INTDIR)\Defragment.obj" \ + "$(INTDIR)\DriveVolume.obj" \ + "$(INTDIR)\Fraginator.obj" \ + "$(INTDIR)\MainDialog.obj" \ + "$(INTDIR)\ReportDialog.obj" \ + "$(INTDIR)\Unfrag.obj" \ + "$(INTDIR)\Fraginator.res" + +"$(OUTDIR)\Fraginator.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +SOURCE="$(InputPath)" +PostBuild_Desc=Copying to Program Files ... +DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep + +ALL : $(DS_POSTBUILD_DEP) + +# Begin Custom Macros +OutDir=.\Release +# End Custom Macros + +$(DS_POSTBUILD_DEP) : "$(OUTDIR)\Fraginator.exe" + copy Release\Fraginator.exe "c:\Program Files\Fraginator\Fraginator.exe" + echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)" + +!ELSEIF "$(CFG)" == "Fraginator - Win32 Debug" + +OUTDIR=.\Debug +INTDIR=.\Debug +# Begin Custom Macros +OutDir=.\Debug +# End Custom Macros + +ALL : "$(OUTDIR)\Fraginator.exe" + + +CLEAN : + -@erase "$(INTDIR)\Defragment.obj" + -@erase "$(INTDIR)\DriveVolume.obj" + -@erase "$(INTDIR)\Fraginator.obj" + -@erase "$(INTDIR)\Fraginator.res" + -@erase "$(INTDIR)\MainDialog.obj" + -@erase "$(INTDIR)\ReportDialog.obj" + -@erase "$(INTDIR)\Unfrag.obj" + -@erase "$(INTDIR)\vc60.idb" + -@erase "$(INTDIR)\vc60.pdb" + -@erase "$(OUTDIR)\Fraginator.exe" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +CPP_PROJ=/nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Fp"$(INTDIR)\Fraginator.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c +MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 +RSC_PROJ=/l 0x409 /fo"$(INTDIR)\Fraginator.res" /d "_DEBUG" +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\Fraginator.bsc" +BSC32_SBRS= \ + +LINK32=xilink6.exe +LINK32_FLAGS=comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /profile /debug /machine:I386 /out:"$(OUTDIR)\Fraginator.exe" +LINK32_OBJS= \ + "$(INTDIR)\Defragment.obj" \ + "$(INTDIR)\DriveVolume.obj" \ + "$(INTDIR)\Fraginator.obj" \ + "$(INTDIR)\MainDialog.obj" \ + "$(INTDIR)\ReportDialog.obj" \ + "$(INTDIR)\Unfrag.obj" \ + "$(INTDIR)\Fraginator.res" + +"$(OUTDIR)\Fraginator.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ENDIF + +.c{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.c{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + + +!IF "$(NO_EXTERNAL_DEPS)" != "1" +!IF EXISTS("Fraginator.dep") +!INCLUDE "Fraginator.dep" +!ELSE +!MESSAGE Warning: cannot find "Fraginator.dep" +!ENDIF +!ENDIF + + +!IF "$(CFG)" == "Fraginator - Win32 Release" || "$(CFG)" == "Fraginator - Win32 Debug" +SOURCE=.\Defragment.cpp + +"$(INTDIR)\Defragment.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\DriveVolume.cpp + +"$(INTDIR)\DriveVolume.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\Fraginator.cpp + +"$(INTDIR)\Fraginator.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\MainDialog.cpp + +"$(INTDIR)\MainDialog.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\ReportDialog.cpp + +"$(INTDIR)\ReportDialog.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\Unfrag.cpp + +"$(INTDIR)\Unfrag.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\Fraginator.rc + +"$(INTDIR)\Fraginator.res" : $(SOURCE) "$(INTDIR)" + $(RSC) $(RSC_PROJ) $(SOURCE) + + + +!ENDIF + Added: trunk/rosapps/fraginator/Fraginator.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Fraginator.rc?re…
============================================================================== --- trunk/rosapps/fraginator/Fraginator.rc (added) +++ trunk/rosapps/fraginator/Fraginator.rc Thu Mar 30 04:09:09 2006 @@ -1,0 +1,241 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_MAIN DIALOGEX 0, 0, 346, 103 +STYLE DS_SETFONT | DS_CENTERMOUSE | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | + WS_CAPTION | WS_SYSMENU +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + COMBOBOX IDC_DRIVES_LIST,78,52,29,111,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_METHODS_LIST,135,52,77,79,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_PRIORITY_LIST,223,52,59,91,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Start",IDC_STARTSTOP,294,7,45,15 + PUSHBUTTON "Help",ID_MAIN_HELP,294,28,45,15 + PUSHBUTTON "Exit",IDC_QUIT,294,49,45,15 + CONTROL 110,IDC_STATIC,"Static",SS_BITMAP | SS_SUNKEN | + WS_BORDER,7,7,63,58 + LTEXT "Choose a drive:",IDC_STATIC,78,40,50,8 + LTEXT "Choose an action:",IDC_STATIC,135,40,58,8 + CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER | + 0x1,7,71,299,10 + CONTROL "Static",IDC_STATUS,"Static",SS_LEFTNOWORDWRAP | + SS_SUNKEN | WS_GROUP,7,86,332,10 + LTEXT "I am a monkey, hear me eeK",IDC_WISECRACKS,78,15,91,8 + LTEXT "100.00%",IDC_PERCENT,311,71,28,8,0,WS_EX_RIGHT + LTEXT "Process Priority:",IDC_STATIC,223,40,51,8 +END + +IDD_REPORT DIALOG 0, 0, 391, 169 +STYLE DS_SETFONT | WS_POPUP | WS_CAPTION +CAPTION "Report" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "Bytes",IDC_BYTES,7,148,50,14 + DEFPUSHBUTTON "Kilobytes",IDC_KILOBYTES,61,148,50,14 + DEFPUSHBUTTON "Megabytes",IDC_MEGABYTES,115,148,50,14 + DEFPUSHBUTTON "Gigabytes",IDC_GIGABYTES,169,148,50,14 + DEFPUSHBUTTON "OK",IDC_REPORTOK,334,148,50,14 + RTEXT "Volume",IDC_STATIC,7,7,24,8 + LTEXT "Capacity",IDC_STATIC,7,51,28,8 + RTEXT "(Drive Letter)",IDC_DRIVELETTER,63,7,117,10,SS_SUNKEN + RTEXT "(Disk Size, Bytes)",IDC_DISKSIZEBYTES,63,51,117,10, + SS_SUNKEN + RTEXT "(Disk Size, Clusters)",IDC_DISKSIZECLUSTERS,63,73,117, + 10,SS_SUNKEN + LTEXT "Total clusters",IDC_STATIC,7,73,43,8 + RTEXT "(Cluster size)",IDC_DISKCLUSTERSIZE,63,84,117,10, + SS_SUNKEN + LTEXT "Cluster size",IDC_STATIC,7,84,36,8 + RTEXT "(Files count)",IDC_FILESCOUNT,267,18,117,10,SS_SUNKEN + RTEXT "(Files size, bytes)",IDC_FILESSIZEBYTES,267,29,117,10, + SS_SUNKEN + LTEXT "# of files",IDC_STATIC,194,18,28,8 + LTEXT "Total size",IDC_STATIC,194,29,31,8 + LTEXT "Size on disk",IDC_STATIC,194,40,39,8 + RTEXT "(Total size, bytes)",IDC_FILESSIZEONDISK,267,40,117,10, + SS_SUNKEN + RTEXT "(Files slack bytes)",IDC_FILESSLACKBYTES,267,51,117,10, + SS_SUNKEN + LTEXT "Wasted slack",IDC_STATIC,194,51,44,8 + RTEXT "(Disk Free, Bytes)",IDC_DISKFREEBYTES,63,62,117,10, + SS_SUNKEN + LTEXT "Free space",IDC_STATIC,7,62,36,8 + RTEXT "(Files fragmented, count)",IDC_FILESFRAGGED,267,62,117, + 10,SS_SUNKEN + LTEXT "Fragmented files",IDC_STATIC,194,62,52,8 + RTEXT "(Dirs count)",IDC_DIRSCOUNT,267,7,117,10,SS_SUNKEN + LTEXT "# of directories",IDC_STATIC,194,7,48,8 + RTEXT "File System",IDC_STATIC,7,40,36,8 + RTEXT "(File System Name)",IDC_FILESYSTEM,63,40,117,10, + SS_SUNKEN + RTEXT "Volume Label",IDC_STATIC,7,18,44,8 + RTEXT "(Volume Name)",IDC_VOLUMELABEL,63,18,117,10,SS_SUNKEN + RTEXT "Serial",IDC_STATIC,7,29,18,8 + RTEXT "(Volume Serial)",IDC_VOLUMESERIAL,63,29,117,10, + SS_SUNKEN + RTEXT "(Average Frags Per File)",IDC_AVERAGEFRAGS,267,73,117, + 10,SS_SUNKEN + LTEXT "Average fragments per file",IDC_STATIC,194,73,60,20 + LTEXT "XX.X% of the files on this drive are fragmented. It is recommended that you perform a SSSSSSS defragmentation.", + IDC_RECOMMEND,7,106,377,38,SS_SUNKEN + LTEXT "Recommendations:",IDC_STATIC,7,96,62,8 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_MAIN, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 339 + TOPMARGIN, 7 + BOTTOMMARGIN, 96 + END + + IDD_REPORT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 384 + TOPMARGIN, 7 + BOTTOMMARGIN, 162 + END +END +#endif // APSTUDIO_INVOKED + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,3,0,0 + PRODUCTVERSION 1,3,0,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", " " + VALUE "FileDescription", "Fraginator" + VALUE "FileVersion", "1.03" + VALUE "InternalName", "Fraginator" + VALUE "LegalCopyright", "Copyright © 2000-2002 Rick Brewster" + VALUE "OriginalFilename", "Fraginator.exe" + VALUE "ProductName", "Fraginator" + VALUE "ProductVersion", "1.03" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_LOGO BITMAP "Fraginator Motif Icon.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_ICON ICON "icon1.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// RT_MANIFEST +// + +1 RT_MANIFEST "default1.bin" +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + Added: trunk/rosapps/fraginator/Fraginator.sln URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Fraginator.sln?r…
============================================================================== --- trunk/rosapps/fraginator/Fraginator.sln (added) +++ trunk/rosapps/fraginator/Fraginator.sln Thu Mar 30 04:09:09 2006 @@ -1,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 7.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Fraginator", "Fraginator.vcproj", "{7CB0DB3F-D4AB-4A99-807F-C56CC9F0B19C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unfrag", "unfrag.vcproj", "{8E7E76C1-739B-46E5-99C2-A0504558164B}" +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + ConfigName.0 = Debug + ConfigName.1 = Release + EndGlobalSection + GlobalSection(ProjectDependencies) = postSolution + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {7CB0DB3F-D4AB-4A99-807F-C56CC9F0B19C}.Debug.ActiveCfg = Debug|Win32 + {7CB0DB3F-D4AB-4A99-807F-C56CC9F0B19C}.Debug.Build.0 = Debug|Win32 + {7CB0DB3F-D4AB-4A99-807F-C56CC9F0B19C}.Release.ActiveCfg = Release|Win32 + {7CB0DB3F-D4AB-4A99-807F-C56CC9F0B19C}.Release.Build.0 = Release|Win32 + {8E7E76C1-739B-46E5-99C2-A0504558164B}.Debug.ActiveCfg = Debug|Win32 + {8E7E76C1-739B-46E5-99C2-A0504558164B}.Debug.Build.0 = Debug|Win32 + {8E7E76C1-739B-46E5-99C2-A0504558164B}.Release.ActiveCfg = Release|Win32 + {8E7E76C1-739B-46E5-99C2-A0504558164B}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal Added: trunk/rosapps/fraginator/Fraginator.suo URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Fraginator.suo?r…
============================================================================== Binary file - no diff available. Propchange: trunk/rosapps/fraginator/Fraginator.suo ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/rosapps/fraginator/Fraginator.vcproj URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Fraginator.vcpro…
============================================================================== --- trunk/rosapps/fraginator/Fraginator.vcproj (added) +++ trunk/rosapps/fraginator/Fraginator.vcproj Thu Mar 30 04:09:09 2006 @@ -1,0 +1,203 @@ +<?xml version="1.0" encoding = "Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="7.00" + Name="Fraginator" + SccProjectName="" + SccLocalPath=""> + <Platforms> + <Platform + Name="Win32"/> + </Platforms> + <Configurations> + <Configuration + Name="Release|Win32" + OutputDirectory=".\Release" + IntermediateDirectory=".\Release" + ConfigurationType="1" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="FALSE"> + <Tool + Name="VCCLCompilerTool" + Optimization="3" + GlobalOptimizations="TRUE" + InlineFunctionExpansion="2" + EnableIntrinsicFunctions="TRUE" + FavorSizeOrSpeed="1" + OptimizeForProcessor="2" + PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS" + ExceptionHandling="TRUE" + RuntimeLibrary="0" + StructMemberAlignment="5" + BufferSecurityCheck="FALSE" + PrecompiledHeaderFile=".\Release/Fraginator.pch" + AssemblerListingLocation=".\Release/" + ObjectFile=".\Release/" + ProgramDataBaseFileName=".\Release/" + WarningLevel="3" + SuppressStartupBanner="TRUE" + CompileAsManaged="0" + CallingConvention="1"/> + <Tool + Name="VCCustomBuildTool"/> + <Tool + Name="VCLinkerTool" + AdditionalOptions="/MACHINE:I386" + AdditionalDependencies="comctl32.lib odbc32.lib odbccp32.lib" + OutputFile=".\Release/Fraginator.exe" + LinkIncremental="1" + SuppressStartupBanner="TRUE" + SubSystem="2"/> + <Tool + Name="VCMIDLTool" + PreprocessorDefinitions="NDEBUG" + MkTypLibCompatible="TRUE" + SuppressStartupBanner="TRUE" + TargetEnvironment="1" + TypeLibraryName=".\Release/Fraginator.tlb"/> + <Tool + Name="VCPostBuildEventTool" + Description="Copying to Program Files ..." + CommandLine="copy Release\Fraginator.exe "c:\Program Files\Fraginator\Fraginator.exe""/> + <Tool + Name="VCPreBuildEventTool"/> + <Tool + Name="VCPreLinkEventTool"/> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1033"/> + <Tool + Name="VCWebServiceProxyGeneratorTool"/> + <Tool + Name="VCWebDeploymentTool"/> + </Configuration> + <Configuration + Name="Debug|Win32" + OutputDirectory=".\Debug" + IntermediateDirectory=".\Debug" + ConfigurationType="1" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="FALSE"> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS" + BasicRuntimeChecks="3" + RuntimeLibrary="1" + PrecompiledHeaderFile=".\Debug/Fraginator.pch" + AssemblerListingLocation=".\Debug/" + ObjectFile=".\Debug/" + ProgramDataBaseFileName=".\Debug/" + WarningLevel="3" + SuppressStartupBanner="TRUE" + DebugInformationFormat="4"/> + <Tool + Name="VCCustomBuildTool"/> + <Tool + Name="VCLinkerTool" + AdditionalOptions="/MACHINE:I386" + AdditionalDependencies="comctl32.lib odbc32.lib odbccp32.lib" + OutputFile=".\Debug/Fraginator.exe" + LinkIncremental="2" + SuppressStartupBanner="TRUE" + GenerateDebugInformation="TRUE" + ProgramDatabaseFile=".\Debug/Fraginator.pdb" + SubSystem="2"/> + <Tool + Name="VCMIDLTool" + PreprocessorDefinitions="_DEBUG" + MkTypLibCompatible="TRUE" + SuppressStartupBanner="TRUE" + TargetEnvironment="1" + TypeLibraryName=".\Debug/Fraginator.tlb"/> + <Tool + Name="VCPostBuildEventTool"/> + <Tool + Name="VCPreBuildEventTool"/> + <Tool + Name="VCPreLinkEventTool"/> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1033"/> + <Tool + Name="VCWebServiceProxyGeneratorTool"/> + <Tool + Name="VCWebDeploymentTool"/> + </Configuration> + </Configurations> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> + <File + RelativePath=".\Defragment.cpp"> + </File> + <File + RelativePath=".\DriveVolume.cpp"> + </File> + <File + RelativePath=".\Fraginator.cpp"> + </File> + <File + RelativePath=".\MainDialog.cpp"> + </File> + <File + RelativePath=".\ReportDialog.cpp"> + </File> + <File + RelativePath="Unfrag.cpp"> + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl"> + <File + RelativePath=".\Defragment.h"> + </File> + <File + RelativePath=".\DriveVolume.h"> + </File> + <File + RelativePath=".\Fraginator.h"> + </File> + <File + RelativePath=".\MainDialog.h"> + </File> + <File + RelativePath=".\Mutex.h"> + </File> + <File + RelativePath=".\ReportDialog.h"> + </File> + <File + RelativePath=".\Unfrag.h"> + </File> + <File + RelativePath=".\resource.h"> + </File> + </Filter> + <Filter + Name="Resource Files" + Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> + <File + RelativePath=".\Fraginator Help - Fraginator Icon.bmp"> + </File> + <File + RelativePath=".\Fraginator Motif Icon.bmp"> + </File> + <File + RelativePath=".\Fraginator.rc"> + </File> + <File + RelativePath=".\default1.bin"> + </File> + <File + RelativePath=".\icon1.ico"> + </File> + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> Added: trunk/rosapps/fraginator/MainDialog.cpp URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/MainDialog.cpp?r…
============================================================================== --- trunk/rosapps/fraginator/MainDialog.cpp (added) +++ trunk/rosapps/fraginator/MainDialog.cpp Thu Mar 30 04:09:09 2006 @@ -1,0 +1,574 @@ +#include "unfrag.h" +#include "MainDialog.h" +#include "resource.h" +#include "Fraginator.h" +#include "Defragment.h" +#include "ReportDialog.h" + + +vector<string> DrivesList; +LRESULT AnalyzeID; +LRESULT FastID; +LRESULT ExtensiveID; +bool QuitWhenDone; +bool Stopping; + + +LRESULT PriHighID; +LRESULT PriAboveNormID; +LRESULT PriNormalID; +LRESULT PriBelowNormID; +LRESULT PriIdleID; + + +void InitDialog (HWND Dlg); +void UpdateDefragInfo (HWND Dlg); +void UpdatePriority (HWND Dlg); +string GetDefaultTitle (void); +string GetDefragTitle (void); +void SetDisables (HWND Dlg); +INT_PTR CALLBACK MainDialogProc (HWND Dlg, UINT Msg, WPARAM WParam, LPARAM LParam); + + +static void InitDialog (HWND Dlg) +{ + // Make internal list + DWORD DriveMask; + HWND DlgItem; + int d; + + // Clear out wisecracks line for now + SetDlgItemText (Dlg, IDC_WISECRACKS, "\"Defrag, baby!\""); + + // Make list of logical drives + DrivesList.resize (0); + DriveMask = GetLogicalDrives (); + + for (d = 0; d < 26; d++) + { + if (DriveMask & (1 << d)) + { + string Name; + + Name = (char)('A' + d); + Name += ':'; + DrivesList.push_back (Name); + } + } + + // Give list to dropdown list + DlgItem = GetDlgItem (Dlg, IDC_DRIVES_LIST); + SendMessage (DlgItem, CB_RESETCONTENT, 0, 0); + for (d = 0; d < DrivesList.size(); d++) + { + SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) DrivesList[d].c_str()); + } + + // Put in defrag methods + DlgItem = GetDlgItem (Dlg, IDC_METHODS_LIST); + SendMessage (DlgItem, CB_RESETCONTENT, 0, 0); + AnalyzeID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) "Analyze Only"); + FastID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) "Fast Defrag"); + ExtensiveID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) "Extensive Defrag"); + + // Set up process priorities + DlgItem = GetDlgItem (Dlg, IDC_PRIORITY_LIST); + SendMessage (Dlg, CB_RESETCONTENT, 0, 0); + PriHighID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) "High"); + PriAboveNormID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) "Above Normal"); + PriNormalID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) "Normal"); + PriBelowNormID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) "Below Normal"); + PriIdleID = SendMessage (DlgItem, CB_ADDSTRING, 0, (LPARAM) "Idle"); + UpdatePriority (Dlg); + + // Reset texts and progress meters + SendDlgItemMessage (Dlg, IDC_STATUS, WM_SETTEXT, 0, (LPARAM) ""); + SendDlgItemMessage (Dlg, IDC_PERCENT, WM_SETTEXT, 0, (LPARAM) ""); + SendDlgItemMessage (Dlg, IDC_PROGRESS, PBM_SETRANGE, 0, MAKELPARAM (0, 10000)); + SendDlgItemMessage (Dlg, IDC_PROGRESS, PBM_SETPOS, 0, 0); + + return; +} + + +void UpdateDefragInfo (HWND Dlg) +{ + char PercentText[100]; + static double OldPercent = 200.0f; + static string OldStatus = "Non"; + string NewStatus; + double NewPercent; + + if (Defrag == NULL) + return; + + NewPercent = Defrag->GetStatusPercent (); + if (NewPercent > 100.0f) + NewPercent = 100.0f; + if (NewPercent < 0.0f) + NewPercent = 0.0f; + if (NewPercent != OldPercent) + { + sprintf (PercentText, "%6.2f%%", NewPercent); + SendDlgItemMessage (Dlg, IDC_PERCENT, WM_SETTEXT, 0, (LPARAM) PercentText); + SendDlgItemMessage (Dlg, IDC_PROGRESS, PBM_SETPOS, + (WPARAM) (int)(NewPercent * 100.0f), 0); + OldPercent = NewPercent; + } + + NewStatus = Defrag->GetStatusString (); + if (NewStatus != OldStatus) + { // Change & characters to && to avoid underlining + string Status; + string::iterator it; + + Status = NewStatus; + it = Status.begin (); + while (it < Status.end()) + { + if (*it == '&') + { + Status.insert (it, 1, '&'); + it++; + } + + it++; + } + + SendDlgItemMessage (Dlg, IDC_STATUS, WM_SETTEXT, 0, + (LPARAM) Status.c_str()); + + OldStatus = NewStatus; + } + + return; +} + + +string GetDefaultTitle (void) +{ + string DefaultText; + + DefaultText = string(string(APPNAME_GUI) + string(" v") + string(APPVER_STR) + + string(" (C) 2000 by Rick Brewster")); + + return (DefaultText); +} + + +string GetDefragTitle (void) +{ + string DefragText; + char Percent[10]; + + sprintf (Percent, "%.2f%%", Defrag->GetStatusPercent()); + + DefragText = GetDefaultTitle (); + if (Defrag != NULL) + { + DefragText = string(Percent) + string (" - ") + Defrag->GetVolume().GetRootPath() + + string (" - ") + DefragText; + } + + return (DefragText); +} + + +void SetDisables (HWND Dlg) +{ + // If a defrag is in process, set 'Start' button to say 'Stop' and disable + // the Select Drive and Select Action controls + if (Defrag != NULL && !Defrag->IsDoneYet() && !Defrag->HasError()) + { + SendMessage (GetDlgItem (Dlg, IDC_STARTSTOP), WM_SETTEXT, 0, (LPARAM) "Stop"); + EnableWindow (GetDlgItem (Dlg, IDC_DRIVES_LIST), FALSE); + EnableWindow (GetDlgItem (Dlg, IDC_METHODS_LIST), FALSE); + } + else + { + SendMessage (GetDlgItem (Dlg, IDC_STARTSTOP), WM_SETTEXT, 0, (LPARAM) "Start"); + EnableWindow (GetDlgItem (Dlg, IDC_STARTSTOP), TRUE); + EnableWindow (GetDlgItem (Dlg, IDC_QUIT), TRUE); + EnableWindow (GetDlgItem (Dlg, IDC_DRIVES_LIST), TRUE); + EnableWindow (GetDlgItem (Dlg, IDC_METHODS_LIST), TRUE); + } + + return; +} + + +void UpdatePriority (HWND Dlg) +{ + LRESULT Id; + DWORD Priority; + + Id = SendDlgItemMessage (Dlg, IDC_PRIORITY_LIST, CB_GETCURSEL, 0, 0); + + if (Id == PriHighID) + Priority = HIGH_PRIORITY_CLASS; + else + if (Id == PriAboveNormID) + Priority = ABOVE_NORMAL_PRIORITY_CLASS; + else + if (Id == PriNormalID) + Priority = NORMAL_PRIORITY_CLASS; + else + if (Id == PriBelowNormID) + Priority = BELOW_NORMAL_PRIORITY_CLASS; + else + if (Id == PriIdleID) + Priority = IDLE_PRIORITY_CLASS; + else + return; + + SetPriorityClass (GetCurrentProcess(), Priority); + return; +} + + +// Save settings (ie, process priority and defrag type options) +bool GetRegKeys (HKEY *RegKeyResult) +{ + HKEY RegKey; + LONG Error; + + Error = RegCreateKeyEx + ( + HKEY_CURRENT_USER, + "Software\\Fraginator", + 0, + NULL, + REG_OPTION_NON_VOLATILE, + KEY_ALL_ACCESS, + NULL, + &RegKey, + NULL + ); + + if (Error != ERROR_SUCCESS) + return (false); + + *RegKeyResult = RegKey; + return (true); +} + + +bool DoneRegKey (HKEY RegKey) +{ + RegCloseKey (RegKey); + return (true); +} + + +void SaveSettings (HWND Dlg) +{ + LRESULT DefragID; + DWORD DefragVal; + LRESULT PriID; + DWORD PriVal; + HKEY RegKey; + + DefragID = SendDlgItemMessage (Dlg, IDC_METHODS_LIST, CB_GETCURSEL, 0, 0); + PriID = SendDlgItemMessage (Dlg, IDC_PRIORITY_LIST, CB_GETCURSEL, 0, 0); + + // Action + if (DefragID == AnalyzeID) + DefragVal = (DWORD) DefragAnalyze; + else + if (DefragID == FastID) + DefragVal = (DWORD) DefragFast; + else + if (DefragID == ExtensiveID) + DefragVal = (DWORD) DefragExtensive; + + // Process Priority + if (PriID == PriHighID) + PriVal = HIGH_PRIORITY_CLASS; + else + if (PriID == PriAboveNormID) + PriVal = ABOVE_NORMAL_PRIORITY_CLASS; + else + if (PriID == PriNormalID) + PriVal = NORMAL_PRIORITY_CLASS; + else + if (PriID == PriBelowNormID) + PriVal = BELOW_NORMAL_PRIORITY_CLASS; + else + if (PriID == PriIdleID) + PriVal = IDLE_PRIORITY_CLASS; + + if (!GetRegKeys (&RegKey)) + return; + + RegSetValueEx + ( + RegKey, + "Default Action", + 0, + REG_DWORD, + (CONST BYTE *)&DefragVal, + sizeof (DefragVal) + ); + + RegSetValueEx + ( + RegKey, + "Process Priority", + 0, + REG_DWORD, + (CONST BYTE *)&PriVal, + sizeof (PriVal) + ); + + DoneRegKey (RegKey); + return; +} + + +void LoadSettings (HWND Dlg) +{ + DefragType DType; + DWORD DTypeVal; + LRESULT DefragID; + DWORD PriVal; + LRESULT PriID; + HKEY RegKey; + DWORD RegType; + DWORD RegSize; + LONG Error; + + if (!GetRegKeys (&RegKey)) + return; + + RegSize = sizeof (DTypeVal); + RegType = REG_DWORD; + + Error = RegQueryValueEx + ( + RegKey, + "Default Action", + 0, + &RegType, + (BYTE *)&DTypeVal, + &RegSize + ); + + if (Error != ERROR_SUCCESS) + DTypeVal = DefragAnalyze; + + Error = RegQueryValueEx + ( + RegKey, + "Process Priority", + 0, + &RegType, + (BYTE *)&PriVal, + &RegSize + ); + + DoneRegKey (RegKey); + + if (Error != ERROR_SUCCESS) + PriVal = NORMAL_PRIORITY_CLASS; + + DType = (DefragType) DTypeVal; + switch (DType) + { + default: + case DefragAnalyze: + DefragID = AnalyzeID; + break; + + case DefragFast: + DefragID = FastID; + break; + + case DefragExtensive: + DefragID = ExtensiveID; + break; + } + + switch (PriVal) + { + case HIGH_PRIORITY_CLASS: + PriID = PriHighID; + break; + + case ABOVE_NORMAL_PRIORITY_CLASS: + PriID = PriAboveNormID; + break; + + default: + case NORMAL_PRIORITY_CLASS: + PriID = PriNormalID; + break; + + case BELOW_NORMAL_PRIORITY_CLASS: + PriID = PriBelowNormID; + break; + + case IDLE_PRIORITY_CLASS: + PriID = PriIdleID; + break; + } + + SendDlgItemMessage (Dlg, IDC_PRIORITY_LIST, CB_SETCURSEL, PriID, 0); + SendDlgItemMessage (Dlg, IDC_METHODS_LIST, CB_SETCURSEL, DefragID, 0); + return; +} + + +#define IDLETIME 25 +string OldWindowText = ""; + +INT_PTR CALLBACK MainDialogProc (HWND Dlg, UINT Msg, WPARAM WParam, LPARAM LParam) +{ + static bool ReEntrance = false; + + switch (Msg) + { + case WM_INITDIALOG: + Stopping = false; + SetWindowText (Dlg, GetDefaultTitle().c_str()); + SetDisables (Dlg); + InitDialog (Dlg); + SetTimer (Dlg, 1, IDLETIME, NULL); + SetClassLong (Dlg, GCL_HICON, (LONG) LoadIcon (GlobalHInstance, MAKEINTRESOURCE(IDI_ICON))); + QuitWhenDone = false; + LoadSettings (Dlg); + UpdatePriority (Dlg); + return (1); + + + case WM_TIMER: + if (Defrag != NULL && !ReEntrance) + { + string NewTitle; + + SendMessage (Dlg, WM_UPDATEINFO, 0, 0); + + NewTitle = GetDefragTitle (); + if (NewTitle != OldWindowText) + { + OldWindowText = NewTitle; + SetWindowText (Dlg, NewTitle.c_str()); + } + + if (Defrag->IsDoneYet() || Defrag->HasError()) + { // This is the code executed when defragging is finished (or stopped :) + if (Defrag->GetDefragType() == DefragAnalyze && + !Defrag->HasError() && + !Stopping) + { // Show report + ReEntrance = true; + + DialogBoxParam (GlobalHInstance, MAKEINTRESOURCE (IDD_REPORT), + Dlg, ReportDialogProc, (LPARAM) Defrag); + + ReEntrance = false; + } + + delete Defrag; + Defrag = NULL; + SetDisables (Dlg); + SetWindowText (Dlg, GetDefaultTitle().c_str()); + + Stopping = false; + + if (QuitWhenDone) + SendMessage (GetDlgItem (Dlg, IDC_QUIT), BM_CLICK, 0, 0); + } + } + + SetTimer (Dlg, 1, IDLETIME, NULL); + return (0); + + + case WM_UPDATEINFO: + UpdateDefragInfo (Dlg); + return (1); + + + case WM_CLOSE: + SendMessage (GetDlgItem (Dlg, IDC_QUIT), BM_CLICK, 0, 0); + return (1); + + + case WM_COMMAND: + switch (LOWORD(WParam)) + { + case IDC_PRIORITY_LIST: + UpdatePriority (Dlg); + return (1); + + + case ID_MAIN_HELP: + ShellExecute (Dlg, "open", "Fraginator.chm", "", ".", SW_SHOW); + return (1); + + + case IDC_QUIT: + if (Defrag == NULL) + { // This is the code executing when quitting + SaveSettings (Dlg); + EndDialog (Dlg, 0); + } + else + { // Tell defragging to finish and disable our button + QuitWhenDone = true; + SendMessage (GetDlgItem (Dlg, IDC_STARTSTOP), BM_CLICK, 0, 0); + EnableWindow (GetDlgItem (Dlg, IDC_QUIT), FALSE); + } + return (1); + + + case IDC_STARTSTOP: + if (Defrag == NULL) + { // "Start" + char Drive[10]; + LRESULT ID; + DefragType Method; + HANDLE H; + + if (Defrag != NULL) + return (1); + + SendMessage (GetDlgItem (Dlg, IDC_DRIVES_LIST), WM_GETTEXT, + sizeof (Drive) - 1, (LPARAM) Drive); + + if (strlen(Drive) != 2 || Drive[1] != ':') + return (1); + + ID = SendMessage (GetDlgItem (Dlg, IDC_METHODS_LIST), CB_GETCURSEL, 0, 0); + Method = DefragInvalid; + if (ID == AnalyzeID) + Method = DefragAnalyze; + else + if (ID == FastID) + Method = DefragFast; + else + if (ID == ExtensiveID) + Method = DefragExtensive; + + if (Method != DefragInvalid) + { + Defrag = StartDefragThread (Drive, Method, H); + Defrag->SetDoLimitLength (false); + SetWindowText (Dlg, GetDefragTitle().c_str()); + SetDisables (Dlg); + } + } + else + { // "Stop" + Stopping = true; + Defrag->Stop (); + EnableWindow (GetDlgItem (Dlg, IDC_STARTSTOP), FALSE); + EnableWindow (GetDlgItem (Dlg, IDC_QUIT), FALSE); + } + return (1); + } + } + + // Otherwise, return 0 to say we did not process the message. + return (0); +} Added: trunk/rosapps/fraginator/MainDialog.h URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/MainDialog.h?rev…
============================================================================== --- trunk/rosapps/fraginator/MainDialog.h (added) +++ trunk/rosapps/fraginator/MainDialog.h Thu Mar 30 04:09:09 2006 @@ -1,0 +1,14 @@ +#ifndef MAINDIALOG_H +#define MAINDIALOG_H + + +#include <windows.h> + + +#define WM_UPDATEINFO (WM_USER + 1) + + +INT_PTR CALLBACK MainDialogProc (HWND Dlg, UINT Msg, WPARAM WParam, LPARAM LParam); + + +#endif // MAINDIALOG_H Added: trunk/rosapps/fraginator/Mutex.h URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Mutex.h?rev=2141…
============================================================================== --- trunk/rosapps/fraginator/Mutex.h (added) +++ trunk/rosapps/fraginator/Mutex.h Thu Mar 30 04:09:09 2006 @@ -1,0 +1,78 @@ +/***************************************************************************** + + Mutex + +*****************************************************************************/ + + +#ifndef MUTEX_H +#define MUTEX_H + + +#include "Unfrag.h" + + +class Mutex +{ +public: + Mutex () + { + // NT only code begin ... Win9x disregards this part + SECURITY_ATTRIBUTES MutexAttribs; + + memset (&MutexAttribs, 0, sizeof (SECURITY_ATTRIBUTES)); + + MutexAttribs.bInheritHandle = false; + MutexAttribs.nLength = sizeof (SECURITY_ATTRIBUTES); + MutexAttribs.lpSecurityDescriptor = NULL; + // NT only code end + + Locked = false; + LockCount = 0; + MutexHandle = CreateMutex (&MutexAttribs, Locked, NULL); + + return; + } + + ~Mutex () + { + Lock (); + CloseHandle (MutexHandle); + } + + void Lock (void) + { + Locked = true; + WaitForSingleObject (MutexHandle, INFINITE); + LockCount += 1; + return; + } + + + void Unlock (void) + { + LockCount -= 1; + if (LockCount <= 0) + { + LockCount = 0; + Locked = false; + } + + ReleaseMutex (MutexHandle); + return; + } + + + bool IsLocked (void) + { + return (Locked); + } + +protected: + uint32 LockCount; + HANDLE MutexHandle; + bool Locked; +}; + + +#endif // MUTEX_H Added: trunk/rosapps/fraginator/ReportDialog.cpp URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/ReportDialog.cpp…
============================================================================== --- trunk/rosapps/fraginator/ReportDialog.cpp (added) +++ trunk/rosapps/fraginator/ReportDialog.cpp Thu Mar 30 04:09:09 2006 @@ -1,0 +1,231 @@ +#include "ReportDialog.h" +#include "unfrag.h" +#include "Fraginator.h" +#include "DriveVolume.h" +#include "Defragment.h" +#include "resource.h" + + +void SetReportInfo (HWND Dlg, DefragReport &Report, uint32 BytesDivisor, char *BytesUnits, bool Fractional) +{ + char Text[1000]; + char Text2[1000]; + char Text3[1000]; + + memset (Text, 0, sizeof (Text)); + + // Volume name + SetDlgItemText (Dlg, IDC_DRIVELETTER, Report.RootPath.c_str()); + + // Volume label + SetDlgItemText (Dlg, IDC_VOLUMELABEL, Defrag->GetVolume().GetVolumeInfo().Name.c_str()); + + // Volume Serial + SetDlgItemText (Dlg, IDC_VOLUMESERIAL, Defrag->GetVolume().GetVolumeInfo().Serial.c_str()); + + // File System + SetDlgItemText (Dlg, IDC_FILESYSTEM, Defrag->GetVolume().GetVolumeInfo().FileSystem.c_str()); + + // DiskSizeBytes + if (Fractional) + { + sprintf (Text, "%.2f %s", (double)(signed)(Report.DiskSizeBytes / + (BytesDivisor / 1024)) / 1024.0, BytesUnits); + } + else + { + AddCommas (Text, Report.DiskSizeBytes / BytesDivisor); + strcat (Text, " "); + strcat (Text, BytesUnits); + } + + SetDlgItemText (Dlg, IDC_DISKSIZEBYTES, Text); + + // DiskFreeBytes + if (Fractional) + { + sprintf (Text, "%.2f %s", (double)(signed)(Defrag->GetVolume().GetVolumeInfo().FreeBytes / + (BytesDivisor / 1024)) / 1024.0, BytesUnits); + } + else + { + AddCommas (Text, Defrag->GetVolume().GetVolumeInfo().FreeBytes / BytesDivisor); + strcat (Text, " "); + strcat (Text, BytesUnits); + } + SetDlgItemText (Dlg, IDC_DISKFREEBYTES, Text); + + // DiskSizeClusters + AddCommas (Text, Defrag->GetVolume().GetVolumeInfo().ClusterCount); + strcat (Text, " clusters"); + SetDlgItemText (Dlg, IDC_DISKSIZECLUSTERS, Text); + + // DiskClusterSize + sprintf (Text, "%u bytes", Defrag->GetVolume().GetVolumeInfo().ClusterSize); + SetDlgItemText (Dlg, IDC_DISKCLUSTERSIZE, Text); + + // DirsCount + AddCommas (Text, Report.DirsCount); + SetDlgItemText (Dlg, IDC_DIRSCOUNT, Text); + + // FilesCount + AddCommas (Text, Report.FilesCount); + SetDlgItemText (Dlg, IDC_FILESCOUNT, Text); + + // FilesFragged + sprintf (Text, "(%.2f%%)", Report.PercentFragged); + AddCommas (Text2, Report.FraggedFiles.size()); + sprintf (Text3, "%s %s", Text, Text2); + SetDlgItemText (Dlg, IDC_FILESFRAGGED, Text3); + + // Average Frags + sprintf (Text, "%.2f", Report.AverageFragments); + SetDlgItemText (Dlg, IDC_AVERAGEFRAGS, Text); + + // FilesSizeBytes + if (Fractional) + { + sprintf (Text, "%.2f %s", (double)(signed)(Report.FilesSizeBytes / + (BytesDivisor / 1024)) / 1024.0, BytesUnits); + } + else + { + AddCommas (Text, Report.FilesSizeBytes / (uint64)BytesDivisor); + strcat (Text, " "); + strcat (Text, BytesUnits); + } + SetDlgItemText (Dlg, IDC_FILESSIZEBYTES, Text); + + // Files SizeOnDisk + if (Fractional) + { + sprintf (Text, "%.2f %s", (double)(signed)((Report.FilesSizeBytes + Report.FilesSlackBytes) / + (BytesDivisor / 1024)) / 1024.0, BytesUnits); + } + else + { + AddCommas (Text, (Report.FilesSizeBytes + Report.FilesSlackBytes) / (uint64)BytesDivisor); + strcat (Text, " "); + strcat (Text, BytesUnits); + + } + SetDlgItemText (Dlg, IDC_FILESSIZEONDISK, Text); + + // FilesSlackBytes + if (Fractional) + { + sprintf (Text, "%.2f %s", (double)(signed)(Report.FilesSlackBytes / + (BytesDivisor / 1024)) / 1024.0, BytesUnits); + } + else + { + AddCommas (Text, Report.FilesSlackBytes / BytesDivisor); + strcat (Text, " "); + strcat (Text, BytesUnits); + } + sprintf (Text2, "(%.2f%%)", Report.PercentSlack); + sprintf (Text3, "%s %s", Text2, Text); + SetDlgItemText (Dlg, IDC_FILESSLACKBYTES, Text3); + + // Recommendation + bool PFRec = false; // Recommend based off percent fragged files? + bool AFRec = false; // Recommend based off average fragments per file? + + if (Report.PercentFragged >= 5.0f) + PFRec = true; + + if (Report.AverageFragments >= 1.1f) + AFRec = true; + + strcpy (Text, "* "); + + if (PFRec) + { + sprintf + ( + Text2, + "%.2f%% of the files on this volume are fragmented. ", + Report.PercentFragged + ); + + strcat (Text, Text2); + } + + if (AFRec) + { + sprintf + ( + Text2, + "The average fragments per file (%.2f) indicates a high degree of fragmentation. ", + Report.AverageFragments + ); + + strcat (Text, Text2); + } + + if (Report.PercentFragged < 5.0f && Report.AverageFragments < 1.1f) + sprintf (Text, "* No defragmentation is necessary at this point."); + else + if (Report.PercentFragged < 15.0f && Report.AverageFragments < 1.3f) + strcat (Text, "It is recommended that you perform a Fast Defrag."); + else + strcat (Text, "It is recommended that you perform an Extensive Defrag."); + + // Should we recommend a smaller cluster size? + if (Report.PercentSlack >= 10.0f) + { + sprintf + ( + Text2, + "\n* A large amount of disk space (%.2f%%) is being lost " + "due to a large (%u bytes) cluster size. It is recommended " + "that you use a disk utility such as Partition Magic to " + "reduce the cluster size of this volume.", + Report.PercentSlack, + Defrag->GetVolume().GetVolumeInfo().ClusterSize + ); + + strcat (Text, Text2); + } + + SetDlgItemText (Dlg, IDC_RECOMMEND, Text); + + return; +} + + +INT_PTR CALLBACK ReportDialogProc (HWND Dlg, UINT Msg, WPARAM WParam, LPARAM LParam) +{ + switch (Msg) + { + case WM_INITDIALOG: + SetReportInfo (Dlg, Defrag->GetDefragReport (), 1, "bytes", false); + return (1); + + case WM_COMMAND: + switch (LOWORD(WParam)) + { + case IDC_REPORTOK: + EndDialog (Dlg, 0); + return (1); + + case IDC_GIGABYTES: + SetReportInfo (Dlg, Defrag->GetDefragReport (), 1024*1024*1024, "GB", true); + return (1); + + case IDC_MEGABYTES: + SetReportInfo (Dlg, Defrag->GetDefragReport (), 1024*1024, "MB", false); + return (1); + + case IDC_KILOBYTES: + SetReportInfo (Dlg, Defrag->GetDefragReport (), 1024, "KB", false); + return (1); + + case IDC_BYTES: + SetReportInfo (Dlg, Defrag->GetDefragReport (), 1, "bytes", false); + return (1); + } + } + + return (0); +} Added: trunk/rosapps/fraginator/ReportDialog.h URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/ReportDialog.h?r…
============================================================================== --- trunk/rosapps/fraginator/ReportDialog.h (added) +++ trunk/rosapps/fraginator/ReportDialog.h Thu Mar 30 04:09:09 2006 @@ -1,0 +1,18 @@ +/***************************************************************************** + + ReportDialog + +*****************************************************************************/ + + +#ifndef REPORTDIALOG_H +#define REPORTDIALOG_H + + +#include <windows.h> + + +INT_PTR CALLBACK ReportDialogProc (HWND Dlg, UINT Msg, WPARAM WParam, LPARAM LParam); + + +#endif // REPORTDIALOG_H Added: trunk/rosapps/fraginator/Unfrag.cpp URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Unfrag.cpp?rev=2…
============================================================================== --- trunk/rosapps/fraginator/Unfrag.cpp (added) +++ trunk/rosapps/fraginator/Unfrag.cpp Thu Mar 30 04:09:09 2006 @@ -1,0 +1,464 @@ +/***************************************************************************** + + Unfrag + +*****************************************************************************/ + + +#include "Unfrag.h" +#include "DriveVolume.h" +#include "Defragment.h" +#include <process.h> + + +bool QuietMode = false; +bool VerboseMode = false; + + +// Makes sure we're in Windows 2000 +bool CheckWinVer (void) +{ + OSVERSIONINFO OSVersion; + + ZeroMemory (&OSVersion, sizeof (OSVersion)); + OSVersion.dwOSVersionInfoSize = sizeof (OSVersion); + GetVersionEx (&OSVersion); + + // Need Windows 2000! + + // Check for NT first + // Actually what we do is check that we're not on Win31+Win32s and that we're + // not in Windows 9x. It's possible that there could be more Windows "platforms" + // in the future and there's no sense in claiming incompatibility. + if (OSVersion.dwPlatformId == VER_PLATFORM_WIN32s || + OSVersion.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) + { + return (false); + } + + // Ok we're in Windows NT, now make sure we're in 2000 + if (OSVersion.dwMajorVersion < 5) + return (false); + + // Kew, we're in at least Windows 2000 ("NT 5.0") + return (true); +} + + +char *AddCommas (char *Result, uint64 Number) +{ + char Temp[128]; + int TempLen; + char *p = NULL; + int AddCommas = 0; + char *StrPosResult = NULL; + char *StrPosOrig = NULL; + + // we get the string form of the number, then we count down w/ AddCommas + // while copying the string from Temp1 to Result. when AddCommas % 3 == 1, + // slap in a commas as well, before the #. + sprintf (Temp, "%I64u", Number); + AddCommas = TempLen = strlen (Temp); + StrPosOrig = Temp; + StrPosResult = Result; + while (AddCommas) + { + if ((AddCommas % 3) == 0 && AddCommas != TempLen) // avoid stuff like ",345" + { + *StrPosResult = ','; + StrPosResult++; + } + + *StrPosResult = *StrPosOrig; + StrPosResult++; + StrPosOrig++; + + *StrPosResult = 0; + + AddCommas--; + } + + return (Result); +} + + +void PrintBanner (void) +{ + printf ("%s v%s\n", APPNAME_CLI, APPVER_STR); + printf ("%s\n", APPCOPYRIGHT); + printf ("\n"); + + return; +} + + +void FraggerHelp (void) +{ + printf ("Usage: unfrag drive: [...] <-f | -e>\n"); + printf ("\n"); + printf ("drive: : The drive to defrag. Should be two characters long, ie 'c:' or 'd:'.\n"); + printf (" Multiple drives may be given, and all will be simultaneously\n"); + printf (" defragmented using the same options.\n"); + printf ("-f : Do a fast defragmentation. Files that are not fragmented will not be\n"); + printf (" moved. Only one pass is made over the file list. Using this option\n"); + printf (" may result in not all files being defragmented, depending on\n"); + printf (" available disk space.\n"); + printf ("-e : Do an extensive defragmention. Files will be moved in an attempt to\n"); + printf (" defragment both files and free space.\n"); + + if (!CheckWinVer()) + { + printf ("\n"); + printf ("NOTE: This program requires Windows 2000, which is not presently running on\n"); + printf ("this system.\n"); + } + + return; +} + + +void __cdecl DefragThread (LPVOID parm) +{ + Defragment *Defrag; + + Defrag = (Defragment *) parm; + Defrag->Start (); + + _endthread (); + return; +} + + +Defragment *StartDefragThread (string Drive, DefragType Method, HANDLE &Handle) +{ + Defragment *Defragger; + unsigned long Thread; + + Defragger = new Defragment (Drive, Method); + //Thread = /*CreateThread*/ _beginthreadex (NULL, 0, DefragThread, Defragger, 0, &ThreadID); + Thread = _beginthread (DefragThread, 0, Defragger); + Handle = *((HANDLE *)&Thread); + return (Defragger); +} + + +// Main Initialization +int __cdecl main (int argc, char **argv) +{ + vector<string> Drives; + vector<Defragment *> Defrags; + DefragType DefragMode = DefragInvalid; + int d; + + PrintBanner (); + + // Parse command line arguments + bool ValidCmdLine = false; + for (int c = 0; c < argc; c++) + { + if (strlen(argv[c]) == 2 && argv[c][1] == ':') + { + Drives.push_back (strupr(argv[c])); + } + else + if (argv[c][0] == '-' || argv[c][0] == '/' && strlen(argv[c]) == 2) + { + switch (tolower(argv[c][1])) + { + case '?' : + case 'h' : + FraggerHelp (); + return (0); + + case 'f' : + if (DefragMode != DefragInvalid) + { + ValidCmdLine = false; + break; + } + DefragMode = DefragFast; + ValidCmdLine = true; + break; + + case 'e' : + if (DefragMode != DefragInvalid) + { + ValidCmdLine = false; + break; + } + DefragMode = DefragExtensive; + ValidCmdLine = true; + break; + + } + } + } + + if (DefragMode == DefragInvalid) + ValidCmdLine = false; + + if (!ValidCmdLine) + { + printf ("Invalid command-line options. Use '%s -?' for help.\n", argv[0]); + return (0); + } + + // Check OS requirements + if (!CheckWinVer()) + { + printf ("Fatal Error: This program requires Windows 2000.\n"); + return (0); + } + + for (d = 0; d < Drives.size (); d++) + { + HANDLE TossMe; + Defrags.push_back (StartDefragThread (Drives[d], DefragMode, TossMe)); + } + + for (d = 0; d < Drives.size () - 1; d++) + printf ("\n "); + + bool Continue = true; + HANDLE Screen; + + Screen = GetStdHandle (STD_OUTPUT_HANDLE); + while (Continue) + { + Sleep (25); + + // Get current screen coords + CONSOLE_SCREEN_BUFFER_INFO ScreenInfo; + + GetConsoleScreenBufferInfo (Screen, &ScreenInfo); + + // Now set back to the beginning + ScreenInfo.dwCursorPosition.X = 0; + ScreenInfo.dwCursorPosition.Y -= Drives.size(); + SetConsoleCursorPosition (Screen, ScreenInfo.dwCursorPosition); + + for (d = 0; d < Drives.size (); d++) + { + printf ("\n%6.2f%% %-70s", Defrags[d]->GetStatusPercent(), Defrags[d]->GetStatusString().c_str()); + } + + // Determine if we should keep going + Continue = false; + for (d = 0; d < Drives.size (); d++) + { + if (!Defrags[d]->IsDoneYet() && !Defrags[d]->HasError()) + Continue = true; + } + } + +#if 0 + // Loop through the drives list + for (int d = 0; d < Drives.size(); d++) + { + DriveVolume *Drive; + + Drive = new DriveVolume; + + // First thing: build a file list. + printf ("Opening volume %s ...", Drives[d].c_str()); + if (!Drive->Open (Drives[d])) + { + printf ("FAILED\n\n"); + delete Drive; + continue; + } + printf ("\n"); + + printf (" Getting drive bitmap ..."); + if (!Drive->GetBitmap ()) + { + printf ("FAILED\n\n"); + delete Drive; + continue; + } + printf ("\n"); + + printf (" Obtaining drive geometry ..."); + if (!Drive->ObtainInfo ()) + { + printf ("FAILED\n\n"); + delete Drive; + continue; + } + printf ("\n"); + + printf (" Building file database for drive %s ...", Drives[d].c_str()); + if (!Drive->BuildFileList ()) + { + printf ("FAILED\n\n"); + delete Drive; + continue; + } + printf ("\n"); + + printf (" %u files\n", Drive->GetDBFileCount ()); + + // Analyze only? + if (DefragMode == DefragAnalyze) + { + uint64 UsedBytes = 0; // total bytes used, with cluster size considerations + uint64 TotalBytes = 0; // total bytes used + uint64 SlackBytes = 0; // wasted space due to slack + uint32 Fragged = 0; // fragmented files + + printf (" Analyzing ..."); + if (VerboseMode) + printf ("\n"); + + for (int i = 0; i < Drive->GetDBFileCount(); i++) + { + uint64 Used; + uint64 Slack; + FileInfo Info; + + Info = Drive->GetDBFile (i); + + // Compute total used disk space + Used = ((Info.Size + Drive->GetClusterSize() - 1) / Drive->GetClusterSize()) * Drive->GetClusterSize(); + Slack = Used - Info.Size; + + UsedBytes += Used; + SlackBytes += Slack; + TotalBytes += Info.Size; + + if (VerboseMode) + { + printf (" %s%s, ", Drive->GetDBDir (Info.DirIndice).c_str(), Info.Name.c_str()); + + if (Info.Attributes.AccessDenied) + printf ("access was denied\n"); + else + { + if (Info.Attributes.Unmovable == 1) + printf ("unmovable, "); + + printf ("%I64u bytes, %I64u bytes on disk, %I64u bytes slack, %u fragments\n", + Info.Size, Used, Slack, Info.Fragments.size()); + } + } + + if (Info.Fragments.size() > 1) + Fragged++; + } + + if (!VerboseMode) + printf ("\n"); + + // TODO: Make it not look like ass + printf ("\n"); + printf (" Overall Analysis\n"); + printf (" ----------------\n"); + printf (" %u clusters\n", Drive->GetClusterCount ()); + printf (" %u bytes per cluster\n", Drive->GetClusterSize()); + printf (" %I64u total bytes on drive\n", (uint64)Drive->GetClusterCount() * (uint64)Drive->GetClusterSize()); + printf ("\n"); + printf (" %u files\n", Drive->GetDBFileCount ()); + printf (" %u contiguous files\n", Drive->GetDBFileCount () - Fragged); + printf (" %u fragmented files\n", Fragged); + printf ("\n"); + printf (" %I64u bytes\n", TotalBytes); + printf (" %I64u bytes on disk\n", UsedBytes); + printf (" %I64u bytes slack\n", SlackBytes); + } + + // Fast defragment! + if (DefragMode == DefragFast || DefragMode == DefragExtensive) + { + uint32 i; + uint64 FirstFreeLCN; + char PrintName[80]; + int Width = 66; + + if (DefragMode == DefragFast) + printf (" Performing fast file defragmentation ...\n"); + else + if (DefragMode == DefragExtensive) + printf (" Performing extensive file defragmentation\n"); + + // Find first free LCN for speedier searches ... + Drive->FindFreeRange (0, 1, FirstFreeLCN); + + for (i = 0; i < Drive->GetDBFileCount(); i++) + { + FileInfo Info; + bool Result; + uint64 TargetLCN; + + printf ("\r"); + + Info = Drive->GetDBFile (i); + + FitName (PrintName, Drive->GetDBDir (Info.DirIndice).c_str(), Info.Name.c_str(), Width); + printf (" %6.2f%% %-66s", (float)i / (float)Drive->GetDBFileCount() * 100.0f, PrintName); + + // Can't defrag 0 byte files :) + if (Info.Fragments.size() == 0) + continue; + + // If doing fast defrag, skip non-fragmented files + if (Info.Fragments.size() == 1 && DefragMode == DefragFast) + continue; + + // Find a place that can fit the file + Result = Drive->FindFreeRange (FirstFreeLCN, Info.Clusters, TargetLCN); + + // If we're doing an extensive defrag and the file is already defragmented + // and if its new location would be after its current location, don't + // move it. + if (DefragMode == DefragExtensive && Info.Fragments.size() == 1) + { + if (TargetLCN > Info.Fragments[0].StartLCN) + continue; + } + + // Otherwise, defrag0rize it! + if (Result) + { + bool Success = false; + + if (Drive->MoveFileDumb (i, TargetLCN)) + Success = true; + else + { // hmm, look for another area to move it to + Result = Drive->FindFreeRange (TargetLCN + 1, Info.Clusters, TargetLCN); + if (Result) + { + if (Drive->MoveFileDumb (i, TargetLCN)) + Success = true; + else + { // Try updating the drive bitmap + if (Drive->GetBitmap ()) + { + Result = Drive->FindFreeRange (0, Info.Clusters, TargetLCN); + if (Result) + { + if (Drive->MoveFileDumb (i, TargetLCN)) + Success = true; + } + } + } + } + } + + if (!Success) + printf ("\n -> failed\n"); + + Drive->FindFreeRange (0, 1, FirstFreeLCN); + } + } + + printf ("\n"); + } + printf ("Closing volume %s ...", Drives[d].c_str()); + delete Drive; + printf ("\n"); + } +#endif + + return (0); +} Added: trunk/rosapps/fraginator/Unfrag.h URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/Unfrag.h?rev=214…
============================================================================== --- trunk/rosapps/fraginator/Unfrag.h (added) +++ trunk/rosapps/fraginator/Unfrag.h Thu Mar 30 04:09:09 2006 @@ -1,0 +1,83 @@ +/***************************************************************************** + + Unfrag + +*****************************************************************************/ + + +#ifndef UNFRAG_H +#define UNFRAG_H + + +// Blah blah blah your template name is too long ... SO WHAT +#pragma warning (disable: 4786) + + +// I forget what this disables +#ifdef __ICL +#pragma warning (disable: 268) +#endif + + +// Hello Mr. Platform SDK, please let us use Windows 2000 only features +#ifndef WINVER +#define WINVER 0x0500 +#define _WIN32_WINNT 0x0500 +#endif + + +#include <windows.h> +#include <string> +#include <stdio.h> +#include <stdlib.h> + + +#define APPNAME_CLI "Unfrag" +#define APPNAME_GUI "Fraginator" +#define APPVER_STR "1.03" +#define APPVER_NUM 1.03f +#define APPAUTHOR "Rick Brewster" +#define APPCOPYRIGHT "Copyright 2000-2002 Rick Brewster" + + +#include <vector> +#include <string> +using namespace std; + + +typedef unsigned __int8 uint8; +typedef signed __int8 sint8; +typedef unsigned __int16 uint16; +typedef signed __int16 sint16; +typedef unsigned __int32 uint32; +typedef signed __int32 sint32; +typedef unsigned __int64 uint64; +typedef signed __int64 sint64; +typedef unsigned char uchar; + + +extern bool QuietMode; +extern bool VerboseMode; + + +typedef enum +{ + DefragInvalid, + DefragFast, + DefragExtensive, + DefragAnalyze +} DefragType; + + +extern bool CheckWinVer (void); + + +class Defragment; +extern Defragment *StartDefragThread (string Drive, DefragType Method, HANDLE &Handle); + + +extern char *AddCommas (char *Result, uint64 Number); + + +#endif // UNFRAG_H + Added: trunk/rosapps/fraginator/default1.bin URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/default1.bin?rev…
============================================================================== --- trunk/rosapps/fraginator/default1.bin (added) +++ trunk/rosapps/fraginator/default1.bin Thu Mar 30 04:09:09 2006 @@ -1,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly + xmlns="urn:schemas-microsoft-com:asm.v1" + manifestVersion="1.0"> +<assemblyIdentity + processorArchitecture="x86" + version="5.1.0.0" + type="win32" + name="Fraginator.exe"/> + <description>Fraginator</description> + <dependency> + <dependentAssembly> + <assemblyIdentity + type="win32" + name="Microsoft.Windows.Common-Controls" + version="6.0.0.0" + publicKeyToken="6595b64144ccf1df" + language="*" + processorArchitecture="x86"/> + </dependentAssembly> + </dependency> +</assembly> Added: trunk/rosapps/fraginator/icon1.ico URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/icon1.ico?rev=21…
============================================================================== Binary file - no diff available. Propchange: trunk/rosapps/fraginator/icon1.ico ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/rosapps/fraginator/resource.h URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/resource.h?rev=2…
============================================================================== --- trunk/rosapps/fraginator/resource.h (added) +++ trunk/rosapps/fraginator/resource.h Thu Mar 30 04:09:09 2006 @@ -1,0 +1,51 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by Fraginator.rc +// +#define IDD_DIALOG1 101 +#define IDD_MAIN 101 +#define IDD_REPORT 106 +#define IDB_LOGO 110 +#define IDI_ICON 114 +#define IDC_QUIT 1010 +#define IDC_STARTSTOP 1014 +#define IDC_METHODS_LIST 1016 +#define IDC_DRIVES_LIST 1019 +#define IDC_PROGRESS 1021 +#define IDC_PERCENT 1022 +#define IDC_STATUS 1023 +#define IDC_DISKSIZEBYTES 1027 +#define IDC_DRIVELETTER 1028 +#define IDC_REPORTOK 1029 +#define IDC_DISKSIZECLUSTERS 1030 +#define IDC_DISKCLUSTERSIZE 1031 +#define IDC_FILESYSTEM 1032 +#define IDC_WISECRACKS 1033 +#define IDC_VOLUMELABEL 1033 +#define IDC_VOLUMESERIAL 1034 +#define IDC_BYTES 1035 +#define IDC_KILOBYTES 1036 +#define IDC_RECOMMEND 1037 +#define IDC_FILESCOUNT 1038 +#define IDC_FILESSIZEBYTES 1039 +#define IDC_FILESSIZEONDISK 1040 +#define IDC_FILESSLACKBYTES 1041 +#define IDC_GIGABYTES 1043 +#define IDC_DISKFREEBYTES 1044 +#define IDC_MEGABYTES 1045 +#define IDC_FILESFRAGGED 1047 +#define IDC_DIRSCOUNT 1048 +#define IDC_AVERAGEFRAGS 1049 +#define ID_MAIN_HELP 1054 +#define IDC_PRIORITY_LIST 1057 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 118 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1058 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif Added: trunk/rosapps/fraginator/unfrag.dsp URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/unfrag.dsp?rev=2…
============================================================================== --- trunk/rosapps/fraginator/unfrag.dsp (added) +++ trunk/rosapps/fraginator/unfrag.dsp Thu Mar 30 04:09:09 2006 @@ -1,0 +1,133 @@ +# Microsoft Developer Studio Project File - Name="unfrag" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=unfrag - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "unfrag.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "unfrag.mak" CFG="unfrag - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "unfrag - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "unfrag - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=xicl6.exe +RSC=rc.exe + +!IF "$(CFG)" == "unfrag - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /G6 /Gr /MD /W3 /GX /Ox /Ot /Og /Oi /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Desc=Copying to Program Files ... +PostBuild_Cmds=copy Release\unfrag.exe "c:\Program Files\Fraginator\unfrag.exe" +# End Special Build Tool + +!ELSEIF "$(CFG)" == "unfrag - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "unfrag___Win32_Debug" +# PROP BASE Intermediate_Dir "unfrag___Win32_Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "unfrag___Win32_Debug" +# PROP Intermediate_Dir "unfrag___Win32_Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "unfrag - Win32 Release" +# Name "unfrag - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\Defragment.cpp +# End Source File +# Begin Source File + +SOURCE=.\DriveVolume.cpp +# End Source File +# Begin Source File + +SOURCE=.\Unfrag.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\Defragment.h +# End Source File +# Begin Source File + +SOURCE=.\DriveVolume.h +# End Source File +# Begin Source File + +SOURCE=.\Mutex.h +# End Source File +# Begin Source File + +SOURCE=.\Unfrag.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project Added: trunk/rosapps/fraginator/unfrag.exe URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/unfrag.exe?rev=2…
============================================================================== Binary file - no diff available. Propchange: trunk/rosapps/fraginator/unfrag.exe ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/rosapps/fraginator/unfrag.mak URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/unfrag.mak?rev=2…
============================================================================== --- trunk/rosapps/fraginator/unfrag.mak (added) +++ trunk/rosapps/fraginator/unfrag.mak Thu Mar 30 04:09:09 2006 @@ -1,0 +1,184 @@ +# Microsoft Developer Studio Generated NMAKE File, Based on unfrag.dsp +!IF "$(CFG)" == "" +CFG=unfrag - Win32 Debug +!MESSAGE No configuration specified. Defaulting to unfrag - Win32 Debug. +!ENDIF + +!IF "$(CFG)" != "unfrag - Win32 Release" && "$(CFG)" != "unfrag - Win32 Debug" +!MESSAGE Invalid configuration "$(CFG)" specified. +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "unfrag.mak" CFG="unfrag - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "unfrag - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "unfrag - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE +!ERROR An invalid configuration is specified. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF + +CPP=xicl6.exe +RSC=rc.exe + +!IF "$(CFG)" == "unfrag - Win32 Release" + +OUTDIR=.\Release +INTDIR=.\Release +# Begin Custom Macros +OutDir=.\Release +# End Custom Macros + +ALL : "$(OUTDIR)\unfrag.exe" + + +CLEAN : + -@erase "$(INTDIR)\Defragment.obj" + -@erase "$(INTDIR)\DriveVolume.obj" + -@erase "$(INTDIR)\Unfrag.obj" + -@erase "$(INTDIR)\vc60.idb" + -@erase "$(OUTDIR)\unfrag.exe" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +CPP_PROJ=/nologo /G6 /Gr /MD /W3 /GX /Ox /Ot /Og /Oi /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\unfrag.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\unfrag.bsc" +BSC32_SBRS= \ + +LINK32=xilink6.exe +LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\unfrag.pdb" /machine:I386 /out:"$(OUTDIR)\unfrag.exe" +LINK32_OBJS= \ + "$(INTDIR)\Defragment.obj" \ + "$(INTDIR)\DriveVolume.obj" \ + "$(INTDIR)\Unfrag.obj" + +"$(OUTDIR)\unfrag.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +SOURCE="$(InputPath)" +PostBuild_Desc=Copying to Program Files ... +DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep + +ALL : $(DS_POSTBUILD_DEP) + +# Begin Custom Macros +OutDir=.\Release +# End Custom Macros + +$(DS_POSTBUILD_DEP) : "$(OUTDIR)\unfrag.exe" + copy Release\unfrag.exe "c:\Program Files\Fraginator\unfrag.exe" + echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)" + +!ELSEIF "$(CFG)" == "unfrag - Win32 Debug" + +OUTDIR=.\unfrag___Win32_Debug +INTDIR=.\unfrag___Win32_Debug +# Begin Custom Macros +OutDir=.\unfrag___Win32_Debug +# End Custom Macros + +ALL : "$(OUTDIR)\unfrag.exe" + + +CLEAN : + -@erase "$(INTDIR)\Defragment.obj" + -@erase "$(INTDIR)\DriveVolume.obj" + -@erase "$(INTDIR)\Unfrag.obj" + -@erase "$(INTDIR)\vc60.idb" + -@erase "$(INTDIR)\vc60.pdb" + -@erase "$(OUTDIR)\unfrag.exe" + -@erase "$(OUTDIR)\unfrag.ilk" + -@erase "$(OUTDIR)\unfrag.pdb" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +CPP_PROJ=/nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\unfrag.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\unfrag.bsc" +BSC32_SBRS= \ + +LINK32=xilink6.exe +LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"$(OUTDIR)\unfrag.pdb" /debug /machine:I386 /out:"$(OUTDIR)\unfrag.exe" /pdbtype:sept +LINK32_OBJS= \ + "$(INTDIR)\Defragment.obj" \ + "$(INTDIR)\DriveVolume.obj" \ + "$(INTDIR)\Unfrag.obj" + +"$(OUTDIR)\unfrag.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ENDIF + +.c{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.c{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + + +!IF "$(NO_EXTERNAL_DEPS)" != "1" +!IF EXISTS("unfrag.dep") +!INCLUDE "unfrag.dep" +!ELSE +!MESSAGE Warning: cannot find "unfrag.dep" +!ENDIF +!ENDIF + + +!IF "$(CFG)" == "unfrag - Win32 Release" || "$(CFG)" == "unfrag - Win32 Debug" +SOURCE=.\Defragment.cpp + +"$(INTDIR)\Defragment.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\DriveVolume.cpp + +"$(INTDIR)\DriveVolume.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\Unfrag.cpp + +"$(INTDIR)\Unfrag.obj" : $(SOURCE) "$(INTDIR)" + + + +!ENDIF + Added: trunk/rosapps/fraginator/unfrag.plg URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/unfrag.plg?rev=2…
============================================================================== --- trunk/rosapps/fraginator/unfrag.plg (added) +++ trunk/rosapps/fraginator/unfrag.plg Thu Mar 30 04:09:09 2006 @@ -1,0 +1,48 @@ +<html> +<body> +<pre> +<h1>Build Log</h1> +<h3> +--------------------Configuration: unfrag - Win32 Release-------------------- +</h3> +<h3>Command Lines</h3> +Creating temporary file "C:\TEMP\RSP9D8.tmp" with contents +[ +/nologo /G6 /Gr /MD /W3 /GX /Ox /Ot /Og /Oi /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fo"Release/" /Fd"Release/" /FD /c +"C:\src\Fraginator\Defragment.cpp" +"C:\src\Fraginator\DriveVolume.cpp" +"C:\src\Fraginator\Unfrag.cpp" +] +Creating command line "xicl6.exe @C:\TEMP\RSP9D8.tmp" +Creating temporary file "C:\TEMP\RSP9D9.tmp" with contents +[ +kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"Release/unfrag.pdb" /machine:I386 /out:"Release/unfrag.exe" +.\Release\Defragment.obj +.\Release\DriveVolume.obj +.\Release\Unfrag.obj +] +Creating command line "xilink6.exe @C:\TEMP\RSP9D9.tmp" +<h3>Output Window</h3> +Compiling... +Defragment.cpp +DriveVolume.cpp +Unfrag.cpp +Generating Code... +Linking... +xilink6: executing 'C:\PROGRA~1\MIAF9D~1\VC98\Bin\link.exe' +Creating temporary file "C:\TEMP\RSP9DB.bat" with contents +[ +@echo off +copy Release\unfrag.exe "c:\Program Files\Fraginator\unfrag.exe" +] +Creating command line "C:\TEMP\RSP9DB.bat" +Copying to Program Files ... + 1 file(s) copied. + + + +<h3>Results</h3> +unfrag.exe - 0 error(s), 0 warning(s) +</pre> +</body> +</html> Added: trunk/rosapps/fraginator/unfrag.vcproj URL:
http://svn.reactos.ru/svn/reactos/trunk/rosapps/fraginator/unfrag.vcproj?re…
============================================================================== --- trunk/rosapps/fraginator/unfrag.vcproj (added) +++ trunk/rosapps/fraginator/unfrag.vcproj Thu Mar 30 04:09:09 2006 @@ -1,0 +1,160 @@ +<?xml version="1.0" encoding = "Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="7.00" + Name="unfrag" + SccProjectName="" + SccLocalPath=""> + <Platforms> + <Platform + Name="Win32"/> + </Platforms> + <Configurations> + <Configuration + Name="Release|Win32" + OutputDirectory=".\Release" + IntermediateDirectory=".\Release" + ConfigurationType="1" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="FALSE" + CharacterSet="2"> + <Tool + Name="VCCLCompilerTool" + Optimization="3" + GlobalOptimizations="TRUE" + InlineFunctionExpansion="2" + EnableIntrinsicFunctions="TRUE" + FavorSizeOrSpeed="1" + OptimizeForProcessor="2" + PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE" + RuntimeLibrary="0" + StructMemberAlignment="5" + BufferSecurityCheck="FALSE" + PrecompiledHeaderFile=".\Release/unfrag.pch" + AssemblerListingLocation=".\Release/" + ObjectFile=".\Release/" + ProgramDataBaseFileName=".\Release/" + WarningLevel="3" + SuppressStartupBanner="TRUE" + CallingConvention="1"/> + <Tool + Name="VCCustomBuildTool"/> + <Tool + Name="VCLinkerTool" + AdditionalOptions="/MACHINE:I386" + AdditionalDependencies="odbc32.lib odbccp32.lib" + OutputFile=".\Release/unfrag.exe" + LinkIncremental="1" + SuppressStartupBanner="TRUE" + ProgramDatabaseFile=".\Release/unfrag.pdb" + SubSystem="1"/> + <Tool + Name="VCMIDLTool" + TypeLibraryName=".\Release/unfrag.tlb"/> + <Tool + Name="VCPostBuildEventTool" + Description="Copying to Program Files ..." + CommandLine="copy Release\unfrag.exe "c:\Program Files\Fraginator\unfrag.exe""/> + <Tool + Name="VCPreBuildEventTool"/> + <Tool + Name="VCPreLinkEventTool"/> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1033"/> + <Tool + Name="VCWebServiceProxyGeneratorTool"/> + <Tool + Name="VCWebDeploymentTool"/> + </Configuration> + <Configuration + Name="Debug|Win32" + OutputDirectory=".\unfrag___Win32_Debug" + IntermediateDirectory=".\unfrag___Win32_Debug" + ConfigurationType="1" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="FALSE" + CharacterSet="2"> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="WIN32,_DEBUG,_CONSOLE" + BasicRuntimeChecks="3" + RuntimeLibrary="1" + PrecompiledHeaderFile=".\unfrag___Win32_Debug/unfrag.pch" + AssemblerListingLocation=".\unfrag___Win32_Debug/" + ObjectFile=".\unfrag___Win32_Debug/" + ProgramDataBaseFileName=".\unfrag___Win32_Debug/" + WarningLevel="3" + SuppressStartupBanner="TRUE" + DebugInformationFormat="4"/> + <Tool + Name="VCCustomBuildTool"/> + <Tool + Name="VCLinkerTool" + AdditionalOptions="/MACHINE:I386" + AdditionalDependencies="odbc32.lib odbccp32.lib" + OutputFile=".\unfrag___Win32_Debug/unfrag.exe" + LinkIncremental="2" + SuppressStartupBanner="TRUE" + GenerateDebugInformation="TRUE" + ProgramDatabaseFile=".\unfrag___Win32_Debug/unfrag.pdb" + SubSystem="1"/> + <Tool + Name="VCMIDLTool" + TypeLibraryName=".\unfrag___Win32_Debug/unfrag.tlb"/> + <Tool + Name="VCPostBuildEventTool"/> + <Tool + Name="VCPreBuildEventTool"/> + <Tool + Name="VCPreLinkEventTool"/> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1033"/> + <Tool + Name="VCWebServiceProxyGeneratorTool"/> + <Tool + Name="VCWebDeploymentTool"/> + </Configuration> + </Configurations> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> + <File + RelativePath=".\Defragment.cpp"> + </File> + <File + RelativePath=".\DriveVolume.cpp"> + </File> + <File + RelativePath=".\Unfrag.cpp"> + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl"> + <File + RelativePath=".\Defragment.h"> + </File> + <File + RelativePath=".\DriveVolume.h"> + </File> + <File + RelativePath=".\Mutex.h"> + </File> + <File + RelativePath=".\Unfrag.h"> + </File> + </Filter> + <Filter + Name="Resource Files" + Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject>
19 years
1
0
0
0
[tretiakov] 21410: Forget to update rpcrt4.spec
by aleksey@studiocerebral.com
Author: tretiakov Date: Wed Mar 29 23:15:29 2006 New Revision: 21410 URL:
http://svn.reactos.ru/svn/reactos?rev=21410&view=rev
Log: Forget to update rpcrt4.spec Modified: trunk/reactos/dll/win32/rpcrt4/rpcrt4.spec Modified: trunk/reactos/dll/win32/rpcrt4/rpcrt4.spec URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpcrt4.spe…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpcrt4.spec (original) +++ trunk/reactos/dll/win32/rpcrt4/rpcrt4.spec Wed Mar 29 23:15:29 2006 @@ -138,7 +138,7 @@ @ stub MqGetContext # win9x @ stub MqRegisterQueue # win9x @ stdcall NDRCContextBinding(ptr) -@ stub NDRCContextMarshall +@ stdcall NDRCContextMarshall(ptr ptr) @ stub NDRCContextUnmarshall @ stub NDRSContextMarshall2 @ stub NDRSContextMarshall
19 years
1
0
0
0
[tretiakov] 21409: Implement NdrCContextMarshall()
by aleksey@studiocerebral.com
Author: tretiakov Date: Wed Mar 29 23:09:43 2006 New Revision: 21409 URL:
http://svn.reactos.ru/svn/reactos?rev=21409&view=rev
Log: Implement NdrCContextMarshall() Modified: trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c Modified: trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/rpcrt4/ndr_marsha…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c (original) +++ trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c Wed Mar 29 23:09:43 2006 @@ -3231,6 +3231,15 @@ } /*********************************************************************** + * NDRCContextMarshall + */ +void WINAPI NDRCContextMarshall(IN NDR_CCONTEXT CContext, OUT void *pBuff ) +{ + CContextHandle *ctx = (CContextHandle*)CContext; + memcpy(pBuff, ctx->Ndr, sizeof(ctx->Ndr)); +} + +/*********************************************************************** * NdrClientContextMarshall */ void WINAPI NdrClientContextMarshall(PMIDL_STUB_MESSAGE pStubMsg,
19 years
1
0
0
0
[tretiakov] 21408: Implement NDRCContextBinding()
by aleksey@studiocerebral.com
Author: tretiakov Date: Wed Mar 29 22:11:19 2006 New Revision: 21408 URL:
http://svn.reactos.ru/svn/reactos?rev=21408&view=rev
Log: Implement NDRCContextBinding() Modified: trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c trunk/reactos/dll/win32/rpcrt4/rpc_binding.c trunk/reactos/dll/win32/rpcrt4/rpc_binding.h Modified: trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/rpcrt4/ndr_marsha…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c (original) +++ trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c Wed Mar 29 22:11:19 2006 @@ -40,6 +40,8 @@ #include "wine/rpcfc.h" #include "wine/debug.h" + +#include "rpc_binding.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); @@ -3292,6 +3294,6 @@ RPC_BINDING_HANDLE WINAPI NDRCContextBinding(NDR_CCONTEXT CContext) { - FIXME("(%p): stub\n", CContext); - return NULL; -} + + return (RPC_BINDING_HANDLE)((CContextHandle*)CContext)->Binding; +} Modified: trunk/reactos/dll/win32/rpcrt4/rpc_binding.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_bindin…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpc_binding.c (original) +++ trunk/reactos/dll/win32/rpcrt4/rpc_binding.c Wed Mar 29 22:11:19 2006 @@ -619,7 +619,7 @@ memcpy(DestBinding, SrcBinding, sizeof(RpcBinding)); DestBinding->refs = 1; - DestBinding->Next = NULL; + DestBinding->Next = NULL; // FIXME: ? DestBinding->server = FALSE; DestBinding->Protseq = RPCRT4_strndupA(SrcBinding->Protseq, -1); DestBinding->NetworkAddr = RPCRT4_strndupA(SrcBinding->NetworkAddr, -1); Modified: trunk/reactos/dll/win32/rpcrt4/rpc_binding.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_bindin…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpc_binding.h (original) +++ trunk/reactos/dll/win32/rpcrt4/rpc_binding.h Wed Mar 29 22:11:19 2006 @@ -53,6 +53,13 @@ RpcConnection* FromConn; } RpcBinding; + +typedef struct _CContextHandle +{ + RpcBinding *Binding; + BYTE Ndr[20]; +} CContextHandle; + LPSTR RPCRT4_strndupA(LPCSTR src, INT len); LPWSTR RPCRT4_strndupW(LPWSTR src, INT len); LPSTR RPCRT4_strdupWtoA(LPWSTR src);
19 years
1
0
0
0
[tretiakov] 21407: Test application for demonstration of how undocumented context handle function work.
by aleksey@studiocerebral.com
Author: tretiakov Date: Wed Mar 29 21:42:29 2006 New Revision: 21407 URL:
http://svn.reactos.ru/svn/reactos?rev=21407&view=rev
Log: Test application for demonstration of how undocumented context handle function work. Added: trunk/reactos/base/applications/testsets/rpcrt4/ trunk/reactos/base/applications/testsets/rpcrt4/context_handles/ trunk/reactos/base/applications/testsets/rpcrt4/context_handles/client.c trunk/reactos/base/applications/testsets/rpcrt4/context_handles/ctx.acf trunk/reactos/base/applications/testsets/rpcrt4/context_handles/ctx.h trunk/reactos/base/applications/testsets/rpcrt4/context_handles/ctx.idl trunk/reactos/base/applications/testsets/rpcrt4/context_handles/ctx_c.c trunk/reactos/base/applications/testsets/rpcrt4/context_handles/ctx_s.c trunk/reactos/base/applications/testsets/rpcrt4/context_handles/server.c Added: trunk/reactos/base/applications/testsets/rpcrt4/context_handles/client.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/testsets/…
============================================================================== --- trunk/reactos/base/applications/testsets/rpcrt4/context_handles/client.c (added) +++ trunk/reactos/base/applications/testsets/rpcrt4/context_handles/client.c Wed Mar 29 21:42:29 2006 @@ -1,0 +1,297 @@ +#include <stdlib.h> +#include <stdio.h> +#include <ctype.h> +#include "ctx.h" + +#define TYPE_FORMAT_STRING_SIZE 23 +#define PROC_FORMAT_STRING_SIZE 21 +#define TRANSMIT_AS_TABLE_SIZE 0 +#define WIRE_MARSHAL_TABLE_SIZE 0 + +typedef struct _MIDL_TYPE_FORMAT_STRING + { + short Pad; + unsigned char Format[ TYPE_FORMAT_STRING_SIZE ]; + } MIDL_TYPE_FORMAT_STRING; + +typedef struct _MIDL_PROC_FORMAT_STRING + { + short Pad; + unsigned char Format[ PROC_FORMAT_STRING_SIZE ]; +} MIDL_PROC_FORMAT_STRING; + +extern const MIDL_STUB_DESC hello_StubDesc; +extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString; +//extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString;*/ + +/***************************************************************** + * Modified from midl-generated stubs * + *****************************************************************/ + + +void m_CtxOpen( + /* [out] */ PCTXTYPE __RPC_FAR *pphContext, + /* [in] */ long Value) +{ + RPC_BINDING_HANDLE _Handle = 0; + + RPC_MESSAGE _RpcMessage; + + MIDL_STUB_MESSAGE _StubMsg; + + char *ctx, *buf; + int i; + + printf("\n*******************************************************************\n"); + printf("**** CtxOpen() ***\n"); + printf("*******************************************************************\n\n"); + + if(!pphContext) + { + RpcRaiseException(RPC_X_NULL_REF_POINTER); + } + RpcTryFinally + { + NdrClientInitializeNew( + ( PRPC_MESSAGE )&_RpcMessage, + ( PMIDL_STUB_MESSAGE )&_StubMsg, + ( PMIDL_STUB_DESC )&hello_StubDesc, + 0); + + + _Handle = hBinding; + + + _StubMsg.BufferLength = 4U; + NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle ); + + *(( long __RPC_FAR * )_StubMsg.Buffer)++ = Value; + + NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer ); + + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) + NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] ); + + + printf("Before NdrClientContextUnmarshall: Buflen=%d\nBuffer: ", _StubMsg.RpcMsg->BufferLength); + for(buf = _StubMsg.Buffer, i = 0; i < _StubMsg.RpcMsg->BufferLength; i++) + printf("0x%x, ", buf[i] & 0x0FF); + printf("\n\n"); + + *pphContext = (void *)0; + NdrClientContextUnmarshall( + ( PMIDL_STUB_MESSAGE )&_StubMsg, + ( NDR_CCONTEXT __RPC_FAR * )pphContext, + _Handle); + + ctx = (char*)*pphContext; + printf("\nNdrClientContextUnmarshall returned: handle=0x%p\n", ctx); + printf("00: 0x%x <- obviously pointer to binding handle copyed from _Handle\n", *((int*)ctx)); + ctx+=4; + printf("04: 0x%x <- unknown field\n", *((int*)ctx)); + printf("08: "); + + for(ctx+=4, i = 0; i < 20; i++) + printf("0x%x,", *(ctx+i) & 0x0FF); printf(" <- ndr 20 bytes\n\n"); + + printf("Buflen=%d, Buffer: ", _StubMsg.BufferLength); + for(buf = _StubMsg.BufferStart; buf < _StubMsg.BufferEnd; buf++) + printf("0x%x,", *buf & 0x0FF); + printf("\n"); + + + } + RpcFinally + { + NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg ); + + } + RpcEndFinally + +} + + +void m_CtxHello( + /* [in] */ PCTXTYPE phContext) +{ + + RPC_BINDING_HANDLE _Handle = 0; + + RPC_MESSAGE _RpcMessage; + + MIDL_STUB_MESSAGE _StubMsg; + + char *buf; + int i; + + printf("\n*******************************************************************\n"); + printf("**** CtxHello() ***\n"); + printf("*******************************************************************\n\n"); + + RpcTryFinally + { + NdrClientInitializeNew( + ( PRPC_MESSAGE )&_RpcMessage, + ( PMIDL_STUB_MESSAGE )&_StubMsg, + ( PMIDL_STUB_DESC )&hello_StubDesc, + 1); + + + if(phContext != 0) + { + _Handle = NDRCContextBinding(( NDR_CCONTEXT )phContext);; + + } + else + { + RpcRaiseException(RPC_X_SS_IN_NULL_CONTEXT); + } + + _StubMsg.BufferLength = 20U; + NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle ); + + NdrClientContextMarshall( + ( PMIDL_STUB_MESSAGE )&_StubMsg, + ( NDR_CCONTEXT )phContext, + 1); + printf("After NdrClientContextMarshall: Buflen=%d\nBuffer: ", _StubMsg.BufferLength ); + for(buf = _StubMsg.Buffer, i = 0; i < _StubMsg.BufferLength; i++) + printf("0x%x, ", buf[i] & 0x0FF); + printf("\n\n"); + + NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer ); + + } + RpcFinally + { + NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg ); + + } + RpcEndFinally + +} + + +void m_CtxClose( + /* [out][in] */ PCTXTYPE __RPC_FAR *pphContext) +{ + + RPC_BINDING_HANDLE _Handle = 0; + + RPC_MESSAGE _RpcMessage; + + MIDL_STUB_MESSAGE _StubMsg; + char *buf; + int i; + + printf("\n*******************************************************************\n"); + printf("**** CtxClose() ***\n"); + printf("*******************************************************************\n\n"); + + if(!pphContext) + { + RpcRaiseException(RPC_X_NULL_REF_POINTER); + } + RpcTryFinally + { + NdrClientInitializeNew( + ( PRPC_MESSAGE )&_RpcMessage, + ( PMIDL_STUB_MESSAGE )&_StubMsg, + ( PMIDL_STUB_DESC )&hello_StubDesc, + 2); + + + if(*pphContext != 0) + { + _Handle = NDRCContextBinding(( NDR_CCONTEXT )*pphContext);; + + } + + _StubMsg.BufferLength = 20U; + NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle ); + + NdrClientContextMarshall( + ( PMIDL_STUB_MESSAGE )&_StubMsg, + ( NDR_CCONTEXT )*pphContext, + 0); + + NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer ); + + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) + NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[14] ); + + + printf("Before NdrClientContextUnmarshall: Buflen=%d\nBuffer: ", _StubMsg.BufferLength ); + for(buf = _StubMsg.Buffer, i = 0; i < _StubMsg.BufferLength; i++) + printf("0x%x, ", buf[i] & 0x0FF); + printf("\n\n"); + + NdrClientContextUnmarshall( + ( PMIDL_STUB_MESSAGE )&_StubMsg, + ( NDR_CCONTEXT __RPC_FAR * )pphContext, + _Handle); + + + printf("\nNdrClientContextUnmarshall returned: handle=0x%p\n", *pphContext); + + + } + RpcFinally + { + NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg ); + + } + RpcEndFinally + +} + +void main() +{ + RPC_STATUS status; + unsigned long ulCode; + PCTXTYPE hContext; + char *pszStringBinding = NULL; + + status = RpcStringBindingCompose(NULL, + "ncacn_np", + NULL, + "\\pipe\\hello", + NULL, + &pszStringBinding); + + if (status) + { + printf("RpcStringBindingCompose %x\n", status); + exit(status); + } + + status = RpcBindingFromStringBinding(pszStringBinding, &hBinding); + + if (status) + { + printf("RpcBindingFromStringBinding %x\n", status); + exit(status); + } + + RpcStringFree(&pszStringBinding); + + m_CtxOpen(&hContext, 31337); + RpcBindingFree(&hBinding); + + m_CtxHello(hContext); + + m_CtxClose(&hContext); + + +} + + +void __RPC_FAR * __RPC_USER midl_user_allocate(size_t len) +{ + return(malloc(len)); +} + +void __RPC_USER midl_user_free(void __RPC_FAR * ptr) +{ + free(ptr); +} Added: trunk/reactos/base/applications/testsets/rpcrt4/context_handles/ctx.acf URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/testsets/…
============================================================================== --- trunk/reactos/base/applications/testsets/rpcrt4/context_handles/ctx.acf (added) +++ trunk/reactos/base/applications/testsets/rpcrt4/context_handles/ctx.acf Wed Mar 29 21:42:29 2006 @@ -1,0 +1,8 @@ +//file hello.idl +[ + implicit_handle(handle_t hBinding) +] +interface hello +{ + +} Added: trunk/reactos/base/applications/testsets/rpcrt4/context_handles/ctx.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/testsets/…
============================================================================== --- trunk/reactos/base/applications/testsets/rpcrt4/context_handles/ctx.h (added) +++ trunk/reactos/base/applications/testsets/rpcrt4/context_handles/ctx.h Wed Mar 29 21:42:29 2006 @@ -1,0 +1,80 @@ + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 5.03.0280 */ +/* at Fri Mar 24 18:32:16 2006 + */ +/* Compiler settings for ctx.idl: + Os (OptLev=s), W1, Zp8, env=Win32 (32b run), ms_ext, c_ext + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +//@@MIDL_FILE_HEADING( ) + + +/* verify that the <rpcndr.h> version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 440 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __ctx_h__ +#define __ctx_h__ + +/* Forward Declarations */ + +#ifdef __cplusplus +extern "C"{ +#endif + +void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t); +void __RPC_USER MIDL_user_free( void __RPC_FAR * ); + +#ifndef __hello_INTERFACE_DEFINED__ +#define __hello_INTERFACE_DEFINED__ + +/* interface hello */ +/* [implicit_handle][version][uuid] */ + +typedef long CTXTYPE; + +typedef /* [context_handle] */ CTXTYPE __RPC_FAR *PCTXTYPE; + +void CtxOpen( + /* [out] */ PCTXTYPE __RPC_FAR *pphContext, + /* [in] */ long Value); + +void CtxHello( + /* [in] */ PCTXTYPE phContext); + +void CtxClose( + /* [out][in] */ PCTXTYPE __RPC_FAR *pphContext); + + +extern handle_t hBinding; + + +extern RPC_IF_HANDLE hello_v1_0_c_ifspec; +extern RPC_IF_HANDLE hello_v1_0_s_ifspec; +#endif /* __hello_INTERFACE_DEFINED__ */ + +/* Additional Prototypes for ALL interfaces */ + +void __RPC_USER PCTXTYPE_rundown( PCTXTYPE ); + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + Added: trunk/reactos/base/applications/testsets/rpcrt4/context_handles/ctx.idl URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/testsets/…
============================================================================== --- trunk/reactos/base/applications/testsets/rpcrt4/context_handles/ctx.idl (added) +++ trunk/reactos/base/applications/testsets/rpcrt4/context_handles/ctx.idl Wed Mar 29 21:42:29 2006 @@ -1,0 +1,19 @@ +//file hello.idl +[ + uuid(7a98c250-6808-11cf-b73b-00aa00b677a7), + version(1.0) +] +interface hello +{ + +typedef long CTXTYPE; +typedef [context_handle] CTXTYPE, *PCTXTYPE; + +void CtxOpen( [out] PCTXTYPE *pphContext, + [in] long Value); + +void CtxHello( [in] PCTXTYPE phContext ); + +void CtxClose( [in, out] PCTXTYPE *pphContext ); + +} Added: trunk/reactos/base/applications/testsets/rpcrt4/context_handles/ctx_c.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/testsets/…
============================================================================== --- trunk/reactos/base/applications/testsets/rpcrt4/context_handles/ctx_c.c (added) +++ trunk/reactos/base/applications/testsets/rpcrt4/context_handles/ctx_c.c Wed Mar 29 21:42:29 2006 @@ -1,0 +1,335 @@ + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + +/* this ALWAYS GENERATED file contains the RPC client stubs */ + + + /* File created by MIDL compiler version 5.03.0280 */ +/* at Fri Mar 24 18:32:16 2006 + */ +/* Compiler settings for ctx.idl: + Os (OptLev=s), W1, Zp8, env=Win32 (32b run), ms_ext, c_ext + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +//@@MIDL_FILE_HEADING( ) + +#if !defined(_M_IA64) && !defined(_M_AXP64) +#include <string.h> +#if defined( _ALPHA_ ) +#include <stdarg.h> +#endif + +#include "ctx.h" + +#define TYPE_FORMAT_STRING_SIZE 23 +#define PROC_FORMAT_STRING_SIZE 21 +#define TRANSMIT_AS_TABLE_SIZE 0 +#define WIRE_MARSHAL_TABLE_SIZE 0 + +typedef struct _MIDL_TYPE_FORMAT_STRING + { + short Pad; + unsigned char Format[ TYPE_FORMAT_STRING_SIZE ]; + } MIDL_TYPE_FORMAT_STRING; + +typedef struct _MIDL_PROC_FORMAT_STRING + { + short Pad; + unsigned char Format[ PROC_FORMAT_STRING_SIZE ]; + } MIDL_PROC_FORMAT_STRING; + + +extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString; +extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString; + +#define GENERIC_BINDING_TABLE_SIZE 0 + + +/* Standard interface: hello, ver. 1.0, + GUID={0x7a98c250,0x6808,0x11cf,{0xb7,0x3b,0x00,0xaa,0x00,0xb6,0x77,0xa7}} */ + +handle_t hBinding; + + +static const RPC_CLIENT_INTERFACE hello___RpcClientInterface = + { + sizeof(RPC_CLIENT_INTERFACE), + {{0x7a98c250,0x6808,0x11cf,{0xb7,0x3b,0x00,0xaa,0x00,0xb6,0x77,0xa7}},{1,0}}, + {{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}}, + 0, + 0, + 0, + 0, + 0, + 0 + }; +RPC_IF_HANDLE hello_v1_0_c_ifspec = (RPC_IF_HANDLE)& hello___RpcClientInterface; + +extern const MIDL_STUB_DESC hello_StubDesc; + +RPC_BINDING_HANDLE hello__MIDL_AutoBindHandle; + + +void CtxOpen( + /* [out] */ PCTXTYPE __RPC_FAR *pphContext, + /* [in] */ long Value) +{ + + RPC_BINDING_HANDLE _Handle = 0; + + RPC_MESSAGE _RpcMessage; + + MIDL_STUB_MESSAGE _StubMsg; + + if(!pphContext) + { + RpcRaiseException(RPC_X_NULL_REF_POINTER); + } + RpcTryFinally + { + NdrClientInitializeNew( + ( PRPC_MESSAGE )&_RpcMessage, + ( PMIDL_STUB_MESSAGE )&_StubMsg, + ( PMIDL_STUB_DESC )&hello_StubDesc, + 0); + + + _Handle = hBinding; + + + _StubMsg.BufferLength = 4U; + NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle ); + + *(( long __RPC_FAR * )_StubMsg.Buffer)++ = Value; + + NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer ); + + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) + NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] ); + + *pphContext = (void *)0; + NdrClientContextUnmarshall( + ( PMIDL_STUB_MESSAGE )&_StubMsg, + ( NDR_CCONTEXT __RPC_FAR * )pphContext, + _Handle); + + } + RpcFinally + { + NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg ); + + } + RpcEndFinally + +} + + +void CtxHello( + /* [in] */ PCTXTYPE phContext) +{ + + RPC_BINDING_HANDLE _Handle = 0; + + RPC_MESSAGE _RpcMessage; + + MIDL_STUB_MESSAGE _StubMsg; + + RpcTryFinally + { + NdrClientInitializeNew( + ( PRPC_MESSAGE )&_RpcMessage, + ( PMIDL_STUB_MESSAGE )&_StubMsg, + ( PMIDL_STUB_DESC )&hello_StubDesc, + 1); + + + if(phContext != 0) + { + _Handle = NDRCContextBinding(( NDR_CCONTEXT )phContext);; + + } + else + { + RpcRaiseException(RPC_X_SS_IN_NULL_CONTEXT); + } + + _StubMsg.BufferLength = 20U; + NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle ); + + NdrClientContextMarshall( + ( PMIDL_STUB_MESSAGE )&_StubMsg, + ( NDR_CCONTEXT )phContext, + 1); + NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer ); + + } + RpcFinally + { + NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg ); + + } + RpcEndFinally + +} + + +void CtxClose( + /* [out][in] */ PCTXTYPE __RPC_FAR *pphContext) +{ + + RPC_BINDING_HANDLE _Handle = 0; + + RPC_MESSAGE _RpcMessage; + + MIDL_STUB_MESSAGE _StubMsg; + + if(!pphContext) + { + RpcRaiseException(RPC_X_NULL_REF_POINTER); + } + RpcTryFinally + { + NdrClientInitializeNew( + ( PRPC_MESSAGE )&_RpcMessage, + ( PMIDL_STUB_MESSAGE )&_StubMsg, + ( PMIDL_STUB_DESC )&hello_StubDesc, + 2); + + + if(*pphContext != 0) + { + _Handle = NDRCContextBinding(( NDR_CCONTEXT )*pphContext);; + + } + + _StubMsg.BufferLength = 20U; + NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle ); + + NdrClientContextMarshall( + ( PMIDL_STUB_MESSAGE )&_StubMsg, + ( NDR_CCONTEXT )*pphContext, + 0); + NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer ); + + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) + NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[14] ); + + NdrClientContextUnmarshall( + ( PMIDL_STUB_MESSAGE )&_StubMsg, + ( NDR_CCONTEXT __RPC_FAR * )pphContext, + _Handle); + + } + RpcFinally + { + NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg ); + + } + RpcEndFinally + +} + + +const MIDL_STUB_DESC hello_StubDesc = + { + (void __RPC_FAR *)& hello___RpcClientInterface, + MIDL_user_allocate, + MIDL_user_free, + &hBinding, + 0, + 0, + 0, + 0, + __MIDL_TypeFormatString.Format, + 1, /* -error bounds_check flag */ + 0x10001, /* Ndr library version */ + 0, + 0x5030118, /* MIDL Version 5.3.280 */ + 0, + 0, + 0, /* notify & notify_flag routine table */ + 0x1, /* MIDL flag */ + 0, /* Reserved3 */ + 0, /* Reserved4 */ + 0 /* Reserved5 */ + }; + +#if !defined(__RPC_WIN32__) +#error Invalid build platform for this stub. +#endif + +const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = + { + 0, + { + + 0x51, /* FC_OUT_PARAM */ +#ifndef _ALPHA_ + 0x1, /* x86, MIPS & PPC stack size = 1 */ +#else + 0x2, /* Alpha stack size = 2 */ +#endif +/* 2 */ NdrFcShort( 0x2 ), /* Type Offset=2 */ +/* 4 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ + 0x8, /* FC_LONG */ +/* 6 */ 0x5b, /* FC_END */ + 0x5c, /* FC_PAD */ +/* 8 */ + 0x4d, /* FC_IN_PARAM */ +#ifndef _ALPHA_ + 0x1, /* x86, MIPS & PPC stack size = 1 */ +#else + 0x2, /* Alpha stack size = 2 */ +#endif +/* 10 */ NdrFcShort( 0xa ), /* Type Offset=10 */ +/* 12 */ 0x5b, /* FC_END */ + 0x5c, /* FC_PAD */ +/* 14 */ + 0x50, /* FC_IN_OUT_PARAM */ +#ifndef _ALPHA_ + 0x1, /* x86, MIPS & PPC stack size = 1 */ +#else + 0x2, /* Alpha stack size = 2 */ +#endif +/* 16 */ NdrFcShort( 0xe ), /* Type Offset=14 */ +/* 18 */ 0x5b, /* FC_END */ + 0x5c, /* FC_PAD */ + + 0x0 + } + }; + +const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = + { + 0, + { + NdrFcShort( 0x0 ), /* 0 */ +/* 2 */ + 0x11, 0x0, /* FC_RP */ +/* 4 */ NdrFcShort( 0x2 ), /* Offset= 2 (6) */ +/* 6 */ 0x30, /* FC_BIND_CONTEXT */ + 0xa0, /* Ctxt flags: via ptr, out, */ +/* 8 */ 0x0, /* 0 */ + 0x0, /* 0 */ +/* 10 */ 0x30, /* FC_BIND_CONTEXT */ + 0x41, /* Ctxt flags: in, can't be null */ +/* 12 */ 0x0, /* 0 */ + 0x0, /* 0 */ +/* 14 */ + 0x11, 0x0, /* FC_RP */ +/* 16 */ NdrFcShort( 0x2 ), /* Offset= 2 (18) */ +/* 18 */ 0x30, /* FC_BIND_CONTEXT */ + 0xe1, /* Ctxt flags: via ptr, in, out, can't be null */ +/* 20 */ 0x0, /* 0 */ + 0x0, /* 0 */ + + 0x0 + } + }; + + +#endif /* !defined(_M_IA64) && !defined(_M_AXP64)*/ + Added: trunk/reactos/base/applications/testsets/rpcrt4/context_handles/ctx_s.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/testsets/…
============================================================================== --- trunk/reactos/base/applications/testsets/rpcrt4/context_handles/ctx_s.c (added) +++ trunk/reactos/base/applications/testsets/rpcrt4/context_handles/ctx_s.c Wed Mar 29 21:42:29 2006 @@ -1,0 +1,349 @@ + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + +/* this ALWAYS GENERATED file contains the RPC server stubs */ + + + /* File created by MIDL compiler version 5.03.0280 */ +/* at Fri Mar 24 18:32:16 2006 + */ +/* Compiler settings for ctx.idl: + Os (OptLev=s), W1, Zp8, env=Win32 (32b run), ms_ext, c_ext + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +//@@MIDL_FILE_HEADING( ) + +#if !defined(_M_IA64) && !defined(_M_AXP64) +#include <string.h> +#include "ctx.h" + +#define TYPE_FORMAT_STRING_SIZE 23 +#define PROC_FORMAT_STRING_SIZE 21 +#define TRANSMIT_AS_TABLE_SIZE 0 +#define WIRE_MARSHAL_TABLE_SIZE 0 + +typedef struct _MIDL_TYPE_FORMAT_STRING + { + short Pad; + unsigned char Format[ TYPE_FORMAT_STRING_SIZE ]; + } MIDL_TYPE_FORMAT_STRING; + +typedef struct _MIDL_PROC_FORMAT_STRING + { + short Pad; + unsigned char Format[ PROC_FORMAT_STRING_SIZE ]; + } MIDL_PROC_FORMAT_STRING; + +extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString; +extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString; + +/* Standard interface: hello, ver. 1.0, + GUID={0x7a98c250,0x6808,0x11cf,{0xb7,0x3b,0x00,0xaa,0x00,0xb6,0x77,0xa7}} */ + + +extern RPC_DISPATCH_TABLE hello_v1_0_DispatchTable; + +static const RPC_SERVER_INTERFACE hello___RpcServerInterface = + { + sizeof(RPC_SERVER_INTERFACE), + {{0x7a98c250,0x6808,0x11cf,{0xb7,0x3b,0x00,0xaa,0x00,0xb6,0x77,0xa7}},{1,0}}, + {{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}}, + &hello_v1_0_DispatchTable, + 0, + 0, + 0, + 0, + 0 + }; +RPC_IF_HANDLE hello_v1_0_s_ifspec = (RPC_IF_HANDLE)& hello___RpcServerInterface; + +extern const MIDL_STUB_DESC hello_StubDesc; + +void __RPC_STUB +hello_CtxOpen( + PRPC_MESSAGE _pRpcMessage ) +{ + long Value; + MIDL_STUB_MESSAGE _StubMsg; + NDR_SCONTEXT pphContext; + RPC_STATUS _Status; + + ((void)(_Status)); + NdrServerInitializeNew( + _pRpcMessage, + &_StubMsg, + &hello_StubDesc); + + ( PCTXTYPE __RPC_FAR * )pphContext = 0; + RpcTryFinally + { + RpcTryExcept + { + if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) + NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] ); + + Value = *(( long __RPC_FAR * )_StubMsg.Buffer)++; + + if(_StubMsg.Buffer > _StubMsg.BufferEnd) + { + RpcRaiseException(RPC_X_BAD_STUB_DATA); + } + } + RpcExcept( RPC_BAD_STUB_DATA_EXCEPTION_FILTER ) + { + RpcRaiseException(RPC_X_BAD_STUB_DATA); + } + RpcEndExcept + pphContext = NDRSContextUnmarshall( (char *)0, _pRpcMessage->DataRepresentation ); + + + CtxOpen(( PCTXTYPE __RPC_FAR * )NDRSContextValue(pphContext),Value); + + _StubMsg.BufferLength = 20U; + _pRpcMessage->BufferLength = _StubMsg.BufferLength; + + _Status = I_RpcGetBuffer( _pRpcMessage ); + if ( _Status ) + RpcRaiseException( _Status ); + + _StubMsg.Buffer = (unsigned char __RPC_FAR *) _pRpcMessage->Buffer; + + NdrServerContextMarshall( + ( PMIDL_STUB_MESSAGE )&_StubMsg, + ( NDR_SCONTEXT )pphContext, + ( NDR_RUNDOWN )PCTXTYPE_rundown); + + } + RpcFinally + { + } + RpcEndFinally + _pRpcMessage->BufferLength = + (unsigned int)(_StubMsg.Buffer - (unsigned char __RPC_FAR *)_pRpcMessage->Buffer); + +} + +void __RPC_STUB +hello_CtxHello( + PRPC_MESSAGE _pRpcMessage ) +{ + MIDL_STUB_MESSAGE _StubMsg; + NDR_SCONTEXT phContext; + RPC_STATUS _Status; + + ((void)(_Status)); + NdrServerInitializeNew( + _pRpcMessage, + &_StubMsg, + &hello_StubDesc); + + RpcTryFinally + { + RpcTryExcept + { + if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) + NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[8] ); + + phContext = NdrServerContextUnmarshall(( PMIDL_STUB_MESSAGE )&_StubMsg); + + if(_StubMsg.Buffer > _StubMsg.BufferEnd) + { + RpcRaiseException(RPC_X_BAD_STUB_DATA); + } + } + RpcExcept( RPC_BAD_STUB_DATA_EXCEPTION_FILTER ) + { + RpcRaiseException(RPC_X_BAD_STUB_DATA); + } + RpcEndExcept + + CtxHello(( PCTXTYPE )*NDRSContextValue(phContext)); + + } + RpcFinally + { + } + RpcEndFinally + _pRpcMessage->BufferLength = + (unsigned int)(_StubMsg.Buffer - (unsigned char __RPC_FAR *)_pRpcMessage->Buffer); + +} + +void __RPC_STUB +hello_CtxClose( + PRPC_MESSAGE _pRpcMessage ) +{ + MIDL_STUB_MESSAGE _StubMsg; + NDR_SCONTEXT pphContext; + RPC_STATUS _Status; + + ((void)(_Status)); + NdrServerInitializeNew( + _pRpcMessage, + &_StubMsg, + &hello_StubDesc); + + ( PCTXTYPE __RPC_FAR * )pphContext = 0; + RpcTryFinally + { + RpcTryExcept + { + if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) + NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[14] ); + + pphContext = NdrServerContextUnmarshall(( PMIDL_STUB_MESSAGE )&_StubMsg); + + if(_StubMsg.Buffer > _StubMsg.BufferEnd) + { + RpcRaiseException(RPC_X_BAD_STUB_DATA); + } + } + RpcExcept( RPC_BAD_STUB_DATA_EXCEPTION_FILTER ) + { + RpcRaiseException(RPC_X_BAD_STUB_DATA); + } + RpcEndExcept + + CtxClose(( PCTXTYPE __RPC_FAR * )NDRSContextValue(pphContext)); + + _StubMsg.BufferLength = 20U; + _pRpcMessage->BufferLength = _StubMsg.BufferLength; + + _Status = I_RpcGetBuffer( _pRpcMessage ); + if ( _Status ) + RpcRaiseException( _Status ); + + _StubMsg.Buffer = (unsigned char __RPC_FAR *) _pRpcMessage->Buffer; + + NdrServerContextMarshall( + ( PMIDL_STUB_MESSAGE )&_StubMsg, + ( NDR_SCONTEXT )pphContext, + ( NDR_RUNDOWN )PCTXTYPE_rundown); + + } + RpcFinally + { + } + RpcEndFinally + _pRpcMessage->BufferLength = + (unsigned int)(_StubMsg.Buffer - (unsigned char __RPC_FAR *)_pRpcMessage->Buffer); + +} + + +static const MIDL_STUB_DESC hello_StubDesc = + { + (void __RPC_FAR *)& hello___RpcServerInterface, + MIDL_user_allocate, + MIDL_user_free, + 0, + 0, + 0, + 0, + 0, + __MIDL_TypeFormatString.Format, + 1, /* -error bounds_check flag */ + 0x10001, /* Ndr library version */ + 0, + 0x5030118, /* MIDL Version 5.3.280 */ + 0, + 0, + 0, /* notify & notify_flag routine table */ + 0x1, /* MIDL flag */ + 0, /* Reserved3 */ + 0, /* Reserved4 */ + 0 /* Reserved5 */ + }; + +static RPC_DISPATCH_FUNCTION hello_table[] = + { + hello_CtxOpen, + hello_CtxHello, + hello_CtxClose, + 0 + }; +RPC_DISPATCH_TABLE hello_v1_0_DispatchTable = + { + 3, + hello_table + }; + +#if !defined(__RPC_WIN32__) +#error Invalid build platform for this stub. +#endif + +static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = + { + 0, + { + + 0x51, /* FC_OUT_PARAM */ +#ifndef _ALPHA_ + 0x1, /* x86, MIPS & PPC stack size = 1 */ +#else + 0x2, /* Alpha stack size = 2 */ +#endif +/* 2 */ NdrFcShort( 0x2 ), /* Type Offset=2 */ +/* 4 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ + 0x8, /* FC_LONG */ +/* 6 */ 0x5b, /* FC_END */ + 0x5c, /* FC_PAD */ +/* 8 */ + 0x4d, /* FC_IN_PARAM */ +#ifndef _ALPHA_ + 0x1, /* x86, MIPS & PPC stack size = 1 */ +#else + 0x2, /* Alpha stack size = 2 */ +#endif +/* 10 */ NdrFcShort( 0xa ), /* Type Offset=10 */ +/* 12 */ 0x5b, /* FC_END */ + 0x5c, /* FC_PAD */ +/* 14 */ + 0x50, /* FC_IN_OUT_PARAM */ +#ifndef _ALPHA_ + 0x1, /* x86, MIPS & PPC stack size = 1 */ +#else + 0x2, /* Alpha stack size = 2 */ +#endif +/* 16 */ NdrFcShort( 0xe ), /* Type Offset=14 */ +/* 18 */ 0x5b, /* FC_END */ + 0x5c, /* FC_PAD */ + + 0x0 + } + }; + +static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = + { + 0, + { + NdrFcShort( 0x0 ), /* 0 */ +/* 2 */ + 0x11, 0x0, /* FC_RP */ +/* 4 */ NdrFcShort( 0x2 ), /* Offset= 2 (6) */ +/* 6 */ 0x30, /* FC_BIND_CONTEXT */ + 0xa0, /* Ctxt flags: via ptr, out, */ +/* 8 */ 0x0, /* 0 */ + 0x0, /* 0 */ +/* 10 */ 0x30, /* FC_BIND_CONTEXT */ + 0x41, /* Ctxt flags: in, can't be null */ +/* 12 */ 0x0, /* 0 */ + 0x0, /* 0 */ +/* 14 */ + 0x11, 0x0, /* FC_RP */ +/* 16 */ NdrFcShort( 0x2 ), /* Offset= 2 (18) */ +/* 18 */ 0x30, /* FC_BIND_CONTEXT */ + 0xe1, /* Ctxt flags: via ptr, in, out, can't be null */ +/* 20 */ 0x0, /* 0 */ + 0x0, /* 0 */ + + 0x0 + } + }; + + +#endif /* !defined(_M_IA64) && !defined(_M_AXP64)*/ + Added: trunk/reactos/base/applications/testsets/rpcrt4/context_handles/server.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/testsets/…
============================================================================== --- trunk/reactos/base/applications/testsets/rpcrt4/context_handles/server.c (added) +++ trunk/reactos/base/applications/testsets/rpcrt4/context_handles/server.c Wed Mar 29 21:42:29 2006 @@ -1,0 +1,77 @@ +#include <stdlib.h> +#include <stdio.h> +#include <ctype.h> +#include "ctx.h" + +void CtxOpen( PCTXTYPE *pphContext, + long Value) +{ + printf("CtxOpen()\n"); + *pphContext = (PCTXTYPE)midl_user_allocate( sizeof(CTXTYPE) ); + **pphContext = Value; +} + +void CtxHello( PCTXTYPE phContext ) +{ + printf("Hello, World! Context value: %d\n", *phContext); +} + +void CtxClose(PCTXTYPE *pphContext ) +{ + printf("CtxClose()\n"); + midl_user_free(*pphContext); + *pphContext = NULL; +} + + +void main() +{ + RPC_STATUS status; + unsigned int cMinCalls = 1; + unsigned int cMaxCalls = 20; + int i; + + status = RpcServerUseProtseqEp("ncacn_np", 20, "\\pipe\\hello", NULL); + + if (status) + { + printf("RpcServerUseProtseqEp %x\n", status); + exit(status); + } + + status = RpcServerRegisterIf(hello_v1_0_s_ifspec, NULL, NULL); + + if (status) + { + printf("RpcServerRegisterIf %x\n", status); + exit(status); + } + + status = RpcServerListen(1, 20, FALSE); + + if (status) + { + printf("RpcServerListen %x", status); + exit(status); + } + + scanf("%d", &i); +} + + +void __RPC_USER PCTXTYPE_rundown( + PCTXTYPE hContext) +{ + printf("Context rundown \n"); + midl_user_free(hContext); +} + +void __RPC_FAR * __RPC_USER midl_user_allocate(size_t len) +{ + return(malloc(len)); +} + +void __RPC_USER midl_user_free(void __RPC_FAR * ptr) +{ + free(ptr); +}
19 years
1
0
0
0
[gedmurphy] 21406: remove Wine makefile
by aleksey@studiocerebral.com
Author: gedmurphy Date: Wed Mar 29 19:04:50 2006 New Revision: 21406 URL:
http://svn.reactos.ru/svn/reactos?rev=21406&view=rev
Log: remove Wine makefile Removed: trunk/reactos/base/applications/notepad/Makefile.in Removed: trunk/reactos/base/applications/notepad/Makefile.in URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/notepad/M…
============================================================================== --- trunk/reactos/base/applications/notepad/Makefile.in (original) +++ trunk/reactos/base/applications/notepad/Makefile.in (removed) @@ -1,21 +1,0 @@ -TOPSRCDIR = @top_srcdir@ -TOPOBJDIR = ../.. -SRCDIR = @srcdir@ -VPATH = @srcdir@ -MODULE = notepad.exe -APPMODE = -mwindows -IMPORTS = comdlg32 shell32 user32 gdi32 msvcrt advapi32 kernel32 -EXTRAINCL = -I$(TOPSRCDIR)/include/msvcrt -EXTRADEFS = -DNO_LIBWINE_PORT - -C_SRCS = \ - License_En.c \ - dialog.c \ - license.c \ - main.c - -RC_SRCS = rsrc.rc - -@MAKE_PROG_RULES@ - -### Dependencies:
19 years
1
0
0
0
[gedmurphy] 21405: - [AUDIT] unlocked notepad. Much of the code is from Wine, ReactOS code builds on this. - Implement find next and add some German resources - patch by timo.kreuzer@web.de - fixes bugs 1351 & 1352
by aleksey@studiocerebral.com
Author: gedmurphy Date: Wed Mar 29 18:51:37 2006 New Revision: 21405 URL:
http://svn.reactos.ru/svn/reactos?rev=21405&view=rev
Log: - [AUDIT] unlocked notepad. Much of the code is from Wine, ReactOS code builds on this. - Implement find next and add some German resources - patch by timo.kreuzer(a)web.de - fixes bugs 1351 & 1352 Modified: trunk/reactos/base/applications/notepad/dialog.c (contents, props changed) trunk/reactos/base/applications/notepad/dialog.h (props changed) trunk/reactos/base/applications/notepad/license.c (props changed) trunk/reactos/base/applications/notepad/main.c trunk/reactos/base/applications/notepad/main.h trunk/reactos/base/applications/notepad/notepad.h (props changed) trunk/reactos/base/applications/notepad/res/De.rc trunk/reactos/base/applications/notepad/settings.c (props changed) trunk/reactos/base/applications/notepad/text.c (props changed) Modified: trunk/reactos/base/applications/notepad/dialog.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/notepad/d…
============================================================================== --- trunk/reactos/base/applications/notepad/dialog.c (original) +++ trunk/reactos/base/applications/notepad/dialog.c Wed Mar 29 18:51:37 2006 @@ -698,8 +698,8 @@ VOID DIALOG_SearchNext(VOID) { - /* FIXME: Search Next */ - DIALOG_Search(); + if (Globals.find.lpstrFindWhat != NULL) + NOTEPAD_FindNext(&Globals.find, FALSE, TRUE); } VOID DIALOG_Replace(VOID) Propchange: trunk/reactos/base/applications/notepad/dialog.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/applications/notepad/dialog.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/applications/notepad/license.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Modified: trunk/reactos/base/applications/notepad/main.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/notepad/m…
============================================================================== --- trunk/reactos/base/applications/notepad/main.c (original) +++ trunk/reactos/base/applications/notepad/main.c Wed Mar 29 18:51:37 2006 @@ -125,7 +125,7 @@ * NOTEPAD_FindNext */ -static BOOL NOTEPAD_FindNext(FINDREPLACE *pFindReplace, BOOL bReplace, BOOL bShowAlert) +BOOL NOTEPAD_FindNext(FINDREPLACE *pFindReplace, BOOL bReplace, BOOL bShowAlert) { int iTextLength, iTargetLength; int iAdjustment = 0; @@ -255,6 +255,7 @@ lstrcpy(p, all_files); p += lstrlen(p) + 1; *p = '\0'; + Globals.find.lpstrFindWhat = NULL; } /*********************************************************************** @@ -358,6 +359,7 @@ if (msg == aFINDMSGSTRING) { FINDREPLACE *pFindReplace = (FINDREPLACE *) lParam; + Globals.find = *(FINDREPLACE *) lParam; if (pFindReplace->Flags & FR_FINDNEXT) NOTEPAD_FindNext(pFindReplace, FALSE, TRUE); Modified: trunk/reactos/base/applications/notepad/main.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/notepad/m…
============================================================================== --- trunk/reactos/base/applications/notepad/main.h (original) +++ trunk/reactos/base/applications/notepad/main.h Wed Mar 29 18:51:37 2006 @@ -76,3 +76,6 @@ /* from settings.c */ void LoadSettings(void); void SaveSettings(void); + +/* from main.c */ +BOOL NOTEPAD_FindNext(FINDREPLACE *, BOOL , BOOL ); Propchange: trunk/reactos/base/applications/notepad/notepad.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Modified: trunk/reactos/base/applications/notepad/res/De.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/notepad/r…
============================================================================== --- trunk/reactos/base/applications/notepad/res/De.rc (original) +++ trunk/reactos/base/applications/notepad/res/De.rc Wed Mar 29 18:51:37 2006 @@ -154,6 +154,12 @@ STRING_OUT_OF_MEMORY, "Nicht genügend Arbeitsspeicher, \ um diese Funktion \nabzuschließen. Beenden Sie eine oder mehrere \ \nAnwendungen, um den verfügbaren Arbeitsspeicher zu \nerhöhen." - - +STRING_CANNOTFIND "'%s' wurde nicht gefunden." +STRING_ANSI, "ANSI" +STRING_UNICODE, "Unicode" +STRING_UNICODE_BE, "Unicode (big endian)" +STRING_UTF8, "UTF-8" +STRING_CRLF, "Windows" +STRING_LF, "Unix" +STRING_CR, "Mac" } Propchange: trunk/reactos/base/applications/notepad/settings.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/applications/notepad/text.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -*
19 years
1
0
0
0
[gedmurphy] 21404: Import a very basic version of wordpad from Wine.
by aleksey@studiocerebral.com
Author: gedmurphy Date: Wed Mar 29 01:15:04 2006 New Revision: 21404 URL:
http://svn.reactos.ru/svn/reactos?rev=21404&view=rev
Log: Import a very basic version of wordpad from Wine. Added: trunk/reactos/base/applications/wordpad/ trunk/reactos/base/applications/wordpad/De.rc trunk/reactos/base/applications/wordpad/En.rc trunk/reactos/base/applications/wordpad/Fr.rc trunk/reactos/base/applications/wordpad/Ko.rc trunk/reactos/base/applications/wordpad/Nl.rc trunk/reactos/base/applications/wordpad/No.rc trunk/reactos/base/applications/wordpad/Ru.rc trunk/reactos/base/applications/wordpad/Tr.rc trunk/reactos/base/applications/wordpad/resource.h trunk/reactos/base/applications/wordpad/rsrc.rc trunk/reactos/base/applications/wordpad/toolbar.bmp (with props) trunk/reactos/base/applications/wordpad/wordpad.c trunk/reactos/base/applications/wordpad/wordpad.rbuild Modified: trunk/reactos/base/applications/applications.rbuild Modified: trunk/reactos/base/applications/applications.rbuild URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/applicati…
============================================================================== --- trunk/reactos/base/applications/applications.rbuild (original) +++ trunk/reactos/base/applications/applications.rbuild Wed Mar 29 01:15:04 2006 @@ -55,4 +55,7 @@ <directory name="winefile"> <xi:include href="winefile/winefile.rbuild" /> </directory> +<directory name="wordpad"> + <xi:include href="wordpad/wordpad.rbuild" /> +</directory> </group> Added: trunk/reactos/base/applications/wordpad/De.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/D…
============================================================================== --- trunk/reactos/base/applications/wordpad/De.rc (added) +++ trunk/reactos/base/applications/wordpad/De.rc Wed Mar 29 01:15:04 2006 @@ -1,0 +1,66 @@ +/* + * Copyright 2006 by Henning Gerhardt + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +LANGUAGE LANG_GERMAN, SUBLANG_DEFAULT + +MAINMENU MENU DISCARDABLE +BEGIN + POPUP "&Datei" + BEGIN + MENUITEM "&Neu", ID_FILE_NEW + MENUITEM "&Öffnen", ID_FILE_OPEN + MENUITEM "&Speichern", ID_FILE_SAVE + MENUITEM SEPARATOR + MENUITEM "&Beenden", ID_FILE_EXIT + END + POPUP "&Bearbeiten" + BEGIN + MENUITEM "&Rückgängig\tCtrl+Z", ID_EDIT_UNDO + MENUITEM "&Wiederholen\tCtrl+Y", ID_EDIT_REDO + MENUITEM "&Alles markieren\tCtrl+A", ID_EDIT_SELECTALL + MENUITEM SEPARATOR + MENUITEM "Aus&schneiden\tCtrl+X", ID_EDIT_CUT + MENUITEM "&Kopieren\tCtrl+C", ID_EDIT_COPY + MENUITEM SEPARATOR + MENUITEM "Schreibgeschü&tzt", ID_EDIT_READONLY + MENUITEM "&Geändert", ID_EDIT_MODIFIED + MENUITEM SEPARATOR + POPUP "&Extras" + BEGIN + MENUITEM "Markierungs&information", ID_EDIT_SELECTIONINFO + MENUITEM "Zeichen&format", ID_EDIT_CHARFORMAT + MENUITEM "&Standardzeichenformat", ID_EDIT_DEFCHARFORMAT + MENUITEM "&Absatzformat", ID_EDIT_PARAFORMAT + MENUITEM "&Get text", ID_EDIT_GETTEXT + END + END + POPUP "F&ormat" + BEGIN + POPUP "&Hintergrund" + BEGIN + MENUITEM "&System\tCtrl+1", ID_BACK_1 + MENUITEM "&PostIt-Notiz\tCtrl+2", ID_BACK_2 + END + POPUP "&Ausrichtung" + BEGIN + MENUITEM "&Links\tCtrl+L", ID_ALIGN_LEFT + MENUITEM "&Zentriert\tCtrl+E", ID_ALIGN_CENTER + MENUITEM "&Rechts\tCtrl+R", ID_ALIGN_RIGHT + END + END +END Added: trunk/reactos/base/applications/wordpad/En.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/E…
============================================================================== --- trunk/reactos/base/applications/wordpad/En.rc (added) +++ trunk/reactos/base/applications/wordpad/En.rc Wed Mar 29 01:15:04 2006 @@ -1,0 +1,66 @@ +/* + * Copyright 2004 by Krzysztof Foltman + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT + +MAINMENU MENU DISCARDABLE +BEGIN + POPUP "&File" + BEGIN + MENUITEM "&New", ID_FILE_NEW + MENUITEM "&Open", ID_FILE_OPEN + MENUITEM "&Save", ID_FILE_SAVE + MENUITEM SEPARATOR + MENUITEM "&Exit", ID_FILE_EXIT + END + POPUP "&Edit" + BEGIN + MENUITEM "&Undo\tCtrl+Z", ID_EDIT_UNDO + MENUITEM "&Redo\tCtrl+Y", ID_EDIT_REDO + MENUITEM "&Select all\tCtrl+A", ID_EDIT_SELECTALL + MENUITEM SEPARATOR + MENUITEM "Cu&t\tCtrl+X", ID_EDIT_CUT + MENUITEM "&Copy\tCtrl+C", ID_EDIT_COPY + MENUITEM SEPARATOR + MENUITEM "Read-&only", ID_EDIT_READONLY + MENUITEM "&Modified", ID_EDIT_MODIFIED + MENUITEM SEPARATOR + POPUP "&Extras" + BEGIN + MENUITEM "Selection &info", ID_EDIT_SELECTIONINFO + MENUITEM "Character &format", ID_EDIT_CHARFORMAT + MENUITEM "&Def. char format", ID_EDIT_DEFCHARFORMAT + MENUITEM "Paragrap&h format", ID_EDIT_PARAFORMAT + MENUITEM "&Get text", ID_EDIT_GETTEXT + END + END + POPUP "F&ormat" + BEGIN + POPUP "&Background" + BEGIN + MENUITEM "&System\tCtrl+1", ID_BACK_1 + MENUITEM "&PostThat yellowish\tCtrl+2", ID_BACK_2 + END + POPUP "&Alignment" + BEGIN + MENUITEM "&Left\tCtrl+L", ID_ALIGN_LEFT + MENUITEM "&Center\tCtrl+E", ID_ALIGN_CENTER + MENUITEM "&Right\tCtrl+R", ID_ALIGN_RIGHT + END + END +END Added: trunk/reactos/base/applications/wordpad/Fr.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/F…
============================================================================== --- trunk/reactos/base/applications/wordpad/Fr.rc (added) +++ trunk/reactos/base/applications/wordpad/Fr.rc Wed Mar 29 01:15:04 2006 @@ -1,0 +1,66 @@ +/* + * Copyright 2006 by Jonathan Ernst + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL + +MAINMENU MENU DISCARDABLE +BEGIN + POPUP "&Fichier" + BEGIN + MENUITEM "&Nouveau", ID_FILE_NEW + MENUITEM "&Ouvrir", ID_FILE_OPEN + MENUITEM "&Sauver", ID_FILE_SAVE + MENUITEM SEPARATOR + MENUITEM "&Quitter", ID_FILE_EXIT + END + POPUP "&Edition" + BEGIN + MENUITEM "&Annuler\tCtrl+Z", ID_EDIT_UNDO + MENUITEM "&Répéter\tCtrl+Y", ID_EDIT_REDO + MENUITEM "&Sélectionner tout\tCtrl+A", ID_EDIT_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&Couper\tCtrl+X", ID_EDIT_CUT + MENUITEM "Co&pier\tCtrl+C", ID_EDIT_COPY + MENUITEM SEPARATOR + MENUITEM "Lecture-&seule", ID_EDIT_READONLY + MENUITEM "&Modifié", ID_EDIT_MODIFIED + MENUITEM SEPARATOR + POPUP "&Avancés" + BEGIN + MENUITEM "&Information sélection", ID_EDIT_SELECTIONINFO + MENUITEM "&Format caractÃÅ¡res", ID_EDIT_CHARFORMAT + MENUITEM "&Déf. format car.", ID_EDIT_DEFCHARFORMAT + MENUITEM "Format paragrap&he", ID_EDIT_PARAFORMAT + MENUITEM "&Recevoir texte", ID_EDIT_GETTEXT + END + END + POPUP "F&ormat" + BEGIN + POPUP "&Fond" + BEGIN + MENUITEM "&SystÃÅ¡me\tCtrl+1", ID_BACK_1 + MENUITEM "&PostThat yellowish\tCtrl+2", ID_BACK_2 + END + POPUP "&Alignement" + BEGIN + MENUITEM "Aligné à&gauche\tCtrl+L", ID_ALIGN_LEFT + MENUITEM "&Centré\tCtrl+E", ID_ALIGN_CENTER + MENUITEM "Aligné à&droite\tCtrl+R", ID_ALIGN_RIGHT + END + END +END Added: trunk/reactos/base/applications/wordpad/Ko.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/K…
============================================================================== --- trunk/reactos/base/applications/wordpad/Ko.rc (added) +++ trunk/reactos/base/applications/wordpad/Ko.rc Wed Mar 29 01:15:04 2006 @@ -1,0 +1,67 @@ + /* + * Copyright 2004 by Krzysztof Foltman + * Copyright 2006 by YunSong Hwang + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT +MAINMENU MENU DISCARDABLE +BEGIN + POPUP "ÆÄÀÏ(&F)" + BEGIN + MENUITEM "»õ ÆÄÀÏ(&N)", ID_FILE_NEW + MENUITEM "¿±â(&O)", ID_FILE_OPEN + MENUITEM "ÀúÀå(&S)", ID_FILE_SAVE + MENUITEM SEPARATOR + MENUITEM "³ª°¡±â(&E)", ID_FILE_EXIT + END + POPUP "ÆíÁý(&E)" + BEGIN + MENUITEM "µÇµ¹¸®±â(&U)\tCtrl+Z", ID_EDIT_UNDO + MENUITEM "´Ù½Ã ½ÇÇà(&R)\tCtrl+Y", ID_EDIT_REDO + MENUITEM "¸ðµÎ ¼±ÅÃ(&S)\tCtrl+A", ID_EDIT_SELECTALL + MENUITEM SEPARATOR + MENUITEM "À߶󳻱â(&T)\tCtrl+X", ID_EDIT_CUT + MENUITEM "º¹»ç(&C)\tCtrl+C", ID_EDIT_COPY + MENUITEM SEPARATOR + MENUITEM "Àбâ Àü¿ë(&O)", ID_EDIT_READONLY + MENUITEM "¼öÁ¤ °¡´É(&M)", ID_EDIT_MODIFIED + MENUITEM SEPARATOR + POPUP "±âŸ(&E)" + BEGIN + MENUITEM "¼±Åà ¿µ¿ª Á¤º¸(&I)", ID_EDIT_SELECTIONINFO + MENUITEM "¹®ÀÚ Çü½Ä(&F)", ID_EDIT_CHARFORMAT + MENUITEM "Á¤ÀÇµÈ ¹®ÀÚ¿ Çü½Ä(&D)", ID_EDIT_DEFCHARFORMAT + MENUITEM "´Ü¶ô Çü½Ä(&H)", ID_EDIT_PARAFORMAT + MENUITEM "ÅؽºÆ® ¾ò±â(&G)", ID_EDIT_GETTEXT + END + END + POPUP "Çü½Ä(&O)" + BEGIN + POPUP "¹è°æ(&B)" + BEGIN + MENUITEM "½Ã½ºÅÛ(&S)\tCtrl+1", ID_BACK_1 + MENUITEM "³ë¶û»öÀ¸·Î(&P)\tCtrl+2", ID_BACK_2 + END + POPUP "Á¤·Ä(&A)" + BEGIN + MENUITEM "¿ÞÂÊ(&L)\tCtrl+L", ID_ALIGN_LEFT + MENUITEM "°¡¿îµ¥(&C)\tCtrl+E", ID_ALIGN_CENTER + MENUITEM "¿À¸¥ÂÊ(&R)\tCtrl+R", ID_ALIGN_RIGHT + END + END +END Added: trunk/reactos/base/applications/wordpad/Nl.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/N…
============================================================================== --- trunk/reactos/base/applications/wordpad/Nl.rc (added) +++ trunk/reactos/base/applications/wordpad/Nl.rc Wed Mar 29 01:15:04 2006 @@ -1,0 +1,66 @@ +/* + * Copyright 2006 by Hans Leidekker + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +LANGUAGE LANG_DUTCH, SUBLANG_DEFAULT + +MAINMENU MENU DISCARDABLE +BEGIN + POPUP "&Bestand" + BEGIN + MENUITEM "&Nieuw" ID_FILE_NEW + MENUITEM "&Openen", ID_FILE_OPEN + MENUITEM "O&pslaan", ID_FILE_SAVE + MENUITEM SEPARATOR + MENUITEM "&Afsluiten", ID_FILE_EXIT + END + POPUP "Be&werken" + BEGIN + MENUITEM "&Ongedaan maken\tCtrl+Z", ID_EDIT_UNDO + MENUITEM "O&pnieuw\tCtrl+Y", ID_EDIT_REDO + MENUITEM "&Alles selecteren\tCtrl+A", ID_EDIT_SELECTALL + MENUITEM SEPARATOR + MENUITEM "K&nippen\tCtrl+X", ID_EDIT_CUT + MENUITEM "&Kopieren\tCtrl+C", ID_EDIT_COPY + MENUITEM SEPARATOR + MENUITEM "Alleen &lezen", ID_EDIT_READONLY + MENUITEM "&Gewijzigd", ID_EDIT_MODIFIED + MENUITEM SEPARATOR + POPUP "&Extra's" + BEGIN + MENUITEM "Selectie&informatie", ID_EDIT_SELECTIONINFO + MENUITEM "&Karakterformaat", ID_EDIT_CHARFORMAT + MENUITEM "&Standaard karakterformaat", ID_EDIT_DEFCHARFORMAT + MENUITEM "&Paragraafformaat", ID_EDIT_PARAFORMAT + MENUITEM "&Haal tekst", ID_EDIT_GETTEXT + END + END + POPUP "&Opmaak" + BEGIN + POPUP "&Achtergrond" + BEGIN + MENUITEM "&Systeem\tCtrl+1", ID_BACK_1 + MENUITEM "&Geeltje\tCtrl+2", ID_BACK_2 + END + POPUP "&Uitlijning" + BEGIN + MENUITEM "&Links\tCtrl+L", ID_ALIGN_LEFT + MENUITEM "&Gecentreerd\tCtrl+E", ID_ALIGN_CENTER + MENUITEM "&Rechts\tCtrl+R", ID_ALIGN_RIGHT + END + END +END Added: trunk/reactos/base/applications/wordpad/No.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/N…
============================================================================== --- trunk/reactos/base/applications/wordpad/No.rc (added) +++ trunk/reactos/base/applications/wordpad/No.rc Wed Mar 29 01:15:04 2006 @@ -1,0 +1,66 @@ +/* + * Copyright 2006 by Alexander N. Sørnes <alex(a)thehandofagony.com> + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL + +MAINMENU MENU DISCARDABLE +BEGIN + POPUP "&Fil" + BEGIN + MENUITEM "&Ny", ID_FILE_NEW + MENUITEM "&Åpne", ID_FILE_OPEN + MENUITEM "&Lagre", ID_FILE_SAVE + MENUITEM SEPARATOR + MENUITEM "&Avslutt", ID_FILE_EXIT + END + POPUP "R&ediger" + BEGIN + MENUITEM "&Angre\tCtrl+Z", ID_EDIT_UNDO + MENUITEM "&Gjenta\tCtrl+Y", ID_EDIT_REDO + MENUITEM "&Merk alt\tCtrl+A", ID_EDIT_SELECTALL + MENUITEM SEPARATOR + MENUITEM "Klipp u&t\tCtrl+X", ID_EDIT_CUT + MENUITEM "&Kopier\tCtrl+C", ID_EDIT_COPY + MENUITEM SEPARATOR + MENUITEM "&Skrivebeskyttet", ID_EDIT_READONLY + MENUITEM "E&ndret", ID_EDIT_MODIFIED + MENUITEM SEPARATOR + POPUP "&Ekstra" + BEGIN + MENUITEM "&Info om merket område", ID_EDIT_SELECTIONINFO + MENUITEM "Tegn&format", ID_EDIT_CHARFORMAT + MENUITEM "Stan&dard tegnformat", ID_EDIT_DEFCHARFORMAT + MENUITEM "&Avsnittformat", ID_EDIT_PARAFORMAT + MENUITEM "&Hent tekst", ID_EDIT_GETTEXT + END + END + POPUP "F&ormat" + BEGIN + POPUP "&Bakgrunn" + BEGIN + MENUITEM "&System\tCtrl+1", ID_BACK_1 + MENUITEM "Merkela&pp-gult\tCtrl+2", ID_BACK_2 + END + POPUP "&Justering" + BEGIN + MENUITEM "&Venstrestilt\tCtrl+L", ID_ALIGN_LEFT + MENUITEM "&Midtstilt\tCtrl+E", ID_ALIGN_CENTER + MENUITEM "Høy&restilt\tCtrl+R", ID_ALIGN_RIGHT + END + END +END Added: trunk/reactos/base/applications/wordpad/Ru.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/R…
============================================================================== --- trunk/reactos/base/applications/wordpad/Ru.rc (added) +++ trunk/reactos/base/applications/wordpad/Ru.rc Wed Mar 29 01:15:04 2006 @@ -1,0 +1,66 @@ +/* + * Copyright 2006 by Phil Krylov + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT + +MAINMENU MENU DISCARDABLE +BEGIN + POPUP "&Ôàéë" + BEGIN + MENUITEM "Ñîçä&àòü", ID_FILE_NEW + MENUITEM "&Îòêðûòü", ID_FILE_OPEN + MENUITEM "&Ñîõðàíèòü", ID_FILE_SAVE + MENUITEM SEPARATOR + MENUITEM "Â&ûõîä", ID_FILE_EXIT + END + POPUP "&Ïðàâêà" + BEGIN + MENUITEM "&Îòìåíèòü\tCtrl+Z", ID_EDIT_UNDO + MENUITEM "&Ïîâòîðèòü\tCtrl+Y", ID_EDIT_REDO + MENUITEM "Âûäåëèòü â&ñå\tCtrl+A", ID_EDIT_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&Âûðåçàòü\tCtrl+X", ID_EDIT_CUT + MENUITEM "&Êîïèðîâàòü\tCtrl+C", ID_EDIT_COPY + MENUITEM SEPARATOR + MENUITEM "&Òîëüêî äëÿ ÷òåíèÿ", ID_EDIT_READONLY + MENUITEM "&Èçìåíåí", ID_EDIT_MODIFIED + MENUITEM SEPARATOR + POPUP "&Äîïîëíèòåëüíî" + BEGIN + MENUITEM "&Èíôîðìàöèÿ î âûäåëåíèè", ID_EDIT_SELECTIONINFO + MENUITEM "&Ôîðìàò ñèìâîëîâ", ID_EDIT_CHARFORMAT + MENUITEM "Ôîðìàò ñèìâîëîâ &ïî óìîë÷àíèþ", ID_EDIT_DEFCHARFORMAT + MENUITEM "Ôîðìàò &àáçàöà", ID_EDIT_PARAFORMAT + MENUITEM "Ï&îëó÷èòü òåêñò", ID_EDIT_GETTEXT + END + END + POPUP "Ôîð&ìàò" + BEGIN + POPUP "&Ôîí" + BEGIN + MENUITEM "&Ñèñòåìíûé\tCtrl+1", ID_BACK_1 + MENUITEM "&Æåëòîâàòûé PostThat\tCtrl+2", ID_BACK_2 + END + POPUP "&Âûðàâíèâàíèå" + BEGIN + MENUITEM "Â&ëåâî\tCtrl+L", ID_ALIGN_LEFT + MENUITEM "Ïî &öåíòðó\tCtrl+E", ID_ALIGN_CENTER + MENUITEM "Â&ïðàâî\tCtrl+R", ID_ALIGN_RIGHT + END + END +END Added: trunk/reactos/base/applications/wordpad/Tr.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/T…
============================================================================== --- trunk/reactos/base/applications/wordpad/Tr.rc (added) +++ trunk/reactos/base/applications/wordpad/Tr.rc Wed Mar 29 01:15:04 2006 @@ -1,0 +1,68 @@ +/* + * Turkish Resources for Wordpad + * + * Copyright 2006 Fatih Aþýcý <fasici(a)linux-sevenler.org> + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT + +MAINMENU MENU DISCARDABLE +BEGIN + POPUP "&Dosya" + BEGIN + MENUITEM "&Yeni", ID_FILE_NEW + MENUITEM "&Aç", ID_FILE_OPEN + MENUITEM "&Kaydet", ID_FILE_SAVE + MENUITEM SEPARATOR + MENUITEM "&Çýk", ID_FILE_EXIT + END + POPUP "&Düzen" + BEGIN + MENUITEM "&Geri Al\tCtrl+Z", ID_EDIT_UNDO + MENUITEM "&Yinele\tCtrl+Y", ID_EDIT_REDO + MENUITEM "&Tümünü seç\tCtrl+A", ID_EDIT_SELECTALL + MENUITEM SEPARATOR + MENUITEM "Ke&s\tCtrl+X", ID_EDIT_CUT + MENUITEM "&Kopyala\tCtrl+C", ID_EDIT_COPY + MENUITEM SEPARATOR + MENUITEM "Salt-&okunur", ID_EDIT_READONLY + MENUITEM "&Deðiþmiþ", ID_EDIT_MODIFIED + MENUITEM SEPARATOR + POPUP "D&iðerleri" + BEGIN + MENUITEM "Seçim &bilgisi", ID_EDIT_SELECTIONINFO + MENUITEM "Karakter bi&çimi", ID_EDIT_CHARFORMAT + MENUITEM "&Öntanýmlý kar. biçimi", ID_EDIT_DEFCHARFORMAT + MENUITEM "Paragra&f biçimi", ID_EDIT_PARAFORMAT + MENUITEM "&Metni al", ID_EDIT_GETTEXT + END + END + POPUP "&Biçim" + BEGIN + POPUP "&Arkaplan" + BEGIN + MENUITEM "S&istem\tCtrl+1", ID_BACK_1 + MENUITEM "&Sarýmtýrak\tCtrl+2", ID_BACK_2 + END + POPUP "&Hizalama" + BEGIN + MENUITEM "S&ol\tCtrl+L", ID_ALIGN_LEFT + MENUITEM "O&rta\tCtrl+E", ID_ALIGN_CENTER + MENUITEM "S&að\tCtrl+R", ID_ALIGN_RIGHT + END + END +END Added: trunk/reactos/base/applications/wordpad/resource.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/r…
============================================================================== --- trunk/reactos/base/applications/wordpad/resource.h (added) +++ trunk/reactos/base/applications/wordpad/resource.h Wed Mar 29 01:15:04 2006 @@ -1,0 +1,54 @@ +/* + * Copyright 2004 by Krzysztof Foltman + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#define ID_FILE_EXIT 1000 +#define ID_FILE_OPEN 1001 +#define ID_FILE_SAVE 1002 +#define ID_FILE_NEW 1003 + +#define ID_ALIGN_LEFT 1100 +#define ID_ALIGN_CENTER 1101 +#define ID_ALIGN_RIGHT 1102 + +#define ID_BACK_1 1200 +#define ID_BACK_2 1201 + +#define ID_EDIT_SELECTALL 1300 +#define ID_EDIT_SELECTIONINFO 1301 +#define ID_EDIT_READONLY 1302 +#define ID_EDIT_MODIFIED 1303 +#define ID_EDIT_CHARFORMAT 1304 +#define ID_EDIT_PARAFORMAT 1305 +#define ID_EDIT_DEFCHARFORMAT 1306 +#define ID_EDIT_UNDO 1307 +#define ID_EDIT_REDO 1308 +#define ID_EDIT_GETTEXT 1309 +#define ID_EDIT_COPY 1310 +#define ID_EDIT_CUT 1311 + +#define ID_FORMAT_BOLD 1400 +#define ID_FORMAT_ITALIC 1401 +#define ID_FORMAT_UNDERLINE 1402 + +#define IDC_STATUSBAR 2000 +#define IDC_EDITOR 2001 +#define IDC_TOOLBAR 2002 +#define IDC_REBAR 2003 +#define IDC_COMBO 2004 + +#define IDB_TOOLBAR 100 Added: trunk/reactos/base/applications/wordpad/rsrc.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/r…
============================================================================== --- trunk/reactos/base/applications/wordpad/rsrc.rc (added) +++ trunk/reactos/base/applications/wordpad/rsrc.rc Wed Mar 29 01:15:04 2006 @@ -1,0 +1,52 @@ +/* + * Copyright 2004 by Krzysztof Foltman + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include <windows.h> +#include "resource.h" + +MAINACCELTABLE ACCELERATORS +BEGIN + "1", ID_BACK_1, VIRTKEY, CONTROL + "2", ID_BACK_2, VIRTKEY, CONTROL + "L", ID_ALIGN_LEFT, VIRTKEY, CONTROL + "E", ID_ALIGN_CENTER, VIRTKEY, CONTROL + "R", ID_ALIGN_RIGHT, VIRTKEY, CONTROL + "A", ID_EDIT_SELECTALL, VIRTKEY, CONTROL + "X", ID_EDIT_CUT, VIRTKEY, CONTROL + "C", ID_EDIT_COPY, VIRTKEY, CONTROL + "Z", ID_EDIT_UNDO, VIRTKEY, CONTROL + "Y", ID_EDIT_REDO, VIRTKEY, CONTROL + "B", ID_FORMAT_BOLD, VIRTKEY, CONTROL + "I", ID_FORMAT_ITALIC, VIRTKEY, CONTROL + "U", ID_FORMAT_UNDERLINE,VIRTKEY, CONTROL + "N", ID_FILE_NEW, VIRTKEY, CONTROL + "O", ID_FILE_OPEN, VIRTKEY, CONTROL + "S", ID_FILE_SAVE, VIRTKEY, CONTROL +END + +/* toolbar.bmp */ +IDB_TOOLBAR BITMAP toolbar.bmp + +#include "De.rc" +#include "En.rc" +#include "Fr.rc" +#include "Ko.rc" +#include "Nl.rc" +#include "No.rc" +#include "Ru.rc" +#include "Tr.rc" Added: trunk/reactos/base/applications/wordpad/toolbar.bmp URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/t…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/base/applications/wordpad/toolbar.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/base/applications/wordpad/wordpad.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/w…
============================================================================== --- trunk/reactos/base/applications/wordpad/wordpad.c (added) +++ trunk/reactos/base/applications/wordpad/wordpad.c Wed Mar 29 01:15:04 2006 @@ -1,0 +1,513 @@ +/* + * Wordpad implementation + * + * Copyright 2004 by Krzysztof Foltman + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#define WIN32_LEAN_AND_MEAN + +#include <stdarg.h> +#include <ctype.h> +#include <stdio.h> +#include <assert.h> + +#include <windows.h> +#include <richedit.h> +#include <commctrl.h> + +#include "resource.h" + + +/* use LoadString */ +static const WCHAR xszAppTitle[] = {'W','i','n','e',' ','W','o','r','d','p','a','d',0}; +static const WCHAR xszMainMenu[] = {'M','A','I','N','M','E','N','U',0}; + +static const WCHAR wszRichEditClass[] = {'R','I','C','H','E','D','I','T','2','0','W',0}; +static const WCHAR wszMainWndClass[] = {'W','O','R','D','P','A','D','T','O','P',0}; +static const WCHAR wszAppTitle[] = {'W','i','n','e',' ','W','o','r','d','p','a','d',0}; + +static HWND hMainWnd = NULL; + +void AddButton(HWND hwndToolBar, int nImage, int nCommand) +{ + TBBUTTON button; + + ZeroMemory(&button, sizeof(button)); + button.iBitmap = nImage; + button.idCommand = nCommand; + button.fsState = TBSTATE_ENABLED; + button.fsStyle = TBSTYLE_BUTTON; + button.dwData = 0; + button.iString = -1; + SendMessage(hwndToolBar, TB_ADDBUTTONS, 1, (LPARAM)&button); +} + +void AddSeparator(HWND hwndToolBar) +{ + TBBUTTON button; + + ZeroMemory(&button, sizeof(button)); + button.iBitmap = -1; + button.idCommand = 0; + button.fsState = 0; + button.fsStyle = TBSTYLE_SEP; + button.dwData = 0; + button.iString = -1; + SendMessage(hwndToolBar, TB_ADDBUTTONS, 1, (LPARAM)&button); +} + +static LRESULT OnCreate( HWND hWnd, WPARAM wParam, LPARAM lParam) +{ + HWND hEditorWnd, hToolBarWnd, hReBarWnd; + HINSTANCE hInstance = (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE); + HANDLE hDLL; + TBADDBITMAP ab; + int nStdBitmaps = 0; + REBARINFO rbi; + REBARBANDINFO rbb; + + CreateStatusWindow(CCS_NODIVIDER|WS_CHILD|WS_VISIBLE, "RichEdit text", hWnd, IDC_STATUSBAR); + + hReBarWnd = CreateWindowEx(WS_EX_TOOLWINDOW, REBARCLASSNAME, NULL, + CCS_NODIVIDER|WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|RBS_VARHEIGHT|CCS_TOP, + CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, hWnd, (HMENU)IDC_REBAR, hInstance, NULL); + + rbi.cbSize = sizeof(rbi); + rbi.fMask = 0; + rbi.himl = NULL; + if(!SendMessage(hReBarWnd, RB_SETBARINFO, 0, (LPARAM)&rbi)) + return -1; + + hToolBarWnd = CreateToolbarEx(hReBarWnd, CCS_NOPARENTALIGN|CCS_NODIVIDER|CCS_NOMOVEY|WS_VISIBLE|WS_CHILD|TBSTYLE_TOOLTIPS|TBSTYLE_FLAT, + IDC_TOOLBAR, + 3, hInstance, IDB_TOOLBAR, + NULL, 0, + 24, 24, 16, 16, sizeof(TBBUTTON)); + + ab.hInst = HINST_COMMCTRL; + ab.nID = IDB_STD_SMALL_COLOR; + nStdBitmaps = SendMessage(hToolBarWnd, TB_ADDBITMAP, 3, (LPARAM)&ab); + AddButton(hToolBarWnd, nStdBitmaps+STD_FILENEW, ID_FILE_NEW); + AddButton(hToolBarWnd, nStdBitmaps+STD_FILEOPEN, ID_FILE_OPEN); + AddButton(hToolBarWnd, nStdBitmaps+STD_FILESAVE, ID_FILE_SAVE); + AddSeparator(hToolBarWnd); + AddButton(hToolBarWnd, nStdBitmaps+STD_CUT, ID_EDIT_CUT); + AddButton(hToolBarWnd, nStdBitmaps+STD_COPY, ID_EDIT_COPY); + AddSeparator(hToolBarWnd); + AddButton(hToolBarWnd, nStdBitmaps+STD_UNDO, ID_EDIT_UNDO); + AddButton(hToolBarWnd, nStdBitmaps+STD_REDOW, ID_EDIT_REDO); + AddSeparator(hToolBarWnd); + AddButton(hToolBarWnd, 0, ID_FORMAT_BOLD); + AddButton(hToolBarWnd, 1, ID_FORMAT_ITALIC); + AddButton(hToolBarWnd, 2, ID_FORMAT_UNDERLINE); + + SendMessage(hToolBarWnd, TB_ADDSTRING, 0, (LPARAM)"Exit\0"); + SendMessage(hToolBarWnd, TB_AUTOSIZE, 0, 0); + + rbb.cbSize = sizeof(rbb); + rbb.fMask = RBBIM_SIZE | RBBIM_CHILDSIZE | RBBIM_CHILD | RBBIM_STYLE; + rbb.fStyle = RBBS_CHILDEDGE; + rbb.cx = 500; + rbb.hwndChild = hToolBarWnd; + rbb.cxMinChild = 0; + rbb.cyChild = rbb.cyMinChild = HIWORD(SendMessage(hToolBarWnd, TB_GETBUTTONSIZE, 0, 0)); + + SendMessage(hReBarWnd, RB_INSERTBAND, -1, (LPARAM)&rbb); + + hDLL = LoadLibrary("RICHED20.DLL"); + assert(hDLL); + + hEditorWnd = CreateWindowExW(WS_EX_CLIENTEDGE, wszRichEditClass, NULL, + WS_CHILD|WS_VISIBLE|ES_MULTILINE|ES_AUTOVSCROLL|ES_WANTRETURN, + 0, 0, 1000, 100, hWnd, (HMENU)IDC_EDITOR, hInstance, NULL); + if (!hEditorWnd) + { + fprintf(stderr, "Error code %lu\n", GetLastError()); + return -1; + } + assert(hEditorWnd); + + SetFocus(hEditorWnd); + SendMessage(hEditorWnd, EM_SETEVENTMASK, 0, ENM_SELCHANGE); + return 0; +} + +static LRESULT OnUser( HWND hWnd, WPARAM wParam, LPARAM lParam) +{ + HWND hwndEditor = GetDlgItem(hWnd, IDC_EDITOR); + HWND hwndReBar = GetDlgItem(hWnd, IDC_REBAR); + HWND hwndToolBar = GetDlgItem(hwndReBar, IDC_TOOLBAR); + int from, to; + CHARFORMAT2W fmt; + + ZeroMemory(&fmt, sizeof(fmt)); + fmt.cbSize = sizeof(fmt); + + SendMessage(hwndEditor, EM_GETCHARFORMAT, TRUE, (LPARAM)&fmt); + + SendMessage(hwndEditor, EM_GETSEL, (WPARAM)&from, (LPARAM)&to); + SendMessage(hwndToolBar, TB_ENABLEBUTTON, ID_EDIT_UNDO, + SendMessage(hwndEditor, EM_CANUNDO, 0, 0)); + SendMessage(hwndToolBar, TB_ENABLEBUTTON, ID_EDIT_REDO, + SendMessage(hwndEditor, EM_CANREDO, 0, 0)); + SendMessage(hwndToolBar, TB_ENABLEBUTTON, ID_EDIT_CUT, from == to ? 0 : 1); + SendMessage(hwndToolBar, TB_ENABLEBUTTON, ID_EDIT_COPY, from == to ? 0 : 1); + SendMessage(hwndToolBar, TB_CHECKBUTTON, ID_FORMAT_BOLD, (fmt.dwMask & CFM_BOLD) && (fmt.dwEffects & CFE_BOLD)); + SendMessage(hwndToolBar, TB_INDETERMINATE, ID_FORMAT_BOLD, !(fmt.dwMask & CFM_BOLD)); + SendMessage(hwndToolBar, TB_CHECKBUTTON, ID_FORMAT_ITALIC, (fmt.dwMask & CFM_ITALIC) && (fmt.dwEffects & CFE_ITALIC)); + SendMessage(hwndToolBar, TB_INDETERMINATE, ID_FORMAT_ITALIC, !(fmt.dwMask & CFM_ITALIC)); + SendMessage(hwndToolBar, TB_CHECKBUTTON, ID_FORMAT_UNDERLINE, (fmt.dwMask & CFM_UNDERLINE) && (fmt.dwEffects & CFE_UNDERLINE)); + SendMessage(hwndToolBar, TB_INDETERMINATE, ID_FORMAT_UNDERLINE, !(fmt.dwMask & CFM_UNDERLINE)); + return 0; +} + +static LRESULT OnNotify( HWND hWnd, WPARAM wParam, LPARAM lParam) +{ + HWND hwndEditor = GetDlgItem(hWnd, IDC_EDITOR); + NMHDR *pHdr = (NMHDR *)lParam; + + if (pHdr->hwndFrom != hwndEditor) + return 0; + + if (pHdr->code == EN_SELCHANGE) + { + SELCHANGE *pSC = (SELCHANGE *)lParam; + char buf[128]; + + sprintf( buf,"selection = %ld..%ld, line count=%ld\n", + pSC->chrg.cpMin, pSC->chrg.cpMax, + SendMessage(hwndEditor, EM_GETLINECOUNT, 0, 0)); + SetWindowText(GetDlgItem(hWnd, IDC_STATUSBAR), buf); + SendMessage(hWnd, WM_USER, 0, 0); + return 1; + } + return 0; +} + +static LRESULT OnCommand( HWND hWnd, WPARAM wParam, LPARAM lParam) +{ + HWND hwndEditor = GetDlgItem(hWnd, IDC_EDITOR); + + if ((HWND)lParam == hwndEditor) + return 0; + + switch(LOWORD(wParam)) + { + case ID_FILE_EXIT: + PostMessage(hWnd, WM_CLOSE, 0, 0); + break; + + case ID_FILE_NEW: + SetWindowTextA(hwndEditor, ""); + /* FIXME: set default format too */ + break; + + case ID_FILE_OPEN: + case ID_FILE_SAVE: + MessageBox(hWnd, "Open/Save not implemented", "WordPad", MB_OK); + break; + + case ID_FORMAT_BOLD: + case ID_FORMAT_ITALIC: + case ID_FORMAT_UNDERLINE: + { + CHARFORMAT2W fmt; + int mask = CFM_BOLD; + if (LOWORD(wParam) == ID_FORMAT_ITALIC) mask = CFM_ITALIC; + if (LOWORD(wParam) == ID_FORMAT_UNDERLINE) mask = CFM_UNDERLINE; + + ZeroMemory(&fmt, sizeof(fmt)); + fmt.cbSize = sizeof(fmt); + SendMessage(hwndEditor, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&fmt); + if (!(fmt.dwMask&mask)) + fmt.dwEffects |= mask; + else + fmt.dwEffects ^= mask; + fmt.dwMask = mask; + SendMessage(hwndEditor, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&fmt); + break; + } + + case ID_EDIT_CUT: + PostMessage(hwndEditor, WM_CUT, 0, 0); + break; + + case ID_EDIT_COPY: + PostMessage(hwndEditor, WM_COPY, 0, 0); + break; + + case ID_EDIT_SELECTALL: + { + CHARRANGE range = {0, -1}; + SendMessage(hwndEditor, EM_EXSETSEL, 0, (LPARAM)&range); + /* SendMessage(hwndEditor, EM_SETSEL, 0, -1); */ + return 0; + } + + case ID_EDIT_GETTEXT: + { + int nLen = GetWindowTextLengthW(hwndEditor); + LPWSTR data = HeapAlloc( GetProcessHeap(), 0, (nLen+1)*sizeof(WCHAR) ); + TEXTRANGEW tr; + + GetWindowTextW(hwndEditor, data, nLen+1); + MessageBoxW(NULL, data, xszAppTitle, MB_OK); + + HeapFree( GetProcessHeap(), 0, data); + data = HeapAlloc(GetProcessHeap(), 0, (nLen+1)*sizeof(WCHAR)); + tr.chrg.cpMin = 0; + tr.chrg.cpMax = nLen; + tr.lpstrText = data; + SendMessage (hwndEditor, EM_GETTEXTRANGE, 0, (LPARAM)&tr); + MessageBoxW(NULL, data, xszAppTitle, MB_OK); + HeapFree( GetProcessHeap(), 0, data ); + + /* SendMessage(hwndEditor, EM_SETSEL, 0, -1); */ + return 0; + } + + case ID_EDIT_CHARFORMAT: + case ID_EDIT_DEFCHARFORMAT: + { + CHARFORMAT2W cf; + LRESULT i; + ZeroMemory(&cf, sizeof(cf)); + cf.cbSize = sizeof(cf); + cf.dwMask = 0; + i = SendMessage(hwndEditor, EM_GETCHARFORMAT, + LOWORD(wParam) == ID_EDIT_CHARFORMAT, (LPARAM)&cf); + return 0; + } + + case ID_EDIT_PARAFORMAT: + { + PARAFORMAT2 pf; + ZeroMemory(&pf, sizeof(pf)); + pf.cbSize = sizeof(pf); + SendMessage(hwndEditor, EM_GETPARAFORMAT, 0, (LPARAM)&pf); + return 0; + } + + case ID_EDIT_SELECTIONINFO: + { + CHARRANGE range = {0, -1}; + char buf[128]; + WCHAR *data = NULL; + + SendMessage(hwndEditor, EM_EXGETSEL, 0, (LPARAM)&range); + data = HeapAlloc(GetProcessHeap(), 0, sizeof(*data) * (range.cpMax-range.cpMin+1)); + SendMessage(hwndEditor, EM_GETSELTEXT, 0, (LPARAM)data); + sprintf(buf, "Start = %ld, End = %ld", range.cpMin, range.cpMax); + MessageBoxA(hWnd, buf, "Editor", MB_OK); + MessageBoxW(hWnd, data, xszAppTitle, MB_OK); + HeapFree( GetProcessHeap(), 0, data); + /* SendMessage(hwndEditor, EM_SETSEL, 0, -1); */ + return 0; + } + + case ID_EDIT_READONLY: + { + long nStyle = GetWindowLong(hwndEditor, GWL_STYLE); + if (nStyle & ES_READONLY) + SendMessage(hwndEditor, EM_SETREADONLY, 0, 0); + else + SendMessage(hwndEditor, EM_SETREADONLY, 1, 0); + return 0; + } + + case ID_EDIT_MODIFIED: + if (SendMessage(hwndEditor, EM_GETMODIFY, 0, 0)) + SendMessage(hwndEditor, EM_SETMODIFY, 0, 0); + else + SendMessage(hwndEditor, EM_SETMODIFY, 1, 0); + return 0; + + case ID_EDIT_UNDO: + SendMessage(hwndEditor, EM_UNDO, 0, 0); + return 0; + + case ID_EDIT_REDO: + SendMessage(hwndEditor, EM_REDO, 0, 0); + return 0; + + case ID_ALIGN_LEFT: + case ID_ALIGN_CENTER: + case ID_ALIGN_RIGHT: + { + PARAFORMAT2 pf; + + pf.cbSize = sizeof(pf); + pf.dwMask = PFM_ALIGNMENT; + switch(LOWORD(wParam)) { + case ID_ALIGN_LEFT: pf.wAlignment = PFA_LEFT; break; + case ID_ALIGN_CENTER: pf.wAlignment = PFA_CENTER; break; + case ID_ALIGN_RIGHT: pf.wAlignment = PFA_RIGHT; break; + } + SendMessage(hwndEditor, EM_SETPARAFORMAT, 0, (LPARAM)&pf); + break; + } + + case ID_BACK_1: + SendMessage(hwndEditor, EM_SETBKGNDCOLOR, 1, 0); + break; + + case ID_BACK_2: + SendMessage(hwndEditor, EM_SETBKGNDCOLOR, 0, RGB(255,255,192)); + break; + + default: + SendMessage(hwndEditor, WM_COMMAND, wParam, lParam); + break; + } + return 0; +} + +static LRESULT OnInitPopupMenu( HWND hWnd, WPARAM wParam, LPARAM lParam ) +{ + HMENU hMenu = (HMENU)wParam; + HWND hwndEditor = GetDlgItem(hWnd, IDC_EDITOR); + PARAFORMAT pf; + int nAlignment = -1; + + pf.cbSize = sizeof(PARAFORMAT); + SendMessage(hwndEditor, EM_GETPARAFORMAT, 0, (LPARAM)&pf); + CheckMenuItem(hMenu, ID_EDIT_READONLY, + MF_BYCOMMAND|(GetWindowLong(hwndEditor, GWL_STYLE)&ES_READONLY ? MF_CHECKED : MF_UNCHECKED)); + CheckMenuItem(hMenu, ID_EDIT_MODIFIED, + MF_BYCOMMAND|(SendMessage(hwndEditor, EM_GETMODIFY, 0, 0) ? MF_CHECKED : MF_UNCHECKED)); + if (pf.dwMask & PFM_ALIGNMENT) + nAlignment = pf.wAlignment; + CheckMenuItem(hMenu, ID_ALIGN_LEFT, MF_BYCOMMAND|(nAlignment == PFA_LEFT) ? MF_CHECKED : MF_UNCHECKED); + CheckMenuItem(hMenu, ID_ALIGN_CENTER, MF_BYCOMMAND|(nAlignment == PFA_CENTER) ? MF_CHECKED : MF_UNCHECKED); + CheckMenuItem(hMenu, ID_ALIGN_RIGHT, MF_BYCOMMAND|(nAlignment == PFA_RIGHT) ? MF_CHECKED : MF_UNCHECKED); + EnableMenuItem(hMenu, ID_EDIT_UNDO, MF_BYCOMMAND|(SendMessage(hwndEditor, EM_CANUNDO, 0, 0)) ? MF_ENABLED : MF_GRAYED); + EnableMenuItem(hMenu, ID_EDIT_REDO, MF_BYCOMMAND|(SendMessage(hwndEditor, EM_CANREDO, 0, 0)) ? MF_ENABLED : MF_GRAYED); + return 0; +} + +static LRESULT OnSize( HWND hWnd, WPARAM wParam, LPARAM lParam ) +{ + int nStatusSize = 0, nTBSize = 0; + RECT rc; + HWND hwndEditor = GetDlgItem(hWnd, IDC_EDITOR); + HWND hwndStatusBar = GetDlgItem(hWnd, IDC_STATUSBAR); + HWND hwndReBar = GetDlgItem(hWnd, IDC_REBAR); + HWND hwndToolBar = GetDlgItem(hwndReBar, IDC_TOOLBAR); + + if (hwndStatusBar) + { + SendMessage(hwndStatusBar, WM_SIZE, 0, 0); + GetClientRect(hwndStatusBar, &rc); + nStatusSize = rc.bottom - rc.top; + } + if (hwndToolBar) + { + rc.left = rc.top = 0; + rc.right = LOWORD(lParam); + rc.bottom = HIWORD(lParam); + SendMessage(hwndToolBar, TB_AUTOSIZE, 0, 0); + SendMessage(hwndReBar, RB_SIZETORECT, 0, (LPARAM)&rc); + nTBSize = SendMessage(hwndReBar, RB_GETBARHEIGHT, 0, 0); + GetClientRect(hwndReBar, &rc); + MoveWindow(hwndReBar, 0, 0, LOWORD(lParam), rc.right, FALSE); + } + if (hwndEditor) + { + GetClientRect(hWnd, &rc); + MoveWindow(hwndEditor, 0, nTBSize, rc.right, rc.bottom-nStatusSize-nTBSize, TRUE); + } + + return DefWindowProcW(hWnd, WM_SIZE, wParam, lParam); +} + +LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch(msg) + { + case WM_CREATE: + return OnCreate( hWnd, wParam, lParam ); + + case WM_USER: + return OnUser( hWnd, wParam, lParam ); + + case WM_NOTIFY: + return OnNotify( hWnd, wParam, lParam ); + + case WM_COMMAND: + return OnCommand( hWnd, wParam, lParam ); + + case WM_DESTROY: + PostQuitMessage(0); + break; + + case WM_ACTIVATE: + if (LOWORD(wParam)) + SetFocus(GetDlgItem(hWnd, IDC_EDITOR)); + return 0; + + case WM_INITMENUPOPUP: + return OnInitPopupMenu( hWnd, wParam, lParam ); + + case WM_SIZE: + return OnSize( hWnd, wParam, lParam ); + + default: + return DefWindowProcW(hWnd, msg, wParam, lParam); + } + + return 0; +} + +int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hOldInstance, LPSTR szCmdParagraph, int res) +{ + INITCOMMONCONTROLSEX classes = {8, ICC_BAR_CLASSES|ICC_COOL_CLASSES}; + HACCEL hAccel; + WNDCLASSW wc; + MSG msg; + + InitCommonControlsEx(&classes); + + hAccel = LoadAccelerators(hInstance, "MAINACCELTABLE"); + + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.lpfnWndProc = WndProc; + wc.cbClsExtra = 0; + wc.cbWndExtra = 4; + wc.hInstance = hInstance; + wc.hIcon = NULL; + wc.hCursor = LoadCursor(NULL, IDC_IBEAM); + wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW); + wc.lpszMenuName = xszMainMenu; + wc.lpszClassName = wszMainWndClass; + RegisterClassW(&wc); + + hMainWnd = CreateWindowExW(0, wszMainWndClass, wszAppTitle, WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, CW_USEDEFAULT, 680, 260, NULL, NULL, hInstance, NULL); + ShowWindow(hMainWnd, SW_SHOWMAXIMIZED); + + while(GetMessage(&msg,0,0,0)) + { + if (TranslateAccelerator(hMainWnd, hAccel, &msg)) + continue; + TranslateMessage(&msg); + DispatchMessage(&msg); + if (!PeekMessage(&msg, 0, 0, 0, PM_NOREMOVE)) + SendMessage(hMainWnd, WM_USER, 0, 0); + } + + return 0; +} Added: trunk/reactos/base/applications/wordpad/wordpad.rbuild URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/w…
============================================================================== --- trunk/reactos/base/applications/wordpad/wordpad.rbuild (added) +++ trunk/reactos/base/applications/wordpad/wordpad.rbuild Wed Mar 29 01:15:04 2006 @@ -1,0 +1,14 @@ +<module name="wordpad" type="win32gui" installbase="system32" installname="wordpad.exe"> + <include base="wordpad">.</include> + <define name="__USE_W32API" /> + <define name="_WIN32_IE">0x0501</define> + <library>kernel32</library> + <library>user32</library> + <library>gdi32</library> + <library>comdlg32</library> + <library>advapi32</library> + <library>shell32</library> + <library>comctl32</library> + <file>wordpad.c</file> + <file>rsrc.rc</file> +</module>
19 years
1
0
0
0
[gedmurphy] 21402: tag wine-20050328
by aleksey@studiocerebral.com
Author: gedmurphy Date: Tue Mar 28 18:41:39 2006 New Revision: 21402 URL:
http://svn.reactos.ru/svn/reactos?rev=21402&view=rev
Log: tag wine-20050328 Added: vendor/wine/dlls/comctl32/wine-20050328/ - copied from r21400, vendor/wine/dlls/comctl32/current/ vendor/wine/dlls/comctl32/wine-20050328/comctl32undoc.c - copied unchanged from r21401, vendor/wine/dlls/comctl32/current/comctl32undoc.c vendor/wine/dlls/comctl32/wine-20050328/listview.c - copied unchanged from r21401, vendor/wine/dlls/comctl32/current/listview.c vendor/wine/dlls/comctl32/wine-20050328/rebar.c - copied unchanged from r21401, vendor/wine/dlls/comctl32/current/rebar.c vendor/wine/dlls/comctl32/wine-20050328/tab.c - copied unchanged from r21401, vendor/wine/dlls/comctl32/current/tab.c vendor/wine/dlls/comctl32/wine-20050328/tooltips.c - copied unchanged from r21401, vendor/wine/dlls/comctl32/current/tooltips.c Removed: vendor/wine/dlls/comctl32/Wine-0_9_10/
19 years
1
0
0
0
[gedmurphy] 21401: 20060328 vendor drop
by aleksey@studiocerebral.com
Author: gedmurphy Date: Tue Mar 28 17:29:37 2006 New Revision: 21401 URL:
http://svn.reactos.ru/svn/reactos?rev=21401&view=rev
Log: 20060328 vendor drop Modified: vendor/wine/dlls/comctl32/current/comctl32undoc.c vendor/wine/dlls/comctl32/current/listview.c vendor/wine/dlls/comctl32/current/rebar.c vendor/wine/dlls/comctl32/current/tab.c vendor/wine/dlls/comctl32/current/tooltips.c Modified: vendor/wine/dlls/comctl32/current/comctl32undoc.c URL:
http://svn.reactos.ru/svn/reactos/vendor/wine/dlls/comctl32/current/comctl3…
============================================================================== --- vendor/wine/dlls/comctl32/current/comctl32undoc.c (original) +++ vendor/wine/dlls/comctl32/current/comctl32undoc.c Tue Mar 28 17:29:37 2006 @@ -386,10 +386,8 @@ UINT i; LPSTR dataA = NULL; - if (!mp->extview.lpfnCompare) { - ERR("MRU list not properly created. No compare procedure.\n"); + if (!mp->extview.lpfnCompare) return -1; - } if(!(mp->extview.dwFlags & MRUF_BINARY_LIST) && !mp->isUnicode) { DWORD len = WideCharToMultiByte(CP_ACP, 0, lpData, -1, Modified: vendor/wine/dlls/comctl32/current/listview.c URL:
http://svn.reactos.ru/svn/reactos/vendor/wine/dlls/comctl32/current/listvie…
============================================================================== --- vendor/wine/dlls/comctl32/current/listview.c (original) +++ vendor/wine/dlls/comctl32/current/listview.c Tue Mar 28 17:29:37 2006 @@ -6740,7 +6740,7 @@ hdi.mask = HDI_TEXT; hdi.cchTextMax = DISP_TEXT_SIZE; hdi.pszText = szDispText; - if (Header_GetItemW(infoPtr->hwndHeader, nColumn, (LPARAM)&hdi)) + if (Header_GetItemW(infoPtr->hwndHeader, nColumn, &hdi)) { HDC hdc = GetDC(infoPtr->hwndSelf); HFONT old_font = SelectObject(hdc, (HFONT)SendMessageW(infoPtr->hwndHeader, WM_GETFONT, 0, 0)); @@ -6762,7 +6762,7 @@ hdi.mask = HDI_WIDTH; hdi.cxy = cx; TRACE("hdi.cxy=%d\n", hdi.cxy); - return Header_SetItemW(infoPtr->hwndHeader, nColumn, (LPARAM)&hdi); + return Header_SetItemW(infoPtr->hwndHeader, nColumn, &hdi); } /*** @@ -8385,7 +8385,7 @@ HDITEMW hdi; hdi.mask = HDI_WIDTH; - if (!Header_GetItemW(infoPtr->hwndHeader, lpnmh->iItem, (LPARAM)&hdi)) return 0; + if (!Header_GetItemW(infoPtr->hwndHeader, lpnmh->iItem, &hdi)) return 0; cxy = hdi.cxy; } else Modified: vendor/wine/dlls/comctl32/current/rebar.c URL:
http://svn.reactos.ru/svn/reactos/vendor/wine/dlls/comctl32/current/rebar.c…
============================================================================== --- vendor/wine/dlls/comctl32/current/rebar.c (original) +++ vendor/wine/dlls/comctl32/current/rebar.c Tue Mar 28 17:29:37 2006 @@ -1920,7 +1920,7 @@ y = clientcy; } if (infoPtr->dwStyle & CCS_VERT) { - if( x < REBAR_MINSIZE ) + if( infoPtr->uNumBands != 0 && x < REBAR_MINSIZE ) x = REBAR_MINSIZE; infoPtr->calcSize.cx = x; infoPtr->calcSize.cy = clientcy; @@ -1929,7 +1929,7 @@ if (notify && (x != origheight)) infoPtr->fStatus |= NTF_HGHTCHG; } else { - if( y < REBAR_MINSIZE ) + if( infoPtr->uNumBands != 0 && y < REBAR_MINSIZE ) y = REBAR_MINSIZE; infoPtr->calcSize.cx = clientcx; infoPtr->calcSize.cy = y; Modified: vendor/wine/dlls/comctl32/current/tab.c URL:
http://svn.reactos.ru/svn/reactos/vendor/wine/dlls/comctl32/current/tab.c?r…
============================================================================== --- vendor/wine/dlls/comctl32/current/tab.c (original) +++ vendor/wine/dlls/comctl32/current/tab.c Tue Mar 28 17:29:37 2006 @@ -1747,13 +1747,19 @@ if(lStyle & TCS_VERTICAL) { center_offset_h = ((drawRect->bottom - drawRect->top) - (cy + infoPtr->uHItemPadding + (rcText.right - rcText.left))) / 2; - center_offset_v = ((drawRect->right - drawRect->left) - (cx + infoPtr->uVItemPadding)) / 2; + center_offset_v = (drawRect->left + (drawRect->right - drawRect->left) - cx) / 2; } else { center_offset_h = ((drawRect->right - drawRect->left) - (cx + infoPtr->uHItemPadding + (rcText.right - rcText.left))) / 2; - center_offset_v = ((drawRect->bottom - drawRect->top) - (cy + infoPtr->uVItemPadding)) / 2; + center_offset_v = (drawRect->top + (drawRect->bottom - drawRect->top) - cy) / 2; } + + /* if an item is selected, the icon is shifted up instead of down */ + if (iItem == infoPtr->iSelected) + center_offset_v -= infoPtr->uVItemPadding / 2; + else + center_offset_v += infoPtr->uVItemPadding / 2; if (lStyle & TCS_FIXEDWIDTH && lStyle & (TCS_FORCELABELLEFT | TCS_FORCEICONLEFT)) center_offset_h = infoPtr->uHItemPadding; Modified: vendor/wine/dlls/comctl32/current/tooltips.c URL:
http://svn.reactos.ru/svn/reactos/vendor/wine/dlls/comctl32/current/tooltip…
============================================================================== --- vendor/wine/dlls/comctl32/current/tooltips.c (original) +++ vendor/wine/dlls/comctl32/current/tooltips.c Tue Mar 28 17:29:37 2006 @@ -2025,7 +2025,8 @@ else { if ( (toolPtr->lpszText) && !IS_INTRESOURCE(toolPtr->lpszText) ) { - Free (toolPtr->lpszText); + if( toolPtr->lpszText != LPSTR_TEXTCALLBACKW) + Free (toolPtr->lpszText); toolPtr->lpszText = NULL; } if (lpToolInfo->lpszText) { @@ -2082,7 +2083,8 @@ else { if ( (toolPtr->lpszText) && !IS_INTRESOURCE(toolPtr->lpszText) ) { - Free (toolPtr->lpszText); + if( toolPtr->lpszText != LPSTR_TEXTCALLBACKW) + Free (toolPtr->lpszText); toolPtr->lpszText = NULL; } if (lpToolInfo->lpszText) { @@ -2208,7 +2210,8 @@ else { if ( (toolPtr->lpszText) && !IS_INTRESOURCE(toolPtr->lpszText) ) { - Free (toolPtr->lpszText); + if( toolPtr->lpszText != LPSTR_TEXTCALLBACKW) + Free (toolPtr->lpszText); toolPtr->lpszText = NULL; } if (lpToolInfo->lpszText) { @@ -2265,7 +2268,8 @@ else { if ( (toolPtr->lpszText) && !IS_INTRESOURCE(toolPtr->lpszText) ) { - Free (toolPtr->lpszText); + if( toolPtr->lpszText != LPSTR_TEXTCALLBACKW) + Free (toolPtr->lpszText); toolPtr->lpszText = NULL; } if (lpToolInfo->lpszText) {
19 years
1
0
0
0
← Newer
1
2
3
4
5
6
7
Older →
Jump to page:
1
2
3
4
5
6
7
Results per page:
10
25
50
100
200