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
September 2007
----- 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
19 participants
589 discussions
Start a n
N
ew thread
[fireball] 29240: Samuel Erdtman <samuel@erdtman.se> - Implement 'replace' command in cmd. - TODO: Update all translations with the new text strings for replace command.
by fireball@svn.reactos.org
Author: fireball Date: Thu Sep 27 12:35:08 2007 New Revision: 29240 URL:
http://svn.reactos.org/svn/reactos?rev=29240&view=rev
Log: Samuel Erdtman <samuel(a)erdtman.se> - Implement 'replace' command in cmd. - TODO: Update all translations with the new text strings for replace command. Added: trunk/reactos/base/shell/cmd/replace.c (with props) Modified: trunk/reactos/base/shell/cmd/cmd.h trunk/reactos/base/shell/cmd/cmd.rbuild trunk/reactos/base/shell/cmd/cmdtable.c trunk/reactos/base/shell/cmd/config.h trunk/reactos/base/shell/cmd/files.txt trunk/reactos/base/shell/cmd/lang/en-US.rc trunk/reactos/base/shell/cmd/resource.h Modified: trunk/reactos/base/shell/cmd/cmd.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.h?rev=2…
============================================================================== --- trunk/reactos/base/shell/cmd/cmd.h (original) +++ trunk/reactos/base/shell/cmd/cmd.h Thu Sep 27 12:35:08 2007 @@ -347,6 +347,8 @@ /* Prototypes for REN.C */ INT cmd_rename (LPTSTR, LPTSTR); +/* Prototypes for REN.C */ +INT cmd_replace (LPTSTR, LPTSTR); /* Prototypes for SCREEN.C */ INT CommandScreen (LPTSTR, LPTSTR); Modified: trunk/reactos/base/shell/cmd/cmd.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.rbuild?…
============================================================================== --- trunk/reactos/base/shell/cmd/cmd.rbuild (original) +++ trunk/reactos/base/shell/cmd/cmd.rbuild Thu Sep 27 12:35:08 2007 @@ -52,6 +52,7 @@ <file>prompt.c</file> <file>redir.c</file> <file>ren.c</file> + <file>replace.c</file> <file>screen.c</file> <file>set.c</file> <file>shift.c</file> @@ -82,4 +83,4 @@ <file>cmd.rc</file> <file>main.c</file> </module> -</group> +</group> Modified: trunk/reactos/base/shell/cmd/cmdtable.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmdtable.c?…
============================================================================== --- trunk/reactos/base/shell/cmd/cmdtable.c (original) +++ trunk/reactos/base/shell/cmd/cmdtable.c Thu Sep 27 12:35:08 2007 @@ -174,6 +174,10 @@ #ifdef INCLUDE_CMD_RENAME {_T("ren"), 0, cmd_rename}, {_T("rename"), 0, cmd_rename}, +#endif + +#ifdef INCLUDE_CMD_REPLACE + {_T("replace"), 0, cmd_replace}, #endif #ifdef INCLUDE_CMD_RMDIR Modified: trunk/reactos/base/shell/cmd/config.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/config.h?re…
============================================================================== --- trunk/reactos/base/shell/cmd/config.h (original) +++ trunk/reactos/base/shell/cmd/config.h Thu Sep 27 12:35:08 2007 @@ -79,6 +79,7 @@ #define INCLUDE_CMD_PROMPT #define INCLUDE_CMD_RMDIR #define INCLUDE_CMD_RENAME +#define INCLUDE_CMD_REPLACE #define INCLUDE_CMD_SCREEN #define INCLUDE_CMD_SET #define INCLUDE_CMD_START Modified: trunk/reactos/base/shell/cmd/files.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/files.txt?r…
============================================================================== --- trunk/reactos/base/shell/cmd/files.txt (original) +++ trunk/reactos/base/shell/cmd/files.txt Thu Sep 27 12:35:08 2007 @@ -47,6 +47,7 @@ prompt.c Prompt handling functions redir.c Redirection and piping parsing functions ren.c Implements rename command +replace.c Implements replace command set.c Implements set command shift.c Implements shift command time.c Implements time command Modified: trunk/reactos/base/shell/cmd/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/en-US.…
============================================================================== --- trunk/reactos/base/shell/cmd/lang/en-US.rc (original) +++ trunk/reactos/base/shell/cmd/lang/en-US.rc Thu Sep 27 12:35:08 2007 @@ -389,6 +389,46 @@ STRING_REN_HELP2, " %lu file renamed\n" STRING_REN_HELP3, " %lu files renamed\n" + +STRING_REPLACE_HELP1, "Replaces files.\n\n\ +REPLACE [drive1:][path1]filename [drive2:][path2] [/A] [/P] [/R] [/W]\n\ +REPLACE [drive1:][path1]filename [drive2:][path2] [/P] [/R] [/S] [/W] [/U]\n\n\ + [drive1:][path1]filename Specifies the source file or files.\n\ + [drive2:][path2] Specifies the directory where files are to be\n\ + replaced.\n\ + /A Adds new files to destination directory. Cannot\n\ + use with /S or /U switches.\n\ + /P Prompts for confirmation before replacing a file or\n\ + adding a source file.\n\ + /R Replaces read-only files as well as unprotected\n\ + files.\n\ + /S Replaces files in all subdirectories of the\n\ + destination directory. Cannot use with the /A\n\ + switch.\n\ + /W Waits for you to insert a disk before beginning.\n\ + /U Replaces (updates) only files that are older than\n\ + source files. Cannot use with the /A switch.\n" + +STRING_REPLACE_HELP2, "Source path required\n" + +STRING_REPLACE_HELP3, "No files replaced\n" + +STRING_REPLACE_HELP4, "%lu file(s) replaced\n" + +STRING_REPLACE_HELP5, "Replacing %s\n" + +STRING_REPLACE_HELP6, "Replace %s\n" + +STRING_REPLACE_HELP7, "No files added\n" + +STRING_REPLACE_HELP8, "%lu file(s) added\n" + +STRING_REPLACE_HELP9, "Add %s (Y/N) " + +STRING_REPLACE_HELP10, "Replace %s (Y/N) " + +STRING_REPLACE_HELP11, "Adding %s\n" + STRING_SHIFT_HELP, "Changes the position of replaceable parameters in a batch file.\n\n\ SHIFT [DOWN]" @@ -548,6 +588,7 @@ REM Records comments (remarks) in batch files.\n\ REN Renames a file or files.\n\ RENAME Renames a file or files.\n\ +REPLACE Replaces files.\n\ RMDIR Removes a directory.\n\ SCREEN Move cursor and optionally print text.\n\ SET Displays, sets, or removes ReactOS environment variables.\n\ @@ -636,6 +677,14 @@ STRING_PATH_ERROR, "CMD: Not in environment '%s'\n" +STRING_REPLACE_ERROR1, "Invalid switch - %s\n" +STRING_REPLACE_ERROR2, "Path not found - %s\n" +STRING_REPLACE_ERROR3, "The filename, directory name, or volume label syntax is incorrect.\n" +STRING_REPLACE_ERROR4, "Invalid parameter combination\n" +STRING_REPLACE_ERROR5, "Access denied - %s\n" +STRING_REPLACE_ERROR6, "No files found - %s\n" +STRING_REPLACE_ERROR7, "Extended Error 32\n" + STRING_CMD_SHELLINFO, "\nReactOS Command Line Interpreter" STRING_VERSION_RUNVER, " running on %s" STRING_COPY_FILE , " %d file(s) copied\n" Added: trunk/reactos/base/shell/cmd/replace.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/replace.c?r…
============================================================================== --- trunk/reactos/base/shell/cmd/replace.c (added) +++ trunk/reactos/base/shell/cmd/replace.c Thu Sep 27 12:35:08 2007 @@ -1,0 +1,576 @@ +/* + * PROJECT: ReactOS Command shell + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/shell/cmd/replace.c + * PURPOSE: Implements 'replace' cmd command + * PROGRAMMERS: Samuel Erdtman (samuel(a)erdtman.se) + */ + +/* INCLUDES ******************************************************************/ + +#include <precomp.h> + +#ifdef INCLUDE_CMD_REPLACE + +/* GLOBALS *******************************************************************/ + +enum +{ + REPLACE_ADD = 0x001, /* /A */ + REPLACE_CONFIRM = 0x002, /* /P */ + REPLACE_READ_ONLY = 0x004, /* /R */ + REPLACE_SUBDIR = 0x008, /* /S */ + REPLACE_DISK = 0x010, /* /W */ + REPLACE_UPDATE = 0x020, /* /U */ +}; + +/* FUNCTIONS *****************************************************************/ + +/*just makes a print out if there is a problem with the switches*/ +void invalid_switch(LPTSTR is) +{ + TCHAR szMsg[RC_STRING_MAX_SIZE]; + + LoadString(CMD_ModuleHandle, STRING_REPLACE_ERROR1, szMsg, RC_STRING_MAX_SIZE); + ConOutPrintf(szMsg,is); + ConOutResPaging(TRUE,STRING_REPLACE_HELP3); +} + +/*retrives the pathe dependen om the input file name*/ +void getPath(TCHAR* out, LPTSTR in) +{ + if(_tcslen(in) == 2 && in[1] == _T(':')) + GetRootPath(in,out,MAX_PATH); + else + GetFullPathName (in, MAX_PATH, out, NULL); +} + + +/*makes the replace*/ +INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *doMore) +{ + TCHAR szMsg[RC_STRING_MAX_SIZE]; + TCHAR d[MAX_PATH]; + TCHAR s[MAX_PATH]; + HANDLE hFileSrc, hFileDest; + DWORD dwAttrib, dwRead, dwWritten; + LPBYTE buffer; + BOOL bEof = FALSE; + FILETIME srcCreationTime, destCreationTime, srcLastAccessTime, destLastAccessTime; + FILETIME srcLastWriteTime, destLastWriteTime; + GetPathCase(source, s); + GetPathCase(dest, d); + s[0] = _totupper(s[0]); + d[0] = _totupper(d[0]); +// ConOutPrintf(_T("old-src: %s\n"), s); +// ConOutPrintf(_T("old-dest: %s\n"), d); +// ConOutPrintf(_T("src: %s\n"), source); +// ConOutPrintf(_T("dest: %s\n"), dest); + + /* Open up the sourcefile */ + hFileSrc = CreateFile (source, GENERIC_READ, FILE_SHARE_READ,NULL, OPEN_EXISTING, 0, NULL); + if (hFileSrc == INVALID_HANDLE_VALUE) + { + LoadString(CMD_ModuleHandle, STRING_COPY_ERROR1, szMsg, RC_STRING_MAX_SIZE); + ConOutPrintf(szMsg, source); + return 0; + } + + /* Get the time from source file to be used in the comparison with + dest time if update switch is set */ + GetFileTime (hFileSrc, &srcCreationTime, &srcLastAccessTime, &srcLastWriteTime); + + /* Retrieve the source attributes so that they later on can be + inserted in to the destination */ + dwAttrib = GetFileAttributes (source); + + if(IsExistingFile (dest)) + { + /* Resets the attributes to avoid probles with read only files, + checks for read only has been made earlier */ + SetFileAttributes(dest,FILE_ATTRIBUTE_NORMAL); + /* Is the update flas set? The time has to be controled so that + only older files are replaced */ + if(dwFlags & REPLACE_UPDATE) + { + /* Read destination time */ + hFileDest = CreateFile(dest, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, + 0, NULL); + + if (hFileSrc == INVALID_HANDLE_VALUE) + { + LoadString(CMD_ModuleHandle, STRING_COPY_ERROR1, szMsg, RC_STRING_MAX_SIZE); + ConOutPrintf(szMsg, dest); + return 0; + } + + /* Compare time */ + GetFileTime (hFileDest, &destCreationTime, &destLastAccessTime, &destLastWriteTime); + if(!((srcLastWriteTime.dwHighDateTime > destLastWriteTime.dwHighDateTime) || + ( srcLastWriteTime.dwHighDateTime == destLastWriteTime.dwHighDateTime && + srcLastWriteTime.dwLowDateTime > destLastWriteTime.dwLowDateTime))) + { + CloseHandle (hFileSrc); + CloseHandle (hFileDest); + return 0; + } + CloseHandle (hFileDest); + } + /* Delete the old file */ + DeleteFile (dest); + } + + /* Check confirm flag, and take appropriate action */ + if(dwFlags & REPLACE_CONFIRM) + { + /* Output depending on add flag */ + if(dwFlags & REPLACE_ADD) + LoadString(CMD_ModuleHandle, STRING_REPLACE_HELP9, szMsg, RC_STRING_MAX_SIZE); + else + LoadString(CMD_ModuleHandle, STRING_REPLACE_HELP10, szMsg, RC_STRING_MAX_SIZE); + ConOutPrintf(szMsg, dest); + if( !FilePromptYNA (_T(""))) + return 0; + } + + /* Output depending on add flag */ + if(dwFlags & REPLACE_ADD) + LoadString(CMD_ModuleHandle, STRING_REPLACE_HELP11, szMsg, RC_STRING_MAX_SIZE); + else + LoadString(CMD_ModuleHandle, STRING_REPLACE_HELP5, szMsg, RC_STRING_MAX_SIZE); + ConOutPrintf(szMsg,dest); + + /* Make sure source and destination is not the same */ + if(!_tcscmp(s, d)) + { + ConOutResPaging(TRUE, STRING_REPLACE_ERROR7); + CloseHandle (hFileSrc); + *doMore = FALSE; + return 0; + } + + /* Open destination file to write to */ + hFileDest = CreateFile (dest, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); + if (hFileDest == INVALID_HANDLE_VALUE) + { + CloseHandle (hFileSrc); + ConOutResPaging(TRUE, STRING_REPLACE_ERROR7); + *doMore = FALSE; + return 0; + } + + /* Get buffer for the copy process */ + buffer = (LPBYTE)VirtualAlloc(NULL, BUFF_SIZE, MEM_COMMIT, PAGE_READWRITE); + if (buffer == NULL) + { + CloseHandle (hFileDest); + CloseHandle (hFileSrc); + ConOutResPaging(TRUE, STRING_ERROR_OUT_OF_MEMORY); + return 0; + } + + /* Put attribute and time to the new destination file */ + SetFileAttributes (dest, dwAttrib); + SetFileTime (hFileDest, &srcCreationTime, &srcLastAccessTime, &srcLastWriteTime); + do + { + /* Read data from source */ + ReadFile (hFileSrc, buffer, BUFF_SIZE, &dwRead, NULL); + + /* Done? */ + if (dwRead == 0) + break; + + /* Write to destination file */ + WriteFile (hFileDest, buffer, dwRead, &dwWritten, NULL); + + /* Done! or ctrl break! */ + if (dwWritten != dwRead || CheckCtrlBreak(BREAK_INPUT)) + { + ConOutResPuts(STRING_COPY_ERROR3); + cmd_free (buffer); + CloseHandle (hFileDest); + CloseHandle (hFileSrc); + nErrorLevel = 1; + return 0; + } + } + while (!bEof); + + /* Return memory and close files */ + VirtualFree (buffer, 0, MEM_RELEASE); + CloseHandle (hFileDest); + CloseHandle (hFileSrc); + + /* Return one file replaced */ + return 1; +} + + +/* Function to iterate over source files and call replace for each of them */ +INT recReplace(DWORD dwFlags, TCHAR szSrcPath[MAX_PATH], TCHAR szDestPath[MAX_PATH], BOOL *doMore) +{ + TCHAR szMsg[RC_STRING_MAX_SIZE], tmpDestPath[MAX_PATH], tmpSrcPath[MAX_PATH]; + INT filesReplaced=0, i; + DWORD dwAttrib = 0; + HANDLE hFile; + WIN32_FIND_DATA findBuffer; + + /* Get file handel to the sourcefile(s) */ + hFile = FindFirstFile (szSrcPath, &findBuffer); + + /* Strip the paths back to the folder they are in, so that the diffrent + filenames can be added if more than one */ + for(i = (_tcslen(szSrcPath) - 1); i > -1; i--) + if(szSrcPath[i] != _T('\\')) + szSrcPath[i] = _T('\0'); + else + break; + + /* Go through all the soursfiles and copy/replace them */ + do + { + if(CheckCtrlBreak(BREAK_INPUT)) + { + return filesReplaced; + } + + /* Problem with file handler */ + if(hFile == INVALID_HANDLE_VALUE) + return filesReplaced; + + /* We do not want to replace any .. . ocr directory */ + if(!_tcscmp (findBuffer.cFileName, _T(".")) || + !_tcscmp (findBuffer.cFileName, _T(".."))|| + findBuffer.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + continue; + + /* Add filename to destpath */ + _tcscpy(tmpDestPath,szDestPath); + _tcscat (tmpDestPath, findBuffer.cFileName); + + dwAttrib = GetFileAttributes(tmpDestPath); + /* Check add flag */ + if(dwFlags & REPLACE_ADD) + { + if(IsExistingFile(tmpDestPath)) + continue; + else + dwAttrib = 0; + } + else + { + if(!IsExistingFile(tmpDestPath)) + continue; + } + + /* Check if file is read only, if so check if that should be ignored */ + if(dwAttrib & FILE_ATTRIBUTE_READONLY) + { + if(!(dwFlags & REPLACE_READ_ONLY)) + { + LoadString(CMD_ModuleHandle, STRING_REPLACE_ERROR5, szMsg, RC_STRING_MAX_SIZE); + ConOutPrintf(szMsg, tmpDestPath); + *doMore = FALSE; + break; + } + } + + /* Add filename to sourcepath, insted of wildcards */ + _tcscpy(tmpSrcPath,szSrcPath); + _tcscat (tmpSrcPath, findBuffer.cFileName); + + /* Make the replace */ + if(replace(tmpSrcPath,tmpDestPath, dwFlags, doMore)) + { + filesReplaced++; + } + else if (!*doMore) + { + /* The file to be replaced was the same as the source */ + filesReplaced = -1; + break; + } + + /* Take next sourcefile if any */ + }while(FindNextFile (hFile, &findBuffer)); + + return filesReplaced; +} + +/* If /s switch is specifyed all subdirs has to be considered */ +INT recFindSubDirs(DWORD dwFlags, + TCHAR szSrcPath[MAX_PATH], + TCHAR szDestPath[MAX_PATH], + BOOL *doMore) +{ + HANDLE hFile; + WIN32_FIND_DATA findBuffer; + TCHAR tmpDestPath[MAX_PATH], tmpSrcPath[MAX_PATH]; + INT filesReplaced = 0, i; + + /* Add a wildcard to dest end so the it will be easy to itterate + over all the files and directorys in the dest directory */ + _tcscat(szDestPath, _T("*")); + + /* Get the first file in the directory */ + hFile = FindFirstFile (szDestPath, &findBuffer); + + /* Remove the star added earlyer to dest path */ + for(i = (_tcslen(szDestPath) - 1); i > -1; i--) + if(szDestPath[i] != _T('\\')) + szDestPath[i] = _T('\0'); + else + break; + + /* Iterate over all filed directories in the dest dir */ + do + { + /* Save the source path so that it will not be wrecked */ + _tcscpy(tmpSrcPath,szSrcPath); + /* Check for reading problems */ + if(hFile == INVALID_HANDLE_VALUE) + { + ConOutFormatMessage (GetLastError(), tmpSrcPath); + return filesReplaced; + } + + /* Check if the we should enter the dir or if it is a file + or . or .. if so thake the next object to process */ + if(!_tcscmp (findBuffer.cFileName, _T(".")) || + !_tcscmp (findBuffer.cFileName, _T(".."))|| + IsExistingFile(findBuffer.cFileName)) + continue; + /* Add the destpath and the new dir path to tempDestPath */ + _tcscpy(tmpDestPath,szDestPath); + _tcscat (tmpDestPath, findBuffer.cFileName); + /* Make sure that we have a directory */ + if(IsExistingDirectory(tmpDestPath)) + { + /* Add a \ to the end or the path */ + if(szDestPath[_tcslen(tmpDestPath) - 1] != _T('\\')) + _tcscat(tmpDestPath, _T("\\")); + /* Call the function to replace files in the new directory */ + filesReplaced += recReplace(dwFlags, tmpSrcPath, tmpDestPath, doMore); + /* If there were problems break e.g. read-only file */ + if(!*doMore) + break; + _tcscpy(tmpSrcPath,szSrcPath); + /* Controle the next level of subdirs */ + filesReplaced += recFindSubDirs(dwFlags,tmpSrcPath,tmpDestPath, doMore); + if(!*doMore) + break; + } + /* Get the next handle */ + } while(FindNextFile (hFile, &findBuffer)); + + return filesReplaced; +} + +INT cmd_replace (LPTSTR cmd, LPTSTR param) +{ + TCHAR szMsg[RC_STRING_MAX_SIZE]; + LPTSTR *arg; + INT argc, i,filesReplaced = 0, nFiles, srcIndex = -1, destIndex = -1; + DWORD dwFlags = 0; + TCHAR szDestPath[MAX_PATH], szSrcPath[MAX_PATH], tmpSrcPath[MAX_PATH]; + BOOL doMore = TRUE; + + /* Help wanted? */ + if (!_tcsncmp (param, _T("/?"), 2)) + { + ConOutResPaging(TRUE,STRING_REPLACE_HELP1); + return 0; + } + + /* Divide the argument in to an array of c-strings */ + arg = split (param, &argc, FALSE); + nFiles = argc; + + /* Read options */ + for (i = 0; i < argc; i++) + { + if (arg[i][0] == _T('/')) + { + if (_tcslen(arg[i]) == 2) + { + switch (_totupper(arg[i][1])) + { + case _T('A'): + dwFlags |= REPLACE_ADD; + break; + case _T('P'): + dwFlags |= REPLACE_CONFIRM; + break; + case _T('R'): + dwFlags |= REPLACE_READ_ONLY; + break; + case _T('S'): + dwFlags |= REPLACE_SUBDIR; + break; + case _T('W'): + dwFlags |= REPLACE_DISK; + break; + case _T('U'): + dwFlags |= REPLACE_UPDATE; + break; + default: + invalid_switch(arg[i]); + return 0; + } + } + else + { + invalid_switch(arg[i]); + freep(arg); + return 0; + } + nFiles--; + } + else + { + if(srcIndex == -1) + { + srcIndex = i; + } + else if(destIndex == -1) + { + destIndex = i; + } + else + { + invalid_switch(arg[i]); + freep(arg); + return 0; + } + } + } + + /* See so that at least source is there */ + if (nFiles < 1) + { + ConOutResPaging(TRUE,STRING_REPLACE_HELP2); + ConOutResPaging(TRUE,STRING_REPLACE_HELP3); + freep(arg); + return 1; + } + /* Check so that not both update and add switch is added and subdir */ + if((dwFlags & REPLACE_UPDATE || dwFlags & REPLACE_SUBDIR) && (dwFlags & REPLACE_ADD)) + { + ConOutResPaging(TRUE,STRING_REPLACE_ERROR4); + ConOutResPaging(TRUE,STRING_REPLACE_HELP7); + freep(arg); + return 1; + } + + /* If we have a destination get the full path */ + if(destIndex != -1) + { + if(_tcslen(arg[destIndex]) == 2 && arg[destIndex][1] == ':') + GetRootPath(arg[destIndex],szDestPath,MAX_PATH); + else + { + /* Check for wildcards in destination directory */ + if (_tcschr (arg[destIndex], _T('*')) != NULL || + _tcschr (arg[destIndex], _T('?')) != NULL) + { + LoadString(CMD_ModuleHandle, STRING_REPLACE_ERROR2, szMsg, RC_STRING_MAX_SIZE); + ConOutPrintf(szMsg,arg[destIndex]); + ConOutResPaging(TRUE,STRING_REPLACE_HELP3); + freep(arg); + return 1; + } + getPath(szDestPath, arg[destIndex]); + /* Make sure that destination exists */ + if(!IsExistingDirectory(szDestPath)) + { + LoadString(CMD_ModuleHandle, STRING_REPLACE_ERROR2, szMsg, RC_STRING_MAX_SIZE); + ConOutPrintf(szMsg, szDestPath); + ConOutResPaging(TRUE,STRING_REPLACE_HELP3); + freep(arg); + return 1; + } + } + } + else + { + /* Dest is current dir */ + GetCurrentDirectory(MAX_PATH,szDestPath); + } + + /* Get the full source path */ + if(!(_tcslen(arg[srcIndex]) == 2 && arg[srcIndex][1] == ':')) + getPath(szSrcPath, arg[srcIndex]); + else + _tcscpy(szSrcPath,arg[srcIndex]); + + /* Source does not have wildcards */ + if (_tcschr (arg[srcIndex], _T('*')) == NULL && + _tcschr (arg[srcIndex], _T('?')) == NULL) + { + /* Check so that source is not a directory, because that is not allowed */ + if(IsExistingDirectory(szSrcPath)) + { + LoadString(CMD_ModuleHandle, STRING_REPLACE_ERROR6, szMsg, RC_STRING_MAX_SIZE); + ConOutPrintf(szMsg, szSrcPath); + ConOutResPaging(TRUE,STRING_REPLACE_HELP3); + freep(arg); + return 1; + } + /* Check if the file exists */ + if(!IsExistingFile(szSrcPath)) + { + ConOutResPaging(TRUE,STRING_REPLACE_HELP3); + freep(arg); + return 1; + } + } + /* /w switch is set so wait for any key to be pressed */ + if(dwFlags & REPLACE_DISK) + { + msg_pause(); + cgetchar(); + } + + /* Add an extra \ to the destination path if needed */ + if(szDestPath[_tcslen(szDestPath) - 1] != _T('\\')) + _tcscat(szDestPath, _T("\\")); + + /* Save source path */ + _tcscpy(tmpSrcPath,szSrcPath); + /* Replace in dest dir */ + filesReplaced += recReplace(dwFlags, tmpSrcPath, szDestPath, &doMore); + /* If subdir switch is set replace in the subdirs to */ + if(dwFlags & REPLACE_SUBDIR && doMore) + { + filesReplaced += recFindSubDirs(dwFlags, szSrcPath, szDestPath, &doMore); + } + + /* If source == dest write no more */ + if(filesReplaced != -1) + { + /* No files replaced */ + if(filesReplaced==0) + { + /* Add switch dependent output */ + if(dwFlags & REPLACE_ADD) + ConOutResPaging(TRUE,STRING_REPLACE_HELP7); + else + ConOutResPaging(TRUE,STRING_REPLACE_HELP3); + } + /* Some files replaced */ + else + { + /* Add switch dependent output */ + if(dwFlags & REPLACE_ADD) + LoadString(CMD_ModuleHandle, STRING_REPLACE_HELP8, szMsg, RC_STRING_MAX_SIZE); + else + LoadString(CMD_ModuleHandle, STRING_REPLACE_HELP4, szMsg, RC_STRING_MAX_SIZE); + ConOutPrintf(szMsg, filesReplaced); + } + } + /* Return memory */ + freep(arg); + return 1; +} +#endif /* INCLUDE_CMD_REPLACE */ Propchange: trunk/reactos/base/shell/cmd/replace.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/shell/cmd/replace.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Modified: trunk/reactos/base/shell/cmd/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/resource.h?…
============================================================================== --- trunk/reactos/base/shell/cmd/resource.h (original) +++ trunk/reactos/base/shell/cmd/resource.h Thu Sep 27 12:35:08 2007 @@ -63,8 +63,13 @@ #define STRING_TIME_ERROR1 348 #define STRING_TYPE_ERROR1 349 #define STRING_WINDOW_ERROR1 350 - - +#define STRING_REPLACE_ERROR1 351 +#define STRING_REPLACE_ERROR2 352 +#define STRING_REPLACE_ERROR3 353 +#define STRING_REPLACE_ERROR4 354 +#define STRING_REPLACE_ERROR5 355 +#define STRING_REPLACE_ERROR6 356 +#define STRING_REPLACE_ERROR7 357 #define STRING_ATTRIB_HELP 600 #define STRING_ALIAS_HELP 601 @@ -223,6 +228,18 @@ #define STRING_MD_ERROR 725 #define STRING_MD_ERROR2 726 +#define STRING_REPLACE_HELP1 727 +#define STRING_REPLACE_HELP2 728 +#define STRING_REPLACE_HELP3 729 +#define STRING_REPLACE_HELP4 730 +#define STRING_REPLACE_HELP5 731 +#define STRING_REPLACE_HELP6 732 +#define STRING_REPLACE_HELP7 733 +#define STRING_REPLACE_HELP8 734 +#define STRING_REPLACE_HELP9 735 +#define STRING_REPLACE_HELP10 736 +#define STRING_REPLACE_HELP11 737 + /* These strings are language independent (cmd.rc) */ #define STRING_FREEDOS_DEV 800
17 years, 2 months
1
0
0
0
[weiden] 29239: Fix typo (copy&paste)
by weiden@svn.reactos.org
Author: weiden Date: Thu Sep 27 10:28:30 2007 New Revision: 29239 URL:
http://svn.reactos.org/svn/reactos?rev=29239&view=rev
Log: Fix typo (copy&paste) Modified: trunk/reactos/boot/bootdata/packages/reactos.dff Modified: trunk/reactos/boot/bootdata/packages/reactos.dff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/packages/rea…
============================================================================== --- trunk/reactos/boot/bootdata/packages/reactos.dff (original) +++ trunk/reactos/boot/bootdata/packages/reactos.dff Thu Sep 27 10:28:30 2007 @@ -256,7 +256,7 @@ dll\win32\wtsapi32\wtsapi32.dll 1 dll\win32\beepmidi\beepmidi.dll 1 dll\win32\shellext\deskadp\deskadp.dll 1 -dll\win32\shellext\deskadp\deskmon.dll 1 +dll\win32\shellext\deskmon\deskmon.dll 1 ; Drivers drivers\base\bootvid\bootvid.dll 1
17 years, 2 months
1
0
0
0
[weiden] 29238: Display the resource page in device properties
by weiden@svn.reactos.org
Author: weiden Date: Thu Sep 27 09:51:08 2007 New Revision: 29238 URL:
http://svn.reactos.org/svn/reactos?rev=29238&view=rev
Log: Display the resource page in device properties Modified: trunk/reactos/base/applications/mscutils/devmgmt/enumdevices.c trunk/reactos/base/applications/mscutils/devmgmt/precomp.h Modified: trunk/reactos/base/applications/mscutils/devmgmt/enumdevices.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
============================================================================== --- trunk/reactos/base/applications/mscutils/devmgmt/enumdevices.c (original) +++ trunk/reactos/base/applications/mscutils/devmgmt/enumdevices.c Thu Sep 27 09:51:08 2007 @@ -87,7 +87,7 @@ DevicePropertiesExW(hTreeView, NULL, (LPTSTR)tvItem.lParam, - 0, + DPF_EXTENDED, FALSE); } Modified: trunk/reactos/base/applications/mscutils/devmgmt/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
============================================================================== --- trunk/reactos/base/applications/mscutils/devmgmt/precomp.h (original) +++ trunk/reactos/base/applications/mscutils/devmgmt/precomp.h Thu Sep 27 09:51:08 2007 @@ -9,6 +9,7 @@ #include <setupapi.h> #include <cfgmgr32.h> #include <commctrl.h> +#include <dll/devmgr/devmgr.h> #include "resource.h" #ifdef _MSC_VER @@ -53,26 +54,6 @@ /* enumdevices.c */ -// undocumented API's from devmgr -#ifdef _UNICODE -#define DevicePropertiesEx DevicePropertiesExW -INT_PTR -WINAPI -DevicePropertiesExW(IN HWND hWndParent OPTIONAL, - IN LPCWSTR lpMachineName OPTIONAL, - IN LPCWSTR lpDeviceID OPTIONAL, - IN DWORD dwFlags OPTIONAL, - IN BOOL bShowDevMgr); -#else -#define DevicePropertiesEx DevicePropertiesExA -INT_PTR -WINAPI -DevicePropertiesExA(IN HWND hWndParent OPTIONAL, - IN LPCSTR lpMachineName OPTIONAL, - IN LPCSTR lpDeviceID OPTIONAL, - IN DWORD dwFlags OPTIONAL, - IN BOOL bShowDevMgr); -#endif VOID FreeDeviceStrings(HWND hTreeView); VOID OpenPropSheet(HWND hTreeView, HTREEITEM hItem);
17 years, 2 months
1
0
0
0
[weiden] 29237: Let crt parse the command line parameters
by weiden@svn.reactos.org
Author: weiden Date: Thu Sep 27 09:49:46 2007 New Revision: 29237 URL:
http://svn.reactos.org/svn/reactos?rev=29237&view=rev
Log: Let crt parse the command line parameters Modified: trunk/reactos/base/applications/control/control.c Modified: trunk/reactos/base/applications/control/control.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/control/…
============================================================================== --- trunk/reactos/base/applications/control/control.c (original) +++ trunk/reactos/base/applications/control/control.c Thu Sep 27 09:49:46 2007 @@ -386,46 +386,39 @@ return 0; } - -int WINAPI -_tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) -{ - LPTSTR lpCommandLine; - LPTSTR lpParam; - - hInst = hInstance; - CTL_DEBUG((_T("My Control Panel\r\n"))); - - lpCommandLine = GetCommandLine(); - - CTL_DEBUG((_T("CommandLine: %s\n"), lpCommandLine)); - - lpParam = _tcschr(lpCommandLine, _T(' ')); - if (lpParam == NULL) +int +_tmain(int argc, const TCHAR *argv[]) +{ + STARTUPINFO si; + + si.cb = sizeof(si); + GetStartupInfo(&si); + + hInst = GetModuleHandle(NULL); + + if (argc <= 1) { /* No argument on the command line */ - return RunControlPanelWindow(nCmdShow); - } - - lpParam++; - - if (_tcsicmp(lpParam, _T("desktop")) == 0) + return RunControlPanelWindow(si.wShowWindow); + } + + if (_tcsicmp(argv[1], _T("desktop")) == 0) { return RunControlPanel(_T("desk.cpl"), 0); } - else if (_tcsicmp(lpParam, _T("date/time")) == 0) + else if (_tcsicmp(argv[1], _T("date/time")) == 0) { return RunControlPanel(_T("timedate.cpl"), 0); } - else if (_tcsicmp(lpParam, _T("international")) == 0) + else if (_tcsicmp(argv[1], _T("international")) == 0) { return RunControlPanel(_T("intl.cpl"), 0); } - else if (_tcsicmp(lpParam, _T("mouse")) == 0) + else if (_tcsicmp(argv[1], _T("mouse")) == 0) { return RunControlPanel(_T("main.cpl"), 0); } - else if (_tcsicmp(lpParam, _T("keyboard")) == 0) + else if (_tcsicmp(argv[1], _T("keyboard")) == 0) { return RunControlPanel(_T("main.cpl"), 1); }
17 years, 2 months
1
0
0
0
[weiden] 29236: Add an initial (incomplete, not functional) implementation of the display monitor shell extension for desk.cpl
by weiden@svn.reactos.org
Author: weiden Date: Thu Sep 27 09:45:03 2007 New Revision: 29236 URL:
http://svn.reactos.org/svn/reactos?rev=29236&view=rev
Log: Add an initial (incomplete, not functional) implementation of the display monitor shell extension for desk.cpl Added: trunk/reactos/dll/win32/shellext/deskmon/ trunk/reactos/dll/win32/shellext/deskmon/deskmon.c (with props) trunk/reactos/dll/win32/shellext/deskmon/deskmon.h (with props) trunk/reactos/dll/win32/shellext/deskmon/deskmon.rbuild (with props) trunk/reactos/dll/win32/shellext/deskmon/deskmon.rc (with props) trunk/reactos/dll/win32/shellext/deskmon/deskmon.spec (with props) trunk/reactos/dll/win32/shellext/deskmon/lang/ trunk/reactos/dll/win32/shellext/deskmon/lang/en-US.rc (with props) trunk/reactos/dll/win32/shellext/deskmon/precomp.h (with props) trunk/reactos/dll/win32/shellext/deskmon/resource.h (with props) trunk/reactos/dll/win32/shellext/deskmon/rsrc.rc (with props) trunk/reactos/dll/win32/shellext/deskmon/shxiface.c (with props) Modified: trunk/reactos/baseaddress.rbuild trunk/reactos/boot/bootdata/hivecls.inf trunk/reactos/boot/bootdata/hivesft.inf trunk/reactos/boot/bootdata/packages/reactos.dff trunk/reactos/dll/win32/shellext/shellext.rbuild Modified: trunk/reactos/baseaddress.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/baseaddress.rbuild?rev=292…
============================================================================== --- trunk/reactos/baseaddress.rbuild (original) +++ trunk/reactos/baseaddress.rbuild Thu Sep 27 09:45:03 2007 @@ -55,6 +55,7 @@ <property name="BASEADDRESS_URLMON" value="0x6b3c0000" /> <property name="BASEADDRESS_SERIALUI" value="0x6b3D0000" /> <property name="BASEADDRESS_WINSTA" value="0x6b3D0000" /> + <property name="BASEADDRESS_DESKMON" value="0x6d400000" /> <property name="BASEADDRESS_DESKADP" value="0x6d410000" /> <property name="BASEADDRESS_WLDAP32" value="0x6e130000" /> <property name="BASEADDRESS_CLB" value="0x6f2b0000" /> Modified: trunk/reactos/boot/bootdata/hivecls.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivecls.inf?…
============================================================================== --- trunk/reactos/boot/bootdata/hivecls.inf (original) +++ trunk/reactos/boot/bootdata/hivecls.inf Thu Sep 27 09:45:03 2007 @@ -237,6 +237,11 @@ HKCR,"CLSID\{42071712-76d4-11d1-8b24-00a0c9068ff3}","",0x00000000,"Display Adapter CPL Extension" HKCR,"CLSID\{42071712-76d4-11d1-8b24-00a0c9068ff3}\InProcServer32","",0x00020000,"%SystemRoot%\system32\deskadp.dll" HKCR,"CLSID\{42071712-76d4-11d1-8b24-00a0c9068ff3}\InProcServer32","ThreadingModel",0x00000000,"Apartment" + +; deskmon.dll shell extension +HKCR,"CLSID\{42071713-76d4-11d1-8b24-00a0c9068ff3}","",0x00000000,"Display Monitor CPL Extension" +HKCR,"CLSID\{42071713-76d4-11d1-8b24-00a0c9068ff3}\InProcServer32","",0x00020000,"%SystemRoot%\system32\deskmon.dll" +HKCR,"CLSID\{42071713-76d4-11d1-8b24-00a0c9068ff3}\InProcServer32","ThreadingModel",0x00000000,"Apartment" ; For comcat.dll HKCR,"CLSID\{0002E005-0000-0000-C000-000000000046}","",0x00000000,"StdComponentCategoriesMgr" Modified: trunk/reactos/boot/bootdata/hivesft.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivesft.inf?…
============================================================================== --- trunk/reactos/boot/bootdata/hivesft.inf (original) +++ trunk/reactos/boot/bootdata/hivesft.inf Thu Sep 27 09:45:03 2007 @@ -767,6 +767,9 @@ ; deskadp.dll shell extension HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\Device\shellex\PropertySheetHandlers\Display Adapter CPL Extension","",0x00000000,"{42071712-76d4-11d1-8b24-00a0c9068ff3}" +; deskmon.dll shell extension +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\Device\shellex\PropertySheetHandlers\Display Monitor CPL Extension","",0x00000000,"{42071713-76d4-11d1-8b24-00a0c9068ff3}" + ; Where to download the Mozilla ActiveX control HKLM,"SOFTWARE\ReactOS\shdocvw","MozillaUrl",0x00000000,"
http://links.reactos.org/mozactivex
" Modified: trunk/reactos/boot/bootdata/packages/reactos.dff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/packages/rea…
============================================================================== --- trunk/reactos/boot/bootdata/packages/reactos.dff (original) +++ trunk/reactos/boot/bootdata/packages/reactos.dff Thu Sep 27 09:45:03 2007 @@ -256,6 +256,7 @@ dll\win32\wtsapi32\wtsapi32.dll 1 dll\win32\beepmidi\beepmidi.dll 1 dll\win32\shellext\deskadp\deskadp.dll 1 +dll\win32\shellext\deskadp\deskmon.dll 1 ; Drivers drivers\base\bootvid\bootvid.dll 1 Added: trunk/reactos/dll/win32/shellext/deskmon/deskmon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskmon…
============================================================================== --- trunk/reactos/dll/win32/shellext/deskmon/deskmon.c (added) +++ trunk/reactos/dll/win32/shellext/deskmon/deskmon.c Thu Sep 27 09:45:03 2007 @@ -1,0 +1,251 @@ +#include "precomp.h" + +#define NDEBUG +#include <debug.h> + +static HINSTANCE hInstance; + +static VOID +InitMonitorDialog(PDESKMONITOR This) +{ + LPTSTR lpMonitorName; + + lpMonitorName = QueryDeskCplString(This->pdtobj, + RegisterClipboardFormat(DESK_EXT_MONITORNAME)); + if (lpMonitorName != NULL) + { + SetDlgItemText(This->hwndDlg, + IDC_MONITORNAME, + lpMonitorName); + + LocalFree((HLOCAL)lpMonitorName); + } + + if (This->DeskExtInterface != NULL) + { + /* FIXME */ + } +} + +static INT_PTR CALLBACK +MonitorDlgProc(HWND hwndDlg, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ + PDESKMONITOR This; + INT_PTR Ret = 0; + + if (uMsg != WM_INITDIALOG) + { + This = (PDESKMONITOR)GetWindowLongPtr(hwndDlg, + DWL_USER); + } + + switch (uMsg) + { + case WM_INITDIALOG: + This = (PDESKMONITOR)((LPCPROPSHEETPAGE)lParam)->lParam; + This->hwndDlg = hwndDlg; + SetWindowLongPtr(hwndDlg, + DWL_USER, + (LONG_PTR)This); + + InitMonitorDialog(This); + Ret = TRUE; + break; + + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDC_MONITORPROPERTIES: + break; + } + + break; + } + + return Ret; +} + +static VOID +IDeskMonitor_Destroy(PDESKMONITOR This) +{ + if (This->pdtobj != NULL) + { + IDataObject_Release(This->pdtobj); + This->pdtobj = NULL; + } + + if (This->DeskExtInterface != NULL) + { + LocalFree((HLOCAL)This->DeskExtInterface); + This->DeskExtInterface = NULL; + } +} + +ULONG +IDeskMonitor_AddRef(PDESKMONITOR This) +{ + ULONG ret; + + ret = InterlockedIncrement((PLONG)&This->ref); + if (ret == 1) + InterlockedIncrement(&dll_refs); + + return ret; +} + +ULONG +IDeskMonitor_Release(PDESKMONITOR This) +{ + ULONG ret; + + ret = InterlockedDecrement((PLONG)&This->ref); + if (ret == 0) + { + IDeskMonitor_Destroy(This); + InterlockedDecrement(&dll_refs); + + HeapFree(GetProcessHeap(), + 0, + This); + } + + return ret; +} + +HRESULT STDMETHODCALLTYPE +IDeskMonitor_QueryInterface(PDESKMONITOR This, + REFIID iid, + PVOID *pvObject) +{ + *pvObject = NULL; + + if (IsEqualIID(iid, + &IID_IShellPropSheetExt) || + IsEqualIID(iid, + &IID_IUnknown)) + { + *pvObject = impl_to_interface(This, IShellPropSheetExt); + } + else if (IsEqualIID(iid, + &IID_IShellExtInit)) + { + *pvObject = impl_to_interface(This, IShellExtInit); + } + else if (IsEqualIID(iid, + &IID_IClassFactory)) + { + *pvObject = impl_to_interface(This, IClassFactory); + } + else + { + DPRINT1("IDeskMonitor::QueryInterface(%p,%p): E_NOINTERFACE\n", iid, pvObject); + return E_NOINTERFACE; + } + + IDeskMonitor_AddRef(This); + return S_OK; +} + +HRESULT +IDeskMonitor_Initialize(PDESKMONITOR This, + LPCITEMIDLIST pidlFolder, + IDataObject *pdtobj, + HKEY hkeyProgID) +{ + DPRINT1("IDeskMonitor::Initialize(%p,%p,%p)\n", pidlFolder, pdtobj, hkeyProgID); + + if (pdtobj != NULL) + { + IDataObject_AddRef(pdtobj); + This->pdtobj = pdtobj; + + /* Get a copy of the desk.cpl extension interface */ + This->DeskExtInterface = QueryDeskCplExtInterface(This->pdtobj); + if (This->DeskExtInterface != NULL) + return S_OK; + } + + return S_FALSE; +} + +HRESULT +IDeskMonitor_AddPages(PDESKMONITOR This, + LPFNADDPROPSHEETPAGE pfnAddPage, + LPARAM lParam) +{ + HPROPSHEETPAGE hpsp; + PROPSHEETPAGE psp; + + DPRINT1("IDeskMonitor::AddPages(%p,%p)\n", pfnAddPage, lParam); + + psp.dwSize = sizeof(psp); + psp.dwFlags = PSP_DEFAULT; + psp.hInstance = hInstance; + psp.pszTemplate = MAKEINTRESOURCE(IDD_MONITOR); + psp.pfnDlgProc = MonitorDlgProc; + psp.lParam = (LPARAM)This; + + hpsp = CreatePropertySheetPage(&psp); + if (hpsp != NULL && pfnAddPage(hpsp, lParam)) + return S_OK; + + return S_FALSE; +} + +HRESULT +IDeskMonitor_ReplacePage(PDESKMONITOR This, + EXPPS uPageID, + LPFNADDPROPSHEETPAGE pfnReplacePage, + LPARAM lParam) +{ + DPRINT1("IDeskMonitor::ReplacePage(%u,%p,%p)\n", uPageID, pfnReplacePage, lParam); + return E_NOTIMPL; +} + +HRESULT +IDeskMonitor_Constructor(REFIID riid, + LPVOID *ppv) +{ + PDESKMONITOR This; + HRESULT hRet = E_OUTOFMEMORY; + + DPRINT1("IDeskMonitor::Constructor(%p,%p)\n", riid, ppv); + + This = HeapAlloc(GetProcessHeap(), + 0, + sizeof(*This)); + if (This != NULL) + { + ZeroMemory(This, + sizeof(*This)); + + IDeskMonitor_InitIface(This); + + hRet = IDeskMonitor_QueryInterface(This, + riid, + ppv); + if (!SUCCEEDED(hRet)) + IDeskMonitor_Release(This); + } + + return hRet; +} + +BOOL STDCALL +DllMain(HINSTANCE hinstDLL, + DWORD dwReason, + LPVOID lpvReserved) +{ + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + hInstance = hinstDLL; + DisableThreadLibraryCalls(hInstance); + break; + } + + return TRUE; +} Propchange: trunk/reactos/dll/win32/shellext/deskmon/deskmon.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/shellext/deskmon/deskmon.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskmon…
============================================================================== --- trunk/reactos/dll/win32/shellext/deskmon/deskmon.h (added) +++ trunk/reactos/dll/win32/shellext/deskmon/deskmon.h Thu Sep 27 09:45:03 2007 @@ -1,0 +1,60 @@ +#ifndef __DESKMON__H +#define __DESKMON__H + +typedef struct _DESKMONITOR +{ + const struct IShellPropSheetExtVtbl *lpIShellPropSheetExtVtbl; + const struct IShellExtInitVtbl *lpIShellExtInitVtbl; + const struct IClassFactoryVtbl *lpIClassFactoryVtbl; + DWORD ref; + + HWND hwndDlg; + PDESK_EXT_INTERFACE DeskExtInterface; + IDataObject *pdtobj; +} DESKMONITOR, *PDESKMONITOR; + +extern LONG dll_refs; + +#define impl_to_interface(impl,iface) (struct iface *)(&(impl)->lp##iface##Vtbl) +#define interface_to_impl(instance,iface) ((PDESKMONITOR)((ULONG_PTR)instance - FIELD_OFFSET(DESKMONITOR,lp##iface##Vtbl))) + +HRESULT +IDeskMonitor_Constructor(REFIID riid, + LPVOID *ppv); + +VOID +IDeskMonitor_InitIface(PDESKMONITOR This); + +HRESULT STDMETHODCALLTYPE +IDeskMonitor_QueryInterface(PDESKMONITOR This, + REFIID iid, + PVOID *pvObject); + +ULONG +IDeskMonitor_AddRef(PDESKMONITOR This); + +ULONG +IDeskMonitor_Release(PDESKMONITOR This); + +HRESULT +IDeskMonitor_Initialize(PDESKMONITOR This, + LPCITEMIDLIST pidlFolder, + IDataObject *pdtobj, + HKEY hkeyProgID); + +HRESULT +IDeskMonitor_AddPages(PDESKMONITOR This, + LPFNADDPROPSHEETPAGE pfnAddPage, + LPARAM lParam); + +HRESULT +IDeskMonitor_ReplacePage(PDESKMONITOR This, + EXPPS uPageID, + LPFNADDPROPSHEETPAGE pfnReplacePage, + LPARAM lParam); + +static const GUID CLSID_IDeskMonitor = {0x42071713,0x76d4,0x11d1,{0x8b,0x24,0x00,0xa0,0xc9,0x06,0x8f,0xf3}}; + +ULONG __cdecl DbgPrint(PCCH Format,...); + +#endif /* __DESKMON__H */ Propchange: trunk/reactos/dll/win32/shellext/deskmon/deskmon.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/shellext/deskmon/deskmon.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskmon…
============================================================================== --- trunk/reactos/dll/win32/shellext/deskmon/deskmon.rbuild (added) +++ trunk/reactos/dll/win32/shellext/deskmon/deskmon.rbuild Thu Sep 27 09:45:03 2007 @@ -1,0 +1,21 @@ +<module name="deskmon" type="win32dll" baseaddress="${BASEADDRESS_DESKMON}" installbase="system32" installname="deskmon.dll" unicode="yes"> + <importlibrary definition="deskmon.spec.def" /> + <include base="deskmon">.</include> + <define name="__USE_W32API" /> + <define name="_WIN32_IE">0x0500</define> + <define name="_WIN32_WINNT">0x0600</define> + <define name="WINVER">0x0600</define> + <library>ntdll</library> + <library>kernel32</library> + <library>user32</library> + <library>gdi32</library> + <library>comctl32</library> + <library>ole32</library> + <library>uuid</library> + <library>msvcrt</library> + <file>deskmon.c</file> + <file>shxiface.c</file> + <file>deskmon.rc</file> + <file>deskmon.spec</file> + <pch>precomp.h</pch> +</module> Propchange: trunk/reactos/dll/win32/shellext/deskmon/deskmon.rbuild ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/shellext/deskmon/deskmon.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskmon…
============================================================================== --- trunk/reactos/dll/win32/shellext/deskmon/deskmon.rc (added) +++ trunk/reactos/dll/win32/shellext/deskmon/deskmon.rc Thu Sep 27 09:45:03 2007 @@ -1,0 +1,12 @@ +/* $Id: slayer.rc 24931 2006-11-28 19:35:42Z janderwald $ */ + +#include <windows.h> +#include "resource.h" + +#define REACTOS_VERSION_DLL +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Advanced display monitor properties\0" +#define REACTOS_STR_INTERNAL_NAME "deskmon\0" +#define REACTOS_STR_ORIGINAL_FILENAME "deskmon.dll\0" +#include <reactos/version.rc> + +#include "rsrc.rc" Propchange: trunk/reactos/dll/win32/shellext/deskmon/deskmon.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/shellext/deskmon/deskmon.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskmon…
============================================================================== --- trunk/reactos/dll/win32/shellext/deskmon/deskmon.spec (added) +++ trunk/reactos/dll/win32/shellext/deskmon/deskmon.spec Thu Sep 27 09:45:03 2007 @@ -1,0 +1,4 @@ +# deskmon.dll exports + + 1 stdcall DllCanUnloadNow() + 2 stdcall DllGetClassObject(ptr ptr ptr) Propchange: trunk/reactos/dll/win32/shellext/deskmon/deskmon.spec ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/shellext/deskmon/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskmon…
============================================================================== --- trunk/reactos/dll/win32/shellext/deskmon/lang/en-US.rc (added) +++ trunk/reactos/dll/win32/shellext/deskmon/lang/en-US.rc Thu Sep 27 09:45:03 2007 @@ -1,0 +1,12 @@ +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +IDD_MONITOR DIALOGEX 0, 0, 224, 226 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Monitor" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + GROUPBOX "Monitor type", -1, 7, 3, 237, 52 + LTEXT "", IDC_MONITORNAME, 40, 17, 190, 20, SS_NOPREFIX + PUSHBUTTON "&Properties", IDC_MONITORPROPERTIES, 177, 35, 59, 14, WS_DISABLED +END + Propchange: trunk/reactos/dll/win32/shellext/deskmon/lang/en-US.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/shellext/deskmon/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskmon…
============================================================================== --- trunk/reactos/dll/win32/shellext/deskmon/precomp.h (added) +++ trunk/reactos/dll/win32/shellext/deskmon/precomp.h Thu Sep 27 09:45:03 2007 @@ -1,0 +1,13 @@ +#ifndef __PRECOMP__H +#define __PRECOMP__H + +#define COBJMACROS +#include <windows.h> +#include <tchar.h> +#include <stdio.h> +#include <shlobj.h> +#include <dll/desk/deskcplx.h> +#include "deskmon.h" +#include "resource.h" + +#endif /* __PRECOMP__H */ Propchange: trunk/reactos/dll/win32/shellext/deskmon/precomp.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/shellext/deskmon/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskmon…
============================================================================== --- trunk/reactos/dll/win32/shellext/deskmon/resource.h (added) +++ trunk/reactos/dll/win32/shellext/deskmon/resource.h Thu Sep 27 09:45:03 2007 @@ -1,0 +1,9 @@ +#ifndef __RESOURCE__H +#define __RESOURCE__H + +#define IDD_MONITOR 100 + +#define IDC_MONITORNAME 201 +#define IDC_MONITORPROPERTIES 202 + +#endif /* __RESOURCE__H */ Propchange: trunk/reactos/dll/win32/shellext/deskmon/resource.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/shellext/deskmon/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskmon…
============================================================================== --- trunk/reactos/dll/win32/shellext/deskmon/rsrc.rc (added) +++ trunk/reactos/dll/win32/shellext/deskmon/rsrc.rc Thu Sep 27 09:45:03 2007 @@ -1,0 +1,7 @@ +#include <windows.h> +#include "resource.h" + +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL + +#include "lang/en-US.rc" + Propchange: trunk/reactos/dll/win32/shellext/deskmon/rsrc.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/shellext/deskmon/shxiface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskmon…
============================================================================== --- trunk/reactos/dll/win32/shellext/deskmon/shxiface.c (added) +++ trunk/reactos/dll/win32/shellext/deskmon/shxiface.c Thu Sep 27 09:45:03 2007 @@ -1,0 +1,209 @@ +#include "precomp.h" + +#define NDEBUG +#include <debug.h> + +LONG dll_refs = 0; + +static HRESULT STDMETHODCALLTYPE +IDeskMonitor_IShellPropSheetExt_QueryInterface(IShellPropSheetExt *iface, + REFIID iid, + PVOID *pvObject) +{ + PDESKMONITOR This = interface_to_impl(iface, IShellPropSheetExt); + return IDeskMonitor_QueryInterface(This, + iid, + pvObject); +} + +static ULONG STDMETHODCALLTYPE +IDeskMonitor_IShellPropSheetExt_AddRef(IShellPropSheetExt* iface) +{ + PDESKMONITOR This = interface_to_impl(iface, IShellPropSheetExt); + return IDeskMonitor_AddRef(This); +} + +static ULONG STDMETHODCALLTYPE +IDeskMonitor_IShellPropSheetExt_Release(IShellPropSheetExt* iface) +{ + PDESKMONITOR This = interface_to_impl(iface, IShellPropSheetExt); + return IDeskMonitor_Release(This); +} + +static HRESULT STDMETHODCALLTYPE +IDeskMonitor_IShellPropSheetExt_AddPages(IShellPropSheetExt* iface, + LPFNADDPROPSHEETPAGE pfnAddPage, + LPARAM lParam) +{ + PDESKMONITOR This = interface_to_impl(iface, IShellPropSheetExt); + return IDeskMonitor_AddPages(This, + pfnAddPage, + lParam); +} + +static HRESULT STDMETHODCALLTYPE +IDeskMonitor_IShellPropSheetExt_ReplacePage(IShellPropSheetExt* iface, + EXPPS uPageID, + LPFNADDPROPSHEETPAGE pfnReplacePage, + LPARAM lParam) +{ + PDESKMONITOR This = interface_to_impl(iface, IShellPropSheetExt); + return IDeskMonitor_ReplacePage(This, + uPageID, + pfnReplacePage, + lParam); +} + +static IShellPropSheetExtVtbl efvtIShellPropSheetExt = +{ + IDeskMonitor_IShellPropSheetExt_QueryInterface, + IDeskMonitor_IShellPropSheetExt_AddRef, + IDeskMonitor_IShellPropSheetExt_Release, + IDeskMonitor_IShellPropSheetExt_AddPages, + IDeskMonitor_IShellPropSheetExt_ReplacePage +}; + +static HRESULT STDMETHODCALLTYPE +IDeskMonitor_IShellExtInit_QueryInterface(IShellExtInit *iface, + REFIID iid, + PVOID *pvObject) +{ + PDESKMONITOR This = interface_to_impl(iface, IShellExtInit); + return IDeskMonitor_QueryInterface(This, + iid, + pvObject); +} + +static ULONG STDMETHODCALLTYPE +IDeskMonitor_IShellExtInit_AddRef(IShellExtInit* iface) +{ + PDESKMONITOR This = interface_to_impl(iface, IShellExtInit); + return IDeskMonitor_AddRef(This); +} + +static ULONG STDMETHODCALLTYPE +IDeskMonitor_IShellExtInit_Release(IShellExtInit* iface) +{ + PDESKMONITOR This = interface_to_impl(iface, IShellExtInit); + return IDeskMonitor_Release(This); +} + +static HRESULT STDMETHODCALLTYPE +IDeskMonitor_IShellExtInit_Initialize(IShellExtInit* iface, + LPCITEMIDLIST pidlFolder, + IDataObject *pdtobj, + HKEY hkeyProgID) +{ + PDESKMONITOR This = interface_to_impl(iface, IShellExtInit); + return IDeskMonitor_Initialize(This, + pidlFolder, + pdtobj, + hkeyProgID); +} + +static IShellExtInitVtbl efvtIShellExtInit = +{ + IDeskMonitor_IShellExtInit_QueryInterface, + IDeskMonitor_IShellExtInit_AddRef, + IDeskMonitor_IShellExtInit_Release, + IDeskMonitor_IShellExtInit_Initialize +}; + +static HRESULT STDMETHODCALLTYPE +IDeskMonitor_IClassFactory_QueryInterface(IClassFactory *iface, + REFIID iid, + PVOID *pvObject) +{ + PDESKMONITOR This = interface_to_impl(iface, IClassFactory); + return IDeskMonitor_QueryInterface(This, + iid, + pvObject); +} + +static ULONG STDMETHODCALLTYPE +IDeskMonitor_IClassFactory_AddRef(IClassFactory* iface) +{ + PDESKMONITOR This = interface_to_impl(iface, IClassFactory); + return IDeskMonitor_AddRef(This); +} + +static ULONG STDMETHODCALLTYPE +IDeskMonitor_IClassFactory_Release(IClassFactory* iface) +{ + PDESKMONITOR This = interface_to_impl(iface, IClassFactory); + return IDeskMonitor_Release(This); +} + +static HRESULT STDMETHODCALLTYPE +IDeskMonitor_IClassFactory_CreateInstance(IClassFactory *iface, + IUnknown * pUnkOuter, + REFIID riid, + PVOID *ppvObject) +{ + if (pUnkOuter != NULL && + !IsEqualIID(riid, + &IID_IUnknown)) + { + return CLASS_E_NOAGGREGATION; + } + + return IDeskMonitor_Constructor(riid, + ppvObject); +} + +static HRESULT STDMETHODCALLTYPE +IDeskMonitor_IClassFactory_LockServer(IClassFactory *iface, + BOOL fLock) +{ + if (fLock) + InterlockedIncrement(&dll_refs); + else + InterlockedDecrement(&dll_refs); + + return S_OK; +} + +static IClassFactoryVtbl efvtIClassFactory = +{ + IDeskMonitor_IClassFactory_QueryInterface, + IDeskMonitor_IClassFactory_AddRef, + IDeskMonitor_IClassFactory_Release, + IDeskMonitor_IClassFactory_CreateInstance, + IDeskMonitor_IClassFactory_LockServer, +}; + +VOID +IDeskMonitor_InitIface(PDESKMONITOR This) +{ + This->lpIShellPropSheetExtVtbl = &efvtIShellPropSheetExt; + This->lpIShellExtInitVtbl = &efvtIShellExtInit; + This->lpIClassFactoryVtbl = &efvtIClassFactory; + + IDeskMonitor_AddRef(This); +} + +HRESULT WINAPI +DllGetClassObject(REFCLSID rclsid, + REFIID riid, + LPVOID *ppv) +{ + if (ppv == NULL) + return E_INVALIDARG; + + *ppv = NULL; + if (IsEqualCLSID(rclsid, + &CLSID_IDeskMonitor)) + { + return IDeskMonitor_Constructor(riid, + ppv); + } + + DPRINT1("DllGetClassObject: CLASS_E_CLASSNOTAVAILABLE\n"); + return CLASS_E_CLASSNOTAVAILABLE; +} + +HRESULT WINAPI +DllCanUnloadNow(VOID) +{ + return dll_refs == 0 ? S_OK : S_FALSE; +} Propchange: trunk/reactos/dll/win32/shellext/deskmon/shxiface.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/shellext/shellext.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/shellex…
============================================================================== --- trunk/reactos/dll/win32/shellext/shellext.rbuild (original) +++ trunk/reactos/dll/win32/shellext/shellext.rbuild Thu Sep 27 09:45:03 2007 @@ -7,4 +7,7 @@ <directory name="deskadp"> <xi:include href="deskadp/deskadp.rbuild" /> </directory> + <directory name="deskmon"> + <xi:include href="deskmon/deskmon.rbuild" /> + </directory> </group>
17 years, 2 months
1
0
0
0
[weiden] 29235: Once again change back the GUID to the real one...
by weiden@svn.reactos.org
Author: weiden Date: Thu Sep 27 09:27:23 2007 New Revision: 29235 URL:
http://svn.reactos.org/svn/reactos?rev=29235&view=rev
Log: Once again change back the GUID to the real one... Modified: trunk/reactos/dll/win32/shellext/deskadp/deskadp.h Modified: trunk/reactos/dll/win32/shellext/deskadp/deskadp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskadp…
============================================================================== --- trunk/reactos/dll/win32/shellext/deskadp/deskadp.h (original) +++ trunk/reactos/dll/win32/shellext/deskadp/deskadp.h Thu Sep 27 09:27:23 2007 @@ -56,7 +56,7 @@ LPFNADDPROPSHEETPAGE pfnReplacePage, LPARAM lParam); -static const GUID CLSID_IDeskDisplayAdapter = {0x42071712,0x76d4,0x11d1,{0x8b,0x24,0x00,0xa0,0xc9,0x06,0x8f,0xf9}}; +static const GUID CLSID_IDeskDisplayAdapter = {0x42071712,0x76d4,0x11d1,{0x8b,0x24,0x00,0xa0,0xc9,0x06,0x8f,0xf3}}; ULONG __cdecl DbgPrint(PCCH Format,...);
17 years, 2 months
1
0
0
0
[weiden] 29234: - Allow changing the screen resolution in the advanced adapter settings through desk.cpl - desk.cpl doesn't publish a monitor id
by weiden@svn.reactos.org
Author: weiden Date: Thu Sep 27 09:23:58 2007 New Revision: 29234 URL:
http://svn.reactos.org/svn/reactos?rev=29234&view=rev
Log: - Allow changing the screen resolution in the advanced adapter settings through desk.cpl - desk.cpl doesn't publish a monitor id Modified: trunk/reactos/dll/cpl/desk/desk.def trunk/reactos/dll/cpl/desk/devsett.c trunk/reactos/dll/win32/shellext/deskadp/deskadp.c trunk/reactos/dll/win32/shellext/deskadp/deskadp.h trunk/reactos/dll/win32/shellext/deskadp/lang/en-US.rc trunk/reactos/include/reactos/dll/desk/deskcplx.h Modified: trunk/reactos/dll/cpl/desk/desk.def URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/desk.def?rev=…
============================================================================== --- trunk/reactos/dll/cpl/desk/desk.def (original) +++ trunk/reactos/dll/cpl/desk/desk.def Thu Sep 27 09:23:58 2007 @@ -3,5 +3,6 @@ EXPORTS CPlApplet DisplayClassInstaller +DisplaySaveSettings ; EOF Modified: trunk/reactos/dll/cpl/desk/devsett.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/devsett.c?rev…
============================================================================== --- trunk/reactos/dll/cpl/desk/devsett.c (original) +++ trunk/reactos/dll/cpl/desk/devsett.c Thu Sep 27 09:23:58 2007 @@ -7,6 +7,8 @@ #include "desk.h" +#include <cfgmgr32.h> + #define NDEBUG #include <debug.h> @@ -23,7 +25,6 @@ CLIPFORMAT cfDisplayId; /* "Display ID" */ CLIPFORMAT cfMonitorName; /* "Monitor Name" */ CLIPFORMAT cfMonitorDevice; /* "Monitor Device" */ - CLIPFORMAT cfMonitorId; /* "Monitor ID" */ CLIPFORMAT cfDisplayKey; /* "Display Key" */ CLIPFORMAT cfDisplayStateFlags; /* "Display State Flags" */ CLIPFORMAT cfPruningMode; /* "Pruning Mode" */ @@ -34,7 +35,6 @@ PWSTR pDisplayId; PWSTR pMonitorName; PWSTR pMonitorDevice; - PWSTR pMonitorId; DESK_EXT_INTERFACE ExtInterface; @@ -171,9 +171,47 @@ static PWSTR pCDevSettings_GetDeviceInstanceId(const WCHAR *pszDevice) { - /* FIXME: Implement */ + DEVINST DevInst; + CONFIGRET cr; + ULONG BufLen; + LPWSTR lpDevInstId = NULL; + DPRINT1("CDevSettings::GetDeviceInstanceId(%ws) UNIMPLEMENTED!\n", pszDevice); - return NULL; + + cr = CM_Locate_DevNodeW(&DevInst, + (DEVINSTID_W)pszDevice, + CM_LOCATE_DEVNODE_NORMAL); + if (cr == CR_SUCCESS) + { + DbgPrint("Success1\n"); + cr = CM_Get_Device_ID_Size(&BufLen, + DevInst, + 0); + if (cr == CR_SUCCESS) + { + DbgPrint("Success2\n"); + lpDevInstId = LocalAlloc(LMEM_FIXED, + (BufLen + 1) * sizeof(WCHAR)); + + if (lpDevInstId != NULL) + { + DbgPrint("Success3\n"); + cr = CM_Get_Device_IDW(DevInst, + lpDevInstId, + BufLen, + 0); + + if (cr != CR_SUCCESS) + { + LocalFree((HLOCAL)lpDevInstId); + lpDevInstId = NULL; + } + DbgPrint("instance id: %ws\n", lpDevInstId); + } + } + } + + return lpDevInstId; } @@ -401,7 +439,6 @@ This->cfDisplayStateFlags = RegisterClipboardFormat(DESK_EXT_DISPLAYSTATEFLAGS); This->cfMonitorName = RegisterClipboardFormat(DESK_EXT_MONITORNAME); This->cfMonitorDevice = RegisterClipboardFormat(DESK_EXT_MONITORDEVICE); - This->cfMonitorId = RegisterClipboardFormat(DESK_EXT_MONITORID); This->cfPruningMode = RegisterClipboardFormat(DESK_EXT_PRUNINGMODE); /* Copy the device name */ @@ -411,14 +448,12 @@ DPRINT1("This->pDisplayName: %ws\n", This->pDisplayName); This->pDisplayKey = pCDevSettings_AllocAndCopyString(DisplayDeviceInfo->DeviceKey); DPRINT1("This->pDisplayKey: %ws\n", This->pDisplayKey); - This->pDisplayId = pCDevSettings_GetDeviceInstanceId(This->pDisplayDevice); + This->pDisplayId = pCDevSettings_GetDeviceInstanceId(DisplayDeviceInfo->DeviceID); DPRINT1("This->pDisplayId: %ws\n", This->pDisplayId); This->pMonitorName = pCDevSettings_GetMonitorName(This->pDisplayDevice); DPRINT1("This->pMonitorName: %ws\n", This->pMonitorName); This->pMonitorDevice = pCDevSettings_GetMonitorDevice(This->pDisplayDevice); DPRINT1("This->pMonitorDevice: %ws\n", This->pMonitorDevice); - This->pMonitorId = pCDevSettings_GetDeviceInstanceId( This->pMonitorDevice); - DPRINT1("This->pMonitorId: %ws\n", This->pMonitorId); /* Check pruning mode */ This->bModesPruned = ((DisplayDeviceInfo->DeviceStateFlags & DISPLAY_DEVICE_MODESPRUNED) != 0); @@ -465,7 +500,6 @@ pCDevSettings_FreeString(&This->pDisplayId); pCDevSettings_FreeString(&This->pMonitorName); pCDevSettings_FreeString(&This->pMonitorDevice); - pCDevSettings_FreeString(&This->pMonitorId); } static HRESULT STDMETHODCALLTYPE @@ -561,11 +595,6 @@ { pszRet = This->pMonitorDevice; DPRINT1("CDevSettings::GetData returns monitor device %ws\n", pszRet); - } - else if (pformatetcIn->cfFormat == This->cfMonitorId) - { - pszRet = This->pMonitorId; - DPRINT1("CDevSettings::GetData returns monitor id %ws\n", pszRet); } else if (pformatetcIn->cfFormat == This->cfExtInterface) { @@ -688,7 +717,6 @@ pformatetc->cfFormat == This->cfDisplayStateFlags || pformatetc->cfFormat == This->cfMonitorDevice || pformatetc->cfFormat == This->cfMonitorName || - pformatetc->cfFormat == This->cfMonitorId || pformatetc->cfFormat == This->cfPruningMode) { return S_OK; @@ -774,7 +802,7 @@ IEnumFORMATETC** ppenumFormatEtc) { HRESULT hr; - FORMATETC fetc[10]; + FORMATETC fetc[9]; PCDevSettings This = impl_from_IDataObject(iface); *ppenumFormatEtc = NULL; @@ -798,8 +826,6 @@ pCDevSettings_FillFormatEtc(&fetc[7], This->cfMonitorDevice); pCDevSettings_FillFormatEtc(&fetc[8], - This->cfMonitorId); - pCDevSettings_FillFormatEtc(&fetc[9], This->cfPruningMode); hr = SHCreateStdEnumFmtEtc(sizeof(fetc) / sizeof(fetc[0]), @@ -877,3 +903,12 @@ return NULL; } + +LONG WINAPI +DisplaySaveSettings(PVOID pContext, + HWND hwndPropSheet) +{ + //PCDevSettings This = impl_from_IDataObject((IDataObject *)Context); + DPRINT("DisplaySaveSettings() UNIMPLEMENTED!\n"); + return DISP_CHANGE_BADPARAM; +} Modified: trunk/reactos/dll/win32/shellext/deskadp/deskadp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskadp…
============================================================================== --- trunk/reactos/dll/win32/shellext/deskadp/deskadp.c (original) +++ trunk/reactos/dll/win32/shellext/deskadp/deskadp.c Thu Sep 27 09:23:58 2007 @@ -151,6 +151,38 @@ } } +static BOOL +ChangeSelectedMode(PDESKDISPLAYADAPTER This, + HWND hwndListAllModesDlg) +{ + INT i; + PDEVMODEW lpSelDevMode = NULL; + BOOL bRet = FALSE; + + i = (INT)SendDlgItemMessage(hwndListAllModesDlg, + IDC_ALLVALIDMODES, + LB_GETCURSEL, + 0, + 0); + + if (i >= 0) + { + lpSelDevMode = (PDEVMODEW)SendDlgItemMessage(hwndListAllModesDlg, + IDC_ALLVALIDMODES, + LB_GETITEMDATA, + (WPARAM)i, + 0); + } + + if (lpSelDevMode != NULL) + { + This->lpSelDevMode = lpSelDevMode; + bRet = TRUE; + } + + return bRet; +} + static INT_PTR CALLBACK ListAllModesDlgProc(HWND hwndDlg, UINT uMsg, @@ -183,7 +215,14 @@ switch (LOWORD(wParam)) { case IDOK: + if (ChangeSelectedMode(This, + hwndDlg)) + { + EndDialog(hwndDlg, + IDOK); + } break; + case IDCANCEL: EndDialog(hwndDlg, IDCANCEL); @@ -203,11 +242,25 @@ static VOID ShowListAllModes(PDESKDISPLAYADAPTER This) { - DialogBoxParam(hInstance, - MAKEINTRESOURCE(IDD_LISTALLMODES), - This->hwndDlg, - ListAllModesDlgProc, - (LPARAM)This); + PDEVMODEW lpPrevSel; + + lpPrevSel = This->lpSelDevMode; + + if (This->DeskExtInterface != NULL && + DialogBoxParam(hInstance, + MAKEINTRESOURCE(IDD_LISTALLMODES), + This->hwndDlg, + ListAllModesDlgProc, + (LPARAM)This) == IDOK) + { + if (lpPrevSel != This->lpSelDevMode) + { + (void)PropSheet_Changed(GetParent(This->hwndDlg), + This->hwndDlg); + This->DeskExtInterface->SetCurrentMode(This->DeskExtInterface->Context, + This->lpSelDevMode); + } + } } static VOID @@ -271,6 +324,49 @@ SetDlgItemTextW(This->hwndDlg, IDC_BIOSINFORMATION, This->DeskExtInterface->BiosString); + + This->lpDevModeOnInit = This->DeskExtInterface->GetCurrentMode(This->DeskExtInterface->Context); + } + else + This->lpDevModeOnInit = NULL; + + This->lpSelDevMode = This->lpDevModeOnInit; +} + +static LONG +ApplyDisplayAdapterChanges(PDESKDISPLAYADAPTER This) +{ + LONG lChangeRet; + + if (This->DeskExtInterface != NULL) + { + /* Change the display settings through desk.cpl */ + lChangeRet = DeskCplExtDisplaySaveSettings(This->DeskExtInterface, + This->hwndDlg); + if (lChangeRet == DISP_CHANGE_SUCCESSFUL) + { + /* Save the new mode */ + This->lpDevModeOnInit = This->DeskExtInterface->GetCurrentMode(This->DeskExtInterface->Context); + return PSNRET_NOERROR; + } + else if (lChangeRet == DISP_CHANGE_RESTART) + { + /* Notify desk.cpl that the user needs to reboot */ + PropSheet_RestartWindows(GetParent(This->hwndDlg)); + return PSNRET_NOERROR; + } + } + + return PSNRET_INVALID_NOCHANGEPAGE; +} + +static VOID +ResetDisplayAdapterChanges(PDESKDISPLAYADAPTER This) +{ + if (This->DeskExtInterface != NULL && This->lpDevModeOnInit != NULL) + { + This->DeskExtInterface->SetCurrentMode(This->DeskExtInterface->Context, + This->lpDevModeOnInit); } } @@ -315,6 +411,27 @@ } break; + + case WM_NOTIFY: + { + NMHDR *nmh = (NMHDR *)lParam; + + switch (nmh->code) + { + case PSN_APPLY: + { + SetWindowLong(hwndDlg, + DWL_MSGRESULT, + ApplyDisplayAdapterChanges(This)); + break; + } + + case PSN_RESET: + ResetDisplayAdapterChanges(This); + break; + } + break; + } } return Ret; Modified: trunk/reactos/dll/win32/shellext/deskadp/deskadp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskadp…
============================================================================== --- trunk/reactos/dll/win32/shellext/deskadp/deskadp.h (original) +++ trunk/reactos/dll/win32/shellext/deskadp/deskadp.h Thu Sep 27 09:23:58 2007 @@ -12,6 +12,8 @@ PDESK_EXT_INTERFACE DeskExtInterface; IDataObject *pdtobj; LPTSTR lpDeviceId; + PDEVMODEW lpSelDevMode; + PDEVMODEW lpDevModeOnInit; } DESKDISPLAYADAPTER, *PDESKDISPLAYADAPTER; extern LONG dll_refs; @@ -54,7 +56,7 @@ LPFNADDPROPSHEETPAGE pfnReplacePage, LPARAM lParam); -static const GUID CLSID_IDeskDisplayAdapter = {0x42071712,0x76d4,0x11d1,{0x8b,0x24,0x00,0xa0,0xc9,0x06,0x8f,0xf3}}; +static const GUID CLSID_IDeskDisplayAdapter = {0x42071712,0x76d4,0x11d1,{0x8b,0x24,0x00,0xa0,0xc9,0x06,0x8f,0xf9}}; ULONG __cdecl DbgPrint(PCCH Format,...); Modified: trunk/reactos/dll/win32/shellext/deskadp/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskadp…
============================================================================== --- trunk/reactos/dll/win32/shellext/deskadp/lang/en-US.rc (original) +++ trunk/reactos/dll/win32/shellext/deskadp/lang/en-US.rc Thu Sep 27 09:23:58 2007 @@ -27,7 +27,7 @@ CAPTION "List All Modes" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - DEFPUSHBUTTON "OK", IDOK, 112, 115, 50, 15, WS_DISABLED + DEFPUSHBUTTON "OK", IDOK, 112, 115, 50, 15 PUSHBUTTON "Cancel", IDCANCEL, 167, 115, 50, 15 GROUPBOX "List of valid modes", -1, 6, 7, 212, 98 LISTBOX IDC_ALLVALIDMODES, 10, 20, 204, 87, LBS_NOTIFY | WS_VSCROLL Modified: trunk/reactos/include/reactos/dll/desk/deskcplx.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/dll/desk/d…
============================================================================== --- trunk/reactos/include/reactos/dll/desk/deskcplx.h (original) +++ trunk/reactos/include/reactos/dll/desk/deskcplx.h Thu Sep 27 09:23:58 2007 @@ -12,7 +12,6 @@ #define DESK_EXT_DISPLAYSTATEFLAGS TEXT("Display State Flags") #define DESK_EXT_MONITORNAME TEXT("Monitor Name") #define DESK_EXT_MONITORDEVICE TEXT("Monitor Device") -#define DESK_EXT_MONITORID TEXT("Monitor ID") typedef PDEVMODEW (DESK_EXT_CALLBACK *PDESK_EXT_ENUMALLMODES)(PVOID Context, DWORD Index); typedef PDEVMODEW (DESK_EXT_CALLBACK *PDESK_EXT_GETCURRENTMODE)(PVOID Context); @@ -42,6 +41,8 @@ WCHAR AdapterString[128]; WCHAR BiosString[128]; } DESK_EXT_INTERFACE, *PDESK_EXT_INTERFACE; + +LONG WINAPI DisplaySaveSettings(PVOID pContext, HWND hwndPropSheet); static PDESK_EXT_INTERFACE __inline QueryDeskCplExtInterface(IDataObject *pdo) @@ -117,4 +118,32 @@ return lpStr; } +static LONG __inline +DeskCplExtDisplaySaveSettings(PDESK_EXT_INTERFACE DeskExtInterface, + HWND hwndDlg) +{ + typedef LONG (WINAPI *PDISPLAYSAVESETTINGS)(PVOID, HWND); + HMODULE hModDeskCpl; + PDISPLAYSAVESETTINGS pDisplaySaveSettings; + LONG lRet = DISP_CHANGE_BADPARAM; + + /* We could use GetModuleHandle() instead, but then this routine + wouldn't work if some other application hosts the shell extension */ + hModDeskCpl = LoadLibrary(TEXT("desk.cpl")); + if (hModDeskCpl != NULL) + { + pDisplaySaveSettings = (PDISPLAYSAVESETTINGS)GetProcAddress(hModDeskCpl, + "DisplaySaveSettings"); + if (pDisplaySaveSettings != NULL) + { + lRet = pDisplaySaveSettings(DeskExtInterface->Context, + hwndDlg); + } + + FreeLibrary(hModDeskCpl); + } + + return lRet; +} + #endif /* __DESKCPLX__H */
17 years, 2 months
1
0
0
0
[weiden] 29233: Display the display adapter properties with extended pages
by weiden@svn.reactos.org
Author: weiden Date: Thu Sep 27 07:08:45 2007 New Revision: 29233 URL:
http://svn.reactos.org/svn/reactos?rev=29233&view=rev
Log: Display the display adapter properties with extended pages Modified: trunk/reactos/dll/win32/shellext/deskadp/deskadp.c Modified: trunk/reactos/dll/win32/shellext/deskadp/deskadp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskadp…
============================================================================== --- trunk/reactos/dll/win32/shellext/deskadp/deskadp.c (original) +++ trunk/reactos/dll/win32/shellext/deskadp/deskadp.c Thu Sep 27 07:08:45 2007 @@ -5,7 +5,7 @@ static HINSTANCE hInstance; -typedef INT_PTR (WINAPI *PDEVICEPROPERTIESEXW)(HWND,LPCWSTR,LPCWSTR,DWORD,BOOL); +typedef INT_PTR (WINAPI *PDEVICEPROPERTIESW)(HWND,LPCWSTR,LPCWSTR,BOOL); static VOID GetColorDescription(PDEVMODEW lpDevMode, @@ -214,20 +214,19 @@ ShowAdapterProperties(PDESKDISPLAYADAPTER This) { HMODULE hDevMgr; - PDEVICEPROPERTIESEXW pDevicePropertiesExW; + PDEVICEPROPERTIESW pDevicePropertiesW; hDevMgr = LoadLibrary(TEXT("devmgr.dll")); if (hDevMgr != NULL) { - pDevicePropertiesExW = (PDEVICEPROPERTIESEXW)GetProcAddress(hDevMgr, - "DevicePropertiesExW"); - if (pDevicePropertiesExW != NULL) + pDevicePropertiesW = (PDEVICEPROPERTIESW)GetProcAddress(hDevMgr, + "DevicePropertiesW"); + if (pDevicePropertiesW != NULL) { - pDevicePropertiesExW(This->hwndDlg, - NULL, - This->lpDeviceId, - 0, - FALSE); + pDevicePropertiesW(This->hwndDlg, + NULL, + This->lpDeviceId, + FALSE); } FreeLibrary(hDevMgr);
17 years, 2 months
1
0
0
0
[weiden] 29232: Fix implementation of DevicePropertiesA/W to show extended pages
by weiden@svn.reactos.org
Author: weiden Date: Thu Sep 27 07:04:52 2007 New Revision: 29232 URL:
http://svn.reactos.org/svn/reactos?rev=29232&view=rev
Log: Fix implementation of DevicePropertiesA/W to show extended pages Modified: trunk/reactos/dll/win32/devmgr/advprop.c trunk/reactos/include/reactos/dll/devmgr/devmgr.h Modified: trunk/reactos/dll/win32/devmgr/advprop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/advprop.c…
============================================================================== --- trunk/reactos/dll/win32/devmgr/advprop.c (original) +++ trunk/reactos/dll/win32/devmgr/advprop.c Thu Sep 27 07:04:52 2007 @@ -1813,10 +1813,10 @@ { INT_PTR Ret = -1; - if (dwFlags & ~(DPF_UNKNOWN | DPF_DEVICE_STATUS_ACTION)) + if (dwFlags & ~(DPF_EXTENDED | DPF_DEVICE_STATUS_ACTION)) { DPRINT1("DevPropertiesExW: Invalid flags: 0x%x\n", - dwFlags & ~(DPF_UNKNOWN | DPF_DEVICE_STATUS_ACTION)); + dwFlags & ~(DPF_EXTENDED | DPF_DEVICE_STATUS_ACTION)); SetLastError(ERROR_INVALID_FLAGS); return -1; } @@ -1907,7 +1907,7 @@ return DevicePropertiesExA(hWndParent, lpMachineName, lpDeviceID, - 0, + DPF_EXTENDED, bShowDevMgr); } @@ -1944,7 +1944,7 @@ return DevicePropertiesExW(hWndParent, lpMachineName, lpDeviceID, - 0, + DPF_EXTENDED, bShowDevMgr); } Modified: trunk/reactos/include/reactos/dll/devmgr/devmgr.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/dll/devmgr…
============================================================================== --- trunk/reactos/include/reactos/dll/devmgr/devmgr.h (original) +++ trunk/reactos/include/reactos/dll/devmgr/devmgr.h Thu Sep 27 07:04:52 2007 @@ -137,7 +137,7 @@ IN UINT uNumberOfGuids, IN HWPAGE_DISPLAYMODE DisplayMode); -#define DPF_UNKNOWN (0x1) +#define DPF_EXTENDED (0x1) #define DPF_DEVICE_STATUS_ACTION (0x2) INT_PTR
17 years, 2 months
1
0
0
0
[weiden] 29231: Implement DevicePropertiesA/W by calling DevicePropertiesExA/W and move function prototypes to a private header
by weiden@svn.reactos.org
Author: weiden Date: Thu Sep 27 06:49:31 2007 New Revision: 29231 URL:
http://svn.reactos.org/svn/reactos?rev=29231&view=rev
Log: Implement DevicePropertiesA/W by calling DevicePropertiesExA/W and move function prototypes to a private header Added: trunk/reactos/include/reactos/dll/devmgr/ trunk/reactos/include/reactos/dll/devmgr/devmgr.h (with props) Modified: trunk/reactos/dll/win32/devmgr/advprop.c trunk/reactos/dll/win32/devmgr/devmgr.spec trunk/reactos/dll/win32/devmgr/precomp.h trunk/reactos/dll/win32/devmgr/stubs.c Modified: trunk/reactos/dll/win32/devmgr/advprop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/advprop.c…
============================================================================== --- trunk/reactos/dll/win32/devmgr/advprop.c (original) +++ trunk/reactos/dll/win32/devmgr/advprop.c Thu Sep 27 06:49:31 2007 @@ -1877,6 +1877,80 @@ /*************************************************************************** * NAME EXPORTED + * DevicePropertiesA + * + * DESCRIPTION + * Invokes the device properties dialog directly + * + * ARGUMENTS + * hWndParent: Handle to the parent window + * lpMachineName: Machine Name, NULL is the local machine + * lpDeviceID: Specifies the device whose properties are to be shown + * bShowDevMgr: If non-zero it displays the device manager instead of + * the device property dialog + * + * RETURN VALUE + * >=0: if no errors occured + * -1: if errors occured + * + * REVISIONS + * + * @implemented + */ +int +WINAPI +DevicePropertiesA(HWND hWndParent, + LPCSTR lpMachineName, + LPCSTR lpDeviceID, + BOOL bShowDevMgr) +{ + return DevicePropertiesExA(hWndParent, + lpMachineName, + lpDeviceID, + 0, + bShowDevMgr); +} + + +/*************************************************************************** + * NAME EXPORTED + * DevicePropertiesW + * + * DESCRIPTION + * Invokes the device properties dialog directly + * + * ARGUMENTS + * hWndParent: Handle to the parent window + * lpMachineName: Machine Name, NULL is the local machine + * lpDeviceID: Specifies the device whose properties are to be shown + * bShowDevMgr: If non-zero it displays the device manager instead of + * the device property dialog + * + * RETURN VALUE + * >=0: if no errors occured + * -1: if errors occured + * + * REVISIONS + * + * @implemented + */ +int +WINAPI +DevicePropertiesW(HWND hWndParent, + LPCWSTR lpMachineName, + LPCWSTR lpDeviceID, + BOOL bShowDevMgr) +{ + return DevicePropertiesExW(hWndParent, + lpMachineName, + lpDeviceID, + 0, + bShowDevMgr); +} + + +/*************************************************************************** + * NAME EXPORTED * DeviceProperties_RunDLLA * * DESCRIPTION @@ -1975,8 +2049,7 @@ } DevicePropertiesW(hWndParent, - hInst, szMachineName, szDeviceID, - 0); + FALSE); } Modified: trunk/reactos/dll/win32/devmgr/devmgr.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/devmgr.sp…
============================================================================== --- trunk/reactos/dll/win32/devmgr/devmgr.spec (original) +++ trunk/reactos/dll/win32/devmgr/devmgr.spec Thu Sep 27 06:49:31 2007 @@ -2,8 +2,8 @@ 5 stdcall DeviceProperties_RunDLLA(ptr ptr str long) 6 stdcall DeviceProperties_RunDLLW(ptr ptr wstr long) - 7 stdcall DevicePropertiesA(ptr ptr str str long) - 8 stdcall DevicePropertiesW(ptr ptr wstr wstr long) + 7 stdcall DevicePropertiesA(ptr str str long) + 8 stdcall DevicePropertiesW(ptr wstr wstr long) 9 stdcall DeviceManager_ExecuteA(ptr ptr str long) 10 stdcall DeviceManager_ExecuteW(ptr ptr wstr long) 11 stdcall DeviceProblemTextA(ptr long long str long) Modified: trunk/reactos/dll/win32/devmgr/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/precomp.h…
============================================================================== --- trunk/reactos/dll/win32/devmgr/precomp.h (original) +++ trunk/reactos/dll/win32/devmgr/precomp.h Thu Sep 27 06:49:31 2007 @@ -6,189 +6,12 @@ #include <setupapi.h> #include <cfgmgr32.h> #include <commctrl.h> +#include <dll/devmgr/devmgr.h> #include "resource.h" extern HINSTANCE hDllInstance; ULONG DbgPrint(PCCH Format,...); - -BOOL -WINAPI -DeviceManager_ExecuteA(HWND hWndParent, - HINSTANCE hInst, - LPCSTR lpMachineName, - int nCmdShow); - -BOOL -WINAPI -DeviceManager_ExecuteW(HWND hWndParent, - HINSTANCE hInst, - LPCWSTR lpMachineName, - int nCmdShow); - -VOID -WINAPI -DeviceProperties_RunDLLA(HWND hWndParent, - HINSTANCE hInst, - LPCSTR lpDeviceCmd, - int nCmdShow); - -VOID -WINAPI -DeviceProperties_RunDLLW(HWND hWndParent, - HINSTANCE hInst, - LPCWSTR lpDeviceCmd, - int nCmdShow); - -int -WINAPI -DevicePropertiesA(HWND hWndParent, - HINSTANCE hInst, - LPCSTR lpMachineName, - LPCSTR lpDeviceID, - DWORD Unknown); - -int -WINAPI -DevicePropertiesW(HWND hWndParent, - HINSTANCE hInst, - LPCWSTR lpMachineName, - LPCWSTR lpDeviceID, - DWORD Unknown); - -UINT -WINAPI -DeviceProblemTextA(IN HMACHINE hMachine OPTIONAL, - IN DEVINST dnDevInst, - IN ULONG uProblemId, - OUT LPSTR lpString, - IN UINT uMaxString); - -UINT -WINAPI -DeviceProblemTextW(IN HMACHINE hMachine OPTIONAL, - IN DEVINST dnDevInst, - IN ULONG uProblemId, - OUT LPWSTR lpString, - IN UINT uMaxString); - -BOOL -WINAPI -DeviceProblemWizardA(IN HWND hWndParent OPTIONAL, - IN LPCSTR lpMachineName OPTIONAL, - IN LPCSTR lpDeviceID); - - -BOOL -WINAPI -DeviceProblemWizardW(IN HWND hWndParent OPTIONAL, - IN LPCWSTR lpMachineName OPTIONAL, - IN LPCWSTR lpDeviceID); - -VOID -WINAPI -DeviceProblemWizard_RunDLLA(HWND hWndParent, - HINSTANCE hInst, - LPCSTR lpDeviceCmd, - int nCmdShow); - -VOID -WINAPI -DeviceProblemWizard_RunDLLW(HWND hWndParent, - HINSTANCE hInst, - LPCWSTR lpDeviceCmd, - int nCmdShow); - -#define DEV_PRINT_ABSTRACT (0) -#define DEV_PRINT_SELECTED (1) -#define DEV_PRINT_ALL (2) - -BOOL -WINAPI -DeviceManagerPrintA(LPCSTR lpMachineName, - LPCSTR lpPrinter, - int nPrintMode, - UINT uNumberOfGuids, - LPGUID lpGuids); - -BOOL -WINAPI -DeviceManagerPrintW(LPCWSTR lpMachineName, - LPCWSTR lpPrinter, - int nPrintMode, - UINT uNumberOfGuids, - LPGUID lpGuids); - -INT_PTR -WINAPI -DeviceAdvancedPropertiesA(IN HWND hWndParent OPTIONAL, - IN LPCSTR lpMachineName OPTIONAL, - IN LPCSTR lpDeviceID); - -INT_PTR -WINAPI -DeviceAdvancedPropertiesW(IN HWND hWndParent OPTIONAL, - IN LPCWSTR lpMachineName OPTIONAL, - IN LPCWSTR lpDeviceID); - -typedef enum -{ - HWPD_STANDARDLIST = 0, - HWPD_LARGELIST, - HWPD_MAX = HWPD_LARGELIST -} HWPAGE_DISPLAYMODE, *PHWPAGE_DISPLAYMODE; - -HWND -WINAPI -DeviceCreateHardwarePage(HWND hWndParent, - LPGUID lpGuid); - -HWND -WINAPI -DeviceCreateHardwarePageEx(IN HWND hWndParent, - IN LPGUID lpGuids, - IN UINT uNumberOfGuids, - IN HWPAGE_DISPLAYMODE DisplayMode); - -#define DPF_UNKNOWN (0x1) -#define DPF_DEVICE_STATUS_ACTION (0x2) -INT_PTR -WINAPI -DevicePropertiesExA(IN HWND hWndParent OPTIONAL, - IN LPCSTR lpMachineName OPTIONAL, - IN LPCSTR lpDeviceID OPTIONAL, - IN DWORD dwFlags OPTIONAL, - IN BOOL bShowDevMgr); - -INT_PTR -WINAPI -DevicePropertiesExW(IN HWND hWndParent OPTIONAL, - IN LPCWSTR lpMachineName OPTIONAL, - IN LPCWSTR lpDeviceID OPTIONAL, - IN DWORD dwFlags OPTIONAL, - IN BOOL bShowDevMgr); - -#ifdef UNICODE -#define DeviceManager_Execute DeviceManager_ExecuteW -#define DeviceProperties_RunDLL DeviceProperties_RunDLLW -#define DeviceProperties DevicePropertiesW -#define DeviceProblemText DeviceProblemTextW -#define DeviceProblemWizard DeviceProblemWizardW -#define DeviceProblemWizard_RunDLL DeviceProblemWizard_RunDLLW -#define DeviceManagerPrint DeviceManagerPrintW -#define DeviceAdvancedProperties DeviceAdvancedPropertiesW -#define DevicePropertiesEx DevicePropertiesExW -#else -#define DeviceManager_Execute DeviceManager_ExecuteA -#define DeviceProperties_RunDLL DeviceProperties_RunDLLA -#define DeviceProperties DevicePropertiesA -#define DeviceProblemText DeviceProblemTextA -#define DeviceProblemWizard DeviceProblemWizardA -#define DeviceProblemWizard_RunDLL DeviceProblemWizard_RunDLLA -#define DeviceManagerPrint DeviceManagerPrintA -#define DeviceAdvancedProperties DeviceAdvancedPropertiesA -#define DevicePropertiesEx DevicePropertiesExA -#endif /* ADVPROP.C */ Modified: trunk/reactos/dll/win32/devmgr/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/stubs.c?r…
============================================================================== --- trunk/reactos/dll/win32/devmgr/stubs.c (original) +++ trunk/reactos/dll/win32/devmgr/stubs.c Thu Sep 27 06:49:31 2007 @@ -91,82 +91,6 @@ { UNIMPLEMENTED; return FALSE; -} - - -/*************************************************************************** - * NAME EXPORTED - * DevicePropertiesA - * - * DESCRIPTION - * Invokes the device properties dialog directly - * - * ARGUMENTS - * hWndParent: Handle to the parent window - * hInst: Handle to the application instance - * lpMachineName: Machine Name, NULL is the local machine - * lpDeviceID: Specifies the device whose properties are to be shown - * Unknown: Unknown parameter, see NOTEs - * - * RETURN VALUE - * >=0: if no errors occured - * -1: if errors occured - * - * REVISIONS - * - * NOTE - * Unknown seems to be a BOOL, not sure what it does - * - * @unimplemented - */ -int -WINAPI -DevicePropertiesA(HWND hWndParent, - HINSTANCE hInst, - LPCSTR lpMachineName, - LPCSTR lpDeviceID, - DWORD Unknown) -{ - UNIMPLEMENTED; - return -1; -} - - -/*************************************************************************** - * NAME EXPORTED - * DevicePropertiesW - * - * DESCRIPTION - * Invokes the device properties dialog directly - * - * ARGUMENTS - * hWndParent: Handle to the parent window - * hInst: Handle to the application instance - * lpMachineName: Machine Name, NULL is the local machine - * lpDeviceID: Specifies the device whose properties are to be shown - * Unknown: Unknown parameter, see NOTEs - * - * RETURN VALUE - * >=0: if no errors occured - * -1: if errors occured - * - * REVISIONS - * - * NOTE - * Unknown seems to be a BOOL, not sure what it does - * - * @unimplemented - */ -int -WINAPI -DevicePropertiesW(HWND hWndParent, - HINSTANCE hInst, - LPCWSTR lpMachineName, - LPCWSTR lpDeviceID, - DWORD Unknown) -{ - UNIMPLEMENTED; - return -1; } Added: trunk/reactos/include/reactos/dll/devmgr/devmgr.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/dll/devmgr…
============================================================================== --- trunk/reactos/include/reactos/dll/devmgr/devmgr.h (added) +++ trunk/reactos/include/reactos/dll/devmgr/devmgr.h Thu Sep 27 06:49:31 2007 @@ -1,0 +1,181 @@ +#ifndef __DEVMGR__H +#define __DEVMGR__H + +BOOL +WINAPI +DeviceManager_ExecuteA(HWND hWndParent, + HINSTANCE hInst, + LPCSTR lpMachineName, + int nCmdShow); + +BOOL +WINAPI +DeviceManager_ExecuteW(HWND hWndParent, + HINSTANCE hInst, + LPCWSTR lpMachineName, + int nCmdShow); + +VOID +WINAPI +DeviceProperties_RunDLLA(HWND hWndParent, + HINSTANCE hInst, + LPCSTR lpDeviceCmd, + int nCmdShow); + +VOID +WINAPI +DeviceProperties_RunDLLW(HWND hWndParent, + HINSTANCE hInst, + LPCWSTR lpDeviceCmd, + int nCmdShow); + +int +WINAPI +DevicePropertiesA(HWND hWndParent, + LPCSTR lpMachineName, + LPCSTR lpDeviceID, + BOOL bShowDevMgr); + +int +WINAPI +DevicePropertiesW(HWND hWndParent, + LPCWSTR lpMachineName, + LPCWSTR lpDeviceID, + BOOL bShowDevMgr); + +UINT +WINAPI +DeviceProblemTextA(IN HMACHINE hMachine OPTIONAL, + IN DEVINST dnDevInst, + IN ULONG uProblemId, + OUT LPSTR lpString, + IN UINT uMaxString); + +UINT +WINAPI +DeviceProblemTextW(IN HMACHINE hMachine OPTIONAL, + IN DEVINST dnDevInst, + IN ULONG uProblemId, + OUT LPWSTR lpString, + IN UINT uMaxString); + +BOOL +WINAPI +DeviceProblemWizardA(IN HWND hWndParent OPTIONAL, + IN LPCSTR lpMachineName OPTIONAL, + IN LPCSTR lpDeviceID); + + +BOOL +WINAPI +DeviceProblemWizardW(IN HWND hWndParent OPTIONAL, + IN LPCWSTR lpMachineName OPTIONAL, + IN LPCWSTR lpDeviceID); + +VOID +WINAPI +DeviceProblemWizard_RunDLLA(HWND hWndParent, + HINSTANCE hInst, + LPCSTR lpDeviceCmd, + int nCmdShow); + +VOID +WINAPI +DeviceProblemWizard_RunDLLW(HWND hWndParent, + HINSTANCE hInst, + LPCWSTR lpDeviceCmd, + int nCmdShow); + +#define DEV_PRINT_ABSTRACT (0) +#define DEV_PRINT_SELECTED (1) +#define DEV_PRINT_ALL (2) + +BOOL +WINAPI +DeviceManagerPrintA(LPCSTR lpMachineName, + LPCSTR lpPrinter, + int nPrintMode, + UINT uNumberOfGuids, + LPGUID lpGuids); + +BOOL +WINAPI +DeviceManagerPrintW(LPCWSTR lpMachineName, + LPCWSTR lpPrinter, + int nPrintMode, + UINT uNumberOfGuids, + LPGUID lpGuids); + +INT_PTR +WINAPI +DeviceAdvancedPropertiesA(IN HWND hWndParent OPTIONAL, + IN LPCSTR lpMachineName OPTIONAL, + IN LPCSTR lpDeviceID); + +INT_PTR +WINAPI +DeviceAdvancedPropertiesW(IN HWND hWndParent OPTIONAL, + IN LPCWSTR lpMachineName OPTIONAL, + IN LPCWSTR lpDeviceID); + +typedef enum +{ + HWPD_STANDARDLIST = 0, + HWPD_LARGELIST, + HWPD_MAX = HWPD_LARGELIST +} HWPAGE_DISPLAYMODE, *PHWPAGE_DISPLAYMODE; + +HWND +WINAPI +DeviceCreateHardwarePage(HWND hWndParent, + LPGUID lpGuid); + +HWND +WINAPI +DeviceCreateHardwarePageEx(IN HWND hWndParent, + IN LPGUID lpGuids, + IN UINT uNumberOfGuids, + IN HWPAGE_DISPLAYMODE DisplayMode); + +#define DPF_UNKNOWN (0x1) +#define DPF_DEVICE_STATUS_ACTION (0x2) + +INT_PTR +WINAPI +DevicePropertiesExA(IN HWND hWndParent OPTIONAL, + IN LPCSTR lpMachineName OPTIONAL, + IN LPCSTR lpDeviceID OPTIONAL, + IN DWORD dwFlags OPTIONAL, + IN BOOL bShowDevMgr); + +INT_PTR +WINAPI +DevicePropertiesExW(IN HWND hWndParent OPTIONAL, + IN LPCWSTR lpMachineName OPTIONAL, + IN LPCWSTR lpDeviceID OPTIONAL, + IN DWORD dwFlags OPTIONAL, + IN BOOL bShowDevMgr); + +#ifdef UNICODE +#define DeviceManager_Execute DeviceManager_ExecuteW +#define DeviceProperties_RunDLL DeviceProperties_RunDLLW +#define DeviceProperties DevicePropertiesW +#define DeviceProblemText DeviceProblemTextW +#define DeviceProblemWizard DeviceProblemWizardW +#define DeviceProblemWizard_RunDLL DeviceProblemWizard_RunDLLW +#define DeviceManagerPrint DeviceManagerPrintW +#define DeviceAdvancedProperties DeviceAdvancedPropertiesW +#define DevicePropertiesEx DevicePropertiesExW +#else +#define DeviceManager_Execute DeviceManager_ExecuteA +#define DeviceProperties_RunDLL DeviceProperties_RunDLLA +#define DeviceProperties DevicePropertiesA +#define DeviceProblemText DeviceProblemTextA +#define DeviceProblemWizard DeviceProblemWizardA +#define DeviceProblemWizard_RunDLL DeviceProblemWizard_RunDLLA +#define DeviceManagerPrint DeviceManagerPrintA +#define DeviceAdvancedProperties DeviceAdvancedPropertiesA +#define DevicePropertiesEx DevicePropertiesExA +#endif + +#endif /* __DEVMGR__H */ Propchange: trunk/reactos/include/reactos/dll/devmgr/devmgr.h ------------------------------------------------------------------------------ svn:eol-style = native
17 years, 2 months
1
0
0
0
← Newer
1
...
6
7
8
9
10
11
12
...
59
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
Results per page:
10
25
50
100
200