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
May 2006
----- 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
377 discussions
Start a n
N
ew thread
[sedwards] 22056: sync ntdll tests to 0.9.14
by sedwards@svn.reactos.org
Author: sedwards Date: Fri May 26 21:54:55 2006 New Revision: 22056 URL:
http://svn.reactos.ru/svn/reactos?rev=22056&view=rev
Log: sync ntdll tests to 0.9.14 Added: trunk/reactos/regtests/winetests/ntdll/change.c trunk/reactos/regtests/winetests/ntdll/exception.c trunk/reactos/regtests/winetests/ntdll/port.c Modified: trunk/reactos/regtests/winetests/ntdll/atom.c trunk/reactos/regtests/winetests/ntdll/env.c trunk/reactos/regtests/winetests/ntdll/error.c trunk/reactos/regtests/winetests/ntdll/info.c trunk/reactos/regtests/winetests/ntdll/large_int.c trunk/reactos/regtests/winetests/ntdll/ntdll.rbuild trunk/reactos/regtests/winetests/ntdll/om.c trunk/reactos/regtests/winetests/ntdll/path.c trunk/reactos/regtests/winetests/ntdll/reg.c trunk/reactos/regtests/winetests/ntdll/rtl.c trunk/reactos/regtests/winetests/ntdll/rtlbitmap.c trunk/reactos/regtests/winetests/ntdll/rtlstr.c trunk/reactos/regtests/winetests/ntdll/string.c trunk/reactos/regtests/winetests/ntdll/testlist.c trunk/reactos/regtests/winetests/ntdll/time.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/regtests/winetests/ntdll/atom.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/at…
Added: trunk/reactos/regtests/winetests/ntdll/change.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/ch…
Modified: trunk/reactos/regtests/winetests/ntdll/env.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/en…
Modified: trunk/reactos/regtests/winetests/ntdll/error.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/er…
Added: trunk/reactos/regtests/winetests/ntdll/exception.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/ex…
Modified: trunk/reactos/regtests/winetests/ntdll/info.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/in…
Modified: trunk/reactos/regtests/winetests/ntdll/large_int.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/la…
Modified: trunk/reactos/regtests/winetests/ntdll/ntdll.rbuild URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/nt…
Modified: trunk/reactos/regtests/winetests/ntdll/om.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/om…
Modified: trunk/reactos/regtests/winetests/ntdll/path.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/pa…
Added: trunk/reactos/regtests/winetests/ntdll/port.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/po…
Modified: trunk/reactos/regtests/winetests/ntdll/reg.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/re…
Modified: trunk/reactos/regtests/winetests/ntdll/rtl.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/rt…
Modified: trunk/reactos/regtests/winetests/ntdll/rtlbitmap.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/rt…
Modified: trunk/reactos/regtests/winetests/ntdll/rtlstr.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/rt…
Modified: trunk/reactos/regtests/winetests/ntdll/string.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/st…
Modified: trunk/reactos/regtests/winetests/ntdll/testlist.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/te…
Modified: trunk/reactos/regtests/winetests/ntdll/time.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/ti…
18 years, 7 months
1
0
0
0
[sedwards] 22055: remove another dud, sync psapi test to 0.9.14
by sedwards@svn.reactos.org
Author: sedwards Date: Fri May 26 21:35:11 2006 New Revision: 22055 URL:
http://svn.reactos.ru/svn/reactos?rev=22055&view=rev
Log: remove another dud, sync psapi test to 0.9.14 Added: trunk/reactos/regtests/winetests/psapi/psapi_main.c Removed: trunk/reactos/regtests/winetests/foo trunk/reactos/regtests/winetests/psapi/module.c Modified: trunk/reactos/regtests/winetests/psapi/psapi.rbuild trunk/reactos/regtests/winetests/psapi/testlist.c Removed: trunk/reactos/regtests/winetests/foo URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/foo?rev=…
============================================================================== --- trunk/reactos/regtests/winetests/foo (original) +++ trunk/reactos/regtests/winetests/foo (removed) @@ -1,49 +1,0 @@ -cp ~/wine/source/dlls/dnsapi -cp ~/wine/source/dlls/wininet -cp ~/wine/source/dlls/dsound -cp ~/wine/source/dlls/msi -cp ~/wine/source/dlls/version -cp ~/wine/source/dlls/winspool -cp ~/wine/source/dlls/msacm32 -cp ~/wine/source/dlls/oleaut32 -cp ~/wine/source/dlls/ntdll -cp ~/wine/source/dlls/ws2_32 -cp ~/wine/source/dlls/msvcrtd -cp ~/wine/source/dlls/psapi -cp ~/wine/source/dlls/mlang -cp ~/wine/source/dlls/netapi32 -cp ~/wine/source/dlls/quartz -cp ~/wine/source/dlls/gdi -cp ~/wine/source/dlls/shdocvw -cp ~/wine/source/dlls/advapi32 -cp ~/wine/source/dlls/d3d8 -cp ~/wine/source/dlls/winmm -cp ~/wine/source/dlls/dinput -cp ~/wine/source/dlls/setupapi -cp ~/wine/source/dlls/usp10 -cp ~/wine/source/dlls/rsabase -cp ~/wine/source/dlls/lz32 -cp ~/wine/source/dlls/msxml3 -cp ~/wine/source/dlls/rpcrt4 -cp ~/wine/source/dlls/ole32 -cp ~/wine/source/dlls/mapi32 -cp ~/wine/source/dlls/iphlpapi -cp ~/wine/source/dlls/advpack -cp ~/wine/source/dlls/mscms -cp ~/wine/source/dlls/comctl32 -cp ~/wine/source/dlls/mshtml -cp ~/wine/source/dlls/rsaenh -cp ~/wine/source/dlls/kernel -cp ~/wine/source/dlls/d3d9 -cp ~/wine/source/dlls/shell32 -cp ~/wine/source/dlls/urlmon -cp ~/wine/source/dlls/cabinet -cp ~/wine/source/dlls/msvcrt -cp ~/wine/source/dlls/winspool.drv -cp ~/wine/source/dlls/ddraw -cp ~/wine/source/dlls/shlwapi -cp ~/wine/source/dlls/secur32 -cp ~/wine/source/dlls/user -cp ~/wine/source/dlls/riched20 -cp ~/wine/source/dlls/crypt32 - Removed: trunk/reactos/regtests/winetests/psapi/module.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/psapi/mo…
============================================================================== --- trunk/reactos/regtests/winetests/psapi/module.c (original) +++ trunk/reactos/regtests/winetests/psapi/module.c (removed) @@ -1,161 +1,0 @@ -/* - * Copyright (C) 2004 Stefan Leichter - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <stdarg.h> - -#include "wine/test.h" -#include "windef.h" -#include "winbase.h" -#include "winerror.h" -#include "wingdi.h" -#include "psapi.h" - -/* Function ptrs */ -static HMODULE dll; -static DWORD (WINAPI *pGetModuleBaseNameA)(HANDLE, HANDLE, LPSTR, DWORD); - -static void test_module_base_name(void) -{ DWORD retval; - char buffer[MAX_PATH]; - HMODULE self, modself; - DWORD exact; - - if (!pGetModuleBaseNameA) return; - - self = OpenProcess( PROCESS_QUERY_INFORMATION|PROCESS_VM_READ, - FALSE, GetCurrentProcessId()); - if (!self) { - ok(0, "OpenProcess() failed\n"); - return; - } - modself = GetModuleHandle(NULL); - if (!modself) { - ok(0, "GetModuleHandle() failed\n"); - return; - } - exact = pGetModuleBaseNameA( self, modself, buffer, MAX_PATH); - if (!exact) { - ok(0, "GetModuleBaseNameA failed unexpected with error 0x%08lx\n", - GetLastError()); - return; - } - - SetLastError(ERROR_SUCCESS); - retval = pGetModuleBaseNameA( NULL, NULL, NULL, 0); - ok(!retval, "function result wrong, got %ld expected 0\n", retval); - ok( ERROR_INVALID_PARAMETER == GetLastError() || - ERROR_INVALID_HANDLE == GetLastError(), - "last error wrong, got %ld expected ERROR_INVALID_PARAMETER/" - "ERROR_INVALID_HANDLE (98)\n", GetLastError()); - - SetLastError(ERROR_SUCCESS); - retval = pGetModuleBaseNameA( NULL, NULL, NULL, MAX_PATH); - ok(!retval, "function result wrong, got %ld expected 0\n", retval); - ok( ERROR_INVALID_PARAMETER == GetLastError() || - ERROR_INVALID_HANDLE == GetLastError(), - "last error wrong, got %ld expected ERROR_INVALID_PARAMETER/" - "ERROR_INVALID_HANDLE (98)\n", GetLastError()); - - SetLastError(ERROR_SUCCESS); - retval = pGetModuleBaseNameA( NULL, NULL, buffer, 0); - ok(!retval, "function result wrong, got %ld expected 0\n", retval); - ok( ERROR_INVALID_PARAMETER == GetLastError() || - ERROR_INVALID_HANDLE == GetLastError(), - "last error wrong, got %ld expected ERROR_INVALID_PARAMETER/" - "ERROR_INVALID_HANDLE (98)\n", GetLastError()); - - memset(buffer, 0, sizeof(buffer)); - SetLastError(ERROR_SUCCESS); - retval = pGetModuleBaseNameA( NULL, NULL, buffer, 1); - ok(!retval, "function result wrong, got %ld expected 0\n", retval); - ok(ERROR_INVALID_HANDLE == GetLastError(), - "last error wrong, got %ld expected ERROR_INVALID_HANDLE\n", - GetLastError()); - - memset(buffer, 0, sizeof(buffer)); - SetLastError(ERROR_SUCCESS); - retval = pGetModuleBaseNameA( self, NULL, buffer, 1); - ok(!retval || retval == 1, - "function result wrong, got %ld expected 0 (98)/1\n", retval); -#ifndef __REACTOS__ - ok((retval && ERROR_SUCCESS == GetLastError()) || - (!retval && ERROR_MOD_NOT_FOUND == GetLastError()), - "last error wrong, got %ld expected ERROR_SUCCESS/" - "ERROR_MOD_NOT_FOUND (98)\n", GetLastError()); -#endif - ok(1 == strlen(buffer) || !strlen(buffer), - "buffer content length wrong, got %d(%s) expected 0 (98,XP)/1\n", - strlen(buffer), buffer); - - memset(buffer, 0, sizeof(buffer)); - SetLastError(ERROR_SUCCESS); - retval = pGetModuleBaseNameA( self, modself, buffer, 1); -#ifndef __REACTOS__ - ok(retval == 1, "function result wrong, got %ld expected 1\n", retval); -#endif - ok(ERROR_SUCCESS == GetLastError(), - "last error wrong, got %ld expected ERROR_SUCCESS\n", - GetLastError()); - ok((!strlen(buffer)) || (1 == strlen(buffer)), - "buffer content length wrong, got %d(%s) expected 0 (XP)/1\n", - strlen(buffer), buffer); - - SetLastError(ERROR_SUCCESS); - memset(buffer, 0, sizeof(buffer)); - retval = pGetModuleBaseNameA( self, NULL, buffer, exact); - ok( !retval || retval == exact, - "function result wrong, got %ld expected 0 (98)/%ld\n", retval, exact); -#ifndef __REACTOS__ - ok( (retval && ERROR_SUCCESS == GetLastError()) || - (!retval && ERROR_MOD_NOT_FOUND == GetLastError()), - "last error wrong, got %ld expected ERROR_SUCCESS/" - "ERROR_MOD_NOT_FOUND (98)\n", GetLastError()); -#endif - ok((retval && (exact == strlen(buffer) || exact -1 == strlen(buffer))) || - (!retval && !strlen(buffer)), - "buffer content length wrong, got %d(%s) expected 0(98)/%ld(XP)/%ld\n", - strlen(buffer), buffer, exact -1, exact); - - SetLastError(ERROR_SUCCESS); - memset(buffer, 0, sizeof(buffer)); - retval = pGetModuleBaseNameA( self, modself, buffer, exact); - ok(retval == exact || retval == exact -1, - "function result wrong, got %ld expected %ld(98)/%ld\n", - retval, exact -1, exact); - ok(ERROR_SUCCESS == GetLastError(), - "last error wrong, got %ld expected ERROR_SUCCESS\n", - GetLastError()); - ok(exact == strlen(buffer) || exact -1 == strlen(buffer), - "buffer content length wrong, got %d(%s) expected %ld(98,XP)/%ld\n", - strlen(buffer), buffer, exact -1, exact); -} - -START_TEST(module) -{ - dll = LoadLibrary("psapi.dll"); - if (!dll) { - trace("LoadLibraryA(psapi.dll) failed: skipping tests with target module\n"); - return; - } - - pGetModuleBaseNameA = (void*) GetProcAddress(dll, "GetModuleBaseNameA"); - - test_module_base_name(); - - FreeLibrary(dll); -} Modified: trunk/reactos/regtests/winetests/psapi/psapi.rbuild URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/psapi/ps…
============================================================================== --- trunk/reactos/regtests/winetests/psapi/psapi.rbuild (original) +++ trunk/reactos/regtests/winetests/psapi/psapi.rbuild Fri May 26 21:35:11 2006 @@ -4,5 +4,5 @@ <library>ntdll</library> <library>psapi</library> <file>testlist.c</file> - <file>module.c</file> + <file>psapi_main.c</file> </module> Added: trunk/reactos/regtests/winetests/psapi/psapi_main.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/psapi/ps…
============================================================================== --- trunk/reactos/regtests/winetests/psapi/psapi_main.c (added) +++ trunk/reactos/regtests/winetests/psapi/psapi_main.c Fri May 26 21:35:11 2006 @@ -1,0 +1,325 @@ +/* + * Unit test suite for PSAPI + * + * Copyright (C) 2005 Felix Nawothnig + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> +#include <stdio.h> + +#include "wine/test.h" +#include "windows.h" +#include "psapi.h" + +#define PSAPI_GET_PROC(func) \ + p ## func = (void*)GetProcAddress(hpsapi, #func); \ + if(!p ## func) { \ + ok(0, "GetProcAddress(%s) failed\n", #func); \ + FreeLibrary(hpsapi); \ + return FALSE; \ + } + +/* All PSAPI functions return non-zero and call SetLastError() + * on failure so we can use some macros for convenience */ + +#define w32_suc(x) \ + (SetLastError(0xdeadbeef), \ + (x) \ + ? (ok(1, "succeeded\n"), 1) \ + : GetLastError() == 0xdeadbeef \ + ? (ok(0, "failed without error code\n"), 0) \ + : (ok(0, "failed with %ld\n", GetLastError()), 0)) + +#define w32_err(x, e) \ + (SetLastError(0xdeadbeef), \ + (x) \ + ? (ok(0, "expected error=%d but succeeded\n", e), 0) \ + : GetLastError() == e \ + ? (ok(1, "failed with %d\n", e), 1) \ + : GetLastError() == 0xdeadbeef \ + ? (ok(0, "failed without error code\n"), 0) \ + : (ok(0, "expected error=%d but failed with %ld\n", \ + e, GetLastError()), 0)) + +static BOOL (WINAPI *pEmptyWorkingSet)(HANDLE); +static BOOL (WINAPI *pEnumProcesses)(DWORD*, DWORD, DWORD*); +static BOOL (WINAPI *pEnumProcessModules)(HANDLE, HMODULE*, DWORD, LPDWORD); +static DWORD (WINAPI *pGetModuleBaseNameA)(HANDLE, HMODULE, LPSTR, DWORD); +static DWORD (WINAPI *pGetModuleFileNameExA)(HANDLE, HMODULE, LPSTR, DWORD); +static BOOL (WINAPI *pGetModuleInformation)(HANDLE, HMODULE, LPMODULEINFO, DWORD); +static DWORD (WINAPI *pGetMappedFileNameA)(HANDLE, LPVOID, LPSTR, DWORD); +static DWORD (WINAPI *pGetProcessImageFileNameA)(HANDLE, LPSTR, DWORD); +static BOOL (WINAPI *pGetProcessMemoryInfo)(HANDLE, PPROCESS_MEMORY_COUNTERS, DWORD); +static BOOL (WINAPI *pGetWsChanges)(HANDLE, PPSAPI_WS_WATCH_INFORMATION, DWORD); +static BOOL (WINAPI *pInitializeProcessForWsWatch)(HANDLE); +static BOOL (WINAPI *pQueryWorkingSet)(HANDLE, PVOID, DWORD); + +static BOOL InitFunctionPtrs(HMODULE hpsapi) +{ + PSAPI_GET_PROC(EmptyWorkingSet); + PSAPI_GET_PROC(EnumProcessModules); + PSAPI_GET_PROC(EnumProcesses); + PSAPI_GET_PROC(GetModuleBaseNameA); + PSAPI_GET_PROC(GetModuleFileNameExA); + PSAPI_GET_PROC(GetModuleInformation); + PSAPI_GET_PROC(GetMappedFileNameA); + PSAPI_GET_PROC(GetProcessMemoryInfo); + PSAPI_GET_PROC(GetWsChanges); + PSAPI_GET_PROC(InitializeProcessForWsWatch); + PSAPI_GET_PROC(QueryWorkingSet); + /* GetProcessImageFileName is not exported on NT4 */ + pGetProcessImageFileNameA = + (void *)GetProcAddress(hpsapi, "GetProcessImageFileNameA"); + return TRUE; +} + +static HANDLE hpSR, hpQI, hpVR, hpQV, hpAA; +static const HANDLE hBad = (HANDLE)0xdeadbeef; + +static void test_EnumProcesses(void) +{ + DWORD pid, cbUsed = 0xdeadbeef; + + if(w32_suc(pEnumProcesses(NULL, 0, &cbUsed))) + ok(cbUsed == 0, "cbUsed=%ld\n", cbUsed); + if(w32_suc(pEnumProcesses(&pid, 4, &cbUsed))) + ok(cbUsed == 4, "cbUsed=%ld\n", cbUsed); +} + +static void test_EnumProcessModules(void) +{ + HMODULE hMod = GetModuleHandle(NULL); + DWORD cbNeeded = 0xdeadbeef; + + w32_err(pEnumProcessModules(NULL, NULL, 0, &cbNeeded), ERROR_INVALID_HANDLE); + w32_err(pEnumProcessModules(hpQI, NULL, 0, &cbNeeded), ERROR_ACCESS_DENIED); + w32_suc(pEnumProcessModules(hpQV, NULL, 0, &cbNeeded)); + if(!w32_suc(pEnumProcessModules(hpQV, &hMod, sizeof(HMODULE), &cbNeeded))) + return; + ok(cbNeeded / sizeof(HMODULE) >= 3 && cbNeeded / sizeof(HMODULE) <= 5 * sizeof(HMODULE), + "cbNeeded=%ld\n", cbNeeded); + ok(hMod == GetModuleHandle(NULL), + "hMod=%p GetModuleHandle(NULL)=%p\n", hMod, GetModuleHandle(NULL)); +} + +static void test_GetModuleInformation(void) +{ + HMODULE hMod = GetModuleHandle(NULL); + MODULEINFO info; + + w32_err(pGetModuleInformation(NULL, hMod, &info, sizeof(info)), ERROR_INVALID_HANDLE); + w32_err(pGetModuleInformation(hpQI, hMod, &info, sizeof(info)), ERROR_ACCESS_DENIED); + w32_err(pGetModuleInformation(hpQV, hBad, &info, sizeof(info)), ERROR_INVALID_HANDLE); + w32_err(pGetModuleInformation(hpQV, hMod, &info, sizeof(info)-1), ERROR_INSUFFICIENT_BUFFER); + if(w32_suc(pGetModuleInformation(hpQV, hMod, &info, sizeof(info)))) + ok(info.lpBaseOfDll == hMod, "lpBaseOfDll=%p hMod=%p\n", info.lpBaseOfDll, hMod); +} + +static void test_GetProcessMemoryInfo(void) +{ + PROCESS_MEMORY_COUNTERS pmc; + + w32_err(pGetProcessMemoryInfo(NULL, &pmc, sizeof(pmc)), ERROR_INVALID_HANDLE); + todo_wine w32_err(pGetProcessMemoryInfo(hpSR, &pmc, sizeof(pmc)), ERROR_ACCESS_DENIED); + w32_err(pGetProcessMemoryInfo(hpQI, &pmc, sizeof(pmc)-1), ERROR_INSUFFICIENT_BUFFER); + w32_suc(pGetProcessMemoryInfo(hpQI, &pmc, sizeof(pmc))); +} + +static void test_GetMappedFileName(void) +{ + HMODULE hMod = GetModuleHandle(NULL); + char szMapPath[MAX_PATH], szModPath[MAX_PATH], *szMapBaseName; + DWORD ret; + + w32_err(pGetMappedFileNameA(NULL, hMod, szMapPath, sizeof(szMapPath)), ERROR_INVALID_HANDLE); + w32_err(pGetMappedFileNameA(hpSR, hMod, szMapPath, sizeof(szMapPath)), ERROR_ACCESS_DENIED); + if(!w32_suc(ret = pGetMappedFileNameA(hpQI, hMod, szMapPath, sizeof(szMapPath)))) + return; + ok(ret == strlen(szMapPath), "szMapPath=\"%s\" ret=%ld\n", szMapPath, ret); + ok(szMapPath[0] == '\\', "szMapPath=\"%s\"\n", szMapPath); + szMapBaseName = strrchr(szMapPath, '\\'); /* That's close enough for us */ + if(!szMapBaseName || !*szMapBaseName) + { + ok(0, "szMapPath=\"%s\"\n", szMapPath); + return; + } + GetModuleFileNameA(NULL, szModPath, sizeof(szModPath)); + ok(!strcmp(strrchr(szModPath, '\\'), szMapBaseName), + "szModPath=\"%s\" szMapBaseName=\"%s\"\n", szModPath, szMapBaseName); +} + +static void test_GetProcessImageFileName(void) +{ + HMODULE hMod = GetModuleHandle(NULL); + char szImgPath[MAX_PATH], szMapPath[MAX_PATH]; + DWORD ret; + + if(pGetProcessImageFileNameA == NULL) + return; + + /* This function is available on WinXP+ only */ + SetLastError(0xdeadbeef); + if(!pGetProcessImageFileNameA(hpQI, szImgPath, sizeof(szImgPath))) + { + if(GetLastError() == ERROR_INVALID_FUNCTION) + trace("GetProcessImageFileName not implemented\n"); + else if(GetLastError() == 0xdeadbeef) + ok(0, "failed without error code\n"); + else + ok(0, "failed with %ld\n", GetLastError()); + + return; + } + + w32_err(pGetProcessImageFileNameA(NULL, szImgPath, sizeof(szImgPath)), ERROR_INVALID_HANDLE); + w32_err(pGetProcessImageFileNameA(hpSR, szImgPath, sizeof(szImgPath)), ERROR_ACCESS_DENIED); + w32_err(pGetProcessImageFileNameA(hpQI, szImgPath, 0), ERROR_INSUFFICIENT_BUFFER); + if(!w32_suc(ret = pGetProcessImageFileNameA(hpQI, szImgPath, sizeof(szImgPath))) || + !w32_suc(pGetMappedFileNameA(hpQV, hMod, szMapPath, sizeof(szMapPath)))) + return; + /* Windows returns 2*strlen-1 */ + ok(ret >= strlen(szImgPath), "szImgPath=\"%s\" ret=%ld\n", szImgPath, ret); + ok(!strcmp(szImgPath, szMapPath), + "szImgPath=\"%s\" szMapPath=\"%s\"\n", szImgPath, szMapPath); +} + +static void test_GetModuleFileNameEx(void) +{ + HMODULE hMod = GetModuleHandle(NULL); + char szModExPath[MAX_PATH+1], szModPath[MAX_PATH+1]; + DWORD ret; + + w32_err(pGetModuleFileNameExA(NULL, hMod, szModExPath, sizeof(szModExPath)), ERROR_INVALID_HANDLE); + w32_err(pGetModuleFileNameExA(hpQI, hMod, szModExPath, sizeof(szModExPath)), ERROR_ACCESS_DENIED); + w32_err(pGetModuleFileNameExA(hpQV, hBad, szModExPath, sizeof(szModExPath)), ERROR_INVALID_HANDLE); + if(!w32_suc(ret = pGetModuleFileNameExA(hpQV, NULL, szModExPath, sizeof(szModExPath)))) + return; + ok(ret == strlen(szModExPath), "szModExPath=\"%s\" ret=%ld\n", szModExPath, ret); + GetModuleFileNameA(NULL, szModPath, sizeof(szModPath)); + ok(!strncmp(szModExPath, szModPath, MAX_PATH), + "szModExPath=\"%s\" szModPath=\"%s\"\n", szModExPath, szModPath); +} + +static void test_GetModuleBaseName(void) +{ + HMODULE hMod = GetModuleHandle(NULL); + char szModPath[MAX_PATH], szModBaseName[MAX_PATH]; + DWORD ret; + + w32_err(pGetModuleBaseNameA(NULL, hMod, szModBaseName, sizeof(szModBaseName)), ERROR_INVALID_HANDLE); + w32_err(pGetModuleBaseNameA(hpQI, hMod, szModBaseName, sizeof(szModBaseName)), ERROR_ACCESS_DENIED); + w32_err(pGetModuleBaseNameA(hpQV, hBad, szModBaseName, sizeof(szModBaseName)), ERROR_INVALID_HANDLE); + if(!w32_suc(ret = pGetModuleBaseNameA(hpQV, NULL, szModBaseName, sizeof(szModBaseName)))) + return; + ok(ret == strlen(szModBaseName), "szModBaseName=\"%s\" ret=%ld\n", szModBaseName, ret); + GetModuleFileNameA(NULL, szModPath, sizeof(szModPath)); + ok(!strcmp(strrchr(szModPath, '\\') + 1, szModBaseName), + "szModPath=\"%s\" szModBaseName=\"%s\"\n", szModPath, szModBaseName); +} + +static void test_ws_functions(void) +{ + PSAPI_WS_WATCH_INFORMATION wswi[4096]; + ULONG_PTR pages[4096]; + char *addr; + int i; + + todo_wine w32_err(pEmptyWorkingSet(NULL), ERROR_INVALID_HANDLE); + todo_wine w32_err(pEmptyWorkingSet(hpSR), ERROR_ACCESS_DENIED); + w32_suc(pEmptyWorkingSet(hpAA)); + + todo_wine w32_err(pInitializeProcessForWsWatch(NULL), ERROR_INVALID_HANDLE); + w32_suc(pInitializeProcessForWsWatch(hpAA)); + + if(!w32_suc(addr = VirtualAlloc(NULL, 1, MEM_COMMIT, PAGE_READWRITE))) + return; + + if(!VirtualLock(addr, 1)) + { + trace("locking failed (error=%ld) - skipping test\n", GetLastError()); + goto free_page; + } + + todo_wine if(w32_suc(pQueryWorkingSet(hpQI, pages, 4096 * sizeof(ULONG_PTR)))) + { + for(i = 0; i < pages[0]; i++) + if((pages[i+1] & ~0xfffL) == (ULONG_PTR)addr) + { + ok(1, "QueryWorkingSet found our page\n"); + goto test_gwsc; + } + + ok(0, "QueryWorkingSet didn't find our page\n"); + } + +test_gwsc: + todo_wine if(w32_suc(pGetWsChanges(hpQI, wswi, sizeof(wswi)))) + { + for(i = 0; wswi[i].FaultingVa; i++) + if(((ULONG_PTR)wswi[i].FaultingVa & ~0xfffL) == (ULONG_PTR)addr) + { + ok(1, "GetWsChanges found our page\n"); + goto free_page; + } + + ok(0, "GetWsChanges didn't find our page\n"); + } + +free_page: + VirtualFree(addr, 0, MEM_RELEASE); +} + +START_TEST(psapi_main) +{ + HMODULE hpsapi = LoadLibraryA("psapi.dll"); + + if(!hpsapi) + { + trace("Could not load psapi.dll\n"); + return; + } + + if(InitFunctionPtrs(hpsapi)) + { + DWORD pid = GetCurrentProcessId(); + + w32_suc(hpSR = OpenProcess(STANDARD_RIGHTS_REQUIRED, FALSE, pid)); + w32_suc(hpQI = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid)); + w32_suc(hpVR = OpenProcess(PROCESS_VM_READ, FALSE, pid)); + w32_suc(hpQV = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid)); + w32_suc(hpAA = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid)); + if(hpSR && hpQI && hpVR && hpQV && hpAA) + { + test_EnumProcesses(); + test_EnumProcessModules(); + test_GetModuleInformation(); + test_GetProcessMemoryInfo(); + todo_wine test_GetMappedFileName(); + todo_wine test_GetProcessImageFileName(); + test_GetModuleFileNameEx(); + test_GetModuleBaseName(); + test_ws_functions(); + } + CloseHandle(hpSR); + CloseHandle(hpQI); + CloseHandle(hpVR); + CloseHandle(hpQV); + CloseHandle(hpAA); + } + + FreeLibrary(hpsapi); +} Modified: trunk/reactos/regtests/winetests/psapi/testlist.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/psapi/te…
============================================================================== --- trunk/reactos/regtests/winetests/psapi/testlist.c (original) +++ trunk/reactos/regtests/winetests/psapi/testlist.c Fri May 26 21:35:11 2006 @@ -10,6 +10,6 @@ const struct test winetest_testlist[] = { -// { "psapi_main", func_psapi_main }, + { "psapi_main", func_psapi_main }, { 0, 0 } };
18 years, 7 months
1
0
0
0
[sedwards] 22054: sync the setupapi test to wine 0.9.14 and remove some files commited to the wrong folder
by sedwards@svn.reactos.org
Author: sedwards Date: Fri May 26 21:30:43 2006 New Revision: 22054 URL:
http://svn.reactos.ru/svn/reactos?rev=22054&view=rev
Log: sync the setupapi test to wine 0.9.14 and remove some files commited to the wrong folder Added: trunk/reactos/regtests/winetests/setupapi/parser.c trunk/reactos/regtests/winetests/setupapi/query.c Removed: trunk/reactos/regtests/winetests/alloc.c trunk/reactos/regtests/winetests/atom.c trunk/reactos/regtests/winetests/change.c trunk/reactos/regtests/winetests/codepage.c trunk/reactos/regtests/winetests/comm.c trunk/reactos/regtests/winetests/console.c trunk/reactos/regtests/winetests/directory.c trunk/reactos/regtests/winetests/drive.c trunk/reactos/regtests/winetests/environ.c trunk/reactos/regtests/winetests/file.c trunk/reactos/regtests/winetests/format_msg.c trunk/reactos/regtests/winetests/generated.c trunk/reactos/regtests/winetests/heap.c trunk/reactos/regtests/winetests/locale.c trunk/reactos/regtests/winetests/mailslot.c trunk/reactos/regtests/winetests/module.c trunk/reactos/regtests/winetests/path.c trunk/reactos/regtests/winetests/pipe.c trunk/reactos/regtests/winetests/process.c trunk/reactos/regtests/winetests/profile.c trunk/reactos/regtests/winetests/sync.c trunk/reactos/regtests/winetests/testlist.c trunk/reactos/regtests/winetests/thread.c trunk/reactos/regtests/winetests/time.c trunk/reactos/regtests/winetests/timer.c trunk/reactos/regtests/winetests/toolhelp.c trunk/reactos/regtests/winetests/virtual.c trunk/reactos/regtests/winetests/volume.c Modified: trunk/reactos/regtests/winetests/setupapi/setupapi.rbuild trunk/reactos/regtests/winetests/setupapi/stringtable.c trunk/reactos/regtests/winetests/setupapi/testlist.c [This mail would be too long, it was shortened to contain the URLs only.] Removed: trunk/reactos/regtests/winetests/alloc.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/alloc.c?…
Removed: trunk/reactos/regtests/winetests/atom.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/atom.c?r…
Removed: trunk/reactos/regtests/winetests/change.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/change.c…
Removed: trunk/reactos/regtests/winetests/codepage.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/codepage…
Removed: trunk/reactos/regtests/winetests/comm.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/comm.c?r…
Removed: trunk/reactos/regtests/winetests/console.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/console.…
Removed: trunk/reactos/regtests/winetests/directory.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/director…
Removed: trunk/reactos/regtests/winetests/drive.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/drive.c?…
Removed: trunk/reactos/regtests/winetests/environ.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/environ.…
Removed: trunk/reactos/regtests/winetests/file.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/file.c?r…
Removed: trunk/reactos/regtests/winetests/format_msg.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/format_m…
Removed: trunk/reactos/regtests/winetests/generated.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/generate…
Removed: trunk/reactos/regtests/winetests/heap.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/heap.c?r…
Removed: trunk/reactos/regtests/winetests/locale.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/locale.c…
Removed: trunk/reactos/regtests/winetests/mailslot.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/mailslot…
Removed: trunk/reactos/regtests/winetests/module.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/module.c…
Removed: trunk/reactos/regtests/winetests/path.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/path.c?r…
Removed: trunk/reactos/regtests/winetests/pipe.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/pipe.c?r…
Removed: trunk/reactos/regtests/winetests/process.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/process.…
Removed: trunk/reactos/regtests/winetests/profile.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/profile.…
Added: trunk/reactos/regtests/winetests/setupapi/parser.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/setupapi…
Added: trunk/reactos/regtests/winetests/setupapi/query.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/setupapi…
Modified: trunk/reactos/regtests/winetests/setupapi/setupapi.rbuild URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/setupapi…
Modified: trunk/reactos/regtests/winetests/setupapi/stringtable.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/setupapi…
Modified: trunk/reactos/regtests/winetests/setupapi/testlist.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/setupapi…
Removed: trunk/reactos/regtests/winetests/sync.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/sync.c?r…
Removed: trunk/reactos/regtests/winetests/testlist.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/testlist…
Removed: trunk/reactos/regtests/winetests/thread.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/thread.c…
Removed: trunk/reactos/regtests/winetests/time.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/time.c?r…
Removed: trunk/reactos/regtests/winetests/timer.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/timer.c?…
Removed: trunk/reactos/regtests/winetests/toolhelp.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/toolhelp…
Removed: trunk/reactos/regtests/winetests/virtual.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/virtual.…
Removed: trunk/reactos/regtests/winetests/volume.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/volume.c…
18 years, 7 months
1
0
0
0
[sedwards] 22053: update the winetest framework to 0.9.14 and sync some tests. Untested on ReactOS but at least it builds. More tests will come later. Fsck subversion
by sedwards@svn.reactos.org
Author: sedwards Date: Fri May 26 20:20:53 2006 New Revision: 22053 URL:
http://svn.reactos.ru/svn/reactos?rev=22053&view=rev
Log: update the winetest framework to 0.9.14 and sync some tests. Untested on ReactOS but at least it builds. More tests will come later. Fsck subversion Added: trunk/reactos/regtests/winetests/alloc.c trunk/reactos/regtests/winetests/atom.c trunk/reactos/regtests/winetests/change.c trunk/reactos/regtests/winetests/codepage.c trunk/reactos/regtests/winetests/comm.c trunk/reactos/regtests/winetests/console.c trunk/reactos/regtests/winetests/directory.c trunk/reactos/regtests/winetests/drive.c trunk/reactos/regtests/winetests/environ.c trunk/reactos/regtests/winetests/file.c trunk/reactos/regtests/winetests/foo trunk/reactos/regtests/winetests/format_msg.c trunk/reactos/regtests/winetests/generated.c trunk/reactos/regtests/winetests/heap.c trunk/reactos/regtests/winetests/locale.c trunk/reactos/regtests/winetests/mailslot.c trunk/reactos/regtests/winetests/module.c trunk/reactos/regtests/winetests/path.c trunk/reactos/regtests/winetests/pipe.c trunk/reactos/regtests/winetests/process.c trunk/reactos/regtests/winetests/profile.c trunk/reactos/regtests/winetests/sync.c trunk/reactos/regtests/winetests/testlist.c trunk/reactos/regtests/winetests/thread.c trunk/reactos/regtests/winetests/time.c trunk/reactos/regtests/winetests/timer.c trunk/reactos/regtests/winetests/toolhelp.c trunk/reactos/regtests/winetests/virtual.c trunk/reactos/regtests/winetests/volume.c Modified: trunk/reactos/include/reactos/wine/test.h trunk/reactos/regtests/winetests/advapi32/testlist.c trunk/reactos/regtests/winetests/comctl32/testlist.c trunk/reactos/regtests/winetests/gdi32/testlist.c trunk/reactos/regtests/winetests/kernel32/testlist.c trunk/reactos/regtests/winetests/msvcrt/testlist.c trunk/reactos/regtests/winetests/ntdll/testlist.c trunk/reactos/regtests/winetests/psapi/testlist.c trunk/reactos/regtests/winetests/setupapi/testlist.c trunk/reactos/regtests/winetests/shell32/testlist.c trunk/reactos/regtests/winetests/shlwapi/testlist.c trunk/reactos/regtests/winetests/user32/clipboard.c trunk/reactos/regtests/winetests/user32/dde.c trunk/reactos/regtests/winetests/user32/dialog.c trunk/reactos/regtests/winetests/user32/input.c trunk/reactos/regtests/winetests/user32/msg.c trunk/reactos/regtests/winetests/user32/testlist.c trunk/reactos/regtests/winetests/user32/wsprintf.c trunk/reactos/regtests/winetests/version/testlist.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/include/reactos/wine/test.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/include/reactos/wine/test.h…
Modified: trunk/reactos/regtests/winetests/advapi32/testlist.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/advapi32…
Added: trunk/reactos/regtests/winetests/alloc.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/alloc.c?…
Added: trunk/reactos/regtests/winetests/atom.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/atom.c?r…
Added: trunk/reactos/regtests/winetests/change.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/change.c…
Added: trunk/reactos/regtests/winetests/codepage.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/codepage…
Modified: trunk/reactos/regtests/winetests/comctl32/testlist.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/comctl32…
Added: trunk/reactos/regtests/winetests/comm.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/comm.c?r…
Added: trunk/reactos/regtests/winetests/console.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/console.…
Added: trunk/reactos/regtests/winetests/directory.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/director…
Added: trunk/reactos/regtests/winetests/drive.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/drive.c?…
Added: trunk/reactos/regtests/winetests/environ.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/environ.…
Added: trunk/reactos/regtests/winetests/file.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/file.c?r…
Added: trunk/reactos/regtests/winetests/foo URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/foo?rev=…
Added: trunk/reactos/regtests/winetests/format_msg.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/format_m…
Modified: trunk/reactos/regtests/winetests/gdi32/testlist.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/gdi32/te…
Added: trunk/reactos/regtests/winetests/generated.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/generate…
Added: trunk/reactos/regtests/winetests/heap.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/heap.c?r…
Modified: trunk/reactos/regtests/winetests/kernel32/testlist.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/kernel32…
Added: trunk/reactos/regtests/winetests/locale.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/locale.c…
Added: trunk/reactos/regtests/winetests/mailslot.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/mailslot…
Added: trunk/reactos/regtests/winetests/module.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/module.c…
Modified: trunk/reactos/regtests/winetests/msvcrt/testlist.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/msvcrt/t…
Modified: trunk/reactos/regtests/winetests/ntdll/testlist.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/ntdll/te…
Added: trunk/reactos/regtests/winetests/path.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/path.c?r…
Added: trunk/reactos/regtests/winetests/pipe.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/pipe.c?r…
Added: trunk/reactos/regtests/winetests/process.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/process.…
Added: trunk/reactos/regtests/winetests/profile.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/profile.…
Modified: trunk/reactos/regtests/winetests/psapi/testlist.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/psapi/te…
Modified: trunk/reactos/regtests/winetests/setupapi/testlist.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/setupapi…
Modified: trunk/reactos/regtests/winetests/shell32/testlist.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/shell32/…
Modified: trunk/reactos/regtests/winetests/shlwapi/testlist.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/shlwapi/…
Added: trunk/reactos/regtests/winetests/sync.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/sync.c?r…
Added: trunk/reactos/regtests/winetests/testlist.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/testlist…
Added: trunk/reactos/regtests/winetests/thread.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/thread.c…
Added: trunk/reactos/regtests/winetests/time.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/time.c?r…
Added: trunk/reactos/regtests/winetests/timer.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/timer.c?…
Added: trunk/reactos/regtests/winetests/toolhelp.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/toolhelp…
Modified: trunk/reactos/regtests/winetests/user32/clipboard.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/user32/c…
Modified: trunk/reactos/regtests/winetests/user32/dde.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/user32/d…
Modified: trunk/reactos/regtests/winetests/user32/dialog.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/user32/d…
Modified: trunk/reactos/regtests/winetests/user32/input.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/user32/i…
Modified: trunk/reactos/regtests/winetests/user32/msg.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/user32/m…
Modified: trunk/reactos/regtests/winetests/user32/testlist.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/user32/t…
Modified: trunk/reactos/regtests/winetests/user32/wsprintf.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/user32/w…
Modified: trunk/reactos/regtests/winetests/version/testlist.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/version/…
Added: trunk/reactos/regtests/winetests/virtual.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/virtual.…
Added: trunk/reactos/regtests/winetests/volume.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/volume.c…
18 years, 7 months
1
0
0
0
[amunger] 22052: Bump trunk to 0.4.0, no turning back now.
by amunger@svn.reactos.org
Author: amunger Date: Fri May 26 19:14:13 2006 New Revision: 22052 URL:
http://svn.reactos.ru/svn/reactos?rev=22052&view=rev
Log: Bump trunk to 0.4.0, no turning back now. Modified: trunk/reactos/include/reactos/version.h Modified: trunk/reactos/include/reactos/version.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/include/reactos/version.h?r…
============================================================================== --- trunk/reactos/include/reactos/version.h (original) +++ trunk/reactos/include/reactos/version.h Fri May 26 19:14:13 2006 @@ -18,7 +18,7 @@ #define __VERSION_H #define KERNEL_VERSION_MAJOR 0 -#define KERNEL_VERSION_MINOR 3 +#define KERNEL_VERSION_MINOR 4 #define KERNEL_VERSION_PATCH_LEVEL 0 /* KERNEL_VERSION_BUILD_TYPE is L"SVN", L"RC1", L"RC2" or L"RELEASE" */
18 years, 7 months
1
0
0
0
[hpoussin] 22051: Allow the user to specify a custom path for the driver when installing a new device
by hpoussin@svn.reactos.org
Author: hpoussin Date: Fri May 26 14:16:27 2006 New Revision: 22051 URL:
http://svn.reactos.ru/svn/reactos?rev=22051&view=rev
Log: Allow the user to specify a custom path for the driver when installing a new device Modified: trunk/reactos/dll/win32/newdev/newdev.c trunk/reactos/dll/win32/newdev/newdev.h trunk/reactos/dll/win32/newdev/wizard.c Modified: trunk/reactos/dll/win32/newdev/newdev.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/newdev/newdev.c?r…
============================================================================== --- trunk/reactos/dll/win32/newdev/newdev.c (original) +++ trunk/reactos/dll/win32/newdev/newdev.c Fri May 26 14:16:27 2006 @@ -350,7 +350,6 @@ BOOL retval = FALSE; HANDLE hFindFile = INVALID_HANDLE_VALUE; - TRACE("SearchDriverRecursive(%s)\n", Path); _tcscpy(DirPath, Path); if (DirPath[_tcsclen(DirPath) - 1] != '\\') Modified: trunk/reactos/dll/win32/newdev/newdev.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/newdev/newdev.h?r…
============================================================================== --- trunk/reactos/dll/win32/newdev/newdev.h (original) +++ trunk/reactos/dll/win32/newdev/newdev.h Fri May 26 14:16:27 2006 @@ -1,4 +1,5 @@ #include <windows.h> +#include <windowsx.h> #include <commctrl.h> #include <regstr.h> #include <setupapi.h> Modified: trunk/reactos/dll/win32/newdev/wizard.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/newdev/wizard.c?r…
============================================================================== --- trunk/reactos/dll/win32/newdev/wizard.c (original) +++ trunk/reactos/dll/win32/newdev/wizard.c Fri May 26 14:16:27 2006 @@ -182,8 +182,83 @@ IN PDEVINSTDATA DevInstData, IN HWND hwndDlg) { - FIXME("Include removable devices: %s\n", IsDlgButtonChecked(hwndDlg, IDC_CHECK_MEDIA) ? "yes" : "no"); - FIXME("Include custom path : %s\n", IsDlgButtonChecked(hwndDlg, IDC_CHECK_PATH) ? "yes" : "no"); + TCHAR drive[] = {'?',':',0}; + DWORD dwDrives = 0; + DWORD i; + UINT nType; + DWORD CustomTextLength = 0; + DWORD LengthNeeded = 0; + LPTSTR Buffer; + + TRACE("Include removable devices: %s\n", IsDlgButtonChecked(hwndDlg, IDC_CHECK_MEDIA) ? "yes" : "no"); + TRACE("Include custom path : %s\n", IsDlgButtonChecked(hwndDlg, IDC_CHECK_PATH) ? "yes" : "no"); + + /* Calculate length needed to store the search paths */ + if (IsDlgButtonChecked(hwndDlg, IDC_CHECK_MEDIA)) + { + dwDrives = GetLogicalDrives(); + for (drive[0] = 'A', i = 1; drive[0] <= 'Z'; drive[0]++, i <<= 1) + { + if (dwDrives & i) + { + nType = GetDriveType(drive); + if (nType == DRIVE_REMOVABLE || nType == DRIVE_CDROM) + { + LengthNeeded += 3; + } + } + } + } + if (IsDlgButtonChecked(hwndDlg, IDC_CHECK_PATH)) + { + CustomTextLength = 1 + SendDlgItemMessage( + hwndDlg, + IDC_COMBO_PATH, + WM_GETTEXTLENGTH, + (WPARAM)0, + (LPARAM)0); + LengthNeeded += CustomTextLength; + } + + /* Allocate space for search paths */ + HeapFree(GetProcessHeap(), 0, DevInstData->CustomSearchPath); + DevInstData->CustomSearchPath = Buffer = HeapAlloc( + GetProcessHeap(), + 0, + (LengthNeeded + 1) * sizeof(TCHAR)); + if (!Buffer) + { + TRACE("HeapAlloc() failed\n"); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } + + /* Fill search paths */ + if (IsDlgButtonChecked(hwndDlg, IDC_CHECK_MEDIA)) + { + for (drive[0] = 'A', i = 1; drive[0] <= 'Z'; drive[0]++, i <<= 1) + { + if (dwDrives & i) + { + nType = GetDriveType(drive); + if (nType == DRIVE_REMOVABLE || nType == DRIVE_CDROM) + { + Buffer += 1 + _stprintf(Buffer, drive); + } + } + } + } + if (IsDlgButtonChecked(hwndDlg, IDC_CHECK_PATH)) + { + Buffer += 1 + SendDlgItemMessage( + hwndDlg, + IDC_COMBO_PATH, + WM_GETTEXT, + (WPARAM)CustomTextLength, + (LPARAM)Buffer); + } + *Buffer = _T('\0'); + return TRUE; } @@ -191,62 +266,149 @@ FindDriverProc( IN LPVOID lpParam) { - TCHAR drive[] = {'?',':',0}; - size_t nType; - DWORD dwDrives; PDEVINSTDATA DevInstData; DWORD config_flags; - UINT i = 1; + BOOL result = FALSE; DevInstData = (PDEVINSTDATA)lpParam; - DPRINT1("FindDriverProc(%p)\n", DevInstData->CustomSearchPath); - if (DevInstData->CustomSearchPath) - { + + /* Yes, we can safely ignore the problem (if any) */ + SetupDiDestroyDriverInfoList( + DevInstData->hDevInfo, + &DevInstData->devInfoData, + SPDIT_COMPATDRIVER); + + if (!DevInstData->CustomSearchPath) + { + /* Search in default location */ + result = SearchDriver(DevInstData, NULL, NULL); + } + else + { + /* Search only in specified paths */ + /* We need to check all specified directories to be + * sure to find the best driver for the device. + */ LPCTSTR Path; for (Path = DevInstData->CustomSearchPath; *Path != '\0'; Path += _tcslen(Path) + 1) - DPRINT1("Path %S\n", Path); - } - - dwDrives = GetLogicalDrives(); - for (drive[0] = 'A'; drive[0] <= 'Z'; drive[0]++) - { - if (dwDrives & i) - { - nType = GetDriveType(drive); - if (nType == DRIVE_REMOVABLE || nType == DRIVE_CDROM) - { - /* search for valid inf file */ - if (SearchDriverRecursive(DevInstData, drive)) - { - InstallCurrentDriver(DevInstData); - PostMessage(DevInstData->hDialog, WM_SEARCH_FINISHED, 1, 0); - return 0; - } - } - } - i <<= 1; - } - - /* update device configuration */ - if (SetupDiGetDeviceRegistryProperty( - DevInstData->hDevInfo, - &DevInstData->devInfoData, - SPDRP_CONFIGFLAGS, - NULL, - (BYTE *)&config_flags, - sizeof(config_flags), - NULL)) - { - config_flags |= CONFIGFLAG_FAILEDINSTALL; - SetupDiSetDeviceRegistryProperty( + { + TRACE("Search driver in %S\n", Path); + if (_tcslen(Path) == 2 && Path[1] == ':') + { + if (SearchDriverRecursive(DevInstData, Path)) + result = TRUE; + } + else + { + if (SearchDriver(DevInstData, Path, NULL)) + result = TRUE; + } + } + } + + if (result) + { + PostMessage(DevInstData->hDialog, WM_SEARCH_FINISHED, 1, 0); + } + else + { + /* Update device configuration */ + if (SetupDiGetDeviceRegistryProperty( DevInstData->hDevInfo, &DevInstData->devInfoData, SPDRP_CONFIGFLAGS, - (BYTE *)&config_flags, sizeof(config_flags)); - } - - PostMessage(DevInstData->hDialog, WM_SEARCH_FINISHED, 0, 0); + NULL, + (BYTE *)&config_flags, + sizeof(config_flags), + NULL)) + { + config_flags |= CONFIGFLAG_FAILEDINSTALL; + SetupDiSetDeviceRegistryProperty( + DevInstData->hDevInfo, + &DevInstData->devInfoData, + SPDRP_CONFIGFLAGS, + (BYTE *)&config_flags, sizeof(config_flags)); + } + + PostMessage(DevInstData->hDialog, WM_SEARCH_FINISHED, 0, 0); + } return 0; +} + +static VOID +PopulateCustomPathCombo( + IN HWND hwndCombo) +{ + HKEY hKey = NULL; + DWORD dwRegType; + DWORD dwPathLength; + LPTSTR Buffer = NULL; + LPCTSTR Path; + LONG rc; + + ComboBox_ResetContent(hwndCombo); + + /* RegGetValue would have been better... */ + rc = RegOpenKeyEx( + HKEY_LOCAL_MACHINE, + REGSTR_PATH_SETUP REGSTR_KEY_SETUP, + 0, + KEY_QUERY_VALUE, + &hKey); + if (rc != ERROR_SUCCESS) + { + TRACE("RegOpenKeyEx() failed with error 0x%lx\n", rc); + goto cleanup; + } + rc = RegQueryValueEx( + hKey, + _T("Installation Sources"), + NULL, + &dwRegType, + NULL, + &dwPathLength); + if (rc != ERROR_SUCCESS || dwRegType != REG_MULTI_SZ) + { + TRACE("RegQueryValueEx() failed with error 0x%lx\n", rc); + goto cleanup; + } + /* Allocate enough space to add 2 NULL chars at the end of the string */ + Buffer = HeapAlloc(GetProcessHeap(), 0, dwPathLength + 2 * sizeof(TCHAR)); + if (!Buffer) + { + TRACE("HeapAlloc() failed\n"); + goto cleanup; + } + rc = RegQueryValueEx( + hKey, + _T("Installation Sources"), + NULL, + NULL, + (LPBYTE)Buffer, + &dwPathLength); + if (rc != ERROR_SUCCESS) + { + TRACE("RegQueryValueEx() failed with error 0x%lx\n", rc); + goto cleanup; + } + Buffer[dwPathLength] = Buffer[dwPathLength + 1] = '\0'; + + /* Populate combo box */ + for (Path = Buffer; *Path; Path += _tcslen(Path)) + ComboBox_AddString(hwndCombo, Path); + ComboBox_SetCurSel(hwndCombo, 0); + +cleanup: + if (hKey != NULL) + RegCloseKey(hKey); + HeapFree(GetProcessHeap(), 0, Buffer); +} + +static VOID +SaveCustomPath( + IN HWND hwndCombo) +{ + FIXME("Stub."); } static INT_PTR CALLBACK @@ -381,6 +543,8 @@ /* Hide the system menu */ dwStyle = GetWindowLong(hwndControl, GWL_STYLE); SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU); + + PopulateCustomPathCombo(GetDlgItem(hwndDlg, IDC_COMBO_PATH)); SendDlgItemMessage( hwndDlg, @@ -393,8 +557,7 @@ /* Disable manual driver choice for now */ EnableWindow(GetDlgItem(hwndDlg, IDC_RADIO_CHOOSE), FALSE); - /* Disable custom path for now */ - EnableWindow(GetDlgItem(hwndDlg, IDC_CHECK_PATH), FALSE); + break; } @@ -437,10 +600,13 @@ /* Handle a Next button click, if necessary */ if (IsDlgButtonChecked(hwndDlg, IDC_RADIO_SEARCHHERE)) { + SaveCustomPath(GetDlgItem(hwndDlg, IDC_COMBO_PATH)); HeapFree(GetProcessHeap(), 0, DevInstData->CustomSearchPath); DevInstData->CustomSearchPath = NULL; if (PrepareFoldersToScan(DevInstData, hwndDlg)) PropSheet_SetCurSelByID(GetParent(hwndDlg), IDD_SEARCHDRV); + else + /* FIXME: unknown error */; } else /* FIXME */; @@ -509,7 +675,11 @@ if (wParam == 0) PropSheet_SetCurSelByID(GetParent(hwndDlg), IDD_NODRIVER); else + { + /* FIXME: Shouldn't belong here... */ + InstallCurrentDriver(DevInstData); PropSheet_SetCurSelByID(GetParent(hwndDlg), IDD_FINISHPAGE); + } break; }
18 years, 7 months
1
0
0
0
[hpoussin] 22050: Of course, I forgot to commit the new file in revision 22049...
by hpoussin@svn.reactos.org
Author: hpoussin Date: Fri May 26 03:34:41 2006 New Revision: 22050 URL:
http://svn.reactos.ru/svn/reactos?rev=22050&view=rev
Log: Of course, I forgot to commit the new file in revision 22049... Added: trunk/reactos/dll/win32/newdev/wizard.c (with props) Added: trunk/reactos/dll/win32/newdev/wizard.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/newdev/wizard.c?r…
============================================================================== --- trunk/reactos/dll/win32/newdev/wizard.c (added) +++ trunk/reactos/dll/win32/newdev/wizard.c Fri May 26 03:34:41 2006 @@ -1,0 +1,838 @@ +/* + * New device installer (newdev.dll) + * + * Copyright 2006 Hervé Poussineau (hpoussin(a)reactos.org) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#define YDEBUG +#include "newdev.h" + +WINE_DEFAULT_DEBUG_CHANNEL(newdev); + +HANDLE hThread; + +static VOID +CenterWindow( + IN HWND hWnd) +{ + HWND hWndParent; + RECT rcParent; + RECT rcWindow; + + hWndParent = GetParent(hWnd); + if (hWndParent == NULL) + hWndParent = GetDesktopWindow(); + + GetWindowRect(hWndParent, &rcParent); + GetWindowRect(hWnd, &rcWindow); + + SetWindowPos( + hWnd, + HWND_TOP, + ((rcParent.right - rcParent.left) - (rcWindow.right - rcWindow.left)) / 2, + ((rcParent.bottom - rcParent.top) - (rcWindow.bottom - rcWindow.top)) / 2, + 0, + 0, + SWP_NOSIZE); +} + +static BOOL +CanDisableDevice( + IN DEVINST DevInst, + IN HMACHINE hMachine, + OUT BOOL *CanDisable) +{ +#if 0 + /* hpoussin, Dec 2005. I've disabled this code because + * ntoskrnl never sets the DN_DISABLEABLE flag. + */ + CONFIGRET cr; + ULONG Status, ProblemNumber; + BOOL Ret = FALSE; + + cr = CM_Get_DevNode_Status_Ex( + &Status, + &ProblemNumber, + DevInst, + 0, + hMachine); + if (cr == CR_SUCCESS) + { + *CanDisable = ((Status & DN_DISABLEABLE) != 0); + Ret = TRUE; + } + + return Ret; +#else + *CanDisable = TRUE; + return TRUE; +#endif +} + +static BOOL +IsDeviceStarted( + IN DEVINST DevInst, + IN HMACHINE hMachine, + OUT BOOL *IsEnabled) +{ + CONFIGRET cr; + ULONG Status, ProblemNumber; + BOOL Ret = FALSE; + + cr = CM_Get_DevNode_Status_Ex( + &Status, + &ProblemNumber, + DevInst, + 0, + hMachine); + if (cr == CR_SUCCESS) + { + *IsEnabled = ((Status & DN_STARTED) != 0); + Ret = TRUE; + } + + return Ret; +} + +static BOOL +StartDevice( + IN HDEVINFO DeviceInfoSet, + IN PSP_DEVINFO_DATA DevInfoData OPTIONAL, + IN BOOL bEnable, + IN DWORD HardwareProfile OPTIONAL, + OUT BOOL *bNeedReboot OPTIONAL) +{ + SP_PROPCHANGE_PARAMS pcp; + SP_DEVINSTALL_PARAMS dp; + DWORD LastErr; + BOOL Ret = FALSE; + + pcp.ClassInstallHeader.cbSize = sizeof(SP_CLASSINSTALL_HEADER); + pcp.ClassInstallHeader.InstallFunction = DIF_PROPERTYCHANGE; + pcp.HwProfile = HardwareProfile; + + if (bEnable) + { + /* try to enable the device on the global profile */ + pcp.StateChange = DICS_ENABLE; + pcp.Scope = DICS_FLAG_GLOBAL; + + /* ignore errors */ + LastErr = GetLastError(); + if (SetupDiSetClassInstallParams( + DeviceInfoSet, + DevInfoData, + &pcp.ClassInstallHeader, + sizeof(SP_PROPCHANGE_PARAMS))) + { + SetupDiCallClassInstaller( + DIF_PROPERTYCHANGE, + DeviceInfoSet, + DevInfoData); + } + SetLastError(LastErr); + } + + /* try config-specific */ + pcp.StateChange = (bEnable ? DICS_ENABLE : DICS_DISABLE); + pcp.Scope = DICS_FLAG_CONFIGSPECIFIC; + + if (SetupDiSetClassInstallParams( + DeviceInfoSet, + DevInfoData, + &pcp.ClassInstallHeader, + sizeof(SP_PROPCHANGE_PARAMS)) && + SetupDiCallClassInstaller(DIF_PROPERTYCHANGE, + DeviceInfoSet, + DevInfoData)) + { + dp.cbSize = sizeof(SP_DEVINSTALL_PARAMS); + if (SetupDiGetDeviceInstallParams( + DeviceInfoSet, + DevInfoData, + &dp)) + { + if (bNeedReboot != NULL) + { + *bNeedReboot = ((dp.Flags & (DI_NEEDRESTART | DI_NEEDREBOOT)) != 0); + } + + Ret = TRUE; + } + } + return Ret; +} + +static BOOL +PrepareFoldersToScan( + IN PDEVINSTDATA DevInstData, + IN HWND hwndDlg) +{ + FIXME("Include removable devices: %s\n", IsDlgButtonChecked(hwndDlg, IDC_CHECK_MEDIA) ? "yes" : "no"); + FIXME("Include custom path : %s\n", IsDlgButtonChecked(hwndDlg, IDC_CHECK_PATH) ? "yes" : "no"); + return TRUE; +} + +static DWORD WINAPI +FindDriverProc( + IN LPVOID lpParam) +{ + TCHAR drive[] = {'?',':',0}; + size_t nType; + DWORD dwDrives; + PDEVINSTDATA DevInstData; + DWORD config_flags; + UINT i = 1; + + DevInstData = (PDEVINSTDATA)lpParam; + DPRINT1("FindDriverProc(%p)\n", DevInstData->CustomSearchPath); + if (DevInstData->CustomSearchPath) + { + LPCTSTR Path; + for (Path = DevInstData->CustomSearchPath; *Path != '\0'; Path += _tcslen(Path) + 1) + DPRINT1("Path %S\n", Path); + } + + dwDrives = GetLogicalDrives(); + for (drive[0] = 'A'; drive[0] <= 'Z'; drive[0]++) + { + if (dwDrives & i) + { + nType = GetDriveType(drive); + if (nType == DRIVE_REMOVABLE || nType == DRIVE_CDROM) + { + /* search for valid inf file */ + if (SearchDriverRecursive(DevInstData, drive)) + { + InstallCurrentDriver(DevInstData); + PostMessage(DevInstData->hDialog, WM_SEARCH_FINISHED, 1, 0); + return 0; + } + } + } + i <<= 1; + } + + /* update device configuration */ + if (SetupDiGetDeviceRegistryProperty( + DevInstData->hDevInfo, + &DevInstData->devInfoData, + SPDRP_CONFIGFLAGS, + NULL, + (BYTE *)&config_flags, + sizeof(config_flags), + NULL)) + { + config_flags |= CONFIGFLAG_FAILEDINSTALL; + SetupDiSetDeviceRegistryProperty( + DevInstData->hDevInfo, + &DevInstData->devInfoData, + SPDRP_CONFIGFLAGS, + (BYTE *)&config_flags, sizeof(config_flags)); + } + + PostMessage(DevInstData->hDialog, WM_SEARCH_FINISHED, 0, 0); + return 0; +} + +static INT_PTR CALLBACK +WelcomeDlgProc( + IN HWND hwndDlg, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + PDEVINSTDATA DevInstData; + + /* Retrieve pointer to the global setup data */ + DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWL_USERDATA); + + switch (uMsg) + { + case WM_INITDIALOG: + { + HWND hwndControl; + DWORD dwStyle; + + /* Get pointer to the global setup data */ + DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam; + SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData); + + hwndControl = GetParent(hwndDlg); + + /* Center the wizard window */ + CenterWindow(hwndControl); + + /* Hide the system menu */ + dwStyle = GetWindowLong(hwndControl, GWL_STYLE); + SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU); + + /* Set title font */ + SendDlgItemMessage( + hwndDlg, + IDC_WELCOMETITLE, + WM_SETFONT, + (WPARAM)DevInstData->hTitleFont, + (LPARAM)TRUE); + + SendDlgItemMessage( + hwndDlg, + IDC_DEVICE, + WM_SETTEXT, + 0, + (LPARAM)DevInstData->buffer); + + SendDlgItemMessage( + hwndDlg, + IDC_RADIO_AUTO, + BM_SETCHECK, + (WPARAM)TRUE, + (LPARAM)0); + break; + } + + case WM_NOTIFY: + { + LPNMHDR lpnm = (LPNMHDR)lParam; + + switch (lpnm->code) + { + case PSN_SETACTIVE: + /* Enable the Next button */ + PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_NEXT); + break; + + case PSN_WIZNEXT: + /* Handle a Next button click, if necessary */ + if (SendDlgItemMessage(hwndDlg, IDC_RADIO_AUTO, BM_GETCHECK, (WPARAM)0, (LPARAM)0) == BST_CHECKED) + PropSheet_SetCurSelByID(GetParent(hwndDlg), IDD_SEARCHDRV); + return TRUE; + + default: + break; + } + break; + } + + default: + break; + } + + return FALSE; +} + +static void +IncludePath(HWND Dlg, BOOL Enabled) +{ + EnableWindow(GetDlgItem(Dlg, IDC_COMBO_PATH), Enabled); + EnableWindow(GetDlgItem(Dlg, IDC_BROWSE), /*FIXME: Enabled*/ FALSE); +} + +static void +AutoDriver(HWND Dlg, BOOL Enabled) +{ + EnableWindow(GetDlgItem(Dlg, IDC_CHECK_MEDIA), Enabled); + EnableWindow(GetDlgItem(Dlg, IDC_CHECK_PATH), Enabled); + IncludePath(Dlg, Enabled & IsDlgButtonChecked(Dlg, IDC_CHECK_PATH)); +} + +static INT_PTR CALLBACK +CHSourceDlgProc( + IN HWND hwndDlg, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + PDEVINSTDATA DevInstData; + + /* Retrieve pointer to the global setup data */ + DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWL_USERDATA); + + switch (uMsg) + { + case WM_INITDIALOG: + { + HWND hwndControl; + DWORD dwStyle; + + /* Get pointer to the global setup data */ + DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam; + SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData); + + hwndControl = GetParent(hwndDlg); + + /* Center the wizard window */ + CenterWindow(hwndControl); + + /* Hide the system menu */ + dwStyle = GetWindowLong(hwndControl, GWL_STYLE); + SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU); + + SendDlgItemMessage( + hwndDlg, + IDC_RADIO_SEARCHHERE, + BM_SETCHECK, + (WPARAM)TRUE, + (LPARAM)0); + AutoDriver(hwndDlg, TRUE); + IncludePath(hwndDlg, FALSE); + + /* Disable manual driver choice for now */ + EnableWindow(GetDlgItem(hwndDlg, IDC_RADIO_CHOOSE), FALSE); + /* Disable custom path for now */ + EnableWindow(GetDlgItem(hwndDlg, IDC_CHECK_PATH), FALSE); + break; + } + + case WM_COMMAND: + { + switch (LOWORD(wParam)) + { + case IDC_RADIO_SEARCHHERE: + AutoDriver(hwndDlg, TRUE); + return TRUE; + + case IDC_RADIO_CHOOSE: + AutoDriver(hwndDlg, FALSE); + return TRUE; + + case IDC_CHECK_PATH: + IncludePath(hwndDlg, IsDlgButtonChecked(hwndDlg, IDC_CHECK_PATH)); + return TRUE; + + case IDC_BROWSE: + /* FIXME: set the IDC_COMBO_PATH text */ + FIXME("Should display browse folder dialog\n"); + return FALSE; + } + break; + } + + case WM_NOTIFY: + { + LPNMHDR lpnm = (LPNMHDR)lParam; + + switch (lpnm->code) + { + case PSN_SETACTIVE: + /* Enable the Next and Back buttons */ + PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_NEXT | PSWIZB_BACK); + break; + + case PSN_WIZNEXT: + /* Handle a Next button click, if necessary */ + if (IsDlgButtonChecked(hwndDlg, IDC_RADIO_SEARCHHERE)) + { + HeapFree(GetProcessHeap(), 0, DevInstData->CustomSearchPath); + DevInstData->CustomSearchPath = NULL; + if (PrepareFoldersToScan(DevInstData, hwndDlg)) + PropSheet_SetCurSelByID(GetParent(hwndDlg), IDD_SEARCHDRV); + } + else + /* FIXME */; + return TRUE; + + default: + break; + } + break; + } + + default: + break; + } + + return FALSE; +} + +static INT_PTR CALLBACK +SearchDrvDlgProc( + IN HWND hwndDlg, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + PDEVINSTDATA DevInstData; + DWORD dwThreadId; + + /* Retrieve pointer to the global setup data */ + DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWL_USERDATA); + + switch (uMsg) + { + case WM_INITDIALOG: + { + HWND hwndControl; + DWORD dwStyle; + + /* Get pointer to the global setup data */ + DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam; + SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData); + + DevInstData->hDialog = hwndDlg; + hwndControl = GetParent(hwndDlg); + + /* Center the wizard window */ + CenterWindow(hwndControl); + + SendDlgItemMessage( + hwndDlg, + IDC_DEVICE, + WM_SETTEXT, + 0, + (LPARAM)DevInstData->buffer); + + /* Hide the system menu */ + dwStyle = GetWindowLong(hwndControl, GWL_STYLE); + SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU); + break; + } + + case WM_SEARCH_FINISHED: + { + CloseHandle(hThread); + hThread = 0; + if (wParam == 0) + PropSheet_SetCurSelByID(GetParent(hwndDlg), IDD_NODRIVER); + else + PropSheet_SetCurSelByID(GetParent(hwndDlg), IDD_FINISHPAGE); + break; + } + + case WM_NOTIFY: + { + LPNMHDR lpnm = (LPNMHDR)lParam; + + switch (lpnm->code) + { + case PSN_SETACTIVE: + PropSheet_SetWizButtons(GetParent(hwndDlg), !PSWIZB_NEXT | !PSWIZB_BACK); + hThread = CreateThread(NULL, 0, FindDriverProc, DevInstData, 0, &dwThreadId); + break; + + case PSN_KILLACTIVE: + if (hThread != 0) + { + SetWindowLong(hwndDlg, DWL_MSGRESULT, TRUE); + return TRUE; + } + break; + + case PSN_WIZNEXT: + /* Handle a Next button click, if necessary */ + break; + + default: + break; + } + break; + } + + default: + break; + } + + return FALSE; +} + +static INT_PTR CALLBACK +InstallDrvDlgProc( + IN HWND hwndDlg, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + return FALSE; +} + +static INT_PTR CALLBACK +NoDriverDlgProc( + IN HWND hwndDlg, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + PDEVINSTDATA DevInstData; + + /* Get pointer to the global setup data */ + DevInstData = (PDEVINSTDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA); + + switch (uMsg) + { + case WM_INITDIALOG: + { + HWND hwndControl; + BOOL DisableableDevice = FALSE; + + DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam; + SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData); + + hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL); + ShowWindow (hwndControl, SW_HIDE); + EnableWindow (hwndControl, FALSE); + + /* Set title font */ + SendDlgItemMessage( + hwndDlg, + IDC_FINISHTITLE, + WM_SETFONT, + (WPARAM)DevInstData->hTitleFont, + (LPARAM)TRUE); + + /* disable the "do not show this dialog anymore" checkbox + if the device cannot be disabled */ + CanDisableDevice( + DevInstData->devInfoData.DevInst, + NULL, + &DisableableDevice); + EnableWindow( + GetDlgItem(hwndDlg, IDC_DONOTSHOWDLG), + DisableableDevice); + break; + } + + case WM_NOTIFY: + { + LPNMHDR lpnm = (LPNMHDR)lParam; + + switch (lpnm->code) + { + case PSN_SETACTIVE: + /* Enable the correct buttons on for the active page */ + PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_BACK | PSWIZB_FINISH); + break; + + case PSN_WIZBACK: + /* Handle a Back button click, if necessary */ + PropSheet_SetCurSelByID(GetParent(hwndDlg), IDD_WELCOMEPAGE); + return TRUE; + + case PSN_WIZFINISH: + { + BOOL DisableableDevice = FALSE; + BOOL IsStarted = FALSE; + + if (CanDisableDevice(DevInstData->devInfoData.DevInst, + NULL, + &DisableableDevice) && + DisableableDevice && + IsDeviceStarted( + DevInstData->devInfoData.DevInst, + NULL, + &IsStarted) && + !IsStarted && + SendDlgItemMessage( + hwndDlg, + IDC_DONOTSHOWDLG, + BM_GETCHECK, + (WPARAM)0, (LPARAM)0) == BST_CHECKED) + { + /* disable the device */ + StartDevice( + DevInstData->hDevInfo, + &DevInstData->devInfoData, + FALSE, + 0, + NULL); + } + break; + } + + default: + break; + } + break; + } + + default: + break; + } + + return FALSE; +} + +static INT_PTR CALLBACK +FinishDlgProc( + IN HWND hwndDlg, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + PDEVINSTDATA DevInstData; + + /* Retrieve pointer to the global setup data */ + DevInstData = (PDEVINSTDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA); + + switch (uMsg) + { + case WM_INITDIALOG: + { + HWND hwndControl; + + /* Get pointer to the global setup data */ + DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam; + SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData); + + hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL); + ShowWindow (hwndControl, SW_HIDE); + EnableWindow (hwndControl, FALSE); + + SendDlgItemMessage( + hwndDlg, + IDC_DEVICE, + WM_SETTEXT, + 0, + (LPARAM)DevInstData->drvInfoData.Description); + + /* Set title font */ + SendDlgItemMessage( + hwndDlg, + IDC_FINISHTITLE, + WM_SETFONT, + (WPARAM)DevInstData->hTitleFont, + (LPARAM)TRUE); + break; + } + + case WM_NOTIFY: + { + LPNMHDR lpnm = (LPNMHDR)lParam; + + switch (lpnm->code) + { + case PSN_SETACTIVE: + /* Enable the correct buttons on for the active page */ + PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_FINISH); + break; + + case PSN_WIZBACK: + /* Handle a Back button click, if necessary */ + break; + + case PSN_WIZFINISH: + /* Handle a Finish button click, if necessary */ + break; + + default: + break; + } + break; + } + + default: + break; + } + + return FALSE; +} + +static HFONT +CreateTitleFont(VOID) +{ + NONCLIENTMETRICS ncm; + LOGFONT LogFont; + HDC hdc; + INT FontSize; + HFONT hFont; + + ncm.cbSize = sizeof(NONCLIENTMETRICS); + SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0); + + LogFont = ncm.lfMessageFont; + LogFont.lfWeight = FW_BOLD; + _tcscpy(LogFont.lfFaceName, _T("MS Shell Dlg")); + + hdc = GetDC(NULL); + FontSize = 12; + LogFont.lfHeight = 0 - GetDeviceCaps (hdc, LOGPIXELSY) * FontSize / 72; + hFont = CreateFontIndirect(&LogFont); + ReleaseDC(NULL, hdc); + + return hFont; +} + +BOOL +DisplayWizard( + IN PDEVINSTDATA DevInstData, + IN HWND hwndParent, + IN UINT startPage) +{ + PROPSHEETHEADER psh; + HPROPSHEETPAGE ahpsp[IDD_FINISHPAGE + 1]; + PROPSHEETPAGE psp; + + /* Create the Welcome page */ + ZeroMemory(&psp, sizeof(PROPSHEETPAGE)); + psp.dwSize = sizeof(PROPSHEETPAGE); + psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER; + psp.hInstance = hDllInstance; + psp.lParam = (LPARAM)DevInstData; + psp.pfnDlgProc = WelcomeDlgProc; + psp.pszTemplate = MAKEINTRESOURCE(IDD_WELCOMEPAGE); + ahpsp[IDD_WELCOMEPAGE] = CreatePropertySheetPage(&psp); + + /* Create the Select Source page */ + psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE; + psp.pfnDlgProc = CHSourceDlgProc; + psp.pszTemplate = MAKEINTRESOURCE(IDD_CHSOURCE); + ahpsp[IDD_CHSOURCE] = CreatePropertySheetPage(&psp); + + /* Create the Search driver page */ + psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE; + psp.pfnDlgProc = SearchDrvDlgProc; + psp.pszTemplate = MAKEINTRESOURCE(IDD_SEARCHDRV); + ahpsp[IDD_SEARCHDRV] = CreatePropertySheetPage(&psp); + + /* Create the Install driver page */ + psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE; + psp.pfnDlgProc = InstallDrvDlgProc; + psp.pszTemplate = MAKEINTRESOURCE(IDD_INSTALLDRV); + ahpsp[IDD_INSTALLDRV] = CreatePropertySheetPage(&psp); + + /* Create the Install failed page */ + psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER; + psp.pfnDlgProc = NoDriverDlgProc; + psp.pszTemplate = MAKEINTRESOURCE(IDD_NODRIVER); + ahpsp[IDD_NODRIVER] = CreatePropertySheetPage(&psp); + + /* Create the Finish page */ + psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER; + psp.pfnDlgProc = FinishDlgProc; + psp.pszTemplate = MAKEINTRESOURCE(IDD_FINISHPAGE); + ahpsp[IDD_FINISHPAGE] = CreatePropertySheetPage(&psp); + + /* Create the property sheet */ + psh.dwSize = sizeof(PROPSHEETHEADER); + psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER; + psh.hInstance = hDllInstance; + psh.hwndParent = hwndParent; + psh.nPages = 7; + psh.nStartPage = startPage; + psh.phpage = ahpsp; + psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK); + psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER); + + /* Create title font */ + DevInstData->hTitleFont = CreateTitleFont(); + + /* Display the wizard */ + PropertySheet(&psh); + + DeleteObject(DevInstData->hTitleFont); + + return TRUE; +} Propchange: trunk/reactos/dll/win32/newdev/wizard.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/dll/win32/newdev/wizard.c ------------------------------------------------------------------------------ svn:keywords = author date revision
18 years, 7 months
1
0
0
0
[hpoussin] 22049: - Move new hardware wizard code to wizard.c - Disable non working buttons - Improve navigation between pages - Prepare room for an install page
by hpoussin@svn.reactos.org
Author: hpoussin Date: Fri May 26 02:55:13 2006 New Revision: 22049 URL:
http://svn.reactos.ru/svn/reactos?rev=22049&view=rev
Log: - Move new hardware wizard code to wizard.c - Disable non working buttons - Improve navigation between pages - Prepare room for an install page Modified: trunk/reactos/dll/win32/newdev/De.rc trunk/reactos/dll/win32/newdev/En.rc trunk/reactos/dll/win32/newdev/Es.rc trunk/reactos/dll/win32/newdev/Hu.rc trunk/reactos/dll/win32/newdev/Ru.rc trunk/reactos/dll/win32/newdev/newdev.c trunk/reactos/dll/win32/newdev/newdev.h trunk/reactos/dll/win32/newdev/newdev.rbuild trunk/reactos/dll/win32/newdev/resource.h Modified: trunk/reactos/dll/win32/newdev/De.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/newdev/De.rc?rev=…
============================================================================== --- trunk/reactos/dll/win32/newdev/De.rc (original) +++ trunk/reactos/dll/win32/newdev/De.rc Fri May 26 02:55:13 2006 @@ -58,6 +58,14 @@ LTEXT "UNKNOWN DEVICE",IDC_DEVICE,51,20,169,16 END +IDD_INSTALLDRV DIALOG DISCARDABLE 0, 0, 317, 143 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Hardwareinstallation" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "UNKNOWN DEVICE",IDC_DEVICE,51,20,169,16 +END + IDD_FINISHPAGE DIALOG DISCARDABLE 0, 0, 317, 193 STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU Modified: trunk/reactos/dll/win32/newdev/En.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/newdev/En.rc?rev=…
============================================================================== --- trunk/reactos/dll/win32/newdev/En.rc (original) +++ trunk/reactos/dll/win32/newdev/En.rc Fri May 26 02:55:13 2006 @@ -58,6 +58,14 @@ LTEXT "UNKNOWN DEVICE",IDC_DEVICE,51,20,169,16 END +IDD_INSTALLDRV DIALOG DISCARDABLE 0, 0, 317, 143 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Device installation" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "UNKNOWN DEVICE",IDC_DEVICE,51,20,169,16 +END + IDD_FINISHPAGE DIALOG DISCARDABLE 0, 0, 317, 193 STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU Modified: trunk/reactos/dll/win32/newdev/Es.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/newdev/Es.rc?rev=…
============================================================================== --- trunk/reactos/dll/win32/newdev/Es.rc (original) +++ trunk/reactos/dll/win32/newdev/Es.rc Fri May 26 02:55:13 2006 @@ -58,6 +58,14 @@ LTEXT "DISPOSITIVO DESCONOCIDO",IDC_DEVICE,51,20,169,16 END +IDD_INSTALLDRV DIALOG DISCARDABLE 0, 0, 317, 143 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Device installation" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "DISPOSITIVO DESCONOCIDO",IDC_DEVICE,51,20,169,16 +END + IDD_FINISHPAGE DIALOG DISCARDABLE 0, 0, 317, 193 STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU Modified: trunk/reactos/dll/win32/newdev/Hu.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/newdev/Hu.rc?rev=…
============================================================================== --- trunk/reactos/dll/win32/newdev/Hu.rc (original) +++ trunk/reactos/dll/win32/newdev/Hu.rc Fri May 26 02:55:13 2006 @@ -48,6 +48,14 @@ LTEXT "Ismeretlen eszköz!",IDC_DEVICE,51,20,169,16 END +IDD_INSTALLDRV DIALOG DISCARDABLE 0, 0, 317, 143 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Hardver telepítõ" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Ismeretlen eszköz!",IDC_DEVICE,51,20,169,16 +END + IDD_FINISHPAGE DIALOG DISCARDABLE 0, 0, 317, 193 STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU Modified: trunk/reactos/dll/win32/newdev/Ru.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/newdev/Ru.rc?rev=…
============================================================================== --- trunk/reactos/dll/win32/newdev/Ru.rc (original) +++ trunk/reactos/dll/win32/newdev/Ru.rc Fri May 26 02:55:13 2006 @@ -17,7 +17,7 @@ "Button",BS_AUTORADIOBUTTON,120,133,164,14 END -IDD_NODRIVER DIALOG DISCARDABLE 0, 0, 317, 193 +IDD_INSTALLFAILED DIALOG DISCARDABLE 0, 0, 317, 193 STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Óñòàíîâêà îáîðóäîâàíèÿ" @@ -58,6 +58,14 @@ LTEXT "Íåèçâåñòíîå óñòðîéñòâî",IDC_DEVICE,51,20,169,16 END +IDD_INSTALLDRV DIALOG DISCARDABLE 0, 0, 317, 143 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Óñòàíîâêà îáîðóäîâàíèÿ" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Íåèçâåñòíîå óñòðîéñòâî",IDC_DEVICE,51,20,169,16 +END + IDD_FINISHPAGE DIALOG DISCARDABLE 0, 0, 317, 193 STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU Modified: trunk/reactos/dll/win32/newdev/newdev.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/newdev/newdev.c?r…
============================================================================== --- trunk/reactos/dll/win32/newdev/newdev.c (original) +++ trunk/reactos/dll/win32/newdev/newdev.c Fri May 26 02:55:13 2006 @@ -24,143 +24,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(newdev); -static BOOL SearchDriver ( PDEVINSTDATA DevInstData, LPCTSTR Path ); -static BOOL InstallDriver ( PDEVINSTDATA DevInstData ); -static DWORD WINAPI FindDriverProc( LPVOID lpParam ); -static BOOL FindDriver ( PDEVINSTDATA DevInstData, LPCWSTR InfFile ); - -static DEVINSTDATA DevInstData; +/* Global variables */ HINSTANCE hDllInstance; -HANDLE hThread; - -static BOOL -CanDisableDevice( - IN DEVINST DevInst, - IN HMACHINE hMachine, - OUT BOOL *CanDisable) -{ -#if 0 - /* hpoussin, Dec 2005. I've disabled this code because - * ntoskrnl never sets the DN_DISABLEABLE flag. - */ - CONFIGRET cr; - ULONG Status, ProblemNumber; - BOOL Ret = FALSE; - - cr = CM_Get_DevNode_Status_Ex( - &Status, - &ProblemNumber, - DevInst, - 0, - hMachine); - if (cr == CR_SUCCESS) - { - *CanDisable = ((Status & DN_DISABLEABLE) != 0); - Ret = TRUE; - } - - return Ret; -#else - *CanDisable = TRUE; - return TRUE; -#endif -} - - -static BOOL -IsDeviceStarted( - IN DEVINST DevInst, - IN HMACHINE hMachine, - OUT BOOL *IsEnabled) -{ - CONFIGRET cr; - ULONG Status, ProblemNumber; - BOOL Ret = FALSE; - - cr = CM_Get_DevNode_Status_Ex( - &Status, - &ProblemNumber, - DevInst, - 0, - hMachine); - if (cr == CR_SUCCESS) - { - *IsEnabled = ((Status & DN_STARTED) != 0); - Ret = TRUE; - } - - return Ret; -} - - -static BOOL -StartDevice( - IN HDEVINFO DeviceInfoSet, - IN PSP_DEVINFO_DATA DevInfoData OPTIONAL, - IN BOOL bEnable, - IN DWORD HardwareProfile OPTIONAL, - OUT BOOL *bNeedReboot OPTIONAL) -{ - SP_PROPCHANGE_PARAMS pcp; - SP_DEVINSTALL_PARAMS dp; - DWORD LastErr; - BOOL Ret = FALSE; - - pcp.ClassInstallHeader.cbSize = sizeof(SP_CLASSINSTALL_HEADER); - pcp.ClassInstallHeader.InstallFunction = DIF_PROPERTYCHANGE; - pcp.HwProfile = HardwareProfile; - - if (bEnable) - { - /* try to enable the device on the global profile */ - pcp.StateChange = DICS_ENABLE; - pcp.Scope = DICS_FLAG_GLOBAL; - - /* ignore errors */ - LastErr = GetLastError(); - if (SetupDiSetClassInstallParams( - DeviceInfoSet, - DevInfoData, - &pcp.ClassInstallHeader, - sizeof(SP_PROPCHANGE_PARAMS))) - { - SetupDiCallClassInstaller( - DIF_PROPERTYCHANGE, - DeviceInfoSet, - DevInfoData); - } - SetLastError(LastErr); - } - - /* try config-specific */ - pcp.StateChange = (bEnable ? DICS_ENABLE : DICS_DISABLE); - pcp.Scope = DICS_FLAG_CONFIGSPECIFIC; - - if (SetupDiSetClassInstallParams( - DeviceInfoSet, - DevInfoData, - &pcp.ClassInstallHeader, - sizeof(SP_PROPCHANGE_PARAMS)) && - SetupDiCallClassInstaller(DIF_PROPERTYCHANGE, - DeviceInfoSet, - DevInfoData)) - { - dp.cbSize = sizeof(SP_DEVINSTALL_PARAMS); - if (SetupDiGetDeviceInstallParams( - DeviceInfoSet, - DevInfoData, - &dp)) - { - if (bNeedReboot != NULL) - { - *bNeedReboot = ((dp.Flags & (DI_NEEDRESTART | DI_NEEDREBOOT)) != 0); - } - - Ret = TRUE; - } - } - return Ret; -} /* * @implemented @@ -293,17 +158,17 @@ TRACE("Trying to update the driver of %S\n", Buffer); /* Search driver in the specified .inf file */ - if (!FindDriver(&DevInstData, FullInfPath)) - { - TRACE("FindDriver() failed with error 0x%lx\n", GetLastError()); + if (!SearchDriver(&DevInstData, NULL, FullInfPath)) + { + TRACE("SearchDriver() failed with error 0x%lx\n", GetLastError()); continue; } /* FIXME: HACK! We shouldn't check of ERROR_PRIVILEGE_NOT_HELD */ - //if (!InstallDriver(&DevInstData)) - if (!InstallDriver(&DevInstData) && GetLastError() != ERROR_PRIVILEGE_NOT_HELD) - { - TRACE("InstallDriver() failed with error 0x%lx\n", GetLastError()); + //if (!InstallCurrentDriver(&DevInstData)) + if (!InstallCurrentDriver(&DevInstData) && GetLastError() != ERROR_PRIVILEGE_NOT_HELD) + { + TRACE("InstallCurrentDriver() failed with error 0x%lx\n", GetLastError()); continue; } @@ -375,552 +240,12 @@ return Result; } - -static HFONT -CreateTitleFont(VOID) -{ - NONCLIENTMETRICS ncm; - LOGFONT LogFont; - HDC hdc; - INT FontSize; - HFONT hFont; - - ncm.cbSize = sizeof(NONCLIENTMETRICS); - SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0); - - LogFont = ncm.lfMessageFont; - LogFont.lfWeight = FW_BOLD; - _tcscpy(LogFont.lfFaceName, _T("MS Shell Dlg")); - - hdc = GetDC(NULL); - FontSize = 12; - LogFont.lfHeight = 0 - GetDeviceCaps (hdc, LOGPIXELSY) * FontSize / 72; - hFont = CreateFontIndirect(&LogFont); - ReleaseDC(NULL, hdc); - - return hFont; -} - -static VOID -CenterWindow( - IN HWND hWnd) -{ - HWND hWndParent; - RECT rcParent; - RECT rcWindow; - - hWndParent = GetParent(hWnd); - if (hWndParent == NULL) - hWndParent = GetDesktopWindow(); - - GetWindowRect(hWndParent, &rcParent); - GetWindowRect(hWnd, &rcWindow); - - SetWindowPos( - hWnd, - HWND_TOP, - ((rcParent.right - rcParent.left) - (rcWindow.right - rcWindow.left)) / 2, - ((rcParent.bottom - rcParent.top) - (rcWindow.bottom - rcWindow.top)) / 2, - 0, - 0, - SWP_NOSIZE); -} - -static INT_PTR CALLBACK -WelcomeDlgProc( - IN HWND hwndDlg, - IN UINT uMsg, - IN WPARAM wParam, - IN LPARAM lParam) -{ - - PDEVINSTDATA DevInstData; - - /* Retrieve pointer to the global setup data */ - DevInstData = (PDEVINSTDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA); - - switch (uMsg) - { - case WM_INITDIALOG: - { - HWND hwndControl; - DWORD dwStyle; - - /* Get pointer to the global setup data */ - DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam; - SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData); - - hwndControl = GetParent(hwndDlg); - - /* Center the wizard window */ - CenterWindow (hwndControl); - - /* Hide the system menu */ - dwStyle = GetWindowLong(hwndControl, GWL_STYLE); - SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU); - - /* Set title font */ - SendDlgItemMessage( - hwndDlg, - IDC_WELCOMETITLE, - WM_SETFONT, - (WPARAM)DevInstData->hTitleFont, - (LPARAM)TRUE); - - SendDlgItemMessage( - hwndDlg, - IDC_DEVICE, - WM_SETTEXT, - 0, - (LPARAM) DevInstData->buffer); - - SendDlgItemMessage( - hwndDlg, - IDC_RADIO_AUTO, - BM_SETCHECK, - (WPARAM) TRUE, - (LPARAM) 0); - break; - } - - case WM_NOTIFY: - { - LPNMHDR lpnm = (LPNMHDR)lParam; - - switch (lpnm->code) - { - case PSN_SETACTIVE: - /* Enable the Next button */ - PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_NEXT); - break; - - case PSN_WIZNEXT: - /* Handle a Next button click, if necessary */ - if (SendDlgItemMessage(hwndDlg, IDC_RADIO_AUTO, BM_GETCHECK, (WPARAM) 0, (LPARAM) 0) == BST_CHECKED) - PropSheet_SetCurSel(GetParent(hwndDlg), 0, IDD_SEARCHDRV); - break; - - default: - break; - } - break; - } - - default: - break; - } - - return FALSE; -} - -static INT_PTR CALLBACK -CHSourceDlgProc( - IN HWND hwndDlg, - IN UINT uMsg, - IN WPARAM wParam, - IN LPARAM lParam) -{ - PDEVINSTDATA DevInstData; - - /* Retrieve pointer to the global setup data */ - DevInstData = (PDEVINSTDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA); - - switch (uMsg) - { - case WM_INITDIALOG: - { - HWND hwndControl; - DWORD dwStyle; - - /* Get pointer to the global setup data */ - DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam; - SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData); - - hwndControl = GetParent(hwndDlg); - - /* Center the wizard window */ - CenterWindow (hwndControl); - - /* Hide the system menu */ - dwStyle = GetWindowLong(hwndControl, GWL_STYLE); - SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU); - - SendDlgItemMessage( - hwndDlg, - IDC_RADIO_SEARCHHERE, - BM_SETCHECK, - (WPARAM) TRUE, - (LPARAM) 0); - - break; - } - - case WM_NOTIFY: - { - LPNMHDR lpnm = (LPNMHDR)lParam; - - switch (lpnm->code) - { - case PSN_SETACTIVE: - /* Enable the Next and Back buttons */ - PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_NEXT | PSWIZB_BACK); - break; - - case PSN_WIZNEXT: - /* Handle a Next button click, if necessary */ - PropSheet_SetCurSel(GetParent(hwndDlg), 0, 4); - break; - - default: - break; - } - break; - } - - default: - break; - } - - return FALSE; -} - -static INT_PTR CALLBACK -SearchDrvDlgProc( - IN HWND hwndDlg, - IN UINT uMsg, - IN WPARAM wParam, - IN LPARAM lParam) -{ - PDEVINSTDATA DevInstData; - DWORD dwThreadId; - - /* Retrieve pointer to the global setup data */ - DevInstData = (PDEVINSTDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA); - - switch (uMsg) - { - case WM_INITDIALOG: - { - HWND hwndControl; - DWORD dwStyle; - - /* Get pointer to the global setup data */ - DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam; - SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData); - - DevInstData->hDialog = hwndDlg; - hwndControl = GetParent(hwndDlg); - - /* Center the wizard window */ - CenterWindow (hwndControl); - - SendDlgItemMessage( - hwndDlg, - IDC_DEVICE, - WM_SETTEXT, - 0, - (LPARAM) DevInstData->buffer); - - /* Hide the system menu */ - dwStyle = GetWindowLong(hwndControl, GWL_STYLE); - SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU); - break; - } - - case WM_SEARCH_FINISHED: - { - CloseHandle(hThread); - hThread = 0; - if (wParam == 0) - PropSheet_SetCurSel(GetParent(hwndDlg), 0, IDD_NODRIVER); - else - PropSheet_SetCurSel(GetParent(hwndDlg), 0, IDD_FINISHPAGE); - break; - } - - case WM_NOTIFY: - { - LPNMHDR lpnm = (LPNMHDR)lParam; - - switch (lpnm->code) - { - case PSN_SETACTIVE: - PropSheet_SetWizButtons(GetParent(hwndDlg), !PSWIZB_NEXT | !PSWIZB_BACK); - hThread = CreateThread( NULL, 0, FindDriverProc, DevInstData, 0, &dwThreadId); - break; - - case PSN_KILLACTIVE: - if (hThread != 0) - { - SetWindowLong ( hwndDlg, DWL_MSGRESULT, TRUE); - return TRUE; - } - break; - - case PSN_WIZNEXT: - /* Handle a Next button click, if necessary */ - break; - - default: - break; - } - break; - } - - default: - break; - } - - return FALSE; -} - -static DWORD WINAPI -FindDriverProc( - IN LPVOID lpParam) -{ - TCHAR drive[] = {'?',':',0}; - size_t nType; - DWORD dwDrives; - PDEVINSTDATA DevInstData; - DWORD config_flags; - UINT i = 1; - - DevInstData = (PDEVINSTDATA)lpParam; - - dwDrives = GetLogicalDrives(); - for (drive[0] = 'A'; drive[0] <= 'Z'; drive[0]++) - { - if (dwDrives & i) - { - nType = GetDriveType( drive ); - if (nType == DRIVE_CDROM) - { - /* search for inf file */ - if (SearchDriver ( DevInstData, drive )) - { - /* if we found a valid driver inf... */ - if (FindDriver ( DevInstData, NULL )) - { - InstallDriver ( DevInstData ); - PostMessage(DevInstData->hDialog, WM_SEARCH_FINISHED, 1, 0); - return 0; - } - } - } - } - i <<= 1; - } - - /* update device configuration */ - if (SetupDiGetDeviceRegistryProperty( - DevInstData->hDevInfo, - &DevInstData->devInfoData, - SPDRP_CONFIGFLAGS, - NULL, - (BYTE *)&config_flags, - sizeof(config_flags), - NULL)) - { - config_flags |= CONFIGFLAG_FAILEDINSTALL; - SetupDiSetDeviceRegistryProperty( - DevInstData->hDevInfo, - &DevInstData->devInfoData, - SPDRP_CONFIGFLAGS, - (BYTE *)&config_flags, sizeof(config_flags) ); - } - - PostMessage(DevInstData->hDialog, WM_SEARCH_FINISHED, 0, 0); - return 0; -} - -static INT_PTR CALLBACK -FinishDlgProc( - IN HWND hwndDlg, - IN UINT uMsg, - IN WPARAM wParam, - IN LPARAM lParam) -{ - - PDEVINSTDATA DevInstData; - - /* Retrieve pointer to the global setup data */ - DevInstData = (PDEVINSTDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA); - - switch (uMsg) - { - case WM_INITDIALOG: - { - HWND hwndControl; - - /* Get pointer to the global setup data */ - DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam; - SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData); - - hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL); - ShowWindow (hwndControl, SW_HIDE); - EnableWindow (hwndControl, FALSE); - - SendDlgItemMessage( - hwndDlg, - IDC_DEVICE, - WM_SETTEXT, - 0, - (LPARAM) DevInstData->drvInfoData.Description); - - /* Set title font */ - SendDlgItemMessage( - hwndDlg, - IDC_FINISHTITLE, - WM_SETFONT, - (WPARAM)DevInstData->hTitleFont, - (LPARAM)TRUE); - break; - } - - case WM_NOTIFY: - { - LPNMHDR lpnm = (LPNMHDR)lParam; - - switch (lpnm->code) - { - case PSN_SETACTIVE: - /* Enable the correct buttons on for the active page */ - PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_FINISH); - break; - - case PSN_WIZBACK: - /* Handle a Back button click, if necessary */ - break; - - case PSN_WIZFINISH: - /* Handle a Finish button click, if necessary */ - break; - - default: - break; - } - break; - } - - default: - break; - } - - return FALSE; -} - -static INT_PTR CALLBACK -InstFailDlgProc( - IN HWND hwndDlg, - IN UINT uMsg, - IN WPARAM wParam, - IN LPARAM lParam) -{ - - PDEVINSTDATA DevInstData; - - /* Get pointer to the global setup data */ - DevInstData = (PDEVINSTDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA); - - switch (uMsg) - { - case WM_INITDIALOG: - { - HWND hwndControl; - BOOL DisableableDevice = FALSE; - - DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam; - SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData); - - hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL); - ShowWindow (hwndControl, SW_HIDE); - EnableWindow (hwndControl, FALSE); - - /* Set title font */ - SendDlgItemMessage( - hwndDlg, - IDC_FINISHTITLE, - WM_SETFONT, - (WPARAM)DevInstData->hTitleFont, - (LPARAM)TRUE); - - /* disable the "do not show this dialog anymore" checkbox - if the device cannot be disabled */ - CanDisableDevice( - DevInstData->devInfoData.DevInst, - NULL, - &DisableableDevice); - EnableWindow( - GetDlgItem(hwndDlg, IDC_DONOTSHOWDLG), - DisableableDevice); - break; - } - - case WM_NOTIFY: - { - LPNMHDR lpnm = (LPNMHDR)lParam; - - switch (lpnm->code) - { - case PSN_SETACTIVE: - /* Enable the correct buttons on for the active page */ - PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_BACK | PSWIZB_FINISH); - break; - - case PSN_WIZBACK: - PropSheet_SetCurSel(GetParent(hwndDlg), 0, IDD_WELCOMEPAGE); - /* Handle a Back button click, if necessary */ - break; - - case PSN_WIZFINISH: - { - BOOL DisableableDevice = FALSE; - BOOL IsStarted = FALSE; - - if (CanDisableDevice(DevInstData->devInfoData.DevInst, - NULL, - &DisableableDevice) && - DisableableDevice && - IsDeviceStarted( - DevInstData->devInfoData.DevInst, - NULL, - &IsStarted) && - !IsStarted && - SendDlgItemMessage( - hwndDlg, - IDC_DONOTSHOWDLG, - BM_GETCHECK, - (WPARAM) 0, (LPARAM) 0) == BST_CHECKED) - { - /* disable the device */ - StartDevice( - DevInstData->hDevInfo, - &DevInstData->devInfoData, - FALSE, - 0, - NULL); - } - break; - } - - default: - break; - } - break; - } - - default: - break; - } - - return FALSE; -} - - -static BOOL -FindDriver( +/* Directory and InfFile MUST NOT be specified simultaneously */ +BOOL +SearchDriver( IN PDEVINSTDATA DevInstData, - IN LPCWSTR InfFile OPTIONAL) + IN LPCTSTR Directory OPTIONAL, + IN LPCTSTR InfFile OPTIONAL) { SP_DEVINSTALL_PARAMS DevInstallParams = {0,}; BOOL ret; @@ -936,16 +261,30 @@ if (InfFile) { DevInstallParams.Flags |= DI_ENUMSINGLEINF; - wcscpy(DevInstallParams.DriverPath, InfFile); - } - - if (!SetupDiSetDeviceInstallParams(DevInstData->hDevInfo, &DevInstData->devInfoData, &DevInstallParams)) + _tcsncpy(DevInstallParams.DriverPath, InfFile, MAX_PATH); + } + else if (Directory) + { + DevInstallParams.Flags &= ~DI_ENUMSINGLEINF; + _tcsncpy(DevInstallParams.DriverPath, Directory, MAX_PATH); + } + else + *DevInstallParams.DriverPath = _T('\0'); + + ret = SetupDiSetDeviceInstallParams( + DevInstData->hDevInfo, + &DevInstData->devInfoData, + &DevInstallParams); + if (!ret) { TRACE("SetupDiSetDeviceInstallParams() failed with error 0x%lx\n", GetLastError()); return FALSE; } - ret = SetupDiBuildDriverInfoList(DevInstData->hDevInfo, &DevInstData->devInfoData, SPDIT_COMPATDRIVER); + ret = SetupDiBuildDriverInfoList( + DevInstData->hDevInfo, + &DevInstData->devInfoData, + SPDIT_COMPATDRIVER); if (!ret) { TRACE("SetupDiBuildDriverInfoList() failed with error 0x%lx\n", GetLastError()); @@ -966,7 +305,6 @@ TRACE("SetupDiEnumDriverInfo() failed with error 0x%lx\n", GetLastError()); return FALSE; } - TRACE("Installing driver %S: %S\n", DevInstData->drvInfoData.MfgName, DevInstData->drvInfoData.Description); return TRUE; } @@ -997,22 +335,22 @@ return _T(""); } -static BOOL -SearchDriver( +BOOL +SearchDriverRecursive( IN PDEVINSTDATA DevInstData, IN LPCTSTR Path) { WIN32_FIND_DATA wfd; - SP_DEVINSTALL_PARAMS DevInstallParams; TCHAR DirPath[MAX_PATH]; TCHAR FileName[MAX_PATH]; TCHAR FullPath[MAX_PATH]; TCHAR LastDirPath[MAX_PATH] = _T(""); TCHAR PathWithPattern[MAX_PATH]; BOOL ok = TRUE; - BOOL ret; - HANDLE hFindFile; - + BOOL retval = FALSE; + HANDLE hFindFile = INVALID_HANDLE_VALUE; + + TRACE("SearchDriverRecursive(%s)\n", Path); _tcscpy(DirPath, Path); if (DirPath[_tcsclen(DirPath) - 1] != '\\') @@ -1021,18 +359,21 @@ _tcscpy(PathWithPattern, DirPath); _tcscat(PathWithPattern, _T("\\*")); - for (hFindFile = FindFirstFile(PathWithPattern, &wfd); ((hFindFile != INVALID_HANDLE_VALUE) && ok); ok = FindNextFile(hFindFile, &wfd)) + for (hFindFile = FindFirstFile(PathWithPattern, &wfd); + ok && hFindFile != INVALID_HANDLE_VALUE; + ok = FindNextFile(hFindFile, &wfd)) { _tcscpy(FileName, wfd.cFileName); if (IsDots(FileName)) continue; - if((wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) - { + if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + { + /* Recursive search */ _tcscpy(FullPath, DirPath); _tcscat(FullPath, FileName); - if(SearchDriver(DevInstData, FullPath)) + if (SearchDriverRecursive(DevInstData, FullPath)) break; } else @@ -1042,48 +383,35 @@ if ((_tcscmp(pszExtension, _T(".inf")) == 0) && (_tcscmp(LastDirPath, DirPath) != 0)) { _tcscpy(LastDirPath, DirPath); - ZeroMemory (&DevInstallParams, sizeof(SP_DEVINSTALL_PARAMS)); - DevInstallParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS); - - ret = SetupDiGetDeviceInstallParams( - DevInstData->hDevInfo, - &DevInstData->devInfoData, - &DevInstallParams); - - if (_tcsclen(DirPath) <= MAX_PATH) + + if (_tcsclen(DirPath) > MAX_PATH) + /* Path is too long to be searched */ + continue; + + if (SearchDriver(DevInstData, DirPath, NULL)) { - memcpy(DevInstallParams.DriverPath, DirPath, (_tcsclen(DirPath) + 1) * sizeof(TCHAR)); + retval = TRUE; + goto cleanup; } - ret = SetupDiSetDeviceInstallParams( - DevInstData->hDevInfo, - &DevInstData->devInfoData, - &DevInstallParams); - - if ( FindDriver ( DevInstData, NULL ) ) - { - if (hFindFile != INVALID_HANDLE_VALUE) - FindClose(hFindFile); - return TRUE; - } - } } } +cleanup: if (hFindFile != INVALID_HANDLE_VALUE) FindClose(hFindFile); - - return FALSE; -} - -static BOOL -InstallDriver( + return retval; +} + +BOOL +InstallCurrentDriver( IN PDEVINSTDATA DevInstData) { - BOOL ret; + TRACE("Installing driver %S: %S\n", DevInstData->drvInfoData.MfgName, DevInstData->drvInfoData.Description); + ret = SetupDiCallClassInstaller( DIF_SELECTBESTCOMPATDRV, DevInstData->hDevInfo, @@ -1185,27 +513,6 @@ } return TRUE; -} - -static VOID -CleanUp(VOID) -{ - - if (DevInstData.devInfoData.cbSize != 0) - { - if (!SetupDiDestroyDriverInfoList(DevInstData.hDevInfo, &DevInstData.devInfoData, SPDIT_COMPATDRIVER)) - TRACE("SetupDiDestroyDriverInfoList() failed with error 0x%lx\n", GetLastError()); - } - - if (DevInstData.hDevInfo != INVALID_HANDLE_VALUE) - { - if (!SetupDiDestroyDeviceInfoList(DevInstData.hDevInfo)) - TRACE("SetupDiDestroyDeviceInfoList() failed with error 0x%lx\n", GetLastError()); - } - - if (DevInstData.buffer) - HeapFree(GetProcessHeap(), 0, DevInstData.buffer); - } /* @@ -1218,12 +525,10 @@ IN LPCWSTR InstanceId, IN INT Show) { - - PROPSHEETHEADER psh; - HPROPSHEETPAGE ahpsp[5]; - PROPSHEETPAGE psp; + PDEVINSTDATA DevInstData = NULL; BOOL ret; DWORD config_flags; + BOOL retval = FALSE; if (!IsUserAdmin()) { @@ -1231,46 +536,53 @@ ExitProcess(ERROR_ACCESS_DENIED); } + DevInstData = HeapAlloc(GetProcessHeap(), 0, sizeof(DEVINSTDATA)); + if (!DevInstData) + { + TRACE("HeapAlloc() failed\n"); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + goto cleanup; + } + /* Clear devinst data */ - ZeroMemory(&DevInstData, sizeof(DEVINSTDATA)); - DevInstData.devInfoData.cbSize = 0; /* Tell if the devInfoData is valid */ - - DevInstData.hDevInfo = SetupDiCreateDeviceInfoListExW(NULL, NULL, NULL, NULL); - if (DevInstData.hDevInfo == INVALID_HANDLE_VALUE) + ZeroMemory(DevInstData, sizeof(DEVINSTDATA)); + DevInstData->devInfoData.cbSize = 0; /* Tell if the devInfoData is valid */ + + /* Fill devinst data */ + DevInstData->hDevInfo = SetupDiCreateDeviceInfoListExW(NULL, NULL, NULL, NULL); + if (DevInstData->hDevInfo == INVALID_HANDLE_VALUE) { TRACE("SetupDiCreateDeviceInfoListExW() failed with error 0x%lx\n", GetLastError()); - CleanUp(); - return FALSE; - } - - DevInstData.devInfoData.cbSize = sizeof(SP_DEVINFO_DATA); + goto cleanup; + } + + DevInstData->devInfoData.cbSize = sizeof(SP_DEVINFO_DATA); ret = SetupDiOpenDeviceInfoW( - DevInstData.hDevInfo, + DevInstData->hDevInfo, InstanceId, NULL, 0, /* Open flags */ - &DevInstData.devInfoData); + &DevInstData->devInfoData); if (!ret) { TRACE("SetupDiOpenDeviceInfoW() failed with error 0x%lx (InstanceId %S)\n", GetLastError(), InstanceId); - DevInstData.devInfoData.cbSize = 0; - CleanUp(); - return FALSE; + DevInstData->devInfoData.cbSize = 0; + goto cleanup; } SetLastError(ERROR_GEN_FAILURE); ret = SetupDiGetDeviceRegistryProperty( - DevInstData.hDevInfo, - &DevInstData.devInfoData, + DevInstData->hDevInfo, + &DevInstData->devInfoData, SPDRP_DEVICEDESC, - &DevInstData.regDataType, + &DevInstData->regDataType, NULL, 0, - &DevInstData.requiredSize); - - if (!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER && DevInstData.regDataType == REG_SZ) - { - DevInstData.buffer = HeapAlloc(GetProcessHeap(), 0, DevInstData.requiredSize); - if (!DevInstData.buffer) + &DevInstData->requiredSize); + + if (!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER && DevInstData->regDataType == REG_SZ) + { + DevInstData->buffer = HeapAlloc(GetProcessHeap(), 0, DevInstData->requiredSize); + if (!DevInstData->buffer) { TRACE("HeapAlloc() failed\n"); SetLastError(ERROR_NOT_ENOUGH_MEMORY); @@ -1278,24 +590,23 @@ else { ret = SetupDiGetDeviceRegistryProperty( - DevInstData.hDevInfo, - &DevInstData.devInfoData, + DevInstData->hDevInfo, + &DevInstData->devInfoData, SPDRP_DEVICEDESC, - &DevInstData.regDataType, - DevInstData.buffer, DevInstData.requiredSize, - &DevInstData.requiredSize); + &DevInstData->regDataType, + DevInstData->buffer, DevInstData->requiredSize, + &DevInstData->requiredSize); } } if (!ret) { TRACE("SetupDiGetDeviceRegistryProperty() failed with error 0x%lx (InstanceId %S)\n", GetLastError(), InstanceId); - CleanUp(); - return FALSE; + goto cleanup; } if (SetupDiGetDeviceRegistryProperty( - DevInstData.hDevInfo, - &DevInstData.devInfoData, + DevInstData->hDevInfo, + &DevInstData->devInfoData, SPDRP_CONFIGFLAGS, NULL, (BYTE *)&config_flags, @@ -1304,77 +615,48 @@ { if (config_flags & CONFIGFLAG_FAILEDINSTALL) { - CleanUp(); - return TRUE; - } - } - - TRACE("Installing %S (%S)\n", DevInstData.buffer, InstanceId); - - if ((!FindDriver(&DevInstData, NULL)) && (Show != SW_HIDE)) - { - - /* Create the Welcome page */ - ZeroMemory (&psp, sizeof(PROPSHEETPAGE)); - psp.dwSize = sizeof(PROPSHEETPAGE); - psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER; - psp.hInstance = hDllInstance; - psp.lParam = (LPARAM)&DevInstData; - psp.pfnDlgProc = WelcomeDlgProc; - psp.pszTemplate = MAKEINTRESOURCE(IDD_WELCOMEPAGE); - ahpsp[IDD_WELCOMEPAGE] = CreatePropertySheetPage(&psp); - - /* Create the Select Source page */ - psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE; - psp.pfnDlgProc = CHSourceDlgProc; - psp.pszTemplate = MAKEINTRESOURCE(IDD_CHSOURCE); - ahpsp[IDD_CHSOURCE] = CreatePropertySheetPage(&psp); - - /* Create the Search driver page */ - psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE; - psp.pfnDlgProc = SearchDrvDlgProc; - psp.pszTemplate = MAKEINTRESOURCE(IDD_SEARCHDRV); - ahpsp[IDD_SEARCHDRV] = CreatePropertySheetPage(&psp); - - /* Create the Finish page */ - psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER; - psp.pfnDlgProc = FinishDlgProc; - psp.pszTemplate = MAKEINTRESOURCE(IDD_FINISHPAGE); - ahpsp[IDD_FINISHPAGE] = CreatePropertySheetPage(&psp); - - /* Create the Install failed page */ - psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER; - psp.pfnDlgProc = InstFailDlgProc; - psp.pszTemplate = MAKEINTRESOURCE(IDD_NODRIVER); - ahpsp[IDD_NODRIVER] = CreatePropertySheetPage(&psp); - - /* Create the property sheet */ - psh.dwSize = sizeof(PROPSHEETHEADER); - psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER; - psh.hInstance = hDllInstance; - psh.hwndParent = NULL; - psh.nPages = 5; - psh.nStartPage = 0; - psh.phpage = ahpsp; - psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK); - psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER); - - /* Create title font */ - DevInstData.hTitleFont = CreateTitleFont(); - - /* Display the wizard */ - PropertySheet(&psh); - - DeleteObject(DevInstData.hTitleFont); - - } - else - { - InstallDriver ( &DevInstData ); - } - - CleanUp(); - return TRUE; + /* The device is disabled */ + retval = TRUE; + goto cleanup; + } + } + + TRACE("Installing %S (%S)\n", DevInstData->buffer, InstanceId); + + /* Search driver in default location */ + if (SearchDriver(DevInstData, NULL, NULL)) + { + /* Driver found ; install it */ + retval = InstallCurrentDriver(DevInstData); + goto cleanup; + } + else if (Show == SW_HIDE) + { + /* We can't show the wizard. Fail the install */ + goto cleanup; + } + + /* Prepare the wizard, and display it */ + retval = DisplayWizard(DevInstData, hWndParent, IDD_WELCOMEPAGE); + +cleanup: + if (DevInstData) + { + if (DevInstData->devInfoData.cbSize != 0) + { + if (!SetupDiDestroyDriverInfoList(DevInstData->hDevInfo, &DevInstData->devInfoData, SPDIT_COMPATDRIVER)) + TRACE("SetupDiDestroyDriverInfoList() failed with error 0x%lx\n", GetLastError()); + } + if (DevInstData->hDevInfo != INVALID_HANDLE_VALUE) + { + if (!SetupDiDestroyDeviceInfoList(DevInstData->hDevInfo)) + TRACE("SetupDiDestroyDeviceInfoList() failed with error 0x%lx\n", GetLastError()); + } + HeapFree(GetProcessHeap(), 0, DevInstData->buffer); + HeapFree(GetProcessHeap(), 0, DevInstData); + } + + return retval; } /* Modified: trunk/reactos/dll/win32/newdev/newdev.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/newdev/newdev.h?r…
============================================================================== --- trunk/reactos/dll/win32/newdev/newdev.h (original) +++ trunk/reactos/dll/win32/newdev/newdev.h Fri May 26 02:55:13 2006 @@ -10,6 +10,8 @@ #include "resource.h" +extern HINSTANCE hDllInstance; + typedef struct _DEVINSTDATA { HFONT hTitleFont; @@ -20,6 +22,31 @@ HDEVINFO hDevInfo; SP_DEVINFO_DATA devInfoData; SP_DRVINFO_DATA drvInfoData; + + LPTSTR CustomSearchPath; /* MULTI_SZ string */ } DEVINSTDATA, *PDEVINSTDATA; #define WM_SEARCH_FINISHED (WM_USER + 10) + +/* newdev.c */ +BOOL +SearchDriver( + IN PDEVINSTDATA DevInstData, + IN LPCTSTR Directory OPTIONAL, + IN LPCTSTR InfFile OPTIONAL); + +BOOL +SearchDriverRecursive( + IN PDEVINSTDATA DevInstData, + IN LPCTSTR Path); + +BOOL +InstallCurrentDriver( + IN PDEVINSTDATA DevInstData); + +/* wizard.c */ +BOOL +DisplayWizard( + IN PDEVINSTDATA DevInstData, + IN HWND hwndParent, + IN UINT startPage); Modified: trunk/reactos/dll/win32/newdev/newdev.rbuild URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/newdev/newdev.rbu…
============================================================================== --- trunk/reactos/dll/win32/newdev/newdev.rbuild (original) +++ trunk/reactos/dll/win32/newdev/newdev.rbuild Fri May 26 02:55:13 2006 @@ -7,6 +7,7 @@ <define name="_WIN32_WINNT">0x0501</define> <file>newdev.c</file> <file>stubs.c</file> + <file>wizard.c</file> <file>newdev.rc</file> <file>newdev.spec</file> <library>wine</library> Modified: trunk/reactos/dll/win32/newdev/resource.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/newdev/resource.h…
============================================================================== --- trunk/reactos/dll/win32/newdev/resource.h (original) +++ trunk/reactos/dll/win32/newdev/resource.h Fri May 26 02:55:13 2006 @@ -1,10 +1,10 @@ #ifndef RESOURCE_H #define RESOURCE_H -#define IDB_WATERMARK 100 -#define IDB_HEADER 101 +#define IDB_WATERMARK 100 +#define IDB_HEADER 101 -#define IDC_STATIC -1 +#define IDC_STATIC -1 #define IDC_DEVICE 2000 #define IDC_RADIO_AUTO 2001 @@ -14,15 +14,16 @@ #define IDC_RADIO_CHOOSE 2005 #define IDC_CHECK_MEDIA 2006 #define IDC_CHECK_PATH 2007 -#define IDC_WELCOMETITLE 2008 +#define IDC_WELCOMETITLE 2008 #define IDC_BROWSE 2009 #define IDC_COMBO_PATH 2010 #define IDC_FINISHTITLE 2011 -#define IDD_WELCOMEPAGE 0 +#define IDD_WELCOMEPAGE 0 #define IDD_CHSOURCE 1 #define IDD_SEARCHDRV 2 -#define IDD_FINISHPAGE 3 +#define IDD_INSTALLDRV 3 #define IDD_NODRIVER 4 +#define IDD_FINISHPAGE 5 #endif /* RESOURCE_H */
18 years, 7 months
1
0
0
0
[amunger] 22048: Fix green, it just needed it's ObOpenObjectByName params shuffled. Hope I did it correctly.
by amunger@svn.reactos.org
Author: amunger Date: Fri May 26 01:39:49 2006 New Revision: 22048 URL:
http://svn.reactos.ru/svn/reactos?rev=22048&view=rev
Log: Fix green, it just needed it's ObOpenObjectByName params shuffled. Hope I did it correctly. Modified: trunk/reactos/drivers/base/green/pnp.c Modified: trunk/reactos/drivers/base/green/pnp.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/drivers/base/green/pnp.c?re…
============================================================================== --- trunk/reactos/drivers/base/green/pnp.c (original) +++ trunk/reactos/drivers/base/green/pnp.c Fri May 26 01:39:49 2006 @@ -50,8 +50,8 @@ Status = ObOpenObjectByName( &ObjectAttributes, IoDeviceObjectType, + KernelMode, NULL, - KernelMode, DesiredAccess, NULL, &LocalHandle);
18 years, 7 months
1
0
0
0
[ion] 22047: - Get rid of the intriguing idea that exported/public APIs should have prototypes with inversed parameters (fix ObOpenObjectByName and all its callers). - Isolate ObFindObject into CmFindObject for the registry routines. Because of their well-known abuse of Ob, it's better to give them their internal routine so that when/if Ob ever gets fixed to parse properly, it won't force a re-write of Cm's object routines.
by ion@svn.reactos.org
Author: ion Date: Fri May 26 00:50:58 2006 New Revision: 22047 URL:
http://svn.reactos.ru/svn/reactos?rev=22047&view=rev
Log: - Get rid of the intriguing idea that exported/public APIs should have prototypes with inversed parameters (fix ObOpenObjectByName and all its callers). - Isolate ObFindObject into CmFindObject for the registry routines. Because of their well-known abuse of Ob, it's better to give them their internal routine so that when/if Ob ever gets fixed to parse properly, it won't force a re-write of Cm's object routines. Modified: trunk/reactos/include/ddk/winddk.h trunk/reactos/ntoskrnl/cm/cm.h trunk/reactos/ntoskrnl/cm/ntfunc.c trunk/reactos/ntoskrnl/cm/registry.c trunk/reactos/ntoskrnl/cm/regobj.c trunk/reactos/ntoskrnl/ex/callback.c trunk/reactos/ntoskrnl/ex/event.c trunk/reactos/ntoskrnl/ex/evtpair.c trunk/reactos/ntoskrnl/ex/mutant.c trunk/reactos/ntoskrnl/ex/sem.c trunk/reactos/ntoskrnl/ex/timer.c trunk/reactos/ntoskrnl/io/file.c trunk/reactos/ntoskrnl/io/iocomp.c trunk/reactos/ntoskrnl/mm/section.c trunk/reactos/ntoskrnl/ob/obdir.c trunk/reactos/ntoskrnl/ob/obhandle.c trunk/reactos/ntoskrnl/ob/symlink.c trunk/reactos/ntoskrnl/ps/job.c trunk/reactos/ntoskrnl/ps/process.c trunk/reactos/ntoskrnl/ps/thread.c trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c Modified: trunk/reactos/include/ddk/winddk.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/include/ddk/winddk.h?rev=22…
============================================================================== --- trunk/reactos/include/ddk/winddk.h (original) +++ trunk/reactos/include/ddk/winddk.h Fri May 26 00:50:58 2006 @@ -9535,10 +9535,10 @@ ObOpenObjectByName( IN POBJECT_ATTRIBUTES ObjectAttributes, IN POBJECT_TYPE ObjectType, + IN KPROCESSOR_MODE AccessMode, + IN PACCESS_STATE PassedAccessState, + IN ACCESS_MASK DesiredAccess, IN OUT PVOID ParseContext OPTIONAL, - IN KPROCESSOR_MODE AccessMode, - IN ACCESS_MASK DesiredAccess, - IN PACCESS_STATE PassedAccessState, OUT PHANDLE Handle); NTOSAPI Modified: trunk/reactos/ntoskrnl/cm/cm.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/cm/cm.h?rev=22047&…
============================================================================== --- trunk/reactos/ntoskrnl/cm/cm.h (original) +++ trunk/reactos/ntoskrnl/cm/cm.h Fri May 26 00:50:58 2006 @@ -708,4 +708,15 @@ CmiSaveTempHive (PREGISTRY_HIVE Hive, HANDLE FileHandle); +NTSTATUS +NTAPI +CmFindObject( + POBJECT_CREATE_INFORMATION ObjectCreateInfo, + PUNICODE_STRING ObjectName, + PVOID* ReturnedObject, + PUNICODE_STRING RemainingPath, + POBJECT_TYPE ObjectType, + IN PACCESS_STATE AccessState, + IN PVOID ParseContext +); #endif /*__INCLUDE_CM_H*/ Modified: trunk/reactos/ntoskrnl/cm/ntfunc.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/cm/ntfunc.c?rev=22…
============================================================================== --- trunk/reactos/ntoskrnl/cm/ntfunc.c (original) +++ trunk/reactos/ntoskrnl/cm/ntfunc.c Fri May 26 00:50:58 2006 @@ -199,7 +199,6 @@ KPROCESSOR_MODE PreviousMode; UNICODE_STRING CapturedClass = {0}; HANDLE hKey; - OBP_LOOKUP_CONTEXT Context; PAGED_CODE(); @@ -259,12 +258,11 @@ goto Cleanup; } - Status = ObFindObject(&ObjectCreateInfo, + Status = CmFindObject(&ObjectCreateInfo, &ObjectName, (PVOID*)&Object, &RemainingPath, CmiKeyType, - &Context, NULL, NULL); if (!NT_SUCCESS(Status)) @@ -1266,7 +1264,6 @@ OBJECT_CREATE_INFORMATION ObjectCreateInfo; REG_PRE_OPEN_KEY_INFORMATION PreOpenKeyInfo; REG_POST_OPEN_KEY_INFORMATION PostOpenKeyInfo; - OBP_LOOKUP_CONTEXT Context; PAGED_CODE(); @@ -1330,12 +1327,11 @@ RemainingPath.Buffer = NULL; - Status = ObFindObject(&ObjectCreateInfo, + Status = CmFindObject(&ObjectCreateInfo, &ObjectName, (PVOID*)&Object, &RemainingPath, CmiKeyType, - &Context, NULL, NULL); if (!NT_SUCCESS(Status)) Modified: trunk/reactos/ntoskrnl/cm/registry.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/cm/registry.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/cm/registry.c (original) +++ trunk/reactos/ntoskrnl/cm/registry.c Fri May 26 00:50:58 2006 @@ -704,7 +704,6 @@ PWSTR SubName; UNICODE_STRING ObjectName; OBJECT_CREATE_INFORMATION ObjectCreateInfo; - OBP_LOOKUP_CONTEXT Context; DPRINT("CmiConnectHive(%p, %p) called.\n", KeyObjectAttributes, RegistryHive); @@ -722,12 +721,11 @@ return Status; } - Status = ObFindObject(&ObjectCreateInfo, + Status = CmFindObject(&ObjectCreateInfo, &ObjectName, (PVOID*)&ParentKey, &RemainingPath, CmiKeyType, - &Context, NULL, NULL); ObpReleaseCapturedAttributes(&ObjectCreateInfo); @@ -857,8 +855,8 @@ Status = ObOpenObjectByName (KeyObjectAttributes, CmiKeyType, + KernelMode, NULL, - KernelMode, STANDARD_RIGHTS_REQUIRED, NULL, &KeyHandle); Modified: trunk/reactos/ntoskrnl/cm/regobj.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/cm/regobj.c?rev=22…
============================================================================== --- trunk/reactos/ntoskrnl/cm/regobj.c (original) +++ trunk/reactos/ntoskrnl/cm/regobj.c Fri May 26 00:50:58 2006 @@ -23,7 +23,202 @@ PUNICODE_STRING TargetPath); /* FUNCTONS *****************************************************************/ - +NTSTATUS +NTAPI +CmFindObject(POBJECT_CREATE_INFORMATION ObjectCreateInfo, + PUNICODE_STRING ObjectName, + PVOID* ReturnedObject, + PUNICODE_STRING RemainingPath, + POBJECT_TYPE ObjectType, + IN PACCESS_STATE AccessState, + IN PVOID ParseContext) +{ + PVOID NextObject; + PVOID CurrentObject; + PVOID RootObject; + POBJECT_HEADER CurrentHeader; + NTSTATUS Status; + PWSTR current; + UNICODE_STRING PathString; + ULONG Attributes; + UNICODE_STRING CurrentUs; + OBP_LOOKUP_CONTEXT Context; + + PAGED_CODE(); + + DPRINT("CmindObject(ObjectCreateInfo %x, ReturnedObject %x, " + "RemainingPath %x)\n",ObjectCreateInfo,ReturnedObject,RemainingPath); + + RtlInitUnicodeString (RemainingPath, NULL); + + if (ObjectCreateInfo->RootDirectory == NULL) + { + ObReferenceObjectByPointer(NameSpaceRoot, + DIRECTORY_TRAVERSE, + NULL, + ObjectCreateInfo->ProbeMode); + CurrentObject = NameSpaceRoot; + } + else + { + Status = ObReferenceObjectByHandle(ObjectCreateInfo->RootDirectory, + 0, + NULL, + ObjectCreateInfo->ProbeMode, + &CurrentObject, + NULL); + if (!NT_SUCCESS(Status)) + { + return Status; + } + } + + if (ObjectName->Length == 0 || + ObjectName->Buffer[0] == UNICODE_NULL) + { + *ReturnedObject = CurrentObject; + return STATUS_SUCCESS; + } + + if (ObjectCreateInfo->RootDirectory == NULL && + ObjectName->Buffer[0] != L'\\') + { + ObDereferenceObject (CurrentObject); + DPRINT1("failed\n"); + return STATUS_UNSUCCESSFUL; + } + + /* Create a zero-terminated copy of the object name */ + PathString.Length = ObjectName->Length; + PathString.MaximumLength = ObjectName->Length + sizeof(WCHAR); + PathString.Buffer = ExAllocatePool (NonPagedPool, + PathString.MaximumLength); + if (PathString.Buffer == NULL) + { + ObDereferenceObject (CurrentObject); + return STATUS_INSUFFICIENT_RESOURCES; + } + + RtlCopyMemory (PathString.Buffer, + ObjectName->Buffer, + ObjectName->Length); + PathString.Buffer[PathString.Length / sizeof(WCHAR)] = UNICODE_NULL; + + current = PathString.Buffer; + + RootObject = CurrentObject; + Attributes = ObjectCreateInfo->Attributes; + if (ObjectType == ObSymbolicLinkType) + Attributes |= OBJ_OPENLINK; + + while (TRUE) + { + CurrentHeader = OBJECT_TO_OBJECT_HEADER(CurrentObject); + + /* Loop as long as we're dealing with a directory */ + while (CurrentHeader->Type == ObDirectoryType) + { + PWSTR Start, End; + PVOID FoundObject; + UNICODE_STRING StartUs; + NextObject = NULL; + + if (!current) goto Next; + + Start = current; + if (*Start == L'\\') Start++; + + End = wcschr(Start, L'\\'); + if (End != NULL) *End = 0; + + RtlInitUnicodeString(&StartUs, Start); + Context.DirectoryLocked = TRUE; + Context.Directory = CurrentObject; + FoundObject = ObpLookupEntryDirectory(CurrentObject, &StartUs, Attributes, FALSE, &Context); + if (FoundObject == NULL) + { + if (End != NULL) + { + *End = L'\\'; + } + goto Next; + } + + ObReferenceObjectByPointer(FoundObject, + STANDARD_RIGHTS_REQUIRED, + NULL, + UserMode); + if (End != NULL) + { + *End = L'\\'; + current = End; + } + else + { + current = NULL; + } + + NextObject = FoundObject; + +Next: + if (NextObject == NULL) + { + break; + } + ObDereferenceObject(CurrentObject); + CurrentObject = NextObject; + CurrentHeader = OBJECT_TO_OBJECT_HEADER(CurrentObject); + } + + if (CurrentHeader->Type->TypeInfo.ParseProcedure == NULL) + { + DPRINT("Current object can't parse\n"); + break; + } + + RtlInitUnicodeString(&CurrentUs, current); + Status = CurrentHeader->Type->TypeInfo.ParseProcedure(CurrentObject, + CurrentHeader->Type, + AccessState, + ExGetPreviousMode(), // fixme: should be a parameter, since caller decides. + Attributes, + &PathString, + &CurrentUs, + ParseContext, + NULL, // fixme: where do we get this from? captured OBP? + &NextObject); + current = CurrentUs.Buffer; + if (Status == STATUS_REPARSE) + { + /* reparse the object path */ + NextObject = NameSpaceRoot; + current = PathString.Buffer; + + ObReferenceObjectByPointer(NextObject, + DIRECTORY_TRAVERSE, + NULL, + ObjectCreateInfo->ProbeMode); + } + + + if (NextObject == NULL) + { + break; + } + ObDereferenceObject(CurrentObject); + CurrentObject = NextObject; + } + + if (current) + { + RtlpCreateUnicodeString (RemainingPath, current, NonPagedPool); + } + + RtlFreeUnicodeString (&PathString); + *ReturnedObject = CurrentObject; + + return STATUS_SUCCESS; +} NTSTATUS STDCALL CmiObjectParse(IN PVOID ParsedObject, Modified: trunk/reactos/ntoskrnl/ex/callback.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ex/callback.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ex/callback.c (original) +++ trunk/reactos/ntoskrnl/ex/callback.c Fri May 26 00:50:58 2006 @@ -205,8 +205,8 @@ { Status = ObOpenObjectByName(ObjectAttributes, ExCallbackObjectType, + KernelMode, NULL, - KernelMode, 0, NULL, &Handle); Modified: trunk/reactos/ntoskrnl/ex/event.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ex/event.c?rev=220…
============================================================================== --- trunk/reactos/ntoskrnl/ex/event.c (original) +++ trunk/reactos/ntoskrnl/ex/event.c Fri May 26 00:50:58 2006 @@ -212,8 +212,8 @@ /* Open the Object */ Status = ObOpenObjectByName(ObjectAttributes, ExEventObjectType, + PreviousMode, NULL, - PreviousMode, DesiredAccess, NULL, &hEvent); Modified: trunk/reactos/ntoskrnl/ex/evtpair.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ex/evtpair.c?rev=2…
============================================================================== --- trunk/reactos/ntoskrnl/ex/evtpair.c (original) +++ trunk/reactos/ntoskrnl/ex/evtpair.c Fri May 26 00:50:58 2006 @@ -164,8 +164,8 @@ /* Open the Object */ Status = ObOpenObjectByName(ObjectAttributes, ExEventPairObjectType, + PreviousMode, NULL, - PreviousMode, DesiredAccess, NULL, &hEventPair); Modified: trunk/reactos/ntoskrnl/ex/mutant.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ex/mutant.c?rev=22…
============================================================================== --- trunk/reactos/ntoskrnl/ex/mutant.c (original) +++ trunk/reactos/ntoskrnl/ex/mutant.c Fri May 26 00:50:58 2006 @@ -194,8 +194,8 @@ /* Open the Object */ Status = ObOpenObjectByName(ObjectAttributes, ExMutantObjectType, + PreviousMode, NULL, - PreviousMode, DesiredAccess, NULL, &hMutant); Modified: trunk/reactos/ntoskrnl/ex/sem.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ex/sem.c?rev=22047…
============================================================================== --- trunk/reactos/ntoskrnl/ex/sem.c (original) +++ trunk/reactos/ntoskrnl/ex/sem.c Fri May 26 00:50:58 2006 @@ -188,8 +188,8 @@ /* Open the Object */ Status = ObOpenObjectByName(ObjectAttributes, ExSemaphoreObjectType, + PreviousMode, NULL, - PreviousMode, DesiredAccess, NULL, &hSemaphore); Modified: trunk/reactos/ntoskrnl/ex/timer.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ex/timer.c?rev=220…
============================================================================== --- trunk/reactos/ntoskrnl/ex/timer.c (original) +++ trunk/reactos/ntoskrnl/ex/timer.c Fri May 26 00:50:58 2006 @@ -508,8 +508,8 @@ /* Open the Timer */ Status = ObOpenObjectByName(ObjectAttributes, ExTimerType, + PreviousMode, NULL, - PreviousMode, DesiredAccess, NULL, &hTimer); Modified: trunk/reactos/ntoskrnl/io/file.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/io/file.c?rev=2204…
============================================================================== --- trunk/reactos/ntoskrnl/io/file.c (original) +++ trunk/reactos/ntoskrnl/io/file.c Fri May 26 00:50:58 2006 @@ -931,8 +931,8 @@ /* First try to open an existing named object */ Status = ObOpenObjectByName(ObjectAttributes, NULL, + AccessMode, NULL, - AccessMode, DesiredAccess, NULL, &LocalHandle); Modified: trunk/reactos/ntoskrnl/io/iocomp.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/io/iocomp.c?rev=22…
============================================================================== --- trunk/reactos/ntoskrnl/io/iocomp.c (original) +++ trunk/reactos/ntoskrnl/io/iocomp.c Fri May 26 00:50:58 2006 @@ -322,8 +322,8 @@ /* Open the Object */ Status = ObOpenObjectByName(ObjectAttributes, IoCompletionType, + PreviousMode, NULL, - PreviousMode, DesiredAccess, NULL, &hIoCompletionHandle); Modified: trunk/reactos/ntoskrnl/mm/section.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/mm/section.c?rev=2…
============================================================================== --- trunk/reactos/ntoskrnl/mm/section.c (original) +++ trunk/reactos/ntoskrnl/mm/section.c Fri May 26 00:50:58 2006 @@ -3463,8 +3463,8 @@ Status = ObOpenObjectByName(ObjectAttributes, MmSectionObjectType, + PreviousMode, NULL, - PreviousMode, DesiredAccess, NULL, &hSection); Modified: trunk/reactos/ntoskrnl/ob/obdir.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ob/obdir.c?rev=220…
============================================================================== --- trunk/reactos/ntoskrnl/ob/obdir.c (original) +++ trunk/reactos/ntoskrnl/ob/obdir.c Fri May 26 00:50:58 2006 @@ -334,8 +334,8 @@ /* Open the directory object */ Status = ObOpenObjectByName(ObjectAttributes, ObDirectoryType, + PreviousMode, NULL, - PreviousMode, DesiredAccess, NULL, &hDirectory); Modified: trunk/reactos/ntoskrnl/ob/obhandle.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ob/obhandle.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ob/obhandle.c (original) +++ trunk/reactos/ntoskrnl/ob/obhandle.c Fri May 26 00:50:58 2006 @@ -748,10 +748,10 @@ NTAPI ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes, IN POBJECT_TYPE ObjectType, + IN KPROCESSOR_MODE AccessMode, + IN PACCESS_STATE PassedAccessState, + IN ACCESS_MASK DesiredAccess, IN OUT PVOID ParseContext, - IN KPROCESSOR_MODE AccessMode, - IN ACCESS_MASK DesiredAccess, - IN PACCESS_STATE PassedAccessState, OUT PHANDLE Handle) { UNICODE_STRING RemainingPath; Modified: trunk/reactos/ntoskrnl/ob/symlink.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ob/symlink.c?rev=2…
============================================================================== --- trunk/reactos/ntoskrnl/ob/symlink.c (original) +++ trunk/reactos/ntoskrnl/ob/symlink.c Fri May 26 00:50:58 2006 @@ -403,8 +403,8 @@ /* Open the object */ Status = ObOpenObjectByName(ObjectAttributes, ObSymbolicLinkType, + PreviousMode, NULL, - PreviousMode, DesiredAccess, NULL, &hLink); Modified: trunk/reactos/ntoskrnl/ps/job.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ps/job.c?rev=22047…
============================================================================== --- trunk/reactos/ntoskrnl/ps/job.c (original) +++ trunk/reactos/ntoskrnl/ps/job.c Fri May 26 00:50:58 2006 @@ -413,8 +413,8 @@ { Status = ObOpenObjectByName(ObjectAttributes, PsJobType, + PreviousMode, NULL, - PreviousMode, DesiredAccess, NULL, &hJob); Modified: trunk/reactos/ntoskrnl/ps/process.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ps/process.c?rev=2…
============================================================================== --- trunk/reactos/ntoskrnl/ps/process.c (original) +++ trunk/reactos/ntoskrnl/ps/process.c Fri May 26 00:50:58 2006 @@ -1004,8 +1004,8 @@ DPRINT("Opening by name\n"); Status = ObOpenObjectByName(ObjectAttributes, PsProcessType, + PreviousMode, NULL, - PreviousMode, DesiredAccess, NULL, &hProcess); Modified: trunk/reactos/ntoskrnl/ps/thread.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ps/thread.c?rev=22…
============================================================================== --- trunk/reactos/ntoskrnl/ps/thread.c (original) +++ trunk/reactos/ntoskrnl/ps/thread.c Fri May 26 00:50:58 2006 @@ -720,8 +720,8 @@ /* Open it */ Status = ObOpenObjectByName(ObjectAttributes, PsThreadType, + PreviousMode, NULL, - PreviousMode, DesiredAccess, NULL, &hThread); Modified: trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c Fri May 26 00:50:58 2006 @@ -345,8 +345,8 @@ Status = ObOpenObjectByName(&ObjectAttributes, ExWindowStationObjectType, + KernelMode, NULL, - KernelMode, 0, NULL, (HANDLE*)hWinSta); @@ -379,8 +379,8 @@ Status = ObOpenObjectByName(&ObjectAttributes, ExDesktopObjectType, + KernelMode, NULL, - KernelMode, 0, NULL, (HANDLE*)hDesktop); @@ -926,10 +926,10 @@ Status = ObOpenObjectByName( &ObjectAttributes, ExDesktopObjectType, + KernelMode, + NULL, + dwDesiredAccess, (PVOID)&DummyContext, - KernelMode, - dwDesiredAccess, - NULL, (HANDLE*)&Desktop); if (!NT_SUCCESS(Status)) RETURN(NULL); if (Status == STATUS_OBJECT_NAME_EXISTS) @@ -1129,8 +1129,8 @@ Status = ObOpenObjectByName( &ObjectAttributes, ExDesktopObjectType, + KernelMode, NULL, - KernelMode, dwDesiredAccess, NULL, (HANDLE*)&Desktop); Modified: trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c Fri May 26 00:50:58 2006 @@ -444,8 +444,8 @@ Status = ObOpenObjectByName( &ObjectAttributes, ExWindowStationObjectType, + KernelMode, NULL, - KernelMode, dwDesiredAccess, NULL, (PVOID*)&WindowStation); @@ -603,8 +603,8 @@ Status = ObOpenObjectByName( &ObjectAttributes, ExWindowStationObjectType, + UserMode, NULL, - UserMode, dwDesiredAccess, NULL, (PVOID*)&WindowStation);
18 years, 7 months
1
0
0
0
← Newer
1
...
6
7
8
9
10
11
12
...
38
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
Results per page:
10
25
50
100
200