ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
January 2006
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
23 participants
586 discussions
Start a n
N
ew thread
[cwittich] 20913: implemented HBMMENU_CALLBACK (now some of the Miranda icons are displayed)
by cwittich@svn.reactos.org
implemented HBMMENU_CALLBACK (now some of the Miranda icons are displayed) Modified: trunk/reactos/lib/user32/windows/menu.c _____ Modified: trunk/reactos/lib/user32/windows/menu.c --- trunk/reactos/lib/user32/windows/menu.c 2006-01-16 16:29:02 UTC (rev 20912) +++ trunk/reactos/lib/user32/windows/menu.c 2006-01-16 16:45:27 UTC (rev 20913) @@ -645,7 +645,7 @@ #endif if (! MenuBar) - { + { INT y = Rect.top + Rect.bottom; UINT CheckBitmapWidth = GetSystemMetrics(SM_CXMENUCHECK); UINT CheckBitmapHeight = GetSystemMetrics(SM_CYMENUCHECK); @@ -682,6 +682,37 @@ DeleteDC(DcMem); DeleteObject(bm); } + if (Item->hbmpItem) + { + if (Item->hbmpItem == HBMMENU_CALLBACK) + { + DRAWITEMSTRUCT drawItem; + POINT origorg; + drawItem.CtlType = ODT_MENU; + drawItem.CtlID = 0; + drawItem.itemID = Item->wID; + drawItem.itemAction = Action; + drawItem.itemState = (Item->fState & MF_CHECKED)?ODS_CHECKED:0; + drawItem.itemState |= (Item->fState & MF_DEFAULT)?ODS_DEFAULT:0; + drawItem.itemState |= (Item->fState & MF_DISABLED)?ODS_DISABLED:0; + drawItem.itemState |= (Item->fState & MF_GRAYED)?ODS_GRAYED|ODS_DISABLED:0; + drawItem.itemState |= (Item->fState & MF_HILITE)?ODS_SELECTED:0; + drawItem.hwndItem = (HWND) MenuInfo->Self; + drawItem.hDC = Dc; + drawItem.rcItem = Item->Rect; + drawItem.itemData = Item->dwItemData; + /* some applications make this assumption on the DC's origin */ + SetViewportOrgEx( Dc, Item->Rect.left, Item->Rect.top, &origorg); + OffsetRect( &drawItem.rcItem, - Item->Rect.left, - Item->Rect.top); + SendMessageW( WndOwner, WM_DRAWITEM, 0, (LPARAM)&drawItem); + SetViewportOrgEx( Dc, origorg.x, origorg.y, NULL); + } + else + { + MenuDrawBitmapItem(Dc, Item, &Rect, MenuBar); + return; + } + } } /* Draw the popup-menu arrow */ @@ -699,9 +730,13 @@ DeleteDC(DcMem); } - Rect.left += CheckBitmapWidth; - Rect.right -= ArrowBitmapWidth; - } + Rect.left += CheckBitmapWidth; + Rect.right -= ArrowBitmapWidth; + } + else if( Item->hbmpItem && !(Item->fType & MF_OWNERDRAW)) + { /* Draw the bitmap */ + MenuDrawBitmapItem(Dc, Item, &Rect, MenuBar); + } /* Done for owner-drawn */ if (0 != (Item->fType & MF_OWNERDRAW)) @@ -709,15 +744,9 @@ return; } - /* Draw the item text or bitmap */ - if (IS_BITMAP_ITEM(Item->fType)) + /* process text if present */ + if (!(Item->fType & MF_SYSMENU) && Item->dwTypeData) { - MenuDrawBitmapItem(Dc, Item, &Rect, MenuBar); - return; - } - /* No bitmap - process text if present */ - else if (IS_STRING_ITEM(Item->fType)) - { register int i; HFONT FontOld = NULL; @@ -1154,37 +1183,55 @@ return; } - if (! MenuBar) - { - ItemInfo->Rect.right += 2 * CheckBitmapWidth; - if (0 != (ItemInfo->fType & MF_POPUP)) - { - ItemInfo->Rect.right += ArrowBitmapWidth; - } - } - if (0 != (ItemInfo->fType & MF_OWNERDRAW)) { return; } - if (IS_BITMAP_ITEM(ItemInfo->fType)) - { - SIZE Size; + if (! MenuBar) + { + if (ItemInfo->hbmpItem) + { + if (ItemInfo->hbmpItem == HBMMENU_CALLBACK) + { + MEASUREITEMSTRUCT measItem; + measItem.CtlType = ODT_MENU; + measItem.CtlID = 0; + measItem.itemID = ItemInfo->wID; + measItem.itemWidth = ItemInfo->Rect.right - ItemInfo->Rect.left; + measItem.itemHeight = ItemInfo->Rect.bottom - ItemInfo->Rect.top; + measItem.itemData = ItemInfo->dwItemData; + SendMessageW( WndOwner, WM_MEASUREITEM, ItemInfo->wID, (LPARAM)&measItem); + ItemInfo->Rect.right = ItemInfo->Rect.left + measItem.itemWidth; + } + else + { + SIZE Size; - MenuGetBitmapItemSize((int) ItemInfo->hbmpItem, (DWORD) ItemInfo->hbmpItem, &Size); - ItemInfo->Rect.right += Size.cx; - ItemInfo->Rect.bottom += Size.cy; + MenuGetBitmapItemSize((int) ItemInfo->hbmpItem, (DWORD) ItemInfo->hbmpItem, &Size); + ItemInfo->Rect.right += Size.cx; + ItemInfo->Rect.bottom += Size.cy; - /* Leave space for the sunken border */ - ItemInfo->Rect.right += 2; - ItemInfo->Rect.bottom += 2; + /* Leave space for the sunken border */ + ItemInfo->Rect.right += 2; + ItemInfo->Rect.bottom += 2; - /* Special case: Minimize button doesn't have a space behind it. */ - if (ItemInfo->hbmpItem == (HBITMAP)HBMMENU_MBAR_MINIMIZE || - ItemInfo->hbmpItem == (HBITMAP)HBMMENU_MBAR_MINIMIZE_D) - ItemInfo->Rect.right -= 1; - } + /* Special case: Minimize button doesn't have a space behind it. */ + if (ItemInfo->hbmpItem == (HBITMAP)HBMMENU_MBAR_MINIMIZE || + ItemInfo->hbmpItem == (HBITMAP)HBMMENU_MBAR_MINIMIZE_D) + ItemInfo->Rect.right -= 1; + } + ItemInfo->Rect.right += 2 * CheckBitmapWidth; + } + else + { + ItemInfo->Rect.right += 2 * CheckBitmapWidth; + if (0 != (ItemInfo->fType & MF_POPUP)) + { + ItemInfo->Rect.right += ArrowBitmapWidth; + } + } + } /* it must be a text item - unless it's the system menu */ if (0 == (ItemInfo->fType & MF_SYSMENU) && IS_STRING_ITEM(ItemInfo->fType))
18 years, 11 months
1
0
0
0
[weiden] 20912: fixed difference in signedness warnings and a uninitialized variable warning
by weiden@svn.reactos.org
fixed difference in signedness warnings and a uninitialized variable warning Modified: trunk/reactos/hal/halx86/xbox/display_xbox.c Modified: trunk/reactos/hal/halx86/xbox/font.c Modified: trunk/reactos/hal/halx86/xbox/halxbox.h _____ Modified: trunk/reactos/hal/halx86/xbox/display_xbox.c --- trunk/reactos/hal/halx86/xbox/display_xbox.c 2006-01-16 02:21:22 UTC (rev 20911) +++ trunk/reactos/hal/halx86/xbox/display_xbox.c 2006-01-16 16:29:02 UTC (rev 20912) @@ -295,7 +295,7 @@ ULONG ScreenHeightPixels; PHYSICAL_ADDRESS PhysControl; PHYSICAL_ADDRESS PhysBuffer; - ULONG AvMode; + ULONG AvMode = 0; PVOID ControlBuffer; if (! DisplayInitialized) _____ Modified: trunk/reactos/hal/halx86/xbox/font.c --- trunk/reactos/hal/halx86/xbox/font.c 2006-01-16 02:21:22 UTC (rev 20911) +++ trunk/reactos/hal/halx86/xbox/font.c 2006-01-16 16:29:02 UTC (rev 20912) @@ -16,7 +16,7 @@ #define NDEBUG #include <debug.h> -CHAR XboxFont8x16[256 * 16] = +UCHAR XboxFont8x16[256 * 16] = { 0x00,0x00,0x00,0x7c,0xc6,0xc6,0xde,0xde,0xde,0xdc,0xc0,0x7c,0x00,0x00,0x 00,0x00, /* 0x00 */ 0x00,0x00,0x7e,0x81,0xa5,0x81,0x81,0xa5,0x99,0x81,0x81,0x7e,0x00,0x00,0x 00,0x00, /* 0x01 */ _____ Modified: trunk/reactos/hal/halx86/xbox/halxbox.h --- trunk/reactos/hal/halx86/xbox/halxbox.h 2006-01-16 02:21:22 UTC (rev 20911) +++ trunk/reactos/hal/halx86/xbox/halxbox.h 2006-01-16 16:29:02 UTC (rev 20912) @@ -15,7 +15,7 @@ #include <hal.h> #include <ntdddisk.h> -extern CHAR XboxFont8x16[256 * 16]; +extern UCHAR XboxFont8x16[256 * 16]; void HalpXboxInitPciBus(ULONG BusNumber, PBUS_HANDLER BusHandler); void HalpXboxInitPartIo(void);
18 years, 11 months
1
0
0
0
[ion] 20911: - Fix some nasty context switch bugs:
by ion@svn.reactos.org
- Fix some nasty context switch bugs: * We did not update the KPCR's stacklimit/initialstack with the new thread's stacklimit/initialstack. * We always assumed V86 frame bias in KeInitializeThreadContext. * We did not properly update ESP0 during context switch, to make space for the NPX frame and V86 bias. * We did not update fs:18h to point to the new TEB. * We did not clear out GS when switching processes, nor update the TSS's cr3. * If a new LDT was being updated, we over-wrote EBP (which was supposed to point to the TSS) by the GDT pointer. * We used a push/pop esp0 hack which hid the fact we never updated esp0. Modified: trunk/reactos/ntoskrnl/ke/i386/ctxswitch.S Modified: trunk/reactos/ntoskrnl/ke/i386/thread.c _____ Modified: trunk/reactos/ntoskrnl/ke/i386/ctxswitch.S --- trunk/reactos/ntoskrnl/ke/i386/ctxswitch.S 2006-01-15 22:26:10 UTC (rev 20910) +++ trunk/reactos/ntoskrnl/ke/i386/ctxswitch.S 2006-01-16 02:21:22 UTC (rev 20911) @@ -57,7 +57,7 @@ .globl _KiThreadStartup@156 _KiThreadStartup@156: - /* + /* * Clear all the non-volatile registers, so the thread won't be tempted to * expect any static data (like some badly coded usermode/win9x apps do) */ @@ -65,11 +65,11 @@ xor esi, esi xor edi, edi xor ebp, ebp - + /* It's now safe to go to APC */ mov ecx, APC_LEVEL call @KfLowerIrql@4 - + /* * Call the System Routine which is right on our stack now. * After we pop the pointer, the Start Routine/Context will be on the @@ -77,18 +77,18 @@ */ pop eax call eax - + /* The thread returned... was it a user-thread? */ pop ecx or ecx, ecx jz BadThread - + /* Yes it was, set our trapframe for the System Call Exit Dispatcher */ mov ebp, esp - + /* Exit back to user-mode */ jmp _KiServiceExit2 - + BadThread: /* A system thread returned...this is very bad! */ @@ -114,10 +114,6 @@ *--*/ .globl @KiSwapContextInternal@0 @KiSwapContextInternal@0: -#ifdef KDBG - //jmp SaveTrapFrameForKDB -SaveTrapFrameForKDB_Return: -#endif /* Get the PCR. It's faster to use ebx+offset then fs:offset */ mov ebx, [fs:KPCR_SELF] @@ -132,24 +128,36 @@ cli /* Save the initial stack in EAX */ - mov eax, [edi+KTHREAD_INITIAL_STACK] + mov eax, [esi+KTHREAD_INITIAL_STACK] + /* Save the stack limit in ecx */ + mov ecx, [esi+KTHREAD_STACK_LIMIT] + + /* Make space for the NPX Frame */ + sub eax, NPX_FRAME_LENGTH + + /* Set the KPCR stack values */ + mov [ebx+KPCR_INITIAL_STACK], eax + mov [ebx+KPCR_STACK_LIMIT], ecx + #ifdef CONFIG_SMP /* Save FPU state if the thread has used it. */ + mov ecx, [edi+KTHREAD_INITIAL_STACK] + sub ecx, NPX_FRAME_LENGTH mov dword ptr [ebx+KPCR_NPX_THREAD], 0 test byte ptr [edi+KTHREAD_NPX_STATE], NPX_STATE_DIRTY jz 3f cmp dword ptr _KeI386FxsrPresent, 0 je 1f - fxsave [eax-SIZEOF_FX_SAVE_AREA] + fxsave [ecx] jmp 2f 1: - fnsave [eax-SIZEOF_FX_SAVE_AREA] + fnsave [ecx] 2: mov byte ptr [edi+KTHREAD_NPX_STATE], NPX_STATE_VALID 3: #endif /* CONFIG_SMP */ - + /* Save the stack pointer in this processors TSS */ mov ebp, [ebx+KPCR_TSS] @@ -158,12 +166,17 @@ jnz NoAdjust /* Bias esp */ - //sub dword ptr ss:[ebp+KTSS_ESP0], KTRAP_FRAME_V86_GS - KTRAP_FRAME_SS + sub eax, KTRAP_FRAME_V86_GS - KTRAP_FRAME_SS NoAdjust: - /* Push ESP0 Value */ - push ss:[ebp+KTSS_ESP0] + /* Set new ESP0 */ + mov [ebp+KTSS_ESP0], eax + + /* Set TEB pointer */ + mov eax, [esi+KTHREAD_TEB] + mov [ebx+KPCR_TEB], eax + /* Check if address space switch is needed */ mov eax, [esi+KTHREAD_APCSTATE_PROCESS] cmp eax, [edi+KTHREAD_APCSTATE_PROCESS] @@ -172,52 +185,57 @@ /* Switch stacks */ mov [edi+KTHREAD_KERNEL_STACK], esp mov esp, [esi+KTHREAD_KERNEL_STACK] - + jz NoAddressSpaceSwitch - + + /* Clear gs */ + xor ecx, ecx + mov gs, cx + /* Switch address space */ mov cr3, eax - -NoAddressSpaceSwitch: - + mov [ebp+KTSS_CR3], eax + +NoAddressSpaceSwitch: + /* Stack is OK, safe to enable interrupts now */ - sti + sti /* Check if address space switch is needed (the result from above is valid) */ /* If they match, then use the fast-path and skip all this */ jz SameProcess - + /* Get the new Process. */ mov edi, [esi+KTHREAD_APCSTATE_PROCESS] - + /* Check if we need an LDT */ xor eax, eax cmp [edi+KPROCESS_LDT_DESCRIPTOR0], eax jz NoLdt - + /* Write the LDT Selector */ - mov ebp, [ebx+KPCR_GDT] + mov ecx, [ebx+KPCR_GDT] mov eax, [edi+KPROCESS_LDT_DESCRIPTOR0] - mov [ebp+KGDT_LDT], eax + mov [ecx+KGDT_LDT], eax mov eax, [edi+KPROCESS_LDT_DESCRIPTOR1] - mov [ebp+KGDT_LDT+4], eax - + mov [ecx+KGDT_LDT+4], eax + /* Save LDT Selector */ mov eax, KGDT_LDT - + NoLdt: - + /* Load LDT */ lldt ax - + /* Get the IOPM */ mov ecx, [edi+KPROCESS_IOPM_OFFSET] /* Set current IOPM offset in the TSS */ mov [ebp+KTSS_IOMAPBASE], cx - + SameProcess: - + /* Set the TEB */ mov eax, [esi+KTHREAD_TEB] mov ecx, [ebx+KPCR_GDT] @@ -225,10 +243,10 @@ shr eax, 16 mov [ecx+0x3C], al mov [ecx+0x3F], ah - + /* Increase context switches */ inc dword ptr [esi+KTHREAD_CONTEXT_SWITCHES] - + /* Set TS in cr0 to catch FPU code and load the FPU state when needed */ #ifndef CONFIG_SMP cmp [ebx+KPCR_NPX_THREAD], esi @@ -238,10 +256,7 @@ or eax, X86_CR0_TS mov cr0, eax 4: - - /* Restore the stack pointer in this processors TSS */ - pop ss:[ebp+KTSS_ESP0] - + /* Restore exception list */ pop [ebx+KPCR_EXCEPTION_LIST] @@ -307,106 +322,4 @@ /* Clean stack */ add esp, 4 * 4 ret - -#ifdef KDBG -SaveTrapFrameForKDB: - /* Set up a trap frame */ - pushf // 0x70 - push cs // 0x6C - push 0 /* Error Code */ // 0x64 - push ebp // 0x60 - push ebx - - /* Fake Interrupt Stack */ - mov ebp, [esp+20] /* Eip */ - mov ebx, [esp+16] /* Eflags */ - mov [esp+20], ebx - mov ebx, [esp+12] /* Cs */ - mov [esp+16], ebx - mov [esp+12], ebp - - push esi - push edi - push fs - push -1 /* Exception List */ // 0x4C - push 0 /* Previous Mode */ // 0x48 - push eax - push ecx - push edx - push ds - push es - push gs // 0x30 - - mov eax, dr7 - push eax /* Dr7 */ - /* Clear breakpoint enables in dr7. */ - and eax, 0xffff0000 - mov dr7, eax - mov eax, dr6 - push eax /* Dr6 */ - mov eax, dr3 - push eax /* Dr3 */ - mov eax, dr2 - push eax /* Dr2 */ - mov eax, dr1 - push eax /* Dr1 */ - mov eax, dr0 - push eax /* Dr0 */ - - lea eax, [esp+0x58] - push eax /* TempEsp */ - push ss /* TempSegSs */ - push 0 /* DebugPointer */ - push -1 /* DebugArgMark */ - push [esp+60] /* Debug EIP */ // 0x4 - push ebp /* Debug EBP */ // 0x0 - - /* Set Stack */ - mov ebp, esp - - /* Push old Trap Frame */ - push [edi+KTHREAD_TRAP_FRAME] - - /* Save new one */ - mov [edi+KTHREAD_TRAP_FRAME], ebp - - /* Restore EBP, EBX and EAX */ - mov ebp, [ebp+KTRAP_FRAME_EBP] - mov ebx, [ebp+KTRAP_FRAME_EBX] - mov eax, [ebp+KTRAP_FRAME_EAX] - - /* Return EIP */ - push offset RestoreTrapFrameForKDB - - /* Jump to normal code */ - jmp SaveTrapFrameForKDB_Return - -RestoreTrapFrameForKDB: - - /* Restore the old trapframe */ - pop [esi+KTHREAD_TRAP_FRAME] - - /* Pop unused portions of the trap frame */ - add esp, 0x30 - - /* Restore registers from Trap frame */ - pop gs - pop es - pop ds - pop edx - pop ecx - pop eax - add esp, 8 /* ExceptionList and PreviousMode */ - pop fs - pop edi - pop esi - pop ebx - pop ebp - add esp, 4 /* ErrorCode */ - - /* Return to the caller. */ - iret -#endif /* KDBG */ - - _____ Modified: trunk/reactos/ntoskrnl/ke/i386/thread.c --- trunk/reactos/ntoskrnl/ke/i386/thread.c 2006-01-15 22:26:10 UTC (rev 20910) +++ trunk/reactos/ntoskrnl/ke/i386/thread.c 2006-01-16 02:21:22 UTC (rev 20911) @@ -14,7 +14,6 @@ typedef struct _KSHARED_CTXSWITCH_FRAME { - ULONG Esp0; PVOID ExceptionList; PVOID RetEip; } KSHARED_CTXSWITCH_FRAME, *PKSHARED_CTXSWITCH_FRAME; @@ -232,9 +231,6 @@ /* And set up the Context Switch Frame */ CtxSwitchFrame->RetEip = KiThreadStartup; - CtxSwitchFrame->Esp0 = (ULONG_PTR)Thread->InitialStack - - sizeof(FX_SAVE_AREA) - - 0x10; CtxSwitchFrame->ExceptionList = (PVOID)0xFFFFFFFF; /* Save back the new value of the kernel stack. */
18 years, 11 months
1
0
0
0
[gvg] 20910: Tag Wine 0.9.5
by gvg@svn.reactos.org
Tag Wine 0.9.5 Added: vendor/wine/dlls/wininet/Wine-0_9_5/ _____ Copied: vendor/wine/dlls/wininet/Wine-0_9_5 (from rev 20907, vendor/wine/dlls/wininet/current)
18 years, 11 months
1
0
0
0
[gvg] 20909: New wininet vendor import
by gvg@svn.reactos.org
New wininet vendor import Modified: trunk/reactos/include/wine/shlwapi.h Modified: trunk/reactos/include/wine/winnetwk.h Added: trunk/reactos/lib/wininet/ Deleted: trunk/reactos/lib/wininet/Makefile.in Modified: trunk/reactos/lib/wininet/http.c Modified: trunk/reactos/lib/wininet/internet.c Modified: trunk/reactos/lib/wininet/netconnection.c Modified: trunk/reactos/lib/wininet/utility.c Added: trunk/reactos/lib/wininet/wininet.xml Modified: trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/w32api/include/wininet.h _____ Modified: trunk/reactos/include/wine/shlwapi.h --- trunk/reactos/include/wine/shlwapi.h 2006-01-15 22:22:02 UTC (rev 20908) +++ trunk/reactos/include/wine/shlwapi.h 2006-01-15 22:25:16 UTC (rev 20909) @@ -13,6 +13,7 @@ #define __WINE_SHLWAPI_H #define URL_FILE_USE_PATHURL 0x00010000 +#define URL_BROWSER_MODE URL_DONT_ESCAPE_EXTRA_INFO HRESULT WINAPI SHCreateStreamOnFileEx(LPCWSTR,DWORD,DWORD,BOOL,struct IStream*,struct IStream**); _____ Modified: trunk/reactos/include/wine/winnetwk.h --- trunk/reactos/include/wine/winnetwk.h 2006-01-15 22:22:02 UTC (rev 20908) +++ trunk/reactos/include/wine/winnetwk.h 2006-01-15 22:25:16 UTC (rev 20909) @@ -24,6 +24,8 @@ } PASSWORD_CACHE_ENTRY; typedef BOOL (CALLBACK *ENUMPASSWORDPROC)(PASSWORD_CACHE_ENTRY *, DWORD); +DWORD WINAPI WNetCachePassword( LPSTR, WORD, LPSTR, WORD, BYTE, WORD ); UINT WINAPI WNetEnumCachedPasswords( LPSTR, WORD, BYTE, ENUMPASSWORDPROC, DWORD); +DWORD WINAPI WNetGetCachedPassword( LPSTR, WORD, LPSTR, LPWORD, BYTE ); #endif /* __WINE_WINNETWK_H */ _____ Copied: trunk/reactos/lib/wininet (from rev 20908, vendor/wine/dlls/wininet/current) Property changes on: trunk/reactos/lib/wininet ___________________________________________________________________ Name: svn:ignore + GNUmakefile _____ Deleted: trunk/reactos/lib/wininet/Makefile.in --- vendor/wine/dlls/wininet/current/Makefile.in 2006-01-15 22:22:02 UTC (rev 20908) +++ trunk/reactos/lib/wininet/Makefile.in 2006-01-15 22:25:16 UTC (rev 20909) @@ -1,31 +0,0 @@ -EXTRADEFS = -D_WINX32_ -TOPSRCDIR = @top_srcdir@ -TOPOBJDIR = ../.. -SRCDIR = @srcdir@ -VPATH = @srcdir@ -MODULE = wininet.dll -IMPORTLIB = libwininet.$(IMPLIBEXT) -IMPORTS = mpr shlwapi shell32 user32 advapi32 kernel32 ntdll -EXTRALIBS = $(LIBUNICODE) @SOCKETLIBS@ - -C_SRCS = \ - cookie.c \ - dialogs.c \ - ftp.c \ - gopher.c \ - http.c \ - internet.c \ - netconnection.c \ - urlcache.c \ - utility.c \ - wininet_main.c - -RC_SRCS = \ - rsrc.rc \ - version.rc - -SUBDIRS = tests - -@MAKE_DLL_RULES@ - -### Dependencies: _____ Modified: trunk/reactos/lib/wininet/http.c --- vendor/wine/dlls/wininet/current/http.c 2006-01-15 22:22:02 UTC (rev 20908) +++ trunk/reactos/lib/wininet/http.c 2006-01-15 22:25:16 UTC (rev 20909) @@ -2524,7 +2524,11 @@ /* * HACK peek at the buffer */ +#if 0 + /* This is Wine code, we don't support MSG_PEEK yet so we have to do it + a bit different */ NETCON_recv(&lpwhr->netConnection, buffer, buflen, MSG_PEEK, &rc); +#endif /* * We should first receive 'HTTP/1.x nnn OK' where nnn is the status code. @@ -2533,6 +2537,9 @@ memset(buffer, 0, MAX_REPLY_LEN); if (!NETCON_getNextLine(&lpwhr->netConnection, bufferA, &buflen)) goto lend; +#if 1 + rc = buflen; +#endif MultiByteToWideChar( CP_ACP, 0, bufferA, buflen, buffer, MAX_REPLY_LEN ); /* regenerate raw headers */ @@ -2579,6 +2586,9 @@ { LPWSTR * pFieldAndValue; +#if 1 + rc += buflen; +#endif TRACE("got line %s, now interpreting\n", debugstr_a(bufferA)); MultiByteToWideChar( CP_ACP, 0, bufferA, buflen, buffer, MAX_REPLY_LEN ); _____ Modified: trunk/reactos/lib/wininet/internet.c --- vendor/wine/dlls/wininet/current/internet.c 2006-01-15 22:22:02 UTC (rev 20908) +++ trunk/reactos/lib/wininet/internet.c 2006-01-15 22:25:16 UTC (rev 20909) @@ -259,15 +259,23 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { + WSADATA wsaData; + TRACE("%p,%lx,%p\n", hinstDLL, fdwReason, lpvReserved); switch (fdwReason) { case DLL_PROCESS_ATTACH: + if (0 != WSAStartup(MAKEWORD(1, 1), &wsaData)) { + return FALSE; + } + g_dwTlsErrIndex = TlsAlloc(); - if (g_dwTlsErrIndex == TLS_OUT_OF_INDEXES) + if (g_dwTlsErrIndex == TLS_OUT_OF_INDEXES) { + WSACleanup(); return FALSE; + } hQuitEvent = CreateEventW(0, TRUE, FALSE, NULL); hWorkEvent = CreateEventW(0, FALSE, FALSE, NULL); @@ -314,6 +322,7 @@ CloseHandle(hQuitEvent); CloseHandle(hWorkEvent); DeleteCriticalSection(&csQueue); + WSACleanup(); break; } @@ -2687,10 +2696,10 @@ /* * Build our ping command */ - len = WideCharToMultiByte(CP_UNIXCP, 0, hostW, -1, NULL, 0, NULL, NULL); + len = WideCharToMultiByte(CP_THREAD_ACP, 0, hostW, -1, NULL, 0, NULL, NULL); command = HeapAlloc( GetProcessHeap(), 0, strlen(ping)+len+strlen(redirect) ); strcpy(command,ping); - WideCharToMultiByte(CP_UNIXCP, 0, hostW, -1, command+strlen(ping), len, NULL, NULL); + WideCharToMultiByte(CP_THREAD_ACP, 0, hostW, -1, command+strlen(ping), len, NULL, NULL); strcat(command,redirect); TRACE("Ping command is : %s\n",command); _____ Modified: trunk/reactos/lib/wininet/netconnection.c --- vendor/wine/dlls/wininet/current/netconnection.c 2006-01-15 22:22:02 UTC (rev 20908) +++ trunk/reactos/lib/wininet/netconnection.c 2006-01-15 22:25:16 UTC (rev 20909) @@ -199,70 +199,6 @@ return TRUE; } -/* translate a unix error code into a winsock one */ -static int sock_get_error( int err ) -{ - switch (err) - { - case EINTR: return WSAEINTR; - case EBADF: return WSAEBADF; - case EPERM: - case EACCES: return WSAEACCES; - case EFAULT: return WSAEFAULT; - case EINVAL: return WSAEINVAL; - case EMFILE: return WSAEMFILE; - case EWOULDBLOCK: return WSAEWOULDBLOCK; - case EINPROGRESS: return WSAEINPROGRESS; - case EALREADY: return WSAEALREADY; - case ENOTSOCK: return WSAENOTSOCK; - case EDESTADDRREQ: return WSAEDESTADDRREQ; - case EMSGSIZE: return WSAEMSGSIZE; - case EPROTOTYPE: return WSAEPROTOTYPE; - case ENOPROTOOPT: return WSAENOPROTOOPT; - case EPROTONOSUPPORT: return WSAEPROTONOSUPPORT; - case ESOCKTNOSUPPORT: return WSAESOCKTNOSUPPORT; - case EOPNOTSUPP: return WSAEOPNOTSUPP; - case EPFNOSUPPORT: return WSAEPFNOSUPPORT; - case EAFNOSUPPORT: return WSAEAFNOSUPPORT; - case EADDRINUSE: return WSAEADDRINUSE; - case EADDRNOTAVAIL: return WSAEADDRNOTAVAIL; - case ENETDOWN: return WSAENETDOWN; - case ENETUNREACH: return WSAENETUNREACH; - case ENETRESET: return WSAENETRESET; - case ECONNABORTED: return WSAECONNABORTED; - case EPIPE: - case ECONNRESET: return WSAECONNRESET; - case ENOBUFS: return WSAENOBUFS; - case EISCONN: return WSAEISCONN; - case ENOTCONN: return WSAENOTCONN; - case ESHUTDOWN: return WSAESHUTDOWN; - case ETOOMANYREFS: return WSAETOOMANYREFS; - case ETIMEDOUT: return WSAETIMEDOUT; - case ECONNREFUSED: return WSAECONNREFUSED; - case ELOOP: return WSAELOOP; - case ENAMETOOLONG: return WSAENAMETOOLONG; - case EHOSTDOWN: return WSAEHOSTDOWN; - case EHOSTUNREACH: return WSAEHOSTUNREACH; - case ENOTEMPTY: return WSAENOTEMPTY; -#ifdef EPROCLIM - case EPROCLIM: return WSAEPROCLIM; -#endif -#ifdef EUSERS - case EUSERS: return WSAEUSERS; -#endif -#ifdef EDQUOT - case EDQUOT: return WSAEDQUOT; -#endif -#ifdef ESTALE - case ESTALE: return WSAESTALE; -#endif -#ifdef EREMOTE - case EREMOTE: return WSAEREMOTE; -#endif - default: errno=err; perror("sock_set_error"); return WSAEFAULT; - } -} - /*********************************************************************** ******* * NETCON_create * Basically calls 'socket()' @@ -276,9 +212,9 @@ #endif connection->socketFD = socket(domain, type, protocol); - if (connection->socketFD == -1) + if (INVALID_SOCKET == connection->socketFD) { - INTERNET_SetLastError(sock_get_error(errno)); + INTERNET_SetLastError(WSAGetLastError()); return FALSE; } return TRUE; @@ -312,9 +248,9 @@ result = closesocket(connection->socketFD); connection->socketFD = -1; - if (result == -1) + if (0 != result) { - INTERNET_SetLastError(sock_get_error(errno)); + INTERNET_SetLastError(WSAGetLastError()); return FALSE; } return TRUE; @@ -390,14 +326,14 @@ * the moment */ } - len = WideCharToMultiByte(CP_UNIXCP, 0, hostname, -1, NULL, 0, NULL, NULL); + len = WideCharToMultiByte(CP_THREAD_ACP, 0, hostname, -1, NULL, 0, NULL, NULL); hostname_unix = HeapAlloc(GetProcessHeap(), 0, len); if (!hostname_unix) { INTERNET_SetLastError(ERROR_NOT_ENOUGH_MEMORY); goto fail; } - WideCharToMultiByte(CP_UNIXCP, 0, hostname, -1, hostname_unix, len, NULL, NULL); + WideCharToMultiByte(CP_THREAD_ACP, 0, hostname, -1, hostname_unix, len, NULL, NULL); if (!check_hostname(cert, hostname_unix)) { @@ -433,10 +369,10 @@ if (!NETCON_connected(connection)) return FALSE; result = connect(connection->socketFD, serv_addr, addrlen); - if (result == -1) + if (SOCKET_ERROR == result) { WARN("Unable to connect to host (%s)\n", strerror(errno)); - INTERNET_SetLastError(sock_get_error(errno)); + INTERNET_SetLastError(WSAGetLastError()); closesocket(connection->socketFD); connection->socketFD = -1; @@ -458,9 +394,9 @@ if (!connection->useSSL) { *sent = send(connection->socketFD, msg, len, flags); - if (*sent == -1) + if (SOCKET_ERROR == *sent) { - INTERNET_SetLastError(sock_get_error(errno)); + INTERNET_SetLastError(WSAGetLastError()); return FALSE; } return TRUE; @@ -492,9 +428,9 @@ if (!connection->useSSL) { *recvd = recv(connection->socketFD, buf, len, flags); - if (*recvd == -1) + if (SOCKET_ERROR == *recvd) { - INTERNET_SetLastError(sock_get_error(errno)); + INTERNET_SetLastError(WSAGetLastError()); return FALSE; } return TRUE; @@ -572,6 +508,7 @@ fd_set infd; BOOL bSuccess = FALSE; DWORD nRecv = 0; + int r; FD_ZERO(&infd); FD_SET(connection->socketFD, &infd); @@ -582,9 +519,10 @@ { if (select(connection->socketFD+1,&infd,NULL,NULL,&tv) > 0) { - if (recv(connection->socketFD, &lpszBuffer[nRecv], 1, 0) <= 0) + r = recv(connection->socketFD, &lpszBuffer[nRecv], 1, 0); + if (0 == r || SOCKET_ERROR == r) { - INTERNET_SetLastError(sock_get_error(errno)); + INTERNET_SetLastError(WSAGetLastError()); goto lend; } _____ Modified: trunk/reactos/lib/wininet/utility.c --- vendor/wine/dlls/wininet/current/utility.c 2006-01-15 22:22:02 UTC (rev 20908) +++ trunk/reactos/lib/wininet/utility.c 2006-01-15 22:25:16 UTC (rev 20909) @@ -147,9 +147,9 @@ else len = strlenW(lpszServerName); - sz = WideCharToMultiByte( CP_UNIXCP, 0, lpszServerName, len, NULL, 0, NULL, NULL ); + sz = WideCharToMultiByte( CP_THREAD_ACP, 0, lpszServerName, len, NULL, 0, NULL, NULL ); name = HeapAlloc(GetProcessHeap(), 0, sz+1); - WideCharToMultiByte( CP_UNIXCP, 0, lpszServerName, len, name, sz, NULL, NULL ); + WideCharToMultiByte( CP_THREAD_ACP, 0, lpszServerName, len, name, sz, NULL, NULL ); name[sz] = 0; phe = gethostbyname(name); HeapFree( GetProcessHeap(), 0, name ); _____ Added: trunk/reactos/lib/wininet/wininet.xml --- vendor/wine/dlls/wininet/current/wininet.xml 2006-01-15 22:22:02 UTC (rev 20908) +++ trunk/reactos/lib/wininet/wininet.xml 2006-01-15 22:25:16 UTC (rev 20909) @@ -0,0 +1,33 @@ +<module name="wininet" type="win32dll" baseaddress="${BASEADDRESS_WININET}" installbase="system32" installname="wininet.dll" allowwarnings="true"> + <autoregister infsection="OleControlDlls" type="DllInstall" /> + <importlibrary definition="wininet.spec.def" /> + <include base="wininet">.</include> + <include base="ReactOS">include/wine</include> + <define name="__REACTOS__" /> + <define name="__USE_W32API" /> + <define name="_WIN32_IE">0x600</define> + <define name="_WIN32_WINNT">0x501</define> + <define name="WINVER">0x501</define> + <library>wine</library> + <library>ntdll</library> + <library>kernel32</library> + <library>user32</library> + <library>advapi32</library> + <library>shell32</library> + <library>shlwapi</library> + <library>mpr</library> + <library>ws2_32</library> + <file>cookie.c</file> + <file>dialogs.c</file> + <file>ftp.c</file> + <file>gopher.c</file> + <file>http.c</file> + <file>internet.c</file> + <file>netconnection.c</file> + <file>urlcache.c</file> + <file>utility.c</file> + <file>wininet_main.c</file> + <file>rsrc.rc</file> + <file>version.rc</file> + <file>wininet.spec</file> +</module> Property changes on: trunk/reactos/lib/wininet/wininet.xml ___________________________________________________________________ Name: svn:eol-style + native _____ Modified: trunk/reactos/media/doc/README.WINE --- trunk/reactos/media/doc/README.WINE 2006-01-15 22:22:02 UTC (rev 20908) +++ trunk/reactos/media/doc/README.WINE 2006-01-15 22:25:16 UTC (rev 20909) @@ -78,7 +78,7 @@ reactos/lib/urlmon # Synced to Wine-0_9_5 reactos/lib/uxtheme # Synced to Wine-0_9_5 reactos/lib/version # Out of sync -reactos/lib/wininet # Out of sync +reactos/lib/wininet # Synced to Wine-0_9_5 reactos/lib/wintrust # Synced to Wine-0_9_5 reactos/lib/winmm # Forked at Wine-20050628 reactos/lib/winmm/midimap # Forked at Wine-20050628 _____ Modified: trunk/reactos/w32api/include/wininet.h --- trunk/reactos/w32api/include/wininet.h 2006-01-15 22:22:02 UTC (rev 20908) +++ trunk/reactos/w32api/include/wininet.h 2006-01-15 22:25:16 UTC (rev 20909) @@ -474,11 +474,42 @@ #define INTERNET_OPTION_HTTP_VERSION 59 #define INTERNET_OPTION_RESET_URLCACHE_SESSION 60 #define INTERNET_OPTION_ERROR_MASK 62 +#define INTERNET_OPTION_FROM_CACHE_TIMEOUT 63 +#define INTERNET_OPTION_BYPASS_EDITED_ENTRY 64 +#define INTERNET_OPTION_DIAGNOSTIC_SOCKET_INFO 67 #define INTERNET_OPTION_CODEPAGE 68 +#define INTERNET_OPTION_CACHE_TIMESTAMPS 69 +#define INTERNET_OPTION_DISABLE_AUTODIAL 70 +#define INTERNET_OPTION_MAX_CONNS_PER_SERVER 73 +#define INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER 74 +#define INTERNET_OPTION_PER_CONNECTION_OPTION 75 +#define INTERNET_OPTION_DIGEST_AUTH_UNLOAD 76 +#define INTERNET_OPTION_IGNORE_OFFLINE 77 +#define INTERNET_OPTION_IDENTITY 78 +#define INTERNET_OPTION_REMOVE_IDENTITY 79 +#define INTERNET_OPTION_ALTER_IDENTITY 80 +#define INTERNET_OPTION_SUPPRESS_BEHAVIOR 81 +#define INTERNET_OPTION_AUTODIAL_MODE 82 +#define INTERNET_OPTION_AUTODIAL_CONNECTION 83 +#define INTERNET_OPTION_CLIENT_CERT_CONTEXT 84 +#define INTERNET_OPTION_AUTH_FLAGS 85 #define INTERNET_OPTION_COOKIES_3RD_PARTY 86 +#define INTERNET_OPTION_COOKIES_3RD_PARTY 86 +#define INTERNET_OPTION_DISABLE_PASSPORT_AUTH 87 +#define INTERNET_OPTION_SEND_UTF8_SERVERNAME_TO_PROXY 88 +#define INTERNET_OPTION_EXEMPT_CONNECTION_LIMIT 89 +#define INTERNET_OPTION_ENABLE_PASSPORT_AUTH 90 + +#define INTERNET_OPTION_HIBERNATE_INACTIVE_WORKER_THREADS 91 +#define INTERNET_OPTION_ACTIVATE_WORKER_THREADS 92 +#define INTERNET_OPTION_RESTORE_WORKER_THREAD_DEFAULTS 93 +#define INTERNET_OPTION_SOCKET_SEND_BUFFER_LENGTH 94 + #define INTERNET_OPTION_PROXY_SETTINGS_CHANGED 95 +#define INTERNET_OPTION_DATAFILE_EXT 96 + #define INTERNET_FIRST_OPTION INTERNET_OPTION_CALLBACK -#define INTERNET_LAST_OPTION INTERNET_OPTION_PROXY_SETTINGS_CHANGED +#define INTERNET_LAST_OPTION INTERNET_OPTION_DATAFILE_EXT #define INTERNET_PRIORITY_FOREGROUND 1000 #define INTERNET_HANDLE_TYPE_INTERNET 1
18 years, 11 months
1
0
0
0
[gvg] 20908: Drop old wininet in preparation for new vendor import
by gvg@svn.reactos.org
Drop old wininet in preparation for new vendor import Deleted: trunk/reactos/lib/wininet/
18 years, 11 months
1
0
0
0
[gvg] 20907: wininet from Wine vendor drop
by gvg@svn.reactos.org
wininet from Wine vendor drop Added: vendor/wine/dlls/wininet/ Added: vendor/wine/dlls/wininet/current/ Added: vendor/wine/dlls/wininet/current/Makefile.in Added: vendor/wine/dlls/wininet/current/cookie.c Added: vendor/wine/dlls/wininet/current/dialogs.c Added: vendor/wine/dlls/wininet/current/ftp.c Added: vendor/wine/dlls/wininet/current/gopher.c Added: vendor/wine/dlls/wininet/current/http.c Added: vendor/wine/dlls/wininet/current/internet.c Added: vendor/wine/dlls/wininet/current/internet.h Added: vendor/wine/dlls/wininet/current/netconnection.c Added: vendor/wine/dlls/wininet/current/resource.h Added: vendor/wine/dlls/wininet/current/rsrc.rc Added: vendor/wine/dlls/wininet/current/urlcache.c Added: vendor/wine/dlls/wininet/current/utility.c Added: vendor/wine/dlls/wininet/current/version.rc Added: vendor/wine/dlls/wininet/current/wininet.spec Added: vendor/wine/dlls/wininet/current/wininet_Bg.rc Added: vendor/wine/dlls/wininet/current/wininet_Cs.rc Added: vendor/wine/dlls/wininet/current/wininet_De.rc Added: vendor/wine/dlls/wininet/current/wininet_En.rc Added: vendor/wine/dlls/wininet/current/wininet_Es.rc Added: vendor/wine/dlls/wininet/current/wininet_Fi.rc Added: vendor/wine/dlls/wininet/current/wininet_Fr.rc Added: vendor/wine/dlls/wininet/current/wininet_It.rc Added: vendor/wine/dlls/wininet/current/wininet_Ja.rc Added: vendor/wine/dlls/wininet/current/wininet_Ko.rc Added: vendor/wine/dlls/wininet/current/wininet_Nl.rc Added: vendor/wine/dlls/wininet/current/wininet_No.rc Added: vendor/wine/dlls/wininet/current/wininet_Pt.rc Added: vendor/wine/dlls/wininet/current/wininet_Ru.rc Added: vendor/wine/dlls/wininet/current/wininet_Si.rc Added: vendor/wine/dlls/wininet/current/wininet_main.c _____ Added: vendor/wine/dlls/wininet/current/Makefile.in --- vendor/wine/dlls/wininet/current/Makefile.in 2006-01-15 21:59:39 UTC (rev 20906) +++ vendor/wine/dlls/wininet/current/Makefile.in 2006-01-15 22:20:27 UTC (rev 20907) @@ -0,0 +1,31 @@ +EXTRADEFS = -D_WINX32_ +TOPSRCDIR = @top_srcdir@ +TOPOBJDIR = ../.. +SRCDIR = @srcdir@ +VPATH = @srcdir@ +MODULE = wininet.dll +IMPORTLIB = libwininet.$(IMPLIBEXT) +IMPORTS = mpr shlwapi shell32 user32 advapi32 kernel32 ntdll +EXTRALIBS = $(LIBUNICODE) @SOCKETLIBS@ + +C_SRCS = \ + cookie.c \ + dialogs.c \ + ftp.c \ + gopher.c \ + http.c \ + internet.c \ + netconnection.c \ + urlcache.c \ + utility.c \ + wininet_main.c + +RC_SRCS = \ + rsrc.rc \ + version.rc + +SUBDIRS = tests + +@MAKE_DLL_RULES@ + +### Dependencies: Property changes on: vendor/wine/dlls/wininet/current/Makefile.in ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native _____ Added: vendor/wine/dlls/wininet/current/cookie.c --- vendor/wine/dlls/wininet/current/cookie.c 2006-01-15 21:59:39 UTC (rev 20906) +++ vendor/wine/dlls/wininet/current/cookie.c 2006-01-15 22:20:27 UTC (rev 20907) @@ -0,0 +1,501 @@ +/* + * Wininet - cookie handling stuff + * + * Copyright 2002 TransGaming Technologies Inc. + * + * David Hammerton + * + * 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 "wine/port.h" + +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif + +#include "windef.h" +#include "winbase.h" +#include "wininet.h" +#include "winerror.h" + +#include "wine/debug.h" +#include "internet.h" + +#include "wine/list.h" + +#define RESPONSE_TIMEOUT 30 /* FROM internet.c */ + + +WINE_DEFAULT_DEBUG_CHANNEL(wininet); + +/* FIXME + * Cookies are currently memory only. + * Cookies are NOT THREAD SAFE + * Cookies could use A LOT OF MEMORY. We need some kind of memory management here! + * Cookies should care about the expiry time + */ + +typedef struct _cookie_domain cookie_domain; +typedef struct _cookie cookie; + +struct _cookie +{ + struct list entry; + + struct _cookie_domain *parent; + + LPWSTR lpCookieName; + LPWSTR lpCookieData; + time_t expiry; /* FIXME: not used */ +}; + +struct _cookie_domain +{ + struct list entry; + + LPWSTR lpCookieDomain; + LPWSTR lpCookiePath; + struct list cookie_list; +}; + +static struct list domain_list = LIST_INIT(domain_list); + +static cookie *COOKIE_addCookie(cookie_domain *domain, LPCWSTR name, LPCWSTR data); +static cookie *COOKIE_findCookie(cookie_domain *domain, LPCWSTR lpszCookieName); +static void COOKIE_deleteCookie(cookie *deadCookie, BOOL deleteDomain); +static cookie_domain *COOKIE_addDomain(LPCWSTR domain, LPCWSTR path); +static void COOKIE_deleteDomain(cookie_domain *deadDomain); + + +/* adds a cookie to the domain */ +static cookie *COOKIE_addCookie(cookie_domain *domain, LPCWSTR name, LPCWSTR data) +{ + cookie *newCookie = HeapAlloc(GetProcessHeap(), 0, sizeof(cookie)); + + list_init(&newCookie->entry); + newCookie->lpCookieName = NULL; + newCookie->lpCookieData = NULL; + + if (name) + { + newCookie->lpCookieName = HeapAlloc(GetProcessHeap(), 0, (strlenW(name) + 1)*sizeof(WCHAR)); + lstrcpyW(newCookie->lpCookieName, name); + } + if (data) + { + newCookie->lpCookieData = HeapAlloc(GetProcessHeap(), 0, (strlenW(data) + 1)*sizeof(WCHAR)); + lstrcpyW(newCookie->lpCookieData, data); + } + + TRACE("added cookie %p (data is %s)\n", newCookie, debugstr_w(data) ); + + list_add_tail(&domain->cookie_list, &newCookie->entry); + newCookie->parent = domain; + return newCookie; +} + + +/* finds a cookie in the domain matching the cookie name */ +static cookie *COOKIE_findCookie(cookie_domain *domain, LPCWSTR lpszCookieName) +{ + struct list * cursor; + TRACE("(%p, %s)\n", domain, debugstr_w(lpszCookieName)); + + LIST_FOR_EACH(cursor, &domain->cookie_list) + { + cookie *searchCookie = LIST_ENTRY(cursor, cookie, entry); + BOOL candidate = TRUE; + if (candidate && lpszCookieName) + { + if (candidate && !searchCookie->lpCookieName) + candidate = FALSE; + if (candidate && strcmpW(lpszCookieName, searchCookie->lpCookieName) != 0) + candidate = FALSE; + } + if (candidate) + return searchCookie; + } + return NULL; +} + +/* removes a cookie from the list, if its the last cookie we also remove the domain */ +static void COOKIE_deleteCookie(cookie *deadCookie, BOOL deleteDomain) +{ + HeapFree(GetProcessHeap(), 0, deadCookie->lpCookieName); + HeapFree(GetProcessHeap(), 0, deadCookie->lpCookieData); + list_remove(&deadCookie->entry); + + /* special case: last cookie, lets remove the domain to save memory */ + if (list_empty(&deadCookie->parent->cookie_list) && deleteDomain) + COOKIE_deleteDomain(deadCookie->parent); + HeapFree(GetProcessHeap(), 0, deadCookie); +} + +/* allocates a domain and adds it to the end */ +static cookie_domain *COOKIE_addDomain(LPCWSTR domain, LPCWSTR path) +{ + cookie_domain *newDomain = HeapAlloc(GetProcessHeap(), 0, sizeof(cookie_domain)); + + list_init(&newDomain->entry); + list_init(&newDomain->cookie_list); + newDomain->lpCookieDomain = NULL; + newDomain->lpCookiePath = NULL; + + if (domain) + { + newDomain->lpCookieDomain = HeapAlloc(GetProcessHeap(), 0, (strlenW(domain) + 1)*sizeof(WCHAR)); + strcpyW(newDomain->lpCookieDomain, domain); + } + if (path) + { + newDomain->lpCookiePath = HeapAlloc(GetProcessHeap(), 0, (strlenW(path) + 1)*sizeof(WCHAR)); + lstrcpyW(newDomain->lpCookiePath, path); + } + + list_add_tail(&domain_list, &newDomain->entry); + + TRACE("Adding domain: %p\n", newDomain); + return newDomain; +} + +static void COOKIE_crackUrlSimple(LPCWSTR lpszUrl, LPWSTR hostName, int hostNameLen, LPWSTR path, int pathLen) +{ + URL_COMPONENTSW UrlComponents; + + UrlComponents.lpszExtraInfo = NULL; + UrlComponents.lpszPassword = NULL; + UrlComponents.lpszScheme = NULL; + UrlComponents.lpszUrlPath = path; + UrlComponents.lpszUserName = NULL; + UrlComponents.lpszHostName = hostName; + UrlComponents.dwHostNameLength = hostNameLen; + UrlComponents.dwUrlPathLength = pathLen; + + InternetCrackUrlW(lpszUrl, 0, 0, &UrlComponents); +} + +/* match a domain. domain must match if the domain is not NULL. path must match if the path is not NULL */ +static BOOL COOKIE_matchDomain(LPCWSTR lpszCookieDomain, LPCWSTR lpszCookiePath, + cookie_domain *searchDomain, BOOL allow_partial) +{ + TRACE("searching on domain %p\n", searchDomain); + if (lpszCookieDomain) + { + if (!searchDomain->lpCookieDomain) + return FALSE; + + TRACE("comparing domain %s with %s\n", + debugstr_w(lpszCookieDomain), + debugstr_w(searchDomain->lpCookieDomain)); + + if (allow_partial && !strstrW(lpszCookieDomain, searchDomain->lpCookieDomain)) + return FALSE; + else if (!allow_partial && lstrcmpW(lpszCookieDomain, searchDomain->lpCookieDomain) != 0) + return FALSE; + } + if (lpszCookiePath) + { + TRACE("comparing paths: %s with %s\n", debugstr_w(lpszCookiePath), debugstr_w(searchDomain->lpCookiePath)); + if (!searchDomain->lpCookiePath) + return FALSE; + if (strcmpW(lpszCookiePath, searchDomain->lpCookiePath)) + return FALSE; + } + return TRUE; +} + +/* remove a domain from the list and delete it */ +static void COOKIE_deleteDomain(cookie_domain *deadDomain) +{ + struct list * cursor; + while ((cursor = list_tail(&deadDomain->cookie_list))) + { + COOKIE_deleteCookie(LIST_ENTRY(cursor, cookie, entry), FALSE); + list_remove(cursor); + } + + HeapFree(GetProcessHeap(), 0, deadDomain->lpCookieDomain); + HeapFree(GetProcessHeap(), 0, deadDomain->lpCookiePath); + + list_remove(&deadDomain->entry); + + HeapFree(GetProcessHeap(), 0, deadDomain); +} + +/********************************************************************** * + * InternetGetCookieW (WININET.@) + * + * Retrieve cookie from the specified url + * + * It should be noted that on windows the lpszCookieName parameter is "not implemented". + * So it won't be implemented here. + * + * RETURNS + * TRUE on success + * FALSE on failure + * + */ +BOOL WINAPI InternetGetCookieW(LPCWSTR lpszUrl, LPCWSTR lpszCookieName, + LPWSTR lpCookieData, LPDWORD lpdwSize) +{ + struct list * cursor; + int cnt = 0, domain_count = 0; + int cookie_count = 0; + WCHAR hostName[2048], path[2048]; + + TRACE("(%s, %s, %p, %p)\n", debugstr_w(lpszUrl),debugstr_w(lpszCookieName), + lpCookieData, lpdwSize); + + COOKIE_crackUrlSimple(lpszUrl, hostName, sizeof(hostName)/sizeof(hostName[0]), path, sizeof(path)/sizeof(path[0])); + + LIST_FOR_EACH(cursor, &domain_list) + { + cookie_domain *cookiesDomain = LIST_ENTRY(cursor, cookie_domain, entry); + if (COOKIE_matchDomain(hostName, NULL /* FIXME: path */, cookiesDomain, TRUE)) + { + struct list * cursor; + domain_count++; + TRACE("found domain %p\n", cookiesDomain); + + LIST_FOR_EACH(cursor, &cookiesDomain->cookie_list) + { + cookie *thisCookie = LIST_ENTRY(cursor, cookie, entry); + if (lpCookieData == NULL) /* return the size of the buffer required to lpdwSize */ + { + if (cookie_count != 0) + cnt += 2; /* '; ' */ + cnt += strlenW(thisCookie->lpCookieName); + cnt += 1; /* = */ + cnt += strlenW(thisCookie->lpCookieData); + } + else + { + static const WCHAR szsc[] = { ';',' ',0 }; + static const WCHAR szpseq[] = { '%','s','=','%','s',0 }; + if (cookie_count != 0) + cnt += snprintfW(lpCookieData + cnt, *lpdwSize - cnt, szsc); + cnt += snprintfW(lpCookieData + cnt, *lpdwSize - cnt, szpseq, + thisCookie->lpCookieName, + thisCookie->lpCookieData); + TRACE("Cookie: %s=%s\n", debugstr_w(thisCookie->lpCookieName), debugstr_w(thisCookie->lpCookieData)); + } + cookie_count++; + } + } + } + if (lpCookieData == NULL) + { + cnt += 1; /* NULL */ + *lpdwSize = cnt*sizeof(WCHAR); + TRACE("returning\n"); + return TRUE; + } + + if (!domain_count) + return FALSE; + + *lpdwSize = (cnt + 1)*sizeof(WCHAR); + + TRACE("Returning %i (from %i domains): %s\n", cnt, domain_count, + debugstr_w(lpCookieData)); + + return (cnt ? TRUE : FALSE); +} + + +/********************************************************************** * + * InternetGetCookieA (WININET.@) + * + * Retrieve cookie from the specified url + * + * RETURNS + * TRUE on success + * FALSE on failure + * + */ +BOOL WINAPI InternetGetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName, + LPSTR lpCookieData, LPDWORD lpdwSize) +{ + DWORD len; + LPWSTR szCookieData = NULL, szUrl = NULL, szCookieName = NULL; + BOOL r; + + TRACE("(%s,%s,%p)\n", debugstr_a(lpszUrl), debugstr_a(lpszCookieName), + lpCookieData); + + if( lpszUrl ) + { + len = MultiByteToWideChar( CP_ACP, 0, lpszUrl, -1, NULL, 0 ); + szUrl = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ); + MultiByteToWideChar( CP_ACP, 0, lpszUrl, -1, szUrl, len ); + } + + if( lpszCookieName ) + { + len = MultiByteToWideChar( CP_ACP, 0, lpszCookieName, -1, NULL, 0 ); + szCookieName = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ); + MultiByteToWideChar( CP_ACP, 0, lpszCookieName, -1, szCookieName, len ); + } + + r = InternetGetCookieW( szUrl, szCookieName, NULL, &len ); + if( r ) + { + szCookieData = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ); + if( !szCookieData ) + return FALSE; + + r = InternetGetCookieW( szUrl, szCookieName, szCookieData, &len ); + + *lpdwSize = WideCharToMultiByte( CP_ACP, 0, szCookieData, len, + lpCookieData, *lpdwSize, NULL, NULL ); + } + + HeapFree( GetProcessHeap(), 0, szCookieData ); + HeapFree( GetProcessHeap(), 0, szCookieName ); + HeapFree( GetProcessHeap(), 0, szUrl ); + + return r; +} + + +/********************************************************************** * + * InternetSetCookieW (WININET.@) + * + * Sets cookie for the specified url + * + * RETURNS + * TRUE on success + * FALSE on failure + * + */ +BOOL WINAPI InternetSetCookieW(LPCWSTR lpszUrl, LPCWSTR lpszCookieName, + LPCWSTR lpCookieData) +{ + cookie_domain *thisCookieDomain = NULL; + cookie *thisCookie; + WCHAR hostName[2048], path[2048]; + struct list * cursor; + + TRACE("(%s,%s,%s)\n", debugstr_w(lpszUrl), + debugstr_w(lpszCookieName), debugstr_w(lpCookieData)); + + if (!lpCookieData || !strlenW(lpCookieData)) + { + TRACE("no cookie data, not adding\n"); + return FALSE; + } + if (!lpszCookieName) + { + /* some apps (or is it us??) try to add a cookie with no cookie name, but + * the cookie data in the form of name=data. */ + /* FIXME, probably a bug here, for now I don't care */ + WCHAR *ourCookieName, *ourCookieData; + int ourCookieNameSize; + BOOL ret; + + if (!(ourCookieData = strchrW(lpCookieData, '='))) + { + TRACE("something terribly wrong with cookie data %s\n", + debugstr_w(ourCookieData)); + return FALSE; + } + ourCookieNameSize = ourCookieData - lpCookieData; + ourCookieData += 1; + ourCookieName = HeapAlloc(GetProcessHeap(), 0, + (ourCookieNameSize + 1)*sizeof(WCHAR)); + memcpy(ourCookieName, ourCookieData, ourCookieNameSize * sizeof(WCHAR)); + ourCookieName[ourCookieNameSize] = '\0'; + TRACE("setting (hacked) cookie of %s, %s\n", + debugstr_w(ourCookieName), debugstr_w(ourCookieData)); + ret = InternetSetCookieW(lpszUrl, ourCookieName, ourCookieData); + HeapFree(GetProcessHeap(), 0, ourCookieName); + return ret; + } + + COOKIE_crackUrlSimple(lpszUrl, hostName, sizeof(hostName)/sizeof(hostName[0]), path, sizeof(path)/sizeof(path[0])); + + LIST_FOR_EACH(cursor, &domain_list) + { + thisCookieDomain = LIST_ENTRY(cursor, cookie_domain, entry); + if (COOKIE_matchDomain(hostName, NULL /* FIXME: path */, thisCookieDomain, FALSE)) + break; + thisCookieDomain = NULL; + } + if (!thisCookieDomain) + thisCookieDomain = COOKIE_addDomain(hostName, path); + + if ((thisCookie = COOKIE_findCookie(thisCookieDomain, lpszCookieName))) + COOKIE_deleteCookie(thisCookie, FALSE); + + thisCookie = COOKIE_addCookie(thisCookieDomain, lpszCookieName, lpCookieData); + return TRUE; +} + + +/********************************************************************** * + * InternetSetCookieA (WININET.@) + * + * Sets cookie for the specified url + * + * RETURNS + * TRUE on success + * FALSE on failure + * + */ +BOOL WINAPI InternetSetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName, + LPCSTR lpCookieData) +{ + DWORD len; + LPWSTR szCookieData = NULL, szUrl = NULL, szCookieName = NULL; + BOOL r; + + TRACE("(%s,%s,%s)\n", debugstr_a(lpszUrl), + debugstr_a(lpszCookieName), debugstr_a(lpCookieData)); + + if( lpszUrl ) + { + len = MultiByteToWideChar( CP_ACP, 0, lpszUrl, -1, NULL, 0 ); + szUrl = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ); + MultiByteToWideChar( CP_ACP, 0, lpszUrl, -1, szUrl, len ); + } + + if( lpszCookieName ) + { + len = MultiByteToWideChar( CP_ACP, 0, lpszCookieName, -1, NULL, 0 ); + szCookieName = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ); + MultiByteToWideChar( CP_ACP, 0, lpszCookieName, -1, szCookieName, len ); + } + + if( lpCookieData ) + { + len = MultiByteToWideChar( CP_ACP, 0, lpCookieData, -1, NULL, 0 ); + szCookieData = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ); + MultiByteToWideChar( CP_ACP, 0, lpCookieData, -1, szCookieData, len ); + } + + r = InternetSetCookieW( szUrl, szCookieName, szCookieData ); + + HeapFree( GetProcessHeap(), 0, szCookieData ); + HeapFree( GetProcessHeap(), 0, szCookieName ); + HeapFree( GetProcessHeap(), 0, szUrl ); + + return r; +} Property changes on: vendor/wine/dlls/wininet/current/cookie.c ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native _____ Added: vendor/wine/dlls/wininet/current/dialogs.c --- vendor/wine/dlls/wininet/current/dialogs.c 2006-01-15 21:59:39 UTC (rev 20906) +++ vendor/wine/dlls/wininet/current/dialogs.c 2006-01-15 22:20:27 UTC (rev 20907) @@ -0,0 +1,384 @@ +/* + * Wininet + * + * Copyright 2003 Mike McCormack for CodeWeavers Inc. + * + * 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 "wine/port.h" + +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "winreg.h" +#include "wininet.h" +#include "winnetwk.h" +#include "winnls.h" +#include "wine/debug.h" +#include "winerror.h" +#define NO_SHLWAPI_STREAM +#include "shlwapi.h" + +#include "internet.h" + +#include "wine/unicode.h" + +#include "resource.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wininet); + +struct WININET_ErrorDlgParams +{ + HWND hWnd; + HINTERNET hRequest; + DWORD dwError; + DWORD dwFlags; + LPVOID* lppvData; +}; + +/********************************************************************** * + * WININET_GetProxyServer + * + * Determine the name of the proxy server the request is using + */ +static BOOL WININET_GetProxyServer( HINTERNET hRequest, LPWSTR szBuf, DWORD sz ) +{ + LPWININETHTTPREQW lpwhr; + LPWININETHTTPSESSIONW lpwhs = NULL; + LPWININETAPPINFOW hIC = NULL; + LPWSTR p; + + lpwhr = (LPWININETHTTPREQW) WININET_GetObject( hRequest ); + if (NULL == lpwhr) + return FALSE; + + lpwhs = (LPWININETHTTPSESSIONW) lpwhr->hdr.lpwhparent; + if (NULL == lpwhs) + return FALSE; + + hIC = (LPWININETAPPINFOW) lpwhs->hdr.lpwhparent; + if (NULL == hIC) + return FALSE; + + lstrcpynW(szBuf, hIC->lpszProxy, sz); + + /* FIXME: perhaps it would be better to use InternetCrackUrl here */ + p = strchrW(szBuf, ':'); + if(*p) + *p = 0; + + return TRUE; +} + +/********************************************************************** * + * WININET_GetAuthRealm + * + * Determine the name of the (basic) Authentication realm + */ +static BOOL WININET_GetAuthRealm( HINTERNET hRequest, LPWSTR szBuf, DWORD sz ) +{ + LPWSTR p, q; + DWORD index; + static const WCHAR szRealm[] = { 'r','e','a','l','m','=',0 }; + + /* extract the Realm from the proxy response and show it */ + index = 0; + if( !HttpQueryInfoW( hRequest, HTTP_QUERY_PROXY_AUTHENTICATE, + szBuf, &sz, &index) ) + return FALSE; + + /* + * FIXME: maybe we should check that we're + * dealing with 'Basic' Authentication + */ + p = strchrW( szBuf, ' ' ); + if( p && !strncmpW( p+1, szRealm, strlenW(szRealm) ) ) + { + /* remove quotes */ + p += 7; + if( *p == '"' ) + { + p++; + q = strrchrW( p, '"' ); + if( q ) + *q = 0; + } + } + + strcpyW( szBuf, p ); + + return TRUE; +} + +/********************************************************************** * + * WININET_GetSetPassword + */ +static BOOL WININET_GetSetPassword( HWND hdlg, LPCWSTR szServer, + LPCWSTR szRealm, BOOL bSet ) +{ + WCHAR szResource[0x80], szUserPass[0x40]; + LPWSTR p; + HWND hUserItem, hPassItem; + DWORD r, dwMagic = 19; + UINT r_len, u_len; + WORD sz; + static const WCHAR szColon[] = { ':',0 }; + static const WCHAR szbs[] = { '/', 0 }; + + hUserItem = GetDlgItem( hdlg, IDC_USERNAME ); + hPassItem = GetDlgItem( hdlg, IDC_PASSWORD ); + + /* now try fetch the username and password */ + lstrcpyW( szResource, szServer); + lstrcatW( szResource, szbs); + lstrcatW( szResource, szRealm); + + /* + * WNetCachePassword is only concerned with the length + * of the data stored (which we tell it) and it does + * not use strlen() internally so we can add WCHAR data + * instead of ASCII data and get it back the same way. + */ + if( bSet ) + { + szUserPass[0] = 0; + GetWindowTextW( hUserItem, szUserPass, + (sizeof szUserPass-1)/sizeof(WCHAR) ); + lstrcatW(szUserPass, szColon); + u_len = strlenW( szUserPass ); + GetWindowTextW( hPassItem, szUserPass+u_len, + (sizeof szUserPass)/sizeof(WCHAR)-u_len ); + + r_len = (strlenW( szResource ) + 1)*sizeof(WCHAR); + u_len = (strlenW( szUserPass ) + 1)*sizeof(WCHAR); + r = WNetCachePassword( (CHAR*)szResource, r_len, + (CHAR*)szUserPass, u_len, dwMagic, 0 ); + + return ( r == WN_SUCCESS ); + } + + sz = sizeof szUserPass; + r_len = (strlenW( szResource ) + 1)*sizeof(WCHAR); + r = WNetGetCachedPassword( (CHAR*)szResource, r_len, + (CHAR*)szUserPass, &sz, dwMagic ); + if( r != WN_SUCCESS ) + return FALSE; + + p = strchrW( szUserPass, ':' ); + if( p ) + { + *p = 0; + SetWindowTextW( hUserItem, szUserPass ); + SetWindowTextW( hPassItem, p+1 ); + } + + return TRUE; +} + +/********************************************************************** * + * WININET_SetProxyAuthorization + */ +static BOOL WININET_SetProxyAuthorization( HINTERNET hRequest, + LPWSTR username, LPWSTR password ) +{ + LPWININETHTTPREQW lpwhr; + LPWININETHTTPSESSIONW lpwhs; + LPWININETAPPINFOW hIC; + LPWSTR p; + + lpwhr = (LPWININETHTTPREQW) WININET_GetObject( hRequest ); + if( !lpwhr ) + return FALSE; + + lpwhs = (LPWININETHTTPSESSIONW) lpwhr->hdr.lpwhparent; + if (NULL == lpwhs || lpwhs->hdr.htype != WH_HHTTPSESSION) + { + INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE); + return FALSE; + } + + hIC = (LPWININETAPPINFOW) lpwhs->hdr.lpwhparent; + + p = HeapAlloc( GetProcessHeap(), 0, (strlenW( username ) + 1)*sizeof(WCHAR) ); + if( !p ) + return FALSE; + + lstrcpyW( p, username ); + hIC->lpszProxyUsername = p; + + p = HeapAlloc( GetProcessHeap(), 0, (strlenW( password ) + 1)*sizeof(WCHAR) ); + if( !p ) + return FALSE; + + lstrcpyW( p, password ); + hIC->lpszProxyPassword = p; + + return TRUE; +} + +/********************************************************************** * + * WININET_ProxyPasswordDialog + */ +static INT_PTR WINAPI WININET_ProxyPasswordDialog( + HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam ) +{ + HWND hitem; + struct WININET_ErrorDlgParams *params; + WCHAR szRealm[0x80], szServer[0x80]; + + if( uMsg == WM_INITDIALOG ) + { + TRACE("WM_INITDIALOG (%08lx)\n", lParam); + + /* save the parameter list */ + params = (struct WININET_ErrorDlgParams*) lParam; + SetWindowLongPtrW( hdlg, GWLP_USERDATA, lParam ); + + /* extract the Realm from the proxy response and show it */ + if( WININET_GetAuthRealm( params->hRequest, + szRealm, sizeof szRealm/sizeof(WCHAR)) ) + { + hitem = GetDlgItem( hdlg, IDC_REALM ); + SetWindowTextW( hitem, szRealm ); + } + + /* extract the name of the proxy server */ + if( WININET_GetProxyServer( params->hRequest, + szServer, sizeof szServer/sizeof(WCHAR)) ) + { + hitem = GetDlgItem( hdlg, IDC_PROXY ); + SetWindowTextW( hitem, szServer ); + } + + WININET_GetSetPassword( hdlg, szServer, szRealm, FALSE ); + + return TRUE; + } + + params = (struct WININET_ErrorDlgParams*) + GetWindowLongPtrW( hdlg, GWLP_USERDATA ); + + switch( uMsg ) + { + case WM_COMMAND: + if( wParam == IDOK ) + { + WCHAR username[0x20], password[0x20]; + + username[0] = 0; + hitem = GetDlgItem( hdlg, IDC_USERNAME ); + if( hitem ) + GetWindowTextW( hitem, username, sizeof username/sizeof(WCHAR) ); + + password[0] = 0; + hitem = GetDlgItem( hdlg, IDC_PASSWORD ); + if( hitem ) + GetWindowTextW( hitem, password, sizeof password/sizeof(WCHAR) ); + + hitem = GetDlgItem( hdlg, IDC_SAVEPASSWORD ); + if( hitem && + SendMessageW( hitem, BM_GETSTATE, 0, 0 ) && + WININET_GetAuthRealm( params->hRequest, + szRealm, sizeof szRealm/sizeof(WCHAR)) && + WININET_GetProxyServer( params->hRequest, + szServer, sizeof szServer/sizeof(WCHAR)) ) + { + WININET_GetSetPassword( hdlg, szServer, szRealm, TRUE ); + } + WININET_SetProxyAuthorization( params->hRequest, username, password ); + + EndDialog( hdlg, ERROR_INTERNET_FORCE_RETRY ); + return TRUE; + } + if( wParam == IDCANCEL ) + { + EndDialog( hdlg, 0 ); + return TRUE; + } + break; + } + return FALSE; +} + +/********************************************************************** * + * WININET_GetConnectionStatus + */ +static INT WININET_GetConnectionStatus( HINTERNET hRequest ) +{ + WCHAR szStatus[0x20]; + DWORD sz, index, dwStatus; + + TRACE("%p\n", hRequest ); + + sz = sizeof szStatus; + index = 0; + if( !HttpQueryInfoW( hRequest, HTTP_QUERY_STATUS_CODE, + szStatus, &sz, &index)) + return -1; + dwStatus = atoiW( szStatus ); + + TRACE("request %p status = %ld\n", hRequest, dwStatus ); + + return dwStatus; +} + + +/********************************************************************** * + * InternetErrorDlg + */ +DWORD WINAPI InternetErrorDlg(HWND hWnd, HINTERNET hRequest, + DWORD dwError, DWORD dwFlags, LPVOID* lppvData) +{ + struct WININET_ErrorDlgParams params; + HMODULE hwininet = GetModuleHandleA( "wininet.dll" ); + INT dwStatus; + + TRACE("%p %p %ld %08lx %p\n", hWnd, hRequest, dwError, dwFlags, lppvData); + + params.hWnd = hWnd; + params.hRequest = hRequest; + params.dwError = dwError; + params.dwFlags = dwFlags; + params.lppvData = lppvData; + + switch( dwError ) + { + case ERROR_SUCCESS: + if( !(dwFlags & FLAGS_ERROR_UI_FILTER_FOR_ERRORS ) ) + return 0; + dwStatus = WININET_GetConnectionStatus( hRequest ); + if( HTTP_STATUS_PROXY_AUTH_REQ != dwStatus ) + return ERROR_SUCCESS; + return DialogBoxParamW( hwininet, MAKEINTRESOURCEW( IDD_PROXYDLG ), + hWnd, WININET_ProxyPasswordDialog, (LPARAM) ¶ms ); + + case ERROR_INTERNET_INCORRECT_PASSWORD: + return DialogBoxParamW( hwininet, MAKEINTRESOURCEW( IDD_PROXYDLG ), + hWnd, WININET_ProxyPasswordDialog, (LPARAM) ¶ms ); + + case ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR: + case ERROR_INTERNET_INVALID_CA: + case ERROR_INTERNET_POST_IS_NON_SECURE: + case ERROR_INTERNET_SEC_CERT_CN_INVALID: + case ERROR_INTERNET_SEC_CERT_DATE_INVALID: + FIXME("Need to display dialog for error %ld\n", dwError); + return ERROR_SUCCESS; + } + return ERROR_INVALID_PARAMETER; +} Property changes on: vendor/wine/dlls/wininet/current/dialogs.c ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native _____ Added: vendor/wine/dlls/wininet/current/ftp.c --- vendor/wine/dlls/wininet/current/ftp.c 2006-01-15 21:59:39 UTC (rev 20906) +++ vendor/wine/dlls/wininet/current/ftp.c 2006-01-15 22:20:27 UTC (rev 20907) @@ -0,0 +1,3147 @@ +/* + * WININET - Ftp implementation + * + * Copyright 1999 Corel Corporation + * Copyright 2004 Mike McCormack for CodeWeavers + * Copyright 2004 Kevin Koltzau + * + * Ulrich Czekalla + * Noureddine Jemmali + * + * Copyright 2000 Andreas Mohr + * Copyright 2002 Jaco Greeff + * + * 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 "wine/port.h" + +#include <errno.h> +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/types.h> +#ifdef HAVE_SYS_SOCKET_H +# include <sys/socket.h> +#endif +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif +#include <time.h> +#include <assert.h> + [truncated at 1000 lines; 16091 more skipped]
18 years, 11 months
1
0
0
0
[gvg] 20906: Tag Wine 0.9.5
by gvg@svn.reactos.org
Tag Wine 0.9.5 Added: vendor/wine/dlls/wintrust/Wine-0_9_5/ _____ Copied: vendor/wine/dlls/wintrust/Wine-0_9_5 (from rev 20903, vendor/wine/dlls/wintrust/current)
18 years, 11 months
1
0
0
0
[gvg] 20905: wintrust vendor import
by gvg@svn.reactos.org
wintrust vendor import Modified: trunk/reactos/baseaddress.xml Modified: trunk/reactos/bootdata/packages/reactos.dff Modified: trunk/reactos/lib/directory.xml Added: trunk/reactos/lib/wintrust/ Added: trunk/reactos/lib/wintrust/wintrust.xml Modified: trunk/reactos/media/doc/README.WINE Added: trunk/reactos/w32api/include/mscat.h Modified: trunk/reactos/w32api/include/wincrypt.h Added: trunk/reactos/w32api/include/wintrust.h _____ Modified: trunk/reactos/baseaddress.xml --- trunk/reactos/baseaddress.xml 2006-01-15 21:54:47 UTC (rev 20904) +++ trunk/reactos/baseaddress.xml 2006-01-15 21:58:59 UTC (rev 20905) @@ -85,6 +85,7 @@ <property name="BASEADDRESS_SHFOLDER" value="0x76780000" /> <property name="BASEADDRESS_NTMARTA" value="0x768A0000" /> <property name="BASEADDRESS_GDIPLUS" value="0x76a00000" /> +<property name="BASEADDRESS_WINTRUST" value="0x76c30000" /> <property name="BASEADDRESS_IMAGEHLP" value="0x76c90000" /> <property name="BASEADDRESS_FMIFS" value="0x76df0000" /> <property name="BASEADDRESS_SHELL32" value="0x77260000" /> _____ Modified: trunk/reactos/bootdata/packages/reactos.dff --- trunk/reactos/bootdata/packages/reactos.dff 2006-01-15 21:54:47 UTC (rev 20904) +++ trunk/reactos/bootdata/packages/reactos.dff 2006-01-15 21:58:59 UTC (rev 20905) @@ -167,9 +167,10 @@ lib\userenv\userenv.dll 1 lib\uxtheme\uxtheme.dll 1 lib\version\version.dll 1 -lib\winspool\winspool.drv 1 lib\wininet\wininet.dll 1 lib\winmm\winmm.dll 1 +lib\winspool\winspool.drv 1 +lib\wintrust\wintrust.dll 1 lib\ws2_32\ws2_32.dll 1 lib\ws2help\ws2help.dll 1 lib\wshirda\wshirda.dll 1 _____ Modified: trunk/reactos/lib/directory.xml --- trunk/reactos/lib/directory.xml 2006-01-15 21:54:47 UTC (rev 20904) +++ trunk/reactos/lib/directory.xml 2006-01-15 21:58:59 UTC (rev 20905) @@ -338,6 +338,9 @@ <directory name="winspool"> <xi:include href="winspool/winspool.xml" /> </directory> +<directory name="wintrust"> + <xi:include href="wintrust/wintrust.xml" /> +</directory> <directory name="ws2_32"> <xi:include href="ws2_32/ws2_32.xml" /> </directory> _____ Copied: trunk/reactos/lib/wintrust (from rev 20904, vendor/wine/dlls/wintrust/current) Property changes on: trunk/reactos/lib/wintrust ___________________________________________________________________ Name: svn:ignore + GNUmakefile _____ Added: trunk/reactos/lib/wintrust/wintrust.xml --- vendor/wine/dlls/wintrust/current/wintrust.xml 2006-01-15 21:54:47 UTC (rev 20904) +++ trunk/reactos/lib/wintrust/wintrust.xml 2006-01-15 21:58:59 UTC (rev 20905) @@ -0,0 +1,12 @@ +<module name="wintrust" type="win32dll" baseaddress="${BASEADDRESS_WINTRUST}" installbase="system32" installname="wintrust.dll"> + <autoregister infsection="OleControlDlls" type="DllRegisterServer" /> + <importlibrary definition="wintrust.spec.def" /> + <include base="wintrust">.</include> + <include base="ReactOS">include/wine</include> + <define name="__USE_W32API" /> + <library>wine</library> + <library>ntdll</library> + <file>wintrust_main.c</file> + <file>version.rc</file> + <file>wintrust.spec</file> +</module> Property changes on: trunk/reactos/lib/wintrust/wintrust.xml ___________________________________________________________________ Name: svn:eol-style + native _____ Modified: trunk/reactos/media/doc/README.WINE --- trunk/reactos/media/doc/README.WINE 2006-01-15 21:54:47 UTC (rev 20904) +++ trunk/reactos/media/doc/README.WINE 2006-01-15 21:58:59 UTC (rev 20905) @@ -79,6 +79,7 @@ reactos/lib/uxtheme # Synced to Wine-0_9_5 reactos/lib/version # Out of sync reactos/lib/wininet # Out of sync +reactos/lib/wintrust # Synced to Wine-0_9_5 reactos/lib/winmm # Forked at Wine-20050628 reactos/lib/winmm/midimap # Forked at Wine-20050628 reactos/lib/winmm/wavemap # Forked at Wine-20050628 _____ Added: trunk/reactos/w32api/include/mscat.h --- trunk/reactos/w32api/include/mscat.h 2006-01-15 21:54:47 UTC (rev 20904) +++ trunk/reactos/w32api/include/mscat.h 2006-01-15 21:58:59 UTC (rev 20905) @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2004 Francois Gouget + * + * 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 + */ + +#ifndef __WINE_MSCAT_H +#define __WINE_MSCAT_H + +typedef HANDLE HCATADMIN; + + +#ifdef __cplusplus +extern "C" { +#endif + +BOOL WINAPI CryptCATAdminAcquireContext(HCATADMIN*,const GUID*,DWORD); +BOOL WINAPI CryptCATAdminCalcHashFromFileHandle(HANDLE,DWORD*,BYTE*,DWORD); +BOOL WINAPI CryptCATAdminReleaseContext(HCATADMIN,DWORD); + +#ifdef __cplusplus +} +#endif + +#endif Property changes on: trunk/reactos/w32api/include/mscat.h ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native _____ Modified: trunk/reactos/w32api/include/wincrypt.h --- trunk/reactos/w32api/include/wincrypt.h 2006-01-15 21:54:47 UTC (rev 20904) +++ trunk/reactos/w32api/include/wincrypt.h 2006-01-15 21:58:59 UTC (rev 20905) @@ -1482,6 +1482,21 @@ DWORD cValue; PCRYPT_ATTR_BLOB rgValue; } CRYPT_ATTRIBUTE, *PCRYPT_ATTRIBUTE; +typedef struct _CRYPT_ATTRIBUTES { + DWORD cAttr; + PCRYPT_ATTRIBUTE rgAttr; +} CRYPT_ATTRIBUTES, *PCRYPT_ATTRIBUTES; + +typedef struct _CMSG_SIGNER_INFO { + DWORD dwVersion; + CERT_NAME_BLOB Issuer; + CRYPT_INTEGER_BLOB SerialNumber; + CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm; + CRYPT_ALGORITHM_IDENTIFIER HashEncryptionAlgorithm; + CRYPT_DATA_BLOB EncryptedHash; + CRYPT_ATTRIBUTES AuthAttrs; + CRYPT_ATTRIBUTES UnauthAttrs; +} CMSG_SIGNER_INFO, *PCMSG_SIGNER_INFO; typedef struct _CTL_ENTRY { CRYPT_DATA_BLOB SubjectIdentifier; DWORD cAttribute; _____ Added: trunk/reactos/w32api/include/wintrust.h --- trunk/reactos/w32api/include/wintrust.h 2006-01-15 21:54:47 UTC (rev 20904) +++ trunk/reactos/w32api/include/wintrust.h 2006-01-15 21:58:59 UTC (rev 20905) @@ -0,0 +1,139 @@ +/* + * Copyright (C) 2004 Francois Gouget + * + * 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 + */ + +#ifndef __WINE_WINTRUST_H +#define __WINE_WINTRUST_H + +#include <wincrypt.h> + + +#include <pshpack8.h> + +typedef struct WINTRUST_FILE_INFO_ +{ + DWORD cbStruct; + LPCWSTR pcwszFilePath; + HANDLE hFile; + GUID* pgKnownSubject; +} WINTRUST_FILE_INFO, *PWINTRUST_FILE_INFO; + +typedef struct WINTRUST_CATALOG_INFO_ +{ + DWORD cbStruct; + DWORD dwCatalogVersion; + LPCWSTR pcwszCatalogFilePath; + LPCWSTR pcwszMemberTag; + LPCWSTR pcwszMemberFilePath; + HANDLE hMemberFile; + BYTE* pbCalculatedFileHash; + DWORD cbCalculatedFileHash; + PCCTL_CONTEXT pcCatalogContext; +} WINTRUST_CATALOG_INFO, *PWINTRUST_CATALOG_INFO; + +typedef struct WINTRUST_BLOB_INFO_ +{ + DWORD cbStruct; + GUID gSubject; + LPCWSTR pcwszDisplayName; + DWORD cbMemObject; + BYTE* pbMemObject; + DWORD cbMemSignedMsg; + BYTE* pbMemSignedMsg; +} WINTRUST_BLOB_INFO, *PWINTRUST_BLOB_INFO; + +typedef struct WINTRUST_SGNR_INFO_ +{ + DWORD cbStruct; + LPCWSTR pcwszDisplayName; + CMSG_SIGNER_INFO* psSignerInfo; + DWORD chStores; + HCERTSTORE* pahStores; +} WINTRUST_SGNR_INFO, *PWINTRUST_SGNR_INFO; + +typedef struct WINTRUST_CERT_INFO_ +{ + DWORD cbStruct; + LPCWSTR pcwszDisplayName; + CERT_CONTEXT* psCertContext; + DWORD chStores; + HCERTSTORE* pahStores; + DWORD dwFlags; + FILETIME* psftVerifyAsOf; +} WINTRUST_CERT_INFO, *PWINTRUST_CERT_INFO; + + +typedef struct _WINTRUST_DATA +{ + DWORD cbStruct; + LPVOID pPolicyCallbackData; + LPVOID pSIPClientData; + DWORD dwUIChoice; + DWORD fdwRevocationChecks; + DWORD dwUnionChoice; + union + { + struct WINTRUST_FILE_INFO_* pFile; + struct WINTRUST_CATALOG_INFO_* pCatalog; + struct WINTRUST_BLOB_INFO_* pBlob; + struct WINTRUST_SGNR_INFO_* pSgnr; + struct WINTRUST_CERT_INFO_* pCert; + } DUMMYUNIONNAME; + + DWORD dwStateAction; + HANDLE hWVTStateData; + WCHAR* pwszURLReference; + DWORD dwProvFlags; + DWORD dwUIContext; +} WINTRUST_DATA, *PWINTRUST_DATA; + +typedef struct _CRYPT_TRUST_REG_ENTRY +{ + DWORD cbStruct; + WCHAR *pwszDLLName; + WCHAR *pwszFunctionName; +} CRYPT_TRUST_REG_ENTRY, *PCRYPT_TRUST_REG_ENTRY; + +typedef struct _CRYPT_REGISTER_ACTIONID +{ + DWORD cbStruct; + CRYPT_TRUST_REG_ENTRY sInitProvider; + CRYPT_TRUST_REG_ENTRY sObjectProvider; + CRYPT_TRUST_REG_ENTRY sSignatureProvider; + CRYPT_TRUST_REG_ENTRY sCertificateProvider; + CRYPT_TRUST_REG_ENTRY sCertificatePolicyProvider; + CRYPT_TRUST_REG_ENTRY sFinalPolicyProvider; + CRYPT_TRUST_REG_ENTRY sTestPolicyProvider; + CRYPT_TRUST_REG_ENTRY sCleanupProvider; +} CRYPT_REGISTER_ACTIONID, *PCRYPT_REGISTER_ACTIONID; + +#include <poppack.h> + + +#ifdef __cplusplus +extern "C" { +#endif + +BOOL WINAPI WintrustAddActionID(GUID*,DWORD,CRYPT_REGISTER_ACTIONID*); +void WINAPI WintrustGetRegPolicyFlags(DWORD*); +LONG WINAPI WinVerifyTrust(HWND,GUID*,WINTRUST_DATA*); + +#ifdef __cplusplus +} +#endif + +#endif Property changes on: trunk/reactos/w32api/include/wintrust.h ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native
18 years, 11 months
1
0
0
0
[gvg] 20904: Delete old (unused) wintrust version
by gvg@svn.reactos.org
Delete old (unused) wintrust version Deleted: trunk/reactos/lib/wintrust/
18 years, 11 months
1
0
0
0
← Newer
1
...
15
16
17
18
19
20
21
...
59
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Results per page:
10
25
50
100
200