ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
December 2021
----- 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
33 participants
155 discussions
Start a n
N
ew thread
[reactos] 01/01: [ROSAPPS] Remove 'man' utility
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b34b47056a5d68d4d47e2…
commit b34b47056a5d68d4d47e2bab3769ab3656dcdfdc Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Sun Oct 3 17:32:33 2021 +0200 Commit: Victor Perevertkin <victor(a)perevertkin.ru> CommitDate: Tue Dec 28 01:59:17 2021 +0300 [ROSAPPS] Remove 'man' utility --- .../rosapps/applications/sysutils/CMakeLists.txt | 1 - .../applications/sysutils/man/CMakeLists.txt | 5 - modules/rosapps/applications/sysutils/man/man.c | 259 --------------------- modules/rosapps/applications/sysutils/man/man.cmd | 54 ----- .../applications/sysutils/man/man/2/chkdsk.man | 13 -- .../applications/sysutils/man/man/2/chklib.man | 8 - .../applications/sysutils/man/man/2/format.man | 22 -- .../applications/sysutils/man/man/2/man.man | 21 -- .../applications/sysutils/man/man/2/ping.man | 13 -- .../applications/sysutils/man/man/3/taskmgr.man | 8 - .../rosapps/applications/sysutils/man/man/foo.1 | 78 ------- .../rosapps/applications/sysutils/man/man/man.1 | 100 -------- .../applications/sysutils/man/used_tags.txt | 7 - 13 files changed, 589 deletions(-) diff --git a/modules/rosapps/applications/sysutils/CMakeLists.txt b/modules/rosapps/applications/sysutils/CMakeLists.txt index e19b0fc8fb0..70514805cb5 100644 --- a/modules/rosapps/applications/sysutils/CMakeLists.txt +++ b/modules/rosapps/applications/sysutils/CMakeLists.txt @@ -4,7 +4,6 @@ add_subdirectory(gettype) add_subdirectory(kill) add_subdirectory(logevent) add_subdirectory(lsdd) -add_subdirectory(man) if(ARCH STREQUAL "i386") add_subdirectory(pedump) endif() diff --git a/modules/rosapps/applications/sysutils/man/CMakeLists.txt b/modules/rosapps/applications/sysutils/man/CMakeLists.txt deleted file mode 100644 index 8c2a16a15f1..00000000000 --- a/modules/rosapps/applications/sysutils/man/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ - -add_executable(man man.c) -set_module_type(man win32cui) -add_importlibs(man user32 msvcrt kernel32 ntdll) -add_cd_file(TARGET man DESTINATION reactos/system32 FOR all) diff --git a/modules/rosapps/applications/sysutils/man/man.c b/modules/rosapps/applications/sysutils/man/man.c deleted file mode 100644 index 825b7954396..00000000000 --- a/modules/rosapps/applications/sysutils/man/man.c +++ /dev/null @@ -1,259 +0,0 @@ -/* - * FILE : man.c - * NATIVE NAME: ReactOS manual browser - * AUTHOR : Semyon Novikov (tappak) - * PROJECT : ReactOS Operating System - * DESCRIPTION: manual file browser (Use Linux man file syntax) - * DATE : 2004-03-29 - * LICENSE : GPL - */ - - /* Known issues. - * 1. Scroll screen - * 2. Non ENVIRONMENT manpath varrible - * 3. At the end of man page must be ./" tag! - */ - - -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <windows.h> -#include <wincon.h> - -#define MAXLINE 256 -#define BOLD 7|9 -#define ITALIC 3|9 -#define NORMAL 7|0 - -/*===[functions]===*/ -void SetCl(WORD cl); -int OpenF(char* name); -int CloseF(void); -void Usage(void); -int AnalyzeArgv(char *); -int AnalyzeFile(); -/*=================*/ - -/*====[Globals]====*/ -FILE* manfile; -char OpenFlag=0; -char manpath[MAX_PATH]; -/*=================*/ - -void -SetCl(WORD cl) -{ - SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),cl); -} - -int -OpenF(char* name) -{ - int ret = 0; - char *cp; - - /* C:\man\\... */ - cp = getenv("SystemDrive"); - if (cp && *cp) - { - strcpy(manpath, cp); - strcat(manpath, "\\man\\"); - } - else - { - strcpy(manpath, "C:\\man\\"); - } - strcat(manpath, name); - - manfile = fopen(manpath, "r"); - if (manfile != NULL) - { - OpenFlag = 1; - AnalyzeFile(); - } - else - { - ret = -1; - } - - return ret; -} - -int -CloseF() -{ - int retval=0; - - if(fclose(manfile)) - OpenFlag=0; - else retval=-1; - - return retval; -} - -void -Usage() -{ - puts("usage: man [command]"); - puts("see \"man man\" for details"); -} - -int -AnalyzeArgv(char *argument) -{ - int element; - char HelpFlag=0; - char *keys[]={"--help","/h","/?","-h"}; - char *sections[]={".1",".2",".3",".4",".5",".6",".7",".8",".9"}; - char *filename=(char*)malloc(sizeof(char)*MAXLINE); - - strcpy(filename,argument); //save argument value - - for(element=0;element<_countof(keys);element++) - { - if(!strcmp(keys[element],argument)) - { - Usage(); - HelpFlag=1; - } - } - - element = 0; - - if(!HelpFlag) - { - - if(OpenF(filename)) - { - while(element<_countof(sections)&&OpenF(strcat(filename,sections[element]))) - { - strcpy(filename,argument); - element++; - } - - if(element>=_countof(sections)) printf("No manual for %s\n",argument); - } - - } - - return element; -} - -void sh_outp(char *cur_string) -{ - int symbol; - putchar('\n'); - putchar('\n'); - for(symbol=3;putchar(cur_string[symbol]); symbol++); -} - -void th_outp(char *cur_string, char *THtag) -{ - int symbol; - putchar('\n'); - putchar('\n'); - putchar('\t'); - putchar('\t'); - SetCl(ITALIC); - for(symbol=3;putchar(THtag[symbol]); symbol++); - putchar('\n'); - SetCl(NORMAL); -} - -void text_outp(char *cur_string) -{ - int symbol=0; - - if(cur_string[0]=='.') - while(cur_string[symbol]!=' ') - symbol++; - - for(;cur_string[symbol]!='\n'; symbol++) - putchar(cur_string[symbol]); - - putchar(' '); -} - -int -AnalyzeFile() -{ - char *cur_string=(char*)malloc(sizeof(char)*MAXLINE); - char *THtag=(char*)malloc(sizeof(char)*MAXLINE); - - - - - while(fgets(cur_string,MAXLINE,manfile)) - -/* TAGs processing */ - if((cur_string[0]=='.')&&(cur_string[1]=='S')&& - (cur_string[2]=='H')) // .SH tag - { - SetCl(BOLD); - sh_outp(cur_string); - SetCl(NORMAL); - } - else - if((cur_string[0]=='.')&&(cur_string[1]=='I')&& - (cur_string[2]==' ')) // .I tag - { - SetCl(ITALIC); - text_outp(cur_string); - SetCl(NORMAL); - } - else - if((cur_string[0]=='.')&&(cur_string[1]=='/')&& - (cur_string[2]=='\"')); // ./" tag (comment) - - else - if((cur_string[0]=='.')&&(cur_string[1]=='T')&& - (cur_string[2]=='H')) // .TH tag - { - strcpy(THtag,cur_string); - } - else - if((cur_string[0]=='.')&&(cur_string[1]=='B')&& - (cur_string[2]==' ')) // .B tag - { - SetCl(BOLD); - text_outp(cur_string); - SetCl(NORMAL); - } - else - if((cur_string[0]=='.')&&(cur_string[1]=='N')&& - (cur_string[2]=='L')) - { - putchar('\n'); - putchar(' '); - } - - else - { - text_outp(cur_string); // print plane text - } - th_outp(cur_string, THtag); - /* END of TAGs processing */ - - free(cur_string); - free(THtag); - return 0; -} - - -int -main(int argc, char *argv[]) -{ - - switch(argc) - { - case 1: Usage(); break; - case 2: AnalyzeArgv(argv[1]);break; - default: Usage();break; - } - - if(OpenFlag)CloseF(); - SetCl(NORMAL); - return 0; -} - diff --git a/modules/rosapps/applications/sysutils/man/man.cmd b/modules/rosapps/applications/sysutils/man/man.cmd deleted file mode 100755 index 25bf70cd3a5..00000000000 --- a/modules/rosapps/applications/sysutils/man/man.cmd +++ /dev/null @@ -1,54 +0,0 @@ -@echo off -rem []------[ReactOS MAN Project ]--------[] -rem Project: ReactOS manual browser -rem File: man.cmd -rem Purpose: Clone of UNIX man -rem Programmers: Semyon Novikov -rem Version: 0.1.2 -rem OS: WinNT/ReactOS/os2 eCs(testing) -rem License: GPL -rem []------------------------------------[] - - -rem []==[Config area]==[] -set MANED=edit -set MANMORE=cat -set MAN=%WINDIR%\man -rem []==[End of config area]==[] - -goto chk_param - -:chk_param - - if "%4"=="/create" attrib -r %MAN%\%SECTION%\%1.man - if "%4"=="/create" %ED% %MAN%\%SECTION%\%1.man - if "%4"=="/create" goto end - - if "%2"=="/e" set ED=%MANED% - if "%2"=="/e" goto locate - - if "%3"=="/e" set ED=%MANED% - if "%3"=="/e" goto chk_section - - if "%2"=="" set ED=%MANMORE% - if "%2"=="" goto locate - -:chk_section - set SECTION=%2 - set ED=%MANMORE% - if "%3"=="/e" set ED=%MANED% -goto open_page - -:locate - if exist %MAN%\1\%1.man set SECTION=1 - if exist %MAN%\2\%1.man set SECTION=2 - if exist %MAN%\3\%1.man set SECTION=3 - if exist %MAN%\4\%1.man set SECTION=4 - if exist %MAN%\5\%1.man set SECTION=5 - -:open_page -if not exist %MAN%\%SECTION%\%1.man echo No manual for %1 -if exist %MAN%\%SECTION%\%1.man cls -if exist %MAN%\%SECTION%\%1.man %ED% %MAN%\%SECTION%\%1.man - -:end \ No newline at end of file diff --git a/modules/rosapps/applications/sysutils/man/man/2/chkdsk.man b/modules/rosapps/applications/sysutils/man/man/2/chkdsk.man deleted file mode 100644 index bdf5d686869..00000000000 --- a/modules/rosapps/applications/sysutils/man/man/2/chkdsk.man +++ /dev/null @@ -1,13 +0,0 @@ -[]==============================[chkdsk.exe]===============================[] - Author: Mark Russinovich - Purpose: Disk checking tool - Port on ROS: Emanuele Aliberti - License: GPL - - Usage: %s [drive:] [-F] [-V] [-R] [-C]\n\n\ - [drive:] Specifies the drive to check.\n\ - -F Fixes errors on the disk.\n\ - -V Displays the full path of every file on the disk.\n\ - -R Locates bad sectors and recovers readable information.\n\ - -C Checks the drive only if it is dirty.\n\n" - diff --git a/modules/rosapps/applications/sysutils/man/man/2/chklib.man b/modules/rosapps/applications/sysutils/man/man/2/chklib.man deleted file mode 100644 index 16dc082d03b..00000000000 --- a/modules/rosapps/applications/sysutils/man/man/2/chklib.man +++ /dev/null @@ -1,8 +0,0 @@ -[]===============================[chklib.exe]================================[] - - Purpose: Check a Dynamic Link Library (DLL) for loading - Author: Emanuele Aliberti - License: GPL - - Usage: chklib.exe module [symbol [, ...]] - diff --git a/modules/rosapps/applications/sysutils/man/man/2/format.man b/modules/rosapps/applications/sysutils/man/man/2/format.man deleted file mode 100644 index e69564d0ea8..00000000000 --- a/modules/rosapps/applications/sysutils/man/man/2/format.man +++ /dev/null @@ -1,22 +0,0 @@ -[]=================================[format.com]==============================[] - -Author: Mark Russinovich -Purpose: Disk Format Utility -Port on ROS: Emanuele Aliberti -License: GPL - -Usage:
format.com
drive: [-FS:file-system] [-V:label] [-Q] [-A:size] [-C] - - [drive:] Specifies the drive to format. - -FS:file-system Specifies the type of file system (e.g. FAT). - -V:label Specifies volume label. - -Q Performs a quick format. - -A:size Overrides the default allocation unit size. - Default settings are strongly recommended for general - use NTFS supports 512, 1024, 2048, 4096, 8192, 16K, - 32K, 64K. FAT supports 8192, 16K, 32K, 64K, 128K, 256K. - NTFS compression is not supported for allocation - unit sizes above 4096. - -C Files created on the new volume will be compressed by - default. - diff --git a/modules/rosapps/applications/sysutils/man/man/2/man.man b/modules/rosapps/applications/sysutils/man/man/2/man.man deleted file mode 100644 index 7d7529dfbe2..00000000000 --- a/modules/rosapps/applications/sysutils/man/man/2/man.man +++ /dev/null @@ -1,21 +0,0 @@ -[]=========================[ReactOS Man project]========================[] - - Author: Semyon Novikov <tappak> - Purpose: ReactOS manual browser and manual pages - License: GPL - - 1. Built in cmd.exe commands - 2. Console utils - 3. GUI utils - 4. Developer tools - 5. Games & other - - options: /e - open with editor - /create - create new page - - Usage: man [command] [section] [/e] [/create] - Example: o man man - o man man /e - o man man 2 - o man quake3 5 /e /create - diff --git a/modules/rosapps/applications/sysutils/man/man/2/ping.man b/modules/rosapps/applications/sysutils/man/man/2/ping.man deleted file mode 100644 index 8c8d94a2a05..00000000000 --- a/modules/rosapps/applications/sysutils/man/man/2/ping.man +++ /dev/null @@ -1,13 +0,0 @@ -[]==============================[ping.exe]=======================================[] - - Ptoject: ReactOS ping utility - Purpose: Network test utility - Programmers: Casper S. Hornstrup (chorns(a)users.sourceforge.net) - - Usage: ping [-t] [-n count] [-l size] [-w timeout] destination-host\n\n - -t Ping the specified host until stopped. - To stop - type Control-C. - -n count Number of echo requests to send. - -l size Send buffer size. - -w timeout Timeout in milliseconds to wait for each reply. - diff --git a/modules/rosapps/applications/sysutils/man/man/3/taskmgr.man b/modules/rosapps/applications/sysutils/man/man/3/taskmgr.man deleted file mode 100644 index e5e0d0099fe..00000000000 --- a/modules/rosapps/applications/sysutils/man/man/3/taskmgr.man +++ /dev/null @@ -1,8 +0,0 @@ -[]=====================[ReactOS GUI task Manager]======================[] - Author: Brian Palmer - Purpose: ROS task manager - License: GPL - - - - \ No newline at end of file diff --git a/modules/rosapps/applications/sysutils/man/man/foo.1 b/modules/rosapps/applications/sysutils/man/man/foo.1 deleted file mode 100644 index f18971771a7..00000000000 --- a/modules/rosapps/applications/sysutils/man/man/foo.1 +++ /dev/null @@ -1,78 +0,0 @@ -.\" Process this file with -.\" groff -man -Tascii foo.1 -.\" -.TH FOO 1 "MARCH 1995" Linux "User Manuals" -.SH NAME -foo \- frobnicate the bar library -.SH SYNOPSIS -.B foo [-bar] [-c -.I config-file -.B ] -.I file -.B ... -.SH DESCRIPTION -.B foo -frobnicates the bar library by tweaking internal -symbol tables. By default it parses all baz segments -and rearranges them in reverse order by time for the -.BR xyzzy (1) -linker to find them. The symdef entry is then compressed -using the WBG (Whiz-Bang-Gizmo) algorithm. -All files are processed in the order specified. -.SH OPTIONS -.IP -b -Do not write 'busy' to stdout while processing. -.IP "-c config-file" -Use the alternate system wide -.I config-file -instead of -.IR /etc/foo.conf . -This overrides any -.B FOOCONF -environment variable. -.IP -a -In addition to the baz segments, also parse the -blurfl headers. -.IP -r -Recursive mode. Operates as fast as lightning -at the expense of a megabyte of virtual memory. -.SH FILES -.I /etc/foo.conf -.RS -The system wide configuration file. See -.BR foo (5) -for further details. -.RE -.I ~/.foorc -.RS -Per user configuration file. See -.BR foo (5) -for further details. -.SH ENVIRONMENT -.IP FOOCONF -If non-null the full pathname for an alternate system wide -.IR foo.conf . -Overridden by the -.B -c -option. -.SH DIAGNOSTICS -The following diagnostics may be issued on stderr: - -Bad magic number. -.RS -The input file does not look like an archive file. -.RE -Old style baz segments. -.RS -.B foo -can only handle new style baz segments. COBOL -object libraries are not supported in this version. -.SH BUGS -The command name should have been chosen more carefully -to reflect its purpose. -.SH AUTHOR -Jens Schweikhardt <schweikh(a)noc.dfn.de> -.SH "SEE ALSO" -.BR bar (1), -.BR foo (5), -.BR xyzzy (1) \ No newline at end of file diff --git a/modules/rosapps/applications/sysutils/man/man/man.1 b/modules/rosapps/applications/sysutils/man/man/man.1 deleted file mode 100644 index 18e14e7c216..00000000000 --- a/modules/rosapps/applications/sysutils/man/man/man.1 +++ /dev/null @@ -1,100 +0,0 @@ -./" My first man page for ReactOS :) -.TH ReactOS manual project 2004 - -.SH NAME -man.exe - manual browser for ReactOS -.SH SYNOPSIS -.B man [ -.I manual page -.B ] -.SH DESCRIPTION -This project is UNIX(tm) man compatible tool for ReactOS. -.NL -Manual browser support next tags: -.NL -.I ./" -as comment tag -.NL -.I .NL -as "new line" tag (ReactOS only) -.NL -.I .B - as "bold" tag -.NL -.I .I - as "italic" tag -.NL -.I .SH - as part tag -.NL -.I .TH - as page descriptor -.NL -.SH OPTIONS -At this moment man support only -.B "/?, /h, -h, --help" -arguments :) -.SH FILES -Now all of manual pages must be in -.B c:\man\ -directory. This is hack or -bug, i don't know... We planed use ENVIRONMENT -varrible to set manual path. -.NL -Manual files should have extension which marks section of his content. -.NL -.SH SECTIONS -.B (1) -basic commands. (dir,del,man,etc...) -.NL -.B (2) -kernel calls -.NL -.B (3) -calls from system librares -.NL -.B (4) -device files or devices -.NL -.B (5) -file syntax description -.NL -.B (6) -games -.NL -.B (7) -different information (such as licences, manifestos, etc...) -.NL -.B (8) -administration tools (Admin or root only) -.NL -.B (9) -additional kernel information -.NL - -.SH ENVIRONMENT -Comming soon -.SH BUGS -Heh... A lot of. For example: -.NL -.I Scroll-bug -man can't correctly scroll screen -.NL -.I .NL hack -tag who absent in original man -.NL -.I ./" hack -at the end of man file must be ./" tag -.NL -.I putchar() method -all text displays with putchar() function. -.NL - And we have non correct word carry. - -.SH AUTHOR -Semyon <tappak> Novikov -.NL -.I <tappak(a)freemail.ru> -.NL -Sorry for my English. I'm just a Russian first-year student. -./" \ No newline at end of file diff --git a/modules/rosapps/applications/sysutils/man/used_tags.txt b/modules/rosapps/applications/sysutils/man/used_tags.txt deleted file mode 100644 index 79aa27c66a4..00000000000 --- a/modules/rosapps/applications/sysutils/man/used_tags.txt +++ /dev/null @@ -1,7 +0,0 @@ -.B bold -.I italic -.SH section (BOLD string without /n) -.TH at the end (page comment) -.NL -.\" comment -
2 years, 12 months
1
0
0
0
[reactos] 01/01: [ROSAPPS] Remove 'chklib' utility
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f1519ec1b6565d970af14…
commit f1519ec1b6565d970af14e336966510e5727895d Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Sun Oct 3 17:33:09 2021 +0200 Commit: Victor Perevertkin <victor(a)perevertkin.ru> CommitDate: Tue Dec 28 01:58:52 2021 +0300 [ROSAPPS] Remove 'chklib' utility --- .../rosapps/applications/sysutils/CMakeLists.txt | 1 - .../applications/sysutils/chklib/CMakeLists.txt | 6 - .../rosapps/applications/sysutils/chklib/chklib.c | 199 --------------------- .../rosapps/applications/sysutils/chklib/chklib.rc | 5 - 4 files changed, 211 deletions(-) diff --git a/modules/rosapps/applications/sysutils/CMakeLists.txt b/modules/rosapps/applications/sysutils/CMakeLists.txt index 989e06f1ccd..e19b0fc8fb0 100644 --- a/modules/rosapps/applications/sysutils/CMakeLists.txt +++ b/modules/rosapps/applications/sysutils/CMakeLists.txt @@ -1,4 +1,3 @@ -add_subdirectory(chklib) add_subdirectory(ctm) add_subdirectory(fontsub) add_subdirectory(gettype) diff --git a/modules/rosapps/applications/sysutils/chklib/CMakeLists.txt b/modules/rosapps/applications/sysutils/chklib/CMakeLists.txt deleted file mode 100644 index 059e6588412..00000000000 --- a/modules/rosapps/applications/sysutils/chklib/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ - -add_executable(chklib chklib.c chklib.rc) -set_module_type(chklib win32cui) -target_link_libraries(chklib win32err) -add_importlibs(chklib msvcrt kernel32) -add_cd_file(TARGET chklib DESTINATION reactos/system32 FOR all) diff --git a/modules/rosapps/applications/sysutils/chklib/chklib.c b/modules/rosapps/applications/sysutils/chklib/chklib.c deleted file mode 100644 index e100e5edeb8..00000000000 --- a/modules/rosapps/applications/sysutils/chklib/chklib.c +++ /dev/null @@ -1,199 +0,0 @@ -/* - * chklib.c - * - * Copyright (C) 1998, 1999 Emanuele Aliberti. - * - * -------------------------------------------------------------------- - * - * This software 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 software 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 software; see the file COPYING. If - * not, write to the Free Software Foundation, Inc., 675 Mass Ave, - * Cambridge, MA 02139, USA. - * - * -------------------------------------------------------------------- - * Check a PE DLL for loading and get an exported symbol's address - * (relocated). - * - */ -//#define UNICODE -#include <stdio.h> -#include <stdlib.h> -#include <assert.h> - -#include <stdarg.h> -#include <windef.h> -#include <winbase.h> - -#include "../win32err.h" - -#ifdef DISPLAY_VERSION -static -void -DisplayVersion( - HANDLE dll, - PCHAR ModuleName - ) -{ - DWORD Zero; - DWORD Size; - PVOID vi = NULL; - - assert(ModuleName); - Size = GetFileVersionInfoSize( - ModuleName, - & Zero - ); - if (Size == 0) - { - PrintWin32Error( - L"GetFileVersionInfoSize", - GetLastError() - ); - return; - } - vi = (PVOID) LocalAlloc(LMEM_ZEROINIT,Size); - if (!vi) return; - assert(dll != INVALID_HANDLE_VALUE); - if (0 == GetFileVersionInfo( - ModuleName, - (DWORD) dll, - Size, - vi - ) - ) { - PrintWin32Error( - L"GetFileVersionInfo", - GetLastError() - ); - return; - } -/* - VerQueryValue( - vi, - L"\\StringFileInfo\\040904E4\\FileDescription", - & lpBuffer, - & dwBytes - ); -*/ - LocalFree(vi); -} -#endif /* def DISPLAY_VERSION */ - - -static -void -DisplayEntryPoint( - const HANDLE dll, - LPCSTR SymbolName - ) -{ - FARPROC EntryPoint; - - printf( - "[%s]\n", - SymbolName - ); - EntryPoint = GetProcAddress( - dll, - SymbolName - ); - if (!EntryPoint) - { - PrintWin32Error( - L"GetProcAddress", - GetLastError() - ); - return; - } - printf( - "0x%p %s\n", - EntryPoint, - SymbolName - ); -} - - -/* --- MAIN --- */ - - -int -main( - int argc, - char * argv [] - ) -{ - HINSTANCE dll; - TCHAR ModuleName [_MAX_PATH]; - - if (argc < 2) - { - fprintf( - stderr, - "\ -ReactOS System Tools\n\ -Check a Dynamic Link Library (DLL) for loading\n\ -Copyright (c) 1998, 1999 Emanuele Aliberti\n\n\ -usage: %s module [symbol [, ...]]\n", - argv[0] - ); - exit(EXIT_FAILURE); - } - dll = LoadLibraryA(argv[1]); - if (!dll) - { - UINT LastError; - - LastError = GetLastError(); - PrintWin32Error(L"LoadLibrary",LastError); - fprintf( - stderr, - "%s: loading %s failed (%d).\n", - argv[0], - argv[1], - LastError - ); - exit(EXIT_FAILURE); - } - GetModuleFileName( - (HANDLE) dll, - ModuleName, - sizeof ModuleName - ); - printf( - "%s loaded.\n", - ModuleName - ); -#ifdef DISPLAY_VERSION - DisplayVersion(dll,ModuleName); -#endif - if (argc > 2) - { - int CurrentSymbol; - - for ( CurrentSymbol = 2; - (CurrentSymbol < argc); - ++CurrentSymbol - ) - { - DisplayEntryPoint( dll, argv[CurrentSymbol] ); - } - } - FreeLibrary(dll); - printf( - "%s unloaded.\n", - ModuleName - ); - return EXIT_SUCCESS; -} - -/* EOF */ diff --git a/modules/rosapps/applications/sysutils/chklib/chklib.rc b/modules/rosapps/applications/sysutils/chklib/chklib.rc deleted file mode 100644 index 6659e633a8b..00000000000 --- a/modules/rosapps/applications/sysutils/chklib/chklib.rc +++ /dev/null @@ -1,5 +0,0 @@ - -#define REACTOS_STR_FILE_DESCRIPTION "Tool to check a dynamic library for a symbol\0" -#define REACTOS_STR_INTERNAL_NAME "chklib\0" -#define REACTOS_STR_ORIGINAL_FILENAME "chklib.exe\0" -#include <reactos/version.rc>
2 years, 12 months
1
0
0
0
[reactos] 01/01: [ROSAPPS] Remove 'binpatch' utility
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=271a54282e6645f7f10d4…
commit 271a54282e6645f7f10d44139f515c6b803e124b Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Sun Oct 3 17:33:25 2021 +0200 Commit: Victor Perevertkin <victor(a)perevertkin.ru> CommitDate: Tue Dec 28 01:58:07 2021 +0300 [ROSAPPS] Remove 'binpatch' utility --- .../applications/sysutils/utils/CMakeLists.txt | 1 - .../sysutils/utils/binpatch/CMakeLists.txt | 8 - .../applications/sysutils/utils/binpatch/patch.c | 618 --------------------- 3 files changed, 627 deletions(-) diff --git a/modules/rosapps/applications/sysutils/utils/CMakeLists.txt b/modules/rosapps/applications/sysutils/utils/CMakeLists.txt index e7dcc393722..9bc33cc6efc 100644 --- a/modules/rosapps/applications/sysutils/utils/CMakeLists.txt +++ b/modules/rosapps/applications/sysutils/utils/CMakeLists.txt @@ -1,4 +1,3 @@ -add_subdirectory(binpatch) add_subdirectory(driver) add_subdirectory(infinst) add_subdirectory(nts2w32err) diff --git a/modules/rosapps/applications/sysutils/utils/binpatch/CMakeLists.txt b/modules/rosapps/applications/sysutils/utils/binpatch/CMakeLists.txt deleted file mode 100644 index e2ca7c35b1b..00000000000 --- a/modules/rosapps/applications/sysutils/utils/binpatch/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ - -add_executable(binpatch patch.c) -set_module_type(binpatch win32cui) -add_importlibs(binpatch ntdll msvcrt kernel32) -if(MSVC) - target_link_libraries(binpatch oldnames) -endif() -add_cd_file(TARGET binpatch DESTINATION reactos/system32 FOR all) diff --git a/modules/rosapps/applications/sysutils/utils/binpatch/patch.c b/modules/rosapps/applications/sysutils/utils/binpatch/patch.c deleted file mode 100644 index e793c661f1d..00000000000 --- a/modules/rosapps/applications/sysutils/utils/binpatch/patch.c +++ /dev/null @@ -1,618 +0,0 @@ -#include <windows.h> -#include <conio.h> -#include <io.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <sys/stat.h> - -/** DEFINES *******************************************************************/ - -#define PATCH_BUFFER_SIZE 4096 /* Maximum size of a patch */ -#define PATCH_BUFFER_MAGIC "\xde\xad\xbe\xef MaGiC MaRk " -#define SIZEOF_PATCH_BUFFER_MAGIC (sizeof (PATCH_BUFFER_MAGIC) - 1) - -/** TYPES *********************************************************************/ - -typedef struct _PatchedByte -{ - uintptr_t offset; /*!< File offset of the patched byte. */ - unsigned char expected; /*!< Expected (original) value of the byte. */ - unsigned char patched; /*!< Patched (new) value for the byte. */ -} PatchedByte; - -typedef struct _PatchedFile -{ - const char *name; /*!< Name of the file to be patched. */ - size_t fileSize; /*!< Size of the file in bytes. */ - int patchCount; /*!< Number of patches for the file. */ - PatchedByte *patches; /*!< Patches for the file. */ -} PatchedFile; - -typedef struct _Patch -{ - const char *name; /*!< Name of the patch. */ - int fileCount; /*!< Number of files in the patch. */ - PatchedFile *files; /*!< Files for the patch. */ -} Patch; - -/** FUNCTION PROTOTYPES *******************************************************/ - -static void printUsage(); - -/** GLOBALS *******************************************************************/ - -static Patch m_patch = { NULL, 0, NULL }; -static int m_argc = 0; -static char **m_argv = NULL; - -/* patch buffer where we put the patch info into */ -static char m_patchBuffer[SIZEOF_PATCH_BUFFER_MAGIC + PATCH_BUFFER_SIZE] = - PATCH_BUFFER_MAGIC; - -/** HELPER FUNCTIONS **********************************************************/ - -static void * -loadFile(const char *fileName, size_t *fileSize_) -{ - FILE *f; - struct stat sb; - size_t fileSize; - void *p; - - /* Open the file */ - f = fopen(fileName, "rb"); - if (f == NULL) - { - printf("Couldn't open file %s for reading!\n", fileName); - return NULL; - } - - /* Get file size */ - if (fstat(_fileno(f), &sb) < 0) - { - fclose(f); - printf("Couldn't get size of file %s!\n", fileName); - return NULL; - } - fileSize = sb.st_size; - - /* Load file */ - p = malloc(fileSize); - if (p == NULL) - { - fclose(f); - printf("Couldn't allocate %Id bytes for file %s!\n", fileSize, fileName); - return NULL; - } - - if (fread(p, fileSize, 1, f) != 1) - { - fclose(f); - free(p); - printf("Couldn't read file %s into memory!\n", fileName); - return NULL; - } - - /* Close file */ - fclose(f); - - *fileSize_ = fileSize; - return p; -} - - -static int -saveFile(const char *fileName, void *file, size_t fileSize) -{ - FILE *f; - - /* Open the file */ - f = fopen(fileName, "wb"); - if (f == NULL) - { - printf("Couldn't open file %s for writing!\n", fileName); - return -1; - } - - /* Write file */ - if (fwrite(file, fileSize, 1, f) != 1) - { - fclose(f); - printf("Couldn't write file %s!\n", fileName); - return -1; - } - - /* Close file */ - fclose(f); - return 0; -} - - -static int -compareFiles( - PatchedFile *patchedFile, - const char *originalFileName) -{ - const char *patchedFileName = patchedFile->name; - unsigned char *origChunk, *patchedChunk; - size_t origSize, patchedSize; - int i, patchCount; - PatchedByte *patches = NULL; - int patchesArrayCount = 0; - - /* Load both files */ - origChunk = loadFile(originalFileName, &origSize); - if (origChunk == NULL) - return -1; - patchedChunk = loadFile(patchedFileName, &patchedSize); - if (patchedChunk == NULL) - { - free(origChunk); - return -1; - } - if (origSize != patchedSize) - { - free(origChunk); - free(patchedChunk); - printf("File size of %s and %s differs (%Iu != %Iu)\n", - originalFileName, patchedFileName, - origSize, patchedSize); - return -1; - } - - /* Compare the files and record any differences */ - printf("Comparing %s to %s", originalFileName, patchedFileName); - for (i = 0, patchCount = 0; i < origSize; i++) - { - if (origChunk[i] != patchedChunk[i]) - { - patchCount++; - - /* Resize patches array if needed */ - if (patchesArrayCount < patchCount) - { - PatchedByte *newPatches; - newPatches = realloc(patches, patchCount * sizeof (PatchedByte)); - if (newPatches == NULL) - { - if (patches != NULL) - free(patches); - free(origChunk); - free(patchedChunk); - printf("\nOut of memory (tried to allocated %Id bytes)\n", - patchCount * sizeof (PatchedByte)); - return -1; - } - patches = newPatches; - } - - /* Fill in patch info */ - patches[patchCount - 1].offset = i; - patches[patchCount - 1].expected = origChunk[i]; - patches[patchCount - 1].patched = patchedChunk[i]; - } - if ((i % (origSize / 40)) == 0) - printf("."); - } - printf(" %d changed bytes found.\n", patchCount); - - /* Unload the files */ - free(origChunk); - free(patchedChunk); - - /* Save patch info */ - patchedFile->fileSize = patchedSize; - patchedFile->patchCount = patchCount; - patchedFile->patches = patches; - - return 0; -} - - -static int -outputPatch(const char *outputFileName) -{ - char *patchExe, *patchBuffer = NULL; - size_t i, size, patchExeSize, patchSize, stringSize, stringOffset, patchOffset; - Patch *patch; - PatchedFile *files; - - printf("Putting patch into %s...\n", outputFileName); - - /* Calculate size of the patch */ - patchSize = sizeof (Patch) + sizeof (PatchedFile) * m_patch.fileCount; - stringSize = strlen(m_patch.name) + 1; - for (i = 0; i < m_patch.fileCount; i++) - { - stringSize += strlen(m_patch.files[i].name) + 1; - patchSize += sizeof (PatchedByte) * m_patch.files[i].patchCount; - } - if ((stringSize + patchSize) > PATCH_BUFFER_SIZE) - { - printf("Patch is too big - %u bytes maximum, %Iu bytes needed\n", - PATCH_BUFFER_SIZE, stringSize + patchSize); - return -1; - } - - /* Load patch.exe file into memory... */ - patchExe = loadFile(m_argv[0], &patchExeSize); - if (patchExe == NULL) - { - return -1; - } - - /* Try to find the magic mark for the patch buffer */ - for (i = 0; i < (patchExeSize - SIZEOF_PATCH_BUFFER_MAGIC); i++) - { - if (memcmp(patchExe + i, m_patchBuffer, SIZEOF_PATCH_BUFFER_MAGIC) == 0) - { - patchBuffer = patchExe + i + SIZEOF_PATCH_BUFFER_MAGIC; - - break; - } - } - if (!(i < (patchExeSize - SIZEOF_PATCH_BUFFER_MAGIC))) - { - free(patchExe); - printf("Couldn't find patch buffer magic in file %s - this shouldn't happen!!!\n", m_argv[0]); - return -1; - } - - /* Pack patch together and replace string pointers by offsets */ - patch = (Patch *)patchBuffer; - files = (PatchedFile *)(patchBuffer + sizeof (Patch)); - patchOffset = sizeof (Patch) + sizeof (PatchedFile) * m_patch.fileCount; - stringOffset = patchSize; - - patch->fileCount = m_patch.fileCount; - patch->files = (PatchedFile *)sizeof (Patch); - - patch->name = (const char *)stringOffset; - strcpy(patchBuffer + stringOffset, m_patch.name); - stringOffset += strlen(m_patch.name) + 1; - - for (i = 0; i < m_patch.fileCount; i++) - { - files[i].fileSize = m_patch.files[i].fileSize; - files[i].patchCount = m_patch.files[i].patchCount; - - files[i].name = (const char *)stringOffset; - strcpy(patchBuffer + stringOffset, m_patch.files[i].name); - stringOffset += strlen(m_patch.files[i].name) + 1; - - size = files[i].patchCount * sizeof (PatchedByte); - files[i].patches = (PatchedByte *)patchOffset; - memcpy(patchBuffer + patchOffset, m_patch.files[i].patches, size); - patchOffset += size; - } - size = patchSize + stringSize; - memset(patchBuffer + size, 0, PATCH_BUFFER_SIZE - size); - - /* Save file */ - if (saveFile(outputFileName, patchExe, patchExeSize) < 0) - { - free(patchExe); - return -1; - } - free(patchExe); - - printf("Patch saved!\n"); - return 0; -} - - -static int -loadPatch() -{ - char *p; - Patch *patch; - int i; - - p = m_patchBuffer + SIZEOF_PATCH_BUFFER_MAGIC; - patch = (Patch *)p; - - if (patch->name == NULL) - { - return -1; - } - - m_patch.name = p + (intptr_t)patch->name; - m_patch.fileCount = patch->fileCount; - m_patch.files = (PatchedFile *)(p + (intptr_t)patch->files); - - for (i = 0; i < m_patch.fileCount; i++) - { - m_patch.files[i].name = p + (intptr_t)m_patch.files[i].name; - m_patch.files[i].patches = (PatchedByte *)(p + (intptr_t)m_patch.files[i].patches); - } - - printf("Patch %s loaded...\n", m_patch.name); - return 0; -} - - -/** MAIN FUNCTIONS ************************************************************/ - -static int -createPatch() -{ - int i, status; - const char *outputFileName; - - /* Check argument count */ - if (m_argc < 6 || (m_argc % 2) != 0) - { - printUsage(); - return -1; - } - - outputFileName = m_argv[3]; - m_patch.name = m_argv[2]; - - /* Allocate PatchedFiles array */ - m_patch.fileCount = (m_argc - 4) / 2; - m_patch.files = malloc(m_patch.fileCount * sizeof (PatchedFile)); - if (m_patch.files == NULL) - { - printf("Out of memory!\n"); - return -1; - } - memset(m_patch.files, 0, m_patch.fileCount * sizeof (PatchedFile)); - - /* Compare original to patched files and fill m_patch.files array */ - for (i = 0; i < m_patch.fileCount; i++) - { - m_patch.files[i].name = m_argv[4 + (i * 2) + 1]; - status = compareFiles(m_patch.files + i, m_argv[4 + (i * 2) + 0]); - if (status < 0) - { - for (i = 0; i < m_patch.fileCount; i++) - { - if (m_patch.files[i].patches != NULL) - free(m_patch.files[i].patches); - } - free(m_patch.files); - m_patch.files = NULL; - m_patch.fileCount = 0; - return status; - } - } - - /* Output patch */ - return outputPatch(outputFileName); -} - - -static int -applyPatch() -{ - int c, i, j, makeBackup; - size_t fileSize; - unsigned char *file; - char *p; - const char *fileName; - char buffer[MAX_PATH]; - - - if (m_argc > 1 && strcmp(m_argv[1], "-d") != 0) - { - printUsage(); - return -1; - } - - /* Load patch */ - if (loadPatch() < 0) - { - printf("This executable doesn't contain a patch, use -c to create one.\n"); - return -1; - } - - if (m_argc > 1) - { - /* Dump patch */ - printf("Patch name: %s\n", m_patch.name); - printf("File count: %d\n", m_patch.fileCount); - for (i = 0; i < m_patch.fileCount; i++) - { - printf("----------------------\n" - "File name: %s\n" - "File size: %Id bytes\n", - m_patch.files[i].name, m_patch.files[i].fileSize); - printf("Patch count: %d\n", m_patch.files[i].patchCount); - for (j = 0; j < m_patch.files[i].patchCount; j++) - { - printf(" Offset 0x%Ix 0x%02x -> 0x%02x\n", - m_patch.files[i].patches[j].offset, - m_patch.files[i].patches[j].expected, - m_patch.files[i].patches[j].patched); - } - } - } - else - { - /* Apply patch */ - printf("Applying patch...\n"); - for (i = 0; i < m_patch.fileCount; i++) - { - /* Load original file */ - fileName = m_patch.files[i].name; -applyPatch_retry_file: - file = loadFile(fileName, &fileSize); - if (file == NULL) - { - printf("File %s not found! ", fileName); -applyPatch_file_open_error: - printf("(S)kip, (R)etry, (A)bort, (M)anually enter filename"); - do - { - c = _getch(); - } - while (c != 's' && c != 'r' && c != 'a' && c != 'm'); - printf("\n"); - if (c == 's') - { - continue; - } - else if (c == 'r') - { - goto applyPatch_retry_file; - } - else if (c == 'a') - { - return 0; - } - else if (c == 'm') - { - if (fgets(buffer, sizeof (buffer), stdin) == NULL) - { - printf("fgets() failed!\n"); - return -1; - } - p = strchr(buffer, '\r'); - if (p != NULL) - *p = '\0'; - p = strchr(buffer, '\n'); - if (p != NULL) - *p = '\0'; - - fileName = buffer; - goto applyPatch_retry_file; - } - } - - /* Check file size */ - if (fileSize != m_patch.files[i].fileSize) - { - free(file); - printf("File %s has unexpected filesize of %Id bytes (%Id bytes expected)\n", - fileName, fileSize, m_patch.files[i].fileSize); - if (fileName != m_patch.files[i].name) /* manually entered filename */ - { - goto applyPatch_file_open_error; - } - return -1; - } - - /* Ask for backup */ - printf("Do you want to make a backup of %s? (Y)es, (N)o, (A)bort", fileName); - do - { - c = _getch(); - } - while (c != 'y' && c != 'n' && c != 'a'); - printf("\n"); - if (c == 'y') - { - char buffer[MAX_PATH]; - _snprintf(buffer, MAX_PATH, "%s.bak", fileName); - buffer[MAX_PATH-1] = '\0'; - makeBackup = 1; - if (_access(buffer, 0) >= 0) /* file exists */ - { - printf("File %s already exists, overwrite? (Y)es, (N)o, (A)bort", buffer); - do - { - c = _getch(); - } - while (c != 'y' && c != 'n' && c != 'a'); - printf("\n"); - if (c == 'n') - makeBackup = 0; - else if (c == 'a') - { - free(file); - return 0; - } - } - if (makeBackup && saveFile(buffer, file, fileSize) < 0) - { - free(file); - return -1; - } - } - else if (c == 'a') - { - free(file); - return 0; - } - - /* Patch file */ - for (j = 0; j < m_patch.files[i].patchCount; j++) - { - int offset = m_patch.files[i].patches[j].offset; - if (file[offset] != m_patch.files[i].patches[j].expected) - { - printf("Unexpected value in file %s at offset 0x%x: expected = 0x%02x, found = 0x%02x\n", - fileName, offset, m_patch.files[i].patches[j].expected, file[offset]); - free(file); - return -1; - } - file[offset] = m_patch.files[i].patches[j].patched; - } - - /* Save file */ - if (saveFile(fileName, file, fileSize) < 0) - { - free(file); - return -1; - } - free(file); - } - - printf("Patch applied sucessfully!\n"); - } - - return 0; -} - - -static void -printUsage() -{ - printf("Usage:\n" - "%s -c - Create patch\n" - "%s -d - Dump patch\n" - "%s - Apply patch\n" - "\n" - "A patch can be created like this:\n" - "%s -c \"patch name\" output.exe file1.orig file1.patched[ file2.orig file2.patched[ ...]]\n", - m_argv[0], m_argv[0], m_argv[0], m_argv[0]); -} - - -int -main( - int argc, - char *argv[]) -{ - m_argc = argc; - m_argv = argv; - - if (argc >= 2 && (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0)) - { - printUsage(); - return 0; - } - else if (argc >= 2 && argv[1][0] == '-') - { - if (strcmp(argv[1], "-c") == 0) - { - return createPatch(); - } - else if (strcmp(argv[1], "-d") == 0) - { - return applyPatch(); - } - else - { - printf("Unknown option: %s\n" - "Use -h for help.\n", - argv[1]); - return -1; - } - } - - return applyPatch(); -} -
2 years, 12 months
1
0
0
0
[reactos] 01/01: [CMAKE] toolchain-clang.cmake: Use overrides-gcc.cmake
by Serge Gautherie
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=44d2513ac6ce99e4e3421…
commit 44d2513ac6ce99e4e3421826c5b186bf689aca08 Author: Serge Gautherie <reactos-git_serge_171003(a)gautherie.fr> AuthorDate: Sun Jun 14 13:49:22 2020 +0200 Commit: Victor Perevertkin <victor(a)perevertkin.ru> CommitDate: Tue Dec 28 01:56:33 2021 +0300 [CMAKE] toolchain-clang.cmake: Use overrides-gcc.cmake Addendum to 8cd5c4e. CORE-14513 --- toolchain-clang.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/toolchain-clang.cmake b/toolchain-clang.cmake index e06a4116438..de974bdb572 100644 --- a/toolchain-clang.cmake +++ b/toolchain-clang.cmake @@ -60,3 +60,5 @@ message(STATUS "Using linker ${LD_EXECUTABLE}") set(CMAKE_SHARED_LINKER_FLAGS_INIT "-nostdlib -Wl,--enable-auto-image-base,--disable-auto-import -fuse-ld=${LD_EXECUTABLE}") set(CMAKE_MODULE_LINKER_FLAGS_INIT "-nostdlib -Wl,--enable-auto-image-base,--disable-auto-import -fuse-ld=${LD_EXECUTABLE}") set(CMAKE_EXE_LINKER_FLAGS_INIT "-nostdlib -Wl,--enable-auto-image-base,--disable-auto-import -fuse-ld=${LD_EXECUTABLE}") + +set(CMAKE_USER_MAKE_RULES_OVERRIDE "${CMAKE_CURRENT_LIST_DIR}/overrides-gcc.cmake")
2 years, 12 months
1
0
0
0
[reactos] 01/01: [CRT] mem/: Fix msvc14.0-amd64 build
by Serge Gautherie
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1449523c6d004e1550580…
commit 1449523c6d004e1550580d89bf630d0c96d321e6 Author: Serge Gautherie <reactos-git_serge_171003(a)gautherie.fr> AuthorDate: Sun Jun 14 13:49:22 2020 +0200 Commit: Victor Perevertkin <victor(a)perevertkin.ru> CommitDate: Tue Dec 28 01:55:38 2021 +0300 [CRT] mem/: Fix msvc14.0-amd64 build Addendum to aea4cfb. --- sdk/lib/crt/mem/memchr.c | 2 +- sdk/lib/crt/mem/memmove.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/lib/crt/mem/memchr.c b/sdk/lib/crt/mem/memchr.c index 11682251567..ac2c68e1ba5 100644 --- a/sdk/lib/crt/mem/memchr.c +++ b/sdk/lib/crt/mem/memchr.c @@ -1,7 +1,7 @@ #include <string.h> -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER >= 1910 || !defined(_WIN64)) #pragma function(memchr) #endif /* _MSC_VER */ diff --git a/sdk/lib/crt/mem/memmove.c b/sdk/lib/crt/mem/memmove.c index 6d0dd8bf4d2..34b71c091ca 100644 --- a/sdk/lib/crt/mem/memmove.c +++ b/sdk/lib/crt/mem/memmove.c @@ -1,6 +1,6 @@ #include <string.h> -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER >= 1910 || !defined(_WIN64)) #pragma function(memmove) #endif /* _MSC_VER */
2 years, 12 months
1
0
0
0
[reactos] 01/01: [FREETYPE] CMakeLists.txt: Fix if conditions
by Serge Gautherie
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bf4d47d969c642e144637…
commit bf4d47d969c642e1446374a4d3a12e9c8cd59026 Author: Serge Gautherie <reactos-git_serge_171003(a)gautherie.fr> AuthorDate: Sun Jun 14 13:49:22 2020 +0200 Commit: Victor Perevertkin <victor(a)perevertkin.ru> CommitDate: Tue Dec 28 01:45:28 2021 +0300 [FREETYPE] CMakeLists.txt: Fix if conditions --- sdk/lib/3rdparty/freetype/CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sdk/lib/3rdparty/freetype/CMakeLists.txt b/sdk/lib/3rdparty/freetype/CMakeLists.txt index e2d7b3108ca..bac1f0bb249 100644 --- a/sdk/lib/3rdparty/freetype/CMakeLists.txt +++ b/sdk/lib/3rdparty/freetype/CMakeLists.txt @@ -55,11 +55,9 @@ list(APPEND SOURCE add_library(freetype ${SOURCE}) -if (MSVC) +if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND ARCH STREQUAL "amd64") # error C4312: 'type cast': conversion from 'unsigned long' to 'void *' of greater size remove_target_compile_option(freetype "/we4312") elseif(GCC) target_compile_options(freetype PRIVATE -fno-builtin-malloc) -elseif(CLANG) - target_compile_options(freetype PRIVATE -Wno-tautological-constant-compare) endif()
2 years, 12 months
1
0
0
0
[reactos] 01/01: [NTOSKRNL] Regroup the pool allocation tags in one dedicated place
by George Bișoc
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3bc2d590a1ff9e8d178dd…
commit 3bc2d590a1ff9e8d178dd5e1f96a092c35f66fc0 Author: George Bișoc <george.bisoc(a)reactos.org> AuthorDate: Sun Dec 26 20:58:28 2021 +0100 Commit: George Bișoc <george.bisoc(a)reactos.org> CommitDate: Mon Dec 27 18:57:03 2021 +0100 [NTOSKRNL] Regroup the pool allocation tags in one dedicated place We have a special file, tag.h, which serves as a place to store whatever kernel pool allocation tag yet we still have some tags sparse over the kernel code... So just re-group them in one unique place. --- ntoskrnl/dbgk/dbgkobj.c | 6 +- ntoskrnl/ex/atom.c | 2 - ntoskrnl/ex/harderr.c | 2 - ntoskrnl/ex/profile.c | 2 - ntoskrnl/fsrtl/filelock.c | 4 - ntoskrnl/fsrtl/oplock.c | 2 - ntoskrnl/inbv/inbv.c | 4 - ntoskrnl/include/internal/tag.h | 267 ++++++++++++++++++---------------------- ntoskrnl/io/iomgr/driver.c | 2 - ntoskrnl/io/pnpmgr/devaction.c | 2 - ntoskrnl/kdbg/kdb.h | 6 - ntoskrnl/ke/bug.c | 1 - ntoskrnl/ke/i386/kiinit.c | 2 +- ntoskrnl/ke/i386/v86vdm.c | 4 +- ntoskrnl/ob/obhandle.c | 2 - ntoskrnl/po/povolume.c | 2 - ntoskrnl/ps/apphelp.c | 1 - ntoskrnl/ps/i386/psldt.c | 2 +- ntoskrnl/rtl/libsupp.c | 7 -- 19 files changed, 125 insertions(+), 195 deletions(-) diff --git a/ntoskrnl/dbgk/dbgkobj.c b/ntoskrnl/dbgk/dbgkobj.c index 2175db14594..4b480a2cbf9 100644 --- a/ntoskrnl/dbgk/dbgkobj.c +++ b/ntoskrnl/dbgk/dbgkobj.c @@ -59,7 +59,7 @@ DbgkpQueueMessage(IN PEPROCESS Process, /* Allocate it */ DebugEvent = ExAllocatePoolWithTag(NonPagedPool, sizeof(DEBUG_EVENT), - 'EgbD'); + TAG_DEBUG_EVENT); if (!DebugEvent) return STATUS_INSUFFICIENT_RESOURCES; /* Set flags */ @@ -192,7 +192,7 @@ DbgkpQueueMessage(IN PEPROCESS Process, ObDereferenceObject(Process); /* Free the debug event */ - ExFreePoolWithTag(DebugEvent, 'EgbD'); + ExFreePoolWithTag(DebugEvent, TAG_DEBUG_EVENT); } } @@ -418,7 +418,7 @@ DbgkpFreeDebugEvent(IN PDEBUG_EVENT DebugEvent) /* Dereference process and thread and free the event */ ObDereferenceObject(DebugEvent->Process); ObDereferenceObject(DebugEvent->Thread); - ExFreePoolWithTag(DebugEvent, 'EgbD'); + ExFreePoolWithTag(DebugEvent, TAG_DEBUG_EVENT); } VOID diff --git a/ntoskrnl/ex/atom.c b/ntoskrnl/ex/atom.c index a33e0e9bccb..967fd6c6d65 100644 --- a/ntoskrnl/ex/atom.c +++ b/ntoskrnl/ex/atom.c @@ -13,8 +13,6 @@ #define NDEBUG #include <debug.h> -#define TAG_ATOM 'motA' - /* GLOBALS ****************************************************************/ /* diff --git a/ntoskrnl/ex/harderr.c b/ntoskrnl/ex/harderr.c index 10b6682e657..490514d601e 100644 --- a/ntoskrnl/ex/harderr.c +++ b/ntoskrnl/ex/harderr.c @@ -12,8 +12,6 @@ #define NDEBUG #include <debug.h> -#define TAG_ERR ' rrE' - /* GLOBALS ******************************************************************/ BOOLEAN ExReadyForErrors = FALSE; diff --git a/ntoskrnl/ex/profile.c b/ntoskrnl/ex/profile.c index 45c49f2586a..a7e2e9b9fbe 100644 --- a/ntoskrnl/ex/profile.c +++ b/ntoskrnl/ex/profile.c @@ -13,8 +13,6 @@ #define NDEBUG #include <debug.h> -#define TAG_PROFILE 'forP' - /* GLOBALS *******************************************************************/ POBJECT_TYPE ExProfileObjectType = NULL; diff --git a/ntoskrnl/fsrtl/filelock.c b/ntoskrnl/fsrtl/filelock.c index 624d2dd7047..6d7a9d8afc8 100644 --- a/ntoskrnl/fsrtl/filelock.c +++ b/ntoskrnl/fsrtl/filelock.c @@ -51,10 +51,6 @@ typedef struct _LOCK_SHARED_RANGE } LOCK_SHARED_RANGE, *PLOCK_SHARED_RANGE; -#define TAG_TABLE 'BATL' -#define TAG_RANGE 'ARSF' -#define TAG_FLOCK 'KCLF' - /* PRIVATE FUNCTIONS *********************************************************/ VOID diff --git a/ntoskrnl/fsrtl/oplock.c b/ntoskrnl/fsrtl/oplock.c index f4c38d37d2c..04e90193716 100644 --- a/ntoskrnl/fsrtl/oplock.c +++ b/ntoskrnl/fsrtl/oplock.c @@ -27,8 +27,6 @@ #define BROKEN_TO_CLOSE_PENDING 0x800 #define BROKEN_ANY (BROKEN_TO_LEVEL_2 | BROKEN_TO_NONE | BROKEN_TO_NONE_FROM_LEVEL_2 | BROKEN_TO_CLOSE_PENDING) -#define TAG_OPLOCK 'orSF' - typedef struct _INTERNAL_OPLOCK { /* Level I IRP */ diff --git a/ntoskrnl/inbv/inbv.c b/ntoskrnl/inbv/inbv.c index 78da5d5dd84..049ff230555 100644 --- a/ntoskrnl/inbv/inbv.c +++ b/ntoskrnl/inbv/inbv.c @@ -11,10 +11,6 @@ #define MM_READONLY 1 // PAGE_READONLY #define MM_READWRITE 4 // PAGE_WRITECOPY -#ifndef TAG_OSTR -#define TAG_OSTR 'RTSO' -#endif - /* GLOBALS *******************************************************************/ /* diff --git a/ntoskrnl/include/internal/tag.h b/ntoskrnl/include/internal/tag.h index 38c26245023..0e466482dd2 100644 --- a/ntoskrnl/include/internal/tag.h +++ b/ntoskrnl/include/internal/tag.h @@ -1,3 +1,13 @@ +/* + * PROJECT: ReactOS Kernel + * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * PURPOSE: ReactOS NT kernel pool allocation tags + * COPYRIGHT: Copyright 2005 Steven Edwards <sedwards(a)reactos.com> + * Copyright 2006 Alex Ionescu <alex.ionescu(a)reactos.org> + * Copyright 2015 Thomas Faber <thomas.faber(a)reactos.org> + * Copyright 2021 George Bișoc <george.bisoc(a)reactos.org> + */ + #pragma once /* Cache Manager Tags */ @@ -7,167 +17,128 @@ #define TAG_PRIVATE_CACHE_MAP 'cPcC' #define TAG_BCB 'cBcC' -/* Executive Callbacks */ +/* Executive Tags */ #define TAG_CALLBACK_ROUTINE_BLOCK 'brbC' #define TAG_CALLBACK_REGISTRATION 'eRBC' - -/* formely located in dbg/dbgkobj.c */ -#define TAG_DEBUG_EVENT 'EgbD' - -/* formerly located in ex/resource.c */ -#define TAG_RESOURCE_TABLE 'aTeR' -#define TAG_RESOURCE_EVENT 'aTeR' -#define TAG_RESOURCE_SEMAPHORE 'aTeR' - -/* formerly located in ex/handle.c */ -#define TAG_OBJECT_TABLE 'btbO' - -/* formerly located in ex/init.c */ -#define TAG_INIT 'tinI' -#define TAG_RTLI 'iltR' - -/* formerly located in fs/notify.c */ -#define FSRTL_NOTIFY_TAG 'ITON' - -/* formerly located in fsrtl/unc.c */ -#define TAG_UNC 'nuSF' - -/* formerly located in io/device.c */ +#define TAG_RESOURCE_TABLE 'aTeR' +#define TAG_RESOURCE_EVENT 'aTeR' +#define TAG_RESOURCE_SEMAPHORE 'aTeR' +#define TAG_OBJECT_TABLE 'btbO' +#define TAG_INIT 'tinI' +#define TAG_RTLI 'iltR' +#define TAG_ATOM 'motA' +#define TAG_PROFILE 'forP' +#define TAG_ERR ' rrE' + +/* User Mode Debugging Manager Tag */ +#define TAG_DEBUG_EVENT 'EgbD' + +/* Kernel Debugger Tags */ +#define TAG_KDBS 'SBDK' +#define TAG_KDBG 'GBDK' + +/* Kernel Tags */ +#define TAG_KNMI 'IMNK' +#define TAG_KERNEL ' eK' + +/* File-System Run-Time Library Tags */ +#define TAG_UNC 'nuSF' +#define TAG_TABLE 'BATL' +#define TAG_RANGE 'ARSF' +#define TAG_FLOCK 'KCLF' +#define TAG_OPLOCK 'orSF' + +/* I/O Manager Tags */ #define TAG_DEVICE_EXTENSION 'TXED' -#define TAG_SHUTDOWN_ENTRY 'TUHS' -#define TAG_IO_TIMER 'MTOI' - -/* formerly located in io/driver.c */ +#define TAG_SHUTDOWN_ENTRY 'TUHS' +#define TAG_IO_TIMER 'MTOI' #define TAG_DRIVER 'RVRD' #define TAG_DRIVER_EXTENSION 'EVRD' - -/* formerly located in io/file.c */ -#define TAG_SYSB 'BSYS' -#define TAG_LOCK 'kclF' -#define TAG_FILE_NAME 'MANF' - -/* formerly located in io/fs.c */ -#define TAG_FILE_SYSTEM 'SYSF' -#define TAG_FS_CHANGE_NOTIFY 'NCSF' -#define IFS_POOL_TAG 'trSF' -#define TAG_FS_NOTIFICATIONS 'NrSF' - -/* formerly located in io/iocomp.c */ -#define IOC_TAG 'TCOI' - -/* formerly located in io/iomgr.c */ -#define TAG_DEVICE_TYPE 'TVED' -#define TAG_FILE_TYPE 'ELIF' -#define TAG_ADAPTER_TYPE 'TPDA' -#define IO_LARGEIRP 'lprI' -#define IO_SMALLIRP 'sprI' -#define IO_LARGEIRP_CPU 'LprI' -#define IO_SMALLIRP_CPU 'SprI' -#define IOC_TAG1 ' cpI' -#define IOC_CPU 'PcpI' -#define TAG_APC 'CPAK' -#define TAG_IO ' oI' -#define TAG_ERROR_LOG 'rEoI' -#define TAG_EA 'aEoI' -#define TAG_IO_NAME 'mNoI' -#define TAG_REINIT 'iRoI' - -/* formerly located in io/work.c */ -#define TAG_IOWI 'IWOI' - -/* formerly located in io/irp.c */ -#define TAG_IRP ' prI' -#define TAG_SYS_BUF 'BSYS' - -/* formerly located in io/irq.c */ -#define TAG_KINTERRUPT 'RSIK' - -/* formerly located in io/mdl.c */ -#define TAG_MDL ' LDM' - -/* formerly located in io/pnpmgr.c */ -#define TAG_IO_DEVNODE 'donD' - -/* formerly located in io/pnpnotify.c */ -#define TAG_PNP_NOTIFY 'NPnP' - -/* for io/pnproot.c */ -#define TAG_PNP_ROOT 'RPnP' - -/* formerly located in io/resource.c */ -#define TAG_IO_RESOURCE 'CRSR' - -/* formerly located in io/timer.c */ -#define TAG_IO_TIMER 'MTOI' - -/* formerly located in io/vpb.c */ -#define TAG_VPB ' BPV' -#define TAG_SYSB 'BSYS' - -/* formerly located in ldr/loader.c */ -#define TAG_DRIVER_MEM 'MVRD' /* drvm */ +#define TAG_SYSB 'BSYS' +#define TAG_LOCK 'kclF' +#define TAG_FILE_NAME 'MANF' +#define TAG_FILE_SYSTEM 'SYSF' +#define TAG_FS_CHANGE_NOTIFY 'NCSF' +#define IFS_POOL_TAG 'trSF' +#define TAG_FS_NOTIFICATIONS 'NrSF' +#define IOC_TAG 'TCOI' +#define TAG_DEVICE_TYPE 'TVED' +#define TAG_FILE_TYPE 'ELIF' +#define TAG_ADAPTER_TYPE 'TPDA' +#define IO_LARGEIRP 'lprI' +#define IO_SMALLIRP 'sprI' +#define IO_LARGEIRP_CPU 'LprI' +#define IO_SMALLIRP_CPU 'SprI' +#define IOC_TAG1 ' cpI' +#define IOC_CPU 'PcpI' +#define TAG_APC 'CPAK' +#define TAG_IO ' oI' +#define TAG_ERROR_LOG 'rEoI' +#define TAG_EA 'aEoI' +#define TAG_IO_NAME 'mNoI' +#define TAG_REINIT 'iRoI' +#define TAG_IOWI 'IWOI' +#define TAG_IRP ' prI' +#define TAG_SYS_BUF 'BSYS' +#define TAG_KINTERRUPT 'RSIK' +#define TAG_MDL ' LDM' +#define TAG_IO_DEVNODE 'donD' +#define TAG_PNP_NOTIFY 'NPnP' +#define TAG_PNP_ROOT 'RPnP' +#define TAG_IO_RESOURCE 'CRSR' +#define TAG_IO_TIMER 'MTOI' +#define TAG_VPB ' BPV' +#define TAG_SYSB 'BSYS' +#define TAG_RTLREGISTRY 'vrqR' +#define TAG_PNP_DEVACTION 'aDpP' + +/* Loader Related Tags */ #define TAG_MODULE_OBJECT 'omlk' /* klmo - kernel ldr module object */ -#define TAG_LDR_WSTR 'swlk' /* klws - kernel ldr wide string */ -#define TAG_LDR_IMPORTS 'milk' /* klim - kernel ldr imports */ - -/* formerly located in lpc/connect */ -#define TAG_LPC_CONNECT_MESSAGE 'CCPL' - -/* formerly located in mm/aspace.c */ -#define TAG_PTRC 'CRTP' - -/* formerly located in mm/marea.c */ -#define TAG_MAREA 'ERAM' -#define TAG_MVAD 'VADM' - -/* formerly located in mm/pageop.c */ -#define TAG_MM_PAGEOP 'POPM' - -/* formerly located in mm/pool.c */ -#define TAG_NONE 'enoN' - -/* formerly located in mm/region.c */ -#define TAG_MM_REGION 'NGRM' - -/* formerly located in mm/rmap.c */ -#define TAG_RMAP 'PAMR' - -/* formerly located in mm/ARM3/section.c */ -#define TAG_MM ' mM' - -/* formerly located in mm/section.c */ +#define TAG_LDR_WSTR 'swlk' /* klws - kernel ldr wide string */ +#define TAG_LDR_IMPORTS 'milk' /* klim - kernel ldr imports */ + +/* Memory Manager Tags */ +#define TAG_PTRC 'CRTP' +#define TAG_MAREA 'ERAM' +#define TAG_MVAD 'VADM' +#define TAG_MM_PAGEOP 'POPM' +#define TAG_NONE 'enoN' +#define TAG_MM_REGION 'NGRM' +#define TAG_RMAP 'PAMR' +#define TAG_MM ' mM' #define TAG_MM_SECTION_SEGMENT 'SSMM' #define TAG_SECTION_PAGE_TABLE 'TPSM' -/* formerly located in ob/symlink.c */ +/* Object Manager Tags */ +#define OB_NAME_TAG 'mNbO' +#define OB_DIR_TAG 'iDbO' +#define TAG_WAIT 'tiaW' +#define TAG_SEC_QUERY 'qSbO' #define TAG_OBJECT_TYPE 'TjbO' #define TAG_SYMLINK_TTARGET 'TTYS' #define TAG_SYMLINK_TARGET 'TMYS' - -/* formerly located in ob/obsdcach.c */ #define TAG_OB_SD_CACHE 'cSbO' +#define TAG_OB_HANDLE 'dHbO' -/* Object Manager Tags */ -#define OB_NAME_TAG 'mNbO' -#define OB_DIR_TAG 'iDbO' - +/* Power Manager Tag */ +#define TAG_PO_DOPE 'EPOD' -/* formerly located in ps/cid.c */ -#define TAG_CIDOBJECT 'ODIC' +/* Process Manager Tags */ +#define TAG_CIDOBJECT 'ODIC' #define TAG_PS_IMPERSONATION 'mIsP' +#define TAG_EJOB 'BOJE' /* EJOB */ +#define TAG_TERMINATE_APC 'CPAT' +#define TAG_KAPC 'papk' /* kpap - kernel ps apc */ +#define TAG_PS_APC 'pasP' /* Psap - Ps APC */ +#define TAG_SHIM 'MIHS' -/* formerly located in ps/job.c */ -#define TAG_EJOB 'BOJE' /* EJOB */ - -/* formerly located in ps/kill.c */ -#define TAG_TERMINATE_APC 'CPAT' - -/* formerly located in ps/notify.c */ -#define TAG_KAPC 'papk' /* kpap - kernel ps apc */ -#define TAG_PS_APC 'pasP' /* Psap - Ps APC */ - -/* formerly located in rtl/handle.c */ +/* Run-Time Library Tags */ #define TAG_HDTB 'BTDH' +#define TAG_ATMT 'TotA' /* Atom table */ +#define TAG_RTHL 'LHtR' /* Heap Lock */ +#define TAG_USTR 'RTSU' +#define TAG_ASTR 'RTSA' +#define TAG_OSTR 'RTSO' /* Security Manager Tags */ #define TAG_SE ' eS' @@ -189,11 +160,9 @@ #define TAG_SID_VALIDATE 'vSeS' /* LPC Tags */ -#define TAG_LPC_MESSAGE 'McpL' -#define TAG_LPC_ZONE 'ZcpL' - -#define TAG_WAIT 'tiaW' -#define TAG_SEC_QUERY 'qSbO' +#define TAG_LPC_MESSAGE 'McpL' +#define TAG_LPC_ZONE 'ZcpL' +#define TAG_LPC_CONNECT_MESSAGE 'CCPL' -/* FSTUB */ +/* FSTUB Tag */ #define TAG_FSTUB 'BtsF' diff --git a/ntoskrnl/io/iomgr/driver.c b/ntoskrnl/io/iomgr/driver.c index 8be45e3459a..3925477bbd3 100644 --- a/ntoskrnl/io/iomgr/driver.c +++ b/ntoskrnl/io/iomgr/driver.c @@ -32,8 +32,6 @@ static const WCHAR ServicesKeyName[] = L"\\Registry\\Machine\\System\\CurrentCon POBJECT_TYPE IoDriverObjectType = NULL; -#define TAG_RTLREGISTRY 'vrqR' - extern BOOLEAN ExpInTextModeSetup; extern BOOLEAN PnpSystemInit; extern BOOLEAN PnPBootDriversLoaded; diff --git a/ntoskrnl/io/pnpmgr/devaction.c b/ntoskrnl/io/pnpmgr/devaction.c index 2126d31e059..c97f1fdd1c5 100644 --- a/ntoskrnl/io/pnpmgr/devaction.c +++ b/ntoskrnl/io/pnpmgr/devaction.c @@ -50,8 +50,6 @@ KSPIN_LOCK IopDeviceActionLock; KEVENT PiEnumerationFinished; static const WCHAR ServicesKeyName[] = L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\"; -#define TAG_PNP_DEVACTION 'aDpP' - /* TYPES *********************************************************************/ typedef struct _DEVICE_ACTION_REQUEST diff --git a/ntoskrnl/kdbg/kdb.h b/ntoskrnl/kdbg/kdb.h index 3ccd6fc49e0..aa8cb8e8f18 100644 --- a/ntoskrnl/kdbg/kdb.h +++ b/ntoskrnl/kdbg/kdb.h @@ -1,12 +1,6 @@ #pragma once #include "internal/kd.h" -/* DEFINES *******************************************************************/ - -/* formerly located in kdbg/kdb_symbols.c */ -#define TAG_KDBS 'SBDK' -#define TAG_KDBG 'GBDK' - /* TYPES *********************************************************************/ /* from kdb.c */ diff --git a/ntoskrnl/ke/bug.c b/ntoskrnl/ke/bug.c index f7b9175feab..8930e5fc88d 100644 --- a/ntoskrnl/ke/bug.c +++ b/ntoskrnl/ke/bug.c @@ -28,7 +28,6 @@ ULONG_PTR KiBugCheckData[5]; PKNMI_HANDLER_CALLBACK KiNmiCallbackListHead = NULL; KSPIN_LOCK KiNmiCallbackListLock; -#define TAG_KNMI 'IMNK' /* Bugzilla Reporting */ UNICODE_STRING KeRosProcessorName, KeRosBiosDate, KeRosBiosVersion; diff --git a/ntoskrnl/ke/i386/kiinit.c b/ntoskrnl/ke/i386/kiinit.c index 0414176c3d8..c8a9872b519 100644 --- a/ntoskrnl/ke/i386/kiinit.c +++ b/ntoskrnl/ke/i386/kiinit.c @@ -591,7 +591,7 @@ KiInitializeKernel(IN PKPROCESS InitProcess, /* Allocate the IOPM save area */ Ki386IopmSaveArea = ExAllocatePoolWithTag(PagedPool, IOPM_SIZE, - ' eK'); + TAG_KERNEL); if (!Ki386IopmSaveArea) { /* Bugcheck. We need this for V86/VDM support. */ diff --git a/ntoskrnl/ke/i386/v86vdm.c b/ntoskrnl/ke/i386/v86vdm.c index 0421f005217..a50f3aba188 100644 --- a/ntoskrnl/ke/i386/v86vdm.c +++ b/ntoskrnl/ke/i386/v86vdm.c @@ -655,7 +655,7 @@ Ke386CallBios(IN ULONG Int, /* Allocate VDM structure */ VdmProcessObjects = ExAllocatePoolWithTag(NonPagedPool, sizeof(VDM_PROCESS_OBJECTS), - ' eK'); + TAG_KERNEL); if (!VdmProcessObjects) return STATUS_NO_MEMORY; /* Set it up */ @@ -694,7 +694,7 @@ Ke386CallBios(IN ULONG Int, Context->ContextFlags = CONTEXT_FULL; /* Free VDM objects */ - ExFreePoolWithTag(PsGetCurrentProcess()->VdmObjects, ' eK'); + ExFreePoolWithTag(PsGetCurrentProcess()->VdmObjects, TAG_KERNEL); PsGetCurrentProcess()->VdmObjects = NULL; /* Return status */ diff --git a/ntoskrnl/ob/obhandle.c b/ntoskrnl/ob/obhandle.c index c738e3669ee..cff2cbb80e9 100644 --- a/ntoskrnl/ob/obhandle.c +++ b/ntoskrnl/ob/obhandle.c @@ -19,8 +19,6 @@ PHANDLE_TABLE ObpKernelHandleTable = NULL; -#define TAG_OB_HANDLE 'dHbO' - /* PRIVATE FUNCTIONS *********************************************************/ PHANDLE_TABLE diff --git a/ntoskrnl/po/povolume.c b/ntoskrnl/po/povolume.c index 235b6a2feb3..1897c045942 100644 --- a/ntoskrnl/po/povolume.c +++ b/ntoskrnl/po/povolume.c @@ -27,8 +27,6 @@ KGUARDED_MUTEX PopVolumeLock; LIST_ENTRY PopVolumeDevices; KSPIN_LOCK PopDopeGlobalLock; -#define TAG_PO_DOPE 'EPOD' - /* PRIVATE FUNCTIONS *********************************************************/ PDEVICE_OBJECT_POWER_EXTENSION diff --git a/ntoskrnl/ps/apphelp.c b/ntoskrnl/ps/apphelp.c index 8a17777a852..91cd277cb04 100644 --- a/ntoskrnl/ps/apphelp.c +++ b/ntoskrnl/ps/apphelp.c @@ -39,7 +39,6 @@ static UNICODE_STRING AppCompatCacheValue = RTL_CONSTANT_STRING(L"AppCompatCache #define EMPTY_SHIM_ENTRY { { 0 }, { { 0 } }, 0 } #define MAX_SHIM_ENTRIES 0x200 -#define TAG_SHIM 'MIHS' #ifndef INVALID_HANDLE_VALUE #define INVALID_HANDLE_VALUE (HANDLE)(-1) diff --git a/ntoskrnl/ps/i386/psldt.c b/ntoskrnl/ps/i386/psldt.c index f13e2952a4a..43bcbd9a185 100644 --- a/ntoskrnl/ps/i386/psldt.c +++ b/ntoskrnl/ps/i386/psldt.c @@ -34,7 +34,7 @@ PspDeleteVdmObjects(PEPROCESS Process) UNIMPLEMENTED; /* Free VDM objects */ - ExFreePoolWithTag(Process->VdmObjects, ' eK'); + ExFreePoolWithTag(Process->VdmObjects, TAG_KERNEL); Process->VdmObjects = NULL; } diff --git a/ntoskrnl/rtl/libsupp.c b/ntoskrnl/rtl/libsupp.c index 432b9185b40..e8d7b68df88 100644 --- a/ntoskrnl/rtl/libsupp.c +++ b/ntoskrnl/rtl/libsupp.c @@ -13,9 +13,6 @@ #define NDEBUG #include <debug.h> -#define TAG_ATMT 'TotA' /* Atom table */ -#define TAG_RTHL 'LHtR' /* Heap Lock */ - extern ULONG NtGlobalFlag; typedef struct _RTL_RANGE_ENTRY @@ -114,10 +111,6 @@ RtlpAllocateMemory(ULONG Bytes, Tag); } - -#define TAG_USTR 'RTSU' -#define TAG_ASTR 'RTSA' -#define TAG_OSTR 'RTSO' VOID NTAPI RtlpFreeMemory(PVOID Mem,
2 years, 12 months
1
0
0
0
[reactos] 01/01: [MSPAINT] Define enum TOOLTYPE and use it (#4197)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e9330371ea76ae46d09f5…
commit e9330371ea76ae46d09f5f850bc8197f01349b1c Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Dec 27 23:23:32 2021 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Mon Dec 27 23:23:32 2021 +0900 [MSPAINT] Define enum TOOLTYPE and use it (#4197) Improve code quality and debuggability. CORE-17931 --- base/applications/mspaint/definitions.h | 18 ---------------- base/applications/mspaint/imgarea.cpp | 4 ++++ base/applications/mspaint/mouse.cpp | 33 ++++++++++++++++++++++++++++++ base/applications/mspaint/toolbox.cpp | 32 ++++++++++++++--------------- base/applications/mspaint/toolsettings.cpp | 10 +++++++++ base/applications/mspaint/toolsmodel.cpp | 4 ++-- base/applications/mspaint/toolsmodel.h | 26 ++++++++++++++++++++--- base/applications/mspaint/winproc.cpp | 2 ++ 8 files changed, 90 insertions(+), 39 deletions(-) diff --git a/base/applications/mspaint/definitions.h b/base/applications/mspaint/definitions.h index 6d5e7bc109c..26ea4f19549 100644 --- a/base/applications/mspaint/definitions.h +++ b/base/applications/mspaint/definitions.h @@ -131,24 +131,6 @@ #define ID_ELLIPSE 614 #define ID_RRECT 615 -/* the following 16 numbers need to be in order, increasing by 1 */ -#define TOOL_FREESEL 1 -#define TOOL_RECTSEL 2 -#define TOOL_RUBBER 3 -#define TOOL_FILL 4 -#define TOOL_COLOR 5 -#define TOOL_ZOOM 6 -#define TOOL_PEN 7 -#define TOOL_BRUSH 8 -#define TOOL_AIRBRUSH 9 -#define TOOL_TEXT 10 -#define TOOL_LINE 11 -#define TOOL_BEZIER 12 -#define TOOL_RECT 13 -#define TOOL_SHAPE 14 -#define TOOL_ELLIPSE 15 -#define TOOL_RRECT 16 - #define ID_ACCELERATORS 800 #define IDD_MIRRORROTATE 700 diff --git a/base/applications/mspaint/imgarea.cpp b/base/applications/mspaint/imgarea.cpp index c5169a2b1cc..d521b6f065d 100644 --- a/base/applications/mspaint/imgarea.cpp +++ b/base/applications/mspaint/imgarea.cpp @@ -275,6 +275,8 @@ LRESULT CImgAreaWindow::OnKeyDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& case TOOL_SHAPE: case TOOL_BEZIER: cancelDrawing(); break; + default: + break; } } } @@ -369,6 +371,8 @@ LRESULT CImgAreaWindow::OnMouseMove(UINT nMsg, WPARAM wParam, LPARAM lParam, BOO SendMessage(hStatusBar, SB_SETTEXT, 1, (LPARAM) (LPCTSTR) strCoord); break; } + default: + break; } if ((wParam & MK_LBUTTON) != 0) { diff --git a/base/applications/mspaint/mouse.cpp b/base/applications/mspaint/mouse.cpp index 8c81c88562c..0720a9fde56 100644 --- a/base/applications/mspaint/mouse.cpp +++ b/base/applications/mspaint/mouse.cpp @@ -127,6 +127,9 @@ startPaintingL(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg) pointSP++; } break; + case TOOL_COLOR: + case TOOL_ZOOM: + break; } } @@ -217,6 +220,10 @@ whilePaintingL(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg) regularize(start.x, start.y, x, y); RRect(hdc, start.x, start.y, x, y, fg, bg, toolsModel.GetLineWidth(), toolsModel.GetShapeStyle()); break; + case TOOL_FILL: + case TOOL_COLOR: + case TOOL_ZOOM: + break; } last.x = x; @@ -330,6 +337,12 @@ endPaintingL(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg) regularize(start.x, start.y, x, y); RRect(hdc, start.x, start.y, x, y, fg, bg, toolsModel.GetLineWidth(), toolsModel.GetShapeStyle()); break; + case TOOL_FILL: + case TOOL_COLOR: + case TOOL_ZOOM: + case TOOL_BRUSH: + case TOOL_AIRBRUSH: + break; } } @@ -390,6 +403,10 @@ startPaintingR(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg) pointSP++; } break; + case TOOL_RECTSEL: + case TOOL_COLOR: + case TOOL_ZOOM: + break; } } @@ -462,6 +479,13 @@ whilePaintingR(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg) regularize(start.x, start.y, x, y); RRect(hdc, start.x, start.y, x, y, bg, fg, toolsModel.GetLineWidth(), toolsModel.GetShapeStyle()); break; + case TOOL_FREESEL: + case TOOL_RECTSEL: + case TOOL_FILL: + case TOOL_COLOR: + case TOOL_ZOOM: + case TOOL_TEXT: + break; } last.x = x; @@ -532,5 +556,14 @@ endPaintingR(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg) regularize(start.x, start.y, x, y); RRect(hdc, start.x, start.y, x, y, bg, fg, toolsModel.GetLineWidth(), toolsModel.GetShapeStyle()); break; + case TOOL_FREESEL: + case TOOL_RECTSEL: + case TOOL_FILL: + case TOOL_COLOR: + case TOOL_ZOOM: + case TOOL_BRUSH: + case TOOL_AIRBRUSH: + case TOOL_TEXT: + break; } } diff --git a/base/applications/mspaint/toolbox.cpp b/base/applications/mspaint/toolbox.cpp index adfc282cdc9..7e0a3aeeafd 100644 --- a/base/applications/mspaint/toolbox.cpp +++ b/base/applications/mspaint/toolbox.cpp @@ -76,52 +76,52 @@ LRESULT CToolBox::OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHand switch (LOWORD(wParam)) { case ID_FREESEL: - toolsModel.SetActiveTool(1); + toolsModel.SetActiveTool(TOOL_FREESEL); break; case ID_RECTSEL: - toolsModel.SetActiveTool(2); + toolsModel.SetActiveTool(TOOL_RECTSEL); break; case ID_RUBBER: - toolsModel.SetActiveTool(3); + toolsModel.SetActiveTool(TOOL_RUBBER); break; case ID_FILL: - toolsModel.SetActiveTool(4); + toolsModel.SetActiveTool(TOOL_FILL); break; case ID_COLOR: - toolsModel.SetActiveTool(5); + toolsModel.SetActiveTool(TOOL_COLOR); break; case ID_ZOOM: - toolsModel.SetActiveTool(6); + toolsModel.SetActiveTool(TOOL_ZOOM); break; case ID_PEN: - toolsModel.SetActiveTool(7); + toolsModel.SetActiveTool(TOOL_PEN); break; case ID_BRUSH: - toolsModel.SetActiveTool(8); + toolsModel.SetActiveTool(TOOL_BRUSH); break; case ID_AIRBRUSH: - toolsModel.SetActiveTool(9); + toolsModel.SetActiveTool(TOOL_AIRBRUSH); break; case ID_TEXT: - toolsModel.SetActiveTool(10); + toolsModel.SetActiveTool(TOOL_TEXT); break; case ID_LINE: - toolsModel.SetActiveTool(11); + toolsModel.SetActiveTool(TOOL_LINE); break; case ID_BEZIER: - toolsModel.SetActiveTool(12); + toolsModel.SetActiveTool(TOOL_BEZIER); break; case ID_RECT: - toolsModel.SetActiveTool(13); + toolsModel.SetActiveTool(TOOL_RECT); break; case ID_SHAPE: - toolsModel.SetActiveTool(14); + toolsModel.SetActiveTool(TOOL_SHAPE); break; case ID_ELLIPSE: - toolsModel.SetActiveTool(15); + toolsModel.SetActiveTool(TOOL_ELLIPSE); break; case ID_RRECT: - toolsModel.SetActiveTool(16); + toolsModel.SetActiveTool(TOOL_RRECT); break; } return 0; diff --git a/base/applications/mspaint/toolsettings.cpp b/base/applications/mspaint/toolsettings.cpp index acda95196e5..4639d81da66 100644 --- a/base/applications/mspaint/toolsettings.cpp +++ b/base/applications/mspaint/toolsettings.cpp @@ -175,6 +175,11 @@ LRESULT CToolSettingsWindow::OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BO DeleteObject(SelectObject(hdc, oldPen)); break; } + case TOOL_FILL: + case TOOL_COLOR: + case TOOL_ZOOM: + case TOOL_PEN: + break; } ReleaseDC(hdc); return 0; @@ -233,6 +238,11 @@ LRESULT CToolSettingsWindow::OnLButtonDown(UINT nMsg, WPARAM wParam, LPARAM lPar if ((y >= 70) && (y <= 132)) toolsModel.SetLineWidth((y - 72) / 12 + 1); break; + case TOOL_FILL: + case TOOL_COLOR: + case TOOL_ZOOM: + case TOOL_PEN: + break; } return 0; } diff --git a/base/applications/mspaint/toolsmodel.cpp b/base/applications/mspaint/toolsmodel.cpp index 36a521f7b3d..a0ceaeff1ef 100644 --- a/base/applications/mspaint/toolsmodel.cpp +++ b/base/applications/mspaint/toolsmodel.cpp @@ -57,12 +57,12 @@ void ToolsModel::SetBrushStyle(int nBrushStyle) NotifyToolSettingsChanged(); } -int ToolsModel::GetActiveTool() const +TOOLTYPE ToolsModel::GetActiveTool() const { return m_activeTool; } -void ToolsModel::SetActiveTool(int nActiveTool) +void ToolsModel::SetActiveTool(TOOLTYPE nActiveTool) { m_activeTool = nActiveTool; NotifyToolChanged(); diff --git a/base/applications/mspaint/toolsmodel.h b/base/applications/mspaint/toolsmodel.h index 104da42637c..0fff204d626 100644 --- a/base/applications/mspaint/toolsmodel.h +++ b/base/applications/mspaint/toolsmodel.h @@ -8,6 +8,26 @@ #pragma once +enum TOOLTYPE +{ + TOOL_FREESEL = 1, + TOOL_RECTSEL = 2, + TOOL_RUBBER = 3, + TOOL_FILL = 4, + TOOL_COLOR = 5, + TOOL_ZOOM = 6, + TOOL_PEN = 7, + TOOL_BRUSH = 8, + TOOL_AIRBRUSH = 9, + TOOL_TEXT = 10, + TOOL_LINE = 11, + TOOL_BEZIER = 12, + TOOL_RECT = 13, + TOOL_SHAPE = 14, + TOOL_ELLIPSE = 15, + TOOL_RRECT = 16, +}; + /* CLASSES **********************************************************/ class ToolsModel @@ -16,7 +36,7 @@ private: int m_lineWidth; int m_shapeStyle; int m_brushStyle; - int m_activeTool; + TOOLTYPE m_activeTool; int m_airBrushWidth; int m_rubberRadius; BOOL m_transpBg; @@ -34,8 +54,8 @@ public: void SetShapeStyle(int nShapeStyle); int GetBrushStyle() const; void SetBrushStyle(int nBrushStyle); - int GetActiveTool() const; - void SetActiveTool(int nActiveTool); + TOOLTYPE GetActiveTool() const; + void SetActiveTool(TOOLTYPE nActiveTool); int GetAirBrushWidth() const; void SetAirBrushWidth(int nAirBrushWidth); int GetRubberRadius() const; diff --git a/base/applications/mspaint/winproc.cpp b/base/applications/mspaint/winproc.cpp index dea5e46cdda..1f251449669 100644 --- a/base/applications/mspaint/winproc.cpp +++ b/base/applications/mspaint/winproc.cpp @@ -405,6 +405,8 @@ LRESULT CMainWindow::OnKeyDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bH case TOOL_SHAPE: case TOOL_BEZIER: imageArea.SendMessage(nMsg, wParam, lParam); break; + default: + break; } } }
2 years, 12 months
1
0
0
0
[reactos] 01/01: [MSPAINT] Mouse Wheel support (#4195)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=90c3f89bb29f021470be7…
commit 90c3f89bb29f021470be7ad4e4cb9609e39bd4d8 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Dec 27 22:20:22 2021 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Mon Dec 27 22:20:22 2021 +0900 [MSPAINT] Mouse Wheel support (#4195) Improve usability by mouse wheel handling. Plain wheel, Ctrl+Wheel, and Shift+Wheel. CORE-17937 --- base/applications/mspaint/common.h | 2 ++ base/applications/mspaint/imgarea.cpp | 9 ++++-- base/applications/mspaint/imgarea.h | 2 ++ base/applications/mspaint/scrollbox.cpp | 5 +++ base/applications/mspaint/scrollbox.h | 2 ++ base/applications/mspaint/selection.cpp | 5 +++ base/applications/mspaint/selection.h | 2 ++ base/applications/mspaint/toolsettings.cpp | 2 +- base/applications/mspaint/winproc.cpp | 50 ++++++++++++++++++++++++++++++ base/applications/mspaint/winproc.h | 2 ++ 10 files changed, 78 insertions(+), 3 deletions(-) diff --git a/base/applications/mspaint/common.h b/base/applications/mspaint/common.h index e6864cc21a8..7cdbb22c9bf 100644 --- a/base/applications/mspaint/common.h +++ b/base/applications/mspaint/common.h @@ -26,3 +26,5 @@ static inline int UnZoomed(int xy) } #define GRIP_SIZE 3 +#define MIN_ZOOM 125 +#define MAX_ZOOM 8000 diff --git a/base/applications/mspaint/imgarea.cpp b/base/applications/mspaint/imgarea.cpp index 99a6c72d177..c5169a2b1cc 100644 --- a/base/applications/mspaint/imgarea.cpp +++ b/base/applications/mspaint/imgarea.cpp @@ -172,7 +172,7 @@ LRESULT CImgAreaWindow::OnLButtonDown(UINT nMsg, WPARAM wParam, LPARAM lParam, B imageModel.Undo(); } Invalidate(FALSE); - if ((toolsModel.GetActiveTool() == TOOL_ZOOM) && (toolsModel.GetZoom() < 8000)) + if ((toolsModel.GetActiveTool() == TOOL_ZOOM) && (toolsModel.GetZoom() < MAX_ZOOM)) zoomTo(toolsModel.GetZoom() * 2, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); return 0; } @@ -192,7 +192,7 @@ LRESULT CImgAreaWindow::OnRButtonDown(UINT nMsg, WPARAM wParam, LPARAM lParam, B imageModel.Undo(); } Invalidate(FALSE); - if ((toolsModel.GetActiveTool() == TOOL_ZOOM) && (toolsModel.GetZoom() > 125)) + if ((toolsModel.GetActiveTool() == TOOL_ZOOM) && (toolsModel.GetZoom() > MIN_ZOOM)) zoomTo(toolsModel.GetZoom() / 2, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); return 0; } @@ -419,3 +419,8 @@ LRESULT CImgAreaWindow::OnImageModelImageChanged(UINT nMsg, WPARAM wParam, LPARA Invalidate(FALSE); return 0; } + +LRESULT CImgAreaWindow::OnMouseWheel(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) +{ + return ::SendMessage(GetParent(), nMsg, wParam, lParam); +} diff --git a/base/applications/mspaint/imgarea.h b/base/applications/mspaint/imgarea.h index 2fd0074b255..184076c965a 100644 --- a/base/applications/mspaint/imgarea.h +++ b/base/applications/mspaint/imgarea.h @@ -24,6 +24,7 @@ public: MESSAGE_HANDLER(WM_LBUTTONUP, OnLButtonUp) MESSAGE_HANDLER(WM_RBUTTONUP, OnRButtonUp) MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove) + MESSAGE_HANDLER(WM_MOUSEWHEEL, OnMouseWheel) MESSAGE_HANDLER(WM_MOUSELEAVE, OnMouseLeave) MESSAGE_HANDLER(WM_IMAGEMODELDIMENSIONSCHANGED, OnImageModelDimensionsChanged) MESSAGE_HANDLER(WM_IMAGEMODELIMAGECHANGED, OnImageModelImageChanged) @@ -42,6 +43,7 @@ private: LRESULT OnLButtonUp(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnRButtonUp(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnMouseMove(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); + LRESULT OnMouseWheel(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnMouseLeave(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnImageModelDimensionsChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnImageModelImageChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); diff --git a/base/applications/mspaint/scrollbox.cpp b/base/applications/mspaint/scrollbox.cpp index c2354c0cc10..32f48e6d490 100644 --- a/base/applications/mspaint/scrollbox.cpp +++ b/base/applications/mspaint/scrollbox.cpp @@ -179,3 +179,8 @@ LRESULT CScrollboxWindow::OnLButtonDown(UINT nMsg, WPARAM wParam, LPARAM lParam, pointSP = 0; // resets the point-buffer of the polygon and bezier functions return 0; } + +LRESULT CScrollboxWindow::OnMouseWheel(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) +{ + return ::SendMessage(GetParent(), nMsg, wParam, lParam); +} diff --git a/base/applications/mspaint/scrollbox.h b/base/applications/mspaint/scrollbox.h index 54c42b3d8a2..e2fa3461847 100644 --- a/base/applications/mspaint/scrollbox.h +++ b/base/applications/mspaint/scrollbox.h @@ -18,12 +18,14 @@ public: MESSAGE_HANDLER(WM_HSCROLL, OnHScroll) MESSAGE_HANDLER(WM_VSCROLL, OnVScroll) MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown) + MESSAGE_HANDLER(WM_MOUSEWHEEL, OnMouseWheel) END_MSG_MAP() LRESULT OnSize(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnHScroll(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnVScroll(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnLButtonDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); + LRESULT OnMouseWheel(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); }; void UpdateScrollbox(); diff --git a/base/applications/mspaint/selection.cpp b/base/applications/mspaint/selection.cpp index c9155be1cf0..8edd85ba173 100644 --- a/base/applications/mspaint/selection.cpp +++ b/base/applications/mspaint/selection.cpp @@ -280,3 +280,8 @@ LRESULT CSelectionWindow::OnSelectionModelRefreshNeeded(UINT nMsg, WPARAM wParam ForceRefreshSelectionContents(); return 0; } + +LRESULT CSelectionWindow::OnMouseWheel(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) +{ + return ::SendMessage(GetParent(), nMsg, wParam, lParam); +} diff --git a/base/applications/mspaint/selection.h b/base/applications/mspaint/selection.h index 536d4aa9a77..44c9bac0ade 100644 --- a/base/applications/mspaint/selection.h +++ b/base/applications/mspaint/selection.h @@ -22,6 +22,7 @@ public: MESSAGE_HANDLER(WM_SETCURSOR, OnSetCursor) MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown) MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove) + MESSAGE_HANDLER(WM_MOUSEWHEEL, OnMouseWheel) MESSAGE_HANDLER(WM_LBUTTONUP, OnLButtonUp) MESSAGE_HANDLER(WM_PALETTEMODELCOLORCHANGED, OnPaletteModelColorChanged) MESSAGE_HANDLER(WM_TOOLSMODELSETTINGSCHANGED, OnToolsModelSettingsChanged) @@ -37,6 +38,7 @@ public: LRESULT OnSetCursor(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnLButtonDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnMouseMove(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); + LRESULT OnMouseWheel(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnLButtonUp(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnPaletteModelColorChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnToolsModelSettingsChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); diff --git a/base/applications/mspaint/toolsettings.cpp b/base/applications/mspaint/toolsettings.cpp index 11cce8386d0..acda95196e5 100644 --- a/base/applications/mspaint/toolsettings.cpp +++ b/base/applications/mspaint/toolsettings.cpp @@ -255,7 +255,7 @@ LRESULT CToolSettingsWindow::OnToolsModelZoomChanged(UINT nMsg, WPARAM wParam, L int tbPos = 0; int tempZoom = toolsModel.GetZoom(); - while (tempZoom > 125) + while (tempZoom > MIN_ZOOM) { tbPos++; tempZoom = tempZoom >> 1; diff --git a/base/applications/mspaint/winproc.cpp b/base/applications/mspaint/winproc.cpp index be060047ac3..dea5e46cdda 100644 --- a/base/applications/mspaint/winproc.cpp +++ b/base/applications/mspaint/winproc.cpp @@ -157,6 +157,56 @@ void CMainWindow::InsertSelectionFromHBITMAP(HBITMAP bitmap, HWND window) ForceRefreshSelectionContents(); } +LRESULT CMainWindow::OnMouseWheel(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) +{ + INT zDelta = (SHORT)HIWORD(wParam); + + if (::GetAsyncKeyState(VK_CONTROL) < 0) + { + if (zDelta < 0) + { + if (toolsModel.GetZoom() > MIN_ZOOM) + zoomTo(toolsModel.GetZoom() / 2, 0, 0); + } + else if (zDelta > 0) + { + if (toolsModel.GetZoom() < MAX_ZOOM) + zoomTo(toolsModel.GetZoom() * 2, 0, 0); + } + } + else + { + UINT nCount = 3; + if (::GetAsyncKeyState(VK_SHIFT) < 0) + { +#ifndef SPI_GETWHEELSCROLLCHARS + #define SPI_GETWHEELSCROLLCHARS 0x006C // Needed for pre-NT6 PSDK +#endif + SystemParametersInfoW(SPI_GETWHEELSCROLLCHARS, 0, &nCount, 0); + for (UINT i = 0; i < nCount; ++i) + { + if (zDelta < 0) + ::PostMessageW(scrollboxWindow, WM_HSCROLL, MAKEWPARAM(SB_LINEDOWN, 0), 0); + else if (zDelta > 0) + ::PostMessageW(scrollboxWindow, WM_HSCROLL, MAKEWPARAM(SB_LINEUP, 0), 0); + } + } + else + { + SystemParametersInfoW(SPI_GETWHEELSCROLLLINES, 0, &nCount, 0); + for (UINT i = 0; i < nCount; ++i) + { + if (zDelta < 0) + ::PostMessageW(scrollboxWindow, WM_VSCROLL, MAKEWPARAM(SB_LINEDOWN, 0), 0); + else if (zDelta > 0) + ::PostMessageW(scrollboxWindow, WM_VSCROLL, MAKEWPARAM(SB_LINEUP, 0), 0); + } + } + } + + return 0; +} + LRESULT CMainWindow::OnDropFiles(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { TCHAR droppedfile[MAX_PATH]; diff --git a/base/applications/mspaint/winproc.h b/base/applications/mspaint/winproc.h index 0c4a4e799c9..e88e822b420 100644 --- a/base/applications/mspaint/winproc.h +++ b/base/applications/mspaint/winproc.h @@ -26,6 +26,7 @@ public: MESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown) MESSAGE_HANDLER(WM_SYSCOLORCHANGE, OnSysColorChange) MESSAGE_HANDLER(WM_COMMAND, OnCommand) + MESSAGE_HANDLER(WM_MOUSEWHEEL, OnMouseWheel) END_MSG_MAP() LRESULT OnDropFiles(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); @@ -39,6 +40,7 @@ public: LRESULT OnKeyDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnSysColorChange(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); + LRESULT OnMouseWheel(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); void alignChildrenToMainWindow(); void saveImage(BOOL overwrite);
2 years, 12 months
1
0
0
0
[reactos] 01/01: [SYSDM] Update Spanish (es-ES) translation (#4186)
by Javier Fernandez
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=29718e009aa60ded7d918…
commit 29718e009aa60ded7d9182096e936678f631da96 Author: Javier Fernandez <elhoir(a)users.noreply.github.com> AuthorDate: Mon Dec 27 14:08:42 2021 +0100 Commit: GitHub <noreply(a)github.com> CommitDate: Mon Dec 27 16:08:42 2021 +0300 [SYSDM] Update Spanish (es-ES) translation (#4186) Reviewed-by: Julio Carchi Ruiz <julcar(a)informaticos.com> Reviewed-by: Julen Urizar Compains <julenuri(a)hotmail.com> Signed-off-by: Javier Fernandez <elhoir(a)gmail.com> --- dll/cpl/sysdm/lang/es-ES.rc | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/dll/cpl/sysdm/lang/es-ES.rc b/dll/cpl/sysdm/lang/es-ES.rc index 591d19719bc..88c358ca68d 100644 --- a/dll/cpl/sysdm/lang/es-ES.rc +++ b/dll/cpl/sysdm/lang/es-ES.rc @@ -293,8 +293,8 @@ BEGIN EDITTEXT IDC_VARIABLE_VALUE, 75, 30, 289, 12, ES_AUTOHSCROLL DEFPUSHBUTTON "Aceptar", IDOK, 260, 50, 50, 14 PUSHBUTTON "Cancelar", IDCANCEL, 314, 50, 50, 14 - PUSHBUTTON "Browse Directory...", IDC_BUTTON_BROWSE_FOLDER, 6, 50, 75, 14 - PUSHBUTTON "Browse Files...", IDC_BUTTON_BROWSE_FILE, 86, 50, 75, 14 + PUSHBUTTON "Examinar Directorio...", IDC_BUTTON_BROWSE_FOLDER, 6, 50, 75, 14 + PUSHBUTTON "Examinar Ficheros...", IDC_BUTTON_BROWSE_FILE, 86, 50, 75, 14 END IDD_EDIT_VARIABLE_FANCY DIALOGEX 10, 15, 300, 250 @@ -305,13 +305,13 @@ BEGIN SCROLLBAR IDC_DIALOG_GRIP, 293, 243, 7, 7, SBS_SIZEGRIP CONTROL "", IDC_LIST_VARIABLE_VALUE, "SysListView32", LVS_NOCOLUMNHEADER | LVS_EDITLABELS | LVS_SHOWSELALWAYS | LVS_SINGLESEL | LVS_REPORT | WS_BORDER | WS_TABSTOP, 10, 10, 224, 208, WS_EX_CLIENTEDGE - PUSHBUTTON "New", IDC_BUTTON_NEW, 242, 10, 50, 14 - PUSHBUTTON "Edit", IDC_BUTTON_EDIT, 242, 30, 50, 14 - PUSHBUTTON "Browse...", IDC_BUTTON_BROWSE_FOLDER, 242, 50, 50, 14 - PUSHBUTTON "Delete", IDC_BUTTON_DELETE, 242, 70, 50, 14 - PUSHBUTTON "Move Up", IDC_BUTTON_MOVE_UP, 242, 100, 50, 14 - PUSHBUTTON "Move Down", IDC_BUTTON_MOVE_DOWN, 242, 120, 50, 14 - PUSHBUTTON "Edit text...", IDC_BUTTON_EDIT_TEXT, 242, 150, 50, 14 + PUSHBUTTON "Nuevo", IDC_BUTTON_NEW, 242, 10, 50, 14 + PUSHBUTTON "Editar", IDC_BUTTON_EDIT, 242, 30, 50, 14 + PUSHBUTTON "Examinar...", IDC_BUTTON_BROWSE_FOLDER, 242, 50, 50, 14 + PUSHBUTTON "Borrar", IDC_BUTTON_DELETE, 242, 70, 50, 14 + PUSHBUTTON "Mover arriba", IDC_BUTTON_MOVE_UP, 242, 100, 50, 14 + PUSHBUTTON "Mover abajo", IDC_BUTTON_MOVE_DOWN, 242, 120, 50, 14 + PUSHBUTTON "Editar texto...", IDC_BUTTON_EDIT_TEXT, 242, 150, 50, 14 DEFPUSHBUTTON "Aceptar", IDOK, 188, 228, 50, 14 PUSHBUTTON "Cancelar", IDCANCEL, 242, 228, 50, 14 END @@ -348,13 +348,13 @@ BEGIN IDS_USERPROFILE_STATUS "Estado" IDS_USERPROFILE_MODIFIED "Modificado" IDS_USERPROFILE_LOCAL "Local" - IDS_USERPROFILE_ROAMING "Roaming" - IDS_USERPROFILE_MANDATORY "Mandatory" - IDS_USERPROFILE_CONFIRM_DELETE "Are you sure you want to delete %s's profile?" - IDS_USERPROFILE_CONFIRM_DELETE_TITLE "Confirm Delete" - IDS_USERPROFILE_ACCOUNT_UNKNOWN "Account Unknown" - IDS_USERPROFILE_ACCOUNT_DELETED "Account Deleted" - IDS_USERPROFILE_TYPE_TEXT "When %s logs onto this computer, should the operating system use the roaming profile or just the locally cached copy of the roaming profile." + IDS_USERPROFILE_ROAMING "Móvil" + IDS_USERPROFILE_MANDATORY "Obligatorio" + IDS_USERPROFILE_CONFIRM_DELETE "¿Está seguro de que quiere borrar el perfil %s'?" + IDS_USERPROFILE_CONFIRM_DELETE_TITLE "Confirmar borrado" + IDS_USERPROFILE_ACCOUNT_UNKNOWN "Cuenta desconocida" + IDS_USERPROFILE_ACCOUNT_DELETED "Cuenta borrada" + IDS_USERPROFILE_TYPE_TEXT "Cuando %s inicie sesión en este equipo, aplicar el perfil móvil, o la copia en caché local del perfil móvil." IDS_MESSAGEBOXTITLE "Applet de sistema del Panel de control" IDS_WARNINITIALSIZE "Introduzca el tamaño inicial del archivo de paginación." IDS_WARNMAXIMUMSIZE "Introduzca el tamaño máximo del archivo de paginación." @@ -369,6 +369,6 @@ BEGIN IDS_HWPROFILE_ALREADY_IN_USE "El nombre de perfil ya está en uso." IDS_HWPROFILE_PROFILE "Perfil" IDS_HWPROFILE_WARNING "Advertencia" - IDS_ENVIRONMENT_WARNING "Any changes that have been done will be discarded and the variable's value will be edited as text." - IDS_ENVIRONMENT_WARNING_TITLE "System Properties" + IDS_ENVIRONMENT_WARNING "Cualquier cambio será descartado y el valor de la variable será editado como texto." + IDS_ENVIRONMENT_WARNING_TITLE "Propiedades del Sistema" END
2 years, 12 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
16
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Results per page:
10
25
50
100
200