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
November 2005
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
27 participants
875 discussions
Start a n
N
ew thread
[weiden] 19132: fixed warnings when compiled with -Wwrite-strings
by weiden@svn.reactos.com
fixed warnings when compiled with -Wwrite-strings Modified: trunk/reactos/apps/utils/net/whois/whois.c Modified: trunk/reactos/apps/utils/ps/ps.c Modified: trunk/reactos/apps/utils/rosperf/alphablend.c _____ Modified: trunk/reactos/apps/utils/net/whois/whois.c --- trunk/reactos/apps/utils/net/whois/whois.c 2005-11-11 16:11:13 UTC (rev 19131) +++ trunk/reactos/apps/utils/net/whois/whois.c 2005-11-11 16:18:46 UTC (rev 19132) @@ -62,7 +62,7 @@ struct hostent *hp; struct servent *sp; int s; - char *host; + const char *host; WORD wVersionRequested; WSADATA wsaData; int err; _____ Modified: trunk/reactos/apps/utils/ps/ps.c --- trunk/reactos/apps/utils/ps/ps.c 2005-11-11 16:11:13 UTC (rev 19131) +++ trunk/reactos/apps/utils/ps/ps.c 2005-11-11 16:18:46 UTC (rev 19132) @@ -90,14 +90,14 @@ // x00000000 00000000 000:00:00 000:00:00 () -static char* title = "P PID PPID KTime UTime NAME\n"; -static char* title1 = "t TID KTime UTime State WaitResson\n"; -static char* title2 = "w PID Hwnd WndStile TID WndName\n"; +static char title[] = "P PID PPID KTime UTime NAME\n"; +static char title1[] = "t TID KTime UTime State WaitResson\n"; +static char title2[] = "w PID Hwnd WndStile TID WndName\n"; struct status { DWORD state; - char desc[10]; + const char desc[10]; } thread_stat[8 + 1] = { {0, "Init "}, {1, "Ready "}, _____ Modified: trunk/reactos/apps/utils/rosperf/alphablend.c --- trunk/reactos/apps/utils/rosperf/alphablend.c 2005-11-11 16:11:13 UTC (rev 19131) +++ trunk/reactos/apps/utils/rosperf/alphablend.c 2005-11-11 16:18:46 UTC (rev 19132) @@ -60,7 +60,7 @@ ULONG DbgPrint( - IN PCH Format, + IN PCSTR Format, IN ...); void
19 years, 1 month
1
0
0
0
[weiden] 19131: fixed warnings when compiled with -Wwrite-strings
by weiden@svn.reactos.com
fixed warnings when compiled with -Wwrite-strings Modified: trunk/reactos/apps/utils/net/finger/getopt.c Modified: trunk/reactos/apps/utils/net/finger/getopt.h Modified: trunk/reactos/apps/utils/net/ftp/cmds.c Modified: trunk/reactos/apps/utils/net/ftp/domacro.c Modified: trunk/reactos/apps/utils/net/ftp/fake.c Modified: trunk/reactos/apps/utils/net/ftp/ftp.c Modified: trunk/reactos/apps/utils/net/ftp/ftp_var.h Modified: trunk/reactos/apps/utils/net/ftp/main.c Modified: trunk/reactos/apps/utils/net/ftp/prototypes.h Modified: trunk/reactos/apps/utils/net/ftp/ruserpass.c Modified: trunk/reactos/apps/utils/net/telnet/src/ansiprsr.cpp Modified: trunk/reactos/apps/utils/net/telnet/src/ansiprsr.h Modified: trunk/reactos/apps/utils/net/telnet/src/tconsole.cpp Modified: trunk/reactos/apps/utils/net/telnet/src/tnconfig.cpp Modified: trunk/reactos/apps/utils/net/telnet/src/tnconfig.h Modified: trunk/reactos/apps/utils/net/telnet/src/tnmain.cpp Modified: trunk/reactos/apps/utils/net/telnet/src/tscroll.cpp _____ Modified: trunk/reactos/apps/utils/net/finger/getopt.c --- trunk/reactos/apps/utils/net/finger/getopt.c 2005-11-11 11:59:56 UTC (rev 19130) +++ trunk/reactos/apps/utils/net/finger/getopt.c 2005-11-11 16:11:13 UTC (rev 19131) @@ -50,7 +50,7 @@ int opterr = 1, /* if error message should be printed */ optind = 1, /* index into parent argv vector */ optopt; /* character checked for validity */ -char *optarg; /* argument associated with option */ +const char *optarg; /* argument associated with option */ #define BADCH (int)'?' #define EMSG "" @@ -58,7 +58,7 @@ int getopt(int nargc, char * const *nargv, const char *ostr) { - static char *place = EMSG; /* option letter processing */ + static const char *place = EMSG; /* option letter processing */ register char *oli; /* option letter list index */ char *p; _____ Modified: trunk/reactos/apps/utils/net/finger/getopt.h --- trunk/reactos/apps/utils/net/finger/getopt.h 2005-11-11 11:59:56 UTC (rev 19130) +++ trunk/reactos/apps/utils/net/finger/getopt.h 2005-11-11 16:11:13 UTC (rev 19131) @@ -1,6 +1,6 @@ /* getopt.h */ -extern char *optarg; +extern const char *optarg; extern int optind; int _____ Modified: trunk/reactos/apps/utils/net/ftp/cmds.c --- trunk/reactos/apps/utils/net/ftp/cmds.c 2005-11-11 11:59:56 UTC (rev 19130) +++ trunk/reactos/apps/utils/net/ftp/cmds.c 2005-11-11 16:11:13 UTC (rev 19131) @@ -53,9 +53,9 @@ extern off_t restart_point; extern char reply_string[]; -char *mname; +const char *mname; jmp_buf jabort; -char *dotrans(), *domap(); +const char *dotrans(), *domap(); extern short portnum; extern char *hostname; @@ -64,7 +64,7 @@ * Connect to peer server and * auto-login, if possible. */ -void setpeer(int argc, char *argv[]) +void setpeer(int argc, const char *argv[]) { char *host; @@ -154,8 +154,8 @@ } struct types { - char *t_name; - char *t_mode; + const char *t_name; + const char *t_mode; int t_type; char *t_arg; } types[] = { @@ -171,13 +171,13 @@ * Set transfer type. */ void settype(argc, argv) - char *argv[]; + const char *argv[]; { register struct types *p; int comret; if (argc > 2) { - char *sep; + const char *sep; printf("usage: %s [", argv[0]); sep = " "; @@ -216,7 +216,7 @@ } } -char *stype[] = { +const char *stype[] = { "type", "", 0 @@ -308,11 +308,11 @@ */ void put(argc, argv) int argc; - char *argv[]; + const char *argv[]; { - char *cmd; + const char *cmd; int loc = 0; - char *oldargv1, *oldargv2; + const char *oldargv1, *oldargv2; if (argc == 2) { argc++; @@ -374,12 +374,12 @@ * Send multiple files. */ void mput(argc, argv) - char *argv[]; + const char *argv[]; { register int i; int ointer; extern jmp_buf jabort; - char *tp; + const char *tp; if (argc < 2) { (void) strcat(line, " "); @@ -505,13 +505,13 @@ } void reget(argc, argv) - char *argv[]; + const char *argv[]; { (void) getit(argc, argv, 1, "r+w"); } void get(argc, argv) - char *argv[]; + const char *argv[]; { (void) getit(argc, argv, 0, restart_point ? "r+w" : "w" ); } @@ -520,11 +520,11 @@ * Receive one file. */ int getit(argc, argv, restartit, mode) - char *argv[]; - char *mode; + const char *argv[]; + const char *mode; { int loc = 0; - char *oldargv1, *oldargv2; + const char *oldargv1, *oldargv2; if (argc == 2) { argc++; @@ -565,7 +565,8 @@ return (0); } if (loc && mcase) { - char *tp = argv[1], *tp2, tmpbuf[MAXPATHLEN]; + const char *tp = argv[1]; + char *tp2, tmpbuf[MAXPATHLEN]; while (*tp && !islower(*tp)) { tp++; @@ -675,9 +676,10 @@ * Get multiple files. */ void mget(argc, argv) - char *argv[]; + const char *argv[]; { - char *cp, *tp, *tp2, tmpbuf[MAXPATHLEN]; + const char *cp, *tp; + char *tp2, tmpbuf[MAXPATHLEN]; int ointer; extern jmp_buf jabort; @@ -756,7 +758,8 @@ static FILE *ftemp = NULL; static char **args; int oldverbose, oldhash; - char *cp, *mode; + char *cp; + const char *mode; if (!mflag) { if (!doglob) { @@ -808,7 +811,7 @@ return (buf); } -static char * +static const char * onoff(bool) int bool; { @@ -1002,7 +1005,7 @@ * on remote machine. */ void cd(argc, argv) - char *argv[]; + const char *argv[]; { if (argc < 2) { @@ -1034,7 +1037,7 @@ * on local machine. */ void lcd(argc, argv) - char *argv[]; + const char *argv[]; { char buf[MAXPATHLEN]; @@ -1064,7 +1067,7 @@ * Delete a single file. */ void delete(argc, argv) - char *argv[]; + const char *argv[]; { if (argc < 2) { @@ -1089,7 +1092,7 @@ * Delete multiple files. */ void mdelete(argc, argv) - char *argv[]; + const char *argv[]; { char *cp; int ointer; @@ -1139,7 +1142,7 @@ * Rename a remote file. */ void renamefile(argc, argv) - char *argv[]; + const char *argv[]; { if (argc < 2) { @@ -1178,9 +1181,9 @@ * of remote files. */ void ls(argc, argv) - char *argv[]; + const char *argv[]; { - char *cmd; + const char *cmd; if (argc < 2) argc++, argv[1] = NULL; @@ -1211,9 +1214,10 @@ * of multiple remote files. */ void mls(argc, argv) - char *argv[]; + const char *argv[]; { - char *cmd, mode[1], *dest; + const char *cmd, *dest; + char mode[1]; int ointer, i; extern jmp_buf jabort; @@ -1395,7 +1399,7 @@ */ void user(argc, argv) int argc; - char **argv; + const char **argv; { char acct[80], *getpass(); int n, aflag = 0; @@ -1466,7 +1470,7 @@ * Make a directory. */ void makedir(argc, argv) - char *argv[]; + const char *argv[]; { if (argc < 2) { @@ -1497,7 +1501,7 @@ * Remove a directory. */ void removedir(argc, argv) - char *argv[]; + const char *argv[]; { if (argc < 2) { @@ -1528,7 +1532,7 @@ * Send a line, verbatim, to the remote machine. */ void quote(argc, argv) - char *argv[]; + const char *argv[]; { int i; char buf[BUFSIZ]; @@ -1565,7 +1569,7 @@ */ void site(argc, argv) - char *argv[]; + const char *argv[]; { int i; char buf[BUFSIZ]; @@ -1597,7 +1601,7 @@ } void do_chmod(argc, argv) - char *argv[]; + const char *argv[]; { if (argc == 2) { printf("usage: %s mode file-name\n", argv[0]); @@ -1692,7 +1696,7 @@ } int confirm(cmd, file) - char *cmd, *file; + const char *cmd, *file; { char line[BUFSIZ]; @@ -1721,7 +1725,7 @@ * from the expression, we return only the first. */ int globulize(cpp) - char **cpp; + const char **cpp; { char **globbed; @@ -1796,7 +1800,7 @@ void doproxy(argc,argv) int argc; - char *argv[]; + const char *argv[]; { register struct cmd *c; struct cmd *getcmd(); @@ -1901,12 +1905,13 @@ ntout[16] = '\0'; } -char * +const char * dotrans(name) - char *name; + const char *name; { static char new[MAXPATHLEN]; - char *cp1, *cp2 = new; + const char *cp1; + char *cp2 = new; register int i, ostop, found; for (ostop = 0; *(ntout + ostop) && ostop < 16; ostop++); @@ -1943,7 +1948,7 @@ void setnmap(argc, argv) int argc; - char *argv[]; + const char *argv[]; { char *cp; @@ -1983,13 +1988,14 @@ (void) strncpy(mapout, cp, MAXPATHLEN - 1); } -char * +const char * domap(name) - char *name; + const char *name; { static char new[MAXPATHLEN]; - register char *cp1 = name, *cp2 = mapin; - char *tp[9], *te[9]; + const char *cp1 = name; + char *cpn, *cp2 = mapin; + const char *tp[9], *te[9]; int i, toks[9], toknum = 0, match = 1; for (i=0; i < 9; ++i) { @@ -2032,33 +2038,34 @@ { toks[toknum] = 0; } - cp1 = new; - *cp1 = '\0'; + + cpn = new; + *cpn = '\0'; cp2 = mapout; while (*cp2) { match = 0; switch (*cp2) { case '\\': if (*(cp2 + 1)) { - *cp1++ = *++cp2; + *cpn++ = *++cp2; } break; case '[': LOOP: if (*++cp2 == '$' && isdigit(*(cp2+1))) { if (*++cp2 == '0') { - char *cp3 = name; + const char *cp3 = name; while (*cp3) { - *cp1++ = *cp3++; + *cpn++ = *cp3++; } match = 1; } else if (toks[toknum = *cp2 - '1']) { - char *cp3 = tp[toknum]; + const char *cp3 = tp[toknum]; while (cp3 != te[toknum]) { - *cp1++ = *cp3++; + *cpn++ = *cp3++; } match = 1; } @@ -2072,24 +2079,24 @@ else if (*cp2 == '$' && isdigit(*(cp2+1))) { if (*++cp2 == '0') { - char *cp3 = name; + const char *cp3 = name; while (*cp3) { - *cp1++ = *cp3++; + *cpn++ = *cp3++; } } else if (toks[toknum = *cp2 - '1']) { - char *cp3=tp[toknum]; + const char *cp3=tp[toknum]; while (cp3 != te[toknum]) { - *cp1++ = *cp3++; + *cpn++ = *cp3++; } } } else if (*cp2) { - *cp1++ = *cp2++; + *cpn++ = *cp2++; } } if (!*cp2) { @@ -2126,29 +2133,29 @@ case '$': if (isdigit(*(cp2 + 1))) { if (*++cp2 == '0') { - char *cp3 = name; + const char *cp3 = name; while (*cp3) { - *cp1++ = *cp3++; + *cpn++ = *cp3++; } } else if (toks[toknum = *cp2 - '1']) { - char *cp3 = tp[toknum]; + const char *cp3 = tp[toknum]; while (cp3 != te[toknum]) { - *cp1++ = *cp3++; + *cpn++ = *cp3++; } } break; } /* intentional drop through */ default: - *cp1++ = *cp2; + *cpn++ = *cp2; break; } cp2++; } - *cp1 = '\0'; + *cpn = '\0'; if (!*new) { return(name); } @@ -2207,7 +2214,7 @@ void macdef(argc, argv) int argc; - char *argv[]; + const char *argv[]; { char *tmp; int c; @@ -2283,7 +2290,7 @@ * get size of file on remote machine */ void sizecmd(argc, argv) - char *argv[]; + const char *argv[]; { if (argc < 2) { @@ -2308,7 +2315,7 @@ * get last modification time of file on remote machine */ void modtime(argc, argv) - char *argv[]; + const char *argv[]; { int overbose; @@ -2347,7 +2354,7 @@ * show status on reomte machine */ void rmtstatus(argc, argv) - char *argv[]; + const char *argv[]; { (void) command(argc > 1 ? "STAT %s" : "STAT" , argv[1]); } @@ -2356,7 +2363,7 @@ * get file if modtime is more recent than current file */ void newer(argc, argv) - char *argv[]; + const char *argv[]; { if (getit(argc, argv, -1, "w")) { printf("Local file \"%s\" is newer than remote file \"%s\"\n", _____ Modified: trunk/reactos/apps/utils/net/ftp/domacro.c --- trunk/reactos/apps/utils/net/ftp/domacro.c 2005-11-11 11:59:56 UTC (rev 19130) +++ trunk/reactos/apps/utils/net/ftp/domacro.c 2005-11-11 16:11:13 UTC (rev 19131) @@ -30,10 +30,11 @@ void domacro(argc, argv) int argc; - char *argv[]; + const char *argv[]; { - register int i, j; - register char *cp1, *cp2; + int i, j; + const char *cp1; + char *cp2; int count = 2, loopflg = 0; char line2[200]; struct cmd *getcmd(), *c; _____ Modified: trunk/reactos/apps/utils/net/ftp/fake.c --- trunk/reactos/apps/utils/net/ftp/fake.c 2005-11-11 11:59:56 UTC (rev 19130) +++ trunk/reactos/apps/utils/net/ftp/fake.c 2005-11-11 16:11:13 UTC (rev 19131) @@ -113,7 +113,7 @@ #endif -char *fprintfSocket(int s, char *format, ...) +const char *fprintfSocket(int s, const char *format, ...) { va_list argptr; char buffer[10009]; @@ -127,7 +127,7 @@ return NULL; } -char *fputsSocket(char *format, int s) +const char *fputsSocket(const char *format, int s) { send(s, format, strlen(format), 0); _____ Modified: trunk/reactos/apps/utils/net/ftp/ftp.c --- trunk/reactos/apps/utils/net/ftp/ftp.c 2005-11-11 11:59:56 UTC (rev 19130) +++ trunk/reactos/apps/utils/net/ftp/ftp.c 2005-11-11 16:11:13 UTC (rev 19131) @@ -98,9 +98,9 @@ off_t restart_point = 0; SOCKET cin, cout; -int dataconn(char *mode); +int dataconn(const char *mode); -int command(char *fmt, ...); +int command(const char *fmt, ...); char *hostname; @@ -203,19 +203,23 @@ return ((char *)0); } -int login(char *host) +int login(const char *host) { char tmp[80]; - char *user, *pass, *acct; + char *puser, *ppass, *pacct; + const char *user, *pass, *acct; int n, aflag = 0; user = pass = acct = 0; - if (ruserpass(host, &user, &pass, &acct) < 0) { + if (ruserpass(host, &puser, &ppass, &pacct) < 0) { code = -1; return(0); } + user = puser; + pass = ppass; + acct = pacct; while (user == NULL) { - char *myname = "none"; // This needs to become the usename env + const char *myname = "none"; // This needs to become the usename env if (myname) printf("Name (%s:%s): ", host, myname); @@ -273,7 +277,7 @@ } /*VARARGS1*/ -int command(char *fmt, ...) +int command(const char *fmt, ...) { va_list ap; int r; @@ -450,7 +454,7 @@ #define HASHBYTES 1024 -void sendrequest(char *cmd, char *local, char *remote, int printnames) +void sendrequest(const char *cmd, const char *local, const char *remote, int printnames) { FILE *fin; int dout = 0; @@ -461,7 +465,7 @@ register int c, d; struct stat st; struct timeval start, stop; - char *mode; + const char *mode; if (verbose && printnames) { if (local && *local != '-') @@ -723,7 +727,7 @@ } #endif -void recvrequest(char *cmd, char *local, char *remote, char *mode, +void recvrequest(const char *cmd, const char *local, const char *remote, const char *mode, int printnames) { FILE *fout = stdout; @@ -1253,7 +1257,7 @@ return (1); } -int dataconn(char *mode) +int dataconn(const char *mode) { struct sockaddr_in from; int s, fromlen = sizeof (from); @@ -1278,7 +1282,7 @@ } void ptransfer(direction, bytes, t0, t1) - char *direction; + const char *direction; long bytes; struct timeval *t0, *t1; { @@ -1432,12 +1436,12 @@ #endif void proxtrans(cmd, local, remote) - char *cmd, *local, *remote; + const char *cmd, *local, *remote; { // void (*oldintr)(int); int tmptype, oldtype = 0, secndflag = 0, nfnd; extern jmp_buf ptabort; - char *cmd2; + const char *cmd2; // struct fd_set mask; _____ Modified: trunk/reactos/apps/utils/net/ftp/ftp_var.h --- trunk/reactos/apps/utils/net/ftp/ftp_var.h 2005-11-11 11:59:56 UTC (rev 19130) +++ trunk/reactos/apps/utils/net/ftp/ftp_var.h 2005-11-11 16:11:13 UTC (rev 19131) @@ -130,7 +130,7 @@ extern char argbuf[200]; /* argument storage buffer */ extern char *argbase; /* current storage point in arg buffer */ extern int margc; /* count of arguments on input line */ -extern char *margv[20]; /* args parsed from input line */ +extern const char *margv[20]; /* args parsed from input line */ extern int cpend; /* flag: if != 0, then pending server reply */ extern int mflag; /* flag: if != 0, then active multi command */ @@ -140,8 +140,8 @@ * Format of command table. */ struct cmd { - char *c_name; /* name of command */ - char *c_help; /* help string */ + const char *c_name; /* name of command */ + const char *c_help; /* help string */ char c_bell; /* give bell when command completes */ char c_conn; /* must be connected to use command */ char c_proxy; /* proxy server may execute */ _____ Modified: trunk/reactos/apps/utils/net/ftp/main.c --- trunk/reactos/apps/utils/net/ftp/main.c 2005-11-11 11:59:56 UTC (rev 19130) +++ trunk/reactos/apps/utils/net/ftp/main.c 2005-11-11 16:11:13 UTC (rev 19131) @@ -115,18 +115,18 @@ char argbuf[200]; /* argument storage buffer */ char *argbase; /* current storage point in arg buffer */ int margc; /* count of arguments on input line */ -char *margv[20]; /* args parsed from input line */ +const char *margv[20]; /* args parsed from input line */ int cpend; /* flag: if != 0, then pending server reply */ int mflag; /* flag: if != 0, then active multi command */ int options; /* used during socket creation */ -static char *slurpstring(); +static const char *slurpstring(); -int main(int argc, char *argv[]) +int main(int argc, const char *argv[]) { - register char *cp; + const char *cp; int top; #if 0 char homedir[MAXPATHLEN]; @@ -357,12 +357,12 @@ struct cmd * getcmd(name) - register char *name; + const char *name; { extern struct cmd cmdtab[]; - register char *p, *q; - register struct cmd *c, *found; - register int nmatches, longest; + const char *p, *q; + struct cmd *c, *found; + int nmatches, longest; longest = 0; nmatches = 0; @@ -393,7 +393,7 @@ void makeargv() { - char **argp; + const char **argp; margc = 0; argp = margv; @@ -409,7 +409,7 @@ * implemented with FSM to * handle quoting and strings */ -static char * +static const char * slurpstring() { int got_one = 0; _____ Modified: trunk/reactos/apps/utils/net/ftp/prototypes.h --- trunk/reactos/apps/utils/net/ftp/prototypes.h 2005-11-11 11:59:56 UTC (rev 19130) +++ trunk/reactos/apps/utils/net/ftp/prototypes.h 2005-11-11 16:11:13 UTC (rev 19131) @@ -1,8 +1,8 @@ int fgetcSocket(int s); -char *fputsSocket(char *format, int s); +const char *fputsSocket(const char *format, int s); -char *fprintfSocket(int s, char *format, ...); +const char *fprintfSocket(int s, const char *format, ...); int fputcSocket(int s, char putChar); int fputSocket(int s, char *putChar, int len); @@ -13,34 +13,34 @@ int herror(char *s); int getreply(int expecteof); -int ruserpass(char *host, char **aname, char **apass, char **aacct); +int ruserpass(const char *host, char **aname, char **apass, char **aacct); char *getpass(const char *prompt); void makeargv(void); -void domacro(int argc, char *argv[]); -void proxtrans(char *cmd, char *local, char *remote); +void domacro(int argc, const char *argv[]); +void proxtrans(const char *cmd, const char *local, const char *remote); int null(void); int initconn(void); void disconnect(void); -void ptransfer(char *direction, long bytes, struct timeval *t0, struct timeval *t1); +void ptransfer(const char *direction, long bytes, struct timeval *t0, struct timeval *t1); void setascii(void); void setbinary(void); void setebcdic(void); void settenex(void); void tvsub(struct timeval *tdiff, struct timeval *t1, struct timeval *t0); void setpassive(int argc, char *argv[]); -void setpeer(int argc, char *argv[]); +void setpeer(int argc, const char *argv[]); void cmdscanner(int top); void pswitch(int flag); void quit(void); -int login(char *host); -int command(char *fmt, ...); -int globulize(char **cpp); -void sendrequest(char *cmd, char *local, char *remote, int printnames); -void recvrequest(char *cmd, char *local, char *remote, char *mode, +int login(const char *host); +int command(const char *fmt, ...); +int globulize(const char **cpp); +void sendrequest(const char *cmd, const char *local, const char *remote, int printnames); +void recvrequest(const char *cmd, const char *local, const char *remote, const char *mode, int printnames); -int confirm(char *cmd, char *file); +int confirm(const char *cmd, const char *file); void blkfree(char **av0); -int getit(int argc, char *argv[], int restartit, char *mode); +int getit(int argc, const char *argv[], int restartit, const char *mode); int sleep(int time); char *tail(); _____ Modified: trunk/reactos/apps/utils/net/ftp/ruserpass.c --- trunk/reactos/apps/utils/net/ftp/ruserpass.c 2005-11-11 11:59:56 UTC (rev 19130) +++ trunk/reactos/apps/utils/net/ftp/ruserpass.c 2005-11-11 16:11:13 UTC (rev 19131) @@ -50,7 +50,7 @@ static char tokval[100]; static struct toktab { - char *tokstr; + const char *tokstr; int tval; } toktab[]= { {"default", DEFAULT}, @@ -66,10 +66,11 @@ extern char *hostname; static int token(void); -int ruserpass(char *host, char **aname, char **apass, char **aacct) +int ruserpass(const char *host, char **aname, char **apass, char **aacct) { - char *hdir, buf[BUFSIZ], *tmp; - char myname[MAXHOSTNAMELEN], *mydomain; + const char *hdir, *mydomain; + char buf[BUFSIZ], *tmp; + char myname[MAXHOSTNAMELEN]; int t, i, c, usedefault = 0; struct stat stb; extern int errno; _____ Modified: trunk/reactos/apps/utils/net/telnet/src/ansiprsr.cpp --- trunk/reactos/apps/utils/net/telnet/src/ansiprsr.cpp 2005-11-11 11:59:56 UTC (rev 19130) +++ trunk/reactos/apps/utils/net/telnet/src/ansiprsr.cpp 2005-11-11 16:11:13 UTC (rev 19131) @@ -219,7 +219,7 @@ Console.SetCursorPosition(x, y); } -char* TANSIParser::GetTerminalID() +const char* TANSIParser::GetTerminalID() { return "\033[?1;2c"; } @@ -479,7 +479,7 @@ // Get Terminal ID case 'c': { - char* szTerminalId = GetTerminalID(); + const char* szTerminalId = GetTerminalID(); Network.WriteString(szTerminalId, strlen(szTerminalId)); break; } @@ -1005,7 +1005,7 @@ // Terminal ID Request case 'Z': { - char* szTerminalId = GetTerminalID(); + const char* szTerminalId = GetTerminalID(); Network.WriteString(szTerminalId, strlen(szTerminalId)); break; } _____ Modified: trunk/reactos/apps/utils/net/telnet/src/ansiprsr.h --- trunk/reactos/apps/utils/net/telnet/src/ansiprsr.h 2005-11-11 11:59:56 UTC (rev 19130) +++ trunk/reactos/apps/utils/net/telnet/src/ansiprsr.h 2005-11-11 16:11:13 UTC (rev 19131) @@ -40,7 +40,7 @@ #endif void ConSetAttribute(unsigned char wAttr); - char *GetTerminalID(); + const char *GetTerminalID(); void ConSetCursorPos(int x, int y); void ResetTerminal(); void Init(); _____ Modified: trunk/reactos/apps/utils/net/telnet/src/tconsole.cpp --- trunk/reactos/apps/utils/net/telnet/src/tconsole.cpp 2005-11-11 11:59:56 UTC (rev 19130) +++ trunk/reactos/apps/utils/net/telnet/src/tconsole.cpp 2005-11-11 16:11:13 UTC (rev 19131) @@ -60,17 +60,17 @@ GetConsoleScreenBufferInfo(hConsole, &ConsoleInfo); // Start with correct colors - int fg = ini.get_normal_fg(); - int bg = ini.get_normal_bg(); - if(fg == -1) - fg = defaultfg = origfg = ConsoleInfo.wAttributes & 0xF; + int color_fg = ini.get_normal_fg(); + int color_bg = ini.get_normal_bg(); + if(color_fg == -1) + color_fg = defaultfg = origfg = ConsoleInfo.wAttributes & 0xF; else - defaultfg = origfg = fg; - if(bg == -1) - bg = defaultbg = origbg = (ConsoleInfo.wAttributes >> 4) & 0xF; + defaultfg = origfg = color_fg; + if(color_bg == -1) + color_bg = defaultbg = origbg = (ConsoleInfo.wAttributes >> 4) & 0xF; else - defaultbg = origbg = bg; - wAttributes = fg | (bg << 4); + defaultbg = origbg = color_bg; + wAttributes = color_fg | (color_bg << 4); reverse = blink = underline = false; SetConsoleTextAttribute(hConsole, wAttributes); _____ Modified: trunk/reactos/apps/utils/net/telnet/src/tnconfig.cpp --- trunk/reactos/apps/utils/net/telnet/src/tnconfig.cpp 2005-11-11 11:59:56 UTC (rev 19130) +++ trunk/reactos/apps/utils/net/telnet/src/tnconfig.cpp 2005-11-11 16:11:13 UTC (rev 19131) @@ -186,8 +186,8 @@ }; struct ini_variable { - char *name; // variable name - char *section; // name of ini file section the variable is in + const char *name; // variable name + const char *section; // name of ini file section the variable is in enum ini_data_type data_type; // type of data void *ini_data; // pointer to data int max_size; // max size if string _____ Modified: trunk/reactos/apps/utils/net/telnet/src/tnconfig.h --- trunk/reactos/apps/utils/net/telnet/src/tnconfig.h 2005-11-11 11:59:56 UTC (rev 19130) +++ trunk/reactos/apps/utils/net/telnet/src/tnconfig.h 2005-11-11 16:11:13 UTC (rev 19131) @@ -198,7 +198,7 @@ // Host configration char host[128]; - char *port; + const char *port; // Aliases char **aliases; _____ Modified: trunk/reactos/apps/utils/net/telnet/src/tnmain.cpp --- trunk/reactos/apps/utils/net/telnet/src/tnmain.cpp 2005-11-11 11:59:56 UTC (rev 19130) +++ trunk/reactos/apps/utils/net/telnet/src/tnmain.cpp 2005-11-11 16:11:13 UTC (rev 19131) @@ -146,13 +146,13 @@ if (cursor < current) if (InputRecord.Event.KeyEvent.dwControlKeyState & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED)) { - unsigned int i,j; + unsigned int j, k; for (j = cursor; j <= current; j++) if (buf[j+1] == ' ' || (j+1)==current) break; - for (i = ++j; i <= current; i++) - if (buf[i] != ' ' || i == current) { - cursor = i == current ? --i : i; + for (k = ++j; k <= current; k++) + if (buf[k] != ' ' || k == current) { + cursor = k == current ? --k : k; break; [truncated at 1000 lines; 49 more skipped]
19 years, 1 month
1
0
0
0
[weiden] 19130: replace offsetof with FIELD_OFFSET
by weiden@svn.reactos.com
replace offsetof with FIELD_OFFSET Modified: trunk/reactos/lib/advapi32/reg/reg.c _____ Modified: trunk/reactos/lib/advapi32/reg/reg.c --- trunk/reactos/lib/advapi32/reg/reg.c 2005-11-11 08:58:05 UTC (rev 19129) +++ trunk/reactos/lib/advapi32/reg/reg.c 2005-11-11 11:59:56 UTC (rev 19130) @@ -24,9 +24,6 @@ #define REG_MAX_NAME_SIZE 256 #define REG_MAX_DATA_SIZE 2048 -/* FIXME: should go into msvcrt.h header? */ -#define offsetof(s,m) (size_t)&(((s*)NULL)->m) - /* GLOBALS ******************************************************************/ static RTL_CRITICAL_SECTION HandleTableCS; @@ -2240,7 +2237,7 @@ DWORD total_size; char buffer[256], *buf_ptr = buffer; KEY_VALUE_FULL_INFORMATION *info = (KEY_VALUE_FULL_INFORMATION *)buffer; - static const int info_size = offsetof( KEY_VALUE_FULL_INFORMATION, Name ); + static const int info_size = FIELD_OFFSET( KEY_VALUE_FULL_INFORMATION, Name ); //TRACE("(%p,%ld,%p,%p,%p,%p,%p,%p)\n", // hkey, index, value, val_count, reserved, type, data, count ); @@ -2367,7 +2364,7 @@ DWORD total_size; char buffer[256], *buf_ptr = buffer; KEY_VALUE_FULL_INFORMATION *info = (KEY_VALUE_FULL_INFORMATION *)buffer; - static const int info_size = offsetof( KEY_VALUE_FULL_INFORMATION, Name ); + static const int info_size = FIELD_OFFSET( KEY_VALUE_FULL_INFORMATION, Name ); //TRACE("(%p,%ld,%p,%p,%p,%p,%p,%p)\n", // hkey, index, value, val_count, reserved, type, data, count );
19 years, 1 month
1
0
0
0
[sedwards] 19129: msvc fixes
by sedwards@svn.reactos.com
msvc fixes Modified: trunk/reactos/apps/utils/net/finger/err.c Modified: trunk/reactos/apps/utils/net/finger/finger.c Modified: trunk/reactos/apps/utils/net/finger/net.c _____ Modified: trunk/reactos/apps/utils/net/finger/err.c --- trunk/reactos/apps/utils/net/finger/err.c 2005-11-11 01:05:23 UTC (rev 19128) +++ trunk/reactos/apps/utils/net/finger/err.c 2005-11-11 08:58:05 UTC (rev 19129) @@ -50,21 +50,10 @@ extern char *__progname; /* Program name, from crt0. */ void -#ifdef __STDC__ err(int eval, const char *fmt, ...) -#else -err(eval, fmt, va_alist) - int eval; - const char *fmt; - va_dcl -#endif { va_list ap; -#if __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif verr(eval, fmt, ap); va_end(ap); } @@ -85,21 +74,10 @@ } void -#if __STDC__ errx(int eval, const char *fmt, ...) -#else -errx(eval, fmt, va_alist) - int eval; - const char *fmt; - va_dcl -#endif { va_list ap; -#if __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif verrx(eval, fmt, ap); va_end(ap); } @@ -115,20 +93,10 @@ } void -#if __STDC__ warn(const char *fmt, ...) -#else -warn(fmt, va_alist) - const char *fmt; - va_dcl -#endif { va_list ap; -#if __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif vwarn(fmt, ap); va_end(ap); } @@ -150,20 +118,10 @@ } void -#ifdef __STDC__ warnx(const char *fmt, ...) -#else -warnx(fmt, va_alist) - const char *fmt; - va_dcl -#endif { va_list ap; -#ifdef __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif vwarnx(fmt, ap); va_end(ap); } _____ Modified: trunk/reactos/apps/utils/net/finger/finger.c --- trunk/reactos/apps/utils/net/finger/finger.c 2005-11-11 01:05:23 UTC (rev 19128) +++ trunk/reactos/apps/utils/net/finger/finger.c 2005-11-11 08:58:05 UTC (rev 19129) @@ -62,7 +62,6 @@ #include <stdlib.h> #include <string.h> #include <time.h> -#include "unistd.h" #include "various.h" #include "getopt.h" _____ Modified: trunk/reactos/apps/utils/net/finger/net.c --- trunk/reactos/apps/utils/net/finger/net.c 2005-11-11 01:05:23 UTC (rev 19128) +++ trunk/reactos/apps/utils/net/finger/net.c 2005-11-11 08:58:05 UTC (rev 19129) @@ -35,13 +35,15 @@ */ #include <sys/types.h> #include <winsock2.h> -#include "unistd.h" + #include <stdio.h> #include <ctype.h> #include <string.h> #include "various.h" +int close(int); + void netfinger(char *name) {
19 years, 1 month
1
0
0
0
[cwittich] 19128: list services with EnumServicesStatusEx instead of reading them from registry
by cwittich@svn.reactos.com
list services with EnumServicesStatusEx instead of reading them from registry Modified: trunk/reactos/subsys/system/msconfig/De.rc Modified: trunk/reactos/subsys/system/msconfig/En.rc Modified: trunk/reactos/subsys/system/msconfig/resource.h Modified: trunk/reactos/subsys/system/msconfig/srvpage.c _____ Modified: trunk/reactos/subsys/system/msconfig/De.rc --- trunk/reactos/subsys/system/msconfig/De.rc 2005-11-10 23:02:14 UTC (rev 19127) +++ trunk/reactos/subsys/system/msconfig/De.rc 2005-11-11 01:05:23 UTC (rev 19128) @@ -50,6 +50,7 @@ STRINGTABLE DISCARDABLE BEGIN IDS_SERVICES_COLUMN_SERVICE "Dienst" + IDS_SERVICES_COLUMN_REQ "Erforderlich" IDS_SERVICES_COLUMN_VENDOR "Hersteller" IDS_SERVICES_COLUMN_STATUS "Status" END @@ -81,3 +82,12 @@ IDS_STARTUP_COLUMN_CMD "Befehl" IDS_STARTUP_COLUMN_PATH "Pfad" END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICES_STATUS_RUNNING "Gestartet" + IDS_SERVICES_STATUS_STOPPED "Beendet" + IDS_YES "Ja" + IDS_NO "Nein" +END + _____ Modified: trunk/reactos/subsys/system/msconfig/En.rc --- trunk/reactos/subsys/system/msconfig/En.rc 2005-11-10 23:02:14 UTC (rev 19127) +++ trunk/reactos/subsys/system/msconfig/En.rc 2005-11-11 01:05:23 UTC (rev 19128) @@ -50,6 +50,7 @@ STRINGTABLE DISCARDABLE BEGIN IDS_SERVICES_COLUMN_SERVICE "Service" + IDS_SERVICES_COLUMN_REQ "Required" IDS_SERVICES_COLUMN_VENDOR "Vendor" IDS_SERVICES_COLUMN_STATUS "Status" END @@ -80,3 +81,11 @@ IDS_STARTUP_COLUMN_CMD "Command" IDS_STARTUP_COLUMN_PATH "Path" END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICES_STATUS_RUNNING "Running" + IDS_SERVICES_STATUS_STOPPED "Stopped" + IDS_YES "Yes" + IDS_NO "No" +END _____ Modified: trunk/reactos/subsys/system/msconfig/resource.h --- trunk/reactos/subsys/system/msconfig/resource.h 2005-11-10 23:02:14 UTC (rev 19127) +++ trunk/reactos/subsys/system/msconfig/resource.h 2005-11-11 01:05:23 UTC (rev 19128) @@ -23,11 +23,12 @@ #define IDS_TOOLS_COLUMN_NAME 2010 #define IDS_TOOLS_COLUMN_DESCR 2011 #define IDS_SERVICES_COLUMN_SERVICE 2012 -#define IDS_SERVICES_COLUMN_VENDOR 2013 -#define IDS_SERVICES_COLUMN_STATUS 2014 -#define IDS_STARTUP_COLUMN_ELEMENT 2015 -#define IDS_STARTUP_COLUMN_CMD 2016 -#define IDS_STARTUP_COLUMN_PATH 2017 +#define IDS_SERVICES_COLUMN_REQ 2013 +#define IDS_SERVICES_COLUMN_VENDOR 2014 +#define IDS_SERVICES_COLUMN_STATUS 2015 +#define IDS_STARTUP_COLUMN_ELEMENT 2016 +#define IDS_STARTUP_COLUMN_CMD 2017 +#define IDS_STARTUP_COLUMN_PATH 2018 #define IDS_TOOLS_CMD_NAME 2100 #define IDS_TOOLS_CMD_DESCR 2101 @@ -49,4 +50,8 @@ #define IDS_TOOLS_SYSDM_CMD 2114 #define IDS_TOOLS_SYSDM_PARAM 2115 +#define IDS_SERVICES_STATUS_STOPPED 2200 +#define IDS_SERVICES_STATUS_RUNNING 2201 +#define IDS_YES 2202 +#define IDS_NO 2203 /* EOF */ _____ Modified: trunk/reactos/subsys/system/msconfig/srvpage.c --- trunk/reactos/subsys/system/msconfig/srvpage.c 2005-11-10 23:02:14 UTC (rev 19127) +++ trunk/reactos/subsys/system/msconfig/srvpage.c 2005-11-11 01:05:23 UTC (rev 19128) @@ -34,16 +34,22 @@ ListView_InsertColumn(hServicesListCtrl, 0, &column); column.mask = LVCF_TEXT | LVCF_WIDTH; + LoadString(hInst, IDS_SERVICES_COLUMN_REQ, szTemp, 256); + column.pszText = szTemp; + column.cx = 70; + ListView_InsertColumn(hServicesListCtrl, 1, &column); + + column.mask = LVCF_TEXT | LVCF_WIDTH; LoadString(hInst, IDS_SERVICES_COLUMN_VENDOR, szTemp, 256); column.pszText = szTemp; column.cx = 200; - ListView_InsertColumn(hServicesListCtrl, 1, &column); + ListView_InsertColumn(hServicesListCtrl, 2, &column); column.mask = LVCF_TEXT | LVCF_WIDTH; LoadString(hInst, IDS_SERVICES_COLUMN_STATUS, szTemp, 256); column.pszText = szTemp; column.cx = 70; - ListView_InsertColumn(hServicesListCtrl, 2, &column); + ListView_InsertColumn(hServicesListCtrl, 3, &column); GetServices(); return TRUE; @@ -55,50 +61,79 @@ void GetServices ( void ) { - HKEY hKey, hSubKey; - DWORD dwSubKeys, dwKeyLength; - DWORD dwType, dwDataLength; + LV_ITEM item; + SC_HANDLE ScHandle; + DWORD BufSize = 0; + DWORD BytesNeeded = 0; + DWORD ResumeHandle = 0; + DWORD NumServices = 0; size_t Index; - TCHAR lpKeyName[MAX_KEY_LENGTH]; - TCHAR lpSubKey[MAX_KEY_LENGTH]; - TCHAR DisplayName[MAX_VALUE_NAME]; - TCHAR ObjectName[MAX_VALUE_NAME]; - TCHAR lpServicesKey[MAX_KEY_LENGTH] = _T("SYSTEM\\CurrentControlSet\\Services"); - LV_ITEM item; + TCHAR szStatus[128]; - if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, lpServicesKey, 0, KEY_READ, &hKey) == ERROR_SUCCESS) + ENUM_SERVICE_STATUS_PROCESS *pServiceStatus = NULL; + + ScHandle = OpenSCManager(NULL, NULL, SC_MANAGER_ENUMERATE_SERVICE); + if (ScHandle != INVALID_HANDLE_VALUE) { - if (RegQueryInfoKey(hKey, NULL, NULL, NULL, &dwSubKeys, NULL, NULL, NULL, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) + if (EnumServicesStatusEx(ScHandle, SC_ENUM_PROCESS_INFO, SERVICE_WIN32, SERVICE_STATE_ALL, (LPBYTE)pServiceStatus, BufSize, &BytesNeeded, &NumServices, &ResumeHandle, 0) == 0) { - for (Index = 0; Index < dwSubKeys; Index++) - { - dwKeyLength = MAX_KEY_LENGTH; - if (RegEnumKeyEx(hKey, Index, lpKeyName, &dwKeyLength, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) + /* Call function again if required size was returned */ + if (GetLastError() == ERROR_MORE_DATA) + { + /* reserve memory for service info array */ + pServiceStatus = (ENUM_SERVICE_STATUS_PROCESS *) HeapAlloc(GetProcessHeap(), 0, BytesNeeded); + if (pServiceStatus == NULL) + return; + + /* fill array with service info */ + if (EnumServicesStatusEx(ScHandle, SC_ENUM_PROCESS_INFO, SERVICE_WIN32, SERVICE_STATE_ALL, (LPBYTE)pServiceStatus, BytesNeeded, &BytesNeeded, &NumServices, &ResumeHandle, 0) == 0) { - _tcscpy(lpSubKey, lpServicesKey); - _tcscat(lpSubKey, _T("\\")); - _tcscat(lpSubKey, lpKeyName); - if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, lpSubKey, 0, KEY_READ, &hSubKey) == ERROR_SUCCESS) + HeapFree(GetProcessHeap(), 0, pServiceStatus); + return; + } + } + else /* exit on failure */ + { + return; + } + } + + if (NumServices) + { + for (Index = 0; Index < NumServices; Index++) + { + memset(&item, 0, sizeof(LV_ITEM)); + item.mask = LVIF_TEXT; + item.iImage = 0; + item.pszText = pServiceStatus[Index].lpDisplayName; + item.iItem = ListView_GetItemCount(hServicesListCtrl); + item.lParam = 0; + item.iItem = ListView_InsertItem(hServicesListCtrl, &item); + + /* FIXME + if (QueryServiceConfig2(ScHandle, SERVICE_CONFIG_FAILURE_ACTIONS, ) == 0) + { + if (GetLastError() == ERROR_MORE_DATA) { - dwDataLength = MAX_VALUE_NAME; - if (RegQueryValueEx(hSubKey, _T("ObjectName"), NULL, &dwType, (LPBYTE)ObjectName, &dwDataLength) == ERROR_SUCCESS) - { - dwDataLength = MAX_VALUE_NAME; - if (RegQueryValueEx(hSubKey, _T("DisplayName"), NULL, &dwType, (LPBYTE)DisplayName, &dwDataLength) == ERROR_SUCCESS) - { - memset(&item, 0, sizeof(LV_ITEM)); - item.mask = LVIF_TEXT; - item.iImage = 0; - item.pszText = DisplayName; - item.iItem = ListView_GetItemCount(hServicesListCtrl); - item.lParam = 0; - ListView_InsertItem(hServicesListCtrl, &item); - } - } + } } + LoadString(hInst, ( CONDITION ? IDS_YES : IDS_NO), szStatus, 128); + item.pszText = szStatus; + item.iSubItem = 1; + SendMessage(hServicesListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + */ + + LoadString(hInst, ((pServiceStatus[Index].ServiceStatusProcess.dwCurrentState == SERVICE_STOPPED) ? IDS_SERVICES_STATUS_STOPPED : IDS_SERVICES_STATUS_RUNNING), szStatus, 128); + item.pszText = szStatus; + item.iSubItem = 3; + SendMessage(hServicesListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + } } - RegCloseKey(hKey); - } + + CloseServiceHandle(ScHandle); + } + + }
19 years, 1 month
1
0
0
0
[cwittich] 19127: set eol-style:native
by cwittich@svn.reactos.com
set eol-style:native Modified: trunk/reactos/subsys/system/msconfig/startuppage.c Modified: trunk/reactos/subsys/system/msconfig/startuppage.h _____ Modified: trunk/reactos/subsys/system/msconfig/startuppage.c --- trunk/reactos/subsys/system/msconfig/startuppage.c 2005-11-10 22:46:41 UTC (rev 19126) +++ trunk/reactos/subsys/system/msconfig/startuppage.c 2005-11-10 23:02:14 UTC (rev 19127) @@ -1,112 +1,112 @@ -#include <precomp.h> - -HWND hStartupPage; -HWND hStartupListCtrl; -HWND hStartupDialog; - -void GetAutostartEntriesFromRegistry ( HKEY hRootKey, TCHAR* KeyName ); - -INT_PTR CALLBACK -StartupPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) -{ - LV_COLUMN column; - TCHAR szTemp[256]; - DWORD dwStyle; - - switch (message) { - case WM_INITDIALOG: - - hStartupListCtrl = GetDlgItem(hDlg, IDC_STARTUP_LIST); - hStartupDialog = hDlg; - - dwStyle = SendMessage(hStartupListCtrl, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0); - dwStyle = dwStyle | LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES; - SendMessage(hStartupListCtrl, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle); - - SetWindowPos(hDlg, NULL, 10, 32, 0, 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER); - - // Initialize the application page's controls - column.mask = LVCF_TEXT | LVCF_WIDTH; - - LoadString(hInst, IDS_STARTUP_COLUMN_ELEMENT, szTemp, 256); - column.pszText = szTemp; - column.cx = 150; - ListView_InsertColumn(hStartupListCtrl, 0, &column); - - column.mask = LVCF_TEXT | LVCF_WIDTH; - LoadString(hInst, IDS_STARTUP_COLUMN_CMD, szTemp, 256); - column.pszText = szTemp; - column.cx = 150; - ListView_InsertColumn(hStartupListCtrl, 1, &column); - - column.mask = LVCF_TEXT | LVCF_WIDTH; - LoadString(hInst, IDS_STARTUP_COLUMN_PATH, szTemp, 256); - column.pszText = szTemp; - column.cx = 250; - ListView_InsertColumn(hStartupListCtrl, 2, &column); - - GetAutostartEntriesFromRegistry(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run")); - GetAutostartEntriesFromRegistry(HKEY_CURRENT_USER, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run")); - //FIXME: What about HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit - //FIXME: Common Startup (startmenu) - - return TRUE; - } - - return 0; -} - -void -GetAutostartEntriesFromRegistry ( HKEY hRootKey, TCHAR* KeyName ) -{ - HKEY hKey; - DWORD Index, dwValues, retVal, dwType; - DWORD dwValueLength, dwDataLength = MAX_VALUE_NAME; - TCHAR Data[MAX_VALUE_NAME]; - TCHAR lpValueName[MAX_KEY_LENGTH]; - TCHAR Path[MAX_KEY_LENGTH + 5]; - LV_ITEM item; - - if (RegOpenKeyEx(hRootKey, KeyName, 0, KEY_READ, &hKey) == ERROR_SUCCESS) - { - if (RegQueryInfoKey(hKey, NULL, NULL, NULL, NULL, NULL, NULL, &dwValues, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) - { - for (Index = 0, retVal = ERROR_SUCCESS; Index < dwValues; Index++) - { - dwValueLength = MAX_VALUE_NAME; - dwDataLength = MAX_VALUE_NAME; - retVal = RegEnumValue(hKey, Index, lpValueName, &dwValueLength, NULL, &dwType, (LPBYTE)Data, &dwDataLength); - if (retVal == ERROR_SUCCESS) - { - memset(&item, 0, sizeof(LV_ITEM)); - item.mask = LVIF_TEXT; - item.iImage = 0; - item.pszText = lpValueName; - item.iItem = ListView_GetItemCount(hStartupListCtrl); - item.lParam = 0; - ListView_InsertItem(hStartupListCtrl, &item); - - if (dwType == REG_SZ) - { - GetLongPathName(Data, Data, sizeof(Data)); - item.pszText = Data; - item.iSubItem = 1; - SendMessage(hStartupListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); - } - - if (hRootKey == HKEY_LOCAL_MACHINE) - _tcscpy(Path, _T("HKLM\\")); - if (hRootKey == HKEY_CURRENT_USER) - _tcscpy(Path, _T("HKCU\\")); - - _tcscat(Path, KeyName); - item.pszText = Path; - item.iSubItem = 2; - SendMessage(hStartupListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); - } - } - } - RegCloseKey(hKey); - } - -} +#include <precomp.h> + +HWND hStartupPage; +HWND hStartupListCtrl; +HWND hStartupDialog; + +void GetAutostartEntriesFromRegistry ( HKEY hRootKey, TCHAR* KeyName ); + +INT_PTR CALLBACK +StartupPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + LV_COLUMN column; + TCHAR szTemp[256]; + DWORD dwStyle; + + switch (message) { + case WM_INITDIALOG: + + hStartupListCtrl = GetDlgItem(hDlg, IDC_STARTUP_LIST); + hStartupDialog = hDlg; + + dwStyle = SendMessage(hStartupListCtrl, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0); + dwStyle = dwStyle | LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES; + SendMessage(hStartupListCtrl, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle); + + SetWindowPos(hDlg, NULL, 10, 32, 0, 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER); + + // Initialize the application page's controls + column.mask = LVCF_TEXT | LVCF_WIDTH; + + LoadString(hInst, IDS_STARTUP_COLUMN_ELEMENT, szTemp, 256); + column.pszText = szTemp; + column.cx = 150; + ListView_InsertColumn(hStartupListCtrl, 0, &column); + + column.mask = LVCF_TEXT | LVCF_WIDTH; + LoadString(hInst, IDS_STARTUP_COLUMN_CMD, szTemp, 256); + column.pszText = szTemp; + column.cx = 150; + ListView_InsertColumn(hStartupListCtrl, 1, &column); + + column.mask = LVCF_TEXT | LVCF_WIDTH; + LoadString(hInst, IDS_STARTUP_COLUMN_PATH, szTemp, 256); + column.pszText = szTemp; + column.cx = 250; + ListView_InsertColumn(hStartupListCtrl, 2, &column); + + GetAutostartEntriesFromRegistry(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run")); + GetAutostartEntriesFromRegistry(HKEY_CURRENT_USER, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run")); + //FIXME: What about HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit + //FIXME: Common Startup (startmenu) + + return TRUE; + } + + return 0; +} + +void +GetAutostartEntriesFromRegistry ( HKEY hRootKey, TCHAR* KeyName ) +{ + HKEY hKey; + DWORD Index, dwValues, retVal, dwType; + DWORD dwValueLength, dwDataLength = MAX_VALUE_NAME; + TCHAR Data[MAX_VALUE_NAME]; + TCHAR lpValueName[MAX_KEY_LENGTH]; + TCHAR Path[MAX_KEY_LENGTH + 5]; + LV_ITEM item; + + if (RegOpenKeyEx(hRootKey, KeyName, 0, KEY_READ, &hKey) == ERROR_SUCCESS) + { + if (RegQueryInfoKey(hKey, NULL, NULL, NULL, NULL, NULL, NULL, &dwValues, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) + { + for (Index = 0, retVal = ERROR_SUCCESS; Index < dwValues; Index++) + { + dwValueLength = MAX_VALUE_NAME; + dwDataLength = MAX_VALUE_NAME; + retVal = RegEnumValue(hKey, Index, lpValueName, &dwValueLength, NULL, &dwType, (LPBYTE)Data, &dwDataLength); + if (retVal == ERROR_SUCCESS) + { + memset(&item, 0, sizeof(LV_ITEM)); + item.mask = LVIF_TEXT; + item.iImage = 0; + item.pszText = lpValueName; + item.iItem = ListView_GetItemCount(hStartupListCtrl); + item.lParam = 0; + ListView_InsertItem(hStartupListCtrl, &item); + + if (dwType == REG_SZ) + { + GetLongPathName(Data, Data, sizeof(Data)); + item.pszText = Data; + item.iSubItem = 1; + SendMessage(hStartupListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + } + + if (hRootKey == HKEY_LOCAL_MACHINE) + _tcscpy(Path, _T("HKLM\\")); + if (hRootKey == HKEY_CURRENT_USER) + _tcscpy(Path, _T("HKCU\\")); + + _tcscat(Path, KeyName); + item.pszText = Path; + item.iSubItem = 2; + SendMessage(hStartupListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + } + } + } + RegCloseKey(hKey); + } + +} Property changes on: trunk/reactos/subsys/system/msconfig/startuppage.c ___________________________________________________________________ Name: svn:eol-style + native _____ Modified: trunk/reactos/subsys/system/msconfig/startuppage.h --- trunk/reactos/subsys/system/msconfig/startuppage.h 2005-11-10 22:46:41 UTC (rev 19126) +++ trunk/reactos/subsys/system/msconfig/startuppage.h 2005-11-10 23:02:14 UTC (rev 19127) @@ -1,4 +1,4 @@ -extern HWND hStartupPage; -extern HWND hStartupPageListCtrl; - -INT_PTR CALLBACK StartupPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +extern HWND hStartupPage; +extern HWND hStartupPageListCtrl; + +INT_PTR CALLBACK StartupPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); Property changes on: trunk/reactos/subsys/system/msconfig/startuppage.h ___________________________________________________________________ Name: svn:eol-style + native
19 years, 1 month
1
0
0
0
[cwittich] 19126: list services
by cwittich@svn.reactos.com
list services Modified: trunk/reactos/subsys/system/msconfig/De.rc Modified: trunk/reactos/subsys/system/msconfig/En.rc Modified: trunk/reactos/subsys/system/msconfig/msconfig.c Modified: trunk/reactos/subsys/system/msconfig/resource.h Modified: trunk/reactos/subsys/system/msconfig/srvpage.c _____ Modified: trunk/reactos/subsys/system/msconfig/De.rc --- trunk/reactos/subsys/system/msconfig/De.rc 2005-11-10 21:29:00 UTC (rev 19125) +++ trunk/reactos/subsys/system/msconfig/De.rc 2005-11-10 22:46:41 UTC (rev 19126) @@ -34,12 +34,13 @@ STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "Tahoma" BEGIN - CONTROL "List1",IDC_SERVICES_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 2, 1, 360, 168 + CONTROL "List1",IDC_SERVICES_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP, 2, 1, 360, 168 END STRINGTABLE DISCARDABLE BEGIN IDS_TAB_GENERAL "Allgemein" + IDS_TAB_SYSTEM "SYSTEM.INI" IDS_TAB_FREELDR "FREELDR.INI" IDS_TAB_SERVICES "Dienste" IDS_TAB_STARTUP "Systemstart" _____ Modified: trunk/reactos/subsys/system/msconfig/En.rc --- trunk/reactos/subsys/system/msconfig/En.rc 2005-11-10 21:29:00 UTC (rev 19125) +++ trunk/reactos/subsys/system/msconfig/En.rc 2005-11-10 22:46:41 UTC (rev 19126) @@ -34,12 +34,13 @@ STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "Tahoma" BEGIN - CONTROL "List1",IDC_SERVICES_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 2, 1, 360, 168 + CONTROL "List1",IDC_SERVICES_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP, 2, 1, 360, 168 END STRINGTABLE DISCARDABLE BEGIN IDS_TAB_GENERAL "General" + IDS_TAB_SYSTEM "SYSTEM.INI" IDS_TAB_FREELDR "FREELDR.INI" IDS_TAB_SERVICES "Services" IDS_TAB_STARTUP "Startup" _____ Modified: trunk/reactos/subsys/system/msconfig/msconfig.c --- trunk/reactos/subsys/system/msconfig/msconfig.c 2005-11-10 21:29:00 UTC (rev 19125) +++ trunk/reactos/subsys/system/msconfig/msconfig.c 2005-11-10 22:46:41 UTC (rev 19126) @@ -23,30 +23,36 @@ item.pszText = szTemp; TabCtrl_InsertItem(hTabWnd, 0, &item); - LoadString(hInst, IDS_TAB_FREELDR, szTemp, 256); + LoadString(hInst, IDS_TAB_SYSTEM, szTemp, 256); memset(&item, 0, sizeof(TCITEM)); item.mask = TCIF_TEXT; item.pszText = szTemp; TabCtrl_InsertItem(hTabWnd, 1, &item); - LoadString(hInst, IDS_TAB_SERVICES, szTemp, 256); + LoadString(hInst, IDS_TAB_FREELDR, szTemp, 256); memset(&item, 0, sizeof(TCITEM)); item.mask = TCIF_TEXT; item.pszText = szTemp; TabCtrl_InsertItem(hTabWnd, 2, &item); - LoadString(hInst, IDS_TAB_STARTUP, szTemp, 256); + LoadString(hInst, IDS_TAB_SERVICES, szTemp, 256); memset(&item, 0, sizeof(TCITEM)); item.mask = TCIF_TEXT; item.pszText = szTemp; TabCtrl_InsertItem(hTabWnd, 3, &item); - LoadString(hInst, IDS_TAB_TOOLS, szTemp, 256); + LoadString(hInst, IDS_TAB_STARTUP, szTemp, 256); memset(&item, 0, sizeof(TCITEM)); item.mask = TCIF_TEXT; item.pszText = szTemp; TabCtrl_InsertItem(hTabWnd, 4, &item); + LoadString(hInst, IDS_TAB_TOOLS, szTemp, 256); + memset(&item, 0, sizeof(TCITEM)); + item.mask = TCIF_TEXT; + item.pszText = szTemp; + TabCtrl_InsertItem(hTabWnd, 5, &item); + return TRUE; } @@ -61,28 +67,35 @@ ShowWindow(hServicesPage, SW_HIDE); //BringWindowToTop(hFreeLdrPage); break; - case 1: //Freeldr + case 1: //SYSTEM.INI ShowWindow(hToolsPage, SW_HIDE); ShowWindow(hStartupPage, SW_HIDE); //ShowWindow(hFreeLdrPage, SW_SHOW); ShowWindow(hServicesPage, SW_HIDE); //BringWindowToTop(hFreeLdrPage); break; - case 2: //Services + case 2: //Freeldr ShowWindow(hToolsPage, SW_HIDE); ShowWindow(hStartupPage, SW_HIDE); + //ShowWindow(hFreeLdrPage, SW_SHOW); + ShowWindow(hServicesPage, SW_HIDE); + //BringWindowToTop(hFreeLdrPage); + break; + case 3: //Services + ShowWindow(hToolsPage, SW_HIDE); + ShowWindow(hStartupPage, SW_HIDE); //ShowWindow(hFreeLdrPage, SW_HIDE); ShowWindow(hServicesPage, SW_SHOW); - //BringWindowToTop(hFreeLdrPage); + BringWindowToTop(hServicesPage); break; - case 3: //startup + case 4: //startup ShowWindow(hToolsPage, SW_HIDE); ShowWindow(hStartupPage, SW_SHOW); //ShowWindow(hFreeLdrPage, SW_HIDE); ShowWindow(hServicesPage, SW_HIDE); BringWindowToTop(hStartupPage); break; - case 4: //Tools + case 5: //Tools ShowWindow(hToolsPage, SW_SHOW); ShowWindow(hStartupPage, SW_HIDE); //ShowWindow(hFreeLdrPage, SW_HIDE); _____ Modified: trunk/reactos/subsys/system/msconfig/resource.h --- trunk/reactos/subsys/system/msconfig/resource.h 2005-11-10 21:29:00 UTC (rev 19125) +++ trunk/reactos/subsys/system/msconfig/resource.h 2005-11-10 22:46:41 UTC (rev 19126) @@ -14,19 +14,20 @@ #define IDC_STARTUP_LIST 1008 #define IDS_TAB_TOOLS 2001 -#define IDS_TAB_FREELDR 2002 -#define IDS_TAB_STARTUP 2003 -#define IDS_TAB_SERVICES 2004 -#define IDS_TAB_GENERAL 2005 +#define IDS_TAB_SYSTEM 2002 +#define IDS_TAB_FREELDR 2003 +#define IDS_TAB_STARTUP 2004 +#define IDS_TAB_SERVICES 2005 +#define IDS_TAB_GENERAL 2006 #define IDS_TOOLS_COLUMN_NAME 2010 #define IDS_TOOLS_COLUMN_DESCR 2011 #define IDS_SERVICES_COLUMN_SERVICE 2012 #define IDS_SERVICES_COLUMN_VENDOR 2013 #define IDS_SERVICES_COLUMN_STATUS 2014 -#define IDS_STARTUP_COLUMN_ELEMENT 2015 -#define IDS_STARTUP_COLUMN_CMD 2016 -#define IDS_STARTUP_COLUMN_PATH 2017 +#define IDS_STARTUP_COLUMN_ELEMENT 2015 +#define IDS_STARTUP_COLUMN_CMD 2016 +#define IDS_STARTUP_COLUMN_PATH 2017 #define IDS_TOOLS_CMD_NAME 2100 #define IDS_TOOLS_CMD_DESCR 2101 _____ Modified: trunk/reactos/subsys/system/msconfig/srvpage.c --- trunk/reactos/subsys/system/msconfig/srvpage.c 2005-11-10 21:29:00 UTC (rev 19125) +++ trunk/reactos/subsys/system/msconfig/srvpage.c 2005-11-10 22:46:41 UTC (rev 19126) @@ -4,6 +4,8 @@ HWND hServicesListCtrl; HWND hServicesDialog; +void GetServices ( void ); + INT_PTR CALLBACK ServicesPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { @@ -28,7 +30,7 @@ LoadString(hInst, IDS_SERVICES_COLUMN_SERVICE, szTemp, 256); column.pszText = szTemp; - column.cx = 150; + column.cx = 200; ListView_InsertColumn(hServicesListCtrl, 0, &column); column.mask = LVCF_TEXT | LVCF_WIDTH; @@ -43,8 +45,60 @@ column.cx = 70; ListView_InsertColumn(hServicesListCtrl, 2, &column); + GetServices(); return TRUE; } return 0; } + +void +GetServices ( void ) +{ + HKEY hKey, hSubKey; + DWORD dwSubKeys, dwKeyLength; + DWORD dwType, dwDataLength; + size_t Index; + TCHAR lpKeyName[MAX_KEY_LENGTH]; + TCHAR lpSubKey[MAX_KEY_LENGTH]; + TCHAR DisplayName[MAX_VALUE_NAME]; + TCHAR ObjectName[MAX_VALUE_NAME]; + TCHAR lpServicesKey[MAX_KEY_LENGTH] = _T("SYSTEM\\CurrentControlSet\\Services"); + LV_ITEM item; + + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, lpServicesKey, 0, KEY_READ, &hKey) == ERROR_SUCCESS) + { + if (RegQueryInfoKey(hKey, NULL, NULL, NULL, &dwSubKeys, NULL, NULL, NULL, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) + { + for (Index = 0; Index < dwSubKeys; Index++) + { + dwKeyLength = MAX_KEY_LENGTH; + if (RegEnumKeyEx(hKey, Index, lpKeyName, &dwKeyLength, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) + { + _tcscpy(lpSubKey, lpServicesKey); + _tcscat(lpSubKey, _T("\\")); + _tcscat(lpSubKey, lpKeyName); + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, lpSubKey, 0, KEY_READ, &hSubKey) == ERROR_SUCCESS) + { + dwDataLength = MAX_VALUE_NAME; + if (RegQueryValueEx(hSubKey, _T("ObjectName"), NULL, &dwType, (LPBYTE)ObjectName, &dwDataLength) == ERROR_SUCCESS) + { + dwDataLength = MAX_VALUE_NAME; + if (RegQueryValueEx(hSubKey, _T("DisplayName"), NULL, &dwType, (LPBYTE)DisplayName, &dwDataLength) == ERROR_SUCCESS) + { + memset(&item, 0, sizeof(LV_ITEM)); + item.mask = LVIF_TEXT; + item.iImage = 0; + item.pszText = DisplayName; + item.iItem = ListView_GetItemCount(hServicesListCtrl); + item.lParam = 0; + ListView_InsertItem(hServicesListCtrl, &item); + } + } + } + } + } + } + RegCloseKey(hKey); + } +}
19 years, 1 month
1
0
0
0
[gedmurphy] 19125: Display a media disconnected notice if the adapter is not connected.
by gedmurphy@svn.reactos.com
Display a media disconnected notice if the adapter is not connected. Modified: trunk/reactos/apps/utils/net/ipconfig/ipconfig.c _____ Modified: trunk/reactos/apps/utils/net/ipconfig/ipconfig.c --- trunk/reactos/apps/utils/net/ipconfig/ipconfig.c 2005-11-10 20:56:49 UTC (rev 19124) +++ trunk/reactos/apps/utils/net/ipconfig/ipconfig.c 2005-11-10 21:29:00 UTC (rev 19125) @@ -13,7 +13,6 @@ */ /* * TODO: - * display multiple adapters * fix renew / release * implement flushdns, registerdns, displaydns, showclassid, setclassid * allow globbing on adapter names @@ -138,7 +137,7 @@ _tprintf(_T("\nReactOS IP Configuration\n\n")); - do + while (pAdapter) { if (bAll) { @@ -157,6 +156,15 @@ } _tprintf(_T("\n%s ...... : \n\n"), GetInterfaceTypeName(pAdapter->Type)); + + /* check if the adapter is connected to the media */ + if (_tcscmp(pAdapter->IpAddressList.IpAddress.String, "0.0.0.0") == 0) + { + _tprintf(_T("\tMedia State . . . . . . . . . . . : Media disconnected\n")); + pAdapter = pAdapter->Next; + continue; + } + _tprintf(_T("\tConnection-specific DNS Suffix. . : %s\n"), pFixedInfo->DomainName); if (bAll) @@ -202,7 +210,7 @@ pAdapter = pAdapter->Next; - } while (pAdapter); + } return 0; }
19 years, 1 month
1
0
0
0
[cwittich] 19124: started implementing startup page
by cwittich@svn.reactos.com
started implementing startup page Modified: trunk/reactos/subsys/system/msconfig/De.rc Modified: trunk/reactos/subsys/system/msconfig/En.rc Modified: trunk/reactos/subsys/system/msconfig/msconfig.c Modified: trunk/reactos/subsys/system/msconfig/msconfig.xml Modified: trunk/reactos/subsys/system/msconfig/precomp.h Modified: trunk/reactos/subsys/system/msconfig/resource.h Modified: trunk/reactos/subsys/system/msconfig/srvpage.c Added: trunk/reactos/subsys/system/msconfig/startuppage.c Added: trunk/reactos/subsys/system/msconfig/startuppage.h _____ Modified: trunk/reactos/subsys/system/msconfig/De.rc --- trunk/reactos/subsys/system/msconfig/De.rc 2005-11-10 20:33:10 UTC (rev 19123) +++ trunk/reactos/subsys/system/msconfig/De.rc 2005-11-10 20:56:49 UTC (rev 19124) @@ -23,6 +23,13 @@ PUSHBUTTON "&Ausf³hren", IDC_BTN_RUN, 311, 155, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP END +IDD_STARTUP_PAGE DIALOG DISCARDABLE 0, 0, 362, 175 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "Tahoma" +BEGIN + CONTROL "List3",IDC_STARTUP_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 2, 1, 360, 168 +END + IDD_SERVICES_PAGE DIALOG DISCARDABLE 0, 0, 362, 175 STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "Tahoma" @@ -68,4 +75,8 @@ IDS_TOOLS_SYSDM_DESCR "Zeigt Informationen ³ber diesen Rechner an." IDS_TOOLS_SYSDM_CMD "control" IDS_TOOLS_SYSDM_PARAM "sysdm.cpl" + + IDS_STARTUP_COLUMN_ELEMENT "Element" + IDS_STARTUP_COLUMN_CMD "Befehl" + IDS_STARTUP_COLUMN_PATH "Pfad" END _____ Modified: trunk/reactos/subsys/system/msconfig/En.rc --- trunk/reactos/subsys/system/msconfig/En.rc 2005-11-10 20:33:10 UTC (rev 19123) +++ trunk/reactos/subsys/system/msconfig/En.rc 2005-11-10 20:56:49 UTC (rev 19124) @@ -14,6 +14,13 @@ PUSHBUTTON "Apply", IDC_BTN_APPLY, 323, 201, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP END +IDD_STARTUP_PAGE DIALOG DISCARDABLE 0, 0, 362, 175 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "Tahoma" +BEGIN + CONTROL "List3",IDC_STARTUP_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 2, 1, 360, 168 +END + IDD_TOOLS_PAGE DIALOG DISCARDABLE 0, 0, 362, 175 STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "Tahoma" @@ -67,4 +74,8 @@ IDS_TOOLS_SYSDM_DESCR "Shows information about this computer." IDS_TOOLS_SYSDM_CMD "control" IDS_TOOLS_SYSDM_PARAM "sysdm.cpl" + + IDS_STARTUP_COLUMN_ELEMENT "Element" + IDS_STARTUP_COLUMN_CMD "Command" + IDS_STARTUP_COLUMN_PATH "Path" END _____ Modified: trunk/reactos/subsys/system/msconfig/msconfig.c --- trunk/reactos/subsys/system/msconfig/msconfig.c 2005-11-10 20:33:10 UTC (rev 19123) +++ trunk/reactos/subsys/system/msconfig/msconfig.c 2005-11-10 20:56:49 UTC (rev 19124) @@ -14,6 +14,7 @@ hTabWnd = GetDlgItem(hWnd, IDC_TAB); hToolsPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_TOOLS_PAGE), hWnd, ToolsPageWndProc); hServicesPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_SERVICES_PAGE), hWnd, ServicesPageWndProc); + hStartupPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_STARTUP_PAGE), hWnd, StartupPageWndProc); // Insert Tab Pages LoadString(hInst, IDS_TAB_GENERAL, szTemp, 256); @@ -53,32 +54,37 @@ void MsConfig_OnTabWndSelChange(void) { switch (TabCtrl_GetCurSel(hTabWnd)) { - case 0: + case 0: //General ShowWindow(hToolsPage, SW_HIDE); - //ShowWindow(hFreeLdrPage, SW_SHOW); + ShowWindow(hStartupPage, SW_HIDE); + //ShowWindow(hFreeLdrPage, SW_HIDE); ShowWindow(hServicesPage, SW_HIDE); //BringWindowToTop(hFreeLdrPage); break; - case 1: + case 1: //Freeldr ShowWindow(hToolsPage, SW_HIDE); + ShowWindow(hStartupPage, SW_HIDE); //ShowWindow(hFreeLdrPage, SW_SHOW); ShowWindow(hServicesPage, SW_HIDE); //BringWindowToTop(hFreeLdrPage); break; - case 2: + case 2: //Services ShowWindow(hToolsPage, SW_HIDE); + ShowWindow(hStartupPage, SW_HIDE); //ShowWindow(hFreeLdrPage, SW_HIDE); ShowWindow(hServicesPage, SW_SHOW); //BringWindowToTop(hFreeLdrPage); break; - case 3: + case 3: //startup ShowWindow(hToolsPage, SW_HIDE); + ShowWindow(hStartupPage, SW_SHOW); //ShowWindow(hFreeLdrPage, SW_HIDE); ShowWindow(hServicesPage, SW_HIDE); - //BringWindowToTop(hFreeLdrPage); + BringWindowToTop(hStartupPage); break; - case 4: + case 4: //Tools ShowWindow(hToolsPage, SW_SHOW); + ShowWindow(hStartupPage, SW_HIDE); //ShowWindow(hFreeLdrPage, SW_HIDE); ShowWindow(hServicesPage, SW_HIDE); BringWindowToTop(hToolsPage); @@ -125,6 +131,7 @@ case WM_DESTROY: DestroyWindow(hToolsPage); DestroyWindow(hServicesPage); + DestroyWindow(hStartupPage); return DefWindowProc(hDlg, message, wParam, lParam); } _____ Modified: trunk/reactos/subsys/system/msconfig/msconfig.xml --- trunk/reactos/subsys/system/msconfig/msconfig.xml 2005-11-10 20:33:10 UTC (rev 19123) +++ trunk/reactos/subsys/system/msconfig/msconfig.xml 2005-11-10 20:56:49 UTC (rev 19124) @@ -12,6 +12,7 @@ <library>shell32</library> <file>toolspage.c</file> <file>srvpage.c</file> + <file>startuppage.c</file> <file>msconfig.c</file> <file>msconfig.rc</file> </module> _____ Modified: trunk/reactos/subsys/system/msconfig/precomp.h --- trunk/reactos/subsys/system/msconfig/precomp.h 2005-11-10 20:33:10 UTC (rev 19123) +++ trunk/reactos/subsys/system/msconfig/precomp.h 2005-11-10 20:56:49 UTC (rev 19124) @@ -8,4 +8,9 @@ #include "msconfig.h" #include "toolspage.h" #include "srvpage.h" +#include "startuppage.h" +#define MAX_KEY_LENGTH 255 +#define MAX_VALUE_NAME 16383 + + _____ Modified: trunk/reactos/subsys/system/msconfig/resource.h --- trunk/reactos/subsys/system/msconfig/resource.h 2005-11-10 20:33:10 UTC (rev 19123) +++ trunk/reactos/subsys/system/msconfig/resource.h 2005-11-10 20:56:49 UTC (rev 19124) @@ -11,6 +11,7 @@ #define IDC_BTN_RUN 1005 #define IDC_SERVICES_LIST 1006 #define IDC_TOOLS_LIST 1007 +#define IDC_STARTUP_LIST 1008 #define IDS_TAB_TOOLS 2001 #define IDS_TAB_FREELDR 2002 @@ -23,6 +24,9 @@ #define IDS_SERVICES_COLUMN_SERVICE 2012 #define IDS_SERVICES_COLUMN_VENDOR 2013 #define IDS_SERVICES_COLUMN_STATUS 2014 +#define IDS_STARTUP_COLUMN_ELEMENT 2015 +#define IDS_STARTUP_COLUMN_CMD 2016 +#define IDS_STARTUP_COLUMN_PATH 2017 #define IDS_TOOLS_CMD_NAME 2100 #define IDS_TOOLS_CMD_DESCR 2101 _____ Modified: trunk/reactos/subsys/system/msconfig/srvpage.c --- trunk/reactos/subsys/system/msconfig/srvpage.c 2005-11-10 20:33:10 UTC (rev 19123) +++ trunk/reactos/subsys/system/msconfig/srvpage.c 2005-11-10 20:56:49 UTC (rev 19124) @@ -14,7 +14,7 @@ switch (message) { case WM_INITDIALOG: - hServicesListCtrl = GetDlgItem(hDlg, IDC_TOOLS_LIST); + hServicesListCtrl = GetDlgItem(hDlg, IDC_SERVICES_LIST); hServicesDialog = hDlg; dwStyle = SendMessage(hServicesListCtrl, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0); @@ -41,7 +41,7 @@ LoadString(hInst, IDS_SERVICES_COLUMN_STATUS, szTemp, 256); column.pszText = szTemp; column.cx = 70; - ListView_InsertColumn(hServicesListCtrl, 1, &column); + ListView_InsertColumn(hServicesListCtrl, 2, &column); return TRUE; } _____ Added: trunk/reactos/subsys/system/msconfig/startuppage.c --- trunk/reactos/subsys/system/msconfig/startuppage.c 2005-11-10 20:33:10 UTC (rev 19123) +++ trunk/reactos/subsys/system/msconfig/startuppage.c 2005-11-10 20:56:49 UTC (rev 19124) @@ -0,0 +1,112 @@ +#include <precomp.h> + +HWND hStartupPage; +HWND hStartupListCtrl; +HWND hStartupDialog; + +void GetAutostartEntriesFromRegistry ( HKEY hRootKey, TCHAR* KeyName ); + +INT_PTR CALLBACK +StartupPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + LV_COLUMN column; + TCHAR szTemp[256]; + DWORD dwStyle; + + switch (message) { + case WM_INITDIALOG: + + hStartupListCtrl = GetDlgItem(hDlg, IDC_STARTUP_LIST); + hStartupDialog = hDlg; + + dwStyle = SendMessage(hStartupListCtrl, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0); + dwStyle = dwStyle | LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES; + SendMessage(hStartupListCtrl, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle); + + SetWindowPos(hDlg, NULL, 10, 32, 0, 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER); + + // Initialize the application page's controls + column.mask = LVCF_TEXT | LVCF_WIDTH; + + LoadString(hInst, IDS_STARTUP_COLUMN_ELEMENT, szTemp, 256); + column.pszText = szTemp; + column.cx = 150; + ListView_InsertColumn(hStartupListCtrl, 0, &column); + + column.mask = LVCF_TEXT | LVCF_WIDTH; + LoadString(hInst, IDS_STARTUP_COLUMN_CMD, szTemp, 256); + column.pszText = szTemp; + column.cx = 150; + ListView_InsertColumn(hStartupListCtrl, 1, &column); + + column.mask = LVCF_TEXT | LVCF_WIDTH; + LoadString(hInst, IDS_STARTUP_COLUMN_PATH, szTemp, 256); + column.pszText = szTemp; + column.cx = 250; + ListView_InsertColumn(hStartupListCtrl, 2, &column); + + GetAutostartEntriesFromRegistry(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run")); + GetAutostartEntriesFromRegistry(HKEY_CURRENT_USER, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run")); + //FIXME: What about HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit + //FIXME: Common Startup (startmenu) + + return TRUE; + } + + return 0; +} + +void +GetAutostartEntriesFromRegistry ( HKEY hRootKey, TCHAR* KeyName ) +{ + HKEY hKey; + DWORD Index, dwValues, retVal, dwType; + DWORD dwValueLength, dwDataLength = MAX_VALUE_NAME; + TCHAR Data[MAX_VALUE_NAME]; + TCHAR lpValueName[MAX_KEY_LENGTH]; + TCHAR Path[MAX_KEY_LENGTH + 5]; + LV_ITEM item; + + if (RegOpenKeyEx(hRootKey, KeyName, 0, KEY_READ, &hKey) == ERROR_SUCCESS) + { + if (RegQueryInfoKey(hKey, NULL, NULL, NULL, NULL, NULL, NULL, &dwValues, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) + { + for (Index = 0, retVal = ERROR_SUCCESS; Index < dwValues; Index++) + { + dwValueLength = MAX_VALUE_NAME; + dwDataLength = MAX_VALUE_NAME; + retVal = RegEnumValue(hKey, Index, lpValueName, &dwValueLength, NULL, &dwType, (LPBYTE)Data, &dwDataLength); + if (retVal == ERROR_SUCCESS) + { + memset(&item, 0, sizeof(LV_ITEM)); + item.mask = LVIF_TEXT; + item.iImage = 0; + item.pszText = lpValueName; + item.iItem = ListView_GetItemCount(hStartupListCtrl); + item.lParam = 0; + ListView_InsertItem(hStartupListCtrl, &item); + + if (dwType == REG_SZ) + { + GetLongPathName(Data, Data, sizeof(Data)); + item.pszText = Data; + item.iSubItem = 1; + SendMessage(hStartupListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + } + + if (hRootKey == HKEY_LOCAL_MACHINE) + _tcscpy(Path, _T("HKLM\\")); + if (hRootKey == HKEY_CURRENT_USER) + _tcscpy(Path, _T("HKCU\\")); + + _tcscat(Path, KeyName); + item.pszText = Path; + item.iSubItem = 2; + SendMessage(hStartupListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + } + } + } + RegCloseKey(hKey); + } + +} _____ Added: trunk/reactos/subsys/system/msconfig/startuppage.h --- trunk/reactos/subsys/system/msconfig/startuppage.h 2005-11-10 20:33:10 UTC (rev 19123) +++ trunk/reactos/subsys/system/msconfig/startuppage.h 2005-11-10 20:56:49 UTC (rev 19124) @@ -0,0 +1,4 @@ +extern HWND hStartupPage; +extern HWND hStartupPageListCtrl; + +INT_PTR CALLBACK StartupPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
19 years, 1 month
1
0
0
0
[chorns] 19123: Build win32k_test
by chorns@svn.reactos.com
Build win32k_test Modified: trunk/reactos/subsys/win32k/tests/stubs.xml _____ Modified: trunk/reactos/subsys/win32k/tests/stubs.xml --- trunk/reactos/subsys/win32k/tests/stubs.xml 2005-11-10 17:43:55 UTC (rev 19122) +++ trunk/reactos/subsys/win32k/tests/stubs.xml 2005-11-10 20:33:10 UTC (rev 19123) @@ -60,6 +60,7 @@ <symbol>ExFreePool@4</symbol> <symbol>ExAllocatePoolWithTag@12</symbol> <symbol>IoBuildDeviceIoControlRequest@36</symbol> + <symbol>IoBuildSynchronousFsdRequest@28</symbol> <symbol>@IofCallDriver@8</symbol> <symbol>KeWaitForSingleObject@20</symbol> <symbol>@ExAcquireFastMutex@4</symbol>
19 years, 1 month
1
0
0
0
← Newer
1
...
64
65
66
67
68
69
70
...
88
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
Results per page:
10
25
50
100
200