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
July 2008
----- 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
25 participants
761 discussions
Start a n
N
ew thread
[jimtabor] 34379: - Removed NtUserGetWindowThreadProcessId, updated all related. Wanting to remove this since I first joined. - Tested with all my test apps.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Tue Jul 8 23:30:10 2008 New Revision: 34379 URL:
http://svn.reactos.org/svn/reactos?rev=34379&view=rev
Log: - Removed NtUserGetWindowThreadProcessId, updated all related. Wanting to remove this since I first joined. - Tested with all my test apps. Modified: trunk/reactos/dll/win32/user32/windows/window.c trunk/reactos/include/reactos/win32k/ntuser.h trunk/reactos/subsystems/win32/win32k/ntuser/window.c trunk/reactos/subsystems/win32/win32k/w32ksvc.db Modified: trunk/reactos/dll/win32/user32/windows/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/w…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/window.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/window.c [iso-8859-1] Tue Jul 8 23:30:10 2008 @@ -1294,7 +1294,30 @@ GetWindowThreadProcessId(HWND hWnd, LPDWORD lpdwProcessId) { - return NtUserGetWindowThreadProcessId(hWnd, lpdwProcessId); + DWORD Ret = 0; + PW32THREADINFO ti; + PWINDOW pWnd = ValidateHwnd(hWnd); + + if (!pWnd) return Ret; + + ti = pWnd->ti; + + if ( ti ) + { + if ( ti == GetW32ThreadInfo() ) + { // We are current. + if ( lpdwProcessId ) + *lpdwProcessId = (DWORD)NtCurrentTeb()->Cid.UniqueProcess; + Ret = (DWORD)NtCurrentTeb()->Cid.UniqueThread; + } + else + { // Ask kernel for info. + if ( lpdwProcessId ) + *lpdwProcessId = NtUserQueryWindow(hWnd, QUERY_WINDOW_UNIQUE_PROCESS_ID); + Ret = NtUserQueryWindow(hWnd, QUERY_WINDOW_UNIQUE_THREAD_ID); + } + } + return Ret; } @@ -1604,7 +1627,7 @@ LPCSTR lpString) { DWORD ProcessId; - if(!NtUserGetWindowThreadProcessId(hWnd, &ProcessId)) + if(!GetWindowThreadProcessId(hWnd, &ProcessId)) { return FALSE; } @@ -1644,7 +1667,7 @@ LPCWSTR lpString) { DWORD ProcessId; - if(!NtUserGetWindowThreadProcessId(hWnd, &ProcessId)) + if(!GetWindowThreadProcessId(hWnd, &ProcessId)) { return FALSE; } Modified: trunk/reactos/include/reactos/win32k/ntuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntu…
============================================================================== --- trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] Tue Jul 8 23:30:10 2008 @@ -2725,11 +2725,6 @@ NTAPI NtUserGetWindowLong(HWND hWnd, DWORD Index, BOOL Ansi); -DWORD -NTAPI -NtUserGetWindowThreadProcessId(HWND hWnd, LPDWORD UnsafePid); - - /* (other FocusedItem values give the position of the focused item) */ #define NO_SELECTED_ITEM 0xffff Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] Tue Jul 8 23:30:10 2008 @@ -3883,39 +3883,6 @@ CLEANUP: DPRINT("Leave NtUserGetWindowPlacement, ret=%i\n",_ret_); - UserLeave(); - END_CLEANUP; -} - - -/* - * @implemented - */ -DWORD STDCALL -NtUserGetWindowThreadProcessId(HWND hWnd, LPDWORD UnsafePid) -{ - PWINDOW_OBJECT Wnd; - DWORD tid, pid; - DECLARE_RETURN(DWORD); - - DPRINT("Enter NtUserGetWindowThreadProcessId\n"); - UserEnterShared(); - - if (!(Wnd = UserGetWindowObject(hWnd))) - { - RETURN( 0); - } - - tid = (DWORD)IntGetWndThreadId(Wnd); - pid = (DWORD)IntGetWndProcessId(Wnd); - - if (UnsafePid) - MmCopyToCaller(UnsafePid, &pid, sizeof(DWORD)); - - RETURN( tid); - -CLEANUP: - DPRINT("Leave NtUserGetWindowThreadProcessId, ret=%i\n",_ret_); UserLeave(); END_CLEANUP; } Modified: trunk/reactos/subsystems/win32/win32k/w32ksvc.db URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/w3…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/w32ksvc.db [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/w32ksvc.db [iso-8859-1] Tue Jul 8 23:30:10 2008 @@ -690,7 +690,6 @@ NtUserGetShellWindow 0 NtUserGetWindow 2 NtUserGetWindowLong 3 -NtUserGetWindowThreadProcessId 2 NtUserMenuInfo 3 NtUserMenuItemInfo 5 NtUserMonitorFromPoint 3
16 years, 5 months
1
0
0
0
[jimtabor] 34378: - Removed NtUserGetProp, updated all related. - Tested with FF, OOo, Seamonkey, putty, etc, and standard loaded apps. We use GetProp more than anyone thinks.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Tue Jul 8 22:29:43 2008 New Revision: 34378 URL:
http://svn.reactos.org/svn/reactos?rev=34378&view=rev
Log: - Removed NtUserGetProp, updated all related. - Tested with FF, OOo, Seamonkey, putty, etc, and standard loaded apps. We use GetProp more than anyone thinks. Modified: trunk/reactos/dll/win32/user32/windows/prop.c trunk/reactos/include/reactos/win32k/ntuser.h trunk/reactos/subsystems/win32/win32k/include/window.h trunk/reactos/subsystems/win32/win32k/ntuser/prop.c trunk/reactos/subsystems/win32/win32k/ntuser/window.c trunk/reactos/subsystems/win32/win32k/w32ksvc.db Modified: trunk/reactos/dll/win32/user32/windows/prop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/p…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/prop.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/prop.c [iso-8859-1] Tue Jul 8 22:29:43 2008 @@ -32,13 +32,51 @@ #include <wine/debug.h> +WINE_DEFAULT_DEBUG_CHANNEL(user32); + typedef struct _PROPLISTITEM { ATOM Atom; HANDLE Data; } PROPLISTITEM, *PPROPLISTITEM; +typedef struct _PROPERTY +{ + LIST_ENTRY PropListEntry; + HANDLE Data; + ATOM Atom; +} PROPERTY, *PPROPERTY; + #define ATOM_BUFFER_SIZE 256 + +/* INTERNAL FUNCTIONS ********************************************************/ + +HANDLE +FASTCALL +IntGetProp(HWND hWnd, ATOM Atom) +{ + PLIST_ENTRY ListEntry, temp; + PPROPERTY Property; + PWINDOW pWnd; + int i; + + pWnd = ValidateHwnd(hWnd); + if (!pWnd) return NULL; + + ListEntry = SharedPtrToUser(pWnd->PropListHead.Flink); + for (i = 0; i < pWnd->PropListItems; i++ ) + { + Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry); + if (Property->Atom == Atom) + { + return(Property); + } + temp = ListEntry->Flink; + ListEntry = SharedPtrToUser(temp); + } + return NULL; +} + /* FUNCTIONS *****************************************************************/ @@ -345,15 +383,19 @@ GetPropW(HWND hWnd, LPCWSTR lpString) { ATOM Atom; - if (HIWORD(lpString)) - { - Atom = GlobalFindAtomW(lpString); - } - else - { - Atom = LOWORD((DWORD)lpString); - } - return(NtUserGetProp(hWnd, Atom)); + HANDLE Data = NULL; + PPROPERTY Prop; + if (HIWORD(lpString)) + { + Atom = GlobalFindAtomW(lpString); + } + else + { + Atom = LOWORD((DWORD)lpString); + } + Prop = IntGetProp(hWnd, Atom); + if (Prop != NULL) Data = Prop->Data; + return Data; } Modified: trunk/reactos/include/reactos/win32k/ntuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntu…
============================================================================== --- trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] Tue Jul 8 22:29:43 2008 @@ -155,6 +155,9 @@ DWORD ContextHelpId; HWND hWndLastActive; + /* Property list head.*/ + LIST_ENTRY PropListHead; + ULONG PropListItems; struct { @@ -2702,10 +2705,6 @@ OUT LPMONITORINFO pMonitorInfo); /* Should be done in usermode */ -HANDLE -NTAPI -NtUserGetProp(HWND hWnd, ATOM Atom); // Done in both User/Kernel - BOOL NTAPI NtUserGetScrollInfo( Modified: trunk/reactos/subsystems/win32/win32k/include/window.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/window.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/window.h [iso-8859-1] Tue Jul 8 22:29:43 2008 @@ -53,9 +53,6 @@ HWND hOwner; /* DC Entries (DCE) */ PDCE Dce; - /* Property list head.*/ - LIST_ENTRY PropListHead; - ULONG PropListItems; /* Scrollbar info */ PWINDOW_SCROLLINFO Scroll; PETHREAD OwnerThread; Modified: trunk/reactos/subsystems/win32/win32k/ntuser/prop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/prop.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/prop.c [iso-8859-1] Tue Jul 8 22:29:43 2008 @@ -16,8 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id$ - * +/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel * PURPOSE: Window properties @@ -52,8 +51,8 @@ PLIST_ENTRY ListEntry; PPROPERTY Property; - ListEntry = Window->PropListHead.Flink; - while (ListEntry != &Window->PropListHead) + ListEntry = Window->Wnd->PropListHead.Flink; + while (ListEntry != &Window->Wnd->PropListHead) { Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry); if (Property->Atom == Atom) @@ -96,8 +95,8 @@ /* copy list */ li = (PROPLISTITEM *)Buffer; - ListEntry = Window->PropListHead.Flink; - while((BufferSize >= sizeof(PROPLISTITEM)) && (ListEntry != &Window->PropListHead)) + ListEntry = Window->Wnd->PropListHead.Flink; + while((BufferSize >= sizeof(PROPLISTITEM)) && (ListEntry != &Window->Wnd->PropListHead)) { Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry); listitem.Atom = Property->Atom; @@ -118,7 +117,7 @@ } else { - Cnt = Window->PropListItems * sizeof(PROPLISTITEM); + Cnt = Window->Wnd->PropListItems * sizeof(PROPLISTITEM); } if(Count) @@ -162,8 +161,8 @@ } Data = Prop->Data; RemoveEntryList(&Prop->PropListEntry); - ExFreePool(Prop); - Window->PropListItems--; + UserHeapFree(Prop); + Window->Wnd->PropListItems--; RETURN(Data); @@ -173,54 +172,25 @@ END_CLEANUP; } -HANDLE STDCALL -NtUserGetProp(HWND hWnd, ATOM Atom) -{ - PWINDOW_OBJECT Window; - PPROPERTY Prop; - HANDLE Data = NULL; - DECLARE_RETURN(HANDLE); - - DPRINT("Enter NtUserGetProp\n"); - UserEnterShared(); - - if (!(Window = UserGetWindowObject(hWnd))) - { - RETURN( FALSE); - } - - Prop = IntGetProp(Window, Atom); - if (Prop != NULL) - { - Data = Prop->Data; - } - - RETURN(Data); - -CLEANUP: - DPRINT("Leave NtUserGetProp, ret=%i\n",_ret_); - UserLeave(); - END_CLEANUP; -} static BOOL FASTCALL -IntSetProp(PWINDOW_OBJECT Wnd, ATOM Atom, HANDLE Data) +IntSetProp(PWINDOW_OBJECT pWnd, ATOM Atom, HANDLE Data) { PPROPERTY Prop; - Prop = IntGetProp(Wnd, Atom); + Prop = IntGetProp(pWnd, Atom); if (Prop == NULL) { - Prop = ExAllocatePoolWithTag(PagedPool, sizeof(PROPERTY), TAG_WNDPROP); + Prop = UserHeapAlloc(sizeof(PROPERTY)); if (Prop == NULL) { return FALSE; } Prop->Atom = Atom; - InsertTailList(&Wnd->PropListHead, &Prop->PropListEntry); - Wnd->PropListItems++; + InsertTailList(&pWnd->Wnd->PropListHead, &Prop->PropListEntry); + pWnd->Wnd->PropListItems++; } Prop->Data = Data; Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] Tue Jul 8 22:29:43 2008 @@ -1710,7 +1710,7 @@ Window->NextSibling = NULL; Wnd->ExtraDataSize = Wnd->Class->WndExtra; - InitializeListHead(&Window->PropListHead); + InitializeListHead(&Wnd->PropListHead); InitializeListHead(&Window->WndObjListHead); if (NULL != WindowName->Buffer && WindowName->Length > 0) Modified: trunk/reactos/subsystems/win32/win32k/w32ksvc.db URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/w3…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/w32ksvc.db [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/w32ksvc.db [iso-8859-1] Tue Jul 8 22:29:43 2008 @@ -686,7 +686,6 @@ NtUserGetLastInputInfo 1 NtUserGetMinMaxInfo 3 NtUserGetMonitorInfo 2 -NtUserGetProp 2 NtUserGetScrollInfo 3 NtUserGetShellWindow 0 NtUserGetWindow 2
16 years, 5 months
1
0
0
0
[fireball] 34377: Yuriy Sidorov <jura@cp-lab.com> - Always call ZwRaiseException in user mode and RtlDispatchException in kernel mode. - If RtlDispatchException failed call ZwRaiseException in kernel mode. Otherwise unhandled RtlRaiseException() call in kernel mode simply ignored (do nothing)! - Call RtlRaiseStatus in RtlRaiseException, if something went wrong. See issue #3434 for more details.
by fireball@svn.reactos.org
Author: fireball Date: Tue Jul 8 16:17:47 2008 New Revision: 34377 URL:
http://svn.reactos.org/svn/reactos?rev=34377&view=rev
Log: Yuriy Sidorov <jura(a)cp-lab.com> - Always call ZwRaiseException in user mode and RtlDispatchException in kernel mode. - If RtlDispatchException failed call ZwRaiseException in kernel mode. Otherwise unhandled RtlRaiseException() call in kernel mode simply ignored (do nothing)! - Call RtlRaiseStatus in RtlRaiseException, if something went wrong. See issue #3434 for more details. Modified: trunk/reactos/lib/rtl/exception.c Modified: trunk/reactos/lib/rtl/exception.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/exception.c?rev=34…
============================================================================== --- trunk/reactos/lib/rtl/exception.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/exception.c [iso-8859-1] Tue Jul 8 16:17:47 2008 @@ -41,8 +41,8 @@ /* Write the context flag */ Context.ContextFlags = CONTEXT_FULL; - /* Check if we're being debugged (user-mode only) */ - if (!RtlpCheckForActiveDebugger(TRUE)) + /* Check mode */ + if (RtlpGetMode() == UserMode) { /* Raise an exception immediately */ Status = ZwRaiseException(ExceptionRecord, &Context, TRUE); @@ -50,7 +50,7 @@ else { /* Dispatch the exception and check if we should continue */ - if (RtlDispatchException(ExceptionRecord, &Context)) + if (!RtlDispatchException(ExceptionRecord, &Context)) { /* Raise the exception */ Status = ZwRaiseException(ExceptionRecord, &Context, FALSE); @@ -62,8 +62,8 @@ } } - /* We should never return */ - while (TRUE); + /* If we returned, raise a status */ + RtlRaiseStatus(Status); } /* @@ -94,8 +94,8 @@ /* Write the context flag */ Context.ContextFlags = CONTEXT_FULL; - /* Check if we're being debugged (user-mode only) */ - if (!RtlpCheckForActiveDebugger(TRUE)) + /* Check mode */ + if (RtlpGetMode() == UserMode) { /* Raise an exception immediately */ ZwRaiseException(&ExceptionRecord, &Context, TRUE);
16 years, 5 months
1
0
0
0
[pschweitzer] 34376: Apply r33078 fix to r34369 to "prevent mshtml registration (doesn't work yet)" See issue #3189 for more details.
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Tue Jul 8 16:12:38 2008 New Revision: 34376 URL:
http://svn.reactos.org/svn/reactos?rev=34376&view=rev
Log: Apply r33078 fix to r34369 to "prevent mshtml registration (doesn't work yet)" See issue #3189 for more details. Modified: trunk/reactos/dll/win32/mshtml/mshtml.rbuild Modified: trunk/reactos/dll/win32/mshtml/mshtml.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/mshtml.rb…
============================================================================== --- trunk/reactos/dll/win32/mshtml/mshtml.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mshtml/mshtml.rbuild [iso-8859-1] Tue Jul 8 16:12:38 2008 @@ -2,7 +2,7 @@ <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> <group> <module name="mshtml" type="win32dll" baseaddress="${BASEADDRESS_MSHTML}" installbase="system32" installname="mshtml.dll" allowwarnings="true"> - <autoregister infsection="OleControlDlls" type="Both" /> + <!--autoregister infsection="OleControlDlls" type="Both" /--> <importlibrary definition="mshtml.spec.def" /> <include base="mshtml">.</include> <include base="ReactOS">include/reactos/wine</include>
16 years, 5 months
1
0
0
0
[fireball] 34375: Autosyncing with Wine HEAD
by fireball@svn.reactos.org
Author: fireball Date: Tue Jul 8 15:52:29 2008 New Revision: 34375 URL:
http://svn.reactos.org/svn/reactos?rev=34375&view=rev
Log: Autosyncing with Wine HEAD Added: trunk/reactos/dll/win32/msvfw32/msvfw32_Da.rc (with props) trunk/reactos/dll/win32/msvfw32/msvfw32_Ru.rc (with props) trunk/reactos/dll/win32/msvfw32/msvfw32_Si.rc (with props) Modified: trunk/reactos/dll/win32/msi/action.c trunk/reactos/dll/win32/msi/automation.c trunk/reactos/dll/win32/msi/database.c trunk/reactos/dll/win32/msi/files.c trunk/reactos/dll/win32/msi/helpers.c trunk/reactos/dll/win32/msi/msi.c trunk/reactos/dll/win32/msi/msi.spec trunk/reactos/dll/win32/msi/msi_Sv.rc trunk/reactos/dll/win32/msi/msipriv.h trunk/reactos/dll/win32/msi/package.c trunk/reactos/dll/win32/msi/registry.c trunk/reactos/dll/win32/msi/source.c trunk/reactos/dll/win32/msvfw32/drawdib.c trunk/reactos/dll/win32/msvfw32/msvfw32_Es.rc trunk/reactos/dll/win32/msvfw32/msvfw32_No.rc trunk/reactos/dll/win32/msvfw32/msvfw32_Sv.rc trunk/reactos/dll/win32/msvfw32/rsrc.rc trunk/reactos/dll/win32/netapi32/access.c trunk/reactos/dll/win32/netapi32/ds.c trunk/reactos/dll/win32/netapi32/nbnamecache.h trunk/reactos/dll/win32/netapi32/wksta.c Modified: trunk/reactos/dll/win32/msi/action.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/action.c?rev…
============================================================================== --- trunk/reactos/dll/win32/msi/action.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/action.c [iso-8859-1] Tue Jul 8 15:52:29 2008 @@ -648,6 +648,30 @@ return ERROR_SUCCESS; } +static UINT msi_set_context(MSIPACKAGE *package) +{ + WCHAR val[10]; + DWORD sz = 10; + DWORD num; + UINT r; + + static const WCHAR szOne[] = {'1',0}; + static const WCHAR szAllUsers[] = {'A','L','L','U','S','E','R','S',0}; + + package->Context = MSIINSTALLCONTEXT_USERUNMANAGED; + + r = MSI_GetPropertyW(package, szAllUsers, val, &sz); + if (r == ERROR_SUCCESS) + { + num = atolW(val); + if (num == 1 || num == 2) + package->Context = MSIINSTALLCONTEXT_MACHINE; + } + + MSI_SetPropertyW(package, szAllUsers, szOne); + return ERROR_SUCCESS; +} + /**************************************************** * TOP level entry points *****************************************************/ @@ -710,6 +734,7 @@ /* properties may have been added by a transform */ msi_clone_properties( package ); + msi_set_context( package ); if ( (msi_get_property_int(package, szUILevel, 0) & INSTALLUILEVEL_MASK) >= INSTALLUILEVEL_REDUCED ) { @@ -1464,6 +1489,25 @@ file->IsCompressed = package->WordCount & MSIWORDCOUNT_COMPRESSED; } + if (!file->IsCompressed) + { + LPWSTR p, path; + + p = resolve_folder(package, file->Component->Directory, + TRUE, FALSE, TRUE, NULL); + path = build_directory_name(2, p, file->ShortName); + + if (file->LongName && + GetFileAttributesW(path) == INVALID_FILE_ATTRIBUTES) + { + msi_free(path); + path = build_directory_name(2, p, file->LongName); + } + + file->SourcePath = path; + msi_free(p); + } + load_file_hash(package, file); TRACE("File Loaded (%s)\n",debugstr_w(file->File)); @@ -1601,10 +1645,10 @@ MSI_SetPropertyW(package, szCosting, szZero); MSI_SetPropertyW(package, cszRootDrive, c_colon); + load_all_folders( package ); load_all_components( package ); load_all_features( package ); load_all_files( package ); - load_all_folders( package ); return ERROR_SUCCESS; } @@ -1780,9 +1824,6 @@ * 9) FILEADDLOCAL * 10) FILEADDSOURCE * 11) FILEADDDEFAULT - * I have confirmed that if ADDLOCAL is stated then the INSTALLLEVEL is - * ignored for all the features. seems strange, especially since it is not - * documented anywhere, but it is how it works. * * I am still ignoring a lot of these. But that is ok for now, ADDLOCAL and * REMOVE are the big ones, since we don't handle administrative installs @@ -1840,8 +1881,11 @@ { ComponentList *cl; - TRACE("Examining Feature %s (Installed %i, Action %i)\n", - debugstr_w(feature->Feature), feature->Installed, feature->Action); + TRACE("Examining Feature %s (Level %i, Installed %i, Action %i)\n", + debugstr_w(feature->Feature), feature->Level, feature->Installed, feature->Action); + + if (!feature->Level) + continue; /* features with components that have compressed files are made local */ LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry ) @@ -2003,7 +2047,7 @@ { static const WCHAR name_fmt[] = {'%','u','.','%','u','.','%','u','.','%','u',0}; - static WCHAR name[] = {'\\',0}; + static const WCHAR name[] = {'\\',0}; VS_FIXEDFILEINFO *lpVer; WCHAR filever[0x100]; LPVOID version; @@ -2803,15 +2847,11 @@ WCHAR squished_cc[GUID_SIZE]; UINT rc; MSICOMPONENT *comp; - HKEY hkey=0,hkey2=0; + HKEY hkey; TRACE("\n"); - /* writes the Component and Features values to the registry */ - - rc = MSIREG_OpenComponents(&hkey); - if (rc != ERROR_SUCCESS) - return rc; + /* writes the Component values to the registry */ squash_guid(package->ProductCode,squished_pc); ui_progress(package,1,COMPONENT_PROGRESS_VALUE,1,0); @@ -2843,14 +2883,16 @@ */ if (ACTION_VerifyComponentForAction( comp, INSTALLSTATE_LOCAL)) { - rc = RegCreateKeyW(hkey,squished_cc,&hkey2); + if (!comp->FullKeypath) + continue; + + if (package->Context == MSIINSTALLCONTEXT_MACHINE) + rc = MSIREG_OpenLocalUserDataComponentKey(comp->ComponentId, &hkey, TRUE); + else + rc = MSIREG_OpenUserDataComponentKey(comp->ComponentId, &hkey, TRUE); + if (rc != ERROR_SUCCESS) continue; - - if (!comp->FullKeypath) - continue; - - msi_reg_set_val_str( hkey2, squished_pc, comp->FullKeypath ); if (comp->Attributes & msidbComponentAttributesPermanent) { @@ -2859,35 +2901,18 @@ '0','0','0','0','0','0','0','0','0','0','0','0', '0','0','0','0','0','0','0','0',0 }; - msi_reg_set_val_str( hkey2, szPermKey, comp->FullKeypath ); + msi_reg_set_val_str(hkey, szPermKey, comp->FullKeypath); } - RegCloseKey(hkey2); - - rc = MSIREG_OpenUserDataComponentKey(comp->ComponentId, &hkey2, TRUE); - if (rc != ERROR_SUCCESS) - continue; - - msi_reg_set_val_str(hkey2, squished_pc, comp->FullKeypath); - RegCloseKey(hkey2); - } - else if (ACTION_VerifyComponentForAction( comp, INSTALLSTATE_ABSENT)) - { - DWORD res; - - rc = RegOpenKeyW(hkey,squished_cc,&hkey2); - if (rc != ERROR_SUCCESS) - continue; - - RegDeleteValueW(hkey2,squished_pc); - - /* if the key is empty delete it */ - res = RegEnumKeyExW(hkey2,0,NULL,0,0,NULL,0,NULL); - RegCloseKey(hkey2); - if (res == ERROR_NO_MORE_ITEMS) - RegDeleteKeyW(hkey,squished_cc); - - MSIREG_DeleteUserDataComponentKey(comp->ComponentId); + msi_reg_set_val_str(hkey, squished_pc, comp->FullKeypath); + RegCloseKey(hkey); + } + else if (ACTION_VerifyComponentForAction(comp, INSTALLSTATE_ABSENT)) + { + if (package->Context == MSIINSTALLCONTEXT_MACHINE) + MSIREG_DeleteLocalUserDataComponentKey(comp->ComponentId); + else + MSIREG_DeleteUserDataComponentKey(comp->ComponentId); } /* UI stuff */ @@ -2898,8 +2923,8 @@ ui_actiondata(package,szProcessComponents,uirow); msiobj_release( &uirow->hdr ); } - RegCloseKey(hkey); - return rc; + + return ERROR_SUCCESS; } typedef struct { @@ -3236,7 +3261,7 @@ return rc; } -static UINT ITERATE_PublishProduct(MSIRECORD *row, LPVOID param) +static UINT ITERATE_PublishIcon(MSIRECORD *row, LPVOID param) { MSIPACKAGE* package = (MSIPACKAGE*)param; HANDLE the_file; @@ -3295,6 +3320,204 @@ return ERROR_SUCCESS; } +static UINT msi_publish_icons(MSIPACKAGE *package) +{ + UINT r; + MSIQUERY *view; + + static const WCHAR query[]= { + 'S','E','L','E','C','T',' ','*',' ', + 'F','R','O','M',' ','`','I','c','o','n','`',0}; + + r = MSI_DatabaseOpenViewW(package->db, query, &view); + if (r == ERROR_SUCCESS) + { + MSI_IterateRecords(view, NULL, ITERATE_PublishIcon, package); + msiobj_release(&view->hdr); + } + + return ERROR_SUCCESS; +} + +static UINT msi_publish_sourcelist(MSIPACKAGE *package, HKEY hkey) +{ + UINT r; + HKEY source; + LPWSTR buffer; + MSIMEDIADISK *disk; + MSISOURCELISTINFO *info; + + static const WCHAR szEmpty[] = {0}; + static const WCHAR szSourceList[] = {'S','o','u','r','c','e','L','i','s','t',0}; + + r = RegCreateKeyW(hkey, szSourceList, &source); + if (r != ERROR_SUCCESS) + return r; + + RegCloseKey(source); + + buffer = strrchrW(package->PackagePath, '\\') + 1; + r = MsiSourceListSetInfoW(package->ProductCode, NULL, + package->Context, MSICODE_PRODUCT, + INSTALLPROPERTY_PACKAGENAMEW, buffer); + if (r != ERROR_SUCCESS) + return r; + + r = MsiSourceListSetInfoW(package->ProductCode, NULL, + package->Context, MSICODE_PRODUCT, + INSTALLPROPERTY_MEDIAPACKAGEPATHW, szEmpty); + if (r != ERROR_SUCCESS) + return r; + + r = MsiSourceListSetInfoW(package->ProductCode, NULL, + package->Context, MSICODE_PRODUCT, + INSTALLPROPERTY_DISKPROMPTW, szEmpty); + if (r != ERROR_SUCCESS) + return r; + + LIST_FOR_EACH_ENTRY(info, &package->sourcelist_info, MSISOURCELISTINFO, entry) + { + if (!lstrcmpW(info->property, INSTALLPROPERTY_LASTUSEDSOURCEW)) + msi_set_last_used_source(package->ProductCode, NULL, info->context, + info->options, info->value); + else + MsiSourceListSetInfoW(package->ProductCode, NULL, + info->context, info->options, + info->property, info->value); + } + + LIST_FOR_EACH_ENTRY(disk, &package->sourcelist_media, MSIMEDIADISK, entry) + { + MsiSourceListAddMediaDiskW(package->ProductCode, NULL, + disk->context, disk->options, + disk->disk_id, disk->volume_label, disk->disk_prompt); + } + + return ERROR_SUCCESS; +} + +static UINT msi_publish_product_properties(MSIPACKAGE *package, HKEY hkey) +{ + MSIHANDLE hdb, suminfo; + WCHAR guids[MAX_PATH]; + WCHAR packcode[SQUISH_GUID_SIZE]; + LPWSTR buffer; + LPWSTR ptr; + DWORD langid; + DWORD size; + UINT r; + + static const WCHAR szProductLanguage[] = + {'P','r','o','d','u','c','t','L','a','n','g','u','a','g','e',0}; + static const WCHAR szARPProductIcon[] = + {'A','R','P','P','R','O','D','U','C','T','I','C','O','N',0}; + static const WCHAR szProductVersion[] = + {'P','r','o','d','u','c','t','V','e','r','s','i','o','n',0}; + static const WCHAR szAssignment[] = + {'A','s','s','i','g','n','m','e','n','t',0}; + static const WCHAR szAdvertiseFlags[] = + {'A','d','v','e','r','t','i','s','e','F','l','a','g','s',0}; + static const WCHAR szClients[] = + {'C','l','i','e','n','t','s',0}; + static const WCHAR szColon[] = {':',0}; + + buffer = msi_dup_property(package, INSTALLPROPERTY_PRODUCTNAMEW); + msi_reg_set_val_str(hkey, INSTALLPROPERTY_PRODUCTNAMEW, buffer); + msi_free(buffer); + + langid = msi_get_property_int(package, szProductLanguage, 0); + msi_reg_set_val_dword(hkey, INSTALLPROPERTY_LANGUAGEW, langid); + + ptr = strrchrW(package->PackagePath, '\\' ) + 1; + msi_reg_set_val_str(hkey, INSTALLPROPERTY_PACKAGENAMEW, ptr); + + /* FIXME */ + msi_reg_set_val_dword(hkey, INSTALLPROPERTY_AUTHORIZED_LUA_APPW, 0); + + buffer = msi_dup_property(package, szARPProductIcon); + if (buffer) + { + LPWSTR path = build_icon_path(package,buffer); + msi_reg_set_val_str(hkey, INSTALLPROPERTY_PRODUCTICONW, path); + msi_free(path); + msi_free(buffer); + } + + buffer = msi_dup_property(package, szProductVersion); + if (buffer) + { + DWORD verdword = msi_version_str_to_dword(buffer); + msi_reg_set_val_dword(hkey, INSTALLPROPERTY_VERSIONW, verdword); + msi_free(buffer); + } + + msi_reg_set_val_dword(hkey, szAssignment, 0); + msi_reg_set_val_dword(hkey, szAdvertiseFlags, 0x184); + msi_reg_set_val_dword(hkey, INSTALLPROPERTY_INSTANCETYPEW, 0); + msi_reg_set_val_str(hkey, szClients, szColon); + + hdb = alloc_msihandle(&package->db->hdr); + if (!hdb) + return ERROR_NOT_ENOUGH_MEMORY; + + r = MsiGetSummaryInformationW(hdb, NULL, 0, &suminfo); + MsiCloseHandle(hdb); + if (r != ERROR_SUCCESS) + goto done; + + size = MAX_PATH; + r = MsiSummaryInfoGetPropertyW(suminfo, PID_REVNUMBER, NULL, NULL, + NULL, guids, &size); + if (r != ERROR_SUCCESS) + goto done; + + ptr = strchrW(guids, ';'); + if (ptr) *ptr = 0; + squash_guid(guids, packcode); + msi_reg_set_val_str(hkey, INSTALLPROPERTY_PACKAGECODEW, packcode); + +done: + MsiCloseHandle(suminfo); + return ERROR_SUCCESS; +} + +static UINT msi_publish_upgrade_code(MSIPACKAGE *package) +{ + UINT r; + HKEY hkey; + LPWSTR upgrade; + WCHAR squashed_pc[SQUISH_GUID_SIZE]; + + static const WCHAR szUpgradeCode[] = + {'U','p','g','r','a','d','e','C','o','d','e',0}; + + upgrade = msi_dup_property(package, szUpgradeCode); + if (!upgrade) + return ERROR_SUCCESS; + + if (package->Context == MSIINSTALLCONTEXT_MACHINE) + { + r = MSIREG_OpenClassesUpgradeCodesKey(upgrade, &hkey, TRUE); + if (r != ERROR_SUCCESS) + goto done; + } + else + { + r = MSIREG_OpenUserUpgradeCodesKey(upgrade, &hkey, TRUE); + if (r != ERROR_SUCCESS) + goto done; + } + + squash_guid(package->ProductCode, squashed_pc); + msi_reg_set_val_str(hkey, squashed_pc, NULL); + + RegCloseKey(hkey); + +done: + msi_free(upgrade); + return r; +} + static BOOL msi_check_publish(MSIPACKAGE *package) { MSIFEATURE *feature; @@ -3306,6 +3529,19 @@ } return FALSE; +} + +static BOOL msi_check_unpublish(MSIPACKAGE *package) +{ + MSIFEATURE *feature; + + LIST_FOR_EACH_ENTRY(feature, &package->features, MSIFEATURE, entry) + { + if (feature->ActionRequest != INSTALLSTATE_ABSENT) + return FALSE; + } + + return TRUE; } /* @@ -3317,46 +3553,12 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package) { UINT rc; - LPWSTR packname; - MSIQUERY * view; - MSISOURCELISTINFO *info; - MSIMEDIADISK *disk; - static const WCHAR Query[]= - {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', - '`','I','c','o','n','`',0}; - /* for registry stuff */ - HKEY hkey=0; HKEY hukey=0; - HKEY hudkey=0, props=0; - HKEY source; - static const WCHAR szProductLanguage[] = - {'P','r','o','d','u','c','t','L','a','n','g','u','a','g','e',0}; - static const WCHAR szARPProductIcon[] = - {'A','R','P','P','R','O','D','U','C','T','I','C','O','N',0}; - static const WCHAR szProductVersion[] = - {'P','r','o','d','u','c','t','V','e','r','s','i','o','n',0}; - static const WCHAR szSourceList[] = - {'S','o','u','r','c','e','L','i','s','t',0}; - static const WCHAR szEmpty[] = {0}; - DWORD langid; - LPWSTR buffer; - DWORD size; - MSIHANDLE hDb, hSumInfo; + HKEY hudkey=0; /* FIXME: also need to publish if the product is in advertise mode */ if (!msi_check_publish(package)) return ERROR_SUCCESS; - - /* write out icon files */ - - rc = MSI_DatabaseOpenViewW(package->db, Query, &view); - if (rc == ERROR_SUCCESS) - { - MSI_IterateRecords(view, NULL, ITERATE_PublishProduct, package); - msiobj_release(&view->hdr); - } - - /* ok there is a lot more done here but i need to figure out what */ if (package->Context == MSIINSTALLCONTEXT_MACHINE) { @@ -3364,144 +3566,38 @@ if (rc != ERROR_SUCCESS) goto end; - rc = MSIREG_OpenLocalSystemInstallProps(package->ProductCode, &props, TRUE); + rc = MSIREG_OpenLocalUserDataProductKey(package->ProductCode, &hudkey, TRUE); if (rc != ERROR_SUCCESS) goto end; } else { - rc = MSIREG_OpenProductsKey(package->ProductCode,&hkey,TRUE); + rc = MSIREG_OpenUserProductsKey(package->ProductCode, &hukey, TRUE); if (rc != ERROR_SUCCESS) goto end; - rc = MSIREG_OpenUserProductsKey(package->ProductCode,&hukey,TRUE); + rc = MSIREG_OpenUserDataProductKey(package->ProductCode, &hudkey, TRUE); if (rc != ERROR_SUCCESS) goto end; - - rc = MSIREG_OpenCurrentUserInstallProps(package->ProductCode, &props, TRUE); - if (rc != ERROR_SUCCESS) - goto end; - } - - rc = RegCreateKeyW(hukey, szSourceList, &source); + } + + rc = msi_publish_upgrade_code(package); if (rc != ERROR_SUCCESS) goto end; - RegCloseKey(source); - - rc = MSIREG_OpenUserDataProductKey(package->ProductCode,&hudkey,TRUE); + rc = msi_publish_product_properties(package, hukey); if (rc != ERROR_SUCCESS) goto end; - buffer = msi_dup_property( package, INSTALLPROPERTY_PRODUCTNAMEW ); - msi_reg_set_val_str( hukey, INSTALLPROPERTY_PRODUCTNAMEW, buffer ); - msi_free(buffer); - - langid = msi_get_property_int( package, szProductLanguage, 0 ); - msi_reg_set_val_dword( hukey, INSTALLPROPERTY_LANGUAGEW, langid ); - - packname = strrchrW( package->PackagePath, '\\' ) + 1; - msi_reg_set_val_str( hukey, INSTALLPROPERTY_PACKAGENAMEW, packname ); - - /* FIXME */ - msi_reg_set_val_dword( hukey, INSTALLPROPERTY_AUTHORIZED_LUA_APPW, 0 ); - msi_reg_set_val_dword( props, INSTALLPROPERTY_INSTANCETYPEW, 0 ); - - buffer = msi_dup_property( package, szARPProductIcon ); - if (buffer) - { - LPWSTR path = build_icon_path(package,buffer); - msi_reg_set_val_str( hukey, INSTALLPROPERTY_PRODUCTICONW, path ); - msi_free( path ); - } - msi_free(buffer); - - buffer = msi_dup_property( package, szProductVersion ); - if (buffer) - { - DWORD verdword = msi_version_str_to_dword(buffer); - msi_reg_set_val_dword( hukey, INSTALLPROPERTY_VERSIONW, verdword ); - } - msi_free(buffer); - - buffer = strrchrW( package->PackagePath, '\\') + 1; - rc = MsiSourceListSetInfoW( package->ProductCode, NULL, - package->Context, MSICODE_PRODUCT, - INSTALLPROPERTY_PACKAGENAMEW, buffer ); + rc = msi_publish_sourcelist(package, hukey); if (rc != ERROR_SUCCESS) goto end; - rc = MsiSourceListSetInfoW( package->ProductCode, NULL, - package->Context, MSICODE_PRODUCT, - INSTALLPROPERTY_MEDIAPACKAGEPATHW, szEmpty ); - if (rc != ERROR_SUCCESS) - goto end; - - rc = MsiSourceListSetInfoW( package->ProductCode, NULL, - package->Context, MSICODE_PRODUCT, - INSTALLPROPERTY_DISKPROMPTW, szEmpty ); - if (rc != ERROR_SUCCESS) - goto end; - - /* FIXME: Need to write more keys to the user registry */ - - hDb= alloc_msihandle( &package->db->hdr ); - if (!hDb) { - rc = ERROR_NOT_ENOUGH_MEMORY; - goto end; - } - rc = MsiGetSummaryInformationW(hDb, NULL, 0, &hSumInfo); - MsiCloseHandle(hDb); - if (rc == ERROR_SUCCESS) - { - WCHAR guidbuffer[0x200]; - size = 0x200; - rc = MsiSummaryInfoGetPropertyW(hSumInfo, 9, NULL, NULL, NULL, - guidbuffer, &size); - if (rc == ERROR_SUCCESS) - { - /* for now we only care about the first guid */ - LPWSTR ptr = strchrW(guidbuffer,';'); - if (ptr) *ptr = 0; - msi_reg_set_val_str( hukey, INSTALLPROPERTY_PACKAGECODEW, guidbuffer ); - } - else - { - ERR("Unable to query Revision_Number...\n"); - rc = ERROR_SUCCESS; - } - MsiCloseHandle(hSumInfo); - } - else - { - ERR("Unable to open Summary Information\n"); - rc = ERROR_SUCCESS; - } - - /* publish the SourceList info */ - LIST_FOR_EACH_ENTRY(info, &package->sourcelist_info, MSISOURCELISTINFO, entry) - { - if (!lstrcmpW(info->property, INSTALLPROPERTY_LASTUSEDSOURCEW)) - msi_set_last_used_source(package->ProductCode, NULL, info->context, - info->options, info->value); - else - MsiSourceListSetInfoW(package->ProductCode, NULL, - info->context, info->options, - info->property, info->value); - } - - LIST_FOR_EACH_ENTRY(disk, &package->sourcelist_media, MSIMEDIADISK, entry) - { - MsiSourceListAddMediaDiskW(package->ProductCode, NULL, - disk->context, disk->options, - disk->disk_id, disk->volume_label, disk->disk_prompt); - } + rc = msi_publish_icons(package); end: - RegCloseKey(hkey); RegCloseKey(hukey); RegCloseKey(hudkey); - RegCloseKey(props); return rc; } @@ -3708,24 +3804,35 @@ { MSIFEATURE *feature; UINT rc; - HKEY hkey=0; - HKEY hukey=0; - HKEY userdata=0; + HKEY hkey; + HKEY userdata; if (!msi_check_publish(package)) return ERROR_SUCCESS; - rc = MSIREG_OpenFeaturesKey(package->ProductCode,&hkey,TRUE); - if (rc != ERROR_SUCCESS) - goto end; - - rc = MSIREG_OpenUserFeaturesKey(package->ProductCode,&hukey,TRUE); - if (rc != ERROR_SUCCESS) - goto end; - - rc = MSIREG_OpenUserDataFeaturesKey(package->ProductCode, &userdata, TRUE); - if (rc != ERROR_SUCCESS) - goto end; + if (package->Context == MSIINSTALLCONTEXT_MACHINE) + { + rc = MSIREG_OpenLocalClassesFeaturesKey(package->ProductCode, + &hkey, TRUE); + if (rc != ERROR_SUCCESS) + goto end; + + rc = MSIREG_OpenLocalUserDataFeaturesKey(package->ProductCode, + &userdata, TRUE); + if (rc != ERROR_SUCCESS) + goto end; + } + else + { + rc = MSIREG_OpenUserFeaturesKey(package->ProductCode, &hkey, TRUE); + if (rc != ERROR_SUCCESS) + goto end; + + rc = MSIREG_OpenUserDataFeaturesKey(package->ProductCode, + &userdata, TRUE); + if (rc != ERROR_SUCCESS) + goto end; + } /* here the guids are base 85 encoded */ LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry ) @@ -3776,7 +3883,6 @@ strcatW(data,feature->Feature_Parent); } - msi_reg_set_val_str( hkey, feature->Feature, data ); msi_reg_set_val_str( userdata, feature->Feature, data ); msi_free(data); @@ -3787,7 +3893,7 @@ { static const WCHAR emptyW[] = {0}; size += sizeof(WCHAR); - RegSetValueExW(hukey,feature->Feature,0,REG_SZ, + RegSetValueExW(hkey,feature->Feature,0,REG_SZ, (LPBYTE)(feature->Feature_Parent ? feature->Feature_Parent : emptyW),size); } else @@ -3798,7 +3904,7 @@ data[1] = 0; if (feature->Feature_Parent) strcpyW( &data[1], feature->Feature_Parent ); - RegSetValueExW(hukey,feature->Feature,0,REG_SZ, + RegSetValueExW(hkey,feature->Feature,0,REG_SZ, (LPBYTE)data,size); msi_free(data); } @@ -3813,7 +3919,7 @@ end: RegCloseKey(hkey); - RegCloseKey(hukey); + RegCloseKey(userdata); return rc; } @@ -3839,19 +3945,6 @@ } return ERROR_SUCCESS; -} - -static BOOL msi_check_unpublish(MSIPACKAGE *package) -{ - MSIFEATURE *feature; - - LIST_FOR_EACH_ENTRY(feature, &package->features, MSIFEATURE, entry) - { - if (feature->ActionRequest != INSTALLSTATE_ABSENT) - return FALSE; - } - - return TRUE; } static UINT ACTION_UnpublishFeatures(MSIPACKAGE *package) @@ -3904,7 +3997,6 @@ static UINT msi_make_package_local( MSIPACKAGE *package, HKEY hkey ) { WCHAR packagefile[MAX_PATH]; - HKEY props; UINT r; r = msi_get_local_package_name( packagefile ); @@ -3924,18 +4016,42 @@ msi_reg_set_val_str( hkey, INSTALLPROPERTY_LOCALPACKAGEW, packagefile ); - r = MSIREG_OpenCurrentUserInstallProps(package->ProductCode, &props, TRUE); - if (r != ERROR_SUCCESS) - return r; - - msi_reg_set_val_str(props, INSTALLPROPERTY_LOCALPACKAGEW, packagefile); - RegCloseKey(props); return ERROR_SUCCESS; } -static UINT msi_write_uninstall_property_vals( MSIPACKAGE *package, HKEY hkey ) +static UINT msi_publish_install_properties(MSIPACKAGE *package, HKEY hkey) { LPWSTR prop, val, key; + SYSTEMTIME systime; + DWORD size, langid; + WCHAR date[9]; + LPWSTR buffer; + + static const WCHAR date_fmt[] = {'%','i','%','0','2','i','%','0','2','i',0}; + static const WCHAR szWindowsInstaller[] = + {'W','i','n','d','o','w','s','I','n','s','t','a','l','l','e','r',0}; + static const WCHAR modpath_fmt[] = + {'M','s','i','E','x','e','c','.','e','x','e',' ', + '/','I','[','P','r','o','d','u','c','t','C','o','d','e',']',0}; + static const WCHAR szModifyPath[] = + {'M','o','d','i','f','y','P','a','t','h',0}; + static const WCHAR szUninstallString[] = + {'U','n','i','n','s','t','a','l','l','S','t','r','i','n','g',0}; + static const WCHAR szEstimatedSize[] = + {'E','s','t','i','m','a','t','e','d','S','i','z','e',0}; + static const WCHAR szProductLanguage[] = + {'P','r','o','d','u','c','t','L','a','n','g','u','a','g','e',0}; + static const WCHAR szProductVersion[] = + {'P','r','o','d','u','c','t','V','e','r','s','i','o','n',0}; + static const WCHAR szProductName[] = + {'P','r','o','d','u','c','t','N','a','m','e',0}; + static const WCHAR szDisplayName[] = + {'D','i','s','p','l','a','y','N','a','m','e',0}; + static const WCHAR szDisplayVersion[] = + {'D','i','s','p','l','a','y','V','e','r','s','i','o','n',0}; + static const WCHAR szManufacturer[] = + {'M','a','n','u','f','a','c','t','u','r','e','r',0}; + static const LPCSTR propval[] = { "ARPAUTHORIZEDCDFPREFIX", "AuthorizedCDFPrefix", "ARPCONTACT", "Contact", @@ -3955,62 +4071,77 @@ }; const LPCSTR *p = propval; - while( *p ) - { - prop = strdupAtoW( *p++ ); - key = strdupAtoW( *p++ ); - val = msi_dup_property( package, prop ); - msi_reg_set_val_str( hkey, key, val ); + while (*p) + { + prop = strdupAtoW(*p++); + key = strdupAtoW(*p++); + val = msi_dup_property(package, prop); + msi_reg_set_val_str(hkey, key, val); msi_free(val); msi_free(key); msi_free(prop); } + + msi_reg_set_val_dword(hkey, szWindowsInstaller, 1); + + size = deformat_string(package, modpath_fmt, &buffer); + RegSetValueExW(hkey, szModifyPath, 0, REG_EXPAND_SZ, (LPBYTE)buffer, size); + RegSetValueExW(hkey, szUninstallString, 0, REG_EXPAND_SZ, (LPBYTE)buffer, size); + msi_free(buffer); + + /* FIXME: Write real Estimated Size when we have it */ + msi_reg_set_val_dword(hkey, szEstimatedSize, 0); + + buffer = msi_dup_property(package, szProductName); + msi_reg_set_val_str(hkey, szDisplayName, buffer); + msi_free(buffer); + + buffer = msi_dup_property(package, cszSourceDir); + msi_reg_set_val_str(hkey, INSTALLPROPERTY_INSTALLSOURCEW, buffer); + msi_free(buffer); + + buffer = msi_dup_property(package, szManufacturer); + msi_reg_set_val_str(hkey, INSTALLPROPERTY_PUBLISHERW, buffer); + msi_free(buffer); + + GetLocalTime(&systime); + sprintfW(date, date_fmt, systime.wYear, systime.wMonth, systime.wDay); + msi_reg_set_val_str(hkey, INSTALLPROPERTY_INSTALLDATEW, date); + + langid = msi_get_property_int(package, szProductLanguage, 0); + msi_reg_set_val_dword(hkey, INSTALLPROPERTY_LANGUAGEW, langid); + + buffer = msi_dup_property(package, szProductVersion); + msi_reg_set_val_str(hkey, szDisplayVersion, buffer); + if (buffer) + { + DWORD verdword = msi_version_str_to_dword(buffer); + + msi_reg_set_val_dword(hkey, INSTALLPROPERTY_VERSIONW, verdword); + msi_reg_set_val_dword(hkey, INSTALLPROPERTY_VERSIONMAJORW, verdword >> 24); + msi_reg_set_val_dword(hkey, INSTALLPROPERTY_VERSIONMINORW, (verdword >> 16) & 0xFF); + msi_free(buffer); + } + return ERROR_SUCCESS; } static UINT ACTION_RegisterProduct(MSIPACKAGE *package) { - HKEY hkey=0; - HKEY hudkey=0, props=0; - LPWSTR buffer = NULL; + WCHAR squashed_pc[SQUISH_GUID_SIZE]; + LPWSTR upgrade_code; + HKEY hkey, props; + HKEY upgrade; UINT rc; - DWORD size, langid; - static const WCHAR szWindowsInstaller[] = - {'W','i','n','d','o','w','s','I','n','s','t','a','l','l','e','r',0}; - static const WCHAR szUpgradeCode[] = - {'U','p','g','r','a','d','e','C','o','d','e',0}; - static const WCHAR modpath_fmt[] = - {'M','s','i','E','x','e','c','.','e','x','e',' ', - '/','I','[','P','r','o','d','u','c','t','C','o','d','e',']',0}; - static const WCHAR szModifyPath[] = - {'M','o','d','i','f','y','P','a','t','h',0}; - static const WCHAR szUninstallString[] = - {'U','n','i','n','s','t','a','l','l','S','t','r','i','n','g',0}; - static const WCHAR szEstimatedSize[] = - {'E','s','t','i','m','a','t','e','d','S','i','z','e',0}; - static const WCHAR szProductLanguage[] = - {'P','r','o','d','u','c','t','L','a','n','g','u','a','g','e',0}; - static const WCHAR szProductVersion[] = - {'P','r','o','d','u','c','t','V','e','r','s','i','o','n',0}; - static const WCHAR szProductName[] = - {'P','r','o','d','u','c','t','N','a','m','e',0}; - static const WCHAR szDisplayName[] = - {'D','i','s','p','l','a','y','N','a','m','e',0}; - static const WCHAR szDisplayVersion[] = - {'D','i','s','p','l','a','y','V','e','r','s','i','o','n',0}; - static const WCHAR szManufacturer[] = - {'M','a','n','u','f','a','c','t','u','r','e','r',0}; - - SYSTEMTIME systime; - static const WCHAR date_fmt[] = {'%','i','%','0','2','i','%','0','2','i',0}; - LPWSTR upgrade_code; - WCHAR szDate[9]; + + static const WCHAR szUpgradeCode[] = { + 'U','p','g','r','a','d','e','C','o','d','e',0}; /* FIXME: also need to publish if the product is in advertise mode */ if (!msi_check_publish(package)) return ERROR_SUCCESS; - rc = MSIREG_OpenUninstallKey(package->ProductCode,&hkey,TRUE); + rc = MSIREG_OpenUninstallKey(package->ProductCode, &hkey, TRUE); if (rc != ERROR_SUCCESS) return rc; @@ -4018,97 +4149,38 @@ { rc = MSIREG_OpenLocalSystemInstallProps(package->ProductCode, &props, TRUE); if (rc != ERROR_SUCCESS) - return rc; + goto done; } else { rc = MSIREG_OpenCurrentUserInstallProps(package->ProductCode, &props, TRUE); if (rc != ERROR_SUCCESS) - return rc; - } - - /* dump all the info i can grab */ - /* FIXME: Flesh out more information */ - - msi_write_uninstall_property_vals( package, hkey ); - - msi_reg_set_val_dword( hkey, szWindowsInstaller, 1 ); - - msi_make_package_local( package, hkey ); - - /* do ModifyPath and UninstallString */ - size = deformat_string(package,modpath_fmt,&buffer); - RegSetValueExW(hkey,szModifyPath,0,REG_EXPAND_SZ,(LPBYTE)buffer,size); - RegSetValueExW(hkey,szUninstallString,0,REG_EXPAND_SZ,(LPBYTE)buffer,size); - msi_free(buffer); - - /* FIXME: Write real Estimated Size when we have it */ - msi_reg_set_val_dword( hkey, szEstimatedSize, 0 ); - - buffer = msi_dup_property( package, szProductName ); - msi_reg_set_val_str( props, szDisplayName, buffer ); - msi_free(buffer); - - buffer = msi_dup_property( package, cszSourceDir ); - msi_reg_set_val_str( props, INSTALLPROPERTY_INSTALLSOURCEW, buffer); - msi_free(buffer); - - buffer = msi_dup_property( package, szManufacturer ); - msi_reg_set_val_str( props, INSTALLPROPERTY_PUBLISHERW, buffer); - msi_free(buffer); - - GetLocalTime(&systime); - sprintfW(szDate,date_fmt,systime.wYear,systime.wMonth,systime.wDay); - msi_reg_set_val_str( hkey, INSTALLPROPERTY_INSTALLDATEW, szDate ); - msi_reg_set_val_str( props, INSTALLPROPERTY_INSTALLDATEW, szDate ); - - langid = msi_get_property_int( package, szProductLanguage, 0 ); - msi_reg_set_val_dword( hkey, INSTALLPROPERTY_LANGUAGEW, langid ); - - buffer = msi_dup_property( package, szProductVersion ); - msi_reg_set_val_str( props, szDisplayVersion, buffer ); - if (buffer) - { - DWORD verdword = msi_version_str_to_dword(buffer); - - msi_reg_set_val_dword( hkey, INSTALLPROPERTY_VERSIONW, verdword ); - msi_reg_set_val_dword( props, INSTALLPROPERTY_VERSIONW, verdword ); - msi_reg_set_val_dword( hkey, INSTALLPROPERTY_VERSIONMAJORW, verdword>>24 ); - msi_reg_set_val_dword( props, INSTALLPROPERTY_VERSIONMAJORW, verdword>>24 ); - msi_reg_set_val_dword( hkey, INSTALLPROPERTY_VERSIONMINORW, (verdword>>16)&0x00FF ); - msi_reg_set_val_dword( props, INSTALLPROPERTY_VERSIONMINORW, (verdword>>16)&0x00FF ); - } - msi_free(buffer); - - /* Handle Upgrade Codes */ - upgrade_code = msi_dup_property( package, szUpgradeCode ); + goto done; + } + + msi_make_package_local(package, props); + + rc = msi_publish_install_properties(package, hkey); + if (rc != ERROR_SUCCESS) + goto done; + + rc = msi_publish_install_properties(package, props); + if (rc != ERROR_SUCCESS) + goto done; + + upgrade_code = msi_dup_property(package, szUpgradeCode); if (upgrade_code) { - HKEY hkey2; - WCHAR squashed[33]; - MSIREG_OpenUpgradeCodesKey(upgrade_code, &hkey2, TRUE); - squash_guid(package->ProductCode,squashed); - msi_reg_set_val_str( hkey2, squashed, NULL ); - RegCloseKey(hkey2); - MSIREG_OpenUserUpgradeCodesKey(upgrade_code, &hkey2, TRUE); - squash_guid(package->ProductCode,squashed); - msi_reg_set_val_str( hkey2, squashed, NULL ); - RegCloseKey(hkey2); - + MSIREG_OpenUpgradeCodesKey(upgrade_code, &upgrade, TRUE); + squash_guid(package->ProductCode, squashed_pc); + msi_reg_set_val_str(upgrade, squashed_pc, NULL); + RegCloseKey(upgrade); msi_free(upgrade_code); } +done: RegCloseKey(hkey); - rc = MSIREG_OpenUserDataProductKey(package->ProductCode, &hudkey, TRUE); - if (rc != ERROR_SUCCESS) - return rc; - - RegCloseKey(hudkey); - - msi_reg_set_val_dword( props, szWindowsInstaller, 1 ); - RegCloseKey(props); - return ERROR_SUCCESS; } @@ -4119,6 +4191,7 @@ static UINT msi_unpublish_product(MSIPACKAGE *package) { + LPWSTR upgrade; LPWSTR remove = NULL; LPWSTR *features = NULL; BOOL full_uninstall = TRUE; @@ -4126,6 +4199,8 @@ static const WCHAR szRemove[] = {'R','E','M','O','V','E',0}; static const WCHAR szAll[] = {'A','L','L',0}; + static const WCHAR szUpgradeCode[] = + {'U','p','g','r','a','d','e','C','o','d','e',0}; remove = msi_dup_property(package, szRemove); if (!remove) @@ -4158,6 +4233,13 @@ MSIREG_DeleteUserDataProductKey(package->ProductCode); MSIREG_DeleteUserFeaturesKey(package->ProductCode); MSIREG_DeleteUninstallKey(package->ProductCode); + + upgrade = msi_dup_property(package, szUpgradeCode); + if (upgrade) + { + MSIREG_DeleteUserUpgradeCodesKey(upgrade); + msi_free(upgrade); + } done: msi_free(remove); @@ -4323,7 +4405,11 @@ if (!productid) return ERROR_SUCCESS; - rc = MSIREG_OpenCurrentUserInstallProps(package->ProductCode, &hkey, TRUE); + if (package->Context == MSIINSTALLCONTEXT_MACHINE) + rc = MSIREG_OpenLocalSystemInstallProps(package->ProductCode, &hkey, TRUE); + else + rc = MSIREG_OpenCurrentUserInstallProps(package->ProductCode, &hkey, TRUE); + if (rc != ERROR_SUCCESS) goto end; @@ -5663,6 +5749,11 @@ /* FIXME: extract all files belonging to this component */ file = msi_find_file(package, comp->KeyPath); + if (!file) + { + ERR("File %s not found\n", debugstr_w(comp->KeyPath)); + return ERROR_FUNCTION_FAILED; + } GetTempPathW(MAX_PATH, path); Modified: trunk/reactos/dll/win32/msi/automation.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/automation.c…
============================================================================== --- trunk/reactos/dll/win32/msi/automation.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/automation.c [iso-8859-1] Tue Jul 8 15:52:29 2008 @@ -405,7 +405,7 @@ (hr == DISP_E_PARAMNOTFOUND || hr == DISP_E_EXCEPTION)) { static const WCHAR szComma[] = { ',',0 }; - static WCHAR szExceptionSource[] = {'M','s','i',' ','A','P','I',' ','E','r','r','o','r',0}; + static const WCHAR szExceptionSource[] = {'M','s','i',' ','A','P','I',' ','E','r','r','o','r',0}; WCHAR szExceptionDescription[MAX_PATH]; BSTR bstrParamNames[MAX_FUNC_PARAMS]; unsigned namesNo, i; Modified: trunk/reactos/dll/win32/msi/database.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/database.c?r…
============================================================================== --- trunk/reactos/dll/win32/msi/database.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/database.c [iso-8859-1] Tue Jul 8 15:52:29 2008 @@ -83,7 +83,7 @@ WCHAR path[MAX_PATH]; static const WCHAR backslash[] = {'\\',0}; - static WCHAR szTables[] = { '_','T','a','b','l','e','s',0 }; + static const WCHAR szTables[] = { '_','T','a','b','l','e','s',0 }; TRACE("%s %s\n",debugstr_w(szDBPath),debugstr_w(szPersist) ); Modified: trunk/reactos/dll/win32/msi/files.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/files.c?rev=…
============================================================================== --- trunk/reactos/dll/win32/msi/files.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/files.c [iso-8859-1] Tue Jul 8 15:52:29 2008 @@ -459,24 +459,22 @@ return ret; } -static VOID set_file_source(MSIPACKAGE* package, MSIFILE* file, LPCWSTR path) -{ - if (!file->IsCompressed) - { - LPWSTR p, path; - p = resolve_folder(package, file->Component->Directory, TRUE, FALSE, TRUE, NULL); - path = build_directory_name(2, p, file->ShortName); - if (file->LongName && - INVALID_FILE_ATTRIBUTES == GetFileAttributesW( path )) - { - msi_free(path); - path = build_directory_name(2, p, file->LongName); - } - file->SourcePath = path; - msi_free(p); - } - else - file->SourcePath = build_directory_name(2, path, file->File); +/* compares the version of a file read from the filesystem and + * the version specified in the File table + */ +static int msi_compare_file_version(MSIFILE *file) +{ + WCHAR version[MAX_PATH]; + DWORD size; + UINT r; + + size = MAX_PATH; + version[0] = '\0'; + r = MsiGetFileVersionW(file->TargetPath, version, &size, NULL, NULL); + if (r != ERROR_SUCCESS) + return 0; + + return lstrcmpW(version, file->Version); } void msi_free_media_info( MSIMEDIAINFO *mi ) @@ -564,10 +562,9 @@ options |= MSISOURCETYPE_NETWORK; } - if (mi->type == DRIVE_CDROM || mi->type == DRIVE_REMOVABLE) - msi_package_add_media_disk(package, package->Context, - MSICODE_PRODUCT, mi->disk_id, - mi->volume_label, mi->disk_prompt); + msi_package_add_media_disk(package, package->Context, + MSICODE_PRODUCT, mi->disk_id, + mi->volume_label, mi->disk_prompt); msi_package_add_info(package, package->Context, options, INSTALLPROPERTY_LASTUSEDSOURCEW, source); @@ -577,7 +574,7 @@ } /* FIXME: search NETWORK and URL sources as well */ -static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi) +UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi) { WCHAR source[MAX_PATH]; WCHAR volume[MAX_PATH]; @@ -586,6 +583,7 @@ DWORD index, size, id; UINT r; + size = MAX_PATH; r = MsiSourceListGetInfoW(package->ProductCode, NULL, package->Context, MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEW, source, &size); @@ -822,6 +820,13 @@ continue; } + if (MsiGetFileVersionW(file->TargetPath, NULL, NULL, NULL, NULL) == ERROR_SUCCESS && + msi_compare_file_version(file) >= 0) + { + TRACE("Destination file version greater, not overwriting\n"); + continue; + } + if (file->Sequence > mi->last_sequence || mi->is_continuous || (file->IsCompressed && !mi->is_extracted)) { @@ -846,13 +851,11 @@ } } - set_file_source(package, file, mi->source); - - TRACE("file paths %s to %s\n",debugstr_w(file->SourcePath), - debugstr_w(file->TargetPath)); - if (!file->IsCompressed) { + TRACE("file paths %s to %s\n", debugstr_w(file->SourcePath), + debugstr_w(file->TargetPath)); + msi_file_update_ui(package, file, szInstallFiles); rc = copy_install_file(file); if (rc != ERROR_SUCCESS) @@ -992,24 +995,6 @@ msiobj_release(&view->hdr); return rc; -} - -/* compares the version of a file read from the filesystem and - * the version specified in the File table - */ -static int msi_compare_file_version( MSIFILE *file ) -{ - WCHAR version[MAX_PATH]; - DWORD size; - UINT r; - - size = MAX_PATH; - version[0] = '\0'; - r = MsiGetFileVersionW( file->TargetPath, version, &size, NULL, NULL ); - if ( r != ERROR_SUCCESS ) - return 0; - - return lstrcmpW( version, file->Version ); } UINT ACTION_RemoveFiles( MSIPACKAGE *package ) Modified: trunk/reactos/dll/win32/msi/helpers.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/helpers.c?re…
============================================================================== --- trunk/reactos/dll/win32/msi/helpers.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/helpers.c [iso-8859-1] Tue Jul 8 15:52:29 2008 @@ -921,6 +921,8 @@ ComponentList *clist; MSIFEATURE *f; + component->hasLocalFeature = FALSE; + msi_component_set_state( component, newstate ); /*if any other feature wants is local we need to set it local*/ @@ -939,6 +941,7 @@ f->ActionRequest == INSTALLSTATE_SOURCE) ) { TRACE("Saved by %s\n", debugstr_w(f->Feature)); + component->hasLocalFeature = TRUE; if (component->Attributes & msidbComponentAttributesOptional) { @@ -1160,6 +1163,16 @@ if (r != ERROR_SUCCESS) goto done; + if (GetFileAttributesW(mi->source) == INVALID_FILE_ATTRIBUTES) + { + r = find_published_source(package, mi); + if (r != ERROR_SUCCESS) + { + ERR("Cabinet not found: %s\n", debugstr_w(mi->source)); + return ERROR_INSTALL_FAILURE; + } + } + data.package = package; data.mi = mi; data.file = file; Modified: trunk/reactos/dll/win32/msi/msi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/msi.c?rev=34…
============================================================================== --- trunk/reactos/dll/win32/msi/msi.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/msi.c [iso-8859-1] Tue Jul 8 15:52:29 2008 @@ -1812,6 +1812,7 @@ HKEY hkey; INSTALLSTATE r; BOOL missing = FALSE; + BOOL machine = FALSE; TRACE("%s %s\n", debugstr_w(szProduct), debugstr_w(szFeature)); @@ -1821,10 +1822,15 @@ if (!squash_guid( szProduct, squishProduct )) return INSTALLSTATE_INVALIDARG; - /* check that it's installed at all */ - rc = MSIREG_OpenUserFeaturesKey(szProduct, &hkey, FALSE); - if (rc != ERROR_SUCCESS) - return INSTALLSTATE_UNKNOWN; + if (MSIREG_OpenManagedFeaturesKey(szProduct, &hkey, FALSE) != ERROR_SUCCESS && + MSIREG_OpenUserFeaturesKey(szProduct, &hkey, FALSE) != ERROR_SUCCESS) + { + rc = MSIREG_OpenLocalClassesFeaturesKey(szProduct, &hkey, FALSE); + if (rc != ERROR_SUCCESS) + return INSTALLSTATE_UNKNOWN; + + machine = TRUE; + } parent_feature = msi_reg_get_val_str( hkey, szFeature ); RegCloseKey(hkey); @@ -1837,8 +1843,11 @@ if (r == INSTALLSTATE_ABSENT) return r; - /* now check if it's complete or advertised */ - rc = MSIREG_OpenUserDataFeaturesKey(szProduct, &hkey, FALSE); + if (machine) + rc = MSIREG_OpenLocalUserDataFeaturesKey(szProduct, &hkey, FALSE); + else + rc = MSIREG_OpenUserDataFeaturesKey(szProduct, &hkey, FALSE); + if (rc != ERROR_SUCCESS) return INSTALLSTATE_ADVERTISED; @@ -1862,7 +1871,12 @@ } StringFromGUID2(&guid, comp, GUID_SIZE); - rc = MSIREG_OpenUserDataComponentKey(comp, &hkey, FALSE); + + if (machine) + rc = MSIREG_OpenLocalUserDataComponentKey(comp, &hkey, FALSE); + else + rc = MSIREG_OpenUserDataComponentKey(comp, &hkey, FALSE); + if (rc != ERROR_SUCCESS) { msi_free(components); @@ -2281,57 +2295,93 @@ awstring *lpOrgNameBuf, LPDWORD pcchOrgNameBuf, awstring *lpSerialBuf, LPDWORD pcchSerialBuf) { - HKEY hkey; + WCHAR squished_pc[SQUISH_GUID_SIZE]; LPWSTR user, org, serial; + USERINFOSTATE state; + HKEY hkey, props; + LPCWSTR orgptr; UINT r; - USERINFOSTATE state; - - TRACE("%s %p %p %p %p %p %p\n",debugstr_w(szProduct), lpUserNameBuf, + + static const WCHAR szEmpty[] = {0}; + + TRACE("%s %p %p %p %p %p %p\n", debugstr_w(szProduct), lpUserNameBuf, pcchUserNameBuf, lpOrgNameBuf, pcchOrgNameBuf, lpSerialBuf, pcchSerialBuf); - if (!szProduct) + if (!szProduct || !squash_guid(szProduct, squished_pc)) return USERINFOSTATE_INVALIDARG; - r = MSIREG_OpenUninstallKey(szProduct, &hkey, FALSE); - if (r != ERROR_SUCCESS) + if (MSIREG_OpenLocalManagedProductKey(szProduct, &hkey, FALSE) != ERROR_SUCCESS && + MSIREG_OpenUserProductsKey(szProduct, &hkey, FALSE) != ERROR_SUCCESS && + MSIREG_OpenLocalClassesProductKey(szProduct, &hkey, FALSE) != ERROR_SUCCESS) + { return USERINFOSTATE_UNKNOWN; - - user = msi_reg_get_val_str( hkey, INSTALLPROPERTY_REGOWNERW ); - org = msi_reg_get_val_str( hkey, INSTALLPROPERTY_REGCOMPANYW ); - serial = msi_reg_get_val_str( hkey, INSTALLPROPERTY_PRODUCTIDW ); + } + + if (MSIREG_OpenCurrentUserInstallProps(szProduct, &props, FALSE) != ERROR_SUCCESS && + MSIREG_OpenLocalSystemInstallProps(szProduct, &props, FALSE) != ERROR_SUCCESS) + { + RegCloseKey(hkey); + return USERINFOSTATE_ABSENT; + } + + user = msi_reg_get_val_str(props, INSTALLPROPERTY_REGOWNERW); + org = msi_reg_get_val_str(props, INSTALLPROPERTY_REGCOMPANYW); + serial = msi_reg_get_val_str(props, INSTALLPROPERTY_PRODUCTIDW); + state = USERINFOSTATE_ABSENT; RegCloseKey(hkey); - - state = USERINFOSTATE_PRESENT; - - if (user) - { - r = msi_strcpy_to_awstring( user, lpUserNameBuf, pcchUserNameBuf ); + RegCloseKey(props); + + if (user && serial) + state = USERINFOSTATE_PRESENT; + + if (pcchUserNameBuf) + { + if (lpUserNameBuf && !user) + { + (*pcchUserNameBuf)--; + goto done; + } + + r = msi_strcpy_to_awstring(user, lpUserNameBuf, pcchUserNameBuf); + if (r == ERROR_MORE_DATA) + { + state = USERINFOSTATE_MOREDATA; + goto done; + } + } + + if (pcchOrgNameBuf) + { + orgptr = org; + if (!orgptr) orgptr = szEmpty; + + r = msi_strcpy_to_awstring(orgptr, lpOrgNameBuf, pcchOrgNameBuf); + if (r == ERROR_MORE_DATA) + { + state = USERINFOSTATE_MOREDATA; + goto done; + } + } + + if (pcchSerialBuf) + { + if (!serial) + { + (*pcchSerialBuf)--; + goto done; + } + + r = msi_strcpy_to_awstring(serial, lpSerialBuf, pcchSerialBuf); if (r == ERROR_MORE_DATA) state = USERINFOSTATE_MOREDATA; } - else - state = USERINFOSTATE_ABSENT; - if (org) - { - r = msi_strcpy_to_awstring( org, lpOrgNameBuf, pcchOrgNameBuf ); - if (r == ERROR_MORE_DATA && state == USERINFOSTATE_PRESENT) - state = USERINFOSTATE_MOREDATA; - } - /* msdn states: The user information is considered to be present even in the absence of a company name. */ - if (serial) - { - r = msi_strcpy_to_awstring( serial, lpSerialBuf, pcchSerialBuf ); - if (r == ERROR_MORE_DATA && state == USERINFOSTATE_PRESENT) - state = USERINFOSTATE_MOREDATA; - } - else - state = USERINFOSTATE_ABSENT; - - msi_free( user ); - msi_free( org ); - msi_free( serial ); + +done: + msi_free(user); + msi_free(org); + msi_free(serial); return state; } @@ -2345,6 +2395,11 @@ LPWSTR lpSerialBuf, LPDWORD pcchSerialBuf) { awstring user, org, serial; + + if ((lpUserNameBuf && !pcchUserNameBuf) || + (lpOrgNameBuf && !pcchOrgNameBuf) || + (lpSerialBuf && !pcchSerialBuf)) + return USERINFOSTATE_INVALIDARG; user.unicode = TRUE; user.str.w = lpUserNameBuf; @@ -2366,6 +2421,11 @@ awstring user, org, serial; LPWSTR prod; UINT r; + + if ((lpUserNameBuf && !pcchUserNameBuf) || + (lpOrgNameBuf && !pcchOrgNameBuf) || + (lpSerialBuf && !pcchSerialBuf)) + return USERINFOSTATE_INVALIDARG; prod = strdupAtoW( szProduct ); if (szProduct && !prod) Modified: trunk/reactos/dll/win32/msi/msi.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/msi.spec?rev…
============================================================================== --- trunk/reactos/dll/win32/msi/msi.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/msi.spec [iso-8859-1] Tue Jul 8 15:52:29 2008 @@ -187,8 +187,8 @@ 191 stub MsiInvalidateFeatureCache 192 stdcall MsiUseFeatureExA(str str long long) 193 stdcall MsiUseFeatureExW(wstr wstr long long) -194 stdcall MsiGetFileVersionA(str str ptr str ptr) -195 stdcall MsiGetFileVersionW(wstr wstr ptr wstr ptr) +194 stdcall MsiGetFileVersionA(str ptr ptr ptr ptr) +195 stdcall MsiGetFileVersionW(wstr ptr ptr ptr ptr) 196 stdcall MsiLoadStringA(long long long long long) 197 stdcall MsiLoadStringW(long long long long long) 198 stdcall MsiMessageBoxA(long long long long long long) Modified: trunk/reactos/dll/win32/msi/msi_Sv.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/msi_Sv.rc?re…
============================================================================== --- trunk/reactos/dll/win32/msi/msi_Sv.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/msi_Sv.rc [iso-8859-1] Tue Jul 8 15:52:29 2008 @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT +LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL STRINGTABLE DISCARDABLE { Modified: trunk/reactos/dll/win32/msi/msipriv.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/msipriv.h?re…
============================================================================== --- trunk/reactos/dll/win32/msi/msipriv.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/msipriv.h [iso-8859-1] Tue Jul 8 15:52:29 2008 @@ -767,12 +767,13 @@ extern UINT MSIREG_OpenUserPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create); extern UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, HKEY *key, BOOL create); -extern UINT MSIREG_OpenComponents(HKEY* key); extern UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create); +extern UINT MSIREG_OpenLocalUserDataComponentKey(LPCWSTR szComponent, HKEY *key, BOOL create); extern UINT MSIREG_OpenUserDataComponentKey(LPCWSTR szComponent, HKEY *key, BOOL create); extern UINT MSIREG_OpenProductsKey(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_OpenPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create); extern UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, HKEY* key, BOOL create); +extern UINT MSIREG_OpenLocalUserDataProductKey(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_OpenCurrentUserInstallProps(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_OpenLocalSystemInstallProps(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_OpenUserFeaturesKey(LPCWSTR szProduct, HKEY* key, BOOL create); @@ -785,9 +786,15 @@ extern UINT MSIREG_OpenLocalSystemProductKey(LPCWSTR szProductCode, HKEY *key, BOOL create); extern UINT MSIREG_OpenLocalSystemComponentKey(LPCWSTR szComponent, HKEY *key, BOOL create); extern UINT MSIREG_OpenLocalClassesProductKey(LPCWSTR szProductCode, HKEY *key, BOOL create); +extern UINT MSIREG_OpenLocalClassesFeaturesKey(LPCWSTR szProductCode, HKEY *key, BOOL create); extern UINT MSIREG_OpenLocalManagedProductKey(LPCWSTR szProductCode, HKEY *key, BOOL create); +extern UINT MSIREG_OpenManagedFeaturesKey(LPCWSTR szProductCode, HKEY *key, BOOL create); +extern UINT MSIREG_OpenLocalUserDataFeaturesKey(LPCWSTR szProduct, HKEY *key, BOOL create); extern UINT MSIREG_DeleteUserFeaturesKey(LPCWSTR szProduct); +extern UINT MSIREG_DeleteLocalUserDataComponentKey(LPCWSTR szComponent); extern UINT MSIREG_DeleteUserDataComponentKey(LPCWSTR szComponent); +extern UINT MSIREG_DeleteUserUpgradeCodesKey(LPCWSTR szUpgradeCode); +extern UINT MSIREG_OpenClassesUpgradeCodesKey(LPCWSTR szUpgradeCode, HKEY* key, BOOL create); extern LPWSTR msi_reg_get_val_str( HKEY hkey, LPCWSTR name ); extern BOOL msi_reg_get_val_dword( HKEY hkey, LPCWSTR name, DWORD *val); @@ -908,6 +915,7 @@ extern void msi_free_media_info(MSIMEDIAINFO *mi); extern BOOL msi_cabextract(MSIPACKAGE* package, MSIMEDIAINFO *mi, PFNFDINOTIFY notify, LPVOID data); extern UINT msi_extract_file(MSIPACKAGE *package, MSIFILE *file, LPWSTR destdir); +extern UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi); /* control event stuff */ extern VOID ControlEvent_FireSubscribedEvent(MSIPACKAGE *package, LPCWSTR event, Modified: trunk/reactos/dll/win32/msi/package.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/package.c?re…
============================================================================== --- trunk/reactos/dll/win32/msi/package.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/package.c [iso-8859-1] Tue Jul 8 15:52:29 2008 @@ -760,30 +760,6 @@ return r; } -static UINT msi_set_context(MSIPACKAGE *package) -{ - WCHAR val[10]; - DWORD sz = 10; - DWORD num; - UINT r; - - static const WCHAR szOne[] = {'1',0}; - static const WCHAR szAllUsers[] = {'A','L','L','U','S','E','R','S',0}; - - package->Context = MSIINSTALLCONTEXT_USERUNMANAGED; - - r = MSI_GetPropertyW(package, szAllUsers, val, &sz); - if (r == ERROR_SUCCESS) - { - num = atolW(val); - if (num == 1 || num == 2) - package->Context = MSIINSTALLCONTEXT_MACHINE; - } - - MSI_SetPropertyW(package, szAllUsers, szOne); - return ERROR_SUCCESS; -} - MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db, LPCWSTR base_url ) { static const WCHAR szLevel[] = { 'U','I','L','e','v','e','l',0 }; @@ -823,8 +799,6 @@ if (package->WordCount & MSIWORDCOUNT_ADMINISTRATIVE) msi_load_admin_properties( package ); - - msi_set_context( package ); } return package; Modified: trunk/reactos/dll/win32/msi/registry.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/registry.c?r…
============================================================================== --- trunk/reactos/dll/win32/msi/registry.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/registry.c [iso-8859-1] Tue Jul 8 15:52:29 2008 @@ -204,6 +204,12 @@ 'I','n','s','t','a','l','l','e','r','\\', 'P','r','o','d','u','c','t','s','\\','%','s',0}; +static const WCHAR szInstaller_LocalClassesFeat_fmt[] = { +'S','o','f','t','w','a','r','e','\\', +'C','l','a','s','s','e','s','\\', +'I','n','s','t','a','l','l','e','r','\\', +'F','e','a','t','u','r','e','s','\\','%','s',0}; + static const WCHAR szInstaller_LocalManagedProd_fmt[] = { 'S','o','f','t','w','a','r','e','\\', 'M','i','c','r','o','s','o','f','t','\\', @@ -213,6 +219,23 @@ 'M','a','n','a','g','e','d','\\','%','s','\\', 'I','n','s','t','a','l','l','e','r','\\', 'P','r','o','d','u','c','t','s','\\','%','s',0}; + +static const WCHAR szInstaller_LocalManagedFeat_fmt[] = { +'S','o','f','t','w','a','r','e','\\', +'M','i','c','r','o','s','o','f','t','\\', +'W','i','n','d','o','w','s','\\', +'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', +'I','n','s','t','a','l','l','e','r','\\', +'M','a','n','a','g','e','d','\\','%','s','\\', +'I','n','s','t','a','l','l','e','r','\\', +'F','e','a','t','u','r','e','s','\\','%','s',0}; + +static const WCHAR szInstaller_ClassesUpgrade_fmt[] = { +'I','n','s','t','a','l','l','e','r','\\', +'U','p','g','r','a','d','e','C','o','d','e','s','\\', +'%','s',0}; + +static const WCHAR localsid[] = {'S','-','1','-','5','-','1','8',0}; BOOL unsquash_guid(LPCWSTR in, LPWSTR out) { @@ -645,9 +668,22 @@ return rc; } -UINT MSIREG_OpenComponents(HKEY* key) -{ - return RegCreateKeyW(HKEY_LOCAL_MACHINE,szInstaller_Components,key); +UINT MSIREG_OpenLocalUserDataFeaturesKey(LPCWSTR szProduct, HKEY *key, BOOL create) +{ + WCHAR squished_pc[GUID_SIZE]; + WCHAR keypath[0x200]; + + TRACE("%s\n", debugstr_w(szProduct)); + if (!squash_guid(szProduct, squished_pc)) + return ERROR_FUNCTION_FAILED; + TRACE("squished (%s)\n", debugstr_w(squished_pc)); + + sprintfW(keypath, szUserDataFeatures_fmt, localsid, squished_pc); + + if (create) + return RegCreateKeyW(HKEY_LOCAL_MACHINE, keypath, key); + + return RegOpenKeyW(HKEY_LOCAL_MACHINE, keypath, key); } UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create) @@ -671,6 +707,38 @@ return rc; } +UINT MSIREG_OpenLocalUserDataComponentKey(LPCWSTR szComponent, HKEY *key, BOOL create) +{ + WCHAR comp[GUID_SIZE]; + WCHAR keypath[0x200]; + + TRACE("%s\n", debugstr_w(szComponent)); + if (!squash_guid(szComponent, comp)) + return ERROR_FUNCTION_FAILED; + TRACE("squished (%s)\n", debugstr_w(comp)); + + sprintfW(keypath, szUserDataComp_fmt, localsid, comp); + + if (create) + return RegCreateKeyW(HKEY_LOCAL_MACHINE, keypath, key); + + return RegOpenKeyW(HKEY_LOCAL_MACHINE, keypath, key); +} + +UINT MSIREG_DeleteLocalUserDataComponentKey(LPCWSTR szComponent) +{ + WCHAR comp[GUID_SIZE]; + WCHAR keypath[0x200]; + + TRACE("%s\n", debugstr_w(szComponent)); + if (!squash_guid(szComponent, comp)) + return ERROR_FUNCTION_FAILED; + TRACE("squished (%s)\n", debugstr_w(comp)); + + sprintfW(keypath, szUserDataComp_fmt, localsid, comp); + return RegDeleteTreeW(HKEY_LOCAL_MACHINE, keypath); +} + UINT MSIREG_OpenUserDataComponentKey(LPCWSTR szComponent, HKEY *key, BOOL create) { UINT rc; @@ -756,6 +824,24 @@ return rc; } +UINT MSIREG_OpenLocalUserDataProductKey(LPCWSTR szProduct, HKEY *key, BOOL create) +{ + WCHAR squished_pc[GUID_SIZE]; + WCHAR keypath[0x200]; + + TRACE("%s\n", debugstr_w(szProduct)); + if (!squash_guid(szProduct, squished_pc)) + return ERROR_FUNCTION_FAILED; + TRACE("squished (%s)\n", debugstr_w(squished_pc)); + + sprintfW(keypath, szUserDataProd_fmt, localsid, squished_pc); + + if (create) + return RegCreateKeyW(HKEY_LOCAL_MACHINE, keypath, key); + + return RegOpenKeyW(HKEY_LOCAL_MACHINE, keypath, key); +} + static UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, LPCWSTR szUserSID, HKEY *key, BOOL create) { @@ -800,8 +886,6 @@ UINT MSIREG_OpenLocalSystemInstallProps(LPCWSTR szProduct, HKEY *key, BOOL create) { - static const WCHAR localsid[] = {'S','-','1','-','5','-','1','8',0}; - return MSIREG_OpenInstallProps(szProduct, localsid, key, create); } @@ -929,6 +1013,21 @@ return rc; } +UINT MSIREG_DeleteUserUpgradeCodesKey(LPCWSTR szUpgradeCode) +{ + WCHAR squished_pc[GUID_SIZE]; + WCHAR keypath[0x200]; + + TRACE("%s\n",debugstr_w(szUpgradeCode)); + if (!squash_guid(szUpgradeCode,squished_pc)) + return ERROR_FUNCTION_FAILED; + TRACE("squished (%s)\n", debugstr_w(squished_pc)); + + sprintfW(keypath,szInstaller_UserUpgradeCodes_fmt,squished_pc); + + return RegDeleteTreeW(HKEY_CURRENT_USER, keypath); +} + UINT MSIREG_OpenLocalSystemProductKey(LPCWSTR szProductCode, HKEY *key, BOOL create) { WCHAR squished_pc[GUID_SIZE]; @@ -982,6 +1081,26 @@ TRACE("squished (%s)\n", debugstr_w(squished_pc)); sprintfW(keypath, szInstaller_LocalClassesProd_fmt, squished_pc); + + if (create) + return RegCreateKeyW(HKEY_LOCAL_MACHINE, keypath, key); + + return RegOpenKeyW(HKEY_LOCAL_MACHINE, keypath, key); +} + +UINT MSIREG_OpenLocalClassesFeaturesKey(LPCWSTR szProductCode, HKEY *key, BOOL create) +{ + WCHAR squished_pc[GUID_SIZE]; + WCHAR keypath[0x200]; + + TRACE("%s\n", debugstr_w(szProductCode)); + + if (!squash_guid(szProductCode, squished_pc)) + return ERROR_FUNCTION_FAILED; + + TRACE("squished (%s)\n", debugstr_w(squished_pc)); + + sprintfW(keypath, szInstaller_LocalClassesFeat_fmt, squished_pc); if (create) return RegCreateKeyW(HKEY_LOCAL_MACHINE, keypath, key); @@ -1017,6 +1136,54 @@ return RegCreateKeyW(HKEY_LOCAL_MACHINE, keypath, key); return RegOpenKeyW(HKEY_LOCAL_MACHINE, keypath, key); +} + +UINT MSIREG_OpenManagedFeaturesKey(LPCWSTR szProductCode, HKEY *key, BOOL create) +{ + WCHAR squished_pc[GUID_SIZE]; + WCHAR keypath[0x200]; + LPWSTR usersid; + UINT r; + + TRACE("%s\n", debugstr_w(szProductCode)); + + if (!squash_guid(szProductCode, squished_pc)) + return ERROR_FUNCTION_FAILED; + + TRACE("squished (%s)\n", debugstr_w(squished_pc)); + + r = get_user_sid(&usersid); + if (r != ERROR_SUCCESS || !usersid) + { + ERR("Failed to retrieve user SID: %d\n", r); + return r; + } + + sprintfW(keypath, szInstaller_LocalManagedFeat_fmt, usersid, squished_pc); + LocalFree(usersid); + + if (create) + return RegCreateKeyW(HKEY_LOCAL_MACHINE, keypath, key); + + return RegOpenKeyW(HKEY_LOCAL_MACHINE, keypath, key); +} + +UINT MSIREG_OpenClassesUpgradeCodesKey(LPCWSTR szUpgradeCode, HKEY* key, BOOL create) +{ + WCHAR squished_pc[GUID_SIZE]; + WCHAR keypath[0x200]; + + TRACE("%s\n", debugstr_w(szUpgradeCode)); + if (!squash_guid(szUpgradeCode, squished_pc)) + return ERROR_FUNCTION_FAILED; + TRACE("squished (%s)\n", debugstr_w(squished_pc)); + + sprintfW(keypath, szInstaller_ClassesUpgrade_fmt, squished_pc); + + if (create) + return RegCreateKeyW(HKEY_CLASSES_ROOT, keypath, key); + + return RegOpenKeyW(HKEY_CLASSES_ROOT, keypath, key); } /************************************************************************* @@ -1240,7 +1407,7 @@ TRACE("%d %p\n", index, lpguid); - r = MSIREG_OpenComponents(&hkeyComponents); + r = RegCreateKeyW(HKEY_LOCAL_MACHINE, szInstaller_Components, &hkeyComponents); if( r != ERROR_SUCCESS ) return ERROR_NO_MORE_ITEMS; Modified: trunk/reactos/dll/win32/msi/source.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/source.c?rev…
============================================================================== --- trunk/reactos/dll/win32/msi/source.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/source.c [iso-8859-1] Tue Jul 8 15:52:29 2008 @@ -304,15 +304,14 @@ if (pcchDiskPrompt) { - data = ptr; - if (!*data) - data++; - - size = lstrlenW(data); + if (!*ptr) + ptr++; + + size = lstrlenW(ptr); if (size >= *pcchDiskPrompt) r = ERROR_MORE_DATA; else if (szDiskPrompt) - lstrcpyW(szDiskPrompt, data); + lstrcpyW(szDiskPrompt, ptr); *pcchDiskPrompt = size; } Modified: trunk/reactos/dll/win32/msvfw32/drawdib.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msvfw32/drawdib.…
============================================================================== --- trunk/reactos/dll/win32/msvfw32/drawdib.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msvfw32/drawdib.c [iso-8859-1] Tue Jul 8 15:52:29 2008 @@ -458,7 +458,6 @@ UINT VFWAPI DrawDibRealize(HDRAWDIB hdd, HDC hdc, BOOL fBackground) { WINE_HDD *whdd; - HPALETTE oldPal; UINT ret = 0; FIXME("(%p, %p, %d), stub\n", hdd, hdc, fBackground); @@ -475,7 +474,7 @@ if (!whdd->hpal) whdd->hpal = CreateHalftonePalette(hdc); - oldPal = SelectPalette(hdc, whdd->hpal, fBackground); + SelectPalette(hdc, whdd->hpal, fBackground); ret = RealizePalette(hdc); out: Added: trunk/reactos/dll/win32/msvfw32/msvfw32_Da.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msvfw32/msvfw32_…
============================================================================== --- trunk/reactos/dll/win32/msvfw32/msvfw32_Da.rc (added) +++ trunk/reactos/dll/win32/msvfw32/msvfw32_Da.rc [iso-8859-1] Tue Jul 8 15:52:29 2008 @@ -1,0 +1,53 @@ +/* + * Danish language support + * + * Copyright (C) 2008 Jens Albretsen <jens(a)albretsen.dk> + * + * 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 + */ + +LANGUAGE LANG_DANISH, SUBLANG_DEFAULT + +ICM_CHOOSE_COMPRESSOR DIALOG DISCARDABLE 36, 24, 187, 95 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Video komprimering" +FONT 8, "MS Shell Dlg" +{ + DEFPUSHBUTTON "OK",IDOK,129,2,49,14 + PUSHBUTTON "Annuller",IDCANCEL,129,18,49,14 + + LTEXT "&Komprimerer:",-1,9,6,105,8 + COMBOBOX 880,9,16,111,67,CBS_DROPDOWNLIST|WS_VSCROLL|WS_TABSTOP + + PUSHBUTTON "&Opsætning...",882,129,36,49,14 + PUSHBUTTON "O&m...",883,129,52,49,14 + + SCROLLBAR 884,9,44,111,9,WS_TABSTOP + + LTEXT "Komprimeringskvalite&t:",886,9,34,80,8 + + CONTROL "Keyframe for hvert",887,"Button",BS_AUTOCHECKBOX|WS_TABSTOP,9,60,66,12 + EDITTEXT 888,78,60,22,12 + LTEXT "billede",889,103,62,26,10 + + CONTROL "&Datahastighed",894,"Button",BS_AUTOCHECKBOX|WS_TABSTOP,9,76,66,12 + EDITTEXT 895,78,76,22,12 + LTEXT "KB/s",896,102,78,26,10 +} + +STRINGTABLE DISCARDABLE +{ + IDS_FULLFRAMES "Fulde billeder (ukomprimeret)" +} Propchange: trunk/reactos/dll/win32/msvfw32/msvfw32_Da.rc ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/msvfw32/msvfw32_Es.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msvfw32/msvfw32_…
============================================================================== --- trunk/reactos/dll/win32/msvfw32/msvfw32_Es.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msvfw32/msvfw32_Es.rc [iso-8859-1] Tue Jul 8 15:52:29 2008 @@ -1,5 +1,6 @@ /* * Copyright 2007 Luis Carlos Busquets Pérez + * Copyright 2008 José Manuel Ferrer Ortiz * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -36,11 +37,11 @@ LTEXT "C&alidad de compresión:",886,9,34,80,8 - CONTROL "C&uadro clave cada",887,"Botón",BS_AUTOCHECKBOX|WS_TABSTOP,9,60,66,12 + CONTROL "C&uadro clave cada",887,"Button",BS_AUTOCHECKBOX|WS_TABSTOP,9,60,66,12 EDITTEXT 888,78,60,22,12 LTEXT "cuadros",889,103,62,26,10 - CONTROL "&Velocidad de datos",894,"Botón",BS_AUTOCHECKBOX|WS_TABSTOP,9,76,66,12 + CONTROL "&Tasa de datos",894,"Button",BS_AUTOCHECKBOX|WS_TABSTOP,9,76,66,12 EDITTEXT 895,78,76,22,12 LTEXT "KB/s",896,102,78,26,10 } Modified: trunk/reactos/dll/win32/msvfw32/msvfw32_No.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msvfw32/msvfw32_…
============================================================================== --- trunk/reactos/dll/win32/msvfw32/msvfw32_No.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msvfw32/msvfw32_No.rc [iso-8859-1] Tue Jul 8 15:52:29 2008 @@ -29,8 +29,8 @@ LTEXT "&Komprimerer:",-1,9,6,105,8 COMBOBOX 880,9,16,111,67,CBS_DROPDOWNLIST|WS_VSCROLL|WS_TABSTOP - PUSHBUTTON "&Oppsett . . .",882,129,36,49,14 - PUSHBUTTON "O&m . . .",883,129,52,49,14 + PUSHBUTTON "&Oppsett...",882,129,36,49,14 + PUSHBUTTON "O&m...",883,129,52,49,14 SCROLLBAR 884,9,44,111,9,WS_TABSTOP Added: trunk/reactos/dll/win32/msvfw32/msvfw32_Ru.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msvfw32/msvfw32_…
============================================================================== --- trunk/reactos/dll/win32/msvfw32/msvfw32_Ru.rc (added) +++ trunk/reactos/dll/win32/msvfw32/msvfw32_Ru.rc [iso-8859-1] Tue Jul 8 15:52:29 2008 @@ -1,0 +1,51 @@ +/* + * Copyright 2008 Vitaliy Margolen + * + * 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 + */ + +LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT + +ICM_CHOOSE_COMPRESSOR DIALOG DISCARDABLE 36, 24, 187, 95 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Ñæàòèå âèäåî" +FONT 8, "MS Shell Dlg" +{ + DEFPUSHBUTTON "OK",IDOK,129,2,49,14 + PUSHBUTTON "Îòìåíà",IDCANCEL,129,18,49,14 + + LTEXT "&Àëãîðèòì ñæàòèÿ:",-1,9,6,105,8 + COMBOBOX 880,9,16,111,67,CBS_DROPDOWNLIST|WS_VSCROLL|WS_TABSTOP + + PUSHBUTTON "&Íàñòðîéêè...",882,129,36,49,14 + PUSHBUTTON "&Èíôîðìàöèÿ...",883,129,52,49,14 + + SCROLLBAR 884,9,44,111,9,WS_TABSTOP + + LTEXT "&Êà÷åñòâî ñæàòèÿ:",886,9,34,80,8 + + CONTROL "Êë&þ÷åâîé êàäð êàæäûå",887,"Button",BS_AUTOCHECKBOX|WS_TABSTOP,9,60,66,12 + EDITTEXT 888,78,60,22,12 + LTEXT "êàäðîâ",889,103,62,26,10 + + CONTROL "&Ïîòîê äàííûõ",894,"Button",BS_AUTOCHECKBOX|WS_TABSTOP,9,76,66,12 + EDITTEXT 895,78,76,22,12 + LTEXT "ÊÁ/ñåê",896,102,78,26,10 +} + +STRINGTABLE DISCARDABLE +{ + IDS_FULLFRAMES "Êàäðû öåëèêîì (Áåç êîìïðåññèè)" +} Propchange: trunk/reactos/dll/win32/msvfw32/msvfw32_Ru.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/msvfw32/msvfw32_Si.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msvfw32/msvfw32_…
============================================================================== --- trunk/reactos/dll/win32/msvfw32/msvfw32_Si.rc (added) +++ trunk/reactos/dll/win32/msvfw32/msvfw32_Si.rc [iso-8859-1] Tue Jul 8 15:52:29 2008 @@ -1,0 +1,55 @@ +/* + * Copyright 2008 Rok Mandeljc + * + * 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 + */ + +#pragma code_page(65001) + +LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT + +ICM_CHOOSE_COMPRESSOR DIALOG DISCARDABLE 36, 24, 187, 95 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Stiskanje videa" +FONT 8, "MS Shell Dlg" +{ + DEFPUSHBUTTON "V redu",IDOK,129,2,49,14 + PUSHBUTTON "PrekliÄi",IDCANCEL,129,18,49,14 + + LTEXT "&Kodek za stiskanje:",-1,9,6,105,8 + COMBOBOX 880,9,16,111,67,CBS_DROPDOWNLIST|WS_VSCROLL|WS_TABSTOP + + PUSHBUTTON "&Nastavitve ...",882,129,36,49,14 + PUSHBUTTON "&O ...",883,129,52,49,14 + + SCROLLBAR 884,9,44,111,9,WS_TABSTOP + + LTEXT "Kakovost &stiskanja:",886,9,34,80,8 + + CONTROL "&KljuÄna slika na vsakih",887,"Button",BS_AUTOCHECKBOX|WS_TABSTOP,9,60,66,12 + EDITTEXT 888,78,60,22,12 + LTEXT "slik",889,103,62,26,10 + + CONTROL "&Pretok podatkov",894,"Button",BS_AUTOCHECKBOX|WS_TABSTOP,9,76,66,12 + EDITTEXT 895,78,76,22,12 + LTEXT "kb/s",896,102,78,26,10 +} + +STRINGTABLE DISCARDABLE +{ + IDS_FULLFRAMES "Polne slike (nestisnjeno)" +} + +#pragma code_page(default) Propchange: trunk/reactos/dll/win32/msvfw32/msvfw32_Si.rc ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/msvfw32/msvfw32_Sv.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msvfw32/msvfw32_…
============================================================================== --- trunk/reactos/dll/win32/msvfw32/msvfw32_Sv.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msvfw32/msvfw32_Sv.rc [iso-8859-1] Tue Jul 8 15:52:29 2008 @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT +LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL ICM_CHOOSE_COMPRESSOR DIALOG DISCARDABLE 36, 24, 187, 95 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU Modified: trunk/reactos/dll/win32/msvfw32/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msvfw32/rsrc.rc?…
============================================================================== --- trunk/reactos/dll/win32/msvfw32/rsrc.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msvfw32/rsrc.rc [iso-8859-1] Tue Jul 8 15:52:29 2008 @@ -20,6 +20,7 @@ #include "winuser.h" #include "msvideo_private.h" +#include "msvfw32_Da.rc" #include "msvfw32_De.rc" #include "msvfw32_En.rc" #include "msvfw32_Es.rc" @@ -29,5 +30,7 @@ #include "msvfw32_Nl.rc" #include "msvfw32_No.rc" #include "msvfw32_Pl.rc" +#include "msvfw32_Ru.rc" +#include "msvfw32_Si.rc" #include "msvfw32_Sv.rc" #include "msvfw32_Tr.rc" Modified: trunk/reactos/dll/win32/netapi32/access.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/access.…
============================================================================== --- trunk/reactos/dll/win32/netapi32/access.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netapi32/access.c [iso-8859-1] Tue Jul 8 15:52:29 2008 @@ -105,6 +105,34 @@ return NULL; } +static BOOL NETAPI_IsCurrentUser(LPCWSTR username) +{ + LPWSTR curr_user = NULL; + DWORD dwSize; + BOOL ret = FALSE; + + dwSize = LM20_UNLEN+1; + curr_user = HeapAlloc(GetProcessHeap(), 0, dwSize); + if(!curr_user) + { + ERR("Failed to allocate memory for user name.\n"); + goto end; + } + if(!GetUserNameW(curr_user, &dwSize)) + { + ERR("Failed to get current user's user name.\n"); + goto end; + } + if (!lstrcmpW(curr_user, username)) + { + ret = TRUE; + } + +end: + HeapFree(GetProcessHeap(), 0, curr_user); + return ret; +} + /************************************************************ * NetUserAdd (NETAPI32.@) */ @@ -226,7 +254,7 @@ return NERR_InvalidComputer; } - if(!NETAPI_FindUser(username)) + if(!NETAPI_FindUser(username) && !NETAPI_IsCurrentUser(username)) { TRACE("User %s is unknown.\n", debugstr_w(username)); return NERR_UserNotFound; Modified: trunk/reactos/dll/win32/netapi32/ds.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/ds.c?re…
============================================================================== --- trunk/reactos/dll/win32/netapi32/ds.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netapi32/ds.c [iso-8859-1] Tue Jul 8 15:52:29 2008 @@ -77,7 +77,7 @@ * DsRoleGetPrimaryDomainInformation (NETAPI32.@) * * PARAMS - * lpServer [I] Pointer to UNICODE string with Computername + * lpServer [I] Pointer to UNICODE string with ComputerName * InfoLevel [I] Type of data to retrieve * Buffer [O] Pointer to to the requested data * @@ -99,6 +99,7 @@ if (!Buffer) return ERROR_INVALID_PARAMETER; if ((InfoLevel < DsRolePrimaryDomainInfoBasic) || (InfoLevel > DsRoleOperationState)) return ERROR_INVALID_PARAMETER; + *Buffer = NULL; switch (InfoLevel) { case DsRolePrimaryDomainInfoBasic: Modified: trunk/reactos/dll/win32/netapi32/nbnamecache.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/nbnamec…
============================================================================== --- trunk/reactos/dll/win32/netapi32/nbnamecache.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netapi32/nbnamecache.h [iso-8859-1] Tue Jul 8 15:52:29 2008 @@ -45,7 +45,7 @@ /* Functions that create, manipulate, and destroy a name cache. Thread-safe, * with the exception of NBNameCacheDestroy--ensure that no other threads are - * manipulating the cache before destoying it. + * manipulating the cache before destroying it. */ /* Allocates a new name cache from heap, and sets the expire time on new Modified: trunk/reactos/dll/win32/netapi32/wksta.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/wksta.c…
============================================================================== --- trunk/reactos/dll/win32/netapi32/wksta.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netapi32/wksta.c [iso-8859-1] Tue Jul 8 15:52:29 2008 @@ -103,7 +103,7 @@ /* Theoretically this could be too short, except that MS defines * MAX_ADAPTER_NAME as 128, and MAX_INTERFACE_NAME_LEN as 256, and both - * represent a count of WCHARs, so even with an extroardinarily long header + * represent a count of WCHARs, so even with an extraordinarily long header * this will be plenty */ #define MAX_TRANSPORT_NAME MAX_INTERFACE_NAME_LEN @@ -348,7 +348,6 @@ { PWKSTA_USER_INFO_1 ui; PWKSTA_USER_INFO_0 ui0; - DWORD dwSize; LSA_OBJECT_ATTRIBUTES ObjectAttributes; LSA_HANDLE PolicyHandle; PPOLICY_ACCOUNT_DOMAIN_INFO DomainInfo; @@ -405,7 +404,6 @@ oth_domains_sz * sizeof(WCHAR)); /* get data */ - dwSize = username_sz; lstrcpyW(ui->wkui1_username, ui0->wkui0_username); NetApiBufferFree(ui0);
16 years, 5 months
1
0
0
0
[pschweitzer] 34374: Synced wordpad.exe with Wine HEAD
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Tue Jul 8 15:07:27 2008 New Revision: 34374 URL:
http://svn.reactos.org/svn/reactos?rev=34374&view=rev
Log: Synced wordpad.exe with Wine HEAD Modified: trunk/reactos/base/applications/wordpad/registry.c trunk/reactos/base/applications/wordpad/wordpad.c trunk/reactos/base/applications/wordpad/wordpad.h trunk/reactos/base/applications/wordpad/wordpad.rbuild Modified: trunk/reactos/base/applications/wordpad/registry.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
============================================================================== --- trunk/reactos/base/applications/wordpad/registry.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/wordpad/registry.c [iso-8859-1] Tue Jul 8 15:07:27 2008 @@ -33,6 +33,7 @@ static const WCHAR var_file[] = {'F','i','l','e','%','d',0}; static const WCHAR var_framerect[] = {'F','r','a','m','e','R','e','c','t',0}; static const WCHAR var_barstate0[] = {'B','a','r','S','t','a','t','e','0',0}; +static const WCHAR var_maximized[] = {'M','a','x','i','m','i','z','e','d',0}; static LRESULT registry_get_handle(HKEY *hKey, LPDWORD action, LPCWSTR subKey) { @@ -82,11 +83,15 @@ if(registry_get_handle(&hKey, &action, (LPWSTR)key_options) == ERROR_SUCCESS) { - RECT rc; - - GetWindowRect(hMainWnd, &rc); - - RegSetValueExW(hKey, var_framerect, 0, REG_BINARY, (LPBYTE)&rc, sizeof(RECT)); + WINDOWPLACEMENT wp; + DWORD isMaximized; + + wp.length = sizeof(WINDOWPLACEMENT); + GetWindowPlacement(hMainWnd, &wp); + isMaximized = (wp.showCmd == SW_SHOWMAXIMIZED); + + RegSetValueExW(hKey, var_framerect, 0, REG_BINARY, (LPBYTE)&wp.rcNormalPosition, sizeof(RECT)); + RegSetValueExW(hKey, var_maximized, 0, REG_DWORD, (LPBYTE)&isMaximized, sizeof(DWORD)); registry_set_pagemargins(hKey); } @@ -107,6 +112,21 @@ rc->left = 0; rc->bottom = 300; rc->right = 600; + } + + RegCloseKey(hKey); +} + +void registry_read_maximized(DWORD *bMaximized) +{ + HKEY hKey; + DWORD size = sizeof(DWORD); + + if(registry_get_handle(&hKey, 0, (LPWSTR)key_options) != ERROR_SUCCESS || + RegQueryValueExW(hKey, var_maximized, 0, NULL, (LPBYTE)bMaximized, &size) != + ERROR_SUCCESS || size != sizeof(DWORD)) + { + *bMaximized = FALSE; } RegCloseKey(hKey); Modified: trunk/reactos/base/applications/wordpad/wordpad.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
============================================================================== --- trunk/reactos/base/applications/wordpad/wordpad.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/wordpad/wordpad.c [iso-8859-1] Tue Jul 8 15:07:27 2008 @@ -595,9 +595,9 @@ { RECT rect; - GetWindowRect(hMainWnd, &rect); - - (void) OnSize(hMainWnd, SIZE_RESTORED, MAKELONG(rect.right, rect.bottom)); + GetClientRect(hMainWnd, &rect); + + OnSize(hMainWnd, SIZE_RESTORED, MAKELPARAM(rect.right, rect.bottom)); } static BOOL is_bar_visible(int bandId) @@ -2490,7 +2490,7 @@ return 0; } -int CALLBACK wWinMain(HINSTANCE hInstance, HINSTANCE hOldInstance, LPWSTR szCmdParagraph, int res) +int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hOldInstance, LPSTR szCmdParagraph, int nCmdShow) { INITCOMMONCONTROLSEX classes = {8, ICC_BAR_CLASSES|ICC_COOL_CLASSES|ICC_USEREX_CLASSES}; HACCEL hAccel; @@ -2500,6 +2500,7 @@ UINT_PTR hPrevRulerProc; HWND hRulerWnd; POINTL EditPoint; + DWORD bMaximized; static const WCHAR wszAccelTable[] = {'M','A','I','N','A','C','C','E','L', 'T','A','B','L','E','\0'}; @@ -2522,7 +2523,11 @@ registry_read_winrect(&rc); hMainWnd = CreateWindowExW(0, wszMainWndClass, wszAppTitle, WS_CLIPCHILDREN|WS_OVERLAPPEDWINDOW, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, NULL, NULL, hInstance, NULL); - ShowWindow(hMainWnd, SW_SHOWDEFAULT); + registry_read_maximized(&bMaximized); + if ((nCmdShow == SW_SHOWNORMAL || nCmdShow == SW_SHOWDEFAULT) + && bMaximized) + nCmdShow = SW_SHOWMAXIMIZED; + ShowWindow(hMainWnd, nCmdShow); set_caption(NULL); set_bar_states(); Modified: trunk/reactos/base/applications/wordpad/wordpad.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
============================================================================== --- trunk/reactos/base/applications/wordpad/wordpad.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/wordpad/wordpad.h [iso-8859-1] Tue Jul 8 15:07:27 2008 @@ -216,6 +216,7 @@ void registry_read_options(void); void registry_read_formatopts_all(DWORD[], DWORD[]); void registry_read_winrect(RECT*); +void registry_read_maximized(DWORD*); void registry_set_filelist(LPCWSTR, HWND); void registry_set_formatopts_all(DWORD[]); void registry_set_options(HWND); Modified: trunk/reactos/base/applications/wordpad/wordpad.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
============================================================================== --- trunk/reactos/base/applications/wordpad/wordpad.rbuild [iso-8859-1] (original) +++ trunk/reactos/base/applications/wordpad/wordpad.rbuild [iso-8859-1] Tue Jul 8 15:07:27 2008 @@ -1,7 +1,9 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> -<module name="wordpad" type="win32gui" installbase="system32" installname="wordpad.exe" unicode="yes" allowwarnings="true"> +<module name="wordpad" type="win32gui" installbase="system32" installname="wordpad.exe" allowwarnings="true"> <include base="wordpad">.</include> + <define name="UNICODE" /> + <define name="_UNICODE" /> <define name="_WIN32_IE">0x0600</define> <define name="_WIN32_WINNT">0x0501</define> <library>comdlg32</library>
16 years, 5 months
1
0
0
0
[pschweitzer] 34373: Synced riched32_winetest.exe, shlwapi_winetest.exe, urlmon_winetest.exe with Wine HEAD
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Tue Jul 8 14:30:15 2008 New Revision: 34373 URL:
http://svn.reactos.org/svn/reactos?rev=34373&view=rev
Log: Synced riched32_winetest.exe, shlwapi_winetest.exe, urlmon_winetest.exe with Wine HEAD Modified: trunk/rostests/winetests/riched32/editor.c trunk/rostests/winetests/shlwapi/istream.c trunk/rostests/winetests/shlwapi/path.c trunk/rostests/winetests/shlwapi/url.c trunk/rostests/winetests/urlmon/protocol.c trunk/rostests/winetests/urlmon/stream.c trunk/rostests/winetests/urlmon/url.c Modified: trunk/rostests/winetests/riched32/editor.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/riched32/editor…
============================================================================== --- trunk/rostests/winetests/riched32/editor.c [iso-8859-1] (original) +++ trunk/rostests/winetests/riched32/editor.c [iso-8859-1] Tue Jul 8 14:30:15 2008 @@ -696,6 +696,130 @@ DestroyWindow(hwndRichEdit); } +static void test_EM_POSFROMCHAR(void) +{ + HWND hwndRichEdit = new_richedit(NULL); + int i; + POINTL pl; + LRESULT result; + unsigned int height = 0; + int xpos = 0; + static const char text[] = "aa\n" + "this is a long line of text that should be longer than the " + "control's width\n" + "cc\n" + "dd\n" + "ee\n" + "ff\n" + "gg\n" + "hh\n"; + + /* Fill the control to lines to ensure that most of them are offscreen */ + for (i = 0; i < 50; i++) + { + /* Do not modify the string; it is exactly 16 characters long. */ + SendMessage(hwndRichEdit, EM_SETSEL, 0, 0); + SendMessage(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM)"0123456789ABCD\r\n"); + } + + /* + Richedit 1.0 receives a POINTL* on wParam and character offset on lParam, returns void. + Richedit 2.0 receives character offset on wParam, ignores lParam, returns MAKELONG(x,y) + Richedit 3.0 accepts either of the above API conventions. + */ + + /* Testing Richedit 1.0 API format */ + + /* Testing start of lines. X-offset should be constant on all cases (native is 1). + Since all lines are identical and drawn with the same font, + they should have the same height... right? + */ + for (i = 0; i < 50; i++) + { + /* All the lines are 16 characters long */ + result = SendMessage(hwndRichEdit, EM_POSFROMCHAR, (WPARAM)&pl, i * 16); + ok(result == 0, "EM_POSFROMCHAR returned %ld, expected 0\n", result); + if (i == 0) + { + ok(pl.y == 0, "EM_POSFROMCHAR reports y=%d, expected 0\n", pl.y); + todo_wine { + ok(pl.x == 1, "EM_POSFROMCHAR reports x=%d, expected 1\n", pl.x); + } + xpos = pl.x; + } + else if (i == 1) + { + ok(pl.y > 0, "EM_POSFROMCHAR reports y=%d, expected > 0\n", pl.y); + ok(pl.x == xpos, "EM_POSFROMCHAR reports x=%d, expected 1\n", pl.x); + height = pl.y; + } + else + { + ok(pl.y == i * height, "EM_POSFROMCHAR reports y=%d, expected %d\n", pl.y, i * height); + ok(pl.x == xpos, "EM_POSFROMCHAR reports x=%d, expected 1\n", pl.x); + } + } + + /* Testing position at end of text */ + result = SendMessage(hwndRichEdit, EM_POSFROMCHAR, (WPARAM)&pl, 50 * 16); + ok(result == 0, "EM_POSFROMCHAR returned %ld, expected 0\n", result); + ok(pl.y == 50 * height, "EM_POSFROMCHAR reports y=%d, expected %d\n", pl.y, 50 * height); + ok(pl.x == xpos, "EM_POSFROMCHAR reports x=%d, expected 1\n", pl.x); + + /* Testing position way past end of text */ + result = SendMessage(hwndRichEdit, EM_POSFROMCHAR, (WPARAM)&pl, 55 * 16); + ok(result == 0, "EM_POSFROMCHAR returned %ld, expected 0\n", result); + ok(pl.y == 50 * height, "EM_POSFROMCHAR reports y=%d, expected %d\n", pl.y, 50 * height); + ok(pl.x == xpos, "EM_POSFROMCHAR reports x=%d, expected 1\n", pl.x); + + + /* Testing that vertical scrolling does, in fact, have an effect on EM_POSFROMCHAR */ + SendMessage(hwndRichEdit, EM_SCROLL, SB_LINEDOWN, 0); /* line down */ + for (i = 0; i < 50; i++) + { + /* All the lines are 16 characters long */ + result = SendMessage(hwndRichEdit, EM_POSFROMCHAR, (WPARAM)&pl, i * 16); + ok(result == 0, "EM_POSFROMCHAR returned %ld, expected 0\n", result); + ok(pl.y == (i - 1) * height, + "EM_POSFROMCHAR reports y=%d, expected %d\n", + pl.y, (i - 1) * height); + ok(pl.x == xpos, "EM_POSFROMCHAR reports x=%d, expected 1\n", pl.x); + } + + /* Testing position at end of text */ + result = SendMessage(hwndRichEdit, EM_POSFROMCHAR, (WPARAM)&pl, 50 * 16); + ok(result == 0, "EM_POSFROMCHAR returned %ld, expected 0\n", result); + ok(pl.y == (50 - 1) * height, "EM_POSFROMCHAR reports y=%d, expected %d\n", pl.y, (50 - 1) * height); + ok(pl.x == xpos, "EM_POSFROMCHAR reports x=%d, expected 1\n", pl.x); + + /* Testing position way past end of text */ + result = SendMessage(hwndRichEdit, EM_POSFROMCHAR, (WPARAM)&pl, 55 * 16); + ok(result == 0, "EM_POSFROMCHAR returned %ld, expected 0\n", result); + ok(pl.y == (50 - 1) * height, "EM_POSFROMCHAR reports y=%d, expected %d\n", pl.y, (50 - 1) * height); + ok(pl.x == xpos, "EM_POSFROMCHAR reports x=%d, expected 1\n", pl.x); + + /* Testing that horizontal scrolling does, in fact, have an effect on EM_POSFROMCHAR */ + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) text); + SendMessage(hwndRichEdit, EM_SCROLL, SB_LINEUP, 0); /* line up */ + + result = SendMessage(hwndRichEdit, EM_POSFROMCHAR, (WPARAM)&pl, 0); + ok(result == 0, "EM_POSFROMCHAR returned %ld, expected 0\n", result); + ok(pl.y == 0, "EM_POSFROMCHAR reports y=%d, expected 0\n", pl.y); + todo_wine { + ok(pl.x == 1, "EM_POSFROMCHAR reports x=%d, expected 1\n", pl.x); + } + xpos = pl.x; + + SendMessage(hwndRichEdit, WM_HSCROLL, SB_LINERIGHT, 0); + result = SendMessage(hwndRichEdit, EM_POSFROMCHAR, (WPARAM)&pl, 0); + ok(result == 0, "EM_POSFROMCHAR returned %ld, expected 0\n", result); + ok(pl.y == 0, "EM_POSFROMCHAR reports y=%d, expected 0\n", pl.y); + todo_wine { + /* Fails on builtin because horizontal scrollbar is not being shown */ + ok(pl.x < xpos, "EM_POSFROMCHAR reports x=%hd, expected value less than %d\n", pl.x, xpos); + } + DestroyWindow(hwndRichEdit); +} START_TEST( editor ) @@ -717,6 +841,7 @@ test_EM_GETLINE(); test_EM_LINELENGTH(); test_EM_FINDTEXT(); + test_EM_POSFROMCHAR(); /* Set the environment variable WINETEST_RICHED32 to keep windows * responsive and open for 30 seconds. This is useful for debugging. Modified: trunk/rostests/winetests/shlwapi/istream.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/istream…
============================================================================== --- trunk/rostests/winetests/shlwapi/istream.c [iso-8859-1] (original) +++ trunk/rostests/winetests/shlwapi/istream.c [iso-8859-1] Tue Jul 8 14:30:15 2008 @@ -384,9 +384,14 @@ IStream * template = NULL; HRESULT ret; ULONG refcount; - static const WCHAR test_file[] = { 'c', ':', '\\', 't', 'e', 's', 't', '.', 't', 'x', 't', '\0' }; + WCHAR test_file[MAX_PATH]; + static const WCHAR testEx_txt[] = { '\\', 't', 'e', 's', 't', 'E','x', '.', 't', 'x', 't', '\0' }; trace("SHCreateStreamOnFileEx: testing mode %d, STGM flags %08x\n", mode, stgm); + + /* Don't used a fixed path for the testEx.txt file */ + GetTempPathW(MAX_PATH, test_file); + lstrcatW(test_file, testEx_txt); /* invalid arguments */ Modified: trunk/rostests/winetests/shlwapi/path.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/path.c?…
============================================================================== --- trunk/rostests/winetests/shlwapi/path.c [iso-8859-1] (original) +++ trunk/rostests/winetests/shlwapi/path.c [iso-8859-1] Tue Jul 8 14:30:15 2008 @@ -537,9 +537,13 @@ SetLastError(0xdeadbeef); lstrcpyA(dest, "control"); str = PathCombineA(dest, "relative\\dir", "\\one\\two\\three\\"); - ok(str == dest, "Expected str == dest, got %p\n", str); - ok(!lstrcmp(str, "one\\two\\three\\"), "Expected one\\two\\three\\, got %s\n", str); - ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError()); + /* Vista fails which probably makes sense as PathCombineA expects an absolute dir */ + if (str) + { + ok(str == dest, "Expected str == dest, got %p\n", str); + ok(!lstrcmp(str, "one\\two\\three\\"), "Expected one\\two\\three\\, got %s\n", str); + } /* try forward slashes */ SetLastError(0xdeadbeef); @@ -806,10 +810,8 @@ ok(!res, "Expected failure\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); - todo_wine - { - ok(!lstrcmp(dest, "test"), "Expected test, got %s\n", dest); - } + ok(dest[0] == 0 || !lstrcmp(dest, "test"), + "Expected either an empty string (Vista) or test, got %s\n", dest); /* try an empty source */ lstrcpy(dest, "test"); Modified: trunk/rostests/winetests/shlwapi/url.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/url.c?r…
============================================================================== --- trunk/rostests/winetests/shlwapi/url.c [iso-8859-1] (original) +++ trunk/rostests/winetests/shlwapi/url.c [iso-8859-1] Tue Jul 8 14:30:15 2008 @@ -74,6 +74,10 @@ {"file:///c:/tests\\foo%20bar", URL_UNESCAPE , S_OK, "file:///c:/tests/foo bar", FALSE}, {"file:///c:/tests/foo%20bar", 0, S_OK, "file:///c:/tests/foo%20bar", FALSE}, {"file:///c:/tests/foo%20bar", URL_FILE_USE_PATHURL, S_OK, "file://c:\\tests\\foo bar", FALSE}, + {"file://localhost/c:/tests/../tests/foo%20bar", URL_FILE_USE_PATHURL, S_OK, "file://c:\\tests\\foo bar", FALSE}, + {"file://localhost\\c:/tests/../tests/foo%20bar", URL_FILE_USE_PATHURL, S_OK, "file://c:\\tests\\foo bar", FALSE}, + {"file://localhost\\\\c:/tests/../tests/foo%20bar", URL_FILE_USE_PATHURL, S_OK, "file://c:\\tests\\foo bar", FALSE}, + {"file://localhost\\c:\\tests/../tests/foo%20bar", URL_FILE_USE_PATHURL, S_OK, "file://c:\\tests\\foo bar", FALSE}, {"file://c:/tests/../tests/foo%20bar", URL_FILE_USE_PATHURL, S_OK, "file://c:\\tests\\foo bar", FALSE}, {"file://c:/tests\\../tests/foo%20bar", URL_FILE_USE_PATHURL, S_OK, "file://c:\\tests\\foo bar", FALSE}, {"file://c:/tests/foo%20bar", URL_FILE_USE_PATHURL, S_OK, "file://c:\\tests\\foo bar", FALSE}, @@ -575,6 +579,7 @@ DWORD dwSize; DWORD urllen; HRESULT hr; + int i; if (!pUrlCanonicalizeW) { @@ -624,6 +629,21 @@ "got 0x%x with %u and size %u for %u (expected 'S_OK' and size %u)\n", hr, GetLastError(), dwSize, lstrlenW(szReturnUrl), urllen); + /* check that the characters 1..32 are chopped from the end of the string */ + for (i = 1; i < 65536; i++) + { + WCHAR szUrl[128]; + BOOL choped; + int pos; + + MultiByteToWideChar(CP_UTF8, 0, "
http://www.winehq.org/X
", -1, szUrl, 128); + pos = lstrlenW(szUrl) - 1; + szUrl[pos] = i; + urllen = INTERNET_MAX_URL_LENGTH; + pUrlCanonicalizeW(szUrl, szReturnUrl, &urllen, 0); + choped = lstrlenW(szReturnUrl) < lstrlenW(szUrl); + ok(choped == (i <= 32), "Incorrect char chopping for char %d\n", i); + } } /* ########################### */ @@ -781,8 +801,8 @@ DWORD dwEscaped; size_t i; static char inplace[] = "file:///C:/Program%20Files"; - static WCHAR inplaceW[] = {'f','i','l','e',':','/','/','/','C',':','/', - 'P','r','o','g','r','a','m','%','2','0','F','i','l','e','s',0}; + static const char expected[] = "file:///C:/Program Files"; + static WCHAR inplaceW[] = {'f','i','l','e',':','/','/','/','C',':','/','P','r','o','g','r','a','m',' ','F','i','l','e','s',0}; for(i=0; i<sizeof(TEST_URL_UNESCAPE)/sizeof(TEST_URL_UNESCAPE[0]); i++) { dwEscaped=INTERNET_MAX_URL_LENGTH; @@ -801,9 +821,12 @@ dwEscaped = sizeof(inplace); ok(UrlUnescapeA(inplace, NULL, &dwEscaped, URL_UNESCAPE_INPLACE) == S_OK, "UrlUnescapeA failed unexpectedly\n"); + ok(!strcmp(inplace, expected), "got %s expected %s\n", inplace, expected); + ok(dwEscaped == 27, "got %d expected 27\n", dwEscaped); dwEscaped = sizeof(inplaceW); ok(UrlUnescapeW(inplaceW, NULL, &dwEscaped, URL_UNESCAPE_INPLACE) == S_OK, "UrlUnescapeW failed unexpectedly\n"); + ok(dwEscaped == 50, "got %d expected 50\n", dwEscaped); } /* ########################### */ Modified: trunk/rostests/winetests/urlmon/protocol.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/protocol…
============================================================================== --- trunk/rostests/winetests/urlmon/protocol.c [iso-8859-1] (original) +++ trunk/rostests/winetests/urlmon/protocol.c [iso-8859-1] Tue Jul 8 14:30:15 2008 @@ -426,7 +426,7 @@ ok(szStatusText != NULL, "szStatusText == NULL\n"); if(szStatusText) { if(binding_test) - ok(szStatusText == expect_wsz, "unexpected szStatusText\n"); + ok(!lstrcmpW(szStatusText, expect_wsz), "unexpected szStatusText\n"); else if(tested_protocol == FILE_TEST) ok(!lstrcmpW(szStatusText, file_name), "szStatusText = \"%s\"\n", debugstr_w(szStatusText)); else @@ -1342,8 +1342,10 @@ SET_EXPECT(GetBindInfo); expect_hrResult = MK_E_SYNTAX; hres = IInternetProtocol_Start(protocol, wszIndexHtml, &protocol_sink, &bind_info, 0, 0); - ok(hres == MK_E_SYNTAX, "Start failed: %08x, expected MK_E_SYNTAX\n", hres); - CHECK_CALLED(GetBindInfo); + ok(hres == MK_E_SYNTAX || + hres == E_INVALIDARG, + "Start failed: %08x, expected MK_E_SYNTAX or E_INVALIDARG\n", hres); + CLEAR_CALLED(GetBindInfo); /* GetBindInfo not called in IE7 */ SET_EXPECT(GetBindInfo); if(!(bindf & BINDF_FROMURLMON)) @@ -1387,12 +1389,12 @@ SET_EXPECT(GetBindInfo); hres = IInternetProtocol_Start(protocol, NULL, &protocol_sink, &bind_info, 0, 0); ok(hres == E_INVALIDARG, "Start failed: %08x, expected E_INVALIDARG\n", hres); - CHECK_CALLED(GetBindInfo); + CLEAR_CALLED(GetBindInfo); /* GetBindInfo not called in IE7 */ SET_EXPECT(GetBindInfo); hres = IInternetProtocol_Start(protocol, emptyW, &protocol_sink, &bind_info, 0, 0); ok(hres == E_INVALIDARG, "Start failed: %08x, expected E_INVALIDARG\n", hres); - CHECK_CALLED(GetBindInfo); + CLEAR_CALLED(GetBindInfo); /* GetBindInfo not called in IE7 */ IInternetProtocol_Release(protocol); } @@ -1721,13 +1723,23 @@ expect_hrResult = INET_E_RESOURCE_NOT_FOUND; hres = IInternetProtocol_Start(protocol, wrong_url2, &protocol_sink, &bind_info, 0, 0); - ok(hres == INET_E_RESOURCE_NOT_FOUND, "Start failed: %08x, expected INET_E_RESOURCE_NOT_FOUND\n", hres); - - CHECK_CALLED(GetBindInfo); - CLEAR_CALLED(ReportProgress_DIRECTBIND); - CHECK_CALLED(ReportProgress_SENDINGREQUEST); - CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE); - CHECK_CALLED(ReportResult); + ok(hres == INET_E_RESOURCE_NOT_FOUND || + hres == INET_E_INVALID_URL, /* win2k3 */ + "Start failed: %08x, expected INET_E_RESOURCE_NOT_FOUND or INET_E_INVALID_URL\n", hres); + + if (hres == INET_E_RESOURCE_NOT_FOUND) { + CHECK_CALLED(GetBindInfo); + CLEAR_CALLED(ReportProgress_DIRECTBIND); + CHECK_CALLED(ReportProgress_SENDINGREQUEST); + CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE); + CHECK_CALLED(ReportResult); + }else { + CLEAR_CALLED(GetBindInfo); + CLEAR_CALLED(ReportProgress_DIRECTBIND); + CLEAR_CALLED(ReportProgress_SENDINGREQUEST); + CLEAR_CALLED(ReportProgress_MIMETYPEAVAILABLE); + CLEAR_CALLED(ReportResult); + } IInternetProtocol_Release(protocol); } Modified: trunk/rostests/winetests/urlmon/stream.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/stream.c…
============================================================================== --- trunk/rostests/winetests/urlmon/stream.c [iso-8859-1] (original) +++ trunk/rostests/winetests/urlmon/stream.c [iso-8859-1] Tue Jul 8 14:30:15 2008 @@ -294,7 +294,7 @@ static void test_URLOpenBlockingStreamW(void) { HRESULT hr; - IStream *pStream; + IStream *pStream = NULL; char buffer[256]; hr = URLOpenBlockingStreamW(NULL, NULL, &pStream, 0, &BindStatusCallback); @@ -324,12 +324,14 @@ CHECK_CALLED(OnStopBinding); ok(pStream != NULL, "pStream is NULL\n"); - - hr = IStream_Read(pStream, buffer, sizeof(buffer), NULL); - ok(hr == S_OK, "IStream_Read failed with error 0x%08x\n", hr); - ok(!memcmp(buffer, szHtmlDoc, sizeof(szHtmlDoc)-1), "read data differs from file\n"); - - IStream_Release(pStream); + if(pStream) + { + hr = IStream_Read(pStream, buffer, sizeof(buffer), NULL); + ok(hr == S_OK, "IStream_Read failed with error 0x%08x\n", hr); + ok(!memcmp(buffer, szHtmlDoc, sizeof(szHtmlDoc)-1), "read data differs from file\n"); + + IStream_Release(pStream); + } } static void test_URLOpenStreamW(void) Modified: trunk/rostests/winetests/urlmon/url.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/url.c?re…
============================================================================== --- trunk/rostests/winetests/urlmon/url.c [iso-8859-1] (original) +++ trunk/rostests/winetests/urlmon/url.c [iso-8859-1] Tue Jul 8 14:30:15 2008 @@ -2194,6 +2194,8 @@ SET_EXPECT(Start); if(test_protocol == HTTP_TEST) SET_EXPECT(Terminate); + if(test_protocol == FILE_TEST) + SET_EXPECT(OnProgress_MIMETYPEAVAILABLE); SET_EXPECT(UnlockRequest); }else { if(test_protocol == HTTP_TEST) { @@ -2260,6 +2262,8 @@ CHECK_CALLED(Start); if(test_protocol == HTTP_TEST) CHECK_CALLED(Terminate); + if(test_protocol == FILE_TEST) + CLEAR_CALLED(OnProgress_MIMETYPEAVAILABLE); /* not called in IE7 */ CHECK_CALLED(UnlockRequest); }else { if(test_protocol == HTTP_TEST) { @@ -2302,9 +2306,13 @@ if(test_protocol != HTTP_TEST || emul || urls[test_protocol] == SHORT_RESPONSE_URL) { ok(IMoniker_Release(mon) == 0, "mon should be destroyed here\n"); ok(IBindCtx_Release(bctx) == 0, "bctx should be destroyed here\n"); - }else todo_wine { - ok(IMoniker_Release(mon) == 0, "mon should be destroyed here\n"); - ok(IBindCtx_Release(bctx) == 0, "bctx should be destroyed here\n"); + }else { + todo_wine ok(IMoniker_Release(mon) == 0, "mon should be destroyed here\n"); + + if(bindf & BINDF_ASYNCHRONOUS) + ok(IBindCtx_Release(bctx) != 0, "bctx should not be destroyed here\n"); + else + todo_wine ok(IBindCtx_Release(bctx) == 0, "bctx should be destroyed here\n"); } if(emul)
16 years, 5 months
1
0
0
0
[pschweitzer] 34372: Synced riched32.dll, shlwapi.dll, urlmon.dll with Wine HEAD
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Tue Jul 8 14:27:29 2008 New Revision: 34372 URL:
http://svn.reactos.org/svn/reactos?rev=34372&view=rev
Log: Synced riched32.dll, shlwapi.dll, urlmon.dll with Wine HEAD Modified: trunk/reactos/dll/win32/riched32/riched32.rbuild trunk/reactos/dll/win32/riched32/richedit.c trunk/reactos/dll/win32/shlwapi/assoc.c trunk/reactos/dll/win32/shlwapi/string.c trunk/reactos/dll/win32/shlwapi/url.c trunk/reactos/dll/win32/urlmon/file.c trunk/reactos/dll/win32/urlmon/mk.c Modified: trunk/reactos/dll/win32/riched32/riched32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched32/riched3…
============================================================================== --- trunk/reactos/dll/win32/riched32/riched32.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched32/riched32.rbuild [iso-8859-1] Tue Jul 8 14:27:29 2008 @@ -1,5 +1,6 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> +<group> <module name="riched32" type="win32dll" baseaddress="${BASEADDRESS_RICHED32}" installbase="system32" installname="riched32.dll" allowwarnings="true"> <importlibrary definition="riched32.spec.def" /> <include base="riched32">.</include> @@ -7,12 +8,13 @@ <define name="__WINESRC__" /> <define name="WINVER">0x600</define> <define name="_WIN32_WINNT">0x600</define> + <file>richedit.c</file> + <file>version.rc</file> + <file>riched32.spec</file> <library>wine</library> <library>riched20</library> <library>user32</library> <library>kernel32</library> <library>ntdll</library> - <file>richedit.c</file> - <file>version.rc</file> - <file>riched32.spec</file> </module> +</group> Modified: trunk/reactos/dll/win32/riched32/richedit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched32/richedi…
============================================================================== --- trunk/reactos/dll/win32/riched32/richedit.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched32/richedit.c [iso-8859-1] Tue Jul 8 14:27:29 2008 @@ -56,7 +56,7 @@ WNDCLASSA wndClass; ZeroMemory(&wndClass, sizeof(WNDCLASSA)); - wndClass.style = CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS; + wndClass.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS; wndClass.lpfnWndProc = RichEdit10ANSIWndProc; wndClass.cbClsExtra = 0; wndClass.cbWndExtra = 4; Modified: trunk/reactos/dll/win32/shlwapi/assoc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/assoc.c?…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/assoc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/assoc.c [iso-8859-1] Tue Jul 8 14:27:29 2008 @@ -503,7 +503,7 @@ * PARAMS * iface [I] IQueryAssociations interface to initialise * cfFlags [I] ASSOCF_ flags from "shlwapi.h" - * pszAssoc [I] String for the root key name, or NULL if hkProgid is given + * pszAssoc [I] String for the root key name, or NULL if hkeyProgid is given * hkeyProgid [I] Handle for the root key, or NULL if pszAssoc is given * hWnd [I] Reserved, must be NULL. * Modified: trunk/reactos/dll/win32/shlwapi/string.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/string.c…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/string.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/string.c [iso-8859-1] Tue Jul 8 14:27:29 2008 @@ -511,7 +511,7 @@ * Internal implementation of StrStrA/StrStrIA */ static LPSTR SHLWAPI_StrStrHelperA(LPCSTR lpszStr, LPCSTR lpszSearch, - int (*pStrCmpFn)(LPCSTR,LPCSTR,size_t)) + INT (WINAPI *pStrCmpFn)(LPCSTR,LPCSTR,INT)) { size_t iLen; @@ -545,7 +545,7 @@ { TRACE("(%s,%s)\n", debugstr_a(lpszStr), debugstr_a(lpszSearch)); - return SHLWAPI_StrStrHelperA(lpszStr, lpszSearch, strncmp); + return SHLWAPI_StrStrHelperA(lpszStr, lpszSearch, StrCmpNA); } /************************************************************************* @@ -650,7 +650,7 @@ { TRACE("(%s,%s)\n", debugstr_a(lpszStr), debugstr_a(lpszSearch)); - return SHLWAPI_StrStrHelperA(lpszStr, lpszSearch, strncasecmp); + return SHLWAPI_StrStrHelperA(lpszStr, lpszSearch, StrCmpNIA); } /************************************************************************* Modified: trunk/reactos/dll/win32/shlwapi/url.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/url.c?re…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/url.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/url.c [iso-8859-1] Tue Jul 8 14:27:29 2008 @@ -319,6 +319,7 @@ WCHAR slash = '/'; static const WCHAR wszFile[] = {'f','i','l','e',':'}; + static const WCHAR wszLocalhost[] = {'l','o','c','a','l','h','o','s','t'}; TRACE("(%s, %p, %p, 0x%08x) *pcchCanonicalized: %d\n", debugstr_w(pszUrl), pszCanonicalized, pcchCanonicalized, dwFlags, pcchCanonicalized ? *pcchCanonicalized : -1); @@ -387,6 +388,12 @@ *wk2++ = *wk1++; if (*wk1 != '/') {state = 6; break;} *wk2++ = *wk1++; + if((dwFlags & URL_FILE_USE_PATHURL) && nByteLen >= sizeof(wszLocalhost) + && !memcmp(wszLocalhost, wk1, sizeof(wszLocalhost))){ + wk1 += sizeof(wszLocalhost)/sizeof(WCHAR); + while(*wk1 == '\\' && (dwFlags & URL_FILE_USE_PATHURL)) + wk1++; + } if(*wk1 == '/' && (dwFlags & URL_FILE_USE_PATHURL)) wk1++; state = 4; @@ -495,7 +502,7 @@ debugstr_w(pszUrl), debugstr_w(lpszUrlCpy)); } nLen = lstrlenW(lpszUrlCpy); - while ((nLen > 0) && ((lpszUrlCpy[nLen-1] == '\r')||(lpszUrlCpy[nLen-1] == '\n'))) + while ((nLen > 0) && ((lpszUrlCpy[nLen-1] <= ' '))) lpszUrlCpy[--nLen]=0; if(dwFlags & (URL_UNESCAPE | URL_FILE_USE_PATHURL)) Modified: trunk/reactos/dll/win32/urlmon/file.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/file.c?re…
============================================================================== --- trunk/reactos/dll/win32/urlmon/file.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/file.c [iso-8859-1] Tue Jul 8 14:27:29 2008 @@ -109,6 +109,10 @@ TRACE("(%p)->(%s %p %p %08x %d)\n", This, debugstr_w(szUrl), pOIProtSink, pOIBindInfo, grfPI, dwReserved); + if(!szUrl || lstrlenW(szUrl) < sizeof(wszFile)/sizeof(WCHAR) + || memcmp(szUrl, wszFile, sizeof(wszFile))) + return E_INVALIDARG; + memset(&bindinfo, 0, sizeof(bindinfo)); bindinfo.cbSize = sizeof(BINDINFO); hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &grfBINDF, &bindinfo); @@ -118,13 +122,6 @@ } ReleaseBindInfo(&bindinfo); - - if(!szUrl || !*szUrl) - return E_INVALIDARG; - - if(lstrlenW(szUrl) < sizeof(wszFile)/sizeof(WCHAR) - || memcmp(szUrl, wszFile, sizeof(wszFile))) - return MK_E_SYNTAX; len = lstrlenW(szUrl)+16; url = heap_alloc(len*sizeof(WCHAR)); Modified: trunk/reactos/dll/win32/urlmon/mk.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/mk.c?rev=…
============================================================================== --- trunk/reactos/dll/win32/urlmon/mk.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/mk.c [iso-8859-1] Tue Jul 8 14:27:29 2008 @@ -106,7 +106,7 @@ CLSID clsid; HRESULT hres; - static const WCHAR wszMK[] = {'m','k',':'}; + static const WCHAR wszMK[] = {'m','k',':','@'}; TRACE("(%p)->(%s %p %p %08x %d)\n", This, debugstr_w(szUrl), pOIProtSink, pOIBindInfo, grfPI, dwReserved); @@ -133,10 +133,6 @@ } ptr2 = szUrl + sizeof(wszMK)/sizeof(WCHAR); - if(*ptr2 != '@') - return report_result(pOIProtSink, INET_E_RESOURCE_NOT_FOUND, ERROR_INVALID_PARAMETER); - ptr2++; - ptr = strchrW(ptr2, ':'); if(!ptr) return report_result(pOIProtSink, INET_E_RESOURCE_NOT_FOUND, ERROR_INVALID_PARAMETER);
16 years, 5 months
1
0
0
0
[jimtabor] 34371: Fix build, I knew that commit was lite.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Tue Jul 8 14:06:37 2008 New Revision: 34371 URL:
http://svn.reactos.org/svn/reactos?rev=34371&view=rev
Log: Fix build, I knew that commit was lite. Modified: trunk/reactos/subsystems/win32/win32k/w32ksvc.db Modified: trunk/reactos/subsystems/win32/win32k/w32ksvc.db URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/w3…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/w32ksvc.db [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/w32ksvc.db [iso-8859-1] Tue Jul 8 14:06:37 2008 @@ -689,7 +689,6 @@ NtUserGetProp 2 NtUserGetScrollInfo 3 NtUserGetShellWindow 0 -NtUserGetSystemMetrics 1 NtUserGetWindow 2 NtUserGetWindowLong 3 NtUserGetWindowThreadProcessId 2
16 years, 5 months
1
0
0
0
[jimtabor] 34370: Win32k/User32: - Removed NtUserGetSystemMetric, updated all related. - Add GetConnected, this is needed, sometimes global pointers are initilized with zeros. This is normal. - Fix prototype for NtUserDragDetect, and add the Esc key hit to DragDetect.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Tue Jul 8 13:58:07 2008 New Revision: 34370 URL:
http://svn.reactos.org/svn/reactos?rev=34370&view=rev
Log: Win32k/User32: - Removed NtUserGetSystemMetric, updated all related. - Add GetConnected, this is needed, sometimes global pointers are initilized with zeros. This is normal. - Fix prototype for NtUserDragDetect, and add the Esc key hit to DragDetect. Modified: trunk/reactos/dll/win32/user32/include/user32.h trunk/reactos/dll/win32/user32/misc/desktop.c trunk/reactos/dll/win32/user32/misc/dllmain.c trunk/reactos/dll/win32/user32/windows/input.c trunk/reactos/include/reactos/win32k/ntuser.h trunk/reactos/subsystems/win32/win32k/ntuser/input.c trunk/reactos/subsystems/win32/win32k/ntuser/metric.c Modified: trunk/reactos/dll/win32/user32/include/user32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/include/u…
============================================================================== --- trunk/reactos/dll/win32/user32/include/user32.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/include/user32.h [iso-8859-1] Tue Jul 8 13:58:07 2008 @@ -115,3 +115,4 @@ PWINDOW FASTCALL GetThreadDesktopWnd(VOID); PVOID FASTCALL ValidateHandleNoErr(HANDLE handle, UINT uType); PWINDOW FASTCALL ValidateHwndNoErr(HWND hwnd); +VOID FASTCALL GetConnected(VOID); Modified: trunk/reactos/dll/win32/user32/misc/desktop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/misc/desk…
============================================================================== --- trunk/reactos/dll/win32/user32/misc/desktop.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/misc/desktop.c [iso-8859-1] Tue Jul 8 13:58:07 2008 @@ -99,12 +99,10 @@ int STDCALL GetSystemMetrics(int nIndex) { + GetConnected(); // FIXME("Global Sever Data -> %x\n",g_psi); if (nIndex < 0 || nIndex >= SM_CMETRICS) return 0; - if (g_psi) - return g_psi->SystemMetrics[nIndex]; - else - return(NtUserGetSystemMetrics(nIndex)); + return g_psi->SystemMetrics[nIndex]; } Modified: trunk/reactos/dll/win32/user32/misc/dllmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/misc/dllm…
============================================================================== --- trunk/reactos/dll/win32/user32/misc/dllmain.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/misc/dllmain.c [iso-8859-1] Tue Jul 8 13:58:07 2008 @@ -295,3 +295,25 @@ return TRUE; } + + +VOID +FASTCALL +GetConnected(VOID) +{ + PW32PROCESSINFO pi; + + if ((PW32THREADINFO)NtCurrentTeb()->Win32ThreadInfo == NULL) + NtUserGetThreadState(THREADSTATE_GETTHREADINFO); + + if (g_pi && g_kpi && g_psi) return; + + pi = GetW32ProcessInfo(); + if (!g_pi) g_pi = pi; + if (!g_kpi) g_kpi = SharedPtrToKernel(pi); + if (!g_psi) g_psi = SharedPtrToUser(pi->psi); + if (!g_psi) { WARN("Global Share Information has not been initialized!\n"); } + if (!gHandleTable) gHandleTable = SharedPtrToUser(pi->UserHandleTable); + if (!gHandleEntries) gHandleEntries = SharedPtrToUser(gHandleTable->handles); + +} Modified: trunk/reactos/dll/win32/user32/windows/input.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/i…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/input.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/input.c [iso-8859-1] Tue Jul 8 13:58:07 2008 @@ -50,13 +50,13 @@ POINT pt) { #if 0 - return NtUserDragDetect(hWnd, pt.x, pt.y); + return NtUserDragDetect(hWnd, pt); #else MSG msg; RECT rect; POINT tmp; - ULONG dx = NtUserGetSystemMetrics(SM_CXDRAG); - ULONG dy = NtUserGetSystemMetrics(SM_CYDRAG); + ULONG dx = GetSystemMetrics(SM_CXDRAG); + ULONG dy = GetSystemMetrics(SM_CYDRAG); rect.left = pt.x - dx; rect.right = pt.x + dx; @@ -67,12 +67,15 @@ for (;;) { - while (PeekMessageW(&msg, 0, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE)) + while ( + PeekMessageW(&msg, 0, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE) || + PeekMessageW(&msg, 0, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE) + ) { if (msg.message == WM_LBUTTONUP) { ReleaseCapture(); - return 0; + return FALSE; } if (msg.message == WM_MOUSEMOVE) { @@ -81,8 +84,16 @@ if (!PtInRect(&rect, tmp)) { ReleaseCapture(); - return 1; + return TRUE; } + } + if (msg.message == WM_KEYDOWN) + { + if (msg.wParam == VK_ESCAPE) + { + ReleaseCapture(); + return TRUE; + } } } WaitMessage(); Modified: trunk/reactos/include/reactos/win32k/ntuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntu…
============================================================================== --- trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] Tue Jul 8 13:58:07 2008 @@ -1062,8 +1062,7 @@ NTAPI NtUserDragDetect( HWND hWnd, - LONG x, - LONG y); + POINT pt); DWORD NTAPI @@ -2718,10 +2717,6 @@ NTAPI NtUserGetShellWindow(); -ULONG -NTAPI -NtUserGetSystemMetrics(ULONG Index); - HWND NTAPI NtUserGetWindow(HWND hWnd, UINT Relationship); Modified: trunk/reactos/subsystems/win32/win32k/ntuser/input.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/input.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/input.c [iso-8859-1] Tue Jul 8 13:58:07 2008 @@ -885,8 +885,7 @@ STDCALL NtUserDragDetect( HWND hWnd, - LONG x, - LONG y) + POINT pt) // Just like the User call. { UNIMPLEMENTED return 0; Modified: trunk/reactos/subsystems/win32/win32k/ntuser/metric.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/metric.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/metric.c [iso-8859-1] Tue Jul 8 13:58:07 2008 @@ -467,21 +467,5 @@ } } -ULONG STDCALL -NtUserGetSystemMetrics(ULONG Index) -{ - DECLARE_RETURN(ULONG); - - DPRINT("Enter NtUserGetSystemMetrics\n"); - UserEnterShared(); - - RETURN(UserGetSystemMetrics(Index)); - -CLEANUP: - DPRINT("Leave NtUserGetSystemMetrics, ret=%i\n",_ret_); - UserLeave(); - END_CLEANUP; -} - /* EOF */
16 years, 5 months
1
0
0
0
← Newer
1
...
59
60
61
62
63
64
65
...
77
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Results per page:
10
25
50
100
200