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
August 2006
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
19 participants
447 discussions
Start a n
N
ew thread
[ion] 23830: - Write new, optimized, small, working and clean functions (fixes booting, last few commits broke it for me): - RtlCompareMemory - RtlCompareMemoryUlong - RtlFillMemory - RtlFillMemoryUlong - RtlFillMemoryUlongUlong - RtlMoveMemory - RtlZeroMemory - RtlPrefetchMemoryNonTemporal - RtlUshortByteSwap - RtlUlongByteSwap - RtlUlonglongByteSwap
by ion@svn.reactos.org
Author: ion Date: Thu Aug 31 05:20:55 2006 New Revision: 23830 URL:
http://svn.reactos.org/svn/reactos?rev=23830&view=rev
Log: - Write new, optimized, small, working and clean functions (fixes booting, last few commits broke it for me): - RtlCompareMemory - RtlCompareMemoryUlong - RtlFillMemory - RtlFillMemoryUlong - RtlFillMemoryUlongUlong - RtlMoveMemory - RtlZeroMemory - RtlPrefetchMemoryNonTemporal - RtlUshortByteSwap - RtlUlongByteSwap - RtlUlonglongByteSwap Added: trunk/reactos/lib/rtl/i386/rtlmem.s trunk/reactos/lib/rtl/i386/rtlswap.S Removed: trunk/reactos/lib/rtl/i386/comparememory_asm.s trunk/reactos/lib/rtl/i386/comparememory_ulong_asm.s trunk/reactos/lib/rtl/i386/fillmemory_asm.s trunk/reactos/lib/rtl/i386/fillmemory_ulong_asm.s trunk/reactos/lib/rtl/i386/memgeni386.c trunk/reactos/lib/rtl/i386/prefetchmemory_asm.s trunk/reactos/lib/rtl/i386/rtlulongbyteswap.s trunk/reactos/lib/rtl/i386/rtlulonglongbyteswap.s trunk/reactos/lib/rtl/i386/rtlushortbyteswap.s trunk/reactos/lib/rtl/mem.c trunk/reactos/lib/rtl/memgen.c Modified: trunk/reactos/lib/rtl/rtl.rbuild Removed: trunk/reactos/lib/rtl/i386/comparememory_asm.s URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/i386/comparememory…
============================================================================== --- trunk/reactos/lib/rtl/i386/comparememory_asm.s (original) +++ trunk/reactos/lib/rtl/i386/comparememory_asm.s (removed) @@ -1,44 +1,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: comparememory_asm.S - * PURPOSE: Memory functions - * PROGRAMMERS: Patrick Baggett (baggett.patrick(a)gmail.com) - * Alex Ionescu (alex(a)relsoft.net) - * Magnus Olsen (magnusolsen(a)greatlord.com) - */ - -.intel_syntax noprefix - -/* GLOBALS ****************************************************************/ - -.globl _RtlCompareMemory@12 // [4] (no bug) - -/* FUNCTIONS ***************************************************************/ - -_RtlCompareMemory@12: - xor eax,eax // count = 0 - mov ecx, dword [esp + 12 ] // ecx = Length - cmp ecx,0 // if (Length==0) goto .zero - je 3f - - push edi// register that does not to be save eax,ecx,edx to - push ebx// the stack for protetion - - mov edi, dword [esp + (4 + 8)] // edi = Destination - mov edx, dword [esp + (8 + 8)] // edx = Source - -1: - mov bl,byte [edi + eax ] // if (src[count]!=des[count]) goto .pop_zero - cmp byte [edx + eax ],bl - jne 2f - - inc eax // count = count + 1 - dec ecx // Length = Length - 1 - jnz 1b // if (Length!=0) goto .loop_1byte - -2: - pop ebx // restore regiester - pop edi -3: - ret 12 // return count Removed: trunk/reactos/lib/rtl/i386/comparememory_ulong_asm.s URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/i386/comparememory…
============================================================================== --- trunk/reactos/lib/rtl/i386/comparememory_ulong_asm.s (original) +++ trunk/reactos/lib/rtl/i386/comparememory_ulong_asm.s (removed) @@ -1,44 +1,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: comparememory_ulong_asm.S - * PURPOSE: Memory functions - * PROGRAMMERS: Patrick Baggett (baggett.patrick(a)gmail.com) - * Alex Ionescu (alex(a)relsoft.net) - * Magnus Olsen (magnusolsen(a)greatlord.com) - */ - -.intel_syntax noprefix - -/* GLOBALS ****************************************************************/ - -.globl _RtlCompareMemoryUlong@12 // [5] (no bug) - -/* FUNCTIONS ***************************************************************/ - -_RtlCompareMemoryUlong@12: - xor eax,eax - mov ecx, dword [esp + 8 ] // ecx = Length - shr ecx,2 // Length / sizeof(ULONG) - jz 1f // if (Length==0) goto .zero - - push edi// register that does not to be save eax,ecx,edx to - push ebx// the stack for protetion - - mov edi, dword [esp + (4 + 8)] // edx = Destination - mov eax, dword [esp + (12 + 8)] // ebx = value - mov ebx,ecx - cld - repe scasd - - inc ecx - mov eax,ebx - - sub eax,ecx - shl eax,2 - - pop ebx - pop edi - -1: - ret 12 Removed: trunk/reactos/lib/rtl/i386/fillmemory_asm.s URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/i386/fillmemory_as…
============================================================================== --- trunk/reactos/lib/rtl/i386/fillmemory_asm.s (original) +++ trunk/reactos/lib/rtl/i386/fillmemory_asm.s (removed) @@ -1,31 +1,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: fillmemory_asm.S - * PURPOSE: Memory functions - * PROGRAMMERS: Patrick Baggett (baggett.patrick(a)gmail.com) - * Alex Ionescu (alex(a)relsoft.net) - * Magnus Olsen (magnusolsen(a)greatlord.com) - */ - -.intel_syntax noprefix - -/* GLOBALS ****************************************************************/ - -.globl _RtlFillMemory@12 //[4] (no bug) - -/* FUNCTIONS ***************************************************************/ - -_RtlFillMemory@12: - mov ecx,dword [esp + 8 ] // ecx = Length - cmp ecx,0// if (Length==0) goto .zero - je 2f - - mov edx, dword [esp + 4] // edx = Destination - mov eax, dword [esp + 12] // eax = fill -1: - mov byte [edx + ecx -1],al // src[Length - 1] = fill - dec ecx // Length = Length - 1 - jnz 1b // if (Length!=0) goto .loop -2: - ret 12 // return Removed: trunk/reactos/lib/rtl/i386/fillmemory_ulong_asm.s URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/i386/fillmemory_ul…
============================================================================== --- trunk/reactos/lib/rtl/i386/fillmemory_ulong_asm.s (original) +++ trunk/reactos/lib/rtl/i386/fillmemory_ulong_asm.s (removed) @@ -1,31 +1,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: fillmemory_ulong_asm.S - * PURPOSE: Memory functions - * PROGRAMMERS: Patrick Baggett (baggett.patrick(a)gmail.com) - * Alex Ionescu (alex(a)relsoft.net) - * Magnus Olsen (magnusolsen(a)greatlord.com) - */ - -.intel_syntax noprefix - -/* GLOBALS ****************************************************************/ - -.globl _RtlFillMemoryUlong@12 // (no bug) (max optimze code) - -/* FUNCTIONS ***************************************************************/ - -_RtlFillMemoryUlong@12: - mov ecx, dword [esp + 8 ] // Length - shr ecx,2// Length = Length / sizeof(ULONG) - jz 1f // if (Length==0) goto .zero - - push edi - mov edi, dword [esp + (4 + 4)] // Destination - mov eax, dword [esp + (12 + 4)] // Fill - cld - rep stosd// while (Length>0) {Destination[Length-1]=Fill// Length = Length - 1} - pop edi -1: - ret 12 Removed: trunk/reactos/lib/rtl/i386/memgeni386.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/i386/memgeni386.c?…
============================================================================== --- trunk/reactos/lib/rtl/i386/memgeni386.c (original) +++ trunk/reactos/lib/rtl/i386/memgeni386.c (removed) @@ -1,75 +1,0 @@ -/* COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS system libraries - * FILE: lib/rtl/mem.c - * PURPOSE: Memory functions - * PROGRAMMER: David Welch (welch(a)mcmail.com) - */ - -/* INCLUDES *****************************************************************/ - -#include <rtl.h> - -#define NDEBUG -#include <debug.h> - -#undef RtlUlonglongByteSwap -#undef RtlUlongByteSwap -#undef RtlUshortByteSwap - -USHORT UshortByteSwap (IN USHORT Source); -ULONG UlongByteSwap (IN ULONG Source); -ULONGLONG UlonglongByteSwap (IN ULONGLONG Source); - -/************************************************************************* - * RtlUshortByteSwap - * - * Swap the bytes of an unsigned short value. - * - * - * @implemented - */ -USHORT FASTCALL -RtlUshortByteSwap (IN USHORT Source) -{ - return UshortByteSwap (Source); -} - - - -/************************************************************************* - * RtlUlongByteSwap [NTDLL.@] - * - * Swap the bytes of an unsigned int value. - * - * - * @implemented - */ -ULONG -FASTCALL -RtlUlongByteSwap( - IN ULONG Source -) -{ - return UlongByteSwap(Source); -} - - -/************************************************************************* - * RtlUlonglongByteSwap - * - * Swap the bytes of an unsigned long long value. - * - * PARAMS - * i [I] Value to swap bytes of - * - * - * @implemented - */ -ULONGLONG FASTCALL -RtlUlonglongByteSwap (IN ULONGLONG Source) -{ - return UlonglongByteSwap(Source); -} - - -/* EOF */ Removed: trunk/reactos/lib/rtl/i386/prefetchmemory_asm.s URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/i386/prefetchmemor…
============================================================================== --- trunk/reactos/lib/rtl/i386/prefetchmemory_asm.s (original) +++ trunk/reactos/lib/rtl/i386/prefetchmemory_asm.s (removed) @@ -1,30 +1,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: prefetchmemory_asm.S - * PURPOSE: Memory functions - * PROGRAMMERS: Patrick Baggett (baggett.patrick(a)gmail.com) - * Alex Ionescu (alex(a)relsoft.net) - * Magnus Olsen (magnusolsen(a)greatlord.com) - */ - -.intel_syntax noprefix - -/* GLOBALS ****************************************************************/ - -.globl @RtlPrefetchMemoryNonTemporal@8 - -/* FUNCTIONS ***************************************************************/ - -@RtlPrefetchMemoryNonTemporal@8: - ret /* Overwritten by ntoskrnl/ke/i386/kernel.c if SSE is supported (see Ki386SetProcessorFeatures() ) */ - - mov eax, [_Ke386CacheAlignment] // Get cache line size - - // This is fastcall, so ecx = address, edx = size -fetch_next_line: - prefetchnta byte ptr [ecx] // prefechnta(address) - add ecx, eax // address = address + cache_line_size - sub edx, eax // count = count - cache_line_size - ja fetch_next_line // goto fetch_next_line - ret Added: trunk/reactos/lib/rtl/i386/rtlmem.s URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/i386/rtlmem.s?rev=…
============================================================================== --- trunk/reactos/lib/rtl/i386/rtlmem.s (added) +++ trunk/reactos/lib/rtl/i386/rtlmem.s Thu Aug 31 05:20:55 2006 @@ -1,0 +1,312 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Run-Time Library + * PURPOSE: Memory functions + * FILE: lib/rtl/i386/rtlswap.S + * PROGRAMER: Alex Ionescu (alex.ionescu(a)reactos.org) + */ + +.intel_syntax noprefix + +/* GLOBALS *******************************************************************/ + +.globl _RtlCompareMemory@12 +.globl _RtlCompareMemoryUlong@12 +.globl _RtlFillMemory@12 +.globl _RtlFillMemoryUlong@12 +.globl _RtlMoveMemory@12 +.globl _RtlZeroMemory@8 +.globl @RtlPrefetchMemoryNonTemporal@8 + +/* FUNCTIONS *****************************************************************/ + +.func RtlCompareMemory@12 +_RtlCompareMemory@12: + + /* Save volatiles */ + push esi + push edi + + /* Clear direction flag and load pointers and size in ULONGs */ + cld + mov esi, [esp+12] + mov edi, [esp+16] + mov ecx, [esp+20] + shr ecx, 2 + jz NoUlongs + + /* Compare the ULONGs */ + repe cmpsd + jnz NotEqual + +NoUlongs: + + /* Compare what's left */ + mov ecx, [esp+20] + and ecx, 3 + jz NoneLeft + repe cmpsb + jnz NotEqual2 + +NoneLeft: + + /* We're done, return full count */ + mov eax, [esp+20] + pop edi + pop esi + ret 12 + +NotEqual: + /* Compare the last ULONG */ + sub esi, 4 + sub edi, 4 + mov ecx, 5 + repe cmpsb + +NotEqual2: + + /* Remember how many mathced */ + dec esi + sub esi, [esp+20] + + /* Return count */ + mov eax, esi + pop edi + pop esi + ret 12 +.endfunc + +.func RtlCompareMemoryUlong@12 +_RtlCompareMemoryUlong@12: + + /* Get pointers and size in ULONGs */ + push edi + mov edi, [esp+8] + mov ecx, [esp+12] + mov eax, [esp+16] + shr ecx, 2 + + /* Do the compare and check result */ + repe scasd + jz Done + sub esi, 4 + + /* Return count */ +Done: + sub edi, [esp+8] + mov eax, edi + pop edi + ret 12 +.endfunc + +.func RtlFillMemory@12 +_RtlFillMemory@12: + + /* Get pointers and size */ + push edi + mov edi, [esp+8] + mov ecx, [esp+12] + + /* Get pattern */ + mov al, [esp+16] + mov ah, al + shr eax, 16 + mov al, [esp+16] + mov ah, al + + /* Clear direction flag and set ULONG size and UCHAR remainder */ + cld + mov edx, ecx + and edx, 3 + shr ecx, 2 + + /* Do the fill */ + rep stosd + or ecx, ecx + jnz ByteFill + + /* Return */ + pop edi + ret 12 + +ByteFill: + /* Fill what's left */ + rep stosb + pop edi + ret 12 +.endfunc + +.func RtlFillMemoryUlong@12 +_RtlFillMemoryUlong@12: + + /* Get pointer, size and pattern */ + push edi + mov edi, [esp+8] + mov ecx, [esp+12] + mov eax, [esp+16] + shr ecx, 2 + + /* Do the fill and return */ + rep stosd + pop edi + ret 12 +.endfunc + +.func RtlFillMemoryUlonglong@16 +_RtlFillMemoryUlonglong@16: + + /* Save volatiles */ + push edi + push esi + + /* Get pointer, size and pattern */ + mov ecx, [esp+16] + mov esi, [esp+12] + mov eax, [esp+20] + shr ecx, 2 + sub ecx, 2 + + /* Save the first part */ + mov [esi], eax + + /* Read second part */ + mov eax, [esp+24] + lea edi, [esi+8] + mov [esi+4], eax + + /* Do the fill and return */ + rep movsd + pop esi + pop edi + ret 16 +.endfunc + +.func RtlZeroMemory@8 +_RtlZeroMemory@8: + + /* Get pointers and size */ + push edi + mov edi, [esp+8] + mov ecx, [esp+12] + + /* Get pattern */ + xor eax, eax + + /* Clear direction flag and set ULONG size and UCHAR remainder */ + cld + mov edx, ecx + and edx, 3 + shr ecx, 2 + + /* Do the fill */ + rep stosd + or ecx, ecx + jnz ByteZero + + /* Return */ + pop edi + ret 8 + +ByteZero: + /* Fill what's left */ + rep stosb + pop edi + ret 8 +.endfunc + +.func RtlMoveMemory@12 +_RtlMoveMemory@12: + + /* Save volatiles */ + push esi + push edi + + /* Get pointers and size */ + mov esi, [esp+16] + mov edi, [esp+12] + mov ecx, [esp+20] + cld + + /* Check for overlap */ + cmp esi, edi + jbe Overlap + + /* Set ULONG size and UCHAR remainder */ +DoMove: + mov edx, ecx + and edx, 3 + shr ecx, 2 + + /* Do the move */ + rep movsd + or ecx, ecx + jnz ByteMove + + /* Return */ + pop edi + pop esi + ret 12 + +ByteMove: + /* Move what's left */ + rep stosb + +DoneMove: + pop edi + pop esi + ret 12 + +Overlap: + /* Avoid full overlap */ + jz DoneMove + + /* Remove overlap */ + mov eax, edi + sub eax, esi + cmp ecx, eax + jbe DoMove + + /* Set direction flag for backward move */ + std + + /* Can only move some bytes, calculate how many */ + add esi, ecx + add edi, ecx + dec esi + dec edi + + /* Do the move, reset flag and return */ + rep movsb + cld + jmp DoneMove +.endfunc + +.func @RtlPrefetchMemoryNonTemporal@8, @RtlPrefetchMemoryNonTemporal@8 +@RtlPrefetchMemoryNonTemporal@8: + + /* + * Overwritten by ntoskrnl/ke/i386/kernel.c if SSE is supported + * (see Ki386SetProcessorFeatures()) + */ + ret + + /* Get granularity */ + mov eax, [_Ke386CacheAlignment] + +FetchLine: + + /* Prefetch this line */ + prefetchnta byte ptr [ecx] + + /* Update address and count */ + add ecx, eax + sub edx, eax + + /* Keep looping for the next line, or return if done */ + ja FetchLine + ret +.endfunc + +/* FIXME: HACK */ +_Ke386CacheAlignment: + .long 0x40 Added: trunk/reactos/lib/rtl/i386/rtlswap.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/i386/rtlswap.S?rev…
============================================================================== --- trunk/reactos/lib/rtl/i386/rtlswap.S (added) +++ trunk/reactos/lib/rtl/i386/rtlswap.S Thu Aug 31 05:20:55 2006 @@ -1,0 +1,53 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Run-Time Library + * PURPOSE: Byte swap functions + * FILE: lib/rtl/i386/rtlswap.S + * PROGRAMER: Alex Ionescu (alex.ionescu(a)reactos.org) + */ + +.intel_syntax noprefix + +.globl @RtlUshortByteSwap@4 +.globl @RtlUlongByteSwap@4 +.globl @RtlUlonglongByteSwap@8 + +/* FUNCTIONS ***************************************************************/ + +.func @RtlUshortByteSwap@4, @RtlUshortByteSwap@4 +@RtlUshortByteSwap@4: + + /* Swap high and low bits */ + mov ah, cl + mov al, ch + ret +.endfunc + +.func @RtlUlongByteSwap@4, @RtlUlongByteSwap@4 +@RtlUlongByteSwap@4: + + /* Swap high and low bits */ + mov eax, ecx + bswap eax + ret +.endfunc + +.func @RtlUlonglongByteSwap@8, @RtlUlonglongByteSwap@8 +@RtlUlonglongByteSwap@8: + + /* Get 64-bit integer */ + mov edx, [esp+8] + mov eax, [esp+4] + + /* Swap it */ + bswap edx + bswap eax + + /* Return it */ + mov ecx, eax + mov eax, edx + mov edx, ecx + ret +.endfunc + + Removed: trunk/reactos/lib/rtl/i386/rtlulongbyteswap.s URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/i386/rtlulongbytes…
============================================================================== --- trunk/reactos/lib/rtl/i386/rtlulongbyteswap.s (original) +++ trunk/reactos/lib/rtl/i386/rtlulongbyteswap.s (removed) @@ -1,21 +1,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: Run-Time Library - * FILE: lib/rtl/i386/RtlUlongByteSwap.S - * PROGRAMER: Magnus Olsen (magnus(a)greatlord.com) - */ - -.globl _UlongByteSwap - -.intel_syntax noprefix - -/* FUNCTIONS ***************************************************************/ - -_UlongByteSwap: - push ebp // save base - mov ebp,esp // move stack to base - mov eax,[ebp+8] // load the ULONG - bswap eax // swap the ULONG - pop ebp // restore the base - ret Removed: trunk/reactos/lib/rtl/i386/rtlulonglongbyteswap.s URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/i386/rtlulonglongb…
============================================================================== --- trunk/reactos/lib/rtl/i386/rtlulonglongbyteswap.s (original) +++ trunk/reactos/lib/rtl/i386/rtlulonglongbyteswap.s (removed) @@ -1,23 +1,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: Run-Time Library - * FILE: lib/rtl/i386/RtlUlonglongByteSwap.S - * PROGRAMER: Magnus Olsen (magnus(a)greatlord.com) - */ - -.globl _UlonglongByteSwap - -.intel_syntax noprefix - -/* FUNCTIONS ***************************************************************/ - -_UlonglongByteSwap: - push ebp // save base - mov ebp,esp // move stack to base - mov edx,[ebp+8] // load the higher part of ULONGLONG - mov eax,[ebp+12] // load the lower part of ULONGLONG - bswap edx // swap the higher part - bswap eax // swap the lower part - pop ebp // restore the base - ret Removed: trunk/reactos/lib/rtl/i386/rtlushortbyteswap.s URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/i386/rtlushortbyte…
============================================================================== --- trunk/reactos/lib/rtl/i386/rtlushortbyteswap.s (original) +++ trunk/reactos/lib/rtl/i386/rtlushortbyteswap.s (removed) @@ -1,22 +1,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: Run-Time Library - * FILE: lib/rtl/i386/RtlUlongByteSwap.S - * PROGRAMER: Magnus Olsen (magnus(a)greatlord.com) - */ - -.globl _UshortByteSwap - -.intel_syntax noprefix - -/* FUNCTIONS ***************************************************************/ - -_UshortByteSwap: - push ebp // save base - mov ebp,esp // move stack to base - mov eax,[ebp+8] // load the USHORT - bswap eax // swap the USHORT, xchg is slow so we use bswap with rol - rol eax,16 // make it USHORT - pop ebp // restore the base - ret Removed: trunk/reactos/lib/rtl/mem.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/mem.c?rev=23829&vi…
============================================================================== --- trunk/reactos/lib/rtl/mem.c (original) +++ trunk/reactos/lib/rtl/mem.c (removed) @@ -1,173 +1,0 @@ -/* COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS system libraries - * FILE: lib/rtl/mem.c - * PURPOSE: Memory functions - * PROGRAMMER: David Welch (welch(a)mcmail.com) - */ - -/* INCLUDES *****************************************************************/ - -#include <rtl.h> - -#define NDEBUG -#include <debug.h> - - -/* FUNCTIONS *****************************************************************/ - -/****************************************************************************** - * RtlCompareMemory [NTDLL.@] - * - * Compare one block of memory with another - * - * PARAMS - * Source1 [I] Source block - * Source2 [I] Block to compare to Source1 - * Length [I] Number of bytes to fill - * - * RETURNS - * The length of the first byte at which Source1 and Source2 differ, or Length - * if they are the same. - * - * @implemented - */ -SIZE_T NTAPI -RtlCompareMemory(IN const VOID *Source1, - IN const VOID *Source2, - IN SIZE_T Length) -{ - SIZE_T i; - for(i=0; (i<Length) && (((PUCHAR)Source1)[i]==((PUCHAR)Source2)[i]); i++) - ; - return i; -} - - -/* - * @implemented - */ -ULONG -NTAPI -RtlCompareMemoryUlong ( - PVOID Source, - ULONG Length, - ULONG Value -) -/* - * FUNCTION: Compares a block of ULONGs with an ULONG and returns the number of equal bytes - * ARGUMENTS: - * Source = Block to compare - * Length = Number of bytes to compare - * Value = Value to compare - * RETURNS: Number of equal bytes - */ -{ - PULONG ptr = (PULONG)Source; - ULONG len = Length / sizeof(ULONG); - ULONG i; - - for (i = 0; i < len; i++) - { - if (*ptr != Value) - break; - ptr++; - } - - return (ULONG)((PCHAR)ptr - (PCHAR)Source); -} - - -#undef RtlFillMemory -/* - * @implemented - */ -VOID -NTAPI -RtlFillMemory ( - PVOID Destination, - ULONG Length, - UCHAR Fill -) -{ - memset(Destination, Fill, Length); -} - - - -/* - * @implemented - */ -VOID -NTAPI -RtlFillMemoryUlong ( - PVOID Destination, - ULONG Length, - ULONG Fill -) -{ - PULONG Dest = Destination; - ULONG Count = Length / sizeof(ULONG); - - while (Count > 0) - { - *Dest = Fill; - Dest++; - Count--; - } -} - - -#undef RtlMoveMemory -/* - * @implemented - */ -VOID -NTAPI -RtlMoveMemory ( - PVOID Destination, - CONST VOID * Source, - ULONG Length -) -{ - memmove ( - Destination, - Source, - Length - ); -} - -/* -* @implemented -*/ -VOID -FASTCALL -RtlPrefetchMemoryNonTemporal( - IN PVOID Source, - IN SIZE_T Length - ) -{ - /* By nature of prefetch, this is non-portable. */ - (void)Source; - (void)Length; -} - - -#undef RtlZeroMemory -/* - * @implemented - */ -VOID -NTAPI -RtlZeroMemory ( - PVOID Destination, - ULONG Length -) -{ - RtlFillMemory ( - Destination, - Length, - 0 - ); -} - -/* EOF */ Removed: trunk/reactos/lib/rtl/memgen.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/memgen.c?rev=23829…
============================================================================== --- trunk/reactos/lib/rtl/memgen.c (original) +++ trunk/reactos/lib/rtl/memgen.c (removed) @@ -1,77 +1,0 @@ -/* COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS system libraries - * FILE: lib/rtl/mem.c - * PURPOSE: Memory functions - * PROGRAMMER: David Welch (welch(a)mcmail.com) - */ - -/* INCLUDES *****************************************************************/ - -#include <rtl.h> - -#define NDEBUG -#include <debug.h> - -#undef RtlUlonglongByteSwap -#undef RtlUlongByteSwap -#undef RtlUshortByteSwap - -/************************************************************************* - * RtlUshortByteSwap - * - * Swap the bytes of an unsigned short value. - * - * NOTES - * Based on the inline versions in Wine winternl.h - * - * @implemented - */ -USHORT FASTCALL -RtlUshortByteSwap (IN USHORT Source) -{ - return (Source >> 8) | (Source << 8); -} - - - -/************************************************************************* - * RtlUlongByteSwap [NTDLL.@] - * - * Swap the bytes of an unsigned int value. - * - * NOTES - * Based on the inline versions in Wine winternl.h - * - * @implemented - */ -ULONG -FASTCALL -RtlUlongByteSwap( - IN ULONG Source -) -{ - return ((ULONG)RtlUshortByteSwap((USHORT)Source) << 16) | RtlUshortByteSwap((USHORT)(Source >> 16)); -} - - -/************************************************************************* - * RtlUlonglongByteSwap - * - * Swap the bytes of an unsigned long long value. - * - * PARAMS - * i [I] Value to swap bytes of - * - * RETURNS - * The value with its bytes swapped. - * - * @implemented - */ -ULONGLONG FASTCALL -RtlUlonglongByteSwap (IN ULONGLONG Source) -{ - return ((ULONGLONG) RtlUlongByteSwap (Source) << 32) | RtlUlongByteSwap (Source>>32); -} - - -/* EOF */ Modified: trunk/reactos/lib/rtl/rtl.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/rtl.rbuild?rev=238…
============================================================================== --- trunk/reactos/lib/rtl/rtl.rbuild (original) +++ trunk/reactos/lib/rtl/rtl.rbuild Thu Aug 31 05:20:55 2006 @@ -22,37 +22,24 @@ <file>aullshr_asm.s</file> <file>ceil_asm.s</file> <file>chkstk_asm.s</file> - <file>comparememory_asm.s</file> - <file>comparememory_ulong_asm.s</file> <file>cos_asm.s</file> <file>debug_asm.S</file> <file>except_asm.s</file> <file>exception.c</file> <file>fabs_asm.s</file> - <file>fillmemory_asm.s</file> - <file>fillmemory_ulong_asm.s</file> <file>floor_asm.s</file> <file>ftol_asm.s</file> <file>log_asm.s</file> <file>random_asm.S</file> - <file>memgeni386.c</file> - <file>rtlushortbyteswap.s</file> - <file>rtlulongbyteswap.s</file> - <file>rtlulonglongbyteswap.s</file> + <file>rtlswap.S</file> + <file>rtlmem.S</file> <file>pow_asm.s</file> - <file>prefetchmemory_asm.s</file> <file>res_asm.s</file> <file>sin_asm.s</file> <file>sqrt_asm.s</file> <file>tan_asm.s</file> - <file>zeromemory_asm.s</file> </directory> </if> - - <ifnot property="ARCH" value="i386"> - <file>memgen.c</file> - </ifnot> - <file>access.c</file> <file>acl.c</file> <file>atom.c</file> @@ -73,7 +60,6 @@ <file>handle.c</file> <file>heap.c</file> <file>image.c</file> - <file>mem.c</file> <file>message.c</file> <file>largeint.c</file> <file>luid.c</file>
18 years, 3 months
1
0
0
0
[weiden] 23829: Fix difference in signedness warnings
by weiden@svn.reactos.org
Author: weiden Date: Thu Aug 31 01:47:38 2006 New Revision: 23829 URL:
http://svn.reactos.org/svn/reactos?rev=23829&view=rev
Log: Fix difference in signedness warnings Modified: trunk/reactos/ntoskrnl/ke/bug.c trunk/reactos/ntoskrnl/vdm/vdmexec.c Modified: trunk/reactos/ntoskrnl/ke/bug.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/bug.c?rev=2382…
============================================================================== --- trunk/reactos/ntoskrnl/ke/bug.c (original) +++ trunk/reactos/ntoskrnl/ke/bug.c Thu Aug 31 01:47:38 2006 @@ -543,7 +543,7 @@ /* Save the IRQL and set hardware trigger */ Prcb->DebuggerSavedIRQL = KeGetCurrentIrql(); - InterlockedIncrement(&KiHardwareTrigger); + InterlockedIncrement((PLONG)&KiHardwareTrigger); /* Capture the CPU Context */ RtlCaptureContext(&Prcb->ProcessorState.ContextFrame); @@ -857,7 +857,7 @@ } /* Avoid recursion */ - if (!InterlockedDecrement(&KeBugCheckCount)) + if (!InterlockedDecrement((PLONG)&KeBugCheckCount)) { /* Set CPU that is bug checking now */ KeBugCheckOwner = Prcb->Number; Modified: trunk/reactos/ntoskrnl/vdm/vdmexec.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/vdm/vdmexec.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/vdm/vdmexec.c (original) +++ trunk/reactos/ntoskrnl/vdm/vdmexec.c Thu Aug 31 01:47:38 2006 @@ -212,12 +212,12 @@ if (VdmTib->VdmContext.EFlags & EFLAGS_INTERRUPT_MASK) { /* Enable them as well */ - InterlockedOr(VdmState, EFLAGS_INTERRUPT_MASK); + InterlockedOr((PLONG)VdmState, EFLAGS_INTERRUPT_MASK); } else { /* Disable them */ - InterlockedAnd(VdmState, ~EFLAGS_INTERRUPT_MASK); + InterlockedAnd((PLONG)VdmState, ~EFLAGS_INTERRUPT_MASK); } /* Enable the interrupt flag */
18 years, 3 months
1
0
0
0
[weiden] 23828: Use the new ProbeForWriteIoStatusBlock macro
by weiden@svn.reactos.org
Author: weiden Date: Thu Aug 31 01:45:17 2006 New Revision: 23828 URL:
http://svn.reactos.org/svn/reactos?rev=23828&view=rev
Log: Use the new ProbeForWriteIoStatusBlock macro Modified: trunk/reactos/ntoskrnl/io/iomgr/file.c trunk/reactos/ntoskrnl/io/iomgr/iocomp.c trunk/reactos/ntoskrnl/io/iomgr/iofunc.c Modified: trunk/reactos/ntoskrnl/io/iomgr/file.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/file.c?r…
============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/file.c (original) +++ trunk/reactos/ntoskrnl/io/iomgr/file.c Thu Aug 31 01:45:17 2006 @@ -1271,9 +1271,7 @@ _SEH_TRY { ProbeForWriteHandle(FileHandle); - ProbeForWrite(IoStatusBlock, - sizeof(IO_STATUS_BLOCK), - sizeof(ULONG)); + ProbeForWriteIoStatusBlock(IoStatusBlock); if (AllocationSize) { SafeAllocationSize = ProbeForReadLargeInteger(AllocationSize); @@ -2150,9 +2148,7 @@ _SEH_TRY { /* Probe the I/O Status Block */ - ProbeForWrite(IoStatusBlock, - sizeof(IO_STATUS_BLOCK), - sizeof(ULONG)); + ProbeForWriteIoStatusBlock(IoStatusBlock); } _SEH_HANDLE { Modified: trunk/reactos/ntoskrnl/io/iomgr/iocomp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/iocomp.c…
============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/iocomp.c (original) +++ trunk/reactos/ntoskrnl/io/iomgr/iocomp.c Thu Aug 31 01:45:17 2006 @@ -429,9 +429,7 @@ ProbeForWritePointer(ApcContext); /* Probe the I/O Status Block */ - ProbeForWrite(IoStatusBlock, - sizeof(IO_STATUS_BLOCK), - sizeof(ULONG)); + ProbeForWriteIoStatusBlock(IoStatusBlock); if (Timeout) { /* Probe and capture the timeout */ Modified: trunk/reactos/ntoskrnl/io/iomgr/iofunc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/iofunc.c…
============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/iofunc.c (original) +++ trunk/reactos/ntoskrnl/io/iomgr/iofunc.c Thu Aug 31 01:45:17 2006 @@ -218,9 +218,7 @@ _SEH_TRY { /* Probe the status block */ - ProbeForWrite(IoStatusBlock, - sizeof(IO_STATUS_BLOCK), - sizeof(ULONG)); + ProbeForWriteIoStatusBlock(IoStatusBlock); /* Check if this is buffered I/O */ if (AccessType == METHOD_BUFFERED) @@ -826,9 +824,7 @@ _SEH_TRY { /* Probe the I/O Status block */ - ProbeForWrite(IoStatusBlock, - sizeof(IO_STATUS_BLOCK), - sizeof(ULONG)); + ProbeForWriteIoStatusBlock(IoStatusBlock); } _SEH_HANDLE { @@ -960,9 +956,7 @@ _SEH_TRY { /* Probe the I/O STatus block */ - ProbeForWrite(IoStatusBlock, - sizeof(IO_STATUS_BLOCK), - sizeof(ULONG)); + ProbeForWriteIoStatusBlock(IoStatusBlock); /* Probe the buffer */ if (BufferSize) ProbeForWrite(Buffer, BufferSize, sizeof(ULONG)); @@ -1104,9 +1098,7 @@ _SEH_TRY { /* Probe the I/O STatus block */ - ProbeForWrite(IoStatusBlock, - sizeof(IO_STATUS_BLOCK), - sizeof(ULONG)); + ProbeForWriteIoStatusBlock(IoStatusBlock); /* Probe and capture the large integers */ CapturedByteOffset = ProbeForReadLargeInteger(ByteOffset); @@ -1263,9 +1255,7 @@ _SEH_TRY { /* Probe the I/O Status Block */ - ProbeForWrite(IoStatusBlock, - sizeof(IO_STATUS_BLOCK), - sizeof(ULONG)); + ProbeForWriteIoStatusBlock(IoStatusBlock); /* Probe the file information */ ProbeForWrite(FileInformation, Length, sizeof(ULONG)); @@ -1502,9 +1492,7 @@ _SEH_TRY { /* Probe the I/O Status block */ - ProbeForWrite(IoStatusBlock, - sizeof(IO_STATUS_BLOCK), - sizeof(ULONG)); + ProbeForWriteIoStatusBlock(IoStatusBlock); /* Probe the information */ if (Length) ProbeForWrite(FileInformation, Length, 1); @@ -1783,9 +1771,7 @@ _SEH_TRY { /* Probe the status block */ - ProbeForWrite(IoStatusBlock, - sizeof(IO_STATUS_BLOCK), - sizeof(ULONG)); + ProbeForWriteIoStatusBlock(IoStatusBlock); /* Probe the read buffer */ ProbeForWrite(Buffer, Length, 1); @@ -2046,9 +2032,7 @@ _SEH_TRY { /* Probe the I/O Status block */ - ProbeForWrite(IoStatusBlock, - sizeof(IO_STATUS_BLOCK), - sizeof(ULONG)); + ProbeForWriteIoStatusBlock(IoStatusBlock); /* Probe the information */ if (Length) ProbeForRead(FileInformation, Length, 1); @@ -2407,9 +2391,7 @@ _SEH_TRY { /* Probe the I/O Status block */ - ProbeForWrite(IoStatusBlock, - sizeof(IO_STATUS_BLOCK), - sizeof(ULONG)); + ProbeForWriteIoStatusBlock(IoStatusBlock); /* Probe and capture the large integers */ CapturedByteOffset = ProbeForReadLargeInteger(ByteOffset); @@ -2597,9 +2579,7 @@ } /* Probe the status block */ - ProbeForWrite(IoStatusBlock, - sizeof(IO_STATUS_BLOCK), - sizeof(ULONG)); + ProbeForWriteIoStatusBlock(IoStatusBlock); /* Probe the read buffer */ ProbeForRead(Buffer, Length, 1); @@ -2839,9 +2819,7 @@ _SEH_TRY { /* Probe the I/O Status block */ - ProbeForWrite(IoStatusBlock, - sizeof(IO_STATUS_BLOCK), - sizeof(ULONG)); + ProbeForWriteIoStatusBlock(IoStatusBlock); /* Probe the information */ if (Length) ProbeForWrite(FsInformation, Length, 1); @@ -2989,9 +2967,7 @@ _SEH_TRY { /* Probe the I/O Status block */ - ProbeForWrite(IoStatusBlock, - sizeof(IO_STATUS_BLOCK), - sizeof(ULONG)); + ProbeForWriteIoStatusBlock(IoStatusBlock); /* Probe the information */ if (Length) ProbeForRead(FsInformation, Length, 1);
18 years, 3 months
1
0
0
0
[weiden] 23827: - Fix some probing macros - Add probing macros for IO_STATUS_BLOCK structures - Added two inline functions ProbeArrayForRead() and ProbeArrayForWrite(), mainly for use in win32k as they also check for integer overflows.
by weiden@svn.reactos.org
Author: weiden Date: Thu Aug 31 01:44:12 2006 New Revision: 23827 URL:
http://svn.reactos.org/svn/reactos?rev=23827&view=rev
Log: - Fix some probing macros - Add probing macros for IO_STATUS_BLOCK structures - Added two inline functions ProbeArrayForRead() and ProbeArrayForWrite(), mainly for use in win32k as they also check for integer overflows. Modified: trunk/reactos/include/reactos/probe.h Modified: trunk/reactos/include/reactos/probe.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/probe.h?re…
============================================================================== --- trunk/reactos/include/reactos/probe.h (original) +++ trunk/reactos/include/reactos/probe.h Thu Aug 31 01:44:12 2006 @@ -8,6 +8,7 @@ static const UNICODE_STRING __emptyUnicodeString = {0}; static const LARGE_INTEGER __emptyLargeInteger = {{0, 0}}; static const ULARGE_INTEGER __emptyULargeInteger = {{0, 0}}; +static const IO_STATUS_BLOCK __emptyIoStatusBlock = {{0}, 0}; #if defined(_WIN32K_) /* @@ -40,20 +41,20 @@ #define ProbeForWriteInt(Ptr) ProbeForWriteGenericType(Ptr, INT) #define ProbeForWriteUlonglong(Ptr) ProbeForWriteGenericType(Ptr, ULONGLONG) #define ProbeForWriteLonglong(Ptr) ProbeForWriteGenericType(Ptr, LONGLONG) -#define ProbeForWriteLonglong(Ptr) ProbeForWriteGenericType(Ptr, LONGLONG) #define ProbeForWritePointer(Ptr) ProbeForWriteGenericType(Ptr, PVOID) #define ProbeForWriteHandle(Ptr) ProbeForWriteGenericType(Ptr, HANDLE) #define ProbeForWriteLangid(Ptr) ProbeForWriteGenericType(Ptr, LANGID) #define ProbeForWriteSize_t(Ptr) ProbeForWriteGenericType(Ptr, SIZE_T) -#define ProbeForWriteLargeInteger(Ptr) ProbeForWriteGenericType(&(Ptr)->QuadPart, LONGLONG) -#define ProbeForWriteUlargeInteger(Ptr) ProbeForWriteGenericType(&(Ptr)->QuadPart, ULONGLONG) -#define ProbeForWriteUnicodeString(Ptr) ProbeForWriteGenericType(Ptr, UNICODE_STRING) +#define ProbeForWriteLargeInteger(Ptr) ProbeForWriteGenericType(&((PLARGE_INTEGER)Ptr)->QuadPart, LONGLONG) +#define ProbeForWriteUlargeInteger(Ptr) ProbeForWriteGenericType(&((PULARGE_INTEGER)Ptr)->QuadPart, ULONGLONG) +#define ProbeForWriteUnicodeString(Ptr) ProbeForWriteGenericType((PUNICODE_STRING)Ptr, UNICODE_STRING) +#define ProbeForWriteIoStatusBlock(Ptr) ProbeForWriteGenericType((PIO_STATUS_BLOCK)Ptr, IO_STATUS_BLOCK) #define ProbeForReadGenericType(Ptr, Type, Default) \ (((ULONG_PTR)(Ptr) + sizeof(Type) - 1 < (ULONG_PTR)(Ptr) || \ (ULONG_PTR)(Ptr) + sizeof(Type) - 1 >= (ULONG_PTR)MmUserProbeAddress) ? \ ExRaiseStatus (STATUS_ACCESS_VIOLATION), Default : \ - *(Type *)(Ptr)) + *(const volatile Type *)(Ptr)) #define ProbeForReadBoolean(Ptr) ProbeForReadGenericType(Ptr, BOOLEAN, FALSE) #define ProbeForReadUchar(Ptr) ProbeForReadGenericType(Ptr, UCHAR, 0) @@ -70,9 +71,10 @@ #define ProbeForReadHandle(Ptr) ProbeForReadGenericType(Ptr, HANDLE, NULL) #define ProbeForReadLangid(Ptr) ProbeForReadGenericType(Ptr, LANGID, 0) #define ProbeForReadSize_t(Ptr) ProbeForReadGenericType(Ptr, SIZE_T, 0) -#define ProbeForReadLargeInteger(Ptr) ProbeForReadGenericType(Ptr, LARGE_INTEGER, __emptyLargeInteger) -#define ProbeForReadUlargeInteger(Ptr) ProbeForReadGenericType(Ptr, ULARGE_INTEGER, __emptyULargeInteger) -#define ProbeForReadUnicodeString(Ptr) ProbeForReadGenericType(Ptr, UNICODE_STRING, __emptyUnicodeString) +#define ProbeForReadLargeInteger(Ptr) ProbeForReadGenericType((const LARGE_INTEGER *)(Ptr), LARGE_INTEGER, __emptyLargeInteger) +#define ProbeForReadUlargeInteger(Ptr) ProbeForReadGenericType((const ULARGE_INTEGER *)(Ptr), ULARGE_INTEGER, __emptyULargeInteger) +#define ProbeForReadUnicodeString(Ptr) ProbeForReadGenericType((const UNICODE_STRING *)(Ptr), UNICODE_STRING, __emptyUnicodeString) +#define ProbeForReadIoStatusBlock(Ptr) ProbeForReadGenericType((const IO_STATUS_BLOCK *)(Ptr), IO_STATUS_BLOCK, __emptyIoStatusBlock) #define ProbeAndZeroHandle(Ptr) \ do { \ @@ -86,12 +88,61 @@ /* * Inlined Probing Macros */ + +#if defined(_WIN32K_) +static __inline +VOID +NTAPI +ProbeArrayForRead(IN const VOID *ArrayPtr, + IN ULONG ItemSize, + IN ULONG ItemCount, + IN ULONG Alignment) +{ + ULONG ArraySize; + + /* Check for integer overflow */ + ArraySize = ItemSize * ItemCount; + if (ArraySize / ItemSize != ItemCount) + { + RtlRaiseStatus (STATUS_INVALID_PARAMETER); + } + + /* Probe the array */ + ProbeForRead(ArrayPtr, + ArraySize, + Alignment); +} + +static __inline +VOID +NTAPI +ProbeArrayForWrite(IN OUT PVOID ArrayPtr, + IN ULONG ItemSize, + IN ULONG ItemCount, + IN ULONG Alignment) +{ + ULONG ArraySize; + + /* Check for integer overflow */ + ArraySize = ItemSize * ItemCount; + if (ArraySize / ItemSize != ItemCount) + { + RtlRaiseStatus (STATUS_INVALID_PARAMETER); + } + + /* Probe the array */ + ProbeForWrite(ArrayPtr, + ArraySize, + Alignment); +} +#endif /* _WIN32K_ */ + static __inline NTSTATUS NTAPI ProbeAndCaptureUnicodeString(OUT PUNICODE_STRING Dest, IN KPROCESSOR_MODE CurrentMode, - IN PUNICODE_STRING UnsafeSrc) + IN const UNICODE_STRING *UnsafeSrc) { NTSTATUS Status = STATUS_SUCCESS; WCHAR *Buffer = NULL;
18 years, 3 months
1
0
0
0
[greatlrd] 23826: Wrote RtlUshotByteSwap RtlUlongByteSwap and RtlUlonglongByteSwap to asm code. but we need a C api for header to linking it right. Put the asm version to i386
by greatlrd@svn.reactos.org
Author: greatlrd Date: Thu Aug 31 01:17:53 2006 New Revision: 23826 URL:
http://svn.reactos.org/svn/reactos?rev=23826&view=rev
Log: Wrote RtlUshotByteSwap RtlUlongByteSwap and RtlUlonglongByteSwap to asm code. but we need a C api for header to linking it right. Put the asm version to i386 Added: trunk/reactos/lib/rtl/i386/memgeni386.c trunk/reactos/lib/rtl/i386/rtlulongbyteswap.s trunk/reactos/lib/rtl/i386/rtlulonglongbyteswap.s (with props) trunk/reactos/lib/rtl/i386/rtlushortbyteswap.s trunk/reactos/lib/rtl/memgen.c - copied, changed from r23804, trunk/reactos/lib/rtl/mem.c Modified: trunk/reactos/lib/rtl/mem.c trunk/reactos/lib/rtl/rtl.rbuild Added: trunk/reactos/lib/rtl/i386/memgeni386.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/i386/memgeni386.c?…
============================================================================== --- trunk/reactos/lib/rtl/i386/memgeni386.c (added) +++ trunk/reactos/lib/rtl/i386/memgeni386.c Thu Aug 31 01:17:53 2006 @@ -1,0 +1,75 @@ +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/rtl/mem.c + * PURPOSE: Memory functions + * PROGRAMMER: David Welch (welch(a)mcmail.com) + */ + +/* INCLUDES *****************************************************************/ + +#include <rtl.h> + +#define NDEBUG +#include <debug.h> + +#undef RtlUlonglongByteSwap +#undef RtlUlongByteSwap +#undef RtlUshortByteSwap + +USHORT UshortByteSwap (IN USHORT Source); +ULONG UlongByteSwap (IN ULONG Source); +ULONGLONG UlonglongByteSwap (IN ULONGLONG Source); + +/************************************************************************* + * RtlUshortByteSwap + * + * Swap the bytes of an unsigned short value. + * + * + * @implemented + */ +USHORT FASTCALL +RtlUshortByteSwap (IN USHORT Source) +{ + return UshortByteSwap (Source); +} + + + +/************************************************************************* + * RtlUlongByteSwap [NTDLL.@] + * + * Swap the bytes of an unsigned int value. + * + * + * @implemented + */ +ULONG +FASTCALL +RtlUlongByteSwap( + IN ULONG Source +) +{ + return UlongByteSwap(Source); +} + + +/************************************************************************* + * RtlUlonglongByteSwap + * + * Swap the bytes of an unsigned long long value. + * + * PARAMS + * i [I] Value to swap bytes of + * + * + * @implemented + */ +ULONGLONG FASTCALL +RtlUlonglongByteSwap (IN ULONGLONG Source) +{ + return UlonglongByteSwap(Source); +} + + +/* EOF */ Added: trunk/reactos/lib/rtl/i386/rtlulongbyteswap.s URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/i386/rtlulongbytes…
============================================================================== --- trunk/reactos/lib/rtl/i386/rtlulongbyteswap.s (added) +++ trunk/reactos/lib/rtl/i386/rtlulongbyteswap.s Thu Aug 31 01:17:53 2006 @@ -1,0 +1,21 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * PURPOSE: Run-Time Library + * FILE: lib/rtl/i386/RtlUlongByteSwap.S + * PROGRAMER: Magnus Olsen (magnus(a)greatlord.com) + */ + +.globl _UlongByteSwap + +.intel_syntax noprefix + +/* FUNCTIONS ***************************************************************/ + +_UlongByteSwap: + push ebp // save base + mov ebp,esp // move stack to base + mov eax,[ebp+8] // load the ULONG + bswap eax // swap the ULONG + pop ebp // restore the base + ret Added: trunk/reactos/lib/rtl/i386/rtlulonglongbyteswap.s URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/i386/rtlulonglongb…
============================================================================== --- trunk/reactos/lib/rtl/i386/rtlulonglongbyteswap.s (added) +++ trunk/reactos/lib/rtl/i386/rtlulonglongbyteswap.s Thu Aug 31 01:17:53 2006 @@ -1,0 +1,23 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * PURPOSE: Run-Time Library + * FILE: lib/rtl/i386/RtlUlonglongByteSwap.S + * PROGRAMER: Magnus Olsen (magnus(a)greatlord.com) + */ + +.globl _UlonglongByteSwap + +.intel_syntax noprefix + +/* FUNCTIONS ***************************************************************/ + +_UlonglongByteSwap: + push ebp // save base + mov ebp,esp // move stack to base + mov edx,[ebp+8] // load the higher part of ULONGLONG + mov eax,[ebp+12] // load the lower part of ULONGLONG + bswap edx // swap the higher part + bswap eax // swap the lower part + pop ebp // restore the base + ret Propchange: trunk/reactos/lib/rtl/i386/rtlulonglongbyteswap.s ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/lib/rtl/i386/rtlushortbyteswap.s URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/i386/rtlushortbyte…
============================================================================== --- trunk/reactos/lib/rtl/i386/rtlushortbyteswap.s (added) +++ trunk/reactos/lib/rtl/i386/rtlushortbyteswap.s Thu Aug 31 01:17:53 2006 @@ -1,0 +1,22 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * PURPOSE: Run-Time Library + * FILE: lib/rtl/i386/RtlUlongByteSwap.S + * PROGRAMER: Magnus Olsen (magnus(a)greatlord.com) + */ + +.globl _UshortByteSwap + +.intel_syntax noprefix + +/* FUNCTIONS ***************************************************************/ + +_UshortByteSwap: + push ebp // save base + mov ebp,esp // move stack to base + mov eax,[ebp+8] // load the USHORT + bswap eax // swap the USHORT, xchg is slow so we use bswap with rol + rol eax,16 // make it USHORT + pop ebp // restore the base + ret Modified: trunk/reactos/lib/rtl/mem.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/mem.c?rev=23826&r1…
============================================================================== --- trunk/reactos/lib/rtl/mem.c (original) +++ trunk/reactos/lib/rtl/mem.c Thu Aug 31 01:17:53 2006 @@ -12,9 +12,6 @@ #define NDEBUG #include <debug.h> -#undef RtlUlonglongByteSwap -#undef RtlUlongByteSwap -#undef RtlUshortByteSwap /* FUNCTIONS *****************************************************************/ @@ -173,63 +170,4 @@ ); } - -/************************************************************************* - * RtlUshortByteSwap - * - * Swap the bytes of an unsigned short value. - * - * NOTES - * Based on the inline versions in Wine winternl.h - * - * @implemented - */ -USHORT FASTCALL -RtlUshortByteSwap (IN USHORT Source) -{ - return (Source >> 8) | (Source << 8); -} - - - -/************************************************************************* - * RtlUlongByteSwap [NTDLL.@] - * - * Swap the bytes of an unsigned int value. - * - * NOTES - * Based on the inline versions in Wine winternl.h - * - * @implemented - */ -ULONG -FASTCALL -RtlUlongByteSwap( - IN ULONG Source -) -{ - return ((ULONG)RtlUshortByteSwap((USHORT)Source) << 16) | RtlUshortByteSwap((USHORT)(Source >> 16)); -} - - -/************************************************************************* - * RtlUlonglongByteSwap - * - * Swap the bytes of an unsigned long long value. - * - * PARAMS - * i [I] Value to swap bytes of - * - * RETURNS - * The value with its bytes swapped. - * - * @implemented - */ -ULONGLONG FASTCALL -RtlUlonglongByteSwap (IN ULONGLONG Source) -{ - return ((ULONGLONG) RtlUlongByteSwap (Source) << 32) | RtlUlongByteSwap (Source>>32); -} - - /* EOF */ Copied: trunk/reactos/lib/rtl/memgen.c (from r23804, trunk/reactos/lib/rtl/mem.c) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/memgen.c?p2=trunk/…
============================================================================== --- trunk/reactos/lib/rtl/mem.c (original) +++ trunk/reactos/lib/rtl/memgen.c Thu Aug 31 01:17:53 2006 @@ -15,164 +15,6 @@ #undef RtlUlonglongByteSwap #undef RtlUlongByteSwap #undef RtlUshortByteSwap - -/* FUNCTIONS *****************************************************************/ - -/****************************************************************************** - * RtlCompareMemory [NTDLL.@] - * - * Compare one block of memory with another - * - * PARAMS - * Source1 [I] Source block - * Source2 [I] Block to compare to Source1 - * Length [I] Number of bytes to fill - * - * RETURNS - * The length of the first byte at which Source1 and Source2 differ, or Length - * if they are the same. - * - * @implemented - */ -SIZE_T NTAPI -RtlCompareMemory(IN const VOID *Source1, - IN const VOID *Source2, - IN SIZE_T Length) -{ - SIZE_T i; - for(i=0; (i<Length) && (((PUCHAR)Source1)[i]==((PUCHAR)Source2)[i]); i++) - ; - return i; -} - - -/* - * @implemented - */ -ULONG -NTAPI -RtlCompareMemoryUlong ( - PVOID Source, - ULONG Length, - ULONG Value -) -/* - * FUNCTION: Compares a block of ULONGs with an ULONG and returns the number of equal bytes - * ARGUMENTS: - * Source = Block to compare - * Length = Number of bytes to compare - * Value = Value to compare - * RETURNS: Number of equal bytes - */ -{ - PULONG ptr = (PULONG)Source; - ULONG len = Length / sizeof(ULONG); - ULONG i; - - for (i = 0; i < len; i++) - { - if (*ptr != Value) - break; - ptr++; - } - - return (ULONG)((PCHAR)ptr - (PCHAR)Source); -} - - -#undef RtlFillMemory -/* - * @implemented - */ -VOID -NTAPI -RtlFillMemory ( - PVOID Destination, - ULONG Length, - UCHAR Fill -) -{ - memset(Destination, Fill, Length); -} - - - -/* - * @implemented - */ -VOID -NTAPI -RtlFillMemoryUlong ( - PVOID Destination, - ULONG Length, - ULONG Fill -) -{ - PULONG Dest = Destination; - ULONG Count = Length / sizeof(ULONG); - - while (Count > 0) - { - *Dest = Fill; - Dest++; - Count--; - } -} - - -#undef RtlMoveMemory -/* - * @implemented - */ -VOID -NTAPI -RtlMoveMemory ( - PVOID Destination, - CONST VOID * Source, - ULONG Length -) -{ - memmove ( - Destination, - Source, - Length - ); -} - -/* -* @implemented -*/ -VOID -FASTCALL -RtlPrefetchMemoryNonTemporal( - IN PVOID Source, - IN SIZE_T Length - ) -{ - /* By nature of prefetch, this is non-portable. */ - (void)Source; - (void)Length; -} - - -#undef RtlZeroMemory -/* - * @implemented - */ -VOID -NTAPI -RtlZeroMemory ( - PVOID Destination, - ULONG Length -) -{ - RtlFillMemory ( - Destination, - Length, - 0 - ); -} - /************************************************************************* * RtlUshortByteSwap Modified: trunk/reactos/lib/rtl/rtl.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/rtl.rbuild?rev=238…
============================================================================== --- trunk/reactos/lib/rtl/rtl.rbuild (original) +++ trunk/reactos/lib/rtl/rtl.rbuild Thu Aug 31 01:17:53 2006 @@ -35,6 +35,10 @@ <file>ftol_asm.s</file> <file>log_asm.s</file> <file>random_asm.S</file> + <file>memgeni386.c</file> + <file>rtlushortbyteswap.s</file> + <file>rtlulongbyteswap.s</file> + <file>rtlulonglongbyteswap.s</file> <file>pow_asm.s</file> <file>prefetchmemory_asm.s</file> <file>res_asm.s</file> @@ -42,8 +46,13 @@ <file>sqrt_asm.s</file> <file>tan_asm.s</file> <file>zeromemory_asm.s</file> - </directory> + </directory> </if> + + <ifnot property="ARCH" value="i386"> + <file>memgen.c</file> + </ifnot> + <file>access.c</file> <file>acl.c</file> <file>atom.c</file>
18 years, 3 months
1
0
0
0
[weiden] 23825: Revert r23824. This needs to go into the clipboard branch for now.
by weiden@svn.reactos.org
Author: weiden Date: Thu Aug 31 00:59:32 2006 New Revision: 23825 URL:
http://svn.reactos.org/svn/reactos?rev=23825&view=rev
Log: Revert r23824. This needs to go into the clipboard branch for now. Modified: trunk/reactos/include/psdk/ntgdi.h trunk/reactos/include/reactos/win32k/ntuser.h Modified: trunk/reactos/include/psdk/ntgdi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ntgdi.h?rev=2…
============================================================================== --- trunk/reactos/include/psdk/ntgdi.h (original) +++ trunk/reactos/include/psdk/ntgdi.h Thu Aug 31 00:59:32 2006 @@ -3620,11 +3620,4 @@ IN HANDLE h ); -W32KAPI -DWORD -APIENTRY -NtGdiGetLayout( - IN HDC hdc -); - #endif 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 (original) +++ trunk/reactos/include/reactos/win32k/ntuser.h Thu Aug 31 00:59:32 2006 @@ -115,11 +115,6 @@ PRECT hRect, HMENU hMenu, HFONT hFont); - -UINT -NTAPI -NtUserEnumClipboardFormats( - UINT format); UINT NTAPI @@ -1451,16 +1446,6 @@ int id, UINT fsModifiers, UINT vk); - -UINT -NTAPI -NtUserRegisterClipboardFormat( - PUNICODE_STRING format); - -BOOL -NTAPI -NtUserGetLastInputInfo( - PLASTINPUTINFO plii); DWORD NTAPI
18 years, 3 months
1
0
0
0
[pborobia] 23824: * added GetLayout definition * added Clipboards definitions * added GetLastInputInfo definition
by pborobia@svn.reactos.org
Author: pborobia Date: Thu Aug 31 00:56:17 2006 New Revision: 23824 URL:
http://svn.reactos.org/svn/reactos?rev=23824&view=rev
Log: * added GetLayout definition * added Clipboards definitions * added GetLastInputInfo definition Modified: trunk/reactos/include/psdk/ntgdi.h trunk/reactos/include/reactos/win32k/ntuser.h Modified: trunk/reactos/include/psdk/ntgdi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ntgdi.h?rev=2…
============================================================================== --- trunk/reactos/include/psdk/ntgdi.h (original) +++ trunk/reactos/include/psdk/ntgdi.h Thu Aug 31 00:56:17 2006 @@ -3620,4 +3620,11 @@ IN HANDLE h ); +W32KAPI +DWORD +APIENTRY +NtGdiGetLayout( + IN HDC hdc +); + #endif 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 (original) +++ trunk/reactos/include/reactos/win32k/ntuser.h Thu Aug 31 00:56:17 2006 @@ -115,6 +115,11 @@ PRECT hRect, HMENU hMenu, HFONT hFont); + +UINT +NTAPI +NtUserEnumClipboardFormats( + UINT format); UINT NTAPI @@ -1446,6 +1451,16 @@ int id, UINT fsModifiers, UINT vk); + +UINT +NTAPI +NtUserRegisterClipboardFormat( + PUNICODE_STRING format); + +BOOL +NTAPI +NtUserGetLastInputInfo( + PLASTINPUTINFO plii); DWORD NTAPI
18 years, 3 months
1
0
0
0
[weiden] 23823: Revert r23810, r23811, r23813. The clipboard changes are in the clipboard branch for now.
by weiden@svn.reactos.org
Author: weiden Date: Thu Aug 31 00:40:07 2006 New Revision: 23823 URL:
http://svn.reactos.org/svn/reactos?rev=23823&view=rev
Log: Revert r23810, r23811, r23813. The clipboard changes are in the clipboard branch for now. Modified: trunk/reactos/dll/win32/shell32/shell32_main.h trunk/reactos/dll/win32/shell32/shfldr_fs.c trunk/reactos/dll/win32/shell32/shlfileop.c trunk/reactos/dll/win32/shell32/shv_bg_cmenu.c trunk/reactos/dll/win32/shell32/shv_item_cmenu.c trunk/reactos/dll/win32/user32/include/user32p.h trunk/reactos/dll/win32/user32/windows/clipboard.c trunk/reactos/dll/win32/user32/windows/defwnd.c trunk/reactos/dll/win32/user32/windows/input.c trunk/reactos/regtests/winetests/user32/clipboard.c Modified: trunk/reactos/dll/win32/shell32/shell32_main.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shell32_…
============================================================================== --- trunk/reactos/dll/win32/shell32/shell32_main.h (original) +++ trunk/reactos/dll/win32/shell32/shell32_main.h Thu Aug 31 00:40:07 2006 @@ -148,8 +148,6 @@ BOOL SHELL_DeleteDirectoryA(LPCSTR pszDir, BOOL bShowUI); BOOL SHELL_DeleteFileA(LPCSTR pszFile, BOOL bShowUI); BOOL SHELL_ConfirmDialog(int nKindOfDialog, LPCSTR szDir); -DWORD SHNotifyMoveFileA(LPCSTR src, LPCSTR dest); -DWORD SHNotifyCopyFileA(LPCSTR src, LPCSTR dest, BOOL bFailIfExists); /* 16-bit functions */ void WINAPI DragAcceptFiles16(HWND16 hWnd, BOOL16 b); Modified: trunk/reactos/dll/win32/shell32/shfldr_fs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_f…
============================================================================== --- trunk/reactos/dll/win32/shell32/shfldr_fs.c (original) +++ trunk/reactos/dll/win32/shell32/shfldr_fs.c Thu Aug 31 00:40:07 2006 @@ -1154,8 +1154,6 @@ return hres; } -extern BOOL fileMoving; - /**************************************************************************** * ISFHelper_fnDeleteItems * @@ -1170,7 +1168,7 @@ BOOL bConfirm = TRUE; TRACE ("(%p)(%u %p)\n", This, cidl, apidl); - + /* deleting multiple items so give a slightly different warning */ if (cidl != 1) { char tmp[8]; @@ -1180,7 +1178,7 @@ return E_FAIL; bConfirm = FALSE; } - + for (i = 0; i < cidl; i++) { strcpy (szPath, This->sPathTarget); PathAddBackslashA (szPath); @@ -1238,8 +1236,7 @@ LPITEMIDLIST pidl; if (SUCCEEDED (IPersistFolder2_GetCurFolder (ppf2, &pidl))) { - for (i = 0; i < cidl; i++) - { + for (i = 0; i < cidl; i++) { SHGetPathFromIDListA (pidl, szSrcPath); PathAddBackslashA (szSrcPath); _ILSimpleGetText (apidl[i], szSrcPath + strlen (szSrcPath), @@ -1247,43 +1244,9 @@ strcpy (szDstPath, This->sPathTarget); PathAddBackslashA (szDstPath); - _ILSimpleGetText (apidl[i], szDstPath + strlen (szDstPath), MAX_PATH); - DPRINT1 ("copy %s to %s\n", szSrcPath, szDstPath); - - if (fileMoving) - { - fileMoving = FALSE; - SHNotifyMoveFileA(szSrcPath, szDstPath); - } - else - { - SHNotifyCopyFileA(szSrcPath, szDstPath, TRUE); - } - - /* - SHFILEOPSTRUCTA op; - - if (fileMoving) - { - op.wFunc = FO_MOVE; - fileMoving = FALSE; - } - else - { - op.wFunc = FO_COPY; - } - - op.pTo = szDstPath; - op.pFrom = szSrcPath; - op.fFlags = FOF_SIMPLEPROGRESS; - op.hwnd = NULL; - op.hNameMappings = NULL; - op.lpszProgressTitle = NULL; - - UINT bRes = SHFileOperationA(&op); - DbgPrint("CopyItems SHFileOperationA 0x%08x\n", bRes); - */ - + _ILSimpleGetText (apidl[i], szDstPath + strlen (szDstPath), + MAX_PATH); + MESSAGE ("would copy %s to %s\n", szSrcPath, szDstPath); } SHFree (pidl); } @@ -1595,11 +1558,9 @@ ISFDropTarget_Drop (IDropTarget * iface, IDataObject * pDataObject, DWORD dwKeyState, POINTL pt, DWORD * pdwEffect) { - DWORD dwEffect = *pdwEffect; - IGenericSFImpl *This = impl_from_IDropTarget(iface); - FIXME ("(%p) object dropped(%d)\n", This, dwKeyState); + FIXME ("(%p) object dropped\n", This); return E_NOTIMPL; } Modified: trunk/reactos/dll/win32/shell32/shlfileop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlfileo…
============================================================================== --- trunk/reactos/dll/win32/shell32/shlfileop.c (original) +++ trunk/reactos/dll/win32/shell32/shlfileop.c Thu Aug 31 00:40:07 2006 @@ -478,65 +478,6 @@ return GetLastError(); } -DWORD SHNotifyMoveFileA(LPCSTR src, LPCSTR dest) -{ - BOOL ret; - LPWSTR destW; - - ret = MoveFileA(src, dest); - if (!ret) - { - DWORD dwAttr; - - SHELL32_AnsiToUnicodeBuf(dest, &destW, 0); - dwAttr = SHFindAttrW(destW, FALSE); - SHELL32_FreeUnicodeBuf(destW); - if (INVALID_FILE_ATTRIBUTES == dwAttr) - { - /* Source file may be write protected or a system file */ - dwAttr = GetFileAttributesA(src); - if (IsAttrib(dwAttr, FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM)) - if (SetFileAttributesA(src, dwAttr & ~(FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM))) - ret = MoveFileA(src, dest); - } - } - if (ret) - { - //SHChangeNotify(SHCNE_RENAMEITEM, SHCNF_PATHA, src, dest); - SHChangeNotify(SHCNE_CREATE, SHCNF_PATHA, dest, NULL); - SHChangeNotify(SHCNE_DELETE, SHCNF_PATHA, src, NULL); - return ERROR_SUCCESS; - } - return GetLastError(); -} - -/************************************************************************ - * SHNotifyCopyFile [internal] - * - * Copies a file. Also triggers a change notify if one exists. - * - * PARAMS - * src [I] path to source file to move - * dest [I] path to target file to move to - * bFailIfExists [I] if TRUE, the target file will not be overwritten if - * a file with this name already exists - * - * RETURNS - * ERROR_SUCCESS if successful - */ -DWORD SHNotifyCopyFileA(LPCSTR src, LPCSTR dest, BOOL bFailIfExists) -{ - BOOL ret; - - ret = CopyFileA(src, dest, bFailIfExists); - if (ret) - { - SHChangeNotify(SHCNE_CREATE, SHCNF_PATHA, dest, NULL); - return ERROR_SUCCESS; - } - return GetLastError(); -} - /************************************************************************* * SHCreateDirectory [SHELL32.165] * @@ -708,29 +649,7 @@ } return dwAttr; } -/* -DWORD SHFindAttrA(LPSTR pName, BOOL fileOnly) -{ - WIN32_FIND_DATAA wfd; - BOOL b_FileMask = fileOnly && (NULL != StrPBrkA(pName, wWildcardChars)); - DWORD dwAttr = INVALID_FILE_ATTRIBUTES; - HANDLE hFind = FindFirstFileA(pName, &wfd); - - if (INVALID_HANDLE_VALUE != hFind) - { - do - { - if (b_FileMask && IsAttribDir(wfd.dwFileAttributes)) - continue; - dwAttr = wfd.dwFileAttributes; - break; - } - while (FindNextFileA(hFind, &wfd)); - FindClose(hFind); - } - return dwAttr; -} -*/ + /************************************************************************* * * SHFileStrICmp HelperFunction for SHFileOperationW Modified: trunk/reactos/dll/win32/shell32/shv_bg_cmenu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shv_bg_c…
============================================================================== --- trunk/reactos/dll/win32/shell32/shv_bg_cmenu.c (original) +++ trunk/reactos/dll/win32/shell32/shv_bg_cmenu.c Thu Aug 31 00:40:07 2006 @@ -38,8 +38,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); -extern BOOL fileMoving; - /************************************************************************** * IContextMenu Implementation */ @@ -217,82 +215,18 @@ } } -/***************************************************************************/ -static BOOL DoLink(LPCSTR pSrcFile, LPCSTR pDstFile) -{ - IShellLinkA *psl = NULL; - IPersistFile *pPf = NULL; - HRESULT hres; - WCHAR widelink[MAX_PATH]; - BOOL ret = FALSE; - - CoInitialize(0); - - hres = CoCreateInstance( &CLSID_ShellLink, - NULL, - CLSCTX_INPROC_SERVER, - &IID_IShellLinkA, - (LPVOID )&psl); - - if(SUCCEEDED(hres)) { - - hres = IShellLinkA_QueryInterface(psl, &IID_IPersistFile, - (LPVOID *)&pPf); - if(FAILED(hres)) - { - ERR("failed QueryInterface for IPersistFile %08lx\n", hres); - goto fail; - } - - DPRINT1("shortcut point to %s\n", pSrcFile); - - hres = IShellLinkA_SetPath(psl, pSrcFile); - - if(FAILED(hres)) - { - ERR("failed Set{IDList|Path} %08lx\n", hres); - goto fail; - } - - MultiByteToWideChar(CP_ACP, 0, pDstFile, -1, - widelink, MAX_PATH); - - /* create the short cut */ - hres = IPersistFile_Save(pPf, widelink, TRUE); - - if(FAILED(hres)) - { - ERR("failed IPersistFile::Save %08lx\n", hres); - IPersistFile_Release(pPf); - IShellLinkA_Release(psl); - goto fail; - } - - hres = IPersistFile_SaveCompleted(pPf, widelink); - IPersistFile_Release(pPf); - IShellLinkA_Release(psl); - DPRINT1("shortcut %s has been created, result=%08lx\n", - pDstFile, hres); - ret = TRUE; - } - else { - DPRINT1("CoCreateInstance failed, hres=%08lx\n", hres); - } - - fail: - CoUninitialize(); - return ret; -} - -static BOOL MakeLink( - IContextMenu2 *iface) +/************************************************************************** +* DoPaste +*/ +static BOOL DoPaste( + IContextMenu2 *iface) { BgCmImpl *This = (BgCmImpl *)iface; BOOL bSuccess = FALSE; IDataObject * pda; TRACE("\n"); - + if(SUCCEEDED(OleGetClipboard(&pda))) { STGMEDIUM medium; @@ -302,137 +236,9 @@ /* Set the FORMATETC structure*/ InitFormatEtc(formatetc, RegisterClipboardFormatA(CFSTR_SHELLIDLIST), TYMED_HGLOBAL); - + /* Get the pidls from IDataObject */ - if(SUCCEEDED(IDataObject_GetData(pda, &formatetc, &medium))) - { - LPITEMIDLIST * apidl; - LPITEMIDLIST pidl; - IShellFolder *psfFrom = NULL, *psfDesktop; - - LPIDA lpcida = GlobalLock(medium.u.hGlobal); - TRACE("cida=%p\n", lpcida); - - apidl = _ILCopyCidaToaPidl(&pidl, lpcida); - - /* bind to the source shellfolder */ - SHGetDesktopFolder(&psfDesktop); - if(psfDesktop) - { - IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (LPVOID*)&psfFrom); - IShellFolder_Release(psfDesktop); - } - - if (psfFrom) - { - /* get source and destination shellfolder */ - IPersistFolder2 *ppfdst = NULL; - IPersistFolder2 *ppfsrc = NULL; - IShellFolder_QueryInterface(This->pSFParent, &IID_IPersistFolder2, (LPVOID*)&ppfdst); - IShellFolder_QueryInterface(psfFrom, &IID_IPersistFolder2, (LPVOID*)&ppfsrc); - - - DPRINT1("[%p,%p]\n",ppfdst,ppfsrc); - - /* do the link/s */ - /* hack to get desktop path */ - if ( (ppfdst && ppfsrc) || (This->bDesktop && ppfsrc) ) - { - - int i; - char szSrcPath[MAX_PATH]; - char szDstPath[MAX_PATH]; - BOOL ret = FALSE; - LPITEMIDLIST pidl2; - char filename[MAX_PATH]; - char linkFilename[MAX_PATH]; - char srcFilename[MAX_PATH]; - - DbgPrint("&&&"); - IPersistFolder2_GetCurFolder(ppfsrc, &pidl2); - SHGetPathFromIDListA (pidl2, szSrcPath); - - if (This->bDesktop) - { - SHGetSpecialFolderLocation(0, CSIDL_DESKTOPDIRECTORY, &pidl2); - SHGetPathFromIDListA (pidl2, szDstPath); - } - else - { - IPersistFolder2_GetCurFolder(ppfdst, &pidl2); - SHGetPathFromIDListA (pidl2, szDstPath); - } - - - for (i = 0; i < lpcida->cidl; i++) - { - _ILSimpleGetText (apidl[i], filename, MAX_PATH); - - DbgPrint("filename %s\n", filename); - - lstrcpyA(linkFilename, szDstPath); - PathAddBackslashA(linkFilename); - //lstrcatA(linkFilename, "Shortcut to "); - lstrcatA(linkFilename, filename); - lstrcatA(linkFilename, ".lnk"); - - DbgPrint("linkFilename %s\n", linkFilename); - - lstrcpyA(srcFilename, szSrcPath); - PathAddBackslashA(srcFilename); - lstrcatA(srcFilename, filename); - - DbgPrint("srcFilename %s\n", srcFilename); - - ret = DoLink(srcFilename, linkFilename); - - if (ret) - { - SHChangeNotify(SHCNE_CREATE, SHCNF_PATHA, linkFilename, NULL); - } - } - - } - if(ppfdst) IPersistFolder2_Release(ppfdst); - if(ppfsrc) IPersistFolder2_Release(ppfsrc); - IShellFolder_Release(psfFrom); - } - - _ILFreeaPidl(apidl, lpcida->cidl); - SHFree(pidl); - - /* release the medium*/ - ReleaseStgMedium(&medium); - } - IDataObject_Release(pda); - } - return bSuccess; - -} -/************************************************************************** -* DoPaste -*/ -static BOOL DoPaste( - IContextMenu2 *iface) -{ - BgCmImpl *This = (BgCmImpl *)iface; - BOOL bSuccess = FALSE; - IDataObject * pda; - - TRACE("\n"); - - if(SUCCEEDED(OleGetClipboard(&pda))) - { - STGMEDIUM medium; - FORMATETC formatetc; - - TRACE("pda=%p\n", pda); - - /* Set the FORMATETC structure*/ - InitFormatEtc(formatetc, RegisterClipboardFormatA(CFSTR_SHELLIDLIST), TYMED_HGLOBAL); - - /* Get the pidls from IDataObject */ - if(SUCCEEDED(IDataObject_GetData(pda, &formatetc, &medium))) + if(SUCCEEDED(IDataObject_GetData(pda,&formatetc,&medium))) { LPITEMIDLIST * apidl; LPITEMIDLIST pidl; @@ -442,7 +248,7 @@ TRACE("cida=%p\n", lpcida); apidl = _ILCopyCidaToaPidl(&pidl, lpcida); - + /* bind to the source shellfolder */ SHGetDesktopFolder(&psfDesktop); if(psfDesktop) @@ -455,28 +261,17 @@ { /* get source and destination shellfolder */ ISFHelper *psfhlpdst, *psfhlpsrc; - if (This->bDesktop) - { - /* unimplemented*/ - SHGetDesktopFolder(&psfDesktop); - IFSFolder_Constructor(psfDesktop, &IID_ISFHelper, (LPVOID*)&psfhlpdst); - IShellFolder_QueryInterface(psfhlpdst, &IID_ISFHelper, (LPVOID*)&psfhlpdst); - } - else - { - IShellFolder_QueryInterface(This->pSFParent, &IID_ISFHelper, (LPVOID*)&psfhlpdst); - } - + IShellFolder_QueryInterface(This->pSFParent, &IID_ISFHelper, (LPVOID*)&psfhlpdst); IShellFolder_QueryInterface(psfFrom, &IID_ISFHelper, (LPVOID*)&psfhlpsrc); - - DPRINT1("[%p,%p]\n",psfhlpdst,psfhlpsrc); - + /* do the copy/move */ if (psfhlpdst && psfhlpsrc) { ISFHelper_CopyItems(psfhlpdst, psfFrom, lpcida->cidl, (LPCITEMIDLIST*)apidl); + /* FIXME handle move + ISFHelper_DeleteItems(psfhlpsrc, lpcida->cidl, apidl); + */ } - if(psfhlpdst) ISFHelper_Release(psfhlpdst); if(psfhlpsrc) ISFHelper_Release(psfhlpsrc); IShellFolder_Release(psfFrom); @@ -490,7 +285,30 @@ } IDataObject_Release(pda); } - +#if 0 + HGLOBAL hMem; + + OpenClipboard(NULL); + hMem = GetClipboardData(CF_HDROP); + + if(hMem) + { + char * pDropFiles = (char *)GlobalLock(hMem); + if(pDropFiles) + { + int len, offset = sizeof(DROPFILESTRUCT); + + while( pDropFiles[offset] != 0) + { + len = strlen(pDropFiles + offset); + TRACE("%s\n", pDropFiles + offset); + offset += len+1; + } + } + GlobalUnlock(hMem); + } + CloseClipboard(); +#endif return bSuccess; } @@ -517,6 +335,7 @@ IShellView_GetWindow(lpSV, &hWndSV); } } + if(HIWORD(lpcmi->lpVerb)) { TRACE("%s\n",lpcmi->lpVerb); @@ -552,10 +371,6 @@ case FCIDM_SHVIEW_INSERT: DoPaste(iface); - break; - - case FCIDM_SHVIEW_INSERTLINK: - MakeLink(iface); break; case FCIDM_SHVIEW_PROPERTIES: Modified: trunk/reactos/dll/win32/shell32/shv_item_cmenu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shv_item…
============================================================================== --- trunk/reactos/dll/win32/shell32/shv_item_cmenu.c (original) +++ trunk/reactos/dll/win32/shell32/shv_item_cmenu.c Thu Aug 31 00:40:07 2006 @@ -39,10 +39,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); -/* ugly hack for cut&psate files */ -BOOL fileMoving = FALSE; - - /************************************************************************** * IContextMenu Implementation */ @@ -102,7 +98,7 @@ { cm->bAllValues &= (_ILIsValue(apidl[u]) ? 1 : 0); } - + TRACE("(%p)->()\n",cm); return (IContextMenu2*)cm; @@ -378,10 +374,9 @@ LPDATAOBJECT lpDo; TRACE("(%p)->(wnd=%p,bCut=0x%08x)\n",This, hwnd, bCut); - fileMoving = bCut; - + /* get the active IShellView */ - if ((lpSB = (LPSHELLBROWSER)SendMessageA(hwnd, CWM_GETISHELLBROWSER, 0, 0))) + if ((lpSB = (LPSHELLBROWSER)SendMessageA(hwnd, CWM_GETISHELLBROWSER,0,0))) { if (SUCCEEDED(IShellBrowser_QueryActiveShellView(lpSB, &lpSV))) { Modified: trunk/reactos/dll/win32/user32/include/user32p.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/include/u…
============================================================================== --- trunk/reactos/dll/win32/user32/include/user32p.h (original) +++ trunk/reactos/dll/win32/user32/include/user32p.h Thu Aug 31 00:40:07 2006 @@ -75,10 +75,10 @@ #define NtUserSetCaretBlinkTime(uMSeconds) \ (BOOL)NtUserCallOneParam((DWORD)uMSeconds, ONEPARAM_ROUTINE_SETCARETBLINKTIME) -/* + #define NtUserEnumClipboardFormats(format) \ (UINT)NtUserCallOneParam(format, ONEPARAM_ROUTINE_ENUMCLIPBOARDFORMATS) -*/ + #define NtUserWindowFromDC(hDC) \ (HWND)NtUserCallOneParam((DWORD)hDC, ONEPARAM_ROUTINE_WINDOWFROMDC) Modified: trunk/reactos/dll/win32/user32/windows/clipboard.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/c…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/clipboard.c (original) +++ trunk/reactos/dll/win32/user32/windows/clipboard.c Thu Aug 31 00:40:07 2006 @@ -1,25 +1,37 @@ +/* + * ReactOS kernel + * Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ /* $Id$ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/clipboard.c * PURPOSE: Input * PROGRAMMER: Casper S. Hornstrup (chorns(a)users.sourceforge.net) - * Pablo Borobia <pborobia(a)gmail.com> * UPDATE HISTORY: * 09-05-2001 CSH Created - * */ /* INCLUDES ******************************************************************/ #include <user32.h> -#define DEBUG - #include <wine/debug.h> -#define QUERY_SIZE 0 - /* FUNCTIONS *****************************************************************/ /* @@ -28,8 +40,7 @@ BOOL STDCALL OpenClipboard(HWND hWndNewOwner) { - BOOL ret = NtUserOpenClipboard(hWndNewOwner, 0); - return ret; + return NtUserOpenClipboard(hWndNewOwner, 0); } /* @@ -38,9 +49,7 @@ BOOL STDCALL CloseClipboard(VOID) { - BOOL ret; - ret = NtUserCloseClipboard(); - return ret; + return NtUserCloseClipboard(); } /* @@ -49,8 +58,7 @@ INT STDCALL CountClipboardFormats(VOID) { - INT ret = NtUserCountClipboardFormats(); - return ret; + return NtUserCountClipboardFormats(); } /* @@ -59,7 +67,7 @@ BOOL STDCALL EmptyClipboard(VOID) { - return NtUserEmptyClipboard(); + return NtUserEmptyClipboard(); } /* @@ -68,8 +76,7 @@ UINT STDCALL EnumClipboardFormats(UINT format) { - UINT ret = NtUserEnumClipboardFormats(format); - return ret; + return NtUserEnumClipboardFormats(format); } /* @@ -78,31 +85,7 @@ HANDLE STDCALL GetClipboardData(UINT uFormat) { - HGLOBAL hGlobal = NULL; - PVOID pGlobal = NULL; - DWORD size = 0; - - /* dealing with bitmap object */ - if (uFormat != CF_BITMAP) - { - size = (DWORD)NtUserGetClipboardData(uFormat, QUERY_SIZE); - - if (size) - { - hGlobal = GlobalAlloc(GMEM_DDESHARE | GMEM_MOVEABLE, size); - pGlobal = GlobalLock(hGlobal); - - size = (DWORD)NtUserGetClipboardData(uFormat, (DWORD)pGlobal); - - GlobalUnlock(hGlobal); - } - } - else - { - hGlobal = NtUserGetClipboardData(CF_BITMAP, !QUERY_SIZE); - } - - return hGlobal; + return NtUserGetClipboardData(uFormat, 0); } /* @@ -111,32 +94,28 @@ INT STDCALL GetClipboardFormatNameA(UINT format, LPSTR lpszFormatName, int cchMaxCount) { - LPWSTR lpBuffer; - UNICODE_STRING FormatName; - INT Length; - ANSI_STRING ClassName; - - ClassName.MaximumLength = cchMaxCount; - ClassName.Buffer = lpszFormatName; - - lpBuffer = HEAP_alloc(cchMaxCount * sizeof(WCHAR)); - - if (!lpBuffer) - { - SetLastError(ERROR_OUTOFMEMORY); - return 0; - } + LPWSTR lpBuffer; + UNICODE_STRING FormatName; + INT Length; + + lpBuffer = HEAP_alloc(cchMaxCount * sizeof(WCHAR)); + if (!lpBuffer) + { + SetLastError(ERROR_OUTOFMEMORY); + return 0; + } FormatName.Length = 0; FormatName.MaximumLength = cchMaxCount * sizeof(WCHAR); FormatName.Buffer = lpBuffer; - /* we need a UNICODE string */ Length = NtUserGetClipboardFormatName(format, &FormatName, cchMaxCount); - - HEAP_strcpyWtoA(lpszFormatName, FormatName.Buffer, Length); - - return strlen(lpszFormatName); + DPRINT("GetClipboardFormatNameA(%x): %S\n", format, lpBuffer); + HEAP_strcpyWtoA(lpszFormatName, lpBuffer, Length); + HEAP_free(lpBuffer); + DPRINT("GetClipboardFormatNameA(%x): returning %s\n", format, lpszFormatName); + + return Length; } /* @@ -145,15 +124,15 @@ INT STDCALL GetClipboardFormatNameW(UINT format, LPWSTR lpszFormatName, INT cchMaxCount) { - UNICODE_STRING FormatName; - ULONG Ret; - - FormatName.Length = 0; - FormatName.MaximumLength = cchMaxCount * sizeof(WCHAR); - FormatName.Buffer = (PWSTR)lpszFormatName; - Ret = NtUserGetClipboardFormatName(format, &FormatName, cchMaxCount); - return Ret; - + UNICODE_STRING FormatName; + ULONG Ret; + + FormatName.Length = 0; + FormatName.MaximumLength = cchMaxCount * sizeof(WCHAR); + FormatName.Buffer = (PWSTR)lpszFormatName; + Ret = NtUserGetClipboardFormatName(format, &FormatName, cchMaxCount); + DPRINT("GetClipboardFormatNameW(%x): returning %S\n", format, lpszFormatName); + return Ret; } /* @@ -198,8 +177,7 @@ INT STDCALL GetPriorityClipboardFormat(UINT *paFormatPriorityList, INT cFormats) { - INT ret = NtUserGetPriorityClipboardFormat(paFormatPriorityList, cFormats); - return ret; + return NtUserGetPriorityClipboardFormat(paFormatPriorityList, cFormats); } /* @@ -208,42 +186,18 @@ BOOL STDCALL IsClipboardFormatAvailable(UINT format) { - BOOL ret = NtUserIsClipboardFormatAvailable(format); - return ret; -} - -/* - * @implemented - */ - - + return NtUserIsClipboardFormatAvailable(format); +} + +/* + * @implemented + */ UINT STDCALL RegisterClipboardFormatA(LPCSTR lpszFormat) { - UINT ret = 0; - UNICODE_STRING usFormat = {0}; - - if (lpszFormat == NULL) - { - SetLastError(ERROR_INVALID_PARAMETER); - return 0; - } - - /* check for "" */ - if (*lpszFormat == 0) //NULL - { - SetLastError(ERROR_INVALID_NAME); - return 0; - } - - ret = RtlCreateUnicodeStringFromAsciiz(&usFormat, lpszFormat); - if (ret) - { - ret = NtUserRegisterClipboardFormat(&usFormat); //(LPCWSTR) - RtlFreeUnicodeString(&usFormat); - } - - return ret; + ULONG Ret = RegisterWindowMessageA(lpszFormat); + DPRINT("RegisterClipboardFormatA(%s) - %x\n", lpszFormat, Ret); + return Ret; } /* @@ -252,48 +206,9 @@ UINT STDCALL RegisterClipboardFormatW(LPCWSTR lpszFormat) { - UINT ret = 0; - UNICODE_STRING usFormat = {0}; - - if (lpszFormat == NULL) - { - SetLastError(ERROR_INVALID_PARAMETER); - return 0; - } - - /* check for "" */ - if (*lpszFormat == 0) //NULL - { - SetLastError(ERROR_INVALID_NAME); - return 0; - } - - RtlInitUnicodeString(&usFormat, lpszFormat); - ret = NtUserRegisterClipboardFormat(&usFormat); - RtlFreeUnicodeString(&usFormat); - - return ret; -} - -HGLOBAL renderLocale (DWORD Locale) -{ - DWORD* pLocale; - HGLOBAL hGlobal; - - hGlobal = GlobalAlloc(GMEM_DDESHARE | GMEM_MOVEABLE, sizeof(DWORD)); - - if(!hGlobal) - { - return hGlobal; - } - - pLocale = (DWORD*)GlobalLock(hGlobal); - - *pLocale = Locale; - - GlobalUnlock(hGlobal); - - return hGlobal; + ULONG Ret = RegisterWindowMessageW(lpszFormat); + DPRINT("RegisterClipboardFormatW(%S) - %x\n", lpszFormat, Ret); + return Ret; } /* @@ -302,41 +217,7 @@ HANDLE STDCALL SetClipboardData(UINT uFormat, HANDLE hMem) { - DWORD size; - LPVOID pMem; - HANDLE ret = NULL; - - if (hMem == NULL) - { - return NtUserSetClipboardData(uFormat, 0, 0); - } - - if (uFormat == CF_BITMAP) - { - /*FIXME: check if hMem is GDI handle - GlobalLock(hMem) fails && GetObject(hMem, 0, NULL) > 0 - */ - return NtUserSetClipboardData(uFormat, hMem, 0); - } - - size = GlobalSize(hMem); - pMem = GlobalLock(hMem); - - if ((pMem) && (size)) - { - DPRINT1("[1]"); - size = GlobalSize(hMem); - ret = NtUserSetClipboardData(uFormat, pMem, size); - //sholud i unlock hMmem? - GlobalUnlock(hMem); - } - else - { - DPRINT1("SetClipboardData fail\n"); - } - - return ret; - + return NtUserSetClipboardData(uFormat, hMem, 0); } /* @@ -356,35 +237,3 @@ { return NtUserChangeClipboardChain(hWndRemove, hWndNewNext); } - -/* - * @unimplemented - */ -BOOL STDCALL -AddClipboardFormatListener(HWND hwnd) -{ - UNIMPLEMENTED; - return FALSE; -} -/* - * @unimplemented - */ -BOOL STDCALL -RemoveClipboardFormatListener(HWND hwnd) -{ - UNIMPLEMENTED; - return FALSE; -} - -/* - * @unimplemented - */ -BOOL STDCALL -GetUpdatedClipboardFormats( - PUINT lpuiFormats, - UINT cFormats, - PUINT pcFormatsOut) -{ - UNIMPLEMENTED; - return FALSE; -} Modified: trunk/reactos/dll/win32/user32/windows/defwnd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/d…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/defwnd.c (original) +++ trunk/reactos/dll/win32/user32/windows/defwnd.c Thu Aug 31 00:40:07 2006 @@ -984,31 +984,7 @@ VOID FASTCALL DefWndScreenshot(HWND hWnd) { - RECT rect; - - OpenClipboard(hWnd); - EmptyClipboard(); - - HDC hdc = GetWindowDC(hWnd); - GetWindowRect(hWnd, &rect); - INT w = rect.right - rect.left; - INT h = rect.bottom - rect.top; - - HBITMAP hbitmap = CreateCompatibleBitmap(hdc, w, h); - HDC hdc2 = CreateCompatibleDC(hdc); - SelectObject(hdc2, hbitmap); - - BitBlt(hdc2, 0, 0, w, h, - hdc, 0, 0, - SRCCOPY); - - SetClipboardData(CF_BITMAP, hbitmap); - - ReleaseDC(hWnd, hdc); - ReleaseDC(hWnd, hdc2); - - CloseClipboard(); - + } LRESULT STDCALL @@ -1378,10 +1354,6 @@ iF10Key = 1; else if( wParam == VK_ESCAPE && (GetKeyState(VK_SHIFT) & 0x8000)) SendMessageW( hWnd, WM_SYSCOMMAND, SC_KEYMENU, ' ' ); - else if (wParam == VK_SNAPSHOT) - { - DefWndScreenshot(GetDesktopWindow()); - } break; } 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 (original) +++ trunk/reactos/dll/win32/user32/windows/input.c Thu Aug 31 00:40:07 2006 @@ -290,12 +290,13 @@ /* - * @implemented + * @unimplemented */ BOOL STDCALL GetLastInputInfo(PLASTINPUTINFO plii) { - return NtUserGetLastInputInfo(plii); + UNIMPLEMENTED; + return FALSE; } Modified: trunk/reactos/regtests/winetests/user32/clipboard.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/regtests/winetests/user32/…
============================================================================== --- trunk/reactos/regtests/winetests/user32/clipboard.c (original) +++ trunk/reactos/regtests/winetests/user32/clipboard.c Thu Aug 31 00:40:07 2006 @@ -18,20 +18,17 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#define _WIN32_WINNT 0x0501 - #include "wine/test.h" #include "windows.h" static BOOL is_win9x = FALSE; -static DWORD sn; /* to test Secuence Number */ #define test_last_error(expected_error) \ do \ { \ if (!is_win9x) \ ok(GetLastError() == expected_error, \ - "Last error should be set to %ld, not %ld\n", \ + "Last error should be set to %d, not %ld\n", \ expected_error, GetLastError()); \ } while (0) @@ -58,12 +55,7 @@ ok(!CloseClipboard(), "CloseClipboard should fail if clipboard wasn't open\n"); test_last_error(ERROR_CLIPBOARD_NOT_OPEN); - SetLastError(0xdeadbeef); ok(OpenClipboard(0), "OpenClipboard failed\n"); - test_last_error((long)0xdeadbeef); - ok(OpenClipboard(0), "OpenClipboard failed\n"); - test_last_error((long)0xdeadbeef); - ok(!GetClipboardOwner(), "clipboard should still be not owned\n"); ok(!OpenClipboard(hWnd1), "OpenClipboard should fail since clipboard already opened\n"); ret = CloseClipboard(); @@ -86,114 +78,15 @@ "OpenClipboard should fail without setting last error value\n"); ret = CloseClipboard(); - ok(ret, "CloseClipboard error %ld\n", GetLastError()); + ok( ret, "CloseClipboard error %ld\n", GetLastError()); ok(GetClipboardOwner() == hWnd1, "clipboard should still be owned\n"); - + ret = DestroyWindow(hWnd1); - ok(ret, "DestroyWindow error %ld\n", GetLastError()); + ok( ret, "DestroyWindow error %ld\n", GetLastError()); ret = DestroyWindow(hWnd2); - ok(ret, "DestroyWindow error %ld\n", GetLastError()); + ok( ret, "DestroyWindow error %ld\n", GetLastError()); SetLastError(0xdeadbeef); ok(!GetClipboardOwner() && GetLastError() == 0xdeadbeef, "clipboard should not be owned\n"); - - hWnd1 = CreateWindowExA(0, "static", NULL, WS_POPUP, - 0, 0, 10, 10, 0, 0, 0, NULL); - ok(hWnd1 != 0, "CreateWindowExA error %ld\n", GetLastError()); - trace("hWnd1 = %p\n", hWnd1); - ok(OpenClipboard(hWnd1), "OpenClipboard failed\n"); - ret = DestroyWindow(hWnd1); - ok(ret, "DestroyWindow error %ld\n", GetLastError()); - ok(OpenClipboard(0), "OpenClipboard should not fail\n"); - ok(CloseClipboard(), "CloseClipboard error %ld\n", GetLastError()); - - DWORD asn = GetClipboardSequenceNumber(); - ok(asn == sn + 2, "GetClipboardSequenceNumber() returns %d, not %d\n", (int)asn, (int)sn + 2); -} - -static void test_EnumClipboardFormats(void) -{ - - SetLastError(0xdeadbeef); - ok(!EnumClipboardFormats(0), "EnumClipboardFormats failed\n"); - test_last_error(ERROR_CLIPBOARD_NOT_OPEN); - - UINT j = 0; - UINT i = 1; - /* - ok( OpenClipboard(NULL), "OpenClipboard error %ld\n", GetLastError()); - ok(!(j = EnumClipboardFormats(0)), "EnumClipboardFormats failed\n"); - while (j!=0) - { - j = EnumClipboardFormats(j); - i++; - } - ok(!(j != CountClipboardFormats()), "EnumClipboardFormats failed\n"); - */ - ok(OpenClipboard(NULL), "OpenClipboard error %ld\n", GetLastError()); - ok(EmptyClipboard(), "EmptyClipboard error %ld\n", GetLastError()); - - WCHAR *s = L"Pedor"; - HGLOBAL hdst = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, 7 * sizeof(WCHAR)); - PCHAR dst = GlobalLock(hdst); - memcpy(dst, s, 6 * sizeof(WCHAR)); - GlobalUnlock(hdst); - - ok(SetClipboardData(CF_UNICODETEXT, hdst) != 0, "SetClipboardData error %ld\n", GetLastError()); - - /* this test is very bogus, depends on data entered, need more test ;) - ok((j = EnumClipboardFormats(0)), "EnumClipboardFormats failed \n"); - while (j!=0) - { - j = EnumClipboardFormats(j); - i++; - } - ok(j != CountClipboardFormats(), "EnumClipboardFormats failed\n"); - - ok(j != 1, "EnumClipboardFormats must be 1\n"); - */ - - ok( CloseClipboard(), "CloseClipboard error %ld\n", GetLastError()); - - ok(OpenClipboard(NULL), "OpenClipboard error %ld\n", GetLastError()); - ok((j = EnumClipboardFormats(0)), "EnumClipboardFormats failed (%ld)\n", GetLastError()); - while (j!=0) - { - j = EnumClipboardFormats(j); - i++; - } - ok(j != CountClipboardFormats(), "EnumClipboardFormats failed\n"); - ok( CloseClipboard(), "CloseClipboard error %ld\n", GetLastError()); - - DWORD asn = GetClipboardSequenceNumber(); - ok(asn == sn + 7, "GetClipboardSequenceNumber() returns %d, not %d\n", (int)asn, (int)sn + 7); - -} - -static void test_Owner(void) -{ - HWND hWnd1; - BOOL ret; - - /* get owner */ - ok(OpenClipboard(0), "OpenClipboard should not fail\n"); - ok(CloseClipboard(), "CloseClipboard error %ld\n", GetLastError()); - hWnd1 = CreateWindowExA(0, "static", NULL, WS_POPUP, - 0, 0, 10, 10, 0, 0, 0, NULL); - ok(hWnd1 != 0, "CreateWindowExA error %ld\n", GetLastError()); - - ok(OpenClipboard(hWnd1), "OpenClipboard failed\n"); - - HGLOBAL hdst = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, 7 * sizeof(WCHAR)); - - ok((int)SetClipboardData(CF_UNICODETEXT, hdst), "SetClipboardData error we can't put data if not be the owner (%ld)\n", GetLastError()); - ok(CloseClipboard(), "CloseClipboard error %ld\n", GetLastError()); - - ret = DestroyWindow(hWnd1); - ok(ret, "DestroyWindow error %ld\n", GetLastError()); - - /* tets secuence number*/ - DWORD asn = GetClipboardSequenceNumber(); - ok(asn == sn + 8, "GetClipboardSequenceNumber() returns %d, not %d\n", (int)asn, (int)sn + 8); } static void test_RegisterClipboardFormatA(void) @@ -204,14 +97,6 @@ int len; BOOL ret; - SetLastError(0xdeadbeef); - ok(!(format_id = RegisterClipboardFormatA(0)), "RegisterClipboardFormat should fail\n"); - test_last_error(ERROR_INVALID_PARAMETER); - - SetLastError(0xdeadbeef); - ok(!(format_id = RegisterClipboardFormatA("")), "RegisterClipboardFormat should fail\n"); - test_last_error(ERROR_INVALID_NAME); - format_id = RegisterClipboardFormatA("my_cool_clipboard_format"); ok(format_id > 0xc000 && format_id < 0xffff, "invalid clipboard format id %04x\n", format_id); @@ -221,11 +106,6 @@ len = GetClipboardFormatNameA(format_id, buf, 256); ok(len == lstrlenA("my_cool_clipboard_format"), "wrong format name length %d\n", len); ok(!lstrcmpA(buf, "my_cool_clipboard_format"), "wrong format name \"%s\"\n", buf); - - WCHAR buf2[256]; - len = GetClipboardFormatNameW(format_id, buf2, 256); - ok(len == lstrlenW(L"my_cool_clipboard_format"), "wrong format name length %d\n", len); - ok(!lstrcmpW(buf2, L"my_cool_clipboard_format"), "wrong format name \"%S\"\n", buf2); lstrcpyA(buf, "foo"); SetLastError(0xdeadbeef); @@ -274,8 +154,6 @@ } #endif - ok(!GetClipboardFormatNameA(1, buf, 256), "GetClipboardFormatNameA should fail\n"); - ret = OpenClipboard(0); ok( ret, "OpenClipboard error %ld\n", GetLastError()); @@ -305,83 +183,7 @@ SetLastError(0xdeadbeef); ok(!EmptyClipboard(), "EmptyClipboard should fail if clipboard wasn't open\n"); test_last_error(ERROR_CLIPBOARD_NOT_OPEN); - - DWORD asn = GetClipboardSequenceNumber(); - ok(asn == sn + 1, "GetClipboardSequenceNumber() returns %d, not %d\n", (int)asn, (int)sn + 1); } - -static void test_RegisterClipboardFormatW(void) -{ - ATOM atom_id; - UINT format_id, format_id2; - WCHAR buf[256]; - int len; - BOOL ret; - - SetLastError(0xdeadbeef); - ok(!(format_id = RegisterClipboardFormatW(0)), "RegisterClipboardFormatW should fail\n"); - test_last_error(ERROR_INVALID_PARAMETER); - - SetLastError(0xdeadbeef); - ok(!(format_id = RegisterClipboardFormatW(L"")), "RegisterClipboardFormatW should fail\n"); - test_last_error(ERROR_INVALID_NAME); - - format_id = RegisterClipboardFormatW(L"my_cool_clipboard_format"); - ok(format_id > 0xc000 && format_id < 0xffff, "invalid clipboard format id %04x\n", format_id); - - format_id2 = RegisterClipboardFormatW(L"MY_COOL_CLIPBOARD_FORMAT"); - ok(format_id2 == format_id, "invalid clipboard format id %04x\n", format_id2); - - len = GetClipboardFormatNameW(format_id, buf, 256); - ok(len == lstrlenW(L"my_cool_clipboard_format"), "wrong format name length %d\n", len); - ok(!lstrcmpW(buf, L"my_cool_clipboard_format"), "wrong format name \"%S\"\n", buf); - - lstrcpyW(buf, L"foo"); - SetLastError(0xdeadbeef); - len = GetAtomNameW((ATOM)format_id, buf, 256); - ok(len == 0, "GetAtomNameA should fail\n"); - test_last_error(ERROR_INVALID_HANDLE); - - - lstrcpyW(buf, L"foo"); - SetLastError(0xdeadbeef); - len = GlobalGetAtomNameW((ATOM)format_id, buf, 256); - ok(len == 0, "GlobalGetAtomNameA should fail\n"); - test_last_error(ERROR_INVALID_HANDLE); - - SetLastError(0xdeadbeef); - atom_id = FindAtomW(L"my_cool_clipboard_format"); - ok(atom_id == 0, "FindAtomA should fail\n"); - test_last_error(ERROR_FILE_NOT_FOUND); - - ok(!GetClipboardFormatNameW(1, buf, 256), "GetClipboardFormatNameA should fail\n"); - - ret = OpenClipboard(0); - ok( ret, "OpenClipboard error %ld\n", GetLastError()); - - trace("# of formats available: %d\n", CountClipboardFormats()); - - format_id = 0; - while ((format_id = EnumClipboardFormats(format_id))) - { - ok(IsClipboardFormatAvailable(format_id), "format %04x was listed as available\n", format_id); - len = GetClipboardFormatNameW(format_id, buf, 256); - trace("%04x: %S\n", format_id, len ? buf : L""); - } - - ret = EmptyClipboard(); - ok(ret, "EmptyClipboard error %ld\n", GetLastError()); - ret = CloseClipboard(); - ok(ret, "CloseClipboard error %ld\n", GetLastError()); - - SetLastError(0xdeadbeef); - ok(!EmptyClipboard(), "EmptyClipboard should fail if clipboard wasn't open\n"); - test_last_error(ERROR_CLIPBOARD_NOT_OPEN); - - DWORD asn = GetClipboardSequenceNumber(); - ok(asn == sn + 9, "GetClipboardSequenceNumber() returns %d, not %d\n", (int)asn, (int)sn + 9); -} - START_TEST(clipboard) { @@ -389,16 +191,6 @@ FindAtomW(NULL); if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) is_win9x = TRUE; - sn = GetClipboardSequenceNumber(); - trace("Current Secuence Number: %d\n", (int)sn); - test_RegisterClipboardFormatA(); test_ClipboardOwner(); - test_EnumClipboardFormats(); - test_Owner(); - test_RegisterClipboardFormatW(); - - /* - ok(0, "GetClipboardSequenceNumber() returns 0x%x\n", GetClipboardSequenceNumber()); - */ }
18 years, 3 months
1
0
0
0
[hpoussin] 23822: mpr.dll can now be autosynced with Wine
by hpoussin@svn.reactos.org
Author: hpoussin Date: Thu Aug 31 00:37:56 2006 New Revision: 23822 URL:
http://svn.reactos.org/svn/reactos?rev=23822&view=rev
Log: mpr.dll can now be autosynced with Wine Added: trunk/reactos/dll/win32/mpr/mpr_ros.diff (with props) Removed: trunk/reactos/dll/win32/mpr/Makefile.in Modified: trunk/reactos/media/doc/README.WINE Removed: trunk/reactos/dll/win32/mpr/Makefile.in URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mpr/Makefile.in?…
============================================================================== --- trunk/reactos/dll/win32/mpr/Makefile.in (original) +++ trunk/reactos/dll/win32/mpr/Makefile.in (removed) @@ -1,22 +1,0 @@ -TOPSRCDIR = @top_srcdir@ -TOPOBJDIR = ../.. -SRCDIR = @srcdir@ -VPATH = @srcdir@ -MODULE = mpr.dll -IMPORTLIB = libmpr.$(IMPLIBEXT) -IMPORTS = user32 advapi32 kernel32 -EXTRALIBS = $(LIBUNICODE) - -C_SRCS = \ - auth.c \ - mpr_main.c \ - multinet.c \ - nps.c \ - pwcache.c \ - wnet.c - -RC_SRCS = mpr.rc - -@MAKE_DLL_RULES@ - -### Dependencies: Added: trunk/reactos/dll/win32/mpr/mpr_ros.diff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mpr/mpr_ros.diff…
============================================================================== --- trunk/reactos/dll/win32/mpr/mpr_ros.diff (added) +++ trunk/reactos/dll/win32/mpr/mpr_ros.diff Thu Aug 31 00:37:56 2006 @@ -1,0 +1,165 @@ +Index: mpr.rc +=================================================================== +--- mpr.rc (revision 23782) ++++ mpr.rc (working copy) +@@ -38,4 +38,7 @@ + #include "mpr_Nl.rc" + #include "mpr_No.rc" + #include "mpr_Pt.rc" ++#include "mpr_Ru.rc" ++#include "mpr_Sv.rc" + #include "mpr_Tr.rc" ++#include "mpr_Uk.rc" +Index: mpr_Ru.rc +=================================================================== +--- mpr_Ru.rc (revision 23782) ++++ mpr_Ru.rc (working copy) +@@ -0,0 +1,46 @@ ++/* ++ * MPR dll resources ++ * ++ * Copyright (C) 2005 Mikhail Y. Zvyozdochkin ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT ++ ++STRINGTABLE DISCARDABLE ++{ ++ IDS_ENTIRENETWORK "Âñÿ ñåòü" ++} ++ ++IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 ++STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU ++CAPTION "Ââåäèòå Ñåòåâîé Ïàðîëü" ++FONT 8, "MS Shell Dlg" ++{ ++ LTEXT "Ïîæàëóéñòà, ââåäèòå Âàøè èìÿ è ïàðîëü:", IDC_EXPLAIN, 40, 6, 150, 15 ++ LTEXT "Ïðîêñè-ñåðâåð", -1, 40, 26, 50, 10 ++/* LTEXT "Realm", -1, 40, 46, 50, 10 */ ++ LTEXT "Èìÿ ïîëüçîâàòåëÿ", -1, 40, 66, 50, 10 ++ LTEXT "Ïàðîëü", -1, 40, 86, 50, 10 ++ LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0 ++ LTEXT "" IDC_REALM, 80, 46, 150, 14, 0 ++ EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP ++ EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD ++ CHECKBOX "&Ñîõðàíèòü ïàðîëü (íåáåçîïàñíî)", IDC_SAVEPASSWORD, ++ 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP ++ PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON ++ PUSHBUTTON "Îòìåíà", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP ++} +Index: mpr_Sv.rc +=================================================================== +--- mpr_Sv.rc (revision 23782) ++++ mpr_Sv.rc (working copy) +@@ -0,0 +1,46 @@ ++/* ++ * MPR dll Swedish resources ++ * ++ * Copyright (C) 2005 Andreas Bjerkeholt ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT ++ ++STRINGTABLE DISCARDABLE ++{ ++ IDS_ENTIRENETWORK "Hela nätverket" ++} ++ ++IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 ++STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU ++CAPTION "Ange nätverkslösenord" ++FONT 8, "MS Shell Dlg" ++{ ++ LTEXT "Ange ditt användarnamn och lösenord:", IDC_EXPLAIN, 40, 6, 150, 15 ++ LTEXT "Proxy", -1, 40, 26, 50, 10 ++/* LTEXT "Realm", -1, 40, 46, 50, 10 */ ++ LTEXT "Användare", -1, 40, 66, 50, 10 ++ LTEXT "Lösenord", -1, 40, 86, 50, 10 ++ LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0 ++ LTEXT "" IDC_REALM, 80, 46, 150, 14, 0 ++ EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP ++ EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD ++ CHECKBOX "&Spara detta lösenord (Osäkert)", IDC_SAVEPASSWORD, ++ 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP ++ PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON ++ PUSHBUTTON "Avbryt", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP ++} +Index: mpr_Uk.rc +=================================================================== +--- mpr_Uk.rc (revision 23782) ++++ mpr_Uk.rc (working copy) +@@ -0,0 +1,46 @@ ++/* ++ * MPR dll resources (Ukrainian) ++ * ++ * Copyright 2006 Artem Reznikov ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT ++ ++STRINGTABLE DISCARDABLE ++{ ++ IDS_ENTIRENETWORK "Âñÿ Ìåðåæà" ++} ++ ++IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 ++STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU ++CAPTION "Ââåä³òü Ìåðåæíèé Ïàðîëü" ++FONT 8, "MS Shell Dlg" ++{ ++ LTEXT "Áóäü ëàñêà, ââåä³òü Âàø³ ³ì'ÿ òà ïàðîëü:", IDC_EXPLAIN, 40, 6, 150, 15 ++ LTEXT "Ïðîêñ³", -1, 40, 26, 50, 10 ++/* LTEXT "Realm", -1, 40, 46, 50, 10 */ ++ LTEXT "Êîðèñòóâà÷", -1, 40, 66, 50, 10 ++ LTEXT "Ïàðîëü", -1, 40, 86, 50, 10 ++ LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0 ++ LTEXT "" IDC_REALM, 80, 46, 150, 14, 0 ++ EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP ++ EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD ++ CHECKBOX "&Çáåðåãòè öåé ïàðîëü (íåáåçïå÷íî)", IDC_SAVEPASSWORD, ++ 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP ++ PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON ++ PUSHBUTTON "Ñêàñóâàòè", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP ++} Propchange: trunk/reactos/dll/win32/mpr/mpr_ros.diff ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE (original) +++ trunk/reactos/media/doc/README.WINE Thu Aug 31 00:37:56 2006 @@ -51,7 +51,7 @@ reactos/dll/win32/lz32 # Autosync reactos/dll/win32/mapi32 # Autosync reactos/dll/win32/msvcrt20 # Out of sync -reactos/dll/win32/mpr # Synced to Wine-0_9_5 +reactos/dll/win32/mpr # Autosync reactos/dll/win32/msacm # Out of sync reactos/dll/win32/msimg32 # Autosync reactos/dll/win32/msi # Autosync
18 years, 3 months
1
0
0
0
[gedmurphy] 23821: update msi wine regtest
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Thu Aug 31 00:37:49 2006 New Revision: 23821 URL:
http://svn.reactos.org/svn/reactos?rev=23821&view=rev
Log: update msi wine regtest Modified: trunk/reactos/regtests/winetests/msi/db.c trunk/reactos/regtests/winetests/msi/format.c trunk/reactos/regtests/winetests/msi/install.c trunk/reactos/regtests/winetests/msi/package.c Modified: trunk/reactos/regtests/winetests/msi/db.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/regtests/winetests/msi/db.…
============================================================================== --- trunk/reactos/regtests/winetests/msi/db.c (original) +++ trunk/reactos/regtests/winetests/msi/db.c Thu Aug 31 00:37:49 2006 @@ -458,7 +458,7 @@ ok(r == TRUE, "file didn't exist after commit\n"); } -static UINT run_query( MSIHANDLE hdb, const char *query ) +static UINT run_query( MSIHANDLE hdb, MSIHANDLE hrec, const char *query ) { MSIHANDLE hview = 0; UINT r; @@ -467,7 +467,7 @@ if( r != ERROR_SUCCESS ) return r; - r = MsiViewExecute(hview, 0); + r = MsiViewExecute(hview, hrec); if( r == ERROR_SUCCESS ) r = MsiViewClose(hview); MsiCloseHandle(hview); @@ -491,7 +491,7 @@ query = "CREATE TABLE `phone` ( " "`id` INT, `name` CHAR(32), `number` CHAR(32) " "PRIMARY KEY `id`)"; - r = run_query( hdb, query ); + r = run_query( hdb, 0, query ); ok(r == ERROR_SUCCESS, "query failed\n"); /* check what the error function reports without doing anything */ @@ -718,7 +718,7 @@ return type; } -static BOOL check_record( MSIHANDLE rec, UINT field, LPSTR val ) +static BOOL check_record( MSIHANDLE rec, UINT field, LPCSTR val ) { CHAR buffer[0x20]; UINT r; @@ -737,7 +737,7 @@ hdb = create_db(); ok( hdb, "failed to create db\n"); - r = run_query( hdb, + r = run_query( hdb, 0, "CREATE TABLE `Properties` " "( `Property` CHAR(255), `Value` CHAR(1) PRIMARY KEY `Property`)" ); ok( r == ERROR_SUCCESS , "Failed to create table\n" ); @@ -764,7 +764,7 @@ MsiCloseHandle( rec ); - r = run_query( hdb, + r = run_query( hdb, 0, "CREATE TABLE `Binary` " "( `Name` CHAR(255), `Data` OBJECT PRIMARY KEY `Name`)" ); ok( r == ERROR_SUCCESS , "Failed to create table\n" ); @@ -790,7 +790,7 @@ ok( check_record( rec, 2, "Data"), "wrong record type\n"); MsiCloseHandle( rec ); - r = run_query( hdb, + r = run_query( hdb, 0, "CREATE TABLE `UIText` " "( `Key` CHAR(72) NOT NULL, `Text` CHAR(255) LOCALIZABLE PRIMARY KEY `Key`)" ); ok( r == ERROR_SUCCESS , "Failed to create table\n" ); @@ -958,7 +958,7 @@ hdb = create_db(); ok( hdb, "failed to create db\n"); - r = run_query( hdb, + r = run_query( hdb, 0, "CREATE TABLE `Properties` " "( `Property` CHAR(255), `Value` CHAR(1) PRIMARY KEY `Property`)" ); ok( r == ERROR_SUCCESS , "Failed to create table\n" ); @@ -997,7 +997,7 @@ hdb = create_db(); ok( hdb, "failed to create db\n"); - r = run_query( hdb, + r = run_query( hdb, 0, "CREATE TABLE `Media` (" "`DiskId` SHORT NOT NULL, " "`LastSequence` LONG, " @@ -1008,17 +1008,17 @@ "PRIMARY KEY `DiskId`)" ); ok( r == S_OK, "cannot create Media table: %d\n", r ); - r = run_query( hdb, "INSERT INTO `Media` " + r = run_query( hdb, 0, "INSERT INTO `Media` " "( `DiskId`, `LastSequence`, `DiskPrompt`, `Cabinet`, `VolumeLabel`, `Source` ) " "VALUES ( 1, 0, '', 'zero.cab', '', '' )" ); ok( r == S_OK, "cannot add file to the Media table: %d\n", r ); - r = run_query( hdb, "INSERT INTO `Media` " + r = run_query( hdb, 0, "INSERT INTO `Media` " "( `DiskId`, `LastSequence`, `DiskPrompt`, `Cabinet`, `VolumeLabel`, `Source` ) " "VALUES ( 2, 1, '', 'one.cab', '', '' )" ); ok( r == S_OK, "cannot add file to the Media table: %d\n", r ); - r = run_query( hdb, "INSERT INTO `Media` " + r = run_query( hdb, 0, "INSERT INTO `Media` " "( `DiskId`, `LastSequence`, `DiskPrompt`, `Cabinet`, `VolumeLabel`, `Source` ) " "VALUES ( 3, 2, '', 'two.cab', '', '' )" ); ok( r == S_OK, "cannot add file to the Media table: %d\n", r ); @@ -1043,6 +1043,320 @@ MsiCloseHandle( hdb ); DeleteFile(msifile); +} + +static CHAR CURR_DIR[MAX_PATH]; + +static const CHAR test_data[] = "FirstPrimaryColumn\tSecondPrimaryColumn\tShortInt\tShortIntNullable\tLongInt\tLongIntNullable\tString\tLocalizableString\tLocalizableStringNullable\n" + "s255\ti2\ti2\tI2\ti4\tI4\tS255\tS0\ts0\n" + "TestTable\tFirstPrimaryColumn\n" + "stringage\t5\t2\t\t2147483640\t-2147483640\tanother string\tlocalizable\tduh\n"; + +static void write_file(const CHAR *filename, const char *data, int data_size) +{ + DWORD size; + + HANDLE hf = CreateFile(filename, GENERIC_WRITE, 0, NULL, + CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + + WriteFile(hf, data, data_size, &size, NULL); + CloseHandle(hf); +} + +static UINT add_table_to_db(MSIHANDLE hdb, LPCSTR table_data) +{ + UINT r; + + write_file("temp_file", table_data, (lstrlen(table_data) - 1) * sizeof(char)); + r = MsiDatabaseImportA(hdb, CURR_DIR, "temp_file"); + DeleteFileA("temp_file"); + + return r; +} + +static void test_msiimport(void) +{ + MSIHANDLE hdb, view, rec; + LPCSTR query; + UINT r, count; + signed int i; + + GetCurrentDirectoryA(MAX_PATH, CURR_DIR); + + r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + r = add_table_to_db(hdb, test_data); + todo_wine + { + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + } + + query = "SELECT * FROM `TestTable`"; + r = MsiDatabaseOpenView(hdb, query, &view); + todo_wine + { + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + } + + r = MsiViewGetColumnInfo(view, MSICOLINFO_NAMES, &rec); + count = MsiRecordGetFieldCount(rec); + todo_wine + { + ok(count == 9, "Expected 9, got %d\n", count); + ok(check_record(rec, 1, "FirstPrimaryColumn"), "Expected FirstPrimaryColumn\n"); + ok(check_record(rec, 2, "SecondPrimaryColumn"), "Expected SecondPrimaryColumn\n"); + ok(check_record(rec, 3, "ShortInt"), "Expected ShortInt\n"); + ok(check_record(rec, 4, "ShortIntNullable"), "Expected ShortIntNullalble\n"); + ok(check_record(rec, 5, "LongInt"), "Expected LongInt\n"); + ok(check_record(rec, 6, "LongIntNullable"), "Expected LongIntNullalble\n"); + ok(check_record(rec, 7, "String"), "Expected String\n"); + ok(check_record(rec, 8, "LocalizableString"), "Expected LocalizableString\n"); + ok(check_record(rec, 9, "LocalizableStringNullable"), "Expected LocalizableStringNullable\n"); + } + + r = MsiViewGetColumnInfo(view, MSICOLINFO_TYPES, &rec); + count = MsiRecordGetFieldCount(rec); + todo_wine + { + ok(count == 9, "Expected 9, got %d\n", count); + ok(check_record(rec, 1, "s255"), "Expected s255\n"); + ok(check_record(rec, 2, "i2"), "Expected i2\n"); + ok(check_record(rec, 3, "i2"), "Expected i2\n"); + ok(check_record(rec, 4, "I2"), "Expected I2\n"); + ok(check_record(rec, 5, "i4"), "Expected i4\n"); + ok(check_record(rec, 6, "I4"), "Expected I4\n"); + ok(check_record(rec, 7, "S255"), "Expected S255\n"); + ok(check_record(rec, 8, "S0"), "Expected S0\n"); + ok(check_record(rec, 9, "s0"), "Expected s0\n"); + } + + query = "SELECT * FROM `TestTable`"; + r = do_query(hdb, query, &rec); + todo_wine + { + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + } + + todo_wine + { + ok(check_record(rec, 1, "stringage"), "Expected 'stringage'\n"); + ok(check_record(rec, 7, "another string"), "Expected 'another string'\n"); + ok(check_record(rec, 8, "localizable"), "Expected 'localizable'\n"); + ok(check_record(rec, 9, "duh"), "Expected 'duh'\n"); + } + + i = MsiRecordGetInteger(rec, 2); + todo_wine + { + ok(i == 5, "Expected 5, got %d\n", i); + } + + i = MsiRecordGetInteger(rec, 3); + todo_wine + { + ok(i == 2, "Expected 2, got %d\n", i); + } + + i = MsiRecordGetInteger(rec, 4); + ok(i == 0x80000000, "Expected 0x80000000, got %d\n", i); + + i = MsiRecordGetInteger(rec, 5); + todo_wine + { + ok(i == 2147483640, "Expected 2147483640, got %d\n", i); + } + + i = MsiRecordGetInteger(rec, 6); + todo_wine + { + ok(i == -2147483640, "Expected -2147483640, got %d\n", i); + } + + MsiCloseHandle(rec); + MsiCloseHandle(view); + MsiCloseHandle(hdb); + DeleteFileA(msifile); +} + +static void test_markers(void) +{ + MSIHANDLE hdb, rec; + LPCSTR query; + UINT r; + + hdb = create_db(); + ok( hdb, "failed to create db\n"); + + rec = MsiCreateRecord(3); + MsiRecordSetString(rec, 1, "Table"); + MsiRecordSetString(rec, 2, "Apples"); + MsiRecordSetString(rec, 3, "Oranges"); + + /* try a legit create */ + query = "CREATE TABLE `Table` ( `One` SHORT NOT NULL, `Two` CHAR(255) PRIMARY KEY `One`)"; + r = run_query(hdb, 0, query); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + MsiCloseHandle(rec); + + /* try table name as marker */ + rec = MsiCreateRecord(1); + MsiRecordSetString(rec, 1, "Fable"); + query = "CREATE TABLE `?` ( `One` SHORT NOT NULL, `Two` CHAR(255) PRIMARY KEY `One`)"; + r = run_query(hdb, rec, query); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + /* try table name as marker without backticks */ + MsiRecordSetString(rec, 1, "Mable"); + query = "CREATE TABLE ? ( `One` SHORT NOT NULL, `Two` CHAR(255) PRIMARY KEY `One`)"; + r = run_query(hdb, rec, query); + ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); + + /* try one column name as marker */ + MsiRecordSetString(rec, 1, "One"); + query = "CREATE TABLE `Mable` ( `?` SHORT NOT NULL, `Two` CHAR(255) PRIMARY KEY `One`)"; + r = run_query(hdb, rec, query); + ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); + + /* try column names as markers */ + MsiCloseHandle(rec); + rec = MsiCreateRecord(2); + MsiRecordSetString(rec, 1, "One"); + MsiRecordSetString(rec, 2, "Two"); + query = "CREATE TABLE `Mable` ( `?` SHORT NOT NULL, `?` CHAR(255) PRIMARY KEY `One`)"; + r = run_query(hdb, rec, query); + ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); + + /* try names with backticks */ + MsiCloseHandle(rec); + rec = MsiCreateRecord(3); + MsiRecordSetString(rec, 1, "One"); + MsiRecordSetString(rec, 2, "Two"); + MsiRecordSetString(rec, 3, "One"); + query = "CREATE TABLE `Mable` ( `?` SHORT NOT NULL, `?` CHAR(255) PRIMARY KEY `?`)"; + r = run_query(hdb, rec, query); + todo_wine + { + ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); + } + + /* try names with backticks, minus definitions */ + query = "CREATE TABLE `Mable` ( `?`, `?` PRIMARY KEY `?`)"; + r = run_query(hdb, rec, query); + ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); + + /* try names without backticks */ + query = "CREATE TABLE `Mable` ( ? SHORT NOT NULL, ? CHAR(255) PRIMARY KEY ?)"; + r = run_query(hdb, rec, query); + ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); + + /* try one long marker */ + MsiCloseHandle(rec); + rec = MsiCreateRecord(1); + MsiRecordSetString(rec, 1, "`One` SHORT NOT NULL, `Two` CHAR(255) PRIMARY KEY `One`"); + query = "CREATE TABLE `Mable` ( ? )"; + r = run_query(hdb, rec, query); + ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); + + /* try all names as markers */ + MsiCloseHandle(rec); + rec = MsiCreateRecord(4); + MsiRecordSetString(rec, 1, "Mable"); + MsiRecordSetString(rec, 2, "One"); + MsiRecordSetString(rec, 3, "Two"); + MsiRecordSetString(rec, 4, "One"); + query = "CREATE TABLE `?` ( `?` SHORT NOT NULL, `?` CHAR(255) PRIMARY KEY `?`)"; + r = run_query(hdb, rec, query); + ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); + + /* try a legit insert */ + query = "INSERT INTO `Table` ( `One`, `Two` ) VALUES ( 5, 'hello' )"; + r = run_query(hdb, 0, query); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + /* try values as markers */ + MsiCloseHandle(rec); + rec = MsiCreateRecord(2); + MsiRecordSetInteger(rec, 1, 4); + MsiRecordSetString(rec, 2, "hi"); + query = "INSERT INTO `Table` ( `One`, `Two` ) VALUES ( ?, '?' )"; + r = run_query(hdb, rec, query); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + /* try column names and values as markers */ + MsiCloseHandle(rec); + rec = MsiCreateRecord(4); + MsiRecordSetString(rec, 1, "One"); + MsiRecordSetString(rec, 2, "Two"); + MsiRecordSetInteger(rec, 3, 5); + MsiRecordSetString(rec, 4, "hi"); + query = "INSERT INTO `Table` ( `?`, `?` ) VALUES ( ?, '?' )"; + r = run_query(hdb, rec, query); + ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); + + /* try column names as markers */ + MsiCloseHandle(rec); + rec = MsiCreateRecord(2); + MsiRecordSetString(rec, 1, "One"); + MsiRecordSetString(rec, 2, "Two"); + query = "INSERT INTO `Table` ( `?`, `?` ) VALUES ( 3, 'yellow' )"; + r = run_query(hdb, rec, query); + ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); + + /* try table name as a marker */ + MsiCloseHandle(rec); + rec = MsiCreateRecord(1); + MsiRecordSetString(rec, 1, "Table"); + query = "INSERT INTO `?` ( `One`, `Two` ) VALUES ( 2, 'green' )"; + r = run_query(hdb, rec, query); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + /* try table name and values as markers */ + MsiCloseHandle(rec); + rec = MsiCreateRecord(3); + MsiRecordSetString(rec, 1, "Table"); + MsiRecordSetInteger(rec, 2, 10); + MsiRecordSetString(rec, 3, "haha"); + query = "INSERT INTO `?` ( `One`, `Two` ) VALUES ( ?, '?' )"; + r = run_query(hdb, rec, query); + todo_wine + { + ok(r == ERROR_FUNCTION_FAILED, "Expected ERROR_FUNCTION_FAILED, got %d\n", r); + } + + /* try all markers */ + MsiCloseHandle(rec); + rec = MsiCreateRecord(5); + MsiRecordSetString(rec, 1, "Table"); + MsiRecordSetString(rec, 1, "One"); + MsiRecordSetString(rec, 1, "Two"); + MsiRecordSetInteger(rec, 2, 10); + MsiRecordSetString(rec, 3, "haha"); + query = "INSERT INTO `?` ( `?`, `?` ) VALUES ( ?, '?' )"; + r = run_query(hdb, rec, query); + ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); + + /* insert an integer as a string */ + MsiCloseHandle(rec); + rec = MsiCreateRecord(2); + MsiRecordSetString(rec, 1, "11"); + MsiRecordSetString(rec, 2, "hi"); + query = "INSERT INTO `Table` ( `One`, `Two` ) VALUES ( ?, '?' )"; + r = run_query(hdb, rec, query); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + /* leave off the '' for the string */ + MsiCloseHandle(rec); + rec = MsiCreateRecord(2); + MsiRecordSetInteger(rec, 1, 12); + MsiRecordSetString(rec, 2, "hi"); + query = "INSERT INTO `Table` ( `One`, `Two` ) VALUES ( ?, ? )"; + r = run_query(hdb, rec, query); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + MsiCloseHandle(rec); + + MsiCloseHandle(hdb); + DeleteFileA(msifile); } START_TEST(db) @@ -1058,4 +1372,6 @@ test_longstrings(); test_streamtable(); test_where(); -} + test_msiimport(); + test_markers(); +} Modified: trunk/reactos/regtests/winetests/msi/format.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/regtests/winetests/msi/for…
============================================================================== --- trunk/reactos/regtests/winetests/msi/format.c (original) +++ trunk/reactos/regtests/winetests/msi/format.c Thu Aug 31 00:37:49 2006 @@ -1361,9 +1361,35 @@ DeleteFile( filename ); } +static void test_processmessage(void) +{ + static const CHAR filename[] = "winetest.msi"; + MSIHANDLE hrec; + MSIHANDLE package; + int r; + + package = helper_createpackage( filename ); + ok(package!=0, "Unable to create package\n"); + + hrec = MsiCreateRecord(3); + ok( hrec, "failed to create record\n"); + + r = MsiRecordSetString(hrec, 1, ""); + ok( r == ERROR_SUCCESS, "set string failed\n"); + + r = MsiProcessMessage(package, INSTALLMESSAGE_ACTIONSTART, hrec); + ok( r == IDOK, "expected IDOK, got %i\n", r); + + MsiCloseHandle(hrec); + MsiCloseHandle(package); + + DeleteFile(filename); +} + START_TEST(format) { test_createpackage(); test_formatrecord(); test_formatrecord_package(); + test_processmessage(); } Modified: trunk/reactos/regtests/winetests/msi/install.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/regtests/winetests/msi/ins…
============================================================================== --- trunk/reactos/regtests/winetests/msi/install.c (original) +++ trunk/reactos/regtests/winetests/msi/install.c Thu Aug 31 00:37:49 2006 @@ -317,7 +317,7 @@ return 0; } -static BOOL check_record(MSIHANDLE rec, UINT field, LPSTR val) +static BOOL check_record(MSIHANDLE rec, UINT field, LPCSTR val) { CHAR buffer[0x20]; UINT r; @@ -404,6 +404,8 @@ CCAB cabParams; HFCI hfci; ERF erf; + static CHAR four_txt[] = "four.txt", + five_txt[] = "five.txt"; BOOL res; set_cab_parameters(&cabParams, name); @@ -414,8 +416,8 @@ ok(hfci != NULL, "Failed to create an FCI context\n"); - add_file(hfci, "four.txt"); - add_file(hfci, "five.txt"); + add_file(hfci, four_txt); + add_file(hfci, five_txt); res = FCIFlushCabinet(hfci, FALSE, get_next_cabinet, progress); ok(res, "Failed to flush the cabinet\n"); @@ -695,7 +697,7 @@ { MSIHANDLE hdb, view, rec; char path[MAX_PATH]; - LPSTR query; + LPCSTR query; UINT r, count; CoInitialize(NULL); Modified: trunk/reactos/regtests/winetests/msi/package.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/regtests/winetests/msi/pac…
============================================================================== --- trunk/reactos/regtests/winetests/msi/package.c (original) +++ trunk/reactos/regtests/winetests/msi/package.c Thu Aug 31 00:37:49 2006 @@ -99,7 +99,56 @@ "PRIMARY KEY `File`)" ); } -static UINT add_component_entry( MSIHANDLE hdb, char *values ) +static UINT create_remove_file_table( MSIHANDLE hdb ) +{ + return run_query( hdb, + "CREATE TABLE `RemoveFile` (" + "`FileKey` CHAR(72) NOT NULL, " + "`Component_` CHAR(72) NOT NULL, " + "`FileName` CHAR(255) LOCALIZABLE, " + "`DirProperty` CHAR(72) NOT NULL, " + "`InstallMode` SHORT NOT NULL " + "PRIMARY KEY `FileKey`)" ); +} + +static UINT create_appsearch_table( MSIHANDLE hdb ) +{ + return run_query( hdb, + "CREATE TABLE `AppSearch` (" + "`Property` CHAR(72) NOT NULL, " + "`Signature_` CHAR(72) NOT NULL " + "PRIMARY KEY `Property`, `Signature_`)" ); +} + +static UINT create_reglocator_table( MSIHANDLE hdb ) +{ + return run_query( hdb, + "CREATE TABLE `RegLocator` (" + "`Signature_` CHAR(72) NOT NULL, " + "`Root` SHORT NOT NULL, " + "`Key` CHAR(255) NOT NULL, " + "`Name` CHAR(255), " + "`Type` SHORT " + "PRIMARY KEY `Signature_`)" ); +} + +static UINT create_signature_table( MSIHANDLE hdb ) +{ + return run_query( hdb, + "CREATE TABLE `Signature` (" + "`Signature` CHAR(72) NOT NULL, " + "`FileName` CHAR(255) NOT NULL, " + "`MinVersion` CHAR(20), " + "`MaxVersion` CHAR(20), " + "`MinSize` LONG, " + "`MaxSize` LONG, " + "`MinDate` LONG, " + "`MaxDate` LONG, " + "`Languages` CHAR(255) " + "PRIMARY KEY `Signature`)" ); +} + +static UINT add_component_entry( MSIHANDLE hdb, const char *values ) { char insert[] = "INSERT INTO `Component` " "(`Component`, `ComponentId`, `Directory_`, `Attributes`, `Condition`, `KeyPath`) " @@ -115,10 +164,10 @@ return r; } -static UINT add_feature_entry( MSIHANDLE hdb, char *values ) +static UINT add_feature_entry( MSIHANDLE hdb, const char *values ) { char insert[] = "INSERT INTO `Feature` (`Feature`, `Feature_Parent`, " - "`Display`, `Level`, `Attributes`) VALUES( %s )"; + "`Title`, `Description`, `Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )"; char *query; UINT sz, r; @@ -130,7 +179,7 @@ return r; } -static UINT add_feature_components_entry( MSIHANDLE hdb, char *values ) +static UINT add_feature_components_entry( MSIHANDLE hdb, const char *values ) { char insert[] = "INSERT INTO `FeatureComponents` " "(`Feature_`, `Component_`) " @@ -146,10 +195,59 @@ return r; } -static UINT add_file_entry( MSIHANDLE hdb, char *values ) +static UINT add_file_entry( MSIHANDLE hdb, const char *values ) { char insert[] = "INSERT INTO `File` " "(`File`, `Component_`, `FileName`, `FileSize`, `Version`, `Language`, `Attributes`, `Sequence`) " + "VALUES( %s )"; + char *query; + UINT sz, r; + + sz = strlen(values) + sizeof insert; + query = HeapAlloc(GetProcessHeap(),0,sz); + sprintf(query,insert,values); + r = run_query( hdb, query ); + HeapFree(GetProcessHeap(), 0, query); + return r; +} + +static UINT add_appsearch_entry( MSIHANDLE hdb, const char *values ) +{ + char insert[] = "INSERT INTO `AppSearch` " + "(`Property`, `Signature_`) " + "VALUES( %s )"; + char *query; + UINT sz, r; + + sz = strlen(values) + sizeof insert; + query = HeapAlloc(GetProcessHeap(),0,sz); + sprintf(query,insert,values); + r = run_query( hdb, query ); + HeapFree(GetProcessHeap(), 0, query); + return r; +} + +static UINT add_reglocator_entry( MSIHANDLE hdb, const char *values ) +{ + char insert[] = "INSERT INTO `RegLocator` " + "(`Signature_`, `Root`, `Key`, `Name`, `Type`) " + "VALUES( %s )"; + char *query; + UINT sz, r; + + sz = strlen(values) + sizeof insert; + query = HeapAlloc(GetProcessHeap(),0,sz); + sprintf(query,insert,values); + r = run_query( hdb, query ); + HeapFree(GetProcessHeap(), 0, query); + return r; +} + +static UINT add_signature_entry( MSIHANDLE hdb, const char *values ) +{ + char insert[] = "INSERT INTO `Signature` " + "(`Signature`, `FileName`, `MinVersion`, `MaxVersion`," + " `MinSize`, `MaxSize`, `MinDate`, `MaxDate`, `Languages`) " "VALUES( %s )"; char *query; UINT sz, r; @@ -252,6 +350,18 @@ return hPackage; } +static void create_test_file(const CHAR *name) +{ + HANDLE file; + DWORD written; + + file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); + ok(file != INVALID_HANDLE_VALUE, "Failure to open file %s\n", name); + WriteFile(file, name, strlen(name), &written, NULL); + WriteFile(file, "\n", strlen("\n"), &written, NULL); + CloseHandle(file); +} + static void test_createpackage(void) { MSIHANDLE hPackage = 0; @@ -292,7 +402,7 @@ ok( r == ERROR_INVALID_HANDLE, "return value wrong\n"); } -static UINT add_directory_entry( MSIHANDLE hdb, char *values ) +static UINT add_directory_entry( MSIHANDLE hdb, const char *values ) { char insert[] = "INSERT INTO `Directory` (`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )"; char *query; @@ -335,7 +445,7 @@ /* another test but try create a directory this time */ hdb = create_package_db(); ok( hdb, "failed to create database\n"); - + r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'"); ok( r == S_OK, "failed\n"); @@ -471,7 +581,7 @@ MSIHANDLE hpkg; UINT r; MSIHANDLE hdb; - + hdb = create_package_db(); ok ( hdb, "failed to create package database\n" ); @@ -982,11 +1092,151 @@ r = MsiEvaluateCondition(hpkg, "bandalmael<>0"); ok( r == MSICONDITION_TRUE, "wrong return val\n"); + MsiSetProperty(hpkg, "one", "hi"); + MsiSetProperty(hpkg, "two", "hithere"); + r = MsiEvaluateCondition(hpkg, "one >< two"); + ok( r == MSICONDITION_FALSE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", "hithere"); + MsiSetProperty(hpkg, "two", "hi"); + r = MsiEvaluateCondition(hpkg, "one >< two"); + ok( r == MSICONDITION_TRUE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", "hello"); + MsiSetProperty(hpkg, "two", "hi"); + r = MsiEvaluateCondition(hpkg, "one >< two"); + ok( r == MSICONDITION_FALSE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", "hellohithere"); + MsiSetProperty(hpkg, "two", "hi"); + r = MsiEvaluateCondition(hpkg, "one >< two"); + ok( r == MSICONDITION_TRUE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", ""); + MsiSetProperty(hpkg, "two", "hi"); + r = MsiEvaluateCondition(hpkg, "one >< two"); + ok( r == MSICONDITION_FALSE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", "hi"); + MsiSetProperty(hpkg, "two", ""); + r = MsiEvaluateCondition(hpkg, "one >< two"); + ok( r == MSICONDITION_TRUE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", ""); + MsiSetProperty(hpkg, "two", ""); + r = MsiEvaluateCondition(hpkg, "one >< two"); + ok( r == MSICONDITION_FALSE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", "1234"); + MsiSetProperty(hpkg, "two", "1"); + r = MsiEvaluateCondition(hpkg, "one >< two"); + ok( r == MSICONDITION_FALSE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", "one 1234"); + MsiSetProperty(hpkg, "two", "1"); + r = MsiEvaluateCondition(hpkg, "one >< two"); + ok( r == MSICONDITION_TRUE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", "hithere"); + MsiSetProperty(hpkg, "two", "hi"); + r = MsiEvaluateCondition(hpkg, "one << two"); + ok( r == MSICONDITION_TRUE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", "hi"); + MsiSetProperty(hpkg, "two", "hithere"); + r = MsiEvaluateCondition(hpkg, "one << two"); + ok( r == MSICONDITION_FALSE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", "hi"); + MsiSetProperty(hpkg, "two", "hi"); + r = MsiEvaluateCondition(hpkg, "one << two"); + ok( r == MSICONDITION_TRUE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", "abcdhithere"); + MsiSetProperty(hpkg, "two", "hi"); + r = MsiEvaluateCondition(hpkg, "one << two"); + ok( r == MSICONDITION_FALSE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", ""); + MsiSetProperty(hpkg, "two", "hi"); + r = MsiEvaluateCondition(hpkg, "one << two"); + ok( r == MSICONDITION_FALSE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", "hithere"); + MsiSetProperty(hpkg, "two", ""); + r = MsiEvaluateCondition(hpkg, "one << two"); + ok( r == MSICONDITION_TRUE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", ""); + MsiSetProperty(hpkg, "two", ""); + r = MsiEvaluateCondition(hpkg, "one << two"); + ok( r == MSICONDITION_FALSE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", "1234"); + MsiSetProperty(hpkg, "two", "1"); + r = MsiEvaluateCondition(hpkg, "one << two"); + ok( r == MSICONDITION_FALSE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", "1234 one"); + MsiSetProperty(hpkg, "two", "1"); + r = MsiEvaluateCondition(hpkg, "one << two"); + ok( r == MSICONDITION_TRUE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", "hithere"); + MsiSetProperty(hpkg, "two", "there"); + r = MsiEvaluateCondition(hpkg, "one >> two"); + ok( r == MSICONDITION_TRUE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", "hithere"); + MsiSetProperty(hpkg, "two", "hi"); + r = MsiEvaluateCondition(hpkg, "one >> two"); + ok( r == MSICONDITION_FALSE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", "there"); + MsiSetProperty(hpkg, "two", "hithere"); + r = MsiEvaluateCondition(hpkg, "one >> two"); + ok( r == MSICONDITION_FALSE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", "there"); + MsiSetProperty(hpkg, "two", "there"); + r = MsiEvaluateCondition(hpkg, "one >> two"); + ok( r == MSICONDITION_TRUE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", "abcdhithere"); + MsiSetProperty(hpkg, "two", "hi"); + r = MsiEvaluateCondition(hpkg, "one >> two"); + ok( r == MSICONDITION_FALSE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", ""); + MsiSetProperty(hpkg, "two", "there"); + r = MsiEvaluateCondition(hpkg, "one >> two"); + ok( r == MSICONDITION_FALSE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", "there"); + MsiSetProperty(hpkg, "two", ""); + r = MsiEvaluateCondition(hpkg, "one >> two"); + ok( r == MSICONDITION_TRUE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", ""); + MsiSetProperty(hpkg, "two", ""); + r = MsiEvaluateCondition(hpkg, "one >> two"); + ok( r == MSICONDITION_FALSE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", "1234"); + MsiSetProperty(hpkg, "two", "4"); + r = MsiEvaluateCondition(hpkg, "one >> two"); + ok( r == MSICONDITION_FALSE, "wrong return val\n"); + + MsiSetProperty(hpkg, "one", "one 1234"); + MsiSetProperty(hpkg, "two", "4"); + r = MsiEvaluateCondition(hpkg, "one >> two"); + ok( r == MSICONDITION_TRUE, "wrong return val\n"); + MsiCloseHandle( hpkg ); DeleteFile(msifile); } -static BOOL check_prop_empty( MSIHANDLE hpkg, char * prop) +static BOOL check_prop_empty( MSIHANDLE hpkg, const char * prop) { UINT r; DWORD sz; @@ -1295,7 +1545,7 @@ ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r ); /* msidbFeatureAttributesFavorLocal */ - r = add_feature_entry( hdb, "'one', '', 2, 1, 0" ); + r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" ); ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r ); /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */ @@ -1310,8 +1560,12 @@ r = add_component_entry( hdb, "'gamma', '{C271E2A4-DE2E-4F70-86D1-6984AF7DE2CA}', 'TARGETDIR', 2, '', 'gamma_file'" ); ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r ); + /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesSharedDllRefCount */ + r = add_component_entry( hdb, "'theta', '{4EB3129D-81A8-48D5-9801-75600FED3DD9}', 'TARGETDIR', 8, '', 'theta_file'" ); + ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r ); + /* msidbFeatureAttributesFavorSource */ - r = add_feature_entry( hdb, "'two', '', 2, 1, 1" ); + r = add_feature_entry( hdb, "'two', '', '', '', 2, 1, '', 1" ); ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r ); /* msidbFeatureAttributesFavorSource:msidbComponentAttributesLocalOnly */ @@ -1326,8 +1580,12 @@ r = add_component_entry( hdb, "'zeta', '{377D33AB-2FAA-42B9-A629-0C0DAE9B9C7A}', 'TARGETDIR', 2, '', 'zeta_file'" ); ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r ); + /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSharedDllRefCount */ + r = add_component_entry( hdb, "'iota', '{5D36F871-B5ED-4801-9E0F-C46B9E5C9669}', 'TARGETDIR', 8, '', 'iota_file'" ); + ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r ); + /* msidbFeatureAttributesFavorSource */ - r = add_feature_entry( hdb, "'three', '', 2, 1, 1" ); + r = add_feature_entry( hdb, "'three', '', '', '', 2, 1, '', 1" ); ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r ); /* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */ @@ -1346,6 +1604,9 @@ r = add_feature_components_entry( hdb, "'one', 'gamma'" ); ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r ); + r = add_feature_components_entry( hdb, "'one', 'theta'" ); + ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r ); + r = add_feature_components_entry( hdb, "'two', 'delta'" ); ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r ); @@ -1355,6 +1616,9 @@ r = add_feature_components_entry( hdb, "'two', 'zeta'" ); ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r ); + r = add_feature_components_entry( hdb, "'two', 'iota'" ); + ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r ); + r = add_feature_components_entry( hdb, "'three', 'eta'" ); ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r ); @@ -1370,6 +1634,9 @@ r = add_file_entry( hdb, "'gamma_file', 'gamma', 'gamma.txt', 0, '', '1033', 8192, 1" ); ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r); + r = add_file_entry( hdb, "'theta_file', 'theta', 'theta.txt', 0, '', '1033', 8192, 1" ); + ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r); + r = add_file_entry( hdb, "'delta_file', 'delta', 'delta.txt', 0, '', '1033', 8192, 1" ); ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r); @@ -1377,6 +1644,9 @@ ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r); r = add_file_entry( hdb, "'zeta_file', 'zeta', 'zeta.txt', 0, '', '1033', 8192, 1" ); + ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r); + + r = add_file_entry( hdb, "'iota_file', 'iota', 'iota.txt', 0, '', '1033', 8192, 1" ); ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r); /* compressed file */ @@ -1386,81 +1656,95 @@ hpkg = package_from_db( hdb ); ok( hpkg, "failed to create package\n"); - state = 0xdeadbeef; - action = 0xdeadbeef; + state = 0xdeadbee; + action = 0xdeadbee; r = MsiGetFeatureState(hpkg, "one", &state, &action); ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r ); - ok( state == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", state); - ok( action == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", action); - - state = 0xdeadbeef; - action = 0xdeadbeef; + ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state); + ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action); + + state = 0xdeadbee; + action = 0xdeadbee; r = MsiGetFeatureState(hpkg, "two", &state, &action); ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r ); - ok( state == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", state); - ok( action == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", action); - - state = 0xdeadbeef; - action = 0xdeadbeef; + ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state); + ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action); + + state = 0xdeadbee; + action = 0xdeadbee; r = MsiGetFeatureState(hpkg, "three", &state, &action); ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r ); - ok( state == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", state); - ok( action == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", action); - - state = 0xdeadbeef; - action = 0xdeadbeef; + ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state); + ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action); + + state = 0xdeadbee; + action = 0xdeadbee; r = MsiGetComponentState(hpkg, "alpha", &state, &action); ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r ); - ok( state == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", state); - ok( action == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", action); - - state = 0xdeadbeef; - action = 0xdeadbeef; + ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state); + ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action); + + state = 0xdeadbee; + action = 0xdeadbee; r = MsiGetComponentState(hpkg, "beta", &state, &action); ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r ); - ok( state == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", state); - ok( action == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", action); - - state = 0xdeadbeef; - action = 0xdeadbeef; + ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state); + ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action); + + state = 0xdeadbee; + action = 0xdeadbee; r = MsiGetComponentState(hpkg, "gamma", &state, &action); ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r ); - ok( state == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", state); - ok( action == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", action); - - state = 0xdeadbeef; - action = 0xdeadbeef; + ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state); + ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action); + + state = 0xdeadbee; + action = 0xdeadbee; + r = MsiGetComponentState(hpkg, "theta", &state, &action); + ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r ); + ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state); + ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action); + + state = 0xdeadbee; + action = 0xdeadbee; r = MsiGetComponentState(hpkg, "delta", &state, &action); ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r ); - ok( state == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", state); - ok( action == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", action); - - state = 0xdeadbeef; - action = 0xdeadbeef; + ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state); + ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action); + + state = 0xdeadbee; + action = 0xdeadbee; r = MsiGetComponentState(hpkg, "epsilon", &state, &action); ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r ); - ok( state == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", state); - ok( action == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", action); - - state = 0xdeadbeef; - action = 0xdeadbeef; + ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state); + ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action); + + state = 0xdeadbee; + action = 0xdeadbee; r = MsiGetComponentState(hpkg, "zeta", &state, &action); ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r ); - ok( state == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", state); - ok( action == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", action); - - state = 0xdeadbeef; - action = 0xdeadbeef; + ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state); + ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action); + + state = 0xdeadbee; + action = 0xdeadbee; + r = MsiGetComponentState(hpkg, "iota", &state, &action); + ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r ); + ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state); + ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action); + + state = 0xdeadbee; + action = 0xdeadbee; r = MsiGetComponentState(hpkg, "eta", &state, &action); ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r ); - ok( state == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", state); - ok( action == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", action); + ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state); + ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action); r = MsiDoAction( hpkg, "CostInitialize"); ok( r == ERROR_SUCCESS, "cost init failed\n"); - state = 0xdeadbeef; - action = 0xdeadbeef; + state = 0xdeadbee; + action = 0xdeadbee; r = MsiGetFeatureState(hpkg, "one", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); todo_wine @@ -1469,8 +1753,8 @@ } ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); - state = 0xdeadbeef; - action = 0xdeadbeef; + state = 0xdeadbee; + action = 0xdeadbee; r = MsiGetFeatureState(hpkg, "two", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); todo_wine @@ -1479,8 +1763,8 @@ } ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); - state = 0xdeadbeef; - action = 0xdeadbeef; + state = 0xdeadbee; + action = 0xdeadbee; r = MsiGetFeatureState(hpkg, "three", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); todo_wine @@ -1489,8 +1773,8 @@ } ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); - state = 0xdeadbeef; - action = 0xdeadbeef; + state = 0xdeadbee; + action = 0xdeadbee; r = MsiGetComponentState(hpkg, "alpha", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); todo_wine @@ -1499,8 +1783,8 @@ ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); } - state = 0xdeadbeef; - action = 0xdeadbeef; + state = 0xdeadbee; + action = 0xdeadbee; r = MsiGetComponentState(hpkg, "beta", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); todo_wine @@ -1509,8 +1793,8 @@ ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); } - state = 0xdeadbeef; - action = 0xdeadbeef; + state = 0xdeadbee; + action = 0xdeadbee; r = MsiGetComponentState(hpkg, "gamma", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); todo_wine @@ -1519,9 +1803,9 @@ ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); } - state = 0xdeadbeef; - action = 0xdeadbeef; - r = MsiGetComponentState(hpkg, "delta", &state, &action); + state = 0xdeadbee; + action = 0xdeadbee; + r = MsiGetComponentState(hpkg, "theta", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); todo_wine { @@ -1529,9 +1813,9 @@ ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); } - state = 0xdeadbeef; - action = 0xdeadbeef; - r = MsiGetComponentState(hpkg, "epsilon", &state, &action); + state = 0xdeadbee; + action = 0xdeadbee; + r = MsiGetComponentState(hpkg, "delta", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); todo_wine { @@ -1539,9 +1823,9 @@ ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); } - state = 0xdeadbeef; - action = 0xdeadbeef; - r = MsiGetComponentState(hpkg, "zeta", &state, &action); + state = 0xdeadbee; + action = 0xdeadbee; + r = MsiGetComponentState(hpkg, "epsilon", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); todo_wine { @@ -1549,9 +1833,9 @@ ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); } - state = 0xdeadbeef; - action = 0xdeadbeef; - r = MsiGetComponentState(hpkg, "eta", &state, &action); + state = 0xdeadbee; + action = 0xdeadbee; + r = MsiGetComponentState(hpkg, "zeta", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); todo_wine { @@ -1559,11 +1843,31 @@ ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); } + state = 0xdeadbee; + action = 0xdeadbee; + r = MsiGetComponentState(hpkg, "iota", &state, &action); + ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); + todo_wine + { + ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); + ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); + } + + state = 0xdeadbee; + action = 0xdeadbee; + r = MsiGetComponentState(hpkg, "eta", &state, &action); + ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); + todo_wine + { + ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); + ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); + } + r = MsiDoAction( hpkg, "FileCost"); ok( r == ERROR_SUCCESS, "file cost failed\n"); - state = 0xdeadbeef; - action = 0xdeadbeef; + state = 0xdeadbee; + action = 0xdeadbee; r = MsiGetFeatureState(hpkg, "one", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); todo_wine @@ -1572,8 +1876,8 @@ } ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); - state = 0xdeadbeef; - action = 0xdeadbeef; + state = 0xdeadbee; + action = 0xdeadbee; r = MsiGetFeatureState(hpkg, "two", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); todo_wine @@ -1582,8 +1886,8 @@ } ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); - state = 0xdeadbeef; - action = 0xdeadbeef; + state = 0xdeadbee; + action = 0xdeadbee; r = MsiGetFeatureState(hpkg, "three", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); todo_wine @@ -1592,8 +1896,8 @@ } ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); - state = 0xdeadbeef; - action = 0xdeadbeef; + state = 0xdeadbee; + action = 0xdeadbee; r = MsiGetComponentState(hpkg, "alpha", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); todo_wine @@ -1602,8 +1906,8 @@ ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); } - state = 0xdeadbeef; - action = 0xdeadbeef; + state = 0xdeadbee; + action = 0xdeadbee; r = MsiGetComponentState(hpkg, "beta", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); todo_wine @@ -1612,8 +1916,8 @@ ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); } - state = 0xdeadbeef; - action = 0xdeadbeef; + state = 0xdeadbee; + action = 0xdeadbee; r = MsiGetComponentState(hpkg, "gamma", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); todo_wine @@ -1622,9 +1926,9 @@ ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); } - state = 0xdeadbeef; - action = 0xdeadbeef; - r = MsiGetComponentState(hpkg, "delta", &state, &action); + state = 0xdeadbee; + action = 0xdeadbee; + r = MsiGetComponentState(hpkg, "theta", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); todo_wine { @@ -1632,9 +1936,9 @@ ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); } - state = 0xdeadbeef; - action = 0xdeadbeef; - r = MsiGetComponentState(hpkg, "epsilon", &state, &action); + state = 0xdeadbee; + action = 0xdeadbee; + r = MsiGetComponentState(hpkg, "delta", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); todo_wine { @@ -1642,9 +1946,9 @@ ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); } - state = 0xdeadbeef; - action = 0xdeadbeef; - r = MsiGetComponentState(hpkg, "zeta", &state, &action); + state = 0xdeadbee; + action = 0xdeadbee; + r = MsiGetComponentState(hpkg, "epsilon", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); todo_wine { @@ -1652,9 +1956,9 @@ ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); } - state = 0xdeadbeef; - action = 0xdeadbeef; - r = MsiGetComponentState(hpkg, "eta", &state, &action); + state = 0xdeadbee; + action = 0xdeadbee; + r = MsiGetComponentState(hpkg, "zeta", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); todo_wine { @@ -1662,95 +1966,349 @@ ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); } + state = 0xdeadbee; + action = 0xdeadbee; + r = MsiGetComponentState(hpkg, "iota", &state, &action); + ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); + todo_wine + { + ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); + ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); + } + + state = 0xdeadbee; + action = 0xdeadbee; + r = MsiGetComponentState(hpkg, "eta", &state, &action); + ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); + todo_wine + { + ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); + ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); + } + r = MsiDoAction( hpkg, "CostFinalize"); ok( r == ERROR_SUCCESS, "cost finalize failed: %d\n", r); - state = 0xdeadbeef; - action = 0xdeadbeef; + state = 0xdeadbee; + action = 0xdeadbee; r = MsiGetFeatureState(hpkg, "one", &state, &action); - ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); - ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); - todo_wine - { - ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action); - } - - state = 0xdeadbeef; - action = 0xdeadbeef; - r = MsiGetFeatureState(hpkg, "two", &state, &action); - ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); - ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); - todo_wine - { - ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action); - } - - state = 0xdeadbeef; - action = 0xdeadbeef; - r = MsiGetFeatureState(hpkg, "three", &state, &action); - ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); - ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); - todo_wine - { - ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action); - } - - state = 0xdeadbeef; - action = 0xdeadbeef; - r = MsiGetComponentState(hpkg, "alpha", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action); - state = 0xdeadbeef; - action = 0xdeadbeef; - r = MsiGetComponentState(hpkg, "beta", &state, &action); + state = 0xdeadbee; + action = 0xdeadbee; + r = MsiGetFeatureState(hpkg, "two", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action); - state = 0xdeadbeef; - action = 0xdeadbeef; - r = MsiGetComponentState(hpkg, "gamma", &state, &action); + state = 0xdeadbee; + action = 0xdeadbee; + r = MsiGetFeatureState(hpkg, "three", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action); - state = 0xdeadbeef; - action = 0xdeadbeef; - r = MsiGetComponentState(hpkg, "delta", &state, &action); + state = 0xdeadbee; + action = 0xdeadbee; + r = MsiGetComponentState(hpkg, "alpha", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action); - state = 0xdeadbeef; - action = 0xdeadbeef; - r = MsiGetComponentState(hpkg, "epsilon", &state, &action); + state = 0xdeadbee; + action = 0xdeadbee; + r = MsiGetComponentState(hpkg, "beta", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action); - state = 0xdeadbeef; - action = 0xdeadbeef; + state = 0xdeadbee; + action = 0xdeadbee; + r = MsiGetComponentState(hpkg, "gamma", &state, &action); + ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); + ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); + ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action); + + state = 0xdeadbee; + action = 0xdeadbee; + r = MsiGetComponentState(hpkg, "theta", &state, &action); + ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); + ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); + ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action); + + state = 0xdeadbee; + action = 0xdeadbee; + r = MsiGetComponentState(hpkg, "delta", &state, &action); + ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); + ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); + ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action); + + state = 0xdeadbee; + action = 0xdeadbee; + r = MsiGetComponentState(hpkg, "epsilon", &state, &action); + ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); + ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); + ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action); + + state = 0xdeadbee; + action = 0xdeadbee; r = MsiGetComponentState(hpkg, "zeta", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); - todo_wine - { - ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action); - } - - state = 0xdeadbeef; - action = 0xdeadbeef; + ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action); + + state = 0xdeadbee; + action = 0xdeadbee; + r = MsiGetComponentState(hpkg, "iota", &state, &action); + ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); + ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); + ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action); + + state = 0xdeadbee; + action = 0xdeadbee; r = MsiGetComponentState(hpkg, "eta", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); - todo_wine - { - ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action); - } + ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action); MsiCloseHandle( hpkg ); +} + +static void test_getproperty(void) +{ + MSIHANDLE hPackage = 0; + char prop[100]; + static CHAR empty[] = ""; + DWORD size; + UINT r; + + hPackage = package_from_db(create_package_db()); + ok( hPackage != 0, " Failed to create package\n"); + + /* set the property */ + r = MsiSetProperty(hPackage, "Name", "Value"); + ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + /* retrieve the size, NULL pointer */ + size = 0; + r = MsiGetProperty(hPackage, "Name", NULL, &size); + ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok( size == 5, "Expected 5, got %ld\n", size); + + /* retrieve the size, empty string */ + size = 0; + r = MsiGetProperty(hPackage, "Name", empty, &size); + ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r); + ok( size == 5, "Expected 5, got %ld\n", size); + + /* don't change size */ + r = MsiGetProperty(hPackage, "Name", prop, &size); + ok( r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r); + ok( size == 5, "Expected 5, got %ld\n", size); + ok( !lstrcmp(prop, "Valu"), "Expected Valu, got %s\n", prop); + + /* increase the size by 1 */ + size++; + r = MsiGetProperty(hPackage, "Name", prop, &size); + ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok( size == 5, "Expected 5, got %ld\n", size); + ok( !lstrcmp(prop, "Value"), "Expected Value, got %s\n", prop); + + r = MsiCloseHandle( hPackage); + ok( r == ERROR_SUCCESS , "Failed to close package\n" ); + DeleteFile(msifile); +} + +static void test_removefiles(void) +{ + MSIHANDLE hpkg; + UINT r; + MSIHANDLE hdb; + char CURR_DIR[MAX_PATH]; + + GetCurrentDirectoryA(MAX_PATH, CURR_DIR); + + hdb = create_package_db(); + ok ( hdb, "failed to create package database\n" ); + + r = add_directory_entry( hdb, "'TARGETDIR', '', 'SourceDir'"); + ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r ); + + r = create_feature_table( hdb ); + ok( r == ERROR_SUCCESS, "cannot create Feature table: %d\n", r ); + + r = create_component_table( hdb ); + ok( r == ERROR_SUCCESS, "cannot create Component table: %d\n", r ); + + r = add_feature_entry( hdb, "'one', '', '', '', 2, 1, '', 0" ); + ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r ); + + r = add_component_entry( hdb, "'hydrogen', '', 'TARGETDIR', 0, '', 'hydrogen_file'" ); + ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r ); + + r = add_component_entry( hdb, "'helium', '', 'TARGETDIR', 0, '', 'helium_file'" ); + ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r ); + + r = add_component_entry( hdb, "'lithium', '', 'TARGETDIR', 0, '', 'lithium_file'" ); + ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r ); + + r = add_component_entry( hdb, "'beryllium', '', 'TARGETDIR', 0, '', 'beryllium_file'" ); + ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r ); + + r = add_component_entry( hdb, "'boron', '', 'TARGETDIR', 0, '', 'boron_file'" ); + ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r ); + + r = add_component_entry( hdb, "'carbon', '', 'TARGETDIR', 0, '', 'carbon_file'" ); + ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r ); + + r = create_feature_components_table( hdb ); + ok( r == ERROR_SUCCESS, "cannot create FeatureComponents table: %d\n", r ); + + r = add_feature_components_entry( hdb, "'one', 'hydrogen'" ); + ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r ); + + r = add_feature_components_entry( hdb, "'one', 'helium'" ); + ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r ); + + r = add_feature_components_entry( hdb, "'one', 'lithium'" ); + ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r ); + + r = add_feature_components_entry( hdb, "'one', 'beryllium'" ); + ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r ); + + r = add_feature_components_entry( hdb, "'one', 'boron'" ); + ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r ); + + r = add_feature_components_entry( hdb, "'one', 'carbon'" ); + ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r ); + + r = create_file_table( hdb ); + ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r ); + + r = add_file_entry( hdb, "'hydrogen_file', 'hydrogen', 'hydrogen.txt', 0, '', '1033', 8192, 1" ); + ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r); + + r = add_file_entry( hdb, "'helium_file', 'helium', 'helium.txt', 0, '', '1033', 8192, 1" ); + ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r); + + r = add_file_entry( hdb, "'lithium_file', 'lithium', 'lithium.txt', 0, '', '1033', 8192, 1" ); + ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r); + + r = add_file_entry( hdb, "'beryllium_file', 'beryllium', 'beryllium.txt', 0, '', '1033', 16384, 1" ); + ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r); + + r = add_file_entry( hdb, "'boron_file', 'boron', 'boron.txt', 0, '', '1033', 16384, 1" ); + ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r); + + r = add_file_entry( hdb, "'carbon_file', 'carbon', 'carbon.txt', 0, '', '1033', 16384, 1" ); + ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r); + + r = create_remove_file_table( hdb ); + ok( r == ERROR_SUCCESS, "cannot create Remove File table: %d\n", r); + + hpkg = package_from_db( hdb ); + ok( hpkg, "failed to create package\n"); + + create_test_file( "hydrogen.txt" ); + create_test_file( "helium.txt" ); + create_test_file( "lithium.txt" ); + create_test_file( "beryllium.txt" ); + create_test_file( "boron.txt" ); + create_test_file( "carbon.txt" ); + + r = MsiSetProperty( hpkg, "TARGETDIR", CURR_DIR ); + ok( r == ERROR_SUCCESS, "set property failed\n"); + + r = MsiDoAction( hpkg, "CostInitialize"); + ok( r == ERROR_SUCCESS, "cost init failed\n"); + + r = MsiDoAction( hpkg, "FileCost"); + ok( r == ERROR_SUCCESS, "cost finalize failed\n"); + + r = MsiDoAction( hpkg, "CostFinalize"); + ok( r == ERROR_SUCCESS, "cost finalize failed\n"); + + r = MsiDoAction( hpkg, "InstallValidate"); + ok( r == ERROR_SUCCESS, "cost finalize failed\n"); + + r = MsiSetComponentState( hpkg, "hydrogen", INSTALLSTATE_ABSENT ); + ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r); + + r = MsiSetComponentState( hpkg, "helium", INSTALLSTATE_LOCAL ); + ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r); + + r = MsiSetComponentState( hpkg, "lithium", INSTALLSTATE_SOURCE ); + ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r); + + r = MsiSetComponentState( hpkg, "beryllium", INSTALLSTATE_ABSENT ); + ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r); + + r = MsiSetComponentState( hpkg, "boron", INSTALLSTATE_LOCAL ); + ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r); + + r = MsiSetComponentState( hpkg, "carbon", INSTALLSTATE_SOURCE ); + ok( r == ERROR_SUCCESS, "failed to set component state: %d\n", r); + + r = MsiDoAction( hpkg, "RemoveFiles"); + ok( r == ERROR_SUCCESS, "remove files failed\n"); + + ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n"); + ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n"); + ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n"); + ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n"); + ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n"); + ok(DeleteFileA("boron.txt"), "Expected boron.txt to exist\n"); + + MsiCloseHandle( hpkg ); + DeleteFileA(msifile); +} + +static void test_appsearch(void) +{ + MSIHANDLE hpkg; + UINT r; + MSIHANDLE hdb; + CHAR prop[MAX_PATH]; + DWORD size = MAX_PATH; + + hdb = create_package_db(); + ok ( hdb, "failed to create package database\n" ); + + r = create_appsearch_table( hdb ); + ok( r == ERROR_SUCCESS, "cannot create AppSearch table: %d\n", r ); + + r = add_appsearch_entry( hdb, "'WEBBROWSERPROG', 'NewSignature1'" ); + ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r ); + + r = create_reglocator_table( hdb ); + ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r ); + + r = add_reglocator_entry( hdb, "'NewSignature1', 0, 'htmlfile\\shell\\open\\command', '', 1" ); + ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r ); + + r = create_signature_table( hdb ); + ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r ); + + r = add_signature_entry( hdb, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" ); + ok( r == ERROR_SUCCESS, "cannot create Signature table: %d\n", r ); + + hpkg = package_from_db( hdb ); + ok( hpkg, "failed to create package\n"); + + r = MsiDoAction( hpkg, "AppSearch" ); + ok( r == ERROR_SUCCESS, "AppSearch failed: %d\n", r); + + r = MsiGetPropertyA( hpkg, "WEBBROWSERPROG", prop, &size ); + ok( r == ERROR_SUCCESS, "get property failed: %d\n", r); + todo_wine + { + ok( lstrlenA(prop) != 0, "Expected non-zero length\n"); + } + + MsiCloseHandle( hpkg ); + DeleteFileA(msifile); } START_TEST(package) @@ -1766,4 +2324,7 @@ test_msipackage(); test_formatrecord2(); test_states(); -} + test_getproperty(); + test_removefiles(); + test_appsearch(); +}
18 years, 3 months
1
0
0
0
← Newer
1
2
3
4
5
6
...
45
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
Results per page:
10
25
50
100
200