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
January 2009
----- 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
30 participants
755 discussions
Start a n
N
ew thread
[sginsberg] 38650: - COMPUTE_PAGES_SPANNED is deprecated, use ADDRESS_AND_SIZE_TO_SPAN_PAGES instead
by sginsberg@svn.reactos.org
Author: sginsberg Date: Thu Jan 8 13:27:09 2009 New Revision: 38650 URL:
http://svn.reactos.org/svn/reactos?rev=38650&view=rev
Log: - COMPUTE_PAGES_SPANNED is deprecated, use ADDRESS_AND_SIZE_TO_SPAN_PAGES instead Modified: trunk/reactos/ntoskrnl/fsrtl/fastio.c Modified: trunk/reactos/ntoskrnl/fsrtl/fastio.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fsrtl/fastio.c?re…
============================================================================== --- trunk/reactos/ntoskrnl/fsrtl/fastio.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/fsrtl/fastio.c [iso-8859-1] Thu Jan 8 13:27:09 2009 @@ -74,7 +74,7 @@ PFAST_IO_DISPATCH FastIoDispatch; PDEVICE_OBJECT Device; BOOLEAN Result = TRUE; - ULONG PageCount = COMPUTE_PAGES_SPANNED(FileOffset,Length); + ULONG PageCount = ADDRESS_AND_SIZE_TO_SPAN_PAGES(FileOffset,Length); PAGED_CODE(); ASSERT(FileObject);
15 years, 11 months
1
0
0
0
[cwittich] 38649: fix msvc build
by cwittich@svn.reactos.org
Author: cwittich Date: Thu Jan 8 13:08:47 2009 New Revision: 38649 URL:
http://svn.reactos.org/svn/reactos?rev=38649&view=rev
Log: fix msvc build Modified: trunk/reactos/base/applications/screensavers/logon/logon.c Modified: trunk/reactos/base/applications/screensavers/logon/logon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/screensa…
============================================================================== --- trunk/reactos/base/applications/screensavers/logon/logon.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/screensavers/logon/logon.c [iso-8859-1] Thu Jan 8 13:08:47 2009 @@ -81,13 +81,16 @@ { BITMAP bm; /* Bitmap structure as seen in bmWidth & bmHeight */ PAINTSTRUCT ps; + HDC hdc; + HDC hdcMem; + HBITMAP hbmOld; // Obtain window coordinates. GetClientRect (hWnd, &rect); - HDC hdc = BeginPaint(hWnd, &ps); - HDC hdcMem = CreateCompatibleDC(hdc); - HBITMAP hbmOld = SelectObject(hdcMem, bitmap); + hdc = BeginPaint(hWnd, &ps); + hdcMem = CreateCompatibleDC(hdc); + hbmOld = SelectObject(hdcMem, bitmap); GetObject(bitmap, sizeof(bm), &bm);
15 years, 11 months
1
0
0
0
[fireball] 38648: - Some 64bits syncs from Wine by Samuel Serapion.
by fireball@svn.reactos.org
Author: fireball Date: Thu Jan 8 11:35:42 2009 New Revision: 38648 URL:
http://svn.reactos.org/svn/reactos?rev=38648&view=rev
Log: - Some 64bits syncs from Wine by Samuel Serapion. Modified: trunk/reactos/lib/rtl/heap.c Modified: trunk/reactos/lib/rtl/heap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/heap.c?rev=38648&r…
============================================================================== --- trunk/reactos/lib/rtl/heap.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/heap.c [iso-8859-1] Thu Jan 8 11:35:42 2009 @@ -68,7 +68,7 @@ typedef struct tagARENA_INUSE { - DWORD size; /* Block size; must be the first field */ + SIZE_T size; /* Block size; must be the first field */ DWORD magic : 23; /* Magic number */ DWORD has_user_data : 1; /* There is user data associated with this block */ DWORD unused_bytes : 8; /* Number of bytes in the block not used by user data (max value is HEAP_MIN_DATA_SIZE+HEAP_MIN_SHRINK_SIZE) */ @@ -76,7 +76,7 @@ typedef struct tagARENA_FREE { - DWORD size; /* Block size; must be the first field */ + SIZE_T size; /* Block size; must be the first field */ DWORD magic; /* Magic number */ struct list entry; /* Entry in free list */ } ARENA_FREE; @@ -90,14 +90,18 @@ #define ARENA_INUSE_FILLER 0x55 #define ARENA_FREE_FILLER 0xaa -#define ALIGNMENT 8 /* everything is aligned on 8 byte boundaries */ -#define ROUND_SIZE(size) (((size) + ALIGNMENT - 1) & ~(ALIGNMENT-1)) +/* everything is aligned on 8 byte boundaries (16 for Win64)*/ +#define ALIGNMENT (2*sizeof(void*)) +#define ARENA_OFFSET (ALIGNMENT - sizeof(ARENA_INUSE)) + +#define ROUND_SIZE(size) ((((size) + ALIGNMENT - 1) & ~(ALIGNMENT-1)) + ARENA_OFFSET) + #define QUIET 1 /* Suppress messages */ #define NOISY 0 /* Report all errors */ /* minimum data size (without arenas) of an allocated block */ -#define HEAP_MIN_DATA_SIZE 16 +#define HEAP_MIN_DATA_SIZE ROUND_SIZE(2 * sizeof(struct list)) /* minimum size that must remain to shrink an allocated block */ #define HEAP_MIN_SHRINK_SIZE (HEAP_MIN_DATA_SIZE+sizeof(ARENA_FREE)) @@ -112,14 +116,15 @@ typedef struct { ARENA_FREE arena; + void *aligment[4]; } FREE_LIST_ENTRY; struct tagHEAP; typedef struct tagSUBHEAP { - DWORD size; /* Size of the whole sub-heap */ - DWORD commitSize; /* Committed size of the sub-heap */ + SIZE_T size; /* Size of the whole sub-heap */ + SIZE_T commitSize; /* Committed size of the sub-heap */ DWORD headerSize; /* Size of the heap header */ struct tagSUBHEAP *next; /* Next sub-heap */ struct tagHEAP *heap; /* Main heap structure */ @@ -206,6 +211,12 @@ size -= sizeof(ARENA_FREE); for (i = 0; i < HEAP_NB_FREE_LISTS - 1; i++) if (size <= HEAP_freeListSizes[i]) break; return i; +} + +/* get the memory protection type to use for a given heap */ +static inline ULONG get_protection_type( DWORD flags ) +{ + return (flags & HEAP_CREATE_ENABLE_EXECUTE) ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE; } static RTL_CRITICAL_SECTION_DEBUG process_heap_critsect_debug = @@ -282,8 +293,8 @@ } } DPRINTF( "\nTotal: Size=%08lx Committed=%08lx Free=%08lx Used=%08lx Arenas=%08lx (%ld%%)\n\n", - subheap->size, subheap->commitSize, freeSize, usedSize, - arenaSize, (arenaSize * 100) / subheap->size ); + subheap->size, subheap->commitSize, freeSize, usedSize, + arenaSize, (arenaSize * 100) / subheap->size ); subheap = subheap->next; } } @@ -457,7 +468,7 @@ else { Status = ZwAllocateVirtualMemory( NtCurrentProcess(), &ptr, 0, - &size, MEM_COMMIT, PAGE_READWRITE ); + &size, MEM_COMMIT, get_protection_type(subheap->heap->flags) ); } if (!NT_SUCCESS(Status)) { @@ -649,7 +660,7 @@ NTSTATUS Status; if (!address && ZwAllocateVirtualMemory( NtCurrentProcess(), &address, 0, - &commitSize, MEM_COMMIT, PAGE_READWRITE )) + &commitSize, MEM_COMMIT, get_protection_type(flags) )) { WARN("Could not commit %08lx bytes for sub-heap %p\n", commitSize, address ); return FALSE; @@ -733,7 +744,7 @@ 0, &commitSize, MEM_COMMIT, - PAGE_EXECUTE_READWRITE); + get_protection_type(flags)); } if (!NT_SUCCESS(Status)) { @@ -766,13 +777,14 @@ totalSize = (totalSize + 0xffff) & 0xffff0000; commitSize = (commitSize + 0xffff) & 0xffff0000; if (!commitSize) commitSize = 0x10000; + totalSize = min( totalSize, 0xffff0000 ); /* don't allow a heap larger than 4Gb */ if (totalSize < commitSize) totalSize = commitSize; if (!address) { /* allocate the memory block */ if (ZwAllocateVirtualMemory( NtCurrentProcess(), &address, 0, &totalSize, - MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE )) + MEM_RESERVE | MEM_COMMIT, get_protection_type(flags) )) { WARN("Could not allocate %08lx bytes\n", totalSize ); return NULL; @@ -804,6 +816,7 @@ { SUBHEAP *subheap; struct list *ptr; + SIZE_T total_size; FREE_LIST_ENTRY *pEntry = heap->freeList + get_freelist_index( size + sizeof(ARENA_INUSE) ); /* Find a suitable free list, and in it find a block large enough */ @@ -835,9 +848,11 @@ * So just one heap struct, one first free arena which will eventually * get used, and a second free arena that might get assigned all remaining * free space in HEAP_ShrinkBlock() */ - size += ROUND_SIZE(sizeof(SUBHEAP)) + sizeof(ARENA_INUSE) + sizeof(ARENA_FREE); - if (!(subheap = HEAP_CreateSubHeap( heap, NULL, heap->flags, size, - max( HEAP_DEF_SIZE, size ), NULL ))) + total_size = size + ROUND_SIZE(sizeof(SUBHEAP)) + sizeof(ARENA_INUSE) + sizeof(ARENA_FREE); + if (total_size < size) return NULL; /* overflow */ + + if (!(subheap = HEAP_CreateSubHeap( heap, NULL, heap->flags, total_size, + max( HEAP_DEF_SIZE, total_size ), NULL ))) return NULL; TRACE("created new sub-heap %p of %08lx bytes for heap %p\n", @@ -874,7 +889,7 @@ char *heapEnd = (char *)subheap + subheap->size; /* Check for unaligned pointers */ - if ( (ULONG_PTR)pArena % ALIGNMENT != 0 ) + if ( (ULONG_PTR)pArena % ALIGNMENT != ARENA_OFFSET ) { ERR("Heap %p: unaligned arena pointer %p\n", subheap->heap, pArena ); return FALSE; @@ -964,7 +979,7 @@ const char *heapEnd = (const char *)subheap + subheap->size; /* Check for unaligned pointers */ - if ( (ULONG_PTR)pArena % ALIGNMENT != 0 ) + if ( (ULONG_PTR)pArena % ALIGNMENT != ARENA_OFFSET ) { if ( quiet == NOISY ) { @@ -1169,6 +1184,7 @@ { processHeap = subheap->heap; /* assume the first heap we create is the process main heap */ list_init( &processHeap->entry ); + assert( (ULONG_PTR)processHeap->freeList % ALIGNMENT == ARENA_OFFSET ); } } @@ -1252,13 +1268,16 @@ //flags &= HEAP_GENERATE_EXCEPTIONS | HEAP_NO_SERIALIZE | HEAP_ZERO_MEMORY; flags |= heapPtr->flags; rounded_size = ROUND_SIZE(size); + if (rounded_size < size) /* overflow */ + { + if (flags & HEAP_GENERATE_EXCEPTIONS) RtlRaiseStatus( STATUS_NO_MEMORY ); + return NULL; + } + if (rounded_size < HEAP_MIN_DATA_SIZE) rounded_size = HEAP_MIN_DATA_SIZE; if (!(flags & HEAP_NO_SERIALIZE)) RtlEnterHeapLock( &heapPtr->critSection ); /* Locate a suitable free block */ - - /* Locate a suitable free block */ - if (!(pArena = HEAP_FindFreeBlock( heapPtr, rounded_size, &subheap ))) { TRACE("(%p,%08lx,%08lx): returning NULL\n", @@ -1288,7 +1307,10 @@ pInUse->unused_bytes = (pInUse->size & ARENA_SIZE_MASK) - size; if (flags & HEAP_ZERO_MEMORY) - clear_block( pInUse + 1, pInUse->size & ARENA_SIZE_MASK ); + { + clear_block( pInUse + 1, size ); + mark_block_uninitialized( (char *)(pInUse + 1) + size, pInUse->unused_bytes ); + } else mark_block_uninitialized( pInUse + 1, pInUse->size & ARENA_SIZE_MASK ); @@ -1339,16 +1361,26 @@ return FALSE; } - /* Turn the block into a free block */ - + /* Some sanity checks */ pInUse = (ARENA_INUSE *)ptr - 1; subheap = HEAP_FindSubHeap( heapPtr, pInUse ); + if ((char *)pInUse < (char *)subheap + subheap->headerSize) goto error; + if (!HEAP_ValidateInUseArena( subheap, pInUse, QUIET )) goto error; + + /* Turn the block into a free block */ + HEAP_MakeInUseBlockFree( subheap, pInUse ); if (!(flags & HEAP_NO_SERIALIZE)) RtlLeaveHeapLock( &heapPtr->critSection ); TRACE("(%p,%08lx,%p): returning TRUE\n", heap, flags, ptr ); return TRUE; + +error: + if (!(flags & HEAP_NO_SERIALIZE)) RtlLeaveHeapLock( &heapPtr->critSection ); + RtlSetLastWin32ErrorAndNtStatusFromNtStatus( STATUS_INVALID_PARAMETER ); + TRACE("(%p,%08x,%p): returning FALSE\n", heap, flags, ptr ); + return FALSE; } @@ -1376,7 +1408,7 @@ ARENA_INUSE *pArena; HEAP *heapPtr; SUBHEAP *subheap; - SIZE_T oldSize, rounded_size; + SIZE_T oldBlockSize, oldActualSize, rounded_size; if (!ptr) return NULL; if (!(heapPtr = HEAP_GetPtr( heap ))) @@ -1390,55 +1422,44 @@ //Flags &= HEAP_GENERATE_EXCEPTIONS | HEAP_NO_SERIALIZE | HEAP_ZERO_MEMORY | // HEAP_REALLOC_IN_PLACE_ONLY; flags |= heapPtr->flags; + if (!(flags & HEAP_NO_SERIALIZE)) RtlEnterHeapLock( &heapPtr->critSection ); + rounded_size = ROUND_SIZE(size); + if (rounded_size < size) goto oom; /* overflow */ if (rounded_size < HEAP_MIN_DATA_SIZE) rounded_size = HEAP_MIN_DATA_SIZE; - if (!(flags & HEAP_NO_SERIALIZE)) RtlEnterHeapLock( &heapPtr->critSection ); - if (!HEAP_IsRealArena( heapPtr, HEAP_NO_SERIALIZE, ptr, QUIET )) - { - if (!(flags & HEAP_NO_SERIALIZE)) RtlLeaveHeapLock( &heapPtr->critSection ); - RtlSetLastWin32ErrorAndNtStatusFromNtStatus( STATUS_INVALID_PARAMETER ); - TRACE("(%p,%08lx,%p,%08lx): returning NULL\n", heap, flags, ptr, size ); - return NULL; - } - pArena = (ARENA_INUSE *)ptr - 1; - subheap = HEAP_FindSubHeap( heapPtr, pArena ); - oldSize = (pArena->size & ARENA_SIZE_MASK); - if (rounded_size > oldSize) - { - char *pNext = (char *)(pArena + 1) + oldSize; + if(!(subheap = HEAP_FindSubHeap( heapPtr, pArena ))) goto done; + if ((char *)pArena < (char *)subheap + subheap->headerSize) goto error; + if (!HEAP_ValidateInUseArena( subheap, pArena, QUIET )) goto error; + + oldBlockSize = (pArena->size & ARENA_SIZE_MASK); + oldActualSize = (pArena->size & ARENA_SIZE_MASK) - pArena->unused_bytes; + + if (rounded_size > oldBlockSize) + { + char *pNext = (char *)(pArena + 1) + oldBlockSize; if ((pNext < (char *)subheap + subheap->size) && (*(DWORD *)pNext & ARENA_FLAG_FREE) && - (oldSize + (*(DWORD *)pNext & ARENA_SIZE_MASK) + sizeof(ARENA_FREE) >= rounded_size)) + (oldBlockSize + (*(DWORD *)pNext & ARENA_SIZE_MASK) + sizeof(ARENA_FREE) >= rounded_size)) { - /* The next block is free and large enough */ ARENA_FREE *pFree = (ARENA_FREE *)pNext; list_remove( &pFree->entry ); pArena->size += (pFree->size & ARENA_SIZE_MASK) + sizeof(*pFree); - if (!HEAP_Commit( subheap, pArena, rounded_size )) - { - if (!(flags & HEAP_NO_SERIALIZE)) RtlLeaveHeapLock( &heapPtr->critSection ); - if (flags & HEAP_GENERATE_EXCEPTIONS) RtlRaiseStatus( STATUS_NO_MEMORY ); - RtlSetLastWin32ErrorAndNtStatusFromNtStatus( STATUS_NO_MEMORY ); - return NULL; - } + + if (!HEAP_Commit( subheap, pArena, rounded_size )) goto oom; + HEAP_ShrinkBlock( subheap, pArena, rounded_size ); + mark_block_initialized( pArena + 1, oldActualSize ); } else /* Do it the hard way */ { ARENA_FREE *pNew; ARENA_INUSE *pInUse; SUBHEAP *newsubheap; - if ((flags & HEAP_REALLOC_IN_PLACE_ONLY) || !(pNew = HEAP_FindFreeBlock( heapPtr, rounded_size, &newsubheap ))) - { - if (!(flags & HEAP_NO_SERIALIZE)) RtlLeaveHeapLock( &heapPtr->critSection ); - if (flags & HEAP_GENERATE_EXCEPTIONS) RtlRaiseStatus( STATUS_NO_MEMORY ); - RtlSetLastWin32ErrorAndNtStatusFromNtStatus( STATUS_NO_MEMORY ); - return NULL; - } + goto oom; /* Build the in-use arena */ @@ -1448,8 +1469,9 @@ + sizeof(ARENA_FREE) - sizeof(ARENA_INUSE); pInUse->magic = ARENA_INUSE_MAGIC; HEAP_ShrinkBlock( newsubheap, pInUse, rounded_size ); - mark_block_initialized( pInUse + 1, oldSize ); - memcpy( pInUse + 1, pArena + 1, oldSize ); + + mark_block_initialized( pInUse + 1, oldActualSize ); + memcpy( pInUse + 1, pArena + 1, oldActualSize ); /* Free the previous block */ @@ -1458,28 +1480,47 @@ pArena = pInUse; } } - else HEAP_ShrinkBlock( subheap, pArena, rounded_size ); /* Shrink the block */ + else + { + HEAP_ShrinkBlock( subheap, pArena, rounded_size ); /* Shrink the block */ + mark_block_initialized( pArena + 1, size ); + } pArena->unused_bytes = (pArena->size & ARENA_SIZE_MASK) - size; /* Clear the extra bytes if needed */ - if (rounded_size > oldSize) + if (size > oldActualSize) { if (flags & HEAP_ZERO_MEMORY) - clear_block( (char *)(pArena + 1) + oldSize, - (pArena->size & ARENA_SIZE_MASK) - oldSize ); + { + clear_block( (char *)(pArena + 1) + oldActualSize, size - oldActualSize ); + mark_block_uninitialized( (char *)(pArena + 1) + size, + (pArena->size & ARENA_SIZE_MASK) - oldActualSize ); + } else - mark_block_uninitialized( (char *)(pArena + 1) + oldSize, - (pArena->size & ARENA_SIZE_MASK) - oldSize ); + mark_block_uninitialized( (char *)(pArena + 1) + oldActualSize, + (pArena->size & ARENA_SIZE_MASK) - oldActualSize ); } /* Return the new arena */ - +done: if (!(flags & HEAP_NO_SERIALIZE)) RtlLeaveHeapLock( &heapPtr->critSection ); - TRACE("(%p,%08lx,%p,%08lx): returning %p\n", heap, flags, ptr, size, pArena + 1 ); return (LPVOID)(pArena + 1); + +oom: + if (!(flags & HEAP_NO_SERIALIZE)) RtlLeaveHeapLock( &heapPtr->critSection ); + if (flags & HEAP_GENERATE_EXCEPTIONS) RtlRaiseStatus( STATUS_NO_MEMORY ); + RtlSetLastWin32ErrorAndNtStatusFromNtStatus( STATUS_NO_MEMORY ); + TRACE("(%p,%08x,%p,%08lx): returning oom\n", heap, flags, ptr, size ); + return NULL; + +error: + if (!(flags & HEAP_NO_SERIALIZE)) RtlLeaveHeapLock( &heapPtr->critSection ); + RtlSetLastWin32ErrorAndNtStatusFromNtStatus( STATUS_INVALID_PARAMETER ); + TRACE("(%p,%08x,%p,%08lx): returning error\n", heap, flags, ptr, size ); + return NULL; } @@ -1583,7 +1624,7 @@ } else { - ARENA_INUSE *pArena = (ARENA_INUSE *)ptr - 1; + const ARENA_INUSE *pArena = (const ARENA_INUSE *)ptr - 1; ret = (pArena->size & ARENA_SIZE_MASK) - pArena->unused_bytes; } if (!(flags & HEAP_NO_SERIALIZE)) RtlLeaveHeapLock( &heapPtr->critSection );
15 years, 11 months
1
0
0
0
[pschweitzer] 38647: Revert r38536
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Thu Jan 8 11:30:56 2009 New Revision: 38647 URL:
http://svn.reactos.org/svn/reactos?rev=38647&view=rev
Log: Revert r38536 Modified: branches/pierre-fsd/ntoskrnl/io/iomgr/iofunc.c Modified: branches/pierre-fsd/ntoskrnl/io/iomgr/iofunc.c URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/ntoskrnl/io/iomgr/io…
============================================================================== --- branches/pierre-fsd/ntoskrnl/io/iomgr/iofunc.c [iso-8859-1] (original) +++ branches/pierre-fsd/ntoskrnl/io/iomgr/iofunc.c [iso-8859-1] Thu Jan 8 11:30:56 2009 @@ -3297,8 +3297,7 @@ } /* Get the device object */ - Status = IoGetRelatedTargetDevice(FileObject, &DeviceObject); - if (!NT_SUCCESS(Status)) return Status; + DeviceObject = IoGetRelatedDeviceObject(FileObject); /* Clear File Object event */ KeClearEvent(&FileObject->Event);
15 years, 11 months
1
0
0
0
[dchapyshev] 38646: - Formatting fix. No code change
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Thu Jan 8 11:21:16 2009 New Revision: 38646 URL:
http://svn.reactos.org/svn/reactos?rev=38646&view=rev
Log: - Formatting fix. No code change Modified: trunk/reactos/dll/win32/user32/misc/resources.c Modified: trunk/reactos/dll/win32/user32/misc/resources.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/misc/reso…
============================================================================== --- trunk/reactos/dll/win32/user32/misc/resources.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/misc/resources.c [iso-8859-1] Thu Jan 8 11:21:16 2009 @@ -20,228 +20,223 @@ static HINSTANCE hSetupApi = NULL; -BOOL WINAPI _InternalLoadString -( - HINSTANCE hInstance, - UINT uID, - PUNICODE_STRING pwstrDest -) -{ - HRSRC hrsStringTable; - HGLOBAL hResource; - PWCHAR pStringTable; - unsigned i; - unsigned l = uID % 16; /* (1) */ - - /* parameter validation */ - if(IsBadWritePtr(pwstrDest, sizeof(UNICODE_STRING))) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - /* - find the string table. String tables are created by grouping, 16 by 16, string - resources whose identifiers, divided by 16, have the same integer quotient. - Holes in the numbering are filled with zero-length strings. String table ids - (actual resource ids) start from 1. See (1) and (2) - */ - /* TODO: some sort of cache, here, would be great */ - hrsStringTable = FindResourceW - ( - (HMODULE)hInstance, - MAKEINTRESOURCEW((uID / 16) + 1), /* (2) */ - RT_STRING - ); - - /* failure */ - if(hrsStringTable == NULL) return FALSE; - - /* load the string table into memory */ - hResource = LoadResource((HMODULE)hInstance, hrsStringTable); - - /* failure */ - if(hResource == NULL) return FALSE; - - /* lock the resource into memory */ - pStringTable = LockResource(hResource); - - /* failure */ - if(pStringTable == NULL) return FALSE; - - /* - string tables are packed Unicode Pascal strings. The first WCHAR contains the - length, in characters, of the current string. Zero-length strings, if any, are - placeholders for unused slots, and should therefore be considered non-present. - See also (3). Here, we walk all the strings before that of interest - */ - for(i = 0; i < l; ++ i) - { - /* skip the length and the current string */ - pStringTable += 1 + (*pStringTable); - } - - /* we've reached the string of interest */ - if((*pStringTable) == 0) - { - /* the string is empty (unallocated) */ - SetLastError(ERROR_RESOURCE_NAME_NOT_FOUND); - return FALSE; /* 3 */ - } - - /* string length in bytes */ - pwstrDest->Length = pwstrDest->MaximumLength = (*pStringTable) * sizeof(WCHAR); - - /* string */ - pwstrDest->Buffer = pStringTable + 1; - - /* success */ - return TRUE; +BOOL +WINAPI +_InternalLoadString(HINSTANCE hInstance, + UINT uID, + PUNICODE_STRING pwstrDest) +{ + HRSRC hrsStringTable; + HGLOBAL hResource; + PWCHAR pStringTable; + unsigned i; + unsigned l = uID % 16; /* (1) */ + + /* parameter validation */ + if (IsBadWritePtr(pwstrDest, sizeof(UNICODE_STRING))) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + /* + find the string table. String tables are created by grouping, 16 by 16, string + resources whose identifiers, divided by 16, have the same integer quotient. + Holes in the numbering are filled with zero-length strings. String table ids + (actual resource ids) start from 1. See (1) and (2) + */ + /* TODO: some sort of cache, here, would be great */ + hrsStringTable = FindResourceW((HMODULE)hInstance, + MAKEINTRESOURCEW((uID / 16) + 1), /* (2) */ + RT_STRING); + + /* failure */ + if (hrsStringTable == NULL) return FALSE; + + /* load the string table into memory */ + hResource = LoadResource((HMODULE)hInstance, hrsStringTable); + + /* failure */ + if (hResource == NULL) return FALSE; + + /* lock the resource into memory */ + pStringTable = LockResource(hResource); + + /* failure */ + if (pStringTable == NULL) return FALSE; + + /* + string tables are packed Unicode Pascal strings. The first WCHAR contains the + length, in characters, of the current string. Zero-length strings, if any, are + placeholders for unused slots, and should therefore be considered non-present. + See also (3). Here, we walk all the strings before that of interest + */ + for(i = 0; i < l; ++ i) + { + /* skip the length and the current string */ + pStringTable += 1 + (*pStringTable); + } + + /* we've reached the string of interest */ + if ((*pStringTable) == 0) + { + /* the string is empty (unallocated) */ + SetLastError(ERROR_RESOURCE_NAME_NOT_FOUND); + return FALSE; /* 3 */ + } + + /* string length in bytes */ + pwstrDest->Length = pwstrDest->MaximumLength = (*pStringTable) * sizeof(WCHAR); + + /* string */ + pwstrDest->Buffer = pStringTable + 1; + + /* success */ + return TRUE; } /* * @implemented */ -int WINAPI LoadStringA -( - HINSTANCE hInstance, - UINT uID, - LPSTR lpBuffer, - int nBufferMax -) -{ - UNICODE_STRING wstrResStr; - ANSI_STRING strBuf; - INT retSize; - - /* parameter validation */ - - if(nBufferMax < 1) - { - return -1; - } - - if(IsBadWritePtr(lpBuffer, nBufferMax * sizeof(lpBuffer[0]))) - { - SetLastError(ERROR_INVALID_PARAMETER); - return 0; - } - - /* get the UNICODE_STRING descriptor of the in-memory image of the string */ - if(!_InternalLoadString(hInstance, uID, &wstrResStr)) - { - /* failure */ - return 0; - } - - /* - convert the string. The Unicode string may be in UTF-16 (multi-byte), so we - don't alter wstrResStr.Length, and let RtlUnicodeStringToAnsiString truncate - it, if necessary - */ - strBuf.Length = 0; - strBuf.MaximumLength = nBufferMax * sizeof(CHAR); - strBuf.Buffer = lpBuffer; - - retSize = WideCharToMultiByte(CP_ACP, 0, wstrResStr.Buffer, - wstrResStr.Length / sizeof(WCHAR), - strBuf.Buffer, strBuf.MaximumLength, NULL, NULL); - - if(!retSize) - { - /* failure */ - return 0; - } - else - { - strBuf.Length = retSize; - } - - /* the ANSI string may not be null-terminated */ - if(strBuf.Length >= strBuf.MaximumLength) - { - /* length greater than the buffer? whatever */ - int nStringLen = strBuf.MaximumLength / sizeof(CHAR) - 1; - - /* zero the last character in the buffer */ - strBuf.Buffer[nStringLen] = 0; - - /* success */ - return nStringLen; - } - else - { - /* zero the last character in the string */ - strBuf.Buffer[strBuf.Length / sizeof(CHAR)] = 0; - - /* success */ - return strBuf.Length / sizeof(CHAR); - } +int +WINAPI +LoadStringA(HINSTANCE hInstance, + UINT uID, + LPSTR lpBuffer, + int nBufferMax) +{ + UNICODE_STRING wstrResStr; + ANSI_STRING strBuf; + INT retSize; + + /* parameter validation */ + + if (nBufferMax < 1) + { + return -1; + } + + if (IsBadWritePtr(lpBuffer, nBufferMax * sizeof(lpBuffer[0]))) + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + + /* get the UNICODE_STRING descriptor of the in-memory image of the string */ + if (!_InternalLoadString(hInstance, uID, &wstrResStr)) + { + /* failure */ + return 0; + } + + /* + convert the string. The Unicode string may be in UTF-16 (multi-byte), so we + don't alter wstrResStr.Length, and let RtlUnicodeStringToAnsiString truncate + it, if necessary + */ + strBuf.Length = 0; + strBuf.MaximumLength = nBufferMax * sizeof(CHAR); + strBuf.Buffer = lpBuffer; + + retSize = WideCharToMultiByte(CP_ACP, + 0, + wstrResStr.Buffer, + wstrResStr.Length / sizeof(WCHAR), + strBuf.Buffer, + strBuf.MaximumLength, + NULL, + NULL); + + if (!retSize) + { + /* failure */ + return 0; + } + else + { + strBuf.Length = retSize; + } + + /* the ANSI string may not be null-terminated */ + if (strBuf.Length >= strBuf.MaximumLength) + { + /* length greater than the buffer? whatever */ + int nStringLen = strBuf.MaximumLength / sizeof(CHAR) - 1; + + /* zero the last character in the buffer */ + strBuf.Buffer[nStringLen] = 0; + + /* success */ + return nStringLen; + } + else + { + /* zero the last character in the string */ + strBuf.Buffer[strBuf.Length / sizeof(CHAR)] = 0; + + /* success */ + return strBuf.Length / sizeof(CHAR); + } } /* * @implemented */ -int WINAPI LoadStringW -( - HINSTANCE hInstance, - UINT uID, - LPWSTR lpBuffer, - int nBufferMax -) -{ - UNICODE_STRING wstrResStr; - int nStringLen; - - /* parameter validation */ - if - ( - (nBufferMax < 0) || - (lpBuffer == NULL) || - ((nBufferMax > 0) && IsBadWritePtr(lpBuffer, nBufferMax * sizeof(lpBuffer[0]))) || - /* undocumented: If nBufferMax is 0, LoadStringW will copy a pointer to the - in-memory image of the string to the specified buffer and return the length - of the string in WCHARs */ - ((nBufferMax == 0) && IsBadWritePtr(lpBuffer, sizeof(lpBuffer))) - ) - { - SetLastError(ERROR_INVALID_PARAMETER); - return 0; - } - - /* get the UNICODE_STRING descriptor of the in-memory image of the string */ - if(!_InternalLoadString(hInstance, uID, &wstrResStr)) - { - /* failure */ - return 0; - } - - /* get the length in characters */ - nStringLen = wstrResStr.Length / sizeof(WCHAR); - - if (nBufferMax > 0) - { - /* the buffer must be enough to contain the string and the null terminator */ - if(nBufferMax < (nStringLen + 1)) - { - /* otherwise, the string is truncated */ - nStringLen = nBufferMax - 1; - } - - /* copy the string */ - memcpy(lpBuffer, wstrResStr.Buffer, nStringLen * sizeof(WCHAR)); - - /* null-terminate it */ - lpBuffer[nStringLen] = 0; - } - else - { - *((LPWSTR*)lpBuffer) = wstrResStr.Buffer; - } - /* success */ - return nStringLen; +int +WINAPI +LoadStringW(HINSTANCE hInstance, + UINT uID, + LPWSTR lpBuffer, + int nBufferMax) +{ + UNICODE_STRING wstrResStr; + int nStringLen; + + /* parameter validation */ + if ((nBufferMax < 0) || (lpBuffer == NULL) || + ((nBufferMax > 0) && IsBadWritePtr(lpBuffer, nBufferMax * sizeof(lpBuffer[0]))) || + /* undocumented: If nBufferMax is 0, LoadStringW will copy a pointer to the + in-memory image of the string to the specified buffer and return the length + of the string in WCHARs */ + ((nBufferMax == 0) && IsBadWritePtr(lpBuffer, sizeof(lpBuffer)))) + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + + /* get the UNICODE_STRING descriptor of the in-memory image of the string */ + if (!_InternalLoadString(hInstance, uID, &wstrResStr)) + { + /* failure */ + return 0; + } + + /* get the length in characters */ + nStringLen = wstrResStr.Length / sizeof(WCHAR); + + if (nBufferMax > 0) + { + /* the buffer must be enough to contain the string and the null terminator */ + if (nBufferMax < (nStringLen + 1)) + { + /* otherwise, the string is truncated */ + nStringLen = nBufferMax - 1; + } + + /* copy the string */ + memcpy(lpBuffer, wstrResStr.Buffer, nStringLen * sizeof(WCHAR)); + + /* null-terminate it */ + lpBuffer[nStringLen] = 0; + } + else + { + *((LPWSTR*)lpBuffer) = wstrResStr.Buffer; + } + /* success */ + return nStringLen; } @@ -250,44 +245,49 @@ */ HDEVNOTIFY WINAPI -RegisterDeviceNotificationW( - HANDLE hRecipient, - LPVOID NotificationFilter, - DWORD Flags - ) -{ - DWORD ConfigRet = 0; - CMP_REGNOTIFY RegNotify = NULL; - HDEVNOTIFY hDevNotify = NULL; - if ( hSetupApi == NULL ) hSetupApi = LoadLibraryA("SETUPAPI.DLL"); - if ( hSetupApi == NULL ) return NULL; - RegNotify = (CMP_REGNOTIFY) GetProcAddress ( hSetupApi, "CMP_RegisterNotification"); - if (RegNotify == NULL) - { - FreeLibrary ( hSetupApi ); - hSetupApi = NULL; - return NULL; - } - ConfigRet = RegNotify ( hRecipient, NotificationFilter, Flags, (PULONG) &hDevNotify); - if (ConfigRet != CR_SUCCESS) - { - switch (ConfigRet) - { - case CR_OUT_OF_MEMORY: - SetLastError (ERROR_NOT_ENOUGH_MEMORY); - break; - case CR_INVALID_POINTER: - SetLastError (ERROR_INVALID_PARAMETER); - break; - case CR_INVALID_DATA: - SetLastError (ERROR_INVALID_DATA); - break; - default: - SetLastError (ERROR_SERVICE_SPECIFIC_ERROR); - break; - } - } - return hDevNotify; +RegisterDeviceNotificationW(HANDLE hRecipient, + LPVOID NotificationFilter, + DWORD Flags) +{ + DWORD ConfigRet = 0; + CMP_REGNOTIFY RegNotify = NULL; + HDEVNOTIFY hDevNotify = NULL; + + if (hSetupApi == NULL) hSetupApi = LoadLibraryA("SETUPAPI.DLL"); + if (hSetupApi == NULL) return NULL; + + RegNotify = (CMP_REGNOTIFY) GetProcAddress(hSetupApi, "CMP_RegisterNotification"); + if (RegNotify == NULL) + { + FreeLibrary(hSetupApi); + hSetupApi = NULL; + return NULL; + } + + ConfigRet = RegNotify(hRecipient, NotificationFilter, Flags, (PULONG) &hDevNotify); + if (ConfigRet != CR_SUCCESS) + { + switch (ConfigRet) + { + case CR_OUT_OF_MEMORY: + SetLastError (ERROR_NOT_ENOUGH_MEMORY); + break; + + case CR_INVALID_POINTER: + SetLastError (ERROR_INVALID_PARAMETER); + break; + + case CR_INVALID_DATA: + SetLastError (ERROR_INVALID_DATA); + break; + + default: + SetLastError (ERROR_SERVICE_SPECIFIC_ERROR); + break; + } + } + + return hDevNotify; } @@ -296,38 +296,43 @@ */ BOOL WINAPI -UnregisterDeviceNotification( - HDEVNOTIFY Handle) -{ - DWORD ConfigRet = 0; - CMP_UNREGNOTIFY UnRegNotify = NULL; - if ( hSetupApi == NULL ) hSetupApi = LoadLibraryA("SETUPAPI.DLL"); - if ( hSetupApi == NULL ) return FALSE; - UnRegNotify = (CMP_UNREGNOTIFY) GetProcAddress ( hSetupApi, "CMP_UnregisterNotification"); - if (UnRegNotify == NULL) - { - FreeLibrary ( hSetupApi ); - hSetupApi = NULL; - return FALSE; - } - ConfigRet = UnRegNotify ( (ULONG) Handle ); - if (ConfigRet != CR_SUCCESS) - { - switch (ConfigRet) - { - case CR_INVALID_POINTER: - SetLastError (ERROR_INVALID_PARAMETER); - break; - case CR_INVALID_DATA: - SetLastError (ERROR_INVALID_DATA); - break; - default: - SetLastError (ERROR_SERVICE_SPECIFIC_ERROR); - break; - } - return FALSE; - } - return TRUE; +UnregisterDeviceNotification(HDEVNOTIFY Handle) +{ + DWORD ConfigRet = 0; + CMP_UNREGNOTIFY UnRegNotify = NULL; + + if (hSetupApi == NULL) hSetupApi = LoadLibraryA("SETUPAPI.DLL"); + if (hSetupApi == NULL) return FALSE; + + UnRegNotify = (CMP_UNREGNOTIFY) GetProcAddress(hSetupApi, "CMP_UnregisterNotification"); + if (UnRegNotify == NULL) + { + FreeLibrary(hSetupApi); + hSetupApi = NULL; + return FALSE; + } + + ConfigRet = UnRegNotify((ULONG) Handle ); + if (ConfigRet != CR_SUCCESS) + { + switch (ConfigRet) + { + case CR_INVALID_POINTER: + SetLastError (ERROR_INVALID_PARAMETER); + break; + + case CR_INVALID_DATA: + SetLastError (ERROR_INVALID_DATA); + break; + + default: + SetLastError (ERROR_SERVICE_SPECIFIC_ERROR); + break; + } + return FALSE; + } + + return TRUE; } /* EOF */
15 years, 11 months
1
0
0
0
[tkreuzer] 38645: Rename BITMAPOBJ to SURFACE as it's called on windows. Also rename related functions and variables.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Jan 8 10:33:40 2009 New Revision: 38645 URL:
http://svn.reactos.org/svn/reactos?rev=38645&view=rev
Log: Rename BITMAPOBJ to SURFACE as it's called on windows. Also rename related functions and variables. Modified: trunk/reactos/subsystems/win32/win32k/eng/bitblt.c trunk/reactos/subsystems/win32/win32k/eng/copybits.c trunk/reactos/subsystems/win32/win32k/eng/engmisc.c trunk/reactos/subsystems/win32/win32k/eng/gradient.c trunk/reactos/subsystems/win32/win32k/eng/lineto.c trunk/reactos/subsystems/win32/win32k/eng/mouse.c trunk/reactos/subsystems/win32/win32k/eng/paint.c trunk/reactos/subsystems/win32/win32k/eng/surface.c trunk/reactos/subsystems/win32/win32k/eng/transblt.c trunk/reactos/subsystems/win32/win32k/eng/xlate.c trunk/reactos/subsystems/win32/win32k/include/bitmaps.h trunk/reactos/subsystems/win32/win32k/include/dc.h trunk/reactos/subsystems/win32/win32k/include/intgdi.h trunk/reactos/subsystems/win32/win32k/include/paint.h trunk/reactos/subsystems/win32/win32k/include/surface.h trunk/reactos/subsystems/win32/win32k/include/tags.h trunk/reactos/subsystems/win32/win32k/ntuser/clipboard.c trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c trunk/reactos/subsystems/win32/win32k/ntuser/input.c trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c trunk/reactos/subsystems/win32/win32k/objects/arc.c trunk/reactos/subsystems/win32/win32k/objects/bitblt.c trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c trunk/reactos/subsystems/win32/win32k/objects/brush.c trunk/reactos/subsystems/win32/win32k/objects/dibobj.c trunk/reactos/subsystems/win32/win32k/objects/drawing.c trunk/reactos/subsystems/win32/win32k/objects/fillshap.c trunk/reactos/subsystems/win32/win32k/objects/freetype.c trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c trunk/reactos/subsystems/win32/win32k/objects/line.c trunk/reactos/subsystems/win32/win32k/objects/polyfill.c trunk/reactos/subsystems/win32/win32k/objects/print.c trunk/reactos/subsystems/win32/win32k/objects/region.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/subsystems/win32/win32k/eng/bitblt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
Modified: trunk/reactos/subsystems/win32/win32k/eng/copybits.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
Modified: trunk/reactos/subsystems/win32/win32k/eng/engmisc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
Modified: trunk/reactos/subsystems/win32/win32k/eng/gradient.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
Modified: trunk/reactos/subsystems/win32/win32k/eng/lineto.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
Modified: trunk/reactos/subsystems/win32/win32k/eng/mouse.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
Modified: trunk/reactos/subsystems/win32/win32k/eng/paint.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
Modified: trunk/reactos/subsystems/win32/win32k/eng/surface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
Modified: trunk/reactos/subsystems/win32/win32k/eng/transblt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
Modified: trunk/reactos/subsystems/win32/win32k/eng/xlate.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
Modified: trunk/reactos/subsystems/win32/win32k/include/bitmaps.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
Modified: trunk/reactos/subsystems/win32/win32k/include/dc.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
Modified: trunk/reactos/subsystems/win32/win32k/include/intgdi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
Modified: trunk/reactos/subsystems/win32/win32k/include/paint.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
Modified: trunk/reactos/subsystems/win32/win32k/include/surface.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
Modified: trunk/reactos/subsystems/win32/win32k/include/tags.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/clipboard.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/input.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
Modified: trunk/reactos/subsystems/win32/win32k/objects/arc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
Modified: trunk/reactos/subsystems/win32/win32k/objects/bitblt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
Modified: trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
Modified: trunk/reactos/subsystems/win32/win32k/objects/brush.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
Modified: trunk/reactos/subsystems/win32/win32k/objects/dibobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
Modified: trunk/reactos/subsystems/win32/win32k/objects/drawing.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
Modified: trunk/reactos/subsystems/win32/win32k/objects/fillshap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
Modified: trunk/reactos/subsystems/win32/win32k/objects/freetype.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
Modified: trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
Modified: trunk/reactos/subsystems/win32/win32k/objects/line.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
Modified: trunk/reactos/subsystems/win32/win32k/objects/polyfill.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
Modified: trunk/reactos/subsystems/win32/win32k/objects/print.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
Modified: trunk/reactos/subsystems/win32/win32k/objects/region.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
15 years, 11 months
1
0
0
0
[dchapyshev] 38644: - Implement devices status page - More partly implementation
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Thu Jan 8 08:24:45 2009 New Revision: 38644 URL:
http://svn.reactos.org/svn/reactos?rev=38644&view=rev
Log: - Implement devices status page - More partly implementation Modified: trunk/reactos/dll/cpl/hdwwiz/hdwwiz.c trunk/reactos/dll/cpl/hdwwiz/hdwwiz.h trunk/reactos/dll/cpl/hdwwiz/hdwwiz.rbuild trunk/reactos/dll/cpl/hdwwiz/lang/bg-BG.rc trunk/reactos/dll/cpl/hdwwiz/lang/cs-CZ.rc trunk/reactos/dll/cpl/hdwwiz/lang/de-DE.rc trunk/reactos/dll/cpl/hdwwiz/lang/el-GR.rc trunk/reactos/dll/cpl/hdwwiz/lang/en-US.rc trunk/reactos/dll/cpl/hdwwiz/lang/es-ES.rc trunk/reactos/dll/cpl/hdwwiz/lang/fr-FR.rc trunk/reactos/dll/cpl/hdwwiz/lang/hu-HU.rc trunk/reactos/dll/cpl/hdwwiz/lang/id-ID.rc trunk/reactos/dll/cpl/hdwwiz/lang/it-IT.rc trunk/reactos/dll/cpl/hdwwiz/lang/ja-JP.rc trunk/reactos/dll/cpl/hdwwiz/lang/nl-NL.rc trunk/reactos/dll/cpl/hdwwiz/lang/no-NO.rc trunk/reactos/dll/cpl/hdwwiz/lang/pl-PL.rc trunk/reactos/dll/cpl/hdwwiz/lang/pt-BR.rc trunk/reactos/dll/cpl/hdwwiz/lang/ru-RU.rc trunk/reactos/dll/cpl/hdwwiz/lang/sk-SK.rc trunk/reactos/dll/cpl/hdwwiz/lang/th-TH.rc trunk/reactos/dll/cpl/hdwwiz/lang/uk-UA.rc trunk/reactos/dll/cpl/hdwwiz/lang/zh-CN.rc trunk/reactos/dll/cpl/hdwwiz/resource.h Modified: trunk/reactos/dll/cpl/hdwwiz/hdwwiz.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/hdwwiz.c?re…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/hdwwiz.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/hdwwiz.c [iso-8859-1] Thu Jan 8 08:24:45 2009 @@ -32,6 +32,8 @@ HINSTANCE hApplet = NULL; HFONT hTitleFont; SP_CLASSIMAGELIST_DATA ImageListData; +PWSTR pDeviceStatusText; +HANDLE hProcessHeap; typedef BOOL (WINAPI *PINSTALL_NEW_DEVICE)(HWND, LPGUID, PDWORD); @@ -74,6 +76,21 @@ SendDlgItemMessage(hwndDlg, IDC_FINISHTITLE, WM_SETFONT, (WPARAM)hTitleFont, (LPARAM)TRUE); } break; + + case WM_NOTIFY: + { + LPNMHDR lpnm = (LPNMHDR)lParam; + + switch (lpnm->code) + { + case PSN_SETACTIVE: + { + PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_NEXT); + } + break; + } + } + break; } return FALSE; @@ -82,6 +99,30 @@ static INT_PTR CALLBACK SearchPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { + switch (uMsg) + { + case WM_INITDIALOG: + { + /* TODO: PnP devices search */ + } + break; + + case WM_NOTIFY: + { + LPNMHDR lpnm = (LPNMHDR)lParam; + + switch (lpnm->code) + { + case PSN_SETACTIVE: + { + PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_NEXT | PSWIZB_BACK); + } + break; + } + } + break; + } + return FALSE; } @@ -239,8 +280,10 @@ { LV_COLUMN Column; LV_ITEM Item; - WCHAR szBuffer[MAX_STR_SIZE], szGuid[MAX_STR_SIZE], szTrimGuid[MAX_STR_SIZE]; + WCHAR szBuffer[MAX_STR_SIZE], szGuid[MAX_STR_SIZE], + szTrimGuid[MAX_STR_SIZE], szStatusText[MAX_STR_SIZE]; HWND hList = GetDlgItem(hwndDlg, IDC_PROBELIST); + PWSTR pstrStatusText; HDEVINFO hDevInfo; SP_DEVINFO_DATA DevInfoData; ULONG ulStatus, ulProblemNumber; @@ -325,9 +368,19 @@ &ClassGuid, &Item.iImage); + DeviceProblemTextW(NULL, + DevInfoData.DevInst, + ulProblemNumber, + szStatusText, + sizeof(szStatusText) / sizeof(WCHAR)); + + pstrStatusText = (PWSTR)HeapAlloc(hProcessHeap, 0, sizeof(szStatusText)); + lstrcpy(pstrStatusText, szStatusText); + /* Set device name */ - Item.pszText = (LPTSTR) szBuffer; + Item.pszText = (LPWSTR) szBuffer; Item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE; + Item.lParam = (LPARAM) pstrStatusText; Item.iItem = (INT) ListView_GetItemCount(hList); (VOID) ListView_InsertItem(hList, &Item); @@ -341,10 +394,13 @@ static INT_PTR CALLBACK ProbeListPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { + INT Index; + switch (uMsg) { case WM_INITDIALOG: { + pDeviceStatusText = (PWSTR)HeapAlloc(hProcessHeap, 0, MAX_STR_SIZE); InitProbeListPage(hwndDlg); } break; @@ -367,9 +423,102 @@ } break; + case NM_CLICK: + { + Index = (INT) SendMessage(GetDlgItem(hwndDlg, IDC_PROBELIST), LVM_GETNEXTITEM, -1, LVNI_FOCUSED); + if (Index != -1) + { + PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_BACK | PSWIZB_NEXT); + } + } + break; + case PSN_WIZNEXT: { - SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_FINISHPAGE); + Index = (INT) SendMessage(GetDlgItem(hwndDlg, IDC_PROBELIST), LVM_GETNEXTITEM, -1, LVNI_FOCUSED); + if (Index != -1) + { + if (Index == 0) + { + SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_SELECTWAYPAGE); + } + else + { + LVITEM Item; + PWSTR pts; + + ZeroMemory(&Item, sizeof(LV_ITEM)); + Item.mask = LVIF_PARAM; + Item.iItem = Index; + (VOID) ListView_GetItem(GetDlgItem(hwndDlg, IDC_PROBELIST), &Item); + pts = (PWSTR) Item.lParam; + wcscpy(pDeviceStatusText, pts); + + SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_HWSTATUSPAGE); + } + } + return TRUE; + } + } + } + break; + + case WM_DESTROY: + { + INT Index; + LVITEM Item; + + for (Index = ListView_GetItemCount(GetDlgItem(hwndDlg, IDC_PROBELIST)); --Index > 0;) + { + ZeroMemory(&Item, sizeof(LV_ITEM)); + Item.mask = LVIF_PARAM; + Item.iItem = Index; + (VOID) ListView_GetItem(GetDlgItem(hwndDlg, IDC_PROBELIST), &Item); + HeapFree(hProcessHeap, 0, (LPVOID) Item.lParam); + } + HeapFree(hProcessHeap, 0, (LPVOID) pDeviceStatusText); + } + break; + } + + return FALSE; +} + +static INT_PTR CALLBACK +SelectWayPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + return FALSE; +} + +static INT_PTR CALLBACK +DevStatusPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + switch (uMsg) + { + case WM_INITDIALOG: + { + /* Set title font */ + SendDlgItemMessage(hwndDlg, IDC_FINISHTITLE, WM_SETFONT, (WPARAM)hTitleFont, (LPARAM)TRUE); + /* Set status text */ + SetWindowText(GetDlgItem(hwndDlg, IDC_HWSTATUSEDIT), pDeviceStatusText); + } + break; + + case WM_NOTIFY: + { + LPNMHDR lpnm = (LPNMHDR)lParam; + + switch (lpnm->code) + { + case PSN_SETACTIVE: + { + PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_FINISH | PSWIZB_BACK); + } + break; + + case PSN_WIZBACK: + { + SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_PROBELISTPAGE); return TRUE; } } @@ -383,7 +532,7 @@ static VOID HardwareWizardInit(HWND hwnd) { - HPROPSHEETPAGE ahpsp[6]; + HPROPSHEETPAGE ahpsp[8]; PROPSHEETPAGE psp = {0}; PROPSHEETHEADER psh; UINT nPages = 0; @@ -430,6 +579,26 @@ psp.pszTemplate = MAKEINTRESOURCE(IDD_PROBELISTPAGE); ahpsp[nPages++] = CreatePropertySheetPage(&psp); + /* Create select search way page */ + psp.dwSize = sizeof(PROPSHEETPAGE); + psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE; + psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_SELECTWAYTITLE); + psp.pszHeaderSubTitle = NULL; + psp.hInstance = hApplet; + psp.lParam = 0; + psp.pfnDlgProc = SelectWayPageDlgProc; + psp.pszTemplate = MAKEINTRESOURCE(IDD_SELECTWAYPAGE); + ahpsp[nPages++] = CreatePropertySheetPage(&psp); + + /* Create device status page */ + psp.dwSize = sizeof(PROPSHEETPAGE); + psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER; + psp.hInstance = hApplet; + psp.lParam = 0; + psp.pfnDlgProc = DevStatusPageDlgProc; + psp.pszTemplate = MAKEINTRESOURCE(IDD_HWSTATUSPAGE); + ahpsp[nPages++] = CreatePropertySheetPage(&psp); + /* Create finish page */ psp.dwSize = sizeof(PROPSHEETPAGE); psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER; @@ -527,6 +696,7 @@ { case DLL_PROCESS_ATTACH: hApplet = hinstDLL; + hProcessHeap = GetProcessHeap(); DisableThreadLibraryCalls(hinstDLL); break; } Modified: trunk/reactos/dll/cpl/hdwwiz/hdwwiz.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/hdwwiz.h?re…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/hdwwiz.h [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/hdwwiz.h [iso-8859-1] Thu Jan 8 08:24:45 2009 @@ -5,14 +5,17 @@ #include <commctrl.h> #include <setupapi.h> #include <cfgmgr32.h> +#include <reactos/dll/devmgr/devmgr.h> #include <cpl.h> #include <tchar.h> +#include <stdlib.h> #include <stdio.h> +#include <malloc.h> #define NDEBUG #include <debug.h> -#define MAX_STR_SIZE 256 +#define MAX_STR_SIZE 255 extern HINSTANCE hApplet; Modified: trunk/reactos/dll/cpl/hdwwiz/hdwwiz.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/hdwwiz.rbui…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/hdwwiz.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/hdwwiz.rbuild [iso-8859-1] Thu Jan 8 08:24:45 2009 @@ -10,6 +10,8 @@ <library>rpcrt4</library> <library>user32</library> <library>gdi32</library> + <library>devmgr</library> + <library>ntdll</library> <file>hdwwiz.c</file> <file>hdwwiz.rc</file> </module> Modified: trunk/reactos/dll/cpl/hdwwiz/lang/bg-BG.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/lang/bg-BG.…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/lang/bg-BG.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/lang/bg-BG.rc [iso-8859-1] Thu Jan 8 08:24:45 2009 @@ -142,4 +142,5 @@ IDS_ISCONNECTED "Is the hardware connected?" IDS_PROBELISTTITLE "The following hardware is already installed on your computer" IDS_ADDNEWDEVICE "Add a new hardware device" + IDS_SELECTWAYTITLE "The wizard can help you install other hardware" END Modified: trunk/reactos/dll/cpl/hdwwiz/lang/cs-CZ.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/lang/cs-CZ.…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/lang/cs-CZ.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/lang/cs-CZ.rc [iso-8859-1] Thu Jan 8 08:24:45 2009 @@ -142,4 +142,5 @@ IDS_ISCONNECTED "Is the hardware connected?" IDS_PROBELISTTITLE "The following hardware is already installed on your computer" IDS_ADDNEWDEVICE "Add a new hardware device" + IDS_SELECTWAYTITLE "The wizard can help you install other hardware" END Modified: trunk/reactos/dll/cpl/hdwwiz/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/lang/de-DE.…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/lang/de-DE.rc [iso-8859-1] Thu Jan 8 08:24:45 2009 @@ -142,4 +142,5 @@ IDS_ISCONNECTED "Is the hardware connected?" IDS_PROBELISTTITLE "The following hardware is already installed on your computer" IDS_ADDNEWDEVICE "Add a new hardware device" + IDS_SELECTWAYTITLE "The wizard can help you install other hardware" END Modified: trunk/reactos/dll/cpl/hdwwiz/lang/el-GR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/lang/el-GR.…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/lang/el-GR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/lang/el-GR.rc [iso-8859-1] Thu Jan 8 08:24:45 2009 @@ -142,4 +142,5 @@ IDS_ISCONNECTED "Is the hardware connected?" IDS_PROBELISTTITLE "The following hardware is already installed on your computer" IDS_ADDNEWDEVICE "Add a new hardware device" + IDS_SELECTWAYTITLE "The wizard can help you install other hardware" END Modified: trunk/reactos/dll/cpl/hdwwiz/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/lang/en-US.…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/lang/en-US.rc [iso-8859-1] Thu Jan 8 08:24:45 2009 @@ -142,4 +142,5 @@ IDS_ISCONNECTED "Is the hardware connected?" IDS_PROBELISTTITLE "The following hardware is already installed on your computer" IDS_ADDNEWDEVICE "Add a new hardware device" + IDS_SELECTWAYTITLE "The wizard can help you install other hardware" END Modified: trunk/reactos/dll/cpl/hdwwiz/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/lang/es-ES.…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/lang/es-ES.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/lang/es-ES.rc [iso-8859-1] Thu Jan 8 08:24:45 2009 @@ -142,4 +142,5 @@ IDS_ISCONNECTED "Is the hardware connected?" IDS_PROBELISTTITLE "The following hardware is already installed on your computer" IDS_ADDNEWDEVICE "Add a new hardware device" + IDS_SELECTWAYTITLE "The wizard can help you install other hardware" END Modified: trunk/reactos/dll/cpl/hdwwiz/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/lang/fr-FR.…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/lang/fr-FR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/lang/fr-FR.rc [iso-8859-1] Thu Jan 8 08:24:45 2009 @@ -142,4 +142,5 @@ IDS_ISCONNECTED "Is the hardware connected?" IDS_PROBELISTTITLE "The following hardware is already installed on your computer" IDS_ADDNEWDEVICE "Add a new hardware device" + IDS_SELECTWAYTITLE "The wizard can help you install other hardware" END Modified: trunk/reactos/dll/cpl/hdwwiz/lang/hu-HU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/lang/hu-HU.…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/lang/hu-HU.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/lang/hu-HU.rc [iso-8859-1] Thu Jan 8 08:24:45 2009 @@ -143,4 +143,5 @@ IDS_ISCONNECTED "Is the hardware connected?" IDS_PROBELISTTITLE "The following hardware is already installed on your computer" IDS_ADDNEWDEVICE "Add a new hardware device" + IDS_SELECTWAYTITLE "The wizard can help you install other hardware" END Modified: trunk/reactos/dll/cpl/hdwwiz/lang/id-ID.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/lang/id-ID.…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/lang/id-ID.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/lang/id-ID.rc [iso-8859-1] Thu Jan 8 08:24:45 2009 @@ -142,4 +142,5 @@ IDS_ISCONNECTED "Is the hardware connected?" IDS_PROBELISTTITLE "The following hardware is already installed on your computer" IDS_ADDNEWDEVICE "Add a new hardware device" + IDS_SELECTWAYTITLE "The wizard can help you install other hardware" END Modified: trunk/reactos/dll/cpl/hdwwiz/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/lang/it-IT.…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/lang/it-IT.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/lang/it-IT.rc [iso-8859-1] Thu Jan 8 08:24:45 2009 @@ -142,4 +142,5 @@ IDS_ISCONNECTED "Is the hardware connected?" IDS_PROBELISTTITLE "The following hardware is already installed on your computer" IDS_ADDNEWDEVICE "Add a new hardware device" + IDS_SELECTWAYTITLE "The wizard can help you install other hardware" END Modified: trunk/reactos/dll/cpl/hdwwiz/lang/ja-JP.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/lang/ja-JP.…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/lang/ja-JP.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/lang/ja-JP.rc [iso-8859-1] Thu Jan 8 08:24:45 2009 @@ -142,4 +142,5 @@ IDS_ISCONNECTED "Is the hardware connected?" IDS_PROBELISTTITLE "The following hardware is already installed on your computer" IDS_ADDNEWDEVICE "Add a new hardware device" + IDS_SELECTWAYTITLE "The wizard can help you install other hardware" END Modified: trunk/reactos/dll/cpl/hdwwiz/lang/nl-NL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/lang/nl-NL.…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/lang/nl-NL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/lang/nl-NL.rc [iso-8859-1] Thu Jan 8 08:24:45 2009 @@ -142,4 +142,5 @@ IDS_ISCONNECTED "Is the hardware connected?" IDS_PROBELISTTITLE "The following hardware is already installed on your computer" IDS_ADDNEWDEVICE "Add a new hardware device" + IDS_SELECTWAYTITLE "The wizard can help you install other hardware" END Modified: trunk/reactos/dll/cpl/hdwwiz/lang/no-NO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/lang/no-NO.…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/lang/no-NO.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/lang/no-NO.rc [iso-8859-1] Thu Jan 8 08:24:45 2009 @@ -142,4 +142,5 @@ IDS_ISCONNECTED "Is the hardware connected?" IDS_PROBELISTTITLE "The following hardware is already installed on your computer" IDS_ADDNEWDEVICE "Add a new hardware device" + IDS_SELECTWAYTITLE "The wizard can help you install other hardware" END Modified: trunk/reactos/dll/cpl/hdwwiz/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/lang/pl-PL.…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/lang/pl-PL.rc [iso-8859-1] Thu Jan 8 08:24:45 2009 @@ -147,4 +147,5 @@ IDS_ISCONNECTED "Is the hardware connected?" IDS_PROBELISTTITLE "The following hardware is already installed on your computer" IDS_ADDNEWDEVICE "Add a new hardware device" + IDS_SELECTWAYTITLE "The wizard can help you install other hardware" END Modified: trunk/reactos/dll/cpl/hdwwiz/lang/pt-BR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/lang/pt-BR.…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/lang/pt-BR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/lang/pt-BR.rc [iso-8859-1] Thu Jan 8 08:24:45 2009 @@ -142,4 +142,5 @@ IDS_ISCONNECTED "Is the hardware connected?" IDS_PROBELISTTITLE "The following hardware is already installed on your computer" IDS_ADDNEWDEVICE "Add a new hardware device" + IDS_SELECTWAYTITLE "The wizard can help you install other hardware" END Modified: trunk/reactos/dll/cpl/hdwwiz/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/lang/ru-RU.…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/lang/ru-RU.rc [iso-8859-1] Thu Jan 8 08:24:45 2009 @@ -142,4 +142,5 @@ IDS_ISCONNECTED "Ïîäêëþ÷åíî ëè óñòðîéñòâî?" IDS_PROBELISTTITLE "Íà ýòîì êîìïüþòåðå óæå óñòàíîâëåíî ñëåäóþùåå îáîðóäîâàíèå" IDS_ADDNEWDEVICE "Äîáàâëåíèå íîâîãî óñòðîéñòâà" + IDS_SELECTWAYTITLE "The wizard can help you install other hardware" END Modified: trunk/reactos/dll/cpl/hdwwiz/lang/sk-SK.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/lang/sk-SK.…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/lang/sk-SK.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/lang/sk-SK.rc [iso-8859-1] Thu Jan 8 08:24:45 2009 @@ -146,4 +146,5 @@ IDS_ISCONNECTED "Is the hardware connected?" IDS_PROBELISTTITLE "The following hardware is already installed on your computer" IDS_ADDNEWDEVICE "Add a new hardware device" + IDS_SELECTWAYTITLE "The wizard can help you install other hardware" END Modified: trunk/reactos/dll/cpl/hdwwiz/lang/th-TH.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/lang/th-TH.…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/lang/th-TH.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/lang/th-TH.rc [iso-8859-1] Thu Jan 8 08:24:45 2009 @@ -142,4 +142,5 @@ IDS_ISCONNECTED "Is the hardware connected?" IDS_PROBELISTTITLE "The following hardware is already installed on your computer" IDS_ADDNEWDEVICE "Add a new hardware device" + IDS_SELECTWAYTITLE "The wizard can help you install other hardware" END Modified: trunk/reactos/dll/cpl/hdwwiz/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/lang/uk-UA.…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/lang/uk-UA.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/lang/uk-UA.rc [iso-8859-1] Thu Jan 8 08:24:45 2009 @@ -150,4 +150,5 @@ IDS_ISCONNECTED "Is the hardware connected?" IDS_PROBELISTTITLE "The following hardware is already installed on your computer" IDS_ADDNEWDEVICE "Add a new hardware device" + IDS_SELECTWAYTITLE "The wizard can help you install other hardware" END Modified: trunk/reactos/dll/cpl/hdwwiz/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/lang/zh-CN.…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/lang/zh-CN.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/lang/zh-CN.rc [iso-8859-1] Thu Jan 8 08:24:45 2009 @@ -148,4 +148,5 @@ IDS_ISCONNECTED "Is the hardware connected?" IDS_PROBELISTTITLE "The following hardware is already installed on your computer" IDS_ADDNEWDEVICE "Add a new hardware device" + IDS_SELECTWAYTITLE "The wizard can help you install other hardware" END Modified: trunk/reactos/dll/cpl/hdwwiz/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/resource.h?…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/resource.h [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/resource.h [iso-8859-1] Thu Jan 8 08:24:45 2009 @@ -16,6 +16,7 @@ #define IDS_PROBELISTTITLE 1005 #define IDS_SEARCHTEXT 1020 #define IDS_SEARCHTITLE 1025 +#define IDS_SELECTWAYTITLE 1027 #define IDS_ADDNEWDEVICE 1081 #define IDS_ISCONNECTED 1113
15 years, 11 months
1
0
0
0
[dreimer] 38643: Sync to Wine HEAD. Done with my first try of a autosync script for the normal apps.
by dreimer@svn.reactos.org
Author: dreimer Date: Thu Jan 8 08:08:17 2009 New Revision: 38643 URL:
http://svn.reactos.org/svn/reactos?rev=38643&view=rev
Log: Sync to Wine HEAD. Done with my first try of a autosync script for the normal apps. Modified: trunk/reactos/base/applications/cmdutils/xcopy/xcopy.c trunk/reactos/base/applications/winhlp32/lex.yy.c trunk/reactos/base/applications/winhlp32/winhelp.c trunk/reactos/base/applications/winhlp32/winhelp.h Modified: trunk/reactos/base/applications/cmdutils/xcopy/xcopy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/xcopy/xcopy.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/xcopy/xcopy.c [iso-8859-1] Thu Jan 8 08:08:17 2009 @@ -43,6 +43,7 @@ #include <stdio.h> #include <windows.h> #include <wine/debug.h> +#include <wine/unicode.h> #include "xcopy.h" WINE_DEFAULT_DEBUG_CHANNEL(xcopy); @@ -999,9 +1000,8 @@ return 0; } - /* Use wvsprintf to store output into unicode buffer */ va_start(parms, format); - len = vswprintf(output_bufW, format, parms); + len = vsnprintfW(output_bufW, MAX_WRITECONSOLE_SIZE/sizeof(WCHAR), format, parms); va_end(parms); /* Try to write as unicode all the time we think its a console */ Modified: trunk/reactos/base/applications/winhlp32/lex.yy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winhlp32…
============================================================================== --- trunk/reactos/base/applications/winhlp32/lex.yy.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/winhlp32/lex.yy.c [iso-8859-1] Thu Jan 8 08:08:17 2009 @@ -1670,7 +1670,7 @@ void macro_test(void) { WNDPROC lpfnDlg = MakeProcInstance(MACRO_TestDialogProc, Globals.hInstance); - DialogBox(Globals.hInstance, STRING_DIALOG_TEST, Globals.active_win->hMainWnd, lpfnDlg); + DialogBox(Globals.hInstance, STRING_DIALOG_TEST, Globals.active_win->hMainWnd, (DLGPROC)lpfnDlg); FreeProcInstance(lpfnDlg); macro = szTestMacro; } Modified: trunk/reactos/base/applications/winhlp32/winhelp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winhlp32…
============================================================================== --- trunk/reactos/base/applications/winhlp32/winhelp.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/winhlp32/winhelp.c [iso-8859-1] Thu Jan 8 08:08:17 2009 @@ -46,23 +46,98 @@ WINE_DEFAULT_DEBUG_CHANNEL(winhelp); -static BOOL WINHELP_RegisterWinClasses(void); -static LRESULT CALLBACK WINHELP_MainWndProc(HWND, UINT, WPARAM, LPARAM); -static LRESULT CALLBACK WINHELP_ButtonBoxWndProc(HWND, UINT, WPARAM, LPARAM); -static LRESULT CALLBACK WINHELP_ButtonWndProc(HWND, UINT, WPARAM, LPARAM); -static LRESULT CALLBACK WINHELP_HistoryWndProc(HWND, UINT, WPARAM, LPARAM); -static LRESULT CALLBACK WINHELP_ShadowWndProc(HWND, UINT, WPARAM, LPARAM); -static BOOL WINHELP_CheckPopup(HWND, UINT, WPARAM, LPARAM, LRESULT*); -static void WINHELP_InitFonts(HWND hWnd); -static void WINHELP_DeleteWindow(WINHELP_WINDOW*); -static void WINHELP_DeleteButtons(WINHELP_WINDOW*); -static void WINHELP_SetupText(HWND hWnd, WINHELP_WINDOW *win, ULONG relative); -static void WINHELP_DeletePageLinks(HLPFILE_PAGE* page); - WINHELP_GLOBALS Globals = {3, NULL, TRUE, NULL, NULL, NULL, NULL, NULL, {{{NULL,NULL}},0}, NULL}; #define CTL_ID_BUTTON 0x700 #define CTL_ID_TEXT 0x701 + + +/*********************************************************************** + * + * WINHELP_InitFonts + */ +static void WINHELP_InitFonts(HWND hWnd) +{ + WINHELP_WINDOW *win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); + LOGFONT logfontlist[] = { + {-10, 0, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, + {-12, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, + {-12, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, + {-12, 0, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, + {-12, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, + {-10, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, + { -8, 0, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}}; +#define FONTS_LEN (sizeof(logfontlist)/sizeof(*logfontlist)) + + static HFONT fonts[FONTS_LEN]; + static BOOL init = 0; + + win->fonts_len = FONTS_LEN; + win->fonts = fonts; + + if (!init) + { + UINT i; + + for (i = 0; i < FONTS_LEN; i++) + { + fonts[i] = CreateFontIndirect(&logfontlist[i]); + } + + init = 1; + } +} + +static DWORD CALLBACK WINHELP_RtfStreamIn(DWORD_PTR cookie, BYTE* buff, + LONG cb, LONG* pcb) +{ + struct RtfData* rd = (struct RtfData*)cookie; + + if (rd->where >= rd->ptr) return 1; + if (rd->where + cb > rd->ptr) + cb = rd->ptr - rd->where; + memcpy(buff, rd->where, cb); + rd->where += cb; + *pcb = cb; + return 0; +} + +static void WINHELP_SetupText(HWND hTextWnd, WINHELP_WINDOW* win, ULONG relative) +{ + /* At first clear area - needed by EM_POSFROMCHAR/EM_SETSCROLLPOS */ + SendMessage(hTextWnd, WM_SETTEXT, 0, (LPARAM)""); + SendMessage(hTextWnd, WM_SETREDRAW, FALSE, 0); + SendMessage(hTextWnd, EM_SETBKGNDCOLOR, 0, (LPARAM)win->info->sr_color); + /* set word-wrap to window size (undocumented) */ + SendMessage(hTextWnd, EM_SETTARGETDEVICE, 0, 0); + if (win->page) + { + struct RtfData rd; + EDITSTREAM es; + unsigned cp = 0; + POINTL ptl; + POINT pt; + + + if (HLPFILE_BrowsePage(win->page, &rd, win->font_scale, relative)) + { + rd.where = rd.data; + es.dwCookie = (DWORD_PTR)&rd; + es.dwError = 0; + es.pfnCallback = WINHELP_RtfStreamIn; + + SendMessageW(hTextWnd, EM_STREAMIN, SF_RTF, (LPARAM)&es); + cp = rd.char_pos_rel; + } + /* FIXME: else leaking potentially the rd.first_link chain */ + HeapFree(GetProcessHeap(), 0, rd.data); + SendMessage(hTextWnd, EM_POSFROMCHAR, (WPARAM)&ptl, cp ? cp - 1 : 0); + pt.x = 0; pt.y = ptl.y; + SendMessage(hTextWnd, EM_SETSCROLLPOS, 0, (LPARAM)&pt); + } + SendMessage(hTextWnd, WM_SETREDRAW, TRUE, 0); + InvalidateRect(hTextWnd, NULL, TRUE); +} /*********************************************************************** * @@ -115,10 +190,19 @@ return GetOpenFileName(&openfilename); } -static char* WINHELP_GetCaption(WINHELP_WNDPAGE* wpage) -{ - if (wpage->wininfo->caption[0]) return wpage->wininfo->caption; - return wpage->page->file->lpszTitle; +/*********************************************************************** + * + * WINHELP_MessageBoxIDS_s + */ +static INT WINHELP_MessageBoxIDS_s(UINT ids_text, LPCSTR str, UINT ids_title, WORD type) +{ + CHAR text[MAX_STRING_LEN]; + CHAR newtext[MAX_STRING_LEN + MAX_PATH]; + + LoadString(Globals.hInstance, ids_text, text, sizeof(text)); + wsprintf(newtext, text, str); + + return MessageBox(0, newtext, MAKEINTRESOURCE(ids_title), type); } /*********************************************************************** @@ -236,142 +320,6 @@ wi.nsr_color = 0xFFFFFF; return &wi; -} - -/*********************************************************************** - * - * WinMain - */ -int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show) -{ - MSG msg; - LONG lHash = 0; - HLPFILE* hlpfile; - static CHAR default_wndname[] = "main"; - LPSTR wndname = default_wndname; - WINHELP_DLL* dll; - - Globals.hInstance = hInstance; - - if (LoadLibrary("riched20.dll") == NULL) - return MessageBox(0, MAKEINTRESOURCE(STID_NO_RICHEDIT), - MAKEINTRESOURCE(STID_WHERROR), MB_OK); - - /* Get options */ - while (*cmdline && (*cmdline == ' ' || *cmdline == '-')) - { - CHAR option; - LPCSTR topic_id; - if (*cmdline++ == ' ') continue; - - option = *cmdline; - if (option) cmdline++; - while (*cmdline && *cmdline == ' ') cmdline++; - switch (option) - { - case 'i': - case 'I': - topic_id = cmdline; - while (*cmdline && *cmdline != ' ') cmdline++; - if (*cmdline) *cmdline++ = '\0'; - lHash = HLPFILE_Hash(topic_id); - break; - - case '3': - case '4': - Globals.wVersion = option - '0'; - break; - - case 'x': - show = SW_HIDE; - Globals.isBook = FALSE; - break; - - default: - WINE_FIXME("Unsupported cmd line: %s\n", cmdline); - break; - } - } - - /* Create primary window */ - if (!WINHELP_RegisterWinClasses()) - { - WINE_FIXME("Couldn't register classes\n"); - return 0; - } - - if (*cmdline) - { - char* ptr; - if ((*cmdline == '"') && (ptr = strchr(cmdline+1, '"'))) - { - cmdline++; - *ptr = '\0'; - } - if ((ptr = strchr(cmdline, '>'))) - { - *ptr = '\0'; - wndname = ptr + 1; - } - hlpfile = WINHELP_LookupHelpFile(cmdline); - if (!hlpfile) return 0; - } - else hlpfile = NULL; - WINHELP_OpenHelpWindow(HLPFILE_PageByHash, hlpfile, lHash, - WINHELP_GetWindowInfo(hlpfile, wndname), show); - - /* Message loop */ - while (GetMessage(&msg, 0, 0, 0)) - { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - for (dll = Globals.dlls; dll; dll = dll->next) - { - if (dll->class & DC_INITTERM) dll->handler(DW_TERM, 0, 0); - } - return 0; -} - -/*********************************************************************** - * - * RegisterWinClasses - */ -static BOOL WINHELP_RegisterWinClasses(void) -{ - WNDCLASS class_main, class_button_box, class_shadow, class_history; - - class_main.style = CS_HREDRAW | CS_VREDRAW; - class_main.lpfnWndProc = WINHELP_MainWndProc; - class_main.cbClsExtra = 0; - class_main.cbWndExtra = sizeof(LONG); - class_main.hInstance = Globals.hInstance; - class_main.hIcon = LoadIcon(Globals.hInstance, MAKEINTRESOURCE(IDI_WINHELP)); - class_main.hCursor = LoadCursor(0, IDC_ARROW); - class_main.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); - class_main.lpszMenuName = 0; - class_main.lpszClassName = MAIN_WIN_CLASS_NAME; - - class_button_box = class_main; - class_button_box.lpfnWndProc = WINHELP_ButtonBoxWndProc; - class_button_box.cbWndExtra = 0; - class_button_box.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1); - class_button_box.lpszClassName = BUTTON_BOX_WIN_CLASS_NAME; - - class_shadow = class_main; - class_shadow.lpfnWndProc = WINHELP_ShadowWndProc; - class_shadow.cbWndExtra = 0; - class_shadow.hbrBackground = (HBRUSH)(COLOR_3DDKSHADOW+1); - class_shadow.lpszClassName = SHADOW_WIN_CLASS_NAME; - - class_history = class_main; - class_history.lpfnWndProc = WINHELP_HistoryWndProc; - class_history.lpszClassName = HISTORY_WIN_CLASS_NAME; - - return (RegisterClass(&class_main) && - RegisterClass(&class_button_box) && - RegisterClass(&class_shadow) && - RegisterClass(&class_history)); } typedef struct @@ -502,7 +450,104 @@ } -static void WINHELP_RememberPage(WINHELP_WINDOW* win, WINHELP_WNDPAGE* wpage) +/****************************************************************** + * WINHELP_DeleteButtons + * + */ +static void WINHELP_DeleteButtons(WINHELP_WINDOW* win) +{ + WINHELP_BUTTON* b; + WINHELP_BUTTON* bp; + + for (b = win->first_button; b; b = bp) + { + DestroyWindow(b->hWnd); + bp = b->next; + HeapFree(GetProcessHeap(), 0, b); + } + win->first_button = NULL; +} + +/****************************************************************** + * WINHELP_DeleteBackSet + * + */ +void WINHELP_DeleteBackSet(WINHELP_WINDOW* win) +{ + unsigned int i; + + for (i = 0; i < win->back.index; i++) + { + HLPFILE_FreeHlpFile(win->back.set[i].page->file); + win->back.set[i].page = NULL; + } + win->back.index = 0; +} + +/****************************************************************** + * WINHELP_DeletePageLinks + * + */ +static void WINHELP_DeletePageLinks(HLPFILE_PAGE* page) +{ + HLPFILE_LINK* curr; + HLPFILE_LINK* next; + + for (curr = page->first_link; curr; curr = next) + { + next = curr->next; + HeapFree(GetProcessHeap(), 0, curr); + } +} + +/*********************************************************************** + * + * WINHELP_DeleteWindow + */ +static void WINHELP_DeleteWindow(WINHELP_WINDOW* win) +{ + WINHELP_WINDOW** w; + + for (w = &Globals.win_list; *w; w = &(*w)->next) + { + if (*w == win) + { + *w = win->next; + break; + } + } + + if (Globals.active_win == win) + { + Globals.active_win = Globals.win_list; + if (Globals.win_list) + SetActiveWindow(Globals.win_list->hMainWnd); + } + + if (win == Globals.active_popup) + Globals.active_popup = NULL; + + WINHELP_DeleteButtons(win); + + if (win->page) WINHELP_DeletePageLinks(win->page); + if (win->hShadowWnd) DestroyWindow(win->hShadowWnd); + if (win->hHistoryWnd) DestroyWindow(win->hHistoryWnd); + + DeleteObject(win->hBrush); + + WINHELP_DeleteBackSet(win); + + if (win->page) HLPFILE_FreeHlpFile(win->page->file); + HeapFree(GetProcessHeap(), 0, win); +} + +static char* WINHELP_GetCaption(WINHELP_WNDPAGE* wpage) +{ + if (wpage->wininfo->caption[0]) return wpage->wininfo->caption; + return wpage->page->file->lpszTitle; +} + +static void WINHELP_RememberPage(WINHELP_WINDOW* win, WINHELP_WNDPAGE* wpage) { unsigned num; @@ -828,6 +873,392 @@ /*********************************************************************** * + * WINHELP_CheckPopup + */ +static BOOL WINHELP_CheckPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT* lret) +{ + HWND hPopup; + + if (!Globals.active_popup) return FALSE; + + switch (msg) + { + case WM_NOTIFY: + { + MSGFILTER* msgf = (MSGFILTER*)lParam; + if (msgf->nmhdr.code == EN_MSGFILTER) + { + if (!WINHELP_CheckPopup(hWnd, msgf->msg, msgf->wParam, msgf->lParam, NULL)) + return FALSE; + if (lret) *lret = 1; + return TRUE; + } + } + break; + case WM_ACTIVATE: + if (wParam != WA_INACTIVE || (HWND)lParam == Globals.active_win->hMainWnd || + (HWND)lParam == Globals.active_popup->hMainWnd || + GetWindow((HWND)lParam, GW_OWNER) == Globals.active_win->hMainWnd) + break; + case WM_LBUTTONUP: + case WM_LBUTTONDOWN: + if (WINHELP_HandleTextMouse(Globals.active_popup, msg, lParam) && msg == WM_LBUTTONDOWN) + return FALSE; + /* fall through */ + case WM_MBUTTONDOWN: + case WM_RBUTTONDOWN: + case WM_NCLBUTTONDOWN: + case WM_NCMBUTTONDOWN: + case WM_NCRBUTTONDOWN: + hPopup = Globals.active_popup->hMainWnd; + Globals.active_popup = NULL; + DestroyWindow(hPopup); + return TRUE; + } + return FALSE; +} + +/*********************************************************************** + * + * WINHELP_ButtonWndProc + */ +static LRESULT CALLBACK WINHELP_ButtonWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + if (WINHELP_CheckPopup(hWnd, msg, wParam, lParam, NULL)) return 0; + + if (msg == WM_KEYDOWN) + { + switch (wParam) + { + case VK_UP: + case VK_DOWN: + case VK_PRIOR: + case VK_NEXT: + case VK_ESCAPE: + return SendMessage(GetParent(hWnd), msg, wParam, lParam); + } + } + + return CallWindowProc(Globals.button_proc, hWnd, msg, wParam, lParam); +} + +/*********************************************************************** + * + * WINHELP_ButtonBoxWndProc + */ +static LRESULT CALLBACK WINHELP_ButtonBoxWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + WINDOWPOS *winpos; + WINHELP_WINDOW *win; + WINHELP_BUTTON *button; + SIZE button_size; + INT x, y; + + if (WINHELP_CheckPopup(hWnd, msg, wParam, lParam, NULL)) return 0L; + + switch (msg) + { + case WM_WINDOWPOSCHANGING: + winpos = (WINDOWPOS*) lParam; + win = (WINHELP_WINDOW*) GetWindowLongPtr(GetParent(hWnd), 0); + + /* Update buttons */ + button_size.cx = 0; + button_size.cy = 0; + for (button = win->first_button; button; button = button->next) + { + HDC hDc; + SIZE textsize; + if (!button->hWnd) + { + button->hWnd = CreateWindow(STRING_BUTTON, button->lpszName, + WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, + 0, 0, 0, 0, + hWnd, (HMENU) button->wParam, + Globals.hInstance, 0); + if (button->hWnd) + { + if (Globals.button_proc == NULL) + { + NONCLIENTMETRICSW ncm; + Globals.button_proc = (WNDPROC) GetWindowLongPtr(button->hWnd, GWLP_WNDPROC); + + ncm.cbSize = sizeof(NONCLIENTMETRICSW); + SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, + sizeof(NONCLIENTMETRICSW), &ncm, 0); + Globals.hButtonFont = CreateFontIndirectW(&ncm.lfMenuFont); + } + SetWindowLongPtr(button->hWnd, GWLP_WNDPROC, (LONG_PTR) WINHELP_ButtonWndProc); + if (Globals.hButtonFont) + SendMessage(button->hWnd, WM_SETFONT, (WPARAM)Globals.hButtonFont, TRUE); + } + } + hDc = GetDC(button->hWnd); + GetTextExtentPoint(hDc, button->lpszName, + lstrlen(button->lpszName), &textsize); + ReleaseDC(button->hWnd, hDc); + + button_size.cx = max(button_size.cx, textsize.cx + BUTTON_CX); + button_size.cy = max(button_size.cy, textsize.cy + BUTTON_CY); + } + + x = 0; + y = 0; + for (button = win->first_button; button; button = button->next) + { + SetWindowPos(button->hWnd, HWND_TOP, x, y, button_size.cx, button_size.cy, 0); + + if (x + 2 * button_size.cx <= winpos->cx) + x += button_size.cx; + else + x = 0, y += button_size.cy; + } + winpos->cy = y + (x ? button_size.cy : 0); + break; + + case WM_COMMAND: + SendMessage(GetParent(hWnd), msg, wParam, lParam); + break; + + case WM_KEYDOWN: + switch (wParam) + { + case VK_UP: + case VK_DOWN: + case VK_PRIOR: + case VK_NEXT: + case VK_ESCAPE: + return SendMessage(GetParent(hWnd), msg, wParam, lParam); + } + break; + } + + return DefWindowProc(hWnd, msg, wParam, lParam); +} + +/****************************************************************** + * WINHELP_HistoryWndProc + * + * + */ +static LRESULT CALLBACK WINHELP_HistoryWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + WINHELP_WINDOW* win; + PAINTSTRUCT ps; + HDC hDc; + TEXTMETRIC tm; + unsigned int i; + RECT r; + + switch (msg) + { + case WM_NCCREATE: + win = (WINHELP_WINDOW*)((LPCREATESTRUCT)lParam)->lpCreateParams; + SetWindowLongPtr(hWnd, 0, (ULONG_PTR)win); + win->hHistoryWnd = hWnd; + break; + case WM_CREATE: + win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); + hDc = GetDC(hWnd); + GetTextMetrics(hDc, &tm); + GetWindowRect(hWnd, &r); + + r.right = r.left + 30 * tm.tmAveCharWidth; + r.bottom = r.top + (sizeof(Globals.history.set) / sizeof(Globals.history.set[0])) * tm.tmHeight; + AdjustWindowRect(&r, GetWindowLong(hWnd, GWL_STYLE), FALSE); + if (r.left < 0) {r.right -= r.left; r.left = 0;} + if (r.top < 0) {r.bottom -= r.top; r.top = 0;} + + MoveWindow(hWnd, r.left, r.top, r.right, r.bottom, TRUE); + ReleaseDC(hWnd, hDc); + break; + case WM_LBUTTONDOWN: + win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); + hDc = GetDC(hWnd); + GetTextMetrics(hDc, &tm); + i = HIWORD(lParam) / tm.tmHeight; + if (i < Globals.history.index) + WINHELP_CreateHelpWindow(&Globals.history.set[i], SW_SHOW, TRUE); + ReleaseDC(hWnd, hDc); + break; + case WM_PAINT: + hDc = BeginPaint(hWnd, &ps); + win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); + GetTextMetrics(hDc, &tm); + + for (i = 0; i < Globals.history.index; i++) + { + if (Globals.history.set[i].page->file == Globals.active_win->page->file) + { + TextOut(hDc, 0, i * tm.tmHeight, + Globals.history.set[i].page->lpszTitle, + strlen(Globals.history.set[i].page->lpszTitle)); + } + else + { + char buffer[1024]; + const char* ptr1; + const char* ptr2; + unsigned len; + + ptr1 = strrchr(Globals.history.set[i].page->file->lpszPath, '\\'); + if (!ptr1) ptr1 = Globals.history.set[i].page->file->lpszPath; + else ptr1++; + ptr2 = strrchr(ptr1, '.'); + len = ptr2 ? ptr2 - ptr1 : strlen(ptr1); + if (len > sizeof(buffer)) len = sizeof(buffer); + memcpy(buffer, ptr1, len); + if (len < sizeof(buffer)) buffer[len++] = ':'; + strncpy(&buffer[len], Globals.history.set[i].page->lpszTitle, sizeof(buffer) - len); + buffer[sizeof(buffer) - 1] = '\0'; + TextOut(hDc, 0, i * tm.tmHeight, buffer, strlen(buffer)); + } + } + EndPaint(hWnd, &ps); + break; + case WM_DESTROY: + win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); + if (hWnd == win->hHistoryWnd) + win->hHistoryWnd = 0; + break; + } + return DefWindowProc(hWnd, msg, wParam, lParam); +} + +/*********************************************************************** + * + * WINHELP_ShadowWndProc + */ +static LRESULT CALLBACK WINHELP_ShadowWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + if (WINHELP_CheckPopup(hWnd, msg, wParam, lParam, NULL)) return 0; + return WINHELP_CheckPopup(hWnd, msg, wParam, lParam, NULL) ? 0L : DefWindowProc(hWnd, msg, wParam, lParam); +} + +/************************************************************************** + * cb_KWBTree + * + * HLPFILE_BPTreeCallback enumeration function for '|KWBTREE' internal file. + * + */ +static void cb_KWBTree(void *p, void **next, void *cookie) +{ + HWND hListWnd = (HWND)cookie; + int count; + + WINE_TRACE("Adding '%s' to search list\n", (char *)p); + SendMessage(hListWnd, LB_INSERTSTRING, -1, (LPARAM)p); + count = SendMessage(hListWnd, LB_GETCOUNT, 0, 0); + SendMessage(hListWnd, LB_SETITEMDATA, count-1, (LPARAM)p); + *next = (char*)p + strlen((char*)p) + 7; +} + +struct index_data +{ + HLPFILE* hlpfile; + BOOL jump; + ULONG offset; +}; + +/************************************************************************** + * WINHELP_IndexDlgProc + * + */ +static INT_PTR CALLBACK WINHELP_IndexDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static struct index_data* id; + int sel; + + switch (msg) + { + case WM_INITDIALOG: + id = (struct index_data*)((PROPSHEETPAGE*)lParam)->lParam; + HLPFILE_BPTreeEnum(id->hlpfile->kwbtree, cb_KWBTree, + GetDlgItem(hWnd, IDC_INDEXLIST)); + id->jump = FALSE; + id->offset = 1; + return TRUE; + case WM_COMMAND: + switch (HIWORD(wParam)) + { + case LBN_DBLCLK: + if (LOWORD(wParam) == IDC_INDEXLIST) + SendMessage(GetParent(hWnd), PSM_PRESSBUTTON, PSBTN_OK, 0); + break; + } + break; + case WM_NOTIFY: + switch (((NMHDR*)lParam)->code) + { + case PSN_APPLY: + sel = SendDlgItemMessage(hWnd, IDC_INDEXLIST, LB_GETCURSEL, 0, 0); + if (sel != LB_ERR) + { + BYTE *p; + int count; + + p = (BYTE*)SendDlgItemMessage(hWnd, IDC_INDEXLIST, + LB_GETITEMDATA, sel, 0); + count = *(short*)((char *)p + strlen((char *)p) + 1); + if (count > 1) + { + MessageBox(hWnd, "count > 1 not supported yet", "Error", MB_OK | MB_ICONSTOP); + SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_INVALID); + return TRUE; + } + id->offset = *(ULONG*)((char *)p + strlen((char *)p) + 3); + id->offset = *(long*)(id->hlpfile->kwdata + id->offset + 9); + if (id->offset == 0xFFFFFFFF) + { + MessageBox(hWnd, "macro keywords not supported yet", "Error", MB_OK | MB_ICONSTOP); + SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_INVALID); + return TRUE; + } + id->jump = TRUE; + SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_NOERROR); + } + return TRUE; + default: + return FALSE; + } + break; + default: + break; + } + return FALSE; +} + +/************************************************************************** + * WINHELP_SearchDlgProc + * + */ +static INT_PTR CALLBACK WINHELP_SearchDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static struct index_data* id; + + switch (msg) + { + case WM_INITDIALOG: + id = (struct index_data*)((PROPSHEETPAGE*)lParam)->lParam; + return TRUE; + case WM_NOTIFY: + switch (((NMHDR*)lParam)->code) + { + case PSN_APPLY: + SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_NOERROR); + return TRUE; + default: + return FALSE; + } + break; + default: + break; + } + return FALSE; +} + +/*********************************************************************** + * * WINHELP_MainWndProc */ static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) @@ -967,7 +1398,7 @@ GetScrollRange(hTextWnd, SB_VERT, &min, &max); if (keyDelta == 0) - { + { GetClientRect(hTextWnd, &rect); keyDelta = (rect.bottom - rect.top) / 2; if (wParam == VK_PRIOR) @@ -1086,585 +1517,6 @@ return DefWindowProc(hWnd, msg, wParam, lParam); } -static DWORD CALLBACK WINHELP_RtfStreamIn(DWORD_PTR cookie, BYTE* buff, - LONG cb, LONG* pcb) -{ - struct RtfData* rd = (struct RtfData*)cookie; - - if (rd->where >= rd->ptr) return 1; - if (rd->where + cb > rd->ptr) - cb = rd->ptr - rd->where; - memcpy(buff, rd->where, cb); - rd->where += cb; - *pcb = cb; - return 0; -} - -static void WINHELP_SetupText(HWND hTextWnd, WINHELP_WINDOW* win, ULONG relative) -{ - /* At first clear area - needed by EM_POSFROMCHAR/EM_SETSCROLLPOS */ - SendMessage(hTextWnd, WM_SETTEXT, 0, (LPARAM)""); - SendMessage(hTextWnd, WM_SETREDRAW, FALSE, 0); - SendMessage(hTextWnd, EM_SETBKGNDCOLOR, 0, (LPARAM)win->info->sr_color); - /* set word-wrap to window size (undocumented) */ - SendMessage(hTextWnd, EM_SETTARGETDEVICE, 0, 0); - if (win->page) - { - struct RtfData rd; - EDITSTREAM es; - unsigned cp = 0; - POINTL ptl; - POINT pt; - - - if (HLPFILE_BrowsePage(win->page, &rd, win->font_scale, relative)) - { - rd.where = rd.data; - es.dwCookie = (DWORD_PTR)&rd; - es.dwError = 0; - es.pfnCallback = WINHELP_RtfStreamIn; - - SendMessageW(hTextWnd, EM_STREAMIN, SF_RTF, (LPARAM)&es); - cp = rd.char_pos_rel; - } - /* FIXME: else leaking potentially the rd.first_link chain */ - HeapFree(GetProcessHeap(), 0, rd.data); - SendMessage(hTextWnd, EM_POSFROMCHAR, (WPARAM)&ptl, cp ? cp - 1 : 0); - pt.x = 0; pt.y = ptl.y; - SendMessage(hTextWnd, EM_SETSCROLLPOS, 0, (LPARAM)&pt); - } - SendMessage(hTextWnd, WM_SETREDRAW, TRUE, 0); - InvalidateRect(hTextWnd, NULL, TRUE); -} - -/*********************************************************************** - * - * WINHELP_ButtonBoxWndProc - */ -static LRESULT CALLBACK WINHELP_ButtonBoxWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - WINDOWPOS *winpos; - WINHELP_WINDOW *win; - WINHELP_BUTTON *button; - SIZE button_size; - INT x, y; - - if (WINHELP_CheckPopup(hWnd, msg, wParam, lParam, NULL)) return 0L; - - switch (msg) - { - case WM_WINDOWPOSCHANGING: - winpos = (WINDOWPOS*) lParam; - win = (WINHELP_WINDOW*) GetWindowLongPtr(GetParent(hWnd), 0); - - /* Update buttons */ - button_size.cx = 0; - button_size.cy = 0; - for (button = win->first_button; button; button = button->next) - { - HDC hDc; - SIZE textsize; - if (!button->hWnd) - { - button->hWnd = CreateWindow(STRING_BUTTON, button->lpszName, - WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, - 0, 0, 0, 0, - hWnd, (HMENU) button->wParam, - Globals.hInstance, 0); - if (button->hWnd) - { - if (Globals.button_proc == NULL) - { - NONCLIENTMETRICSW ncm; - Globals.button_proc = (WNDPROC) GetWindowLongPtr(button->hWnd, GWLP_WNDPROC); - - ncm.cbSize = sizeof(NONCLIENTMETRICSW); - SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, - sizeof(NONCLIENTMETRICSW), &ncm, 0); - Globals.hButtonFont = CreateFontIndirectW(&ncm.lfMenuFont); - } - SetWindowLongPtr(button->hWnd, GWLP_WNDPROC, (LONG_PTR) WINHELP_ButtonWndProc); - if (Globals.hButtonFont) - SendMessage(button->hWnd, WM_SETFONT, (WPARAM)Globals.hButtonFont, TRUE); - } - } - hDc = GetDC(button->hWnd); - GetTextExtentPoint(hDc, button->lpszName, - lstrlen(button->lpszName), &textsize); - ReleaseDC(button->hWnd, hDc); - - button_size.cx = max(button_size.cx, textsize.cx + BUTTON_CX); - button_size.cy = max(button_size.cy, textsize.cy + BUTTON_CY); - } - - x = 0; - y = 0; - for (button = win->first_button; button; button = button->next) - { - SetWindowPos(button->hWnd, HWND_TOP, x, y, button_size.cx, button_size.cy, 0); - - if (x + 2 * button_size.cx <= winpos->cx) - x += button_size.cx; - else - x = 0, y += button_size.cy; - } - winpos->cy = y + (x ? button_size.cy : 0); - break; - - case WM_COMMAND: - SendMessage(GetParent(hWnd), msg, wParam, lParam); - break; - - case WM_KEYDOWN: - switch (wParam) - { - case VK_UP: - case VK_DOWN: - case VK_PRIOR: - case VK_NEXT: - case VK_ESCAPE: - return SendMessage(GetParent(hWnd), msg, wParam, lParam); - } - break; - } - - return DefWindowProc(hWnd, msg, wParam, lParam); -} - -/*********************************************************************** - * - * WINHELP_ButtonWndProc - */ -static LRESULT CALLBACK WINHELP_ButtonWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - if (WINHELP_CheckPopup(hWnd, msg, wParam, lParam, NULL)) return 0; - - if (msg == WM_KEYDOWN) - { - switch (wParam) - { - case VK_UP: - case VK_DOWN: - case VK_PRIOR: - case VK_NEXT: - case VK_ESCAPE: - return SendMessage(GetParent(hWnd), msg, wParam, lParam); - } - } - - return CallWindowProc(Globals.button_proc, hWnd, msg, wParam, lParam); -} - -/****************************************************************** - * WINHELP_HistoryWndProc - * - * - */ -static LRESULT CALLBACK WINHELP_HistoryWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - WINHELP_WINDOW* win; - PAINTSTRUCT ps; - HDC hDc; - TEXTMETRIC tm; - unsigned int i; - RECT r; - - switch (msg) - { - case WM_NCCREATE: - win = (WINHELP_WINDOW*)((LPCREATESTRUCT)lParam)->lpCreateParams; - SetWindowLongPtr(hWnd, 0, (ULONG_PTR)win); - win->hHistoryWnd = hWnd; - break; - case WM_CREATE: - win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); - hDc = GetDC(hWnd); - GetTextMetrics(hDc, &tm); - GetWindowRect(hWnd, &r); - - r.right = r.left + 30 * tm.tmAveCharWidth; - r.bottom = r.top + (sizeof(Globals.history.set) / sizeof(Globals.history.set[0])) * tm.tmHeight; - AdjustWindowRect(&r, GetWindowLong(hWnd, GWL_STYLE), FALSE); - if (r.left < 0) {r.right -= r.left; r.left = 0;} - if (r.top < 0) {r.bottom -= r.top; r.top = 0;} - - MoveWindow(hWnd, r.left, r.top, r.right, r.bottom, TRUE); - ReleaseDC(hWnd, hDc); - break; - case WM_LBUTTONDOWN: - win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); - hDc = GetDC(hWnd); - GetTextMetrics(hDc, &tm); - i = HIWORD(lParam) / tm.tmHeight; - if (i < Globals.history.index) - WINHELP_CreateHelpWindow(&Globals.history.set[i], SW_SHOW, TRUE); - ReleaseDC(hWnd, hDc); - break; - case WM_PAINT: - hDc = BeginPaint(hWnd, &ps); - win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); - GetTextMetrics(hDc, &tm); - - for (i = 0; i < Globals.history.index; i++) - { - if (Globals.history.set[i].page->file == Globals.active_win->page->file) - { - TextOut(hDc, 0, i * tm.tmHeight, - Globals.history.set[i].page->lpszTitle, - strlen(Globals.history.set[i].page->lpszTitle)); - } - else - { - char buffer[1024]; - const char* ptr1; - const char* ptr2; - unsigned len; - - ptr1 = strrchr(Globals.history.set[i].page->file->lpszPath, '\\'); - if (!ptr1) ptr1 = Globals.history.set[i].page->file->lpszPath; - else ptr1++; - ptr2 = strrchr(ptr1, '.'); - len = ptr2 ? ptr2 - ptr1 : strlen(ptr1); - if (len > sizeof(buffer)) len = sizeof(buffer); - memcpy(buffer, ptr1, len); - if (len < sizeof(buffer)) buffer[len++] = ':'; - strncpy(&buffer[len], Globals.history.set[i].page->lpszTitle, sizeof(buffer) - len); - buffer[sizeof(buffer) - 1] = '\0'; - TextOut(hDc, 0, i * tm.tmHeight, buffer, strlen(buffer)); - } - } - EndPaint(hWnd, &ps); - break; - case WM_DESTROY: - win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); - if (hWnd == win->hHistoryWnd) - win->hHistoryWnd = 0; - break; - } - return DefWindowProc(hWnd, msg, wParam, lParam); -} - -/*********************************************************************** - * - * WINHELP_ShadowWndProc - */ -static LRESULT CALLBACK WINHELP_ShadowWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - if (WINHELP_CheckPopup(hWnd, msg, wParam, lParam, NULL)) return 0; - return WINHELP_CheckPopup(hWnd, msg, wParam, lParam, NULL) ? 0L : DefWindowProc(hWnd, msg, wParam, lParam); -} - -/*********************************************************************** - * - * WINHELP_CheckPopup - */ -static BOOL WINHELP_CheckPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT* lret) -{ - HWND hPopup; - - if (!Globals.active_popup) return FALSE; - - switch (msg) - { - case WM_NOTIFY: - { - MSGFILTER* msgf = (MSGFILTER*)lParam; - if (msgf->nmhdr.code == EN_MSGFILTER) - { - if (!WINHELP_CheckPopup(hWnd, msgf->msg, msgf->wParam, msgf->lParam, NULL)) - return FALSE; - if (lret) *lret = 1; - return TRUE; - } - } - break; - case WM_ACTIVATE: - if (wParam != WA_INACTIVE || (HWND)lParam == Globals.active_win->hMainWnd || - (HWND)lParam == Globals.active_popup->hMainWnd || - GetWindow((HWND)lParam, GW_OWNER) == Globals.active_win->hMainWnd) - break; - case WM_LBUTTONUP: - case WM_LBUTTONDOWN: - if (WINHELP_HandleTextMouse(Globals.active_popup, msg, lParam) && msg == WM_LBUTTONDOWN) - return FALSE; - /* fall through */ - case WM_MBUTTONDOWN: - case WM_RBUTTONDOWN: - case WM_NCLBUTTONDOWN: - case WM_NCMBUTTONDOWN: - case WM_NCRBUTTONDOWN: - hPopup = Globals.active_popup->hMainWnd; - Globals.active_popup = NULL; - DestroyWindow(hPopup); - return TRUE; - } - return FALSE; -} - -/****************************************************************** - * WINHELP_DeleteButtons - * - */ -static void WINHELP_DeleteButtons(WINHELP_WINDOW* win) -{ - WINHELP_BUTTON* b; - WINHELP_BUTTON* bp; - - for (b = win->first_button; b; b = bp) - { - DestroyWindow(b->hWnd); - bp = b->next; - HeapFree(GetProcessHeap(), 0, b); - } - win->first_button = NULL; -} - -/****************************************************************** - * WINHELP_DeleteBackSet - * - */ -void WINHELP_DeleteBackSet(WINHELP_WINDOW* win) -{ - unsigned int i; - - for (i = 0; i < win->back.index; i++) - { - HLPFILE_FreeHlpFile(win->back.set[i].page->file); - win->back.set[i].page = NULL; - } - win->back.index = 0; -} - -/****************************************************************** - * WINHELP_DeletePageLinks - * - */ -static void WINHELP_DeletePageLinks(HLPFILE_PAGE* page) -{ - HLPFILE_LINK* curr; - HLPFILE_LINK* next; - - for (curr = page->first_link; curr; curr = next) - { - next = curr->next; - HeapFree(GetProcessHeap(), 0, curr); - } -} - -/*********************************************************************** - * - * WINHELP_DeleteWindow - */ -static void WINHELP_DeleteWindow(WINHELP_WINDOW* win) -{ - WINHELP_WINDOW** w; - - for (w = &Globals.win_list; *w; w = &(*w)->next) - { - if (*w == win) - { - *w = win->next; - break; - } - } - - if (Globals.active_win == win) - { - Globals.active_win = Globals.win_list; - if (Globals.win_list) - SetActiveWindow(Globals.win_list->hMainWnd); - } - - if (win == Globals.active_popup) - Globals.active_popup = NULL; - - WINHELP_DeleteButtons(win); - - if (win->page) WINHELP_DeletePageLinks(win->page); - if (win->hShadowWnd) DestroyWindow(win->hShadowWnd); - if (win->hHistoryWnd) DestroyWindow(win->hHistoryWnd); - - DeleteObject(win->hBrush); - - WINHELP_DeleteBackSet(win); - - if (win->page) HLPFILE_FreeHlpFile(win->page->file); - HeapFree(GetProcessHeap(), 0, win); -} - -/*********************************************************************** - * - * WINHELP_InitFonts - */ -static void WINHELP_InitFonts(HWND hWnd) -{ - WINHELP_WINDOW *win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); - LOGFONT logfontlist[] = { - {-10, 0, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, - {-12, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, - {-12, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, - {-12, 0, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, - {-12, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, - {-10, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, - { -8, 0, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}}; -#define FONTS_LEN (sizeof(logfontlist)/sizeof(*logfontlist)) - - static HFONT fonts[FONTS_LEN]; - static BOOL init = 0; - - win->fonts_len = FONTS_LEN; - win->fonts = fonts; - - if (!init) - { - UINT i; - - for (i = 0; i < FONTS_LEN; i++) - { - fonts[i] = CreateFontIndirect(&logfontlist[i]); - } - - init = 1; - } -} - -/*********************************************************************** - * - * WINHELP_MessageBoxIDS_s - */ -INT WINHELP_MessageBoxIDS_s(UINT ids_text, LPCSTR str, UINT ids_title, WORD type) -{ - CHAR text[MAX_STRING_LEN]; - CHAR newtext[MAX_STRING_LEN + MAX_PATH]; - - LoadString(Globals.hInstance, ids_text, text, sizeof(text)); - wsprintf(newtext, text, str); - - return MessageBox(0, newtext, MAKEINTRESOURCE(ids_title), type); -} - -/************************************************************************** - * cb_KWBTree - * - * HLPFILE_BPTreeCallback enumeration function for '|KWBTREE' internal file. - * - */ -static void cb_KWBTree(void *p, void **next, void *cookie) -{ - HWND hListWnd = (HWND)cookie; - int count; - - WINE_TRACE("Adding '%s' to search list\n", (char *)p); - SendMessage(hListWnd, LB_INSERTSTRING, -1, (LPARAM)p); - count = SendMessage(hListWnd, LB_GETCOUNT, 0, 0); - SendMessage(hListWnd, LB_SETITEMDATA, count-1, (LPARAM)p); - *next = (char*)p + strlen((char*)p) + 7; -} - -struct index_data -{ - HLPFILE* hlpfile; - BOOL jump; - ULONG offset; -}; - -/************************************************************************** - * WINHELP_IndexDlgProc - * - */ -INT_PTR CALLBACK WINHELP_IndexDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - static struct index_data* id; - int sel; - - switch (msg) - { - case WM_INITDIALOG: - id = (struct index_data*)((PROPSHEETPAGE*)lParam)->lParam; - HLPFILE_BPTreeEnum(id->hlpfile->kwbtree, cb_KWBTree, - GetDlgItem(hWnd, IDC_INDEXLIST)); - id->jump = FALSE; - id->offset = 1; - return TRUE; - case WM_COMMAND: - switch (HIWORD(wParam)) - { - case LBN_DBLCLK: - if (LOWORD(wParam) == IDC_INDEXLIST) - SendMessage(GetParent(hWnd), PSM_PRESSBUTTON, PSBTN_OK, 0); - break; - } - break; - case WM_NOTIFY: - switch (((NMHDR*)lParam)->code) - { - case PSN_APPLY: - sel = SendDlgItemMessage(hWnd, IDC_INDEXLIST, LB_GETCURSEL, 0, 0); - if (sel != LB_ERR) - { - BYTE *p; - int count; - - p = (BYTE*)SendDlgItemMessage(hWnd, IDC_INDEXLIST, - LB_GETITEMDATA, sel, 0); - count = *(short*)((char *)p + strlen((char *)p) + 1); - if (count > 1) - { - MessageBox(hWnd, "count > 1 not supported yet", "Error", MB_OK | MB_ICONSTOP); - SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_INVALID); - return TRUE; - } - id->offset = *(ULONG*)((char *)p + strlen((char *)p) + 3); - id->offset = *(long*)(id->hlpfile->kwdata + id->offset + 9); - if (id->offset == 0xFFFFFFFF) - { - MessageBox(hWnd, "macro keywords not supported yet", "Error", MB_OK | MB_ICONSTOP); - SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_INVALID); - return TRUE; - } - id->jump = TRUE; - SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_NOERROR); - } - return TRUE; - default: - return FALSE; - } - break; - default: - break; - } - return FALSE; -} - -/************************************************************************** - * WINHELP_SearchDlgProc - * - */ -INT_PTR CALLBACK WINHELP_SearchDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - static struct index_data* id; - - switch (msg) - { - case WM_INITDIALOG: - id = (struct index_data*)((PROPSHEETPAGE*)lParam)->lParam; - return TRUE; - case WM_NOTIFY: - switch (((NMHDR*)lParam)->code) - { - case PSN_APPLY: - SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_NOERROR); - return TRUE; - default: - return FALSE; - } - break; - default: - break; - } - return FALSE; -} - /************************************************************************** * WINHELP_CreateIndexWindow * @@ -1730,3 +1582,139 @@ } return TRUE; } + +/*********************************************************************** + * + * RegisterWinClasses + */ +static BOOL WINHELP_RegisterWinClasses(void) +{ + WNDCLASS class_main, class_button_box, class_shadow, class_history; + + class_main.style = CS_HREDRAW | CS_VREDRAW; + class_main.lpfnWndProc = WINHELP_MainWndProc; + class_main.cbClsExtra = 0; + class_main.cbWndExtra = sizeof(LONG); + class_main.hInstance = Globals.hInstance; + class_main.hIcon = LoadIcon(Globals.hInstance, MAKEINTRESOURCE(IDI_WINHELP)); + class_main.hCursor = LoadCursor(0, IDC_ARROW); + class_main.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); + class_main.lpszMenuName = 0; + class_main.lpszClassName = MAIN_WIN_CLASS_NAME; + + class_button_box = class_main; + class_button_box.lpfnWndProc = WINHELP_ButtonBoxWndProc; + class_button_box.cbWndExtra = 0; + class_button_box.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1); + class_button_box.lpszClassName = BUTTON_BOX_WIN_CLASS_NAME; + + class_shadow = class_main; + class_shadow.lpfnWndProc = WINHELP_ShadowWndProc; + class_shadow.cbWndExtra = 0; + class_shadow.hbrBackground = (HBRUSH)(COLOR_3DDKSHADOW+1); + class_shadow.lpszClassName = SHADOW_WIN_CLASS_NAME; + + class_history = class_main; + class_history.lpfnWndProc = WINHELP_HistoryWndProc; + class_history.lpszClassName = HISTORY_WIN_CLASS_NAME; + + return (RegisterClass(&class_main) && + RegisterClass(&class_button_box) && + RegisterClass(&class_shadow) && + RegisterClass(&class_history)); +} + +/*********************************************************************** + * + * WinMain + */ +int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show) +{ + MSG msg; + LONG lHash = 0; + HLPFILE* hlpfile; + static CHAR default_wndname[] = "main"; + LPSTR wndname = default_wndname; + WINHELP_DLL* dll; + + Globals.hInstance = hInstance; + + if (LoadLibrary("riched20.dll") == NULL) + return MessageBox(0, MAKEINTRESOURCE(STID_NO_RICHEDIT), + MAKEINTRESOURCE(STID_WHERROR), MB_OK); + + /* Get options */ + while (*cmdline && (*cmdline == ' ' || *cmdline == '-')) + { + CHAR option; + LPCSTR topic_id; + if (*cmdline++ == ' ') continue; + + option = *cmdline; + if (option) cmdline++; + while (*cmdline && *cmdline == ' ') cmdline++; + switch (option) + { + case 'i': + case 'I': + topic_id = cmdline; + while (*cmdline && *cmdline != ' ') cmdline++; + if (*cmdline) *cmdline++ = '\0'; + lHash = HLPFILE_Hash(topic_id); + break; + + case '3': + case '4': + Globals.wVersion = option - '0'; + break; + + case 'x': + show = SW_HIDE; + Globals.isBook = FALSE; + break; + + default: + WINE_FIXME("Unsupported cmd line: %s\n", cmdline); + break; + } + } + + /* Create primary window */ + if (!WINHELP_RegisterWinClasses()) + { + WINE_FIXME("Couldn't register classes\n"); + return 0; + } + + if (*cmdline) + { + char* ptr; + if ((*cmdline == '"') && (ptr = strchr(cmdline+1, '"'))) + { + cmdline++; + *ptr = '\0'; + } + if ((ptr = strchr(cmdline, '>'))) + { + *ptr = '\0'; + wndname = ptr + 1; + } + hlpfile = WINHELP_LookupHelpFile(cmdline); + if (!hlpfile) return 0; + } + else hlpfile = NULL; + WINHELP_OpenHelpWindow(HLPFILE_PageByHash, hlpfile, lHash, + WINHELP_GetWindowInfo(hlpfile, wndname), show); + + /* Message loop */ + while (GetMessage(&msg, 0, 0, 0)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + for (dll = Globals.dlls; dll; dll = dll->next) + { + if (dll->class & DC_INITTERM) dll->handler(DW_TERM, 0, 0); + } + return 0; +} Modified: trunk/reactos/base/applications/winhlp32/winhelp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winhlp32…
============================================================================== --- trunk/reactos/base/applications/winhlp32/winhelp.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/winhlp32/winhelp.h [iso-8859-1] Thu Jan 8 08:08:17 2009 @@ -149,7 +149,6 @@ BOOL WINHELP_GetOpenFileName(LPSTR, int); BOOL WINHELP_CreateIndexWindow(BOOL); void WINHELP_DeleteBackSet(WINHELP_WINDOW*); -INT WINHELP_MessageBoxIDS_s(UINT, LPCSTR, UINT, WORD); HLPFILE* WINHELP_LookupHelpFile(LPCSTR lpszFile); HLPFILE_WINDOWINFO* WINHELP_GetWindowInfo(HLPFILE* hlpfile, LPCSTR name); void WINHELP_LayoutMainWindow(WINHELP_WINDOW* win);
15 years, 11 months
1
0
0
0
[dreimer] 38642: Sync to Wine HEAD. Done with my first try of a autosync script for the normal apps.
by dreimer@svn.reactos.org
Author: dreimer Date: Thu Jan 8 08:07:10 2009 New Revision: 38642 URL:
http://svn.reactos.org/svn/reactos?rev=38642&view=rev
Log: Sync to Wine HEAD. Done with my first try of a autosync script for the normal apps. Modified: trunk/rosapps/applications/winfile/winefile.c trunk/rosapps/applications/winfile/winefile.h Modified: trunk/rosapps/applications/winfile/winefile.c URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/winef…
============================================================================== --- trunk/rosapps/applications/winfile/winefile.c [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/winefile.c [iso-8859-1] Thu Jan 8 08:07:10 2009 @@ -33,6 +33,7 @@ #include "winefile.h" #include "resource.h" +#include "wine/unicode.h" #ifdef _NO_EXTENSIONS #undef _LEFT_FILES @@ -196,8 +197,17 @@ static const TCHAR sWINEFILEFRAME[] = {'W','F','S','_','F','r','a','m','e','\0'}; static const TCHAR sWINEFILETREE[] = {'W','F','S','_','T','r','e','e','\0'}; -static const TCHAR sLongHexFmt[] = {'%','I','6','4','X','\0'}; -static const TCHAR sLongNumFmt[] = {'%','I','6','4','u','\0'}; +static void format_longlong(LPWSTR ret, ULONGLONG val) +{ + WCHAR buffer[65], *p = &buffer[64]; + + *p = 0; + do { + *(--p) = '0' + val % 10; + val /= 10; + } while (val); + lstrcpyW( ret, p ); +} /* load resource string */ @@ -299,52 +309,6 @@ ReleaseDC(hwnd, hdc); } -#ifdef __WINE__ - -#ifdef UNICODE - -/* call vswprintf() in msvcrt.dll */ -/*TODO: fix swprintf() in non-msvcrt mode, so that this dynamic linking function can be removed */ -static int msvcrt_swprintf(WCHAR* buffer, const WCHAR* fmt, ...) -{ - static int (__cdecl *pvswprintf)(WCHAR*, const WCHAR*, va_list) = NULL; - va_list ap; - int ret; - - if (!pvswprintf) { - HMODULE hModMsvcrt = LoadLibraryA("msvcrt"); - pvswprintf = (int(__cdecl*)(WCHAR*,const WCHAR*,va_list)) GetProcAddress(hModMsvcrt, "vswprintf"); - } - - va_start(ap, fmt); - ret = (*pvswprintf)(buffer, fmt, ap); - va_end(ap); - - return ret; -} - -static LPCWSTR my_wcsrchr(LPCWSTR str, WCHAR c) -{ - LPCWSTR p = str; - - while(*p) - ++p; - - do { - if (--p < str) - return NULL; - } while(*p != c); - - return p; -} - -#define _tcsrchr my_wcsrchr -#else /* UNICODE */ -#define _tcsrchr strrchr -#endif /* UNICODE */ - -#endif /* __WINE__ */ - /* allocate and initialise a directory entry */ static Entry* alloc_entry(void) @@ -1219,8 +1183,8 @@ name1 = fd1->cFileName; name2 = fd2->cFileName; - ext1 = _tcsrchr(name1, '.'); - ext2 = _tcsrchr(name2, '.'); + ext1 = strrchrW(name1, '.'); + ext2 = strrchrW(name2, '.'); if (ext1) ext1++; @@ -2032,7 +1996,6 @@ static const TCHAR sByteFmt[] = {'%','s',' ','B','y','t','e','s','\0'}; TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN]; LPWIN32_FIND_DATA pWFD; - ULONGLONG size; dlg = (struct PropertiesDialog*) lparam; pWFD = (LPWIN32_FIND_DATA) &dlg->entry.data; @@ -2044,8 +2007,7 @@ format_date(&pWFD->ftLastWriteTime, b1, COL_DATE|COL_TIME); SetWindowText(GetDlgItem(hwnd, IDC_STATIC_PROP_LASTCHANGE), b1); - size = ((ULONGLONG)pWFD->nFileSizeHigh << 32) | pWFD->nFileSizeLow; - _stprintf(b1, sLongNumFmt, size); + format_longlong( b1, ((ULONGLONG)pWFD->nFileSizeHigh << 32) | pWFD->nFileSizeLow ); wsprintf(b2, sByteFmt, b1); SetWindowText(GetDlgItem(hwnd, IDC_STATIC_PROP_SIZE), b2); @@ -2907,17 +2869,18 @@ static const TCHAR sFmtGB[] = {'%', '.', '1', 'f', ' ', 'G', 'B', '\0'}; static const TCHAR sFmtMB[] = {'%', '.', '1', 'f', ' ', 'M', 'B', '\0'}; static const TCHAR sFmtkB[] = {'%', '.', '1', 'f', ' ', 'k', 'B', '\0'}; + static const TCHAR sFmtB[] = {'%', 'u', 0}; float fBytes = (float)bytes; if (bytes >= 1073741824) /* 1 GB */ - _stprintf(buffer, sFmtGB, fBytes/1073741824.f+.5f); + sprintfW(buffer, sFmtGB, fBytes/1073741824.f+.5f); else if (bytes >= 1048576) /* 1 MB */ - _stprintf(buffer, sFmtMB, fBytes/1048576.f+.5f); + sprintfW(buffer, sFmtMB, fBytes/1048576.f+.5f); else if (bytes >= 1024) /* 1 kB */ - _stprintf(buffer, sFmtkB, fBytes/1024.f+.5f); + sprintfW(buffer, sFmtkB, fBytes/1024.f+.5f); else - _stprintf(buffer, sLongNumFmt, bytes); + sprintfW(buffer, sFmtB, (DWORD)bytes); } static void set_space_status(void) @@ -3141,7 +3104,7 @@ static enum FILE_TYPE get_file_type(LPCTSTR filename) { - LPCTSTR ext = _tcsrchr(filename, '.'); + LPCTSTR ext = strrchrW(filename, '.'); if (!ext) ext = sEmpty; @@ -3354,11 +3317,7 @@ if (!(attrs&FILE_ATTRIBUTE_DIRECTORY)) #endif { - ULONGLONG size; - - size = ((ULONGLONG)entry->data.nFileSizeHigh << 32) | entry->data.nFileSizeLow; - - _stprintf(buffer, sLongNumFmt, size); + format_longlong( buffer, ((ULONGLONG)entry->data.nFileSizeHigh << 32) | entry->data.nFileSizeLow ); if (calcWidthCol == -1) output_number(pane, dis, col, buffer); @@ -3397,10 +3356,15 @@ #ifndef _NO_EXTENSIONS if (entry->bhfi_valid) { - ULONGLONG index = ((ULONGLONG)entry->bhfi.nFileIndexHigh << 32) | entry->bhfi.nFileIndexLow; - if (visible_cols & COL_INDEX) { - _stprintf(buffer, sLongHexFmt, index); + static const TCHAR fmtlow[] = {'%','X',0}; + static const TCHAR fmthigh[] = {'%','X','%','0','8','X',0}; + + if (entry->bhfi.nFileIndexHigh) + wsprintf(buffer, fmthigh, + entry->bhfi.nFileIndexHigh, entry->bhfi.nFileIndexLow ); + else + wsprintf(buffer, fmtlow, entry->bhfi.nFileIndexLow ); if (calcWidthCol == -1) output_text(pane, dis, col, buffer, DT_RIGHT); Modified: trunk/rosapps/applications/winfile/winefile.h URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/winef…
============================================================================== --- trunk/rosapps/applications/winfile/winefile.h [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/winefile.h [iso-8859-1] Thu Jan 8 08:07:10 2009 @@ -150,11 +150,9 @@ #ifdef UNICODE extern void _wsplitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR* ext); #define _tsplitpath _wsplitpath -#define _stprintf msvcrt_swprintf #else extern void _splitpath(const CHAR* path, CHAR* drv, CHAR* dir, CHAR* name, CHAR* ext); #define _tsplitpath _splitpath -#define _stprintf sprintf #endif #else
15 years, 11 months
1
0
0
0
[dgorbachev] 38641: Fix number of pages.
by dgorbachev@svn.reactos.org
Author: dgorbachev Date: Thu Jan 8 05:39:57 2009 New Revision: 38641 URL:
http://svn.reactos.org/svn/reactos?rev=38641&view=rev
Log: Fix number of pages. Modified: trunk/reactos/dll/cpl/hdwwiz/hdwwiz.c Modified: trunk/reactos/dll/cpl/hdwwiz/hdwwiz.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/hdwwiz/hdwwiz.c?re…
============================================================================== --- trunk/reactos/dll/cpl/hdwwiz/hdwwiz.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/hdwwiz/hdwwiz.c [iso-8859-1] Thu Jan 8 05:39:57 2009 @@ -383,7 +383,7 @@ static VOID HardwareWizardInit(HWND hwnd) { - HPROPSHEETPAGE ahpsp[5]; + HPROPSHEETPAGE ahpsp[6]; PROPSHEETPAGE psp = {0}; PROPSHEETHEADER psh; UINT nPages = 0;
15 years, 11 months
1
0
0
0
← Newer
1
...
58
59
60
61
62
63
64
...
76
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
Results per page:
10
25
50
100
200