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
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
July 2005
----- 2025 -----
January 2025
----- 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
21 participants
563 discussions
Start a n
N
ew thread
[ekohl] 16401: Remove trailing whitespace and fix indentation
by ekohl@svn.reactos.com
Remove trailing whitespace and fix indentation Modified: trunk/reactos/ntoskrnl/ke/i386/syscall.S Modified: trunk/reactos/ntoskrnl/ke/i386/tlbflush.S _____ Modified: trunk/reactos/ntoskrnl/ke/i386/syscall.S --- trunk/reactos/ntoskrnl/ke/i386/syscall.S 2005-07-03 21:35:41 UTC (rev 16400) +++ trunk/reactos/ntoskrnl/ke/i386/syscall.S 2005-07-03 21:37:16 UTC (rev 16401) @@ -25,16 +25,16 @@ .globl _KiDebugService _KiFastCallEntry: - + /* Set FS to PCR */ movl $PCR_SELECTOR, %ecx movw %cx, %fs - + /* Set the current stack to Kernel Stack */ movl %fs:KPCR_TSS, %ecx movl %ss:KTSS_ESP0(%ecx), %ecx movl %ecx, %esp - + /* Set up a fake INT Stack. */ pushl $USER_DS pushl %edx /* Ring 3 SS:ESP */ @@ -42,13 +42,13 @@ orl $X86_EFLAGS_IF, (%esp) /* Re-enable IRQs in EFLAGS, to fake INT */ pushl $USER_CS pushl $KUSER_SHARED_SYSCALL_RET - + /* User Parameter List */ add $8, %edx - + _KiSystemService: - /* + /* * Construct a trap frame on the stack. * The following are already on the stack. */ @@ -63,11 +63,11 @@ pushl %esi // + 0x20 pushl %edi // + 0x24 pushl %fs // + 0x28 - + /* Load PCR Selector into fs */ movw $PCR_SELECTOR, %bx movw %bx, %fs - + /* Save the previous exception list */ pushl %fs:KPCR_EXCEPTION_LIST // + 0x2C @@ -79,7 +79,7 @@ /* Save the old previous mode */ pushl %ss:KTHREAD_PREVIOUS_MODE(%esi) // + 0x30 - + /* Set the new previous mode based on the saved CS selector */ movl 0x24(%esp), %ebx andl $1, %ebx @@ -120,7 +120,7 @@ movl %ebp, KTHREAD_TRAP_FRAME(%esi) CheckValidCall: - + #ifdef DBG /* * GDB thinks the function starts here and @@ -139,29 +139,29 @@ shrl $8, %edi andl $0x10, %edi movl %edi, %ecx - + /* Now add the thread's base system table to the offset */ addl KTHREAD_SERVICE_TABLE(%esi), %edi - + /* Get the true syscall ID and check it */ movl %eax, %ebx andl $0x0FFF, %eax cmpl 8(%edi), %eax - + /* Invalid ID, try to load Win32K Table */ jnb KiBBTUnexpectedRange /* Users's current stack frame pointer is source */ movl %edx, %esi - + /* Allocate room for argument list from kernel stack */ movl 12(%edi), %ecx movb (%ecx, %eax), %cl movzx %cl, %ecx - + /* Allocate space on our stack */ subl %ecx, %esp - + /* Get pointer to function */ movl (%edi), %edi movl (%edi, %eax, 4), %eax @@ -193,25 +193,25 @@ /* Get the Current Thread */ cli movl %fs:KPCR_CURRENT_THREAD, %esi - + /* Deliver APCs only if we were called from user mode */ testb $1, KTRAP_FRAME_CS(%esp) je KiRosTrapReturn - + /* And only if any are actually pending */ cmpb $0, KTHREAD_PENDING_USER_APC(%esi) je KiRosTrapReturn - + /* Save pointer to Trap Frame */ movl %esp, %ebx - + /* Raise IRQL to APC_LEVEL */ movl $1, %ecx call @KfRaiseIrql@4 - + /* Save old IRQL */ pushl %eax - + /* Deliver APCs */ sti pushl %ebx @@ -219,13 +219,13 @@ pushl $UserMode call _KiDeliverApc@12 cli - + /* Return to old IRQL */ popl %ecx call @KfLowerIrql@4 - + KiRosTrapReturn: - + /* Skip debug information and unsaved registers */ addl $0x30, %esp // + 0x48 popl %gs // + 0x44 @@ -252,11 +252,11 @@ /* Check if previous CS is from user-mode */ testl $1, 4(%esp) - + /* It is, so use Fast Exit */ jnz FastRet - - /* + + /* * Restore what the stub pushed, and return back to it. * Note that we were CALLed, so the first thing on our stack is the ret EIP! */ @@ -264,9 +264,9 @@ pop %ecx // + 0x08 popf // + 0x04 jmp *%edx - + IntRet: - + iret FastRet: @@ -278,15 +278,15 @@ /* Restore FS to TIB */ mov $TEB_SELECTOR, %ecx mov %ecx, %fs - + /* We will be cleaning up the stack ourselves */ popl %edx /* New Ring 3 EIP */ add $0x4, %esp /* Skip Ring 3 DS */ andl $~X86_EFLAGS_IF, (%esp) /* Remove IRQ hack from EFLAGS */ popfl /* Restore old EFLAGS */ - popl %ecx /* Old Ring 3 SS:ESP */ - - /* + popl %ecx /* Old Ring 3 SS:ESP */ + + /* * At this point: * ECX points to the old User Stack. * EDX points to the instruction to execute in usermode after the sysenter @@ -306,41 +306,41 @@ call _KiServiceCheck popl %eax popl %edx - + /* Try the Call again */ jmp CheckValidCall - + InvalidCall: /* Invalid System Call */ movl $0xC000001C, %eax /* STATUS_INVALID_SYSTEM_SERVICE */ movl %eax, KTRAP_FRAME_EAX(%ebp) jmp _KiServiceExit - + _KiServiceExit2: /* Get the Current Thread */ cli movl %fs:KPCR_CURRENT_THREAD, %esi - + /* Deliver APCs only if we were called from user mode */ testb $1, KTRAP_FRAME_CS(%esp) je KiRosTrapReturn - + /* And only if any are actually pending */ cmpb $0, KTHREAD_PENDING_USER_APC(%esi) je KiRosTrapReturn - + /* Save pointer to Trap Frame */ movl %esp, %ebx - + /* Raise IRQL to APC_LEVEL */ movl $1, %ecx call @KfRaiseIrql@4 - + /* Save old IRQL */ pushl %eax - + /* Deliver APCs */ sti pushl %ebx @@ -348,14 +348,14 @@ pushl $UserMode call _KiDeliverApc@12 cli - + /* Return to old IRQL */ popl %ecx call @KfLowerIrql@4 - + /* Skip useless Debug Data */ addl $0x18, %esp // + 0x74 - + /* Restore Debug Registers */ popl %eax // + 0x5C movl %eax, %dr0 @@ -369,7 +369,7 @@ movl %eax, %dr6 popl %eax // + 0x48 movl %eax, %dr7 - + /* Restore Registers */ popl %gs // + 0x44 popl %es // + 0x40 @@ -393,12 +393,12 @@ popl %ebp // + 0x14 add $4, %esp // + 0x10 - /* Return to user-mode */ + /* Return to user-mode */ iret - + .intel_syntax noprefix _KiDebugService: - + /* Create the Trap Frame */ push 0 push ebp @@ -406,18 +406,18 @@ push esi push edi push fs - + /* Switch to correct FS */ mov bx, PCR_SELECTOR mov fs, bx - + /* Save Exception List */ push fs:[KPCR_EXCEPTION_LIST] - + /* Use Old Previous Mode */ mov ebx, fs:[KPCR_CURRENT_THREAD] push [ebx+KTHREAD_PREVIOUS_MODE] - + /* Continue building the Trap Frame */ push eax push ecx @@ -425,28 +425,28 @@ push ds push es push gs - + /* Switch Segments to Kernel */ mov bx, KERNEL_DS mov ds, bx mov es, bx - + /* Save Debug Registers */ mov ebx, eax - mov eax, dr7 + mov eax, dr7 push eax - mov eax, dr6 + mov eax, dr6 push eax - mov eax, dr3 + mov eax, dr3 push eax - mov eax, dr2 + mov eax, dr2 push eax - mov eax, dr1 + mov eax, dr1 push eax - mov eax, dr0 + mov eax, dr0 push eax mov eax, ebx - + /* Skip useless debug data */ sub esp, 0x18 @@ -455,6 +455,6 @@ push ecx push eax call _KdpServiceDispatcher@12 - + /* Exit through common routine */ jmp _KiServiceExit2 _____ Modified: trunk/reactos/ntoskrnl/ke/i386/tlbflush.S --- trunk/reactos/ntoskrnl/ke/i386/tlbflush.S 2005-07-03 21:35:41 UTC (rev 16400) +++ trunk/reactos/ntoskrnl/ke/i386/tlbflush.S 2005-07-03 21:37:16 UTC (rev 16401) @@ -1,7 +1,8 @@ -/* i386-specific implemetation of Translation Buffer Flushing +/* + * i386-specific implemetation of Translation Buffer Flushing * Written By: Alex Ionescu <alex(a)relsoft.net> * Reference: IA-32 Intel« Architecture Software Developer's Manual, Volume 3: System Programming Guide, - * Chapter 10 - Memory Cache Control. Section 10.9 - Invalidating the Translation Lookaside Buffers + * Chapter 10 - Memory Cache Control. Section 10.9 - Invalidating the Translation Lookaside Buffers */ #include <internal/i386/ke.h> @@ -9,24 +10,20 @@ .globl _KeFlushCurrentTb@0 _KeFlushCurrentTb@0: - /* Check for global page support */ - testb $0xff, (_Ke386GlobalPagesEnabled) - jz .L1 + /* Check for global page support */ + testb $0xff, (_Ke386GlobalPagesEnabled) + jz .L1 - /* Modifying the PSE, PGE or PAE Flag in CR4 causes the TLB to be flushed */ - movl %cr4, %eax - andl $~X86_CR4_PGE, %eax - movl %eax, %cr4 - orl $X86_CR4_PGE, %eax - movl %eax, %cr4 - - ret + /* Modifying the PSE, PGE or PAE Flag in CR4 causes the TLB to be flushed */ + movl %cr4, %eax + andl $~X86_CR4_PGE, %eax + movl %eax, %cr4 + orl $X86_CR4_PGE, %eax + movl %eax, %cr4 + ret .L1: /* the old way ... */ - movl %cr3, %eax - movl %eax, %cr3 - ret - - - + movl %cr3, %eax + movl %eax, %cr3 + ret
19 years, 6 months
1
0
0
0
[hpoussin] 16400: Delete unused makefiles
by hpoussin@svn.reactos.com
Delete unused makefiles Deleted: trunk/reactos/boot/freeldr/bootsect/Makefile.i386 Deleted: trunk/reactos/boot/freeldr/bootsect/Makefile.powerpc Deleted: trunk/reactos/lib/pseh/makefile.i386 Deleted: trunk/reactos/lib/rosrtl/makefile.i386 Deleted: trunk/reactos/lib/string/Makefile.i386 _____ Deleted: trunk/reactos/boot/freeldr/bootsect/Makefile.i386 --- trunk/reactos/boot/freeldr/bootsect/Makefile.i386 2005-07-03 21:25:00 UTC (rev 16399) +++ trunk/reactos/boot/freeldr/bootsect/Makefile.i386 2005-07-03 21:35:41 UTC (rev 16400) @@ -1,52 +0,0 @@ -all: $(BIN2C) dosmbr.bin fat.bin fat32.bin isoboot.bin ext2.bin - -$(BIN2C) : - @$(MAKE) --no-print-directory -C $(FREELDR_TOOLS_PATH) - -dosmbr.bin : dosmbr.asm - @echo ===================================================== Assembling dosmbr - @$(NASM_CMD) $(NFLAGS) -o dosmbr.bin -f bin dosmbr.asm - -fat.bin : fat.asm $(BIN2C) - @echo ===================================================== Assembling fat - @$(NASM_CMD) $(NFLAGS) -o fat.bin -f bin fat.asm - @$(BIN2C) fat.bin fat.h fat_data - - -fat32.bin : fat32.asm $(BIN2C) - @echo ===================================================== Assembling fat32 - @$(NASM_CMD) $(NFLAGS) -o fat32.bin -f bin fat32.asm - @$(BIN2C) fat32.bin fat32.h fat32_data - -isoboot.bin : isoboot.asm - @echo ===================================================== Assembling isoboot - @$(NASM_CMD) $(NFLAGS) -o isoboot.bin -f bin isoboot.asm - -ext2.bin : ext2.asm - @echo ===================================================== Assembling ext2 - @$(NASM_CMD) $(NFLAGS) -o ext2.bin -f bin ext2.asm - @$(BIN2C) ext2.bin ext2.h ext2_data - - -.PHONY : bootcd -bootcd: bootcd_dirs isoboot.bin - $(CP) isoboot.bin $(BOOTCD_DIR) - $(CP) dosmbr.bin $(BOOTCD_DIR)/disk/loader - $(CP) ext2.bin $(BOOTCD_DIR)/disk/loader - $(CP) fat.bin $(BOOTCD_DIR)/disk/loader - $(CP) fat32.bin $(BOOTCD_DIR)/disk/loader - $(CP) isoboot.bin $(BOOTCD_DIR)/disk/loader - -.PHONY : bootcd_dirs -bootcd_dirs: - $(MKDIR) $(BOOTCD_DIR) - $(MKDIR) $(BOOTCD_DIR)/disk - $(MKDIR) $(BOOTCD_DIR)/disk/reactos - $(MKDIR) $(BOOTCD_DIR)/disk/install - $(MKDIR) $(BOOTCD_DIR)/disk/bootdisk - $(MKDIR) $(BOOTCD_DIR)/disk/loader - -clean: - @-$(RM) *.bin - @-$(RM) *.h - @echo Clean ALL done. _____ Deleted: trunk/reactos/boot/freeldr/bootsect/Makefile.powerpc --- trunk/reactos/boot/freeldr/bootsect/Makefile.powerpc 2005-07-03 21:25:00 UTC (rev 16399) +++ trunk/reactos/boot/freeldr/bootsect/Makefile.powerpc 2005-07-03 21:35:41 UTC (rev 16400) @@ -1,35 +0,0 @@ -TOOLS=$(PATH_TO_TOP)/tools -SECTIONS= \ - --only-section=.text \ - --only-section=.data \ - --only-section=.bss -LDSECT= -Ttext 0xe00000 -Tdata 0xe10000 -OBJS=ofwboot.o freeldr.o -CFLAGS=-mbig -meabi -fPIC -fno-builtin -I../freeldr/include -FREELDR=../freeldr/freeldr.sys - -.SUFFIXES: .c .o - -all: ofwldr - -hack-coff$(EXEEXT): - $(HOST_CC) -I../freeldr/include hack-coff.c -o $@ - -ofwboot.o: ofwboot.s - $(NASM_CMD) $< -c -o $@ - -$(FREELDR): - $(MAKE) -C ../freeldr - -freeldr.o: $(FREELDR) - $(TOOLS)/ppc-le2be $< freeldr.tmp - $(OBJCOPY) -I binary -O elf32-powerpc -B powerpc:common freeldr.tmp $@ - rm freeldr.tmp - -ofwldr: $(OBJS) - $(LD) -melf32ppc --no-omagic $(LDSECT) $(OBJS) -g -o $@.elf - $(OBJCOPY) $(SECTIONS) -O aixcoff-rs6000 $@.elf $@ - $(TOOLS)/hack-coff $@ - -clean: - rm -rf ofwldr *.o *.elf *.tmp _____ Deleted: trunk/reactos/lib/pseh/makefile.i386 --- trunk/reactos/lib/pseh/makefile.i386 2005-07-03 21:25:00 UTC (rev 16399) +++ trunk/reactos/lib/pseh/makefile.i386 2005-07-03 21:35:41 UTC (rev 16400) @@ -1,5 +0,0 @@ -# $Id$ - -TARGET_ARCH_OBJECTS = $(ARCH)/framebased.o $(ARCH)/setjmp.o - -# EOF _____ Deleted: trunk/reactos/lib/rosrtl/makefile.i386 --- trunk/reactos/lib/rosrtl/makefile.i386 2005-07-03 21:25:00 UTC (rev 16399) +++ trunk/reactos/lib/rosrtl/makefile.i386 2005-07-03 21:35:41 UTC (rev 16400) @@ -1,9 +0,0 @@ -# $Id$ - -THREAD_OBJECTS := \ - $(THREAD_OBJECTS) \ - thread/linearstack.o \ - thread/$(ARCH)/context.o \ - thread/$(ARCH)/stackexit.o - -# EOF _____ Deleted: trunk/reactos/lib/string/Makefile.i386 --- trunk/reactos/lib/string/Makefile.i386 2005-07-03 21:25:00 UTC (rev 16399) +++ trunk/reactos/lib/string/Makefile.i386 2005-07-03 21:35:41 UTC (rev 16400) @@ -1,34 +0,0 @@ -# $Id$ - - -EXCLUDE_FILTER = \ - memchr.o \ - memcpy.o \ - memmove.o \ - memset.o \ - strcat.o \ - strchr.o \ - strcmp.o \ - strcpy.o \ - strlen.o \ - strncat.o \ - strncmp.o \ - strncpy.o \ - strrchr.o \ - strnlen.o \ - wcscat.o \ - wcschr.o \ - wcscmp.o \ - wcscpy.o \ - wcslen.o \ - wcsncat.o \ - wcsncmp.o \ - wcsncpy.o \ - wcsnlen.o \ - wcsrchr.o - - -OBJECTS_ARCH = $(addprefix i386/, $(EXCLUDE_FILTER)) - - -# EOF
19 years, 6 months
1
0
0
0
[ekohl] 16399: - Implement PlugPlayControlProperty and PlugPlayControlGetDeviceDepth
by ekohl@svn.reactos.com
- Implement PlugPlayControlProperty and PlugPlayControlGetDeviceDepth - Move documentation from NDK headers Modified: trunk/reactos/include/ndk/zwtypes.h Modified: trunk/reactos/ntoskrnl/io/plugplay.c _____ Modified: trunk/reactos/include/ndk/zwtypes.h --- trunk/reactos/include/ndk/zwtypes.h 2005-07-03 20:19:55 UTC (rev 16398) +++ trunk/reactos/include/ndk/zwtypes.h 2005-07-03 21:25:00 UTC (rev 16399) @@ -279,7 +279,8 @@ PlugPlayControlUserResponse = 0x07, PlugPlayControlProperty = 0x0A, PlugPlayControlGetRelatedDevice = 0x0C, - PlugPlayControlDeviceStatus = 0x0E + PlugPlayControlDeviceStatus = 0x0E, + PlugPlayControlGetDeviceDepth } PLUGPLAY_CONTROL_CLASS; /* TYPES *********************************************************************/ @@ -287,34 +288,6 @@ typedef unsigned short LANGID; typedef LANGID *PLANGID; -/* - * Plug and Play event structure used by NtGetPlugPlayEvent. - * - * EventGuid - * Can be one of the following values: - * GUID_HWPROFILE_QUERY_CHANGE - * GUID_HWPROFILE_CHANGE_CANCELLED - * GUID_HWPROFILE_CHANGE_COMPLETE - * GUID_TARGET_DEVICE_QUERY_REMOVE - * GUID_TARGET_DEVICE_REMOVE_CANCELLED - * GUID_TARGET_DEVICE_REMOVE_COMPLETE - * GUID_PNP_CUSTOM_NOTIFICATION - * GUID_PNP_POWER_NOTIFICATION - * GUID_DEVICE_* (see above) - * - * EventCategory - * Type of the event that happened. - * - * Result - * ? - * - * Flags - * ? - * - * TotalSize - * Size of the event block including the device IDs and other - * per category specific fields. - */ typedef struct _PLUGPLAY_EVENT_BLOCK { GUID EventGuid; @@ -1285,4 +1258,11 @@ ULONG DeviceProblem; /* CM_PROB_ see cfg.h */ } PLUGPLAY_CONTROL_STATUS_DATA, *PPLUGPLAY_CONTROL_STATUS_DATA; +/* Class 0x0F */ +typedef struct _PLUGPLAY_CONTOL_DEPTH_DATA +{ + UNICODE_STRING DeviceInstance; + ULONG Depth; +} PLUGPLAY_CONTROL_DEPTH_DATA, *PPLUGPLAY_CONTROL_DEPTH_DATA; + #endif _____ Modified: trunk/reactos/ntoskrnl/io/plugplay.c --- trunk/reactos/ntoskrnl/io/plugplay.c 2005-07-03 20:19:55 UTC (rev 16398) +++ trunk/reactos/ntoskrnl/io/plugplay.c 2005-07-03 21:25:00 UTC (rev 16399) @@ -104,6 +104,34 @@ /* + * Plug and Play event structure used by NtGetPlugPlayEvent. + * + * EventGuid + * Can be one of the following values: + * GUID_HWPROFILE_QUERY_CHANGE + * GUID_HWPROFILE_CHANGE_CANCELLED + * GUID_HWPROFILE_CHANGE_COMPLETE + * GUID_TARGET_DEVICE_QUERY_REMOVE + * GUID_TARGET_DEVICE_REMOVE_CANCELLED + * GUID_TARGET_DEVICE_REMOVE_COMPLETE + * GUID_PNP_CUSTOM_NOTIFICATION + * GUID_PNP_POWER_NOTIFICATION + * GUID_DEVICE_* (see above) + * + * EventCategory + * Type of the event that happened. + * + * Result + * ? + * + * Flags + * ? + * + * TotalSize + * Size of the event block including the device IDs and other + * per category specific fields. + */ +/* * NtGetPlugPlayEvent * * Returns one Plug & Play event from a global queue. @@ -312,6 +340,32 @@ static NTSTATUS +IopGetDeviceProperty(PPLUGPLAY_CONTROL_PROPERTY_DATA PropertyData) +{ + PDEVICE_OBJECT DeviceObject = NULL; + NTSTATUS Status; + + DPRINT("IopGetDeviceProperty() called\n"); + DPRINT("Device name: %wZ\n", &PropertyData->DeviceInstance); + + /* Get the device object */ + DeviceObject = IopGetDeviceObjectFromDeviceInstance(&PropertyData->DeviceInstance); + if (DeviceObject == NULL) + return STATUS_NO_SUCH_DEVICE; + + Status = IoGetDeviceProperty(DeviceObject, + PropertyData->Property, + PropertyData->BufferSize, + PropertyData->Buffer, + &PropertyData->BufferSize); + + ObDereferenceObject(DeviceObject); + + return Status; +} + + +static NTSTATUS IopGetRelatedDevice(PPLUGPLAY_CONTROL_RELATED_DEVICE_DATA RelatedDeviceData) { UNICODE_STRING RootDeviceName; @@ -320,7 +374,6 @@ PDEVICE_NODE RelatedDeviceNode; DPRINT("IopGetRelatedDevice() called\n"); - DPRINT("Device name: %wZ\n", &RelatedDeviceData->TargetDeviceInstance); RtlInitUnicodeString(&RootDeviceName, @@ -410,7 +463,6 @@ PDEVICE_NODE DeviceNode; DPRINT("IopDeviceStatus() called\n"); - DPRINT("Device name: %wZ\n", &StatusData->DeviceInstance); /* Get the device object */ @@ -445,6 +497,30 @@ } +static NTSTATUS +IopGetDeviceDepth(PPLUGPLAY_CONTROL_DEPTH_DATA DepthData) +{ + PDEVICE_OBJECT DeviceObject; + PDEVICE_NODE DeviceNode; + + DPRINT("IopGetDeviceDepth() called\n"); + DPRINT("Device name: %wZ\n", &DepthData->DeviceInstance); + + /* Get the device object */ + DeviceObject = IopGetDeviceObjectFromDeviceInstance(&DepthData->DeviceInstance); + if (DeviceObject == NULL) + return STATUS_NO_SUCH_DEVICE; + + DeviceNode = DeviceObject->DeviceObjectExtension->DeviceNode; + + DepthData->Depth = DeviceNode->Level; + + ObDereferenceObject(DeviceObject); + + return STATUS_SUCCESS; +} + + /* * NtPlugPlayControl * @@ -551,6 +627,11 @@ return STATUS_INVALID_PARAMETER; return IopRemovePlugPlayEvent(); + case PlugPlayControlProperty: + if (!Buffer || BufferLength < sizeof(PLUGPLAY_CONTROL_PROPERTY_DATA)) + return STATUS_INVALID_PARAMETER; + return IopGetDeviceProperty((PPLUGPLAY_CONTROL_PROPERTY_DATA)Buffer); + case PlugPlayControlGetRelatedDevice: if (!Buffer || BufferLength < sizeof(PLUGPLAY_CONTROL_RELATED_DEVICE_DATA)) return STATUS_INVALID_PARAMETER; @@ -561,6 +642,11 @@ return STATUS_INVALID_PARAMETER; return IopDeviceStatus((PPLUGPLAY_CONTROL_STATUS_DATA)Buffer); + case PlugPlayControlGetDeviceDepth: + if (!Buffer || BufferLength < sizeof(PLUGPLAY_CONTROL_DEPTH_DATA)) + return STATUS_INVALID_PARAMETER; + return IopGetDeviceDepth((PPLUGPLAY_CONTROL_DEPTH_DATA)Buffer); + default: return STATUS_NOT_IMPLEMENTED; }
19 years, 6 months
1
0
0
0
[hpoussin] 16398: Implement SetupDiGetDeviceRegistryPropertyA
by hpoussin@svn.reactos.com
Implement SetupDiGetDeviceRegistryPropertyA Add stub for SetupDiGetDeviceRegistryPropertyW Modified: trunk/reactos/include/wine/setupapi.h Modified: trunk/reactos/lib/setupapi/devinst.c _____ Modified: trunk/reactos/include/wine/setupapi.h --- trunk/reactos/include/wine/setupapi.h 2005-07-03 20:12:16 UTC (rev 16397) +++ trunk/reactos/include/wine/setupapi.h 2005-07-03 20:19:55 UTC (rev 16398) @@ -747,6 +747,7 @@ DWORD, PDWORD, PSP_DEVINFO_DATA); #define SetupDiGetDeviceInterfaceDetail WINELIB_NAME_AW(SetupDiGetDeviceInterfaceDetail) BOOL WINAPI SetupDiGetDeviceRegistryPropertyA(HDEVINFO, PSP_DEVINFO_DATA, DWORD, PDWORD, PBYTE, DWORD, PDWORD); +BOOL WINAPI SetupDiGetDeviceRegistryPropertyW(HDEVINFO, PSP_DEVINFO_DATA, DWORD, PDWORD, PBYTE, DWORD, PDWORD); BOOL WINAPI SetupDiInstallClassA(HWND, PCSTR, DWORD, HSPFILEQ); BOOL WINAPI SetupDiInstallClassW(HWND, PCWSTR, DWORD, HSPFILEQ); #define SetupDiInstallClass WINELIB_NAME_AW(SetupDiInstallClass) _____ Modified: trunk/reactos/lib/setupapi/devinst.c --- trunk/reactos/lib/setupapi/devinst.c 2005-07-03 20:12:16 UTC (rev 16397) +++ trunk/reactos/lib/setupapi/devinst.c 2005-07-03 20:19:55 UTC (rev 16398) @@ -1181,12 +1181,86 @@ DWORD PropertyBufferSize, PDWORD RequiredSize) { + BOOL bResult; + BOOL bIsStringProperty; + DWORD RegType; + DWORD RequiredSizeA, RequiredSizeW; + DWORD PropertyBufferSizeW; + PBYTE PropertyBufferW; + + TRACE("%04lx %p %ld %p %p %ld %p\n", (DWORD)devinfo, DeviceInfoData, + Property, PropertyRegDataType, PropertyBuffer, PropertyBufferSize, + RequiredSize); + + PropertyBufferSizeW = PropertyBufferSize * 2; + PropertyBufferW = HeapAlloc(GetProcessHeap(), 0, PropertyBufferSizeW); + + bResult = SetupDiGetDeviceRegistryPropertyW( + devinfo, + DeviceInfoData, + Property, + &RegType, + PropertyBufferW, + PropertyBufferSizeW, + &RequiredSizeW); + + HeapFree(GetProcessHeap(), 0, PropertyBufferW); + + if (!bResult) + return bResult; + + bIsStringProperty = (RegType == REG_SZ || RegType == REG_MULTI_SZ); + + if (bIsStringProperty) + RequiredSizeA = RequiredSizeW / sizeof(WCHAR); + else + RequiredSizeA = RequiredSizeW; + + if (RequiredSizeA <= PropertyBufferSize) + { + if (bIsStringProperty && PropertyBufferSize > 0) + { + if (WideCharToMultiByte(CP_ACP, 0, (LPWSTR)PropertyBufferW, RequiredSizeW / sizeof(WCHAR), PropertyBuffer, PropertyBufferSize, NULL, NULL) == 0) + { + /* Last error is already set by WideCharToMultiByte */ + bResult = FALSE; + } + } + else + memcpy(PropertyBuffer, PropertyBufferW, RequiredSizeA); + } + else + { + SetLastError(ERROR_INSUFFICIENT_BUFFER); + bResult = FALSE; + } + + if (PropertyRegDataType) + *PropertyRegDataType = RegType; + if (RequiredSize) + *RequiredSize = RequiredSizeA; + return bResult; +} + +/********************************************************************** * + * SetupDiGetDeviceRegistryPropertyW (SETUPAPI.@) + */ +BOOL WINAPI SetupDiGetDeviceRegistryPropertyW( + HDEVINFO devinfo, + PSP_DEVINFO_DATA DeviceInfoData, + DWORD Property, + PDWORD PropertyRegDataType, + PBYTE PropertyBuffer, + DWORD PropertyBufferSize, + PDWORD RequiredSize) +{ FIXME("%04lx %p %ld %p %p %ld %p\n", (DWORD)devinfo, DeviceInfoData, Property, PropertyRegDataType, PropertyBuffer, PropertyBufferSize, RequiredSize); return FALSE; } + /*********************************************************************** * SetupDiInstallClassA (SETUPAPI.@) */
19 years, 6 months
1
0
0
0
[mf] 16397: fix compile errors
by mf@svn.reactos.com
fix compile errors Modified: trunk/reactos/subsys/system/winefile/winefile.c _____ Modified: trunk/reactos/subsys/system/winefile/winefile.c --- trunk/reactos/subsys/system/winefile/winefile.c 2005-07-03 19:32:55 UTC (rev 16396) +++ trunk/reactos/subsys/system/winefile/winefile.c 2005-07-03 20:12:16 UTC (rev 16397) @@ -656,21 +656,19 @@ #endif -static LPSTR strcpyn(LPSTR dest, LPCSTR source, size_t count) +static void free_strret(STRRET* str) { - LPCSTR s; - LPSTR d = dest; + if (str->uType == STRRET_WSTR) + (*Globals.iMalloc->lpVtbl->Free)(Globals.iMalloc, str->UNION_MEMBER(pOleStr)); +} - for(s=source; count&&(*d++=*s++); ) - count--; - return dest; -} +#ifndef UNICODE -static LPWSTR wcscpyn(LPWSTR dest, LPCWSTR source, size_t count) +static LPSTR strcpyn(LPSTR dest, LPCSTR source, size_t count) { - LPCWSTR s; - LPWSTR d = dest; + LPCSTR s; + LPSTR d = dest; for(s=source; count&&(*d++=*s++); ) count--;
19 years, 6 months
1
0
0
0
[weiden] 16396: actually disable it, sorry
by weiden@svn.reactos.com
actually disable it, sorry Modified: trunk/reactos/lib/aclui/aclui.xml _____ Modified: trunk/reactos/lib/aclui/aclui.xml --- trunk/reactos/lib/aclui/aclui.xml 2005-07-03 19:32:30 UTC (rev 16395) +++ trunk/reactos/lib/aclui/aclui.xml 2005-07-03 19:32:55 UTC (rev 16396) @@ -7,7 +7,6 @@ <define name="_WIN32_IE">0x0500</define> <define name="_WIN32_WINNT">0x501</define> <define name="WINVER">0x0600</define> - <define name="SUPPORT_UXTHEME" /> <library>ntdll</library> <library>kernel32</library> <library>user32</library>
19 years, 6 months
1
0
0
0
[weiden] 16395: add support for XP themes (disabled by default)
by weiden@svn.reactos.com
add support for XP themes (disabled by default) Modified: trunk/reactos/lib/aclui/aclui.xml Modified: trunk/reactos/lib/aclui/acluilib.h Modified: trunk/reactos/lib/aclui/checklist.c _____ Modified: trunk/reactos/lib/aclui/aclui.xml --- trunk/reactos/lib/aclui/aclui.xml 2005-07-03 18:32:22 UTC (rev 16394) +++ trunk/reactos/lib/aclui/aclui.xml 2005-07-03 19:32:30 UTC (rev 16395) @@ -7,11 +7,13 @@ <define name="_WIN32_IE">0x0500</define> <define name="_WIN32_WINNT">0x501</define> <define name="WINVER">0x0600</define> + <define name="SUPPORT_UXTHEME" /> <library>ntdll</library> <library>kernel32</library> <library>user32</library> <library>gdi32</library> <library>comctl32</library> + <library>uxtheme</library> <file>aclui.c</file> <file>checklist.c</file> <file>misc.c</file> _____ Modified: trunk/reactos/lib/aclui/acluilib.h --- trunk/reactos/lib/aclui/acluilib.h 2005-07-03 18:32:22 UTC (rev 16394) +++ trunk/reactos/lib/aclui/acluilib.h 2005-07-03 19:32:30 UTC (rev 16395) @@ -4,6 +4,10 @@ #include <aclui.h> #include <sddl.h> #include <ntsecapi.h> +#if SUPPORT_UXTHEME +#include <uxtheme.h> +#include <tmschema.h> +#endif #include "resource.h" ULONG DbgPrint(PCH Format,...); _____ Modified: trunk/reactos/lib/aclui/checklist.c --- trunk/reactos/lib/aclui/checklist.c 2005-07-03 18:32:22 UTC (rev 16394) +++ trunk/reactos/lib/aclui/checklist.c 2005-07-03 19:32:30 UTC (rev 16395) @@ -52,6 +52,14 @@ COLORREF TextColor[2]; UINT CheckBoxLeft[2]; + +#if SUPPORT_UXTHEME + PCHECKITEM HoveredCheckItem; + UINT HoveredCheckItemBox; + UINT HoverTime; + + HTHEME ThemeHandle; +#endif } CHECKLISTWND, *PCHECKLISTWND; #define CI_TEXT_MARGIN_WIDTH (6) @@ -512,7 +520,7 @@ VisibleItems = ((rcClient.bottom - rcClient.top) + infoPtr->ItemHeight - 1) / infoPtr->ItemHeight; - if (Index < VisibleFirst + VisibleItems) + if (Index <= VisibleFirst + VisibleItems) { RECT rcUpdate; @@ -653,6 +661,27 @@ return hOldFont; } +#if SUPPORT_UXTHEME +static INT +CalculateChkBoxStyle(IN BOOL Checked, + IN BOOL Enabled, + IN BOOL HotTrack) +{ + INT BtnState; + + if (Checked) + { + BtnState = (Enabled ? (HotTrack ? CBS_CHECKEDHOT : CBS_CHECKEDNORMAL) : CBS_CHECKEDDISABLED); + } + else + { + BtnState = (Enabled ? (HotTrack ? CBS_UNCHECKEDHOT : CBS_UNCHECKEDNORMAL) : CBS_UNCHECKEDDISABLED); + } + + return BtnState; +} +#endif + static VOID PaintControl(IN PCHECKLISTWND infoPtr, IN HDC hDC, @@ -694,6 +723,10 @@ COLORREF OldTextColor; BOOL Enabled, PrevEnabled; POINT hOldBrushOrg; +#if SUPPORT_UXTHEME + HRESULT hDrawResult; + BOOL ItemHovered; +#endif Enabled = IsWindowEnabled(infoPtr->hSelf); PrevEnabled = Enabled; @@ -736,6 +769,10 @@ SetTextColor(hDC, infoPtr->TextColor[PrevEnabled]); } + +#if SUPPORT_UXTHEME + ItemHovered = (Enabled && infoPtr->HoveredCheckItem == Item); +#endif /* draw the text */ DrawText(hDC, @@ -749,12 +786,39 @@ CheckBox.right = CheckBox.left + (TextRect.bottom - TextRect.top) - (2 * CI_TEXT_MARGIN_HEIGHT); CheckBox.top = TextRect.top; CheckBox.bottom = CheckBox.top + (TextRect.bottom - TextRect.top) - (2 * CI_TEXT_MARGIN_HEIGHT); - DrawFrameControl(hDC, - &CheckBox, - DFC_BUTTON, - DFCS_BUTTONCHECK | DFCS_FLAT | - ((Item->State & CIS_ALLOWDISABLED) || !Enabled ? DFCS_INACTIVE : 0) | - ((Item->State & CIS_ALLOW) ? DFCS_CHECKED : 0)); +#if SUPPORT_UXTHEME + if (infoPtr->ThemeHandle != NULL) + { + INT BtnState = CalculateChkBoxStyle(Item->State & CIS_ALLOW, + Enabled && !(Item->State & CIS_ALLOWDISABLED), + (ItemHovered && infoPtr->HoveredCheckItemBox != CLB_DENY)); + + + hDrawResult = DrawThemeBackground(infoPtr->ThemeHandle, + hDC, + BP_CHECKBOX, + BtnState, + &CheckBox, + NULL); + + } + else + { + hDrawResult = E_FAIL; + } + + /* draw the standard checkbox if no themes are enabled or drawing the + themeed control failed */ + if (FAILED(hDrawResult)) +#endif + { + DrawFrameControl(hDC, + &CheckBox, + DFC_BUTTON, + DFCS_BUTTONCHECK | DFCS_FLAT | + ((Item->State & CIS_ALLOWDISABLED) || !Enabled ? DFCS_INACTIVE : 0) | + ((Item->State & CIS_ALLOW) ? DFCS_CHECKED : 0)); + } if (infoPtr->HasFocus && Item == infoPtr->FocusedCheckItem && infoPtr->FocusedCheckItemBox != CLB_DENY) @@ -772,12 +836,38 @@ /* draw the Deny checkbox */ CheckBox.left = infoPtr->CheckBoxLeft[CLB_DENY] - ((TextRect.bottom - TextRect.top) / 2); CheckBox.right = CheckBox.left + (TextRect.bottom - TextRect.top) - (2 * CI_TEXT_MARGIN_HEIGHT); - DrawFrameControl(hDC, - &CheckBox, - DFC_BUTTON, - DFCS_BUTTONCHECK | DFCS_FLAT | - ((Item->State & CIS_DENYDISABLED) || !Enabled ? DFCS_INACTIVE : 0) | - ((Item->State & CIS_DENY) ? DFCS_CHECKED : 0)); +#if SUPPORT_UXTHEME + if (infoPtr->ThemeHandle != NULL) + { + INT BtnState = CalculateChkBoxStyle(Item->State & CIS_DENY, + Enabled && !(Item->State & CIS_DENYDISABLED), + (ItemHovered && infoPtr->HoveredCheckItemBox == CLB_DENY)); + + hDrawResult = DrawThemeBackground(infoPtr->ThemeHandle, + hDC, + BP_CHECKBOX, + BtnState, + &CheckBox, + NULL); + + } + else + { + hDrawResult = E_FAIL; + } + + /* draw the standard checkbox if no themes are enabled or drawing the + themeed control failed */ + if (FAILED(hDrawResult)) +#endif + { + DrawFrameControl(hDC, + &CheckBox, + DFC_BUTTON, + DFCS_BUTTONCHECK | DFCS_FLAT | + ((Item->State & CIS_DENYDISABLED) || !Enabled ? DFCS_INACTIVE : 0) | + ((Item->State & CIS_DENY) ? DFCS_CHECKED : 0)); + } if (infoPtr->HasFocus && Item == infoPtr->FocusedCheckItem && infoPtr->FocusedCheckItemBox == CLB_DENY) @@ -812,7 +902,7 @@ static VOID ChangeCheckItemFocus(IN PCHECKLISTWND infoPtr, IN PCHECKITEM NewFocus, - IN INT NewFocusBox) + IN UINT NewFocusBox) { if (NewFocus != infoPtr->FocusedCheckItem) { @@ -840,6 +930,92 @@ } } +#if SUPPORT_UXTHEME +static VOID +UpdateCheckItemBox(IN PCHECKLISTWND infoPtr, + IN PCHECKITEM Item, + IN UINT ItemBox) +{ + LONG Style; + RECT rcClient; + INT VisibleFirst, VisibleItems; + INT Index = CheckItemToIndex(infoPtr, + Item); + if (Index != -1) + { + Style = GetWindowLong(infoPtr->hSelf, + GWL_STYLE); + + if (Style & WS_VSCROLL) + { + VisibleFirst = GetScrollPos(infoPtr->hSelf, + SB_VERT); + } + else + { + VisibleFirst = 0; + } + + if (Index >= VisibleFirst) + { + GetClientRect(infoPtr->hSelf, + &rcClient); + + VisibleItems = ((rcClient.bottom - rcClient.top) + infoPtr->ItemHeight - 1) / infoPtr->ItemHeight; + + if (Index <= VisibleFirst + VisibleItems) + { + RECT rcUpdate; + + rcUpdate.left = rcClient.left + infoPtr->CheckBoxLeft[ItemBox] - (infoPtr->ItemHeight / 2); + rcUpdate.right = rcUpdate.left + infoPtr->ItemHeight; + rcUpdate.top = ((Index - VisibleFirst) * infoPtr->ItemHeight) + CI_TEXT_MARGIN_HEIGHT; + rcUpdate.bottom = rcUpdate.top + infoPtr->ItemHeight - (2 * CI_TEXT_MARGIN_HEIGHT); + DbgPrint("Repaint hot item\n"); + + RedrawWindow(infoPtr->hSelf, + &rcUpdate, + NULL, + RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_NOCHILDREN); + } + } + } +} + +static VOID +ChangeCheckItemHotTrack(IN PCHECKLISTWND infoPtr, + IN PCHECKITEM NewHotTrack, + IN UINT NewHotTrackBox) +{ + if (NewHotTrack != infoPtr->HoveredCheckItem) + { + PCHECKITEM OldHotTrack = infoPtr->HoveredCheckItem; + UINT OldHotTrackBox = infoPtr->HoveredCheckItemBox; + + infoPtr->HoveredCheckItem = NewHotTrack; + infoPtr->HoveredCheckItemBox = NewHotTrackBox; + + if (OldHotTrack != NULL) + { + UpdateCheckItemBox(infoPtr, + OldHotTrack, + OldHotTrackBox); + } + } + else + { + infoPtr->HoveredCheckItemBox = NewHotTrackBox; + } + + if (NewHotTrack != NULL) + { + UpdateCheckItemBox(infoPtr, + NewHotTrack, + NewHotTrackBox); + } +} +#endif + static LRESULT CALLBACK CheckListWndProc(IN HWND hwnd, IN UINT uMsg, @@ -889,6 +1065,55 @@ break; } + case WM_MOUSEMOVE: + { +#if SUPPORT_UXTHEME + HWND hWndCapture = GetCapture(); + + /* handle hovering checkboxes */ + if (hWndCapture == NULL) + { + TRACKMOUSEEVENT tme; + PCHECKITEM HotTrackItem; + UINT HotTrackItemBox; + BOOL InCheckBox; + POINT pt; + + pt.x = (LONG)LOWORD(lParam); + pt.y = (LONG)HIWORD(lParam); + + HotTrackItem = PtToCheckItemBox(infoPtr, + &pt, + &HotTrackItemBox, + &InCheckBox); + if (HotTrackItem != NULL && InCheckBox) + { + if (infoPtr->HoveredCheckItem != HotTrackItem || + infoPtr->HoveredCheckItemBox != HotTrackItemBox) + { + ChangeCheckItemHotTrack(infoPtr, + HotTrackItem, + HotTrackItemBox); + } + } + else + { + ChangeCheckItemHotTrack(infoPtr, + NULL, + 0); + } + + tme.cbSize = sizeof(tme); + tme.dwFlags = TME_LEAVE; + tme.hwndTrack = hwnd; + tme.dwHoverTime = infoPtr->HoverTime; + + TrackMouseEvent(&tme); + } +#endif + break; + } + case WM_VSCROLL: { SCROLLINFO ScrollInfo; @@ -1403,6 +1628,51 @@ break; } +#if SUPPORT_UXTHEME + case WM_MOUSELEAVE: + { + DbgPrint("WM_MOUSELEAVE\n"); + if (infoPtr->HoveredCheckItem != NULL) + { + /* reset and repaint the hovered check item box */ + ChangeCheckItemHotTrack(infoPtr, + NULL, + 0); + } + break; + } + + case WM_THEMECHANGED: + { + if (infoPtr->ThemeHandle != NULL) + { + CloseThemeData(infoPtr->ThemeHandle); + infoPtr->ThemeHandle = NULL; + } + if (IsThemeActive()) + { + infoPtr->ThemeHandle = OpenThemeData(infoPtr->hSelf, + L"BUTTON"); + } + break; + } +#endif + + case WM_SETTINGCHANGE: + { +#if SUPPORT_UXTHEME + /* update the hover time */ + if (!SystemParametersInfo(SPI_GETMOUSEHOVERTIME, + 0, + &infoPtr->HoverTime, + 0)) + { + infoPtr->HoverTime = HOVER_DEFAULT; + } +#endif + break; + } + case WM_CREATE: { infoPtr = HeapAlloc(GetProcessHeap(), @@ -1435,6 +1705,28 @@ infoPtr->CheckBoxLeft[0] = rcClient.right - 30; infoPtr->CheckBoxLeft[1] = rcClient.right - 15; + +#if SUPPORT_UXTHEME + infoPtr->HoveredCheckItem = NULL; + infoPtr->HoveredCheckItemBox = 0; + if (!SystemParametersInfo(SPI_GETMOUSEHOVERTIME, + 0, + &infoPtr->HoverTime, + 0)) + { + infoPtr->HoverTime = HOVER_DEFAULT; + } + + if (IsThemeActive()) + { + infoPtr->ThemeHandle = OpenThemeData(infoPtr->hSelf, + L"BUTTON"); + } + else + { + infoPtr->ThemeHandle = NULL; + } +#endif } else { @@ -1447,6 +1739,13 @@ { ClearCheckItems(infoPtr); +#if SUPPORT_UXTHEME + if (infoPtr->ThemeHandle != NULL) + { + CloseThemeData(infoPtr->ThemeHandle); + } +#endif + HeapFree(GetProcessHeap(), 0, infoPtr);
19 years, 6 months
1
0
0
0
[weiden] 16394: - imported uxtheme.dll from WINE-20050703
by weiden@svn.reactos.com
- imported uxtheme.dll from WINE-20050703 - added missing definitions in w32api - imported schemadef.h from WINE and replaced most of tmschema.h with WINE's version (which is much more correct) Modified: trunk/reactos/baseaddress.xml Modified: trunk/reactos/doc/README.WINE Modified: trunk/reactos/include/wine/winuser.h Modified: trunk/reactos/lib/directory.xml Added: trunk/reactos/lib/uxtheme/ Added: trunk/reactos/lib/uxtheme/Makefile.in Added: trunk/reactos/lib/uxtheme/draw.c Added: trunk/reactos/lib/uxtheme/main.c Added: trunk/reactos/lib/uxtheme/metric.c Added: trunk/reactos/lib/uxtheme/msstyles.c Added: trunk/reactos/lib/uxtheme/msstyles.h Added: trunk/reactos/lib/uxtheme/property.c Added: trunk/reactos/lib/uxtheme/stylemap.c Added: trunk/reactos/lib/uxtheme/system.c Added: trunk/reactos/lib/uxtheme/uxini.c Added: trunk/reactos/lib/uxtheme/uxtheme.spec Added: trunk/reactos/lib/uxtheme/uxtheme.xml Added: trunk/reactos/lib/uxtheme/uxthemedll.h Added: trunk/reactos/lib/uxtheme/version.rc Added: trunk/reactos/w32api/include/schemadef.h Modified: trunk/reactos/w32api/include/tmschema.h Modified: trunk/reactos/w32api/include/uxtheme.h Modified: trunk/reactos/w32api/include/winbase.h Modified: trunk/reactos/w32api/include/winuser.h _____ Modified: trunk/reactos/baseaddress.xml --- trunk/reactos/baseaddress.xml 2005-07-03 15:21:19 UTC (rev 16393) +++ trunk/reactos/baseaddress.xml 2005-07-03 18:32:22 UTC (rev 16394) @@ -1,6 +1,7 @@ <property name="BASEADDRESS_REGTESTS" value="0x07000000" /> <property name="BASEADDRESS_NOTIFYHOOK" value="0x08000000" /> <property name="BASEADDRESS_DEVENUM" value="0x35680000" /> +<property name="BASEADDRESS_UXTHEME" value="0x5AD70000" /> <property name="BASEADDRESS_DINPUT" value="0x5F580000" /> <property name="BASEADDRESS_TIMEDATE" value="0x64DA0000" /> <property name="BASEADDRESS_SYSDM" value="0x64DD0000" /> _____ Modified: trunk/reactos/doc/README.WINE --- trunk/reactos/doc/README.WINE 2005-07-03 15:21:19 UTC (rev 16393) +++ trunk/reactos/doc/README.WINE 2005-07-03 18:32:22 UTC (rev 16394) @@ -65,6 +65,7 @@ reactos/lib/shlwapi # Synced to Wine-20050419 reactos/lib/twain # Out of sync reactos/lib/urlmon # Synced to Wine-20050419 +reactos/lib/uxtheme # Synced to Wine-20050703 reactos/lib/version # Out of sync reactos/lib/wininet # Out of sync reactos/lib/winmm # Synced to Wine-20050419 _____ Modified: trunk/reactos/include/wine/winuser.h --- trunk/reactos/include/wine/winuser.h 2005-07-03 15:21:19 UTC (rev 16393) +++ trunk/reactos/include/wine/winuser.h 2005-07-03 18:32:22 UTC (rev 16394) @@ -21,4 +21,14 @@ #define WM_ALTTABACTIVE 0x0029 +#ifndef E_PROP_ID_UNSUPPORTED +#define E_PROP_ID_UNSUPPORTED ((HRESULT)0x80070490) +#endif +#ifndef E_PROP_SET_UNSUPPORTED +#define E_PROP_SET_UNSUPPORTED ((HRESULT)0x80070492) +#endif + +#define MAKEINTATOMA(atom) ((LPCSTR)((ULONG_PTR)((WORD)(atom)))) +#define MAKEINTATOMW(atom) ((LPCWSTR)((ULONG_PTR)((WORD)(atom)))) + #endif /* __WINE_WINUSER_H */ _____ Modified: trunk/reactos/lib/directory.xml --- trunk/reactos/lib/directory.xml 2005-07-03 15:21:19 UTC (rev 16393) +++ trunk/reactos/lib/directory.xml 2005-07-03 18:32:22 UTC (rev 16394) @@ -271,6 +271,9 @@ <directory name="uuid"> <xi:include href="uuid/uuid.xml" /> </directory> +<directory name="uxtheme"> + <xi:include href="uxtheme/uxtheme.xml" /> +</directory> <directory name="version"> <xi:include href="version/version.xml" /> </directory> Property changes on: trunk/reactos/lib/uxtheme ___________________________________________________________________ Name: svn:ignore + *.coff *.dll *.d *.a *.o *.sym *.map *.tmp *.spec.def *.stubs.c *.ico makefile _____ Added: trunk/reactos/lib/uxtheme/Makefile.in --- trunk/reactos/lib/uxtheme/Makefile.in 2005-07-03 15:21:19 UTC (rev 16393) +++ trunk/reactos/lib/uxtheme/Makefile.in 2005-07-03 18:32:22 UTC (rev 16394) @@ -0,0 +1,25 @@ +TOPSRCDIR = @top_srcdir@ +TOPOBJDIR = ../.. +SRCDIR = @srcdir@ +VPATH = @srcdir@ +MODULE = uxtheme.dll +IMPORTLIB = libuxtheme.$(IMPLIBEXT) +IMPORTS = shlwapi user32 gdi32 advapi32 kernel32 ntdll +DELAYIMPORTS = msimg32 +EXTRALIBS = $(LIBUNICODE) + +C_SRCS = \ + draw.c \ + main.c \ + metric.c \ + msstyles.c \ + property.c \ + stylemap.c \ + system.c \ + uxini.c + +RC_SRCS = version.rc + +@MAKE_DLL_RULES@ + +### Dependencies: Property changes on: trunk/reactos/lib/uxtheme/Makefile.in ___________________________________________________________________ Name: svn:eol-style + native _____ Added: trunk/reactos/lib/uxtheme/draw.c --- trunk/reactos/lib/uxtheme/draw.c 2005-07-03 15:21:19 UTC (rev 16393) +++ trunk/reactos/lib/uxtheme/draw.c 2005-07-03 18:32:22 UTC (rev 16394) @@ -0,0 +1,1037 @@ +/* + * Win32 5.1 Theme drawing + * + * Copyright (C) 2003 Kevin Koltzau + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "config.h" + +#include <stdlib.h> +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "wingdi.h" +#include "uxtheme.h" +#include "tmschema.h" + +#include "msstyles.h" +#include "uxthemedll.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(uxtheme); + +/********************************************************************** * + * Defines and global variables + */ + +DWORD dwDialogTextureFlags; + +/********************************************************************** */ + +/********************************************************************** * + * EnableThemeDialogTexture (UXTHEME.@) + */ +HRESULT WINAPI EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags) +{ + TRACE("(%p,0x%08lx\n", hwnd, dwFlags); + dwDialogTextureFlags = dwFlags; + return S_OK; + } + +/********************************************************************** * + * IsThemeDialogTextureEnabled (UXTHEME.@) + */ +BOOL WINAPI IsThemeDialogTextureEnabled(HWND hwnd) +{ + TRACE("(%p)\n", hwnd); + return (dwDialogTextureFlags & ETDT_ENABLE) && !(dwDialogTextureFlags & ETDT_DISABLE); +} + +/********************************************************************** * + * DrawThemeParentBackground (UXTHEME.@) + */ +HRESULT WINAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc) +{ + RECT rt; + POINT org; + HWND hParent; + HRGN clip = NULL; + int hasClip = -1; + + TRACE("(%p,%p,%p)\n", hwnd, hdc, prc); + hParent = GetParent(hwnd); + if(!hParent) + hParent = hwnd; + if(prc) { + CopyRect(&rt, prc); + MapWindowPoints(hwnd, NULL, (LPPOINT)&rt, 2); + + clip = CreateRectRgn(0,0,1,1); + hasClip = GetClipRgn(hdc, clip); + if(hasClip == -1) + TRACE("Failed to get original clipping region\n"); + else + IntersectClipRect(hdc, prc->left, prc->top, prc->right, prc->bottom); + } + else { + GetClientRect(hParent, &rt); + MapWindowPoints(hParent, NULL, (LPPOINT)&rt, 2); + } + + SetViewportOrgEx(hdc, rt.left, rt.top, &org); + + SendMessageW(hParent, WM_ERASEBKGND, (WPARAM)hdc, 0); + SendMessageW(hParent, WM_PRINTCLIENT, (WPARAM)hdc, PRF_CLIENT); + + SetViewportOrgEx(hdc, org.x, org.y, NULL); + if(prc) { + if(hasClip == 0) + SelectClipRgn(hdc, NULL); + else if(hasClip == 1) + SelectClipRgn(hdc, clip); + DeleteObject(clip); + } + return S_OK; +} + + +/********************************************************************** * + * DrawThemeBackground (UXTHEME.@) + */ +HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, const RECT *pRect, + const RECT *pClipRect) +{ + DTBGOPTS opts; + opts.dwSize = sizeof(DTBGOPTS); + opts.dwFlags = 0; + if(pClipRect) { + opts.dwFlags |= DTBG_CLIPRECT; + CopyRect(&opts.rcClip, pClipRect); + } + return DrawThemeBackgroundEx(hTheme, hdc, iPartId, iStateId, pRect, &opts); +} + +/********************************************************************** * + * UXTHEME_SelectImage + * + * Select the image to use + */ +static PTHEME_PROPERTY UXTHEME_SelectImage(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, BOOL glyph) +{ + PTHEME_PROPERTY tp; + int imageselecttype = IST_NONE; + int i; + int image; + if(glyph) + image = TMT_GLYPHIMAGEFILE; + else + image = TMT_IMAGEFILE; + + if((tp=MSSTYLES_FindProperty(hTheme, iPartId, iStateId, TMT_FILENAME, image))) + return tp; + GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_IMAGESELECTTYPE, &imageselecttype); + + if(imageselecttype == IST_DPI) { + int reqdpi = 0; + int screendpi = GetDeviceCaps(hdc, LOGPIXELSX); + for(i=4; i>=0; i--) { + reqdpi = 0; + if(SUCCEEDED(GetThemeInt(hTheme, iPartId, iStateId, i + TMT_MINDPI1, &reqdpi))) { + if(reqdpi != 0 && screendpi >= reqdpi) { + TRACE("Using %d DPI, image %d\n", reqdpi, i + TMT_IMAGEFILE1); + return MSSTYLES_FindProperty(hTheme, iPartId, iStateId, TMT_FILENAME, i + TMT_IMAGEFILE1); + } + } + } + /* If an image couldnt be selected, choose the first one */ + return MSSTYLES_FindProperty(hTheme, iPartId, iStateId, TMT_FILENAME, TMT_IMAGEFILE1); + } + else if(imageselecttype == IST_SIZE) { + POINT size = {pRect->right-pRect->left, pRect->bottom-pRect->top}; + POINT reqsize; + for(i=4; i>=0; i--) { + if(SUCCEEDED(GetThemePosition(hTheme, iPartId, iStateId, i + TMT_MINSIZE1, &reqsize))) { + if(reqsize.x >= size.x && reqsize.y >= size.y) { + TRACE("Using image size %ldx%ld, image %d\n", reqsize.x, reqsize.y, i + TMT_IMAGEFILE1); + return MSSTYLES_FindProperty(hTheme, iPartId, iStateId, TMT_FILENAME, i + TMT_IMAGEFILE1); + } + } + } + /* If an image couldnt be selected, choose the smallest one */ + return MSSTYLES_FindProperty(hTheme, iPartId, iStateId, TMT_FILENAME, TMT_IMAGEFILE1); + } + return NULL; +} + +/********************************************************************** * + * UXTHEME_LoadImage + * + * Load image for part/state + */ +static HRESULT UXTHEME_LoadImage(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, BOOL glyph, + HBITMAP *hBmp, RECT *bmpRect) +{ + int imagelayout = IL_VERTICAL; + int imagecount = 0; + BITMAP bmp; + WCHAR szPath[MAX_PATH]; + PTHEME_PROPERTY tp = UXTHEME_SelectImage(hTheme, hdc, iPartId, iStateId, pRect, glyph); + if(!tp) { + FIXME("Couldn't determine image for part/state %d/%d, invalid theme?\n", iPartId, iStateId); + return E_PROP_ID_UNSUPPORTED; + } + lstrcpynW(szPath, tp->lpValue, min(tp->dwValueLen+1, sizeof(szPath)/sizeof(szPath[0]))); + *hBmp = MSSTYLES_LoadBitmap(hdc, hTheme, szPath); + if(!*hBmp) { + TRACE("Failed to load bitmap %s\n", debugstr_w(szPath)); + return HRESULT_FROM_WIN32(GetLastError()); + } + + GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_IMAGELAYOUT, &imagelayout); + GetThemeInt(hTheme, iPartId, iStateId, TMT_IMAGECOUNT, &imagecount); + + GetObjectW(*hBmp, sizeof(bmp), &bmp); + if(imagelayout == IL_VERTICAL) { + int height = bmp.bmHeight/imagecount; + bmpRect->left = 0; + bmpRect->right = bmp.bmWidth; + bmpRect->top = (min(imagecount, iStateId)-1) * height; + bmpRect->bottom = bmpRect->top + height; + } + else { + int width = bmp.bmWidth/imagecount; + bmpRect->left = (min(imagecount, iStateId)-1) * width; + bmpRect->right = bmpRect->left + width; + bmpRect->top = 0; + bmpRect->bottom = bmp.bmHeight; + } + return S_OK; +} + +/********************************************************************** * + * UXTHEME_StretchBlt + * + * Psudo TransparentBlt/StretchBlt + */ +static inline BOOL UXTHEME_StretchBlt(HDC hdcDst, int nXOriginDst, int nYOriginDst, int nWidthDst, int nHeightDst, + HDC hdcSrc, int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc, + BOOL transparent, COLORREF transcolor) +{ + if(transparent) { + /* Ensure we don't pass any negative values to TransparentBlt */ + return TransparentBlt(hdcDst, nXOriginDst, nYOriginDst, abs(nWidthDst), abs(nHeightDst), + hdcSrc, nXOriginSrc, nYOriginSrc, abs(nWidthSrc), abs(nHeightSrc), + transcolor); + } + /* This should be using AlphaBlend */ + return StretchBlt(hdcDst, nXOriginDst, nYOriginDst, nWidthDst, nHeightDst, + hdcSrc, nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc, + SRCCOPY); +} + +/********************************************************************** * + * UXTHEME_Blt + * + * Simplify sending same width/height for both source and dest + */ +static inline BOOL UXTHEME_Blt(HDC hdcDest, int nXOriginDest, int nYOriginDest, int nWidthDest, int nHeightDest, + HDC hdcSrc, int nXOriginSrc, int nYOriginSrc, + BOOL transparent, COLORREF transcolor) +{ + return UXTHEME_StretchBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest, + hdcSrc, nXOriginSrc, nYOriginSrc, nWidthDest, nHeightDest, + transparent, transcolor); +} + + +/********************************************************************** * + * UXTHEME_DrawImageGlyph + * + * Draw an imagefile glyph + */ +static HRESULT UXTHEME_DrawImageGlyph(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, RECT *pRect, + const DTBGOPTS *pOptions) +{ + HRESULT hr; + HBITMAP bmpSrc = NULL; + HDC hdcSrc = NULL; + HGDIOBJ oldSrc = NULL; + RECT rcSrc; + BOOL transparent = FALSE; + COLORREF transparentcolor = 0; + int valign = VA_CENTER; + int halign = HA_CENTER; + POINT dstSize; + POINT srcSize; + POINT topleft; + + hr = UXTHEME_LoadImage(hTheme, hdc, iPartId, iStateId, pRect, TRUE, &bmpSrc, &rcSrc); + if(FAILED(hr)) return hr; + hdcSrc = CreateCompatibleDC(hdc); + if(!hdcSrc) { + hr = HRESULT_FROM_WIN32(GetLastError()); + DeleteObject(bmpSrc); + return hr; + } + oldSrc = SelectObject(hdcSrc, bmpSrc); + + dstSize.x = pRect->right-pRect->left; + dstSize.y = pRect->bottom-pRect->top; + srcSize.x = rcSrc.right-rcSrc.left; + srcSize.y = rcSrc.bottom-rcSrc.top; + + GetThemeBool(hTheme, iPartId, iStateId, TMT_GLYPHTRANSPARENT, &transparent); + if(transparent) { + if(FAILED(GetThemeColor(hTheme, iPartId, iStateId, TMT_GLYPHTRANSPARENTCOLOR, &transparentcolor))) { + /* If image is transparent, but no color was specified, get the color of the upper left corner */ + transparentcolor = GetPixel(hdcSrc, 0, 0); + } + } + GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_VALIGN, &valign); + GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_HALIGN, &halign); + + topleft.x = pRect->left; + topleft.y = pRect->top; + if(halign == HA_CENTER) topleft.x += (dstSize.x/2)-(srcSize.x/2); + else if(halign == HA_RIGHT) topleft.x += dstSize.x-srcSize.x; + if(valign == VA_CENTER) topleft.y += (dstSize.y/2)-(srcSize.y/2); + else if(valign == VA_BOTTOM) topleft.y += dstSize.y-srcSize.y; + + if(!UXTHEME_Blt(hdc, topleft.x, topleft.y, srcSize.x, srcSize.y, + hdcSrc, rcSrc.left, rcSrc.top, + transparent, transparentcolor)) { + hr = HRESULT_FROM_WIN32(GetLastError()); + } + + SelectObject(hdcSrc, oldSrc); + DeleteDC(hdcSrc); + DeleteObject(bmpSrc); + return hr; +} + +/********************************************************************** * + * UXTHEME_DrawImageGlyph + * + * Draw glyph on top of background, if appropriate + */ +static HRESULT UXTHEME_DrawGlyph(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, RECT *pRect, + const DTBGOPTS *pOptions) +{ + int glyphtype = GT_NONE; + + GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_GLYPHTYPE, &glyphtype); + + if(glyphtype == GT_IMAGEGLYPH) { + return UXTHEME_DrawImageGlyph(hTheme, hdc, iPartId, iStateId, pRect, pOptions); + } + else if(glyphtype == GT_FONTGLYPH) { + /* I don't know what a font glyph is, I've never seen it used in any themes */ + FIXME("Font glyph\n"); + } + return S_OK; +} + +/********************************************************************** * + * UXTHEME_DrawImageBackground + * + * Draw an imagefile background + */ +static HRESULT UXTHEME_DrawImageBackground(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, RECT *pRect, + const DTBGOPTS *pOptions) +{ + HRESULT hr = S_OK; + HBITMAP bmpSrc; + HGDIOBJ oldSrc; + HDC hdcSrc; + RECT rcSrc; + RECT rcDst; + POINT dstSize; + POINT srcSize; + int sizingtype = ST_TRUESIZE; + BOOL uniformsizing = FALSE; + BOOL transparent = FALSE; + COLORREF transparentcolor = 0; + + hr = UXTHEME_LoadImage(hTheme, hdc, iPartId, iStateId, pRect, FALSE, &bmpSrc, &rcSrc); + if(FAILED(hr)) return hr; + hdcSrc = CreateCompatibleDC(hdc); + if(!hdcSrc) { + hr = HRESULT_FROM_WIN32(GetLastError()); + DeleteObject(bmpSrc); + return hr; + } + oldSrc = SelectObject(hdcSrc, bmpSrc); + + CopyRect(&rcDst, pRect); + + GetThemeBool(hTheme, iPartId, iStateId, TMT_TRANSPARENT, &transparent); + if(transparent) { + if(FAILED(GetThemeColor(hTheme, iPartId, iStateId, TMT_TRANSPARENTCOLOR, &transparentcolor))) { + /* If image is transparent, but no color was specified, get the color of the upper left corner */ + transparentcolor = GetPixel(hdcSrc, 0, 0); + } + } + + dstSize.x = rcDst.right-rcDst.left; + dstSize.y = rcDst.bottom-rcDst.top; + srcSize.x = rcSrc.right-rcSrc.left; + srcSize.y = rcSrc.bottom-rcSrc.top; + + GetThemeBool(hTheme, iPartId, iStateId, TMT_UNIFORMSIZING, &uniformsizing); + if(uniformsizing) { + /* Scale height and width equally */ + int widthDiff = abs(srcSize.x-dstSize.x); + int heightDiff = abs(srcSize.y-dstSize.x); + if(widthDiff > heightDiff) { + dstSize.y -= widthDiff-heightDiff; + rcDst.bottom = rcDst.top + dstSize.y; + } + else if(heightDiff > widthDiff) { + dstSize.x -= heightDiff-widthDiff; + rcDst.right = rcDst.left + dstSize.x; + } + } + + GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_SIZINGTYPE, &sizingtype); + if(sizingtype == ST_TRUESIZE) { + int truesizestretchmark = 0; + + if(dstSize.x < 0 || dstSize.y < 0) { + BOOL mirrorimage = TRUE; + GetThemeBool(hTheme, iPartId, iStateId, TMT_MIRRORIMAGE, &mirrorimage); + if(mirrorimage) { + if(dstSize.x < 0) { + rcDst.left += dstSize.x; + rcDst.right += dstSize.x; + } + if(dstSize.y < 0) { + rcDst.top += dstSize.y; + rcDst.bottom += dstSize.y; + } + } + } + /* Only stretch when target exceeds source by truesizestretchmark percent */ + GetThemeInt(hTheme, iPartId, iStateId, TMT_TRUESIZESTRETCHMARK, &truesizestretchmark); + if(dstSize.x < 0 || dstSize.y < 0 || + MulDiv(srcSize.x, 100, dstSize.x) > truesizestretchmark || + MulDiv(srcSize.y, 100, dstSize.y) > truesizestretchmark) { + if(!UXTHEME_StretchBlt(hdc, rcDst.left, rcDst.top, dstSize.x, dstSize.y, + hdcSrc, rcSrc.left, rcSrc.top, srcSize.x, srcSize.y, + transparent, transparentcolor)) + hr = HRESULT_FROM_WIN32(GetLastError()); + } + else { + rcDst.left += (dstSize.x/2)-(srcSize.x/2); + rcDst.top += (dstSize.y/2)-(srcSize.y/2); + rcDst.right = rcDst.left + srcSize.x; + rcDst.bottom = rcDst.top + srcSize.y; + if(!UXTHEME_Blt(hdc, rcDst.left, rcDst.top, srcSize.x, srcSize.y, + hdcSrc, rcSrc.left, rcSrc.top, + transparent, transparentcolor)) + hr = HRESULT_FROM_WIN32(GetLastError()); + } + } + else { + HDC hdcDst = NULL; + HBITMAP bmpDst = NULL; + HGDIOBJ oldDst = NULL; + MARGINS sm; + + dstSize.x = abs(dstSize.x); + dstSize.y = abs(dstSize.y); + + GetThemeMargins(hTheme, hdc, iPartId, iStateId, TMT_SIZINGMARGINS, NULL, &sm); + + hdcDst = CreateCompatibleDC(hdc); + if(!hdcDst) { + hr = HRESULT_FROM_WIN32(GetLastError()); + goto draw_error; + } + bmpDst = CreateCompatibleBitmap(hdc, dstSize.x, dstSize.y); + if(!bmpDst) { + hr = HRESULT_FROM_WIN32(GetLastError()); + goto draw_error; + } + oldDst = SelectObject(hdcDst, bmpDst); + + /* Upper left corner */ + if(!BitBlt(hdcDst, 0, 0, sm.cxLeftWidth, sm.cyTopHeight, + hdcSrc, rcSrc.left, rcSrc.top, SRCCOPY)) { + hr = HRESULT_FROM_WIN32(GetLastError()); + goto draw_error; + } + /* Upper right corner */ + if(!BitBlt(hdcDst, dstSize.x-sm.cxRightWidth, 0, sm.cxRightWidth, sm.cyTopHeight, + hdcSrc, rcSrc.right-sm.cxRightWidth, rcSrc.top, SRCCOPY)) { + hr = HRESULT_FROM_WIN32(GetLastError()); + goto draw_error; + } + /* Lower left corner */ + if(!BitBlt(hdcDst, 0, dstSize.y-sm.cyBottomHeight, sm.cxLeftWidth, sm.cyBottomHeight, + hdcSrc, rcSrc.left, rcSrc.bottom-sm.cyBottomHeight, SRCCOPY)) { + hr = HRESULT_FROM_WIN32(GetLastError()); + goto draw_error; + } + /* Lower right corner */ + if(!BitBlt(hdcDst, dstSize.x-sm.cxRightWidth, dstSize.y-sm.cyBottomHeight, sm.cxRightWidth, sm.cyBottomHeight, + hdcSrc, rcSrc.right-sm.cxRightWidth, rcSrc.bottom-sm.cyBottomHeight, SRCCOPY)) { + hr = HRESULT_FROM_WIN32(GetLastError()); + goto draw_error; + } + + if(sizingtype == ST_TILE) { + FIXME("Tile\n"); + sizingtype = ST_STRETCH; /* Just use stretch for now */ + } + if(sizingtype == ST_STRETCH) { + int destCenterWidth = dstSize.x - (sm.cxLeftWidth + sm.cxRightWidth); + int srcCenterWidth = srcSize.x - (sm.cxLeftWidth + sm.cxRightWidth); + int destCenterHeight = dstSize.y - (sm.cyTopHeight + sm.cyBottomHeight); + int srcCenterHeight = srcSize.y - (sm.cyTopHeight + sm.cyBottomHeight); + + if(destCenterWidth > 0) { + /* Center top */ + if(!StretchBlt(hdcDst, sm.cxLeftWidth, 0, destCenterWidth, sm.cyTopHeight, + hdcSrc, rcSrc.left+sm.cxLeftWidth, rcSrc.top, srcCenterWidth, sm.cyTopHeight, SRCCOPY)) { + hr = HRESULT_FROM_WIN32(GetLastError()); + goto draw_error; + } + /* Center bottom */ + if(!StretchBlt(hdcDst, sm.cxLeftWidth, dstSize.y-sm.cyBottomHeight, destCenterWidth, sm.cyBottomHeight, + hdcSrc, rcSrc.left+sm.cxLeftWidth, rcSrc.bottom-sm.cyBottomHeight, srcCenterWidth, sm.cyTopHeight, SRCCOPY)) { + hr = HRESULT_FROM_WIN32(GetLastError()); + goto draw_error; + } + } + if(destCenterHeight > 0) { + /* Left center */ + if(!StretchBlt(hdcDst, 0, sm.cyTopHeight, sm.cxLeftWidth, destCenterHeight, + hdcSrc, rcSrc.left, rcSrc.top+sm.cyTopHeight, sm.cxLeftWidth, srcCenterHeight, SRCCOPY)) { + hr = HRESULT_FROM_WIN32(GetLastError()); + goto draw_error; + } + /* Right center */ + if(!StretchBlt(hdcDst, dstSize.x-sm.cxRightWidth, sm.cyTopHeight, sm.cxRightWidth, destCenterHeight, + hdcSrc, rcSrc.right-sm.cxRightWidth, rcSrc.top+sm.cyTopHeight, sm.cxRightWidth, srcCenterHeight, SRCCOPY)) { + hr = HRESULT_FROM_WIN32(GetLastError()); + goto draw_error; + } + } + if(destCenterHeight > 0 && destCenterWidth > 0) { + BOOL borderonly = FALSE; + GetThemeBool(hTheme, iPartId, iStateId, TMT_BORDERONLY, &borderonly); + if(!borderonly) { + /* Center */ + if(!StretchBlt(hdcDst, sm.cxLeftWidth, sm.cyTopHeight, destCenterWidth, destCenterHeight, + hdcSrc, rcSrc.left+sm.cxLeftWidth, rcSrc.top+sm.cyTopHeight, srcCenterWidth, srcCenterHeight, SRCCOPY)) { + hr = HRESULT_FROM_WIN32(GetLastError()); + goto draw_error; + } + } + } + } + + if(!UXTHEME_Blt(hdc, rcDst.left, rcDst.top, dstSize.x, dstSize.y, + hdcDst, 0, 0, + transparent, transparentcolor)) + hr = HRESULT_FROM_WIN32(GetLastError()); + +draw_error: + if(hdcDst) { + SelectObject(hdcDst, oldDst); + DeleteDC(hdcDst); + } + if(bmpDst) DeleteObject(bmpDst); + } + SelectObject(hdcSrc, oldSrc); + DeleteObject(bmpSrc); + DeleteDC(hdcSrc); + CopyRect(pRect, &rcDst); + return hr; +} + +/********************************************************************** * + * UXTHEME_DrawBorderRectangle + * + * Draw the bounding rectangle for a borderfill background + */ +static HRESULT UXTHEME_DrawBorderRectangle(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, RECT *pRect, + const DTBGOPTS *pOptions) +{ + HRESULT hr = S_OK; + HPEN hPen; + HGDIOBJ oldPen; + COLORREF bordercolor = RGB(0,0,0); + int bordersize = 1; + + GetThemeInt(hTheme, iPartId, iStateId, TMT_BORDERSIZE, &bordersize); + if(bordersize > 0) { + POINT ptCorners[4]; + ptCorners[0].x = pRect->left; + ptCorners[0].y = pRect->top; + ptCorners[1].x = pRect->right; + ptCorners[1].y = pRect->top; + ptCorners[2].x = pRect->right; + ptCorners[2].y = pRect->bottom; + ptCorners[3].x = pRect->left; + ptCorners[3].y = pRect->bottom; + + InflateRect(pRect, -bordersize, -bordersize); + if(pOptions->dwFlags & DTBG_OMITBORDER) + return S_OK; + GetThemeColor(hTheme, iPartId, iStateId, TMT_BORDERCOLOR, &bordercolor); + hPen = CreatePen(PS_SOLID, bordersize, bordercolor); + if(!hPen) + return HRESULT_FROM_WIN32(GetLastError()); + oldPen = SelectObject(hdc, hPen); + + if(!Polyline(hdc, ptCorners, 4)) + hr = HRESULT_FROM_WIN32(GetLastError()); + + SelectObject(hdc, oldPen); + DeleteObject(hPen); + } + return hr; +} + +/********************************************************************** * + * UXTHEME_DrawBackgroundFill + * + * Fill a borderfill background rectangle + */ +static HRESULT UXTHEME_DrawBackgroundFill(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, RECT *pRect, + const DTBGOPTS *pOptions) +{ + HRESULT hr = S_OK; + int filltype = FT_SOLID; + + TRACE("(%d,%d,%ld)\n", iPartId, iStateId, pOptions->dwFlags); + + if(pOptions->dwFlags & DTBG_OMITCONTENT) + return S_OK; + + GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_FILLTYPE, &filltype); + + if(filltype == FT_SOLID) { + HBRUSH hBrush; + COLORREF fillcolor = RGB(255,255,255); + + GetThemeColor(hTheme, iPartId, iStateId, TMT_FILLCOLOR, &fillcolor); + hBrush = CreateSolidBrush(fillcolor); + if(!FillRect(hdc, pRect, hBrush)) + hr = HRESULT_FROM_WIN32(GetLastError()); + DeleteObject(hBrush); + } + else if(filltype == FT_VERTGRADIENT || filltype == FT_HORZGRADIENT) { + /* FIXME: This only accounts for 2 gradient colors (out of 5) and ignores + the gradient ratios (no idea how those work) + Few themes use this, and the ones I've seen only use 2 colors with + a gradient ratio of 0 and 255 respectivly + */ + + COLORREF gradient1 = RGB(0,0,0); + COLORREF gradient2 = RGB(255,255,255); + TRIVERTEX vert[2]; + GRADIENT_RECT gRect; + + FIXME("Gradient implementation not complete\n"); + + GetThemeColor(hTheme, iPartId, iStateId, TMT_GRADIENTCOLOR1, &gradient1); + GetThemeColor(hTheme, iPartId, iStateId, TMT_GRADIENTCOLOR2, &gradient2); + + vert[0].x = pRect->left; + vert[0].y = pRect->top; + vert[0].Red = GetRValue(gradient1) << 8; + vert[0].Green = GetGValue(gradient1) << 8; + vert[0].Blue = GetBValue(gradient1) << 8; + vert[0].Alpha = 0x0000; + + vert[1].x = pRect->right; + vert[1].y = pRect->bottom; + vert[1].Red = GetRValue(gradient2) << 8; + vert[1].Green = GetGValue(gradient2) << 8; + vert[1].Blue = GetBValue(gradient2) << 8; + vert[1].Alpha = 0x0000; + + gRect.UpperLeft = 0; + gRect.LowerRight = 1; + GradientFill(hdc,vert,2,&gRect,1,filltype==FT_HORZGRADIENT?GRADIENT_FILL _RECT_H:GRADIENT_FILL_RECT_V); + } + else if(filltype == FT_RADIALGRADIENT) { + /* I've never seen this used in a theme */ + FIXME("Radial gradient\n"); + } + else if(filltype == FT_TILEIMAGE) { + /* I've never seen this used in a theme */ + FIXME("Tile image\n"); + } + return hr; +} + +/********************************************************************** * + * UXTHEME_DrawBorderBackground + * + * Draw an imagefile background + */ +static HRESULT UXTHEME_DrawBorderBackground(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, const RECT *pRect, + const DTBGOPTS *pOptions) +{ + HRESULT hr; + RECT rt; + + CopyRect(&rt, pRect); + + hr = UXTHEME_DrawBorderRectangle(hTheme, hdc, iPartId, iStateId, &rt, pOptions); + if(FAILED(hr)) + return hr; + return UXTHEME_DrawBackgroundFill(hTheme, hdc, iPartId, iStateId, &rt, pOptions); +} + +/********************************************************************** * + * DrawThemeBackgroundEx (UXTHEME.@) + */ +HRESULT WINAPI DrawThemeBackgroundEx(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, const RECT *pRect, + const DTBGOPTS *pOptions) +{ + HRESULT hr; + const DTBGOPTS defaultOpts = {sizeof(DTBGOPTS), 0, {0,0,0,0}}; + const DTBGOPTS *opts; + HRGN clip = NULL; + int hasClip = -1; + int bgtype = BT_BORDERFILL; + RECT rt; + + TRACE("(%p,%p,%d,%d,%ld,%ld)\n", hTheme, hdc, iPartId, iStateId,pRect->left,pRect->top); + if(!hTheme) + return E_HANDLE; + + /* Ensure we have a DTBGOPTS structure available, simplifies some of the code */ + opts = pOptions; + if(!opts) opts = &defaultOpts; + + if(opts->dwFlags & DTBG_CLIPRECT) { + clip = CreateRectRgn(0,0,1,1); + hasClip = GetClipRgn(hdc, clip); + if(hasClip == -1) + TRACE("Failed to get original clipping region\n"); + else + IntersectClipRect(hdc, opts->rcClip.left, opts->rcClip.top, opts->rcClip.right, opts->rcClip.bottom); + } + CopyRect(&rt, pRect); + + GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_BGTYPE, &bgtype); + if(bgtype == BT_IMAGEFILE) + hr = UXTHEME_DrawImageBackground(hTheme, hdc, iPartId, iStateId, &rt, opts); + else if(bgtype == BT_BORDERFILL) + hr = UXTHEME_DrawBorderBackground(hTheme, hdc, iPartId, iStateId, pRect, opts); + else { + FIXME("Unknown background type\n"); + /* This should never happen, and hence I don't know what to return */ + hr = E_FAIL; + } + if(SUCCEEDED(hr)) + hr = UXTHEME_DrawGlyph(hTheme, hdc, iPartId, iStateId, &rt, opts); + if(opts->dwFlags & DTBG_CLIPRECT) { + if(hasClip == 0) + SelectClipRgn(hdc, NULL); + else if(hasClip == 1) + SelectClipRgn(hdc, clip); + DeleteObject(clip); + } + return hr; +} + +/********************************************************************** * + * DrawThemeEdge (UXTHEME.@) + */ +HRESULT WINAPI DrawThemeEdge(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, const RECT *pDestRect, UINT uEdge, + UINT uFlags, RECT *pContentRect) +{ + FIXME("%d %d 0x%08x 0x%08x: stub\n", iPartId, iStateId, uEdge, uFlags); + if(!hTheme) + return E_HANDLE; + return ERROR_CALL_NOT_IMPLEMENTED; +} + +/********************************************************************** * + * DrawThemeIcon (UXTHEME.@) + */ +HRESULT WINAPI DrawThemeIcon(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, + const RECT *pRect, HIMAGELIST himl, int iImageIndex) +{ + FIXME("%d %d: stub\n", iPartId, iStateId); + if(!hTheme) + return E_HANDLE; + return ERROR_CALL_NOT_IMPLEMENTED; +} + +/********************************************************************** * + * DrawThemeText (UXTHEME.@) + */ +HRESULT WINAPI DrawThemeText(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, + LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, + DWORD dwTextFlags2, const RECT *pRect) +{ + HRESULT hr; + HFONT hFont = NULL; + HGDIOBJ oldFont = NULL; + LOGFONTW logfont; + COLORREF textColor; + COLORREF oldTextColor; + int oldBkMode; + RECT rt; + + TRACE("%d %d: stub\n", iPartId, iStateId); + if(!hTheme) + return E_HANDLE; + + hr = GetThemeFont(hTheme, hdc, iPartId, iStateId, TMT_FONT, &logfont); + if(SUCCEEDED(hr)) { + hFont = CreateFontIndirectW(&logfont); + if(!hFont) + TRACE("Failed to create font\n"); + } + CopyRect(&rt, pRect); + if(hFont) + oldFont = SelectObject(hdc, hFont); + + if(dwTextFlags2 & DTT_GRAYED) + textColor = GetSysColor(COLOR_GRAYTEXT); + else { + if(FAILED(GetThemeColor(hTheme, iPartId, iStateId, TMT_TEXTCOLOR, &textColor))) + textColor = GetTextColor(hdc); + } + oldTextColor = SetTextColor(hdc, textColor); + oldBkMode = SetBkMode(hdc, TRANSPARENT); + DrawTextW(hdc, pszText, iCharCount, &rt, dwTextFlags); + SetBkMode(hdc, oldBkMode); + SetTextColor(hdc, oldTextColor); + + if(hFont) { + SelectObject(hdc, oldFont); + DeleteObject(hFont); + } + return S_OK; +} + +/********************************************************************** * + * GetThemeBackgroundContentRect (UXTHEME.@) + */ +HRESULT WINAPI GetThemeBackgroundContentRect(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, + const RECT *pBoundingRect, + RECT *pContentRect) +{ + MARGINS margin; + HRESULT hr; + + TRACE("(%d,%d)\n", iPartId, iStateId); + if(!hTheme) + return E_HANDLE; + + hr = GetThemeMargins(hTheme, hdc, iPartId, iStateId, TMT_CONTENTMARGINS, NULL, &margin); + if(FAILED(hr)) { + TRACE("Margins not found\n"); + return hr; + } + pContentRect->left = pBoundingRect->left + margin.cxLeftWidth; + pContentRect->top = pBoundingRect->top + margin.cyTopHeight; + pContentRect->right = pBoundingRect->right - margin.cxRightWidth; + pContentRect->bottom = pBoundingRect->bottom - margin.cyBottomHeight; + + TRACE("left:%ld,top:%ld,right:%ld,bottom:%ld\n", pContentRect->left, pContentRect->top, pContentRect->right, pContentRect->bottom); + + return S_OK; +} + +/********************************************************************** * + * GetThemeBackgroundExtent (UXTHEME.@) + */ +HRESULT WINAPI GetThemeBackgroundExtent(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, const RECT *pContentRect, + RECT *pExtentRect) +{ + MARGINS margin; + HRESULT hr; + + TRACE("(%d,%d)\n", iPartId, iStateId); + if(!hTheme) + return E_HANDLE; + + hr = GetThemeMargins(hTheme, hdc, iPartId, iStateId, TMT_CONTENTMARGINS, NULL, &margin); + if(FAILED(hr)) { + TRACE("Margins not found\n"); [truncated at 1000 lines; 6646 more skipped]
19 years, 6 months
1
0
0
0
[ekohl] 16393: - Move definitions from ntpnp.h into NDK and DDK
by ekohl@svn.reactos.com
- Move definitions from ntpnp.h into NDK and DDK - Remove ntpnp.h Deleted: trunk/reactos/include/ddk/ntpnp.h Modified: trunk/reactos/include/ndk/zwfuncs.h Modified: trunk/reactos/include/ndk/zwtypes.h Modified: trunk/reactos/lib/wdmguid/wdmguid.c Modified: trunk/reactos/ntoskrnl/include/ntoskrnl.h Modified: trunk/reactos/ntoskrnl/io/plugplay.c Modified: trunk/reactos/services/umpnpmgr/umpnpmgr.c Modified: trunk/reactos/w32api/include/ddk/wdmguid.h _____ Deleted: trunk/reactos/include/ddk/ntpnp.h --- trunk/reactos/include/ddk/ntpnp.h 2005-07-03 13:49:05 UTC (rev 16392) +++ trunk/reactos/include/ddk/ntpnp.h 2005-07-03 15:21:19 UTC (rev 16393) @@ -1,277 +0,0 @@ -/* - * ntpnp.h - * - * Plug-and-play interface routines - * - * Contributors: - * Created by Filip Navara <xnavara(a)volny.cz> - * - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * This code is distributed in the hope that it will be useful but - * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY - * DISCLAIMED. This includes but is not limited to warranties of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - */ - -#ifndef __NTPNP_H -#define __NTPNP_H - -#include <ddk/cfg.h> - -/* - * TODO: - * - Describe the undocumented GUIDs. - * - Finish the description of NtPlugPlayControl. - */ - -/* - * Undocumented GUIDs used by NtGetPlugPlayEvent. - */ - -DEFINE_GUID(GUID_DEVICE_STANDBY_VETOED, 0x03B21C13, 0x18D6, 0x11D3, 0x97, 0xDB, 0x00, 0xA0, 0xC9, 0x40, 0x52, 0x2E); -DEFINE_GUID(GUID_DEVICE_KERNEL_INITIATED_EJECT, 0x14689B54, 0x0703, 0x11D3, 0x97, 0xD2, 0x00, 0xA0, 0xC9, 0x40, 0x52, 0x2E); -DEFINE_GUID(GUID_DEVICE_THERMAL_ZONE, 0x4AFA3D51, 0x74A7, 0x11D0, 0xBE, 0x5E, 0x00, 0xA0, 0xC9, 0x06, 0x28, 0x57); -DEFINE_GUID(GUID_DEVICE_SYS_BUTTON, 0x4AFA3D53, 0x74A7, 0x11D0, 0xBE, 0x5E, 0x00, 0xA0, 0xC9, 0x06, 0x28, 0x57); -DEFINE_GUID(GUID_DEVICE_REMOVAL_VETOED, 0x60DBD5FA, 0xDDD2, 0x11D2, 0x97, 0xB8, 0x00, 0xA0, 0xC9, 0x40, 0x52, 0x2E); -DEFINE_GUID(GUID_DEVICE_HIBERNATE_VETOED, 0x61173AD9, 0x194F, 0x11D3, 0x97, 0xDC, 0x00, 0xA0, 0xC9, 0x40, 0x52, 0x2E); -DEFINE_GUID(GUID_DEVICE_BATTERY, 0x72631E54, 0x78A4, 0x11D0, 0xBC, 0xF7, 0x00, 0xAA, 0x00, 0xB7, 0xB3, 0x2A); -DEFINE_GUID(GUID_DEVICE_SAFE_REMOVAL, 0x8FBEF967, 0xD6C5, 0x11D2, 0x97, 0xB5, 0x00, 0xA0, 0xC9, 0x40, 0x52, 0x2E); -#ifndef __USE_W32API -DEFINE_GUID(GUID_DEVICE_INTERFACE_ARRIVAL, 0xCB3A4004, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); -DEFINE_GUID(GUID_DEVICE_INTERFACE_REMOVAL, 0xCB3A4005, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); -#endif -DEFINE_GUID(GUID_DEVICE_ARRIVAL, 0xCB3A4009, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); -DEFINE_GUID(GUID_DEVICE_ENUMERATED, 0xCB3A400A, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); -DEFINE_GUID(GUID_DEVICE_ENUMERATE_REQUEST, 0xCB3A400B, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); -DEFINE_GUID(GUID_DEVICE_START_REQUEST, 0xCB3A400C, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); -DEFINE_GUID(GUID_DEVICE_REMOVE_PENDING, 0xCB3A400D, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); -DEFINE_GUID(GUID_DEVICE_QUERY_AND_REMOVE, 0xCB3A400E, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); -DEFINE_GUID(GUID_DEVICE_EJECT, 0xCB3A400F, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); -DEFINE_GUID(GUID_DEVICE_NOOP, 0xCB3A4010, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); -DEFINE_GUID(GUID_DEVICE_WARM_EJECT_VETOED, 0xCBF4C1F9, 0x18D5, 0x11D3, 0x97, 0xDB, 0x00, 0xA0, 0xC9, 0x40, 0x52, 0x2E); -DEFINE_GUID(GUID_DEVICE_SURPRISE_REMOVAL, 0xCE5AF000, 0x80DD, 0x11D2, 0xA8, 0x8D, 0x00, 0xA0, 0xC9, 0x69, 0x6B, 0x4B); -DEFINE_GUID(GUID_DEVICE_EJECT_VETOED, 0xCF7B71E8, 0xD8FD, 0x11D2, 0x97, 0xB5, 0x00, 0xA0, 0xC9, 0x40, 0x52, 0x2E); -DEFINE_GUID(GUID_DEVICE_EVENT_RBC, 0xD0744792, 0xA98E, 0x11D2, 0x91, 0x7A, 0x00, 0xA0, 0xC9, 0x06, 0x8F, 0xF3); - - -#ifndef __GUIDS_ONLY__ /* This is defined to build libwdmguid.a */ - -typedef enum _PLUGPLAY_EVENT_CATEGORY -{ - HardwareProfileChangeEvent, - TargetDeviceChangeEvent, - DeviceClassChangeEvent, - CustomDeviceEvent, - DeviceInstallEvent, - DeviceArrivalEvent, - PowerEvent, - VetoEvent, - BlockedDriverEvent, - MaxPlugEventCategory -} PLUGPLAY_EVENT_CATEGORY; - -/* - * Plug and Play event structure used by NtGetPlugPlayEvent. - * - * EventGuid - * Can be one of the following values: - * GUID_HWPROFILE_QUERY_CHANGE - * GUID_HWPROFILE_CHANGE_CANCELLED - * GUID_HWPROFILE_CHANGE_COMPLETE - * GUID_TARGET_DEVICE_QUERY_REMOVE - * GUID_TARGET_DEVICE_REMOVE_CANCELLED - * GUID_TARGET_DEVICE_REMOVE_COMPLETE - * GUID_PNP_CUSTOM_NOTIFICATION - * GUID_PNP_POWER_NOTIFICATION - * GUID_DEVICE_* (see above) - * - * EventCategory - * Type of the event that happened. - * - * Result - * ? - * - * Flags - * ? - * - * TotalSize - * Size of the event block including the device IDs and other - * per category specific fields. - */ - -typedef struct _PLUGPLAY_EVENT_BLOCK { - GUID EventGuid; - PLUGPLAY_EVENT_CATEGORY EventCategory; - PULONG Result; - ULONG Flags; - ULONG TotalSize; - PVOID DeviceObject; - union { - struct { - GUID ClassGuid; - WCHAR SymbolicLinkName[ANYSIZE_ARRAY]; - } DeviceClass; - struct { - WCHAR DeviceIds[ANYSIZE_ARRAY]; - } TargetDevice; - struct { - WCHAR DeviceId[ANYSIZE_ARRAY]; - } InstallDevice; - struct { - PVOID NotificationStructure; - WCHAR DeviceIds[ANYSIZE_ARRAY]; - } CustomNotification; - struct { - PVOID Notification; - } ProfileNotification; - struct { - ULONG NotificationCode; - ULONG NotificationData; - } PowerNotification; - struct { - PNP_VETO_TYPE VetoType; - WCHAR DeviceIdVetoNameBuffer[ANYSIZE_ARRAY]; - } VetoNotification; - struct { - GUID BlockedDriverGuid; - } BlockedDriverNotification; - }; -} PLUGPLAY_EVENT_BLOCK, *PPLUGPLAY_EVENT_BLOCK; - -/* - * NtGetPlugPlayEvent - * - * Returns one Plug & Play event from a global queue. - * - * Parameters - * Reserved1 - * Reserved2 - * Always set to zero. - * - * Buffer - * The buffer that will be filled with the event information on - * successful return from the function. - * - * BufferSize - * Size of the buffer pointed by the Buffer parameter. If the - * buffer size is not large enough to hold the whole event - * information, error STATUS_BUFFER_TOO_SMALL is returned and - * the buffer remains untouched. - * - * Return Values - * STATUS_PRIVILEGE_NOT_HELD - * STATUS_BUFFER_TOO_SMALL - * STATUS_SUCCESS - * - * Remarks - * This function isn't multi-thread safe! -NTSTATUS STDCALL -NtGetPlugPlayEvent( - ULONG Reserved1, - ULONG Reserved2, - PPLUGPLAY_EVENT_BLOCK Buffer, - ULONG BufferSize); - */ - -/* - * NtPlugPlayControl - * - * A function for doing various Plug & Play operations from user mode. - * - * Parameters - * ControlCode - * 0x00 Reenumerate device tree - * - * Buffer points to UNICODE_STRING decribing the instance - * path (like "HTREE\ROOT\0" or "Root\ACPI_HAL\0000"). For - * more information about instance paths see !devnode command - * in kernel debugger or look at "Inside Windows 2000" book, - * chapter "Driver Loading, Initialization, and Installation". - * - * 0x01 Register new device - * 0x02 Deregister device - * 0x03 Initialize device - * 0x04 Start device - * 0x06 Query and remove device - * 0x07 User response - * - * Called after processing the message from NtGetPlugPlayEvent. - * - * 0x08 Generate legacy device - * 0x09 Get interface device list - * 0x0A Get property data - * 0x0B Device class association (Registration) - * 0x0C Get related device - * 0x0D Get device interface alias - * 0x0E Get/set/clear device status - * 0x0F Get device depth - * 0x10 Query device relations - * 0x11 Query target device relation - * 0x12 Query conflict list - * 0x13 Retrieve dock data - * 0x14 Reset device - * 0x15 Halt device - * 0x16 Get blocked driver data - * - * Buffer - * The buffer contains information that is specific to each control - * code. The buffer is read-only. - * - * BufferSize - * Size of the buffer pointed by the Buffer parameter. If the - * buffer size specifies incorrect value for specified control - * code, error ??? is returned. - * - * Return Values - * STATUS_PRIVILEGE_NOT_HELD - * STATUS_SUCCESS - * ... - */ - -typedef struct _PLUGPLAY_CONTROL_PROPERTY_DATA -{ - UNICODE_STRING DeviceInstance; - ULONG Property; - PVOID Buffer; - ULONG BufferSize; -} PLUGPLAY_CONTROL_PROPERTY_DATA, *PPLUGPLAY_CONTROL_PROPERTY_DATA; - - -/* PLUGPLAY_GET_RELATED_DEVICE (Code 0x0C) */ - -/* Relation values */ -#define PNP_GET_PARENT_DEVICE 1 -#define PNP_GET_CHILD_DEVICE 2 -#define PNP_GET_SIBLING_DEVICE 3 - -typedef struct _PLUGPLAY_CONTROL_RELATED_DEVICE_DATA -{ - UNICODE_STRING TargetDeviceInstance; - ULONG Relation; /* 1: Parent 2: Child 3: Sibling */ - UNICODE_STRING RelatedDeviceInstance; -} PLUGPLAY_CONTROL_RELATED_DEVICE_DATA, *PPLUGPLAY_CONTROL_RELATED_DEVICE_DATA; - - -/* PLUGPLAY_DEVICE_STATUS (Code 0x0E) */ - -/* Operation values */ -#define PNP_GET_DEVICE_STATUS 0 -#define PNP_SET_DEVICE_STATUS 1 -#define PNP_CLEAR_DEVICE_STATUS 2 - - -typedef struct _PLUGPLAY_CONTOL_STATUS_DATA -{ - UNICODE_STRING DeviceInstance; - ULONG Operation; /* 0: Get 1: Set 2: Clear */ - ULONG DeviceStatus; /* DN_ see cfg.h */ - ULONG DeviceProblem; /* CM_PROB_ see cfg.h */ -} PLUGPLAY_CONTROL_STATUS_DATA, *PPLUGPLAY_CONTROL_STATUS_DATA; - -#endif /* __GUIDS_ONLY__ */ - -#endif /* __NTPNP_H */ _____ Modified: trunk/reactos/include/ndk/zwfuncs.h --- trunk/reactos/include/ndk/zwfuncs.h 2005-07-03 13:49:05 UTC (rev 16392) +++ trunk/reactos/include/ndk/zwfuncs.h 2005-07-03 15:21:19 UTC (rev 16393) @@ -1220,10 +1220,10 @@ NTSTATUS STDCALL NtGetPlugPlayEvent( - ULONG Reserved1, - ULONG Reserved2, - struct _PLUGPLAY_EVENT_BLOCK *Buffer, - ULONG BufferSize + IN ULONG Reserved1, + IN ULONG Reserved2, + OUT PPLUGPLAY_EVENT_BLOCK Buffer, + IN ULONG BufferSize ); ULONG _____ Modified: trunk/reactos/include/ndk/zwtypes.h --- trunk/reactos/include/ndk/zwtypes.h 2005-07-03 13:49:05 UTC (rev 16392) +++ trunk/reactos/include/ndk/zwtypes.h 2005-07-03 15:21:19 UTC (rev 16393) @@ -37,6 +37,16 @@ #define DOSDEVICE_DRIVE_CDROM 5 #define DOSDEVICE_DRIVE_RAMDISK 6 +/* PLUGPLAY_CONTROL_RELATED_DEVICE_DATA.Relation values */ +#define PNP_GET_PARENT_DEVICE 1 +#define PNP_GET_CHILD_DEVICE 2 +#define PNP_GET_SIBLING_DEVICE 3 + +/* PLUGPLAY_CONTROL_STATUS_DATA.Operation values */ +#define PNP_GET_DEVICE_STATUS 0 +#define PNP_SET_DEVICE_STATUS 1 +#define PNP_CLEAR_DEVICE_STATUS 2 + /* ENUMERATIONS **************************************************************/ typedef enum _HARDERROR_RESPONSE_OPTION @@ -63,7 +73,7 @@ ResponseYes } HARDERROR_RESPONSE, *PHARDERROR_RESPONSE; -typedef enum SHUTDOWN_ACTION_TAG +typedef enum _SHUTDOWN_ACTION { ShutdownNoReboot, ShutdownReboot, @@ -90,6 +100,20 @@ SystemDocked } SYSTEM_DOCK_STATE, *PSYSTEM_DOCK_STATE; +typedef enum _PLUGPLAY_EVENT_CATEGORY +{ + HardwareProfileChangeEvent, + TargetDeviceChangeEvent, + DeviceClassChangeEvent, + CustomDeviceEvent, + DeviceInstallEvent, + DeviceArrivalEvent, + PowerEvent, + VetoEvent, + BlockedDriverEvent, + MaxPlugEventCategory +} PLUGPLAY_EVENT_CATEGORY; + /**** Information Classes ****/ /* @@ -218,7 +242,8 @@ /* * Timer */ -typedef enum _TIMER_INFORMATION_CLASS { +typedef enum _TIMER_INFORMATION_CLASS +{ TimerBasicInformation } TIMER_INFORMATION_CLASS; @@ -261,8 +286,84 @@ typedef unsigned short LANGID; typedef LANGID *PLANGID; -struct _PLUGPLAY_EVENT_BLOCK; /* FIXME: Ask Filip if it's OK to define it */ +/* + * Plug and Play event structure used by NtGetPlugPlayEvent. + * + * EventGuid + * Can be one of the following values: + * GUID_HWPROFILE_QUERY_CHANGE + * GUID_HWPROFILE_CHANGE_CANCELLED + * GUID_HWPROFILE_CHANGE_COMPLETE + * GUID_TARGET_DEVICE_QUERY_REMOVE + * GUID_TARGET_DEVICE_REMOVE_CANCELLED + * GUID_TARGET_DEVICE_REMOVE_COMPLETE + * GUID_PNP_CUSTOM_NOTIFICATION + * GUID_PNP_POWER_NOTIFICATION + * GUID_DEVICE_* (see above) + * + * EventCategory + * Type of the event that happened. + * + * Result + * ? + * + * Flags + * ? + * + * TotalSize + * Size of the event block including the device IDs and other + * per category specific fields. + */ +typedef struct _PLUGPLAY_EVENT_BLOCK +{ + GUID EventGuid; + PLUGPLAY_EVENT_CATEGORY EventCategory; + PULONG Result; + ULONG Flags; + ULONG TotalSize; + PVOID DeviceObject; + union + { + struct + { + GUID ClassGuid; + WCHAR SymbolicLinkName[ANYSIZE_ARRAY]; + } DeviceClass; + struct + { + WCHAR DeviceIds[ANYSIZE_ARRAY]; + } TargetDevice; + struct + { + WCHAR DeviceId[ANYSIZE_ARRAY]; + } InstallDevice; + struct + { + PVOID NotificationStructure; + WCHAR DeviceIds[ANYSIZE_ARRAY]; + } CustomNotification; + struct + { + PVOID Notification; + } ProfileNotification; + struct + { + ULONG NotificationCode; + ULONG NotificationData; + } PowerNotification; + struct + { + PNP_VETO_TYPE VetoType; + WCHAR DeviceIdVetoNameBuffer[ANYSIZE_ARRAY]; + } VetoNotification; + struct + { + GUID BlockedDriverGuid; + } BlockedDriverNotification; + }; +} PLUGPLAY_EVENT_BLOCK, *PPLUGPLAY_EVENT_BLOCK; + /**** Information Structures ****/ /* * Mutant @@ -296,7 +397,8 @@ */ /* Class 0 */ -typedef struct _ATOM_BASIC_INFORMATION { +typedef struct _ATOM_BASIC_INFORMATION +{ USHORT UsageCount; USHORT Flags; USHORT NameLength; @@ -1017,7 +1119,8 @@ } SYSTEM_KERNEL_DEBUGGER_INFORMATION, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION; /* Class 36 */ -typedef struct _SYSTEM_CONTEXT_SWITCH_INFORMATION { +typedef struct _SYSTEM_CONTEXT_SWITCH_INFORMATION +{ ULONG ContextSwitches; ULONG FindAny; ULONG FindLast; @@ -1152,5 +1255,34 @@ /* Class 54-81 */ /* FIXME */ +/* + * PlugPlay + */ +/* Class 0x0A */ +typedef struct _PLUGPLAY_CONTROL_PROPERTY_DATA +{ + UNICODE_STRING DeviceInstance; + ULONG Property; + PVOID Buffer; + ULONG BufferSize; +} PLUGPLAY_CONTROL_PROPERTY_DATA, *PPLUGPLAY_CONTROL_PROPERTY_DATA; + +/* Class 0x0C */ +typedef struct _PLUGPLAY_CONTROL_RELATED_DEVICE_DATA +{ + UNICODE_STRING TargetDeviceInstance; + ULONG Relation; /* 1: Parent 2: Child 3: Sibling */ + UNICODE_STRING RelatedDeviceInstance; +} PLUGPLAY_CONTROL_RELATED_DEVICE_DATA, *PPLUGPLAY_CONTROL_RELATED_DEVICE_DATA; + +/* Class 0x0E */ +typedef struct _PLUGPLAY_CONTOL_STATUS_DATA +{ + UNICODE_STRING DeviceInstance; + ULONG Operation; /* 0: Get 1: Set 2: Clear */ + ULONG DeviceStatus; /* DN_ see cfg.h */ + ULONG DeviceProblem; /* CM_PROB_ see cfg.h */ +} PLUGPLAY_CONTROL_STATUS_DATA, *PPLUGPLAY_CONTROL_STATUS_DATA; + #endif _____ Modified: trunk/reactos/lib/wdmguid/wdmguid.c --- trunk/reactos/lib/wdmguid/wdmguid.c 2005-07-03 13:49:05 UTC (rev 16392) +++ trunk/reactos/lib/wdmguid/wdmguid.c 2005-07-03 15:21:19 UTC (rev 16393) @@ -5,7 +5,5 @@ #include "initguid.h" #include <ddk/wdmguid.h> -#define __GUIDS_ONLY__ -#include <ddk/ntpnp.h> /* EOF */ _____ Modified: trunk/reactos/ntoskrnl/include/ntoskrnl.h --- trunk/reactos/ntoskrnl/include/ntoskrnl.h 2005-07-03 13:49:05 UTC (rev 16392) +++ trunk/reactos/ntoskrnl/include/ntoskrnl.h 2005-07-03 15:21:19 UTC (rev 16393) @@ -18,7 +18,6 @@ #include <ddk/ntddk.h> #include <ddk/ntifs.h> #include <ddk/wdmguid.h> -#include <ddk/ntpnp.h> #include <ndk/ntndk.h> #undef IO_TYPE_FILE #define IO_TYPE_FILE 0x0F5L /* Temp Hack */ _____ Modified: trunk/reactos/ntoskrnl/io/plugplay.c --- trunk/reactos/ntoskrnl/io/plugplay.c 2005-07-03 13:49:05 UTC (rev 16392) +++ trunk/reactos/ntoskrnl/io/plugplay.c 2005-07-03 15:21:19 UTC (rev 16393) @@ -104,13 +104,40 @@ /* + * NtGetPlugPlayEvent + * + * Returns one Plug & Play event from a global queue. + * + * Parameters + * Reserved1 + * Reserved2 + * Always set to zero. + * + * Buffer + * The buffer that will be filled with the event information on + * successful return from the function. + * + * BufferSize + * Size of the buffer pointed by the Buffer parameter. If the + * buffer size is not large enough to hold the whole event + * information, error STATUS_BUFFER_TOO_SMALL is returned and + * the buffer remains untouched. + * + * Return Values + * STATUS_PRIVILEGE_NOT_HELD + * STATUS_BUFFER_TOO_SMALL + * STATUS_SUCCESS + * + * Remarks + * This function isn't multi-thread safe! + * * @implemented */ NTSTATUS STDCALL NtGetPlugPlayEvent(IN ULONG Reserved1, IN ULONG Reserved2, OUT PPLUGPLAY_EVENT_BLOCK Buffer, - IN ULONG BufferLength) + IN ULONG BufferSize) { PPNP_EVENT_ENTRY Entry; NTSTATUS Status; @@ -151,7 +178,7 @@ ListEntry); /* Check the buffer size */ - if (BufferLength < Entry->Event.TotalSize) + if (BufferSize < Entry->Event.TotalSize) { DPRINT1("Buffer is too small for the pnp-event\n"); return STATUS_BUFFER_TOO_SMALL; @@ -419,6 +446,59 @@ /* + * NtPlugPlayControl + * + * A function for doing various Plug & Play operations from user mode. + * + * Parameters + * PlugPlayControlClass + * 0x00 Reenumerate device tree + * + * Buffer points to UNICODE_STRING decribing the instance + * path (like "HTREE\ROOT\0" or "Root\ACPI_HAL\0000"). For + * more information about instance paths see !devnode command + * in kernel debugger or look at "Inside Windows 2000" book, + * chapter "Driver Loading, Initialization, and Installation". + * + * 0x01 Register new device + * 0x02 Deregister device + * 0x03 Initialize device + * 0x04 Start device + * 0x06 Query and remove device + * 0x07 User response + * + * Called after processing the message from NtGetPlugPlayEvent. + * + * 0x08 Generate legacy device + * 0x09 Get interface device list + * 0x0A Get property data + * 0x0B Device class association (Registration) + * 0x0C Get related device + * 0x0D Get device interface alias + * 0x0E Get/set/clear device status + * 0x0F Get device depth + * 0x10 Query device relations + * 0x11 Query target device relation + * 0x12 Query conflict list + * 0x13 Retrieve dock data + * 0x14 Reset device + * 0x15 Halt device + * 0x16 Get blocked driver data + * + * Buffer + * The buffer contains information that is specific to each control + * code. The buffer is read-only. + * + * BufferSize + * Size of the buffer pointed by the Buffer parameter. If the + * buffer size specifies incorrect value for specified control + * code, error ??? is returned. + * + * Return Values + * STATUS_PRIVILEGE_NOT_HELD + * STATUS_SUCCESS + * ... + * * @unimplemented */ NTSTATUS STDCALL _____ Modified: trunk/reactos/services/umpnpmgr/umpnpmgr.c --- trunk/reactos/services/umpnpmgr/umpnpmgr.c 2005-07-03 13:49:05 UTC (rev 16392) +++ trunk/reactos/services/umpnpmgr/umpnpmgr.c 2005-07-03 15:21:19 UTC (rev 16393) @@ -16,8 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id$ - * +/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel * FILE: services/umpnpmgr/umpnpmgr.c @@ -31,7 +30,6 @@ #define NTOS_MODE_USER #include <ndk/ntndk.h> #include <ddk/wdmguid.h> -#include <ddk/ntpnp.h> #include <rpc.h> #include <rpcdce.h> _____ Modified: trunk/reactos/w32api/include/ddk/wdmguid.h --- trunk/reactos/w32api/include/ddk/wdmguid.h 2005-07-03 13:49:05 UTC (rev 16392) +++ trunk/reactos/w32api/include/ddk/wdmguid.h 2005-07-03 15:21:19 UTC (rev 16393) @@ -115,4 +115,26 @@ DEFINE_GUID(GUID_POWER_DEVICE_WAKE_ENABLE, 0xa9546a82L, 0xfeb0, 0x11d0, 0xbd, 0x26, 0x00, 0xaa, 0x00, 0xb7, 0xb3, 0x2a); +DEFINE_GUID(GUID_DEVICE_STANDBY_VETOED, 0x03B21C13, 0x18D6, 0x11D3, 0x97, 0xDB, 0x00, 0xA0, 0xC9, 0x40, 0x52, 0x2E); +DEFINE_GUID(GUID_DEVICE_KERNEL_INITIATED_EJECT, 0x14689B54, 0x0703, 0x11D3, 0x97, 0xD2, 0x00, 0xA0, 0xC9, 0x40, 0x52, 0x2E); +DEFINE_GUID(GUID_DEVICE_THERMAL_ZONE, 0x4AFA3D51, 0x74A7, 0x11D0, 0xBE, 0x5E, 0x00, 0xA0, 0xC9, 0x06, 0x28, 0x57); +DEFINE_GUID(GUID_DEVICE_SYS_BUTTON, 0x4AFA3D53, 0x74A7, 0x11D0, 0xBE, 0x5E, 0x00, 0xA0, 0xC9, 0x06, 0x28, 0x57); +DEFINE_GUID(GUID_DEVICE_REMOVAL_VETOED, 0x60DBD5FA, 0xDDD2, 0x11D2, 0x97, 0xB8, 0x00, 0xA0, 0xC9, 0x40, 0x52, 0x2E); +DEFINE_GUID(GUID_DEVICE_HIBERNATE_VETOED, 0x61173AD9, 0x194F, 0x11D3, 0x97, 0xDC, 0x00, 0xA0, 0xC9, 0x40, 0x52, 0x2E); +DEFINE_GUID(GUID_DEVICE_BATTERY, 0x72631E54, 0x78A4, 0x11D0, 0xBC, 0xF7, 0x00, 0xAA, 0x00, 0xB7, 0xB3, 0x2A); +DEFINE_GUID(GUID_DEVICE_SAFE_REMOVAL, 0x8FBEF967, 0xD6C5, 0x11D2, 0x97, 0xB5, 0x00, 0xA0, 0xC9, 0x40, 0x52, 0x2E); + +DEFINE_GUID(GUID_DEVICE_ARRIVAL, 0xCB3A4009, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); +DEFINE_GUID(GUID_DEVICE_ENUMERATED, 0xCB3A400A, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); +DEFINE_GUID(GUID_DEVICE_ENUMERATE_REQUEST, 0xCB3A400B, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); +DEFINE_GUID(GUID_DEVICE_START_REQUEST, 0xCB3A400C, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); +DEFINE_GUID(GUID_DEVICE_REMOVE_PENDING, 0xCB3A400D, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); +DEFINE_GUID(GUID_DEVICE_QUERY_AND_REMOVE, 0xCB3A400E, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); +DEFINE_GUID(GUID_DEVICE_EJECT, 0xCB3A400F, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); +DEFINE_GUID(GUID_DEVICE_NOOP, 0xCB3A4010, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); +DEFINE_GUID(GUID_DEVICE_WARM_EJECT_VETOED, 0xCBF4C1F9, 0x18D5, 0x11D3, 0x97, 0xDB, 0x00, 0xA0, 0xC9, 0x40, 0x52, 0x2E); +DEFINE_GUID(GUID_DEVICE_SURPRISE_REMOVAL, 0xCE5AF000, 0x80DD, 0x11D2, 0xA8, 0x8D, 0x00, 0xA0, 0xC9, 0x69, 0x6B, 0x4B); +DEFINE_GUID(GUID_DEVICE_EJECT_VETOED, 0xCF7B71E8, 0xD8FD, 0x11D2, 0x97, 0xB5, 0x00, 0xA0, 0xC9, 0x40, 0x52, 0x2E); +DEFINE_GUID(GUID_DEVICE_EVENT_RBC, 0xD0744792, 0xA98E, 0x11D2, 0x91, 0x7A, 0x00, 0xA0, 0xC9, 0x06, 0x8F, 0xF3); + #endif /* __WDMGUID_H */
19 years, 6 months
1
0
0
0
[mf] 16392: prepare for WINE UNICODE patch
by mf@svn.reactos.com
prepare for WINE UNICODE patch Modified: trunk/reactos/subsys/system/winefile/winefile.c Modified: trunk/reactos/subsys/system/winefile/winefile.h _____ Modified: trunk/reactos/subsys/system/winefile/winefile.c --- trunk/reactos/subsys/system/winefile/winefile.c 2005-07-03 13:46:33 UTC (rev 16391) +++ trunk/reactos/subsys/system/winefile/winefile.c 2005-07-03 13:49:05 UTC (rev 16392) @@ -155,52 +155,6 @@ -#ifdef __WINE__ - -/* functions in unixcalls.c */ - -extern void call_getcwd(char* buffer, size_t len); -extern void* call_opendir(const char* path); -extern int call_readdir(void* pdir, char* name, unsigned* pinode); -extern void call_closedir(void* pdir); - -extern int call_stat( - const char* path, int* pis_dir, - unsigned long* psize_low, unsigned long* psize_high, - time_t* patime, time_t* pmtime, - unsigned long* plinks -); - -/* call vswprintf() in msvcrt.dll */ -int swprintf(wchar_t* buffer, const wchar_t* fmt, ...) -{ - static int (__cdecl *vswprintf)(wchar_t*, const wchar_t*, va_list); - - va_list ap; - int ret; - - if (!vswprintf) { - HMODULE hmod = LoadLibraryA("msvcrt"); - vswprintf = (int(__cdecl*)(wchar_t*,const wchar_t*,va_list)) GetProcAddress(hmod, "vswprintf"); - } - - va_start(ap, fmt); - ret = vswprintf(buffer, fmt, ap); - va_end(ap); - - return 0; -} - - -#else - - // ugly hack to use alloca() while keeping Wine's developers happy -#define HeapAlloc(h,f,s) alloca(s) -#define HeapFree(h,f,p) - -#endif - - static void read_directory(Entry* dir, LPCTSTR path, SORT_ORDER sortOrder, HWND hwnd); static void set_curdir(ChildWnd* child, Entry* entry, int idx, HWND hwnd); static void refresh_child(ChildWnd* child); @@ -278,6 +232,53 @@ } +#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) { @@ -677,7 +678,6 @@ return dest; } - static void get_strretA(STRRET* str, const SHITEMID* shiid, LPSTR buffer, int len) { switch(str->uType) { @@ -694,6 +694,35 @@ } } +static HRESULT path_from_pidlA(IShellFolder* folder, LPITEMIDLIST pidl, LPSTR buffer, int len) +{ + STRRET str; + + /* SHGDN_FORPARSING: get full path of id list */ + HRESULT hr = (*folder->lpVtbl->GetDisplayNameOf)(folder, pidl, SHGDN_FORPARSING, &str); + + if (SUCCEEDED(hr)) { + get_strretA(&str, &pidl->mkid, buffer, len); + free_strret(&str); + } else + buffer[0] = '\0'; + + return hr; +} + +#endif + +static LPWSTR wcscpyn(LPWSTR dest, LPCWSTR source, size_t count) +{ + LPCWSTR s; + LPWSTR d = dest; + + for(s=source; count&&(*d++=*s++); ) + count--; + + return dest; +} + static void get_strretW(STRRET* str, const SHITEMID* shiid, LPWSTR buffer, int len) { switch(str->uType) { @@ -711,13 +740,6 @@ } -static void free_strret(STRRET* str) -{ - if (str->uType == STRRET_WSTR) - (*Globals.iMalloc->lpVtbl->Free)(Globals.iMalloc, str->UNION_MEMBER(pOleStr)); -} - - static HRESULT name_from_pidl(IShellFolder* folder, LPITEMIDLIST pidl, LPTSTR buffer, int len, SHGDNF flags) { STRRET str; @@ -734,22 +756,6 @@ } -static HRESULT path_from_pidlA(IShellFolder* folder, LPITEMIDLIST pidl, LPSTR buffer, int len) -{ - STRRET str; - - /* SHGDN_FORPARSING: get full path of id list */ - HRESULT hr = (*folder->lpVtbl->GetDisplayNameOf)(folder, pidl, SHGDN_FORPARSING, &str); - - if (SUCCEEDED(hr)) { - get_strretA(&str, &pidl->mkid, buffer, len); - free_strret(&str); - } else - buffer[0] = '\0'; - - return hr; -} - static HRESULT path_from_pidlW(IShellFolder* folder, LPITEMIDLIST pidl, LPWSTR buffer, int len) { STRRET str; @@ -2697,12 +2703,12 @@ return TRUE; for(; *str; str++) - if (_totupper(*str)==_totupper(*pattern) && pattern_match(str, pattern)) + if (*str==*pattern && pattern_match(str, pattern)) return TRUE; return FALSE; } - else if (_totupper(*str)!=_totupper(*pattern) && *pattern!='?') + else if (*str!=*pattern && *pattern!='?') return FALSE; } @@ -2713,7 +2719,19 @@ return TRUE; } +static BOOL pattern_match_ncase(LPCTSTR str, LPCTSTR pattern) +{ + TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN]; + lstrcpy(b1, str); + lstrcpy(b2, pattern); + CharUpper(b1); + CharUpper(b2); + + return pattern_match(b1, b2); +} + + enum FILE_TYPE { FT_OTHER = 0, FT_EXECUTABLE = 1, @@ -2757,7 +2775,7 @@ /* filter using the file name pattern */ if (pattern) - if (!pattern_match(entry->data.cFileName, pattern)) + if (!pattern_match_ncase(entry->data.cFileName, pattern)) continue; /* filter system and hidden files */ @@ -3826,21 +3844,7 @@ return TRUE; } -#ifdef UNICODE -static BOOL launch_fileA(HWND hwnd, LPSTR cmd, UINT nCmdShow) -{ - HINSTANCE hinst = ShellExecuteA(hwnd, NULL/*operation*/, cmd, NULL/*parameters*/, NULL/*dir*/, nCmdShow); - if ((int)hinst <= 32) { - display_error(hwnd, GetLastError()); - return FALSE; - } - - return TRUE; -} -#endif - - static BOOL launch_entry(Entry* entry, HWND hwnd, UINT nCmdShow) { TCHAR cmd[MAX_PATH]; _____ Modified: trunk/reactos/subsys/system/winefile/winefile.h --- trunk/reactos/subsys/system/winefile/winefile.h 2005-07-03 13:46:33 UTC (rev 16391) +++ trunk/reactos/subsys/system/winefile/winefile.h 2005-07-03 13:49:05 UTC (rev 16392) @@ -36,17 +36,20 @@ #ifdef UNICODE #define _UNICODE -#include <wchar.h> #endif -#include <tchar.h> #include <stdlib.h> #include <stdio.h> #include <ctype.h> #include <locale.h> +#include <time.h> #ifndef __WINE__ #include <malloc.h> /* for alloca() */ + + // ugly hack to use alloca() while keeping Wine's developers happy +#define HeapAlloc(h,f,s) alloca(s) +#define HeapFree(h,f,p) #endif #include <shellapi.h> /* for ShellExecute() */ @@ -145,12 +148,38 @@ extern WINEFILE_GLOBALS Globals; #ifdef __WINE__ + extern void WineLicense(HWND hwnd); extern void WineWarranty(HWND hwnd); + #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 + + +/* functions in unixcalls.c */ + +extern void call_getcwd(char* buffer, size_t len); +extern void* call_opendir(const char* path); +extern int call_readdir(void* pdir, char* name, unsigned* pinode); +extern void call_closedir(void* pdir); + +extern int call_stat( + const char* path, int* pis_dir, + unsigned long* psize_low, unsigned long* psize_high, + time_t* patime, time_t* pmtime, + unsigned long* plinks +); + +#else + +#include <tchar.h> /* for _tsplitpath() */ + #endif
19 years, 6 months
1
0
0
0
← Newer
1
...
50
51
52
53
54
55
56
57
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
Results per page:
10
25
50
100
200