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
May 2013
----- 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
16 participants
234 discussions
Start a n
N
ew thread
[ekohl] 59070: [NETAPI32] - Add stubs for missing NetGroup functions. - Update header file.
by ekohl@svn.reactos.org
Author: ekohl Date: Thu May 23 15:20:29 2013 New Revision: 59070 URL:
http://svn.reactos.org/svn/reactos?rev=59070&view=rev
Log: [NETAPI32] - Add stubs for missing NetGroup functions. - Update header file. Modified: trunk/reactos/dll/win32/netapi32/group.c trunk/reactos/dll/win32/netapi32/netapi32.spec trunk/reactos/include/psdk/lmaccess.h Modified: trunk/reactos/dll/win32/netapi32/group.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/group.c…
============================================================================== --- trunk/reactos/dll/win32/netapi32/group.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netapi32/group.c [iso-8859-1] Thu May 23 15:20:29 2013 @@ -22,12 +22,70 @@ WINE_DEFAULT_DEBUG_CHANNEL(netapi32); -/* -@ stub NetGroupAdd -@ stub NetGroupAddUser -@ stub NetGroupDel -@ stub NetGroupDelUser -*/ + +/************************************************************ + * NetGroupAdd (NETAPI32.@) + * + */ +NET_API_STATUS +WINAPI +NetGroupAdd(IN LPCWSTR servername, + IN DWORD level, + IN LPBYTE buf, + OUT LPDWORD parm_err) +{ + FIXME("(%s, %d, %p, %p) stub!\n", debugstr_w(servername), + level, buf, parm_err); + return ERROR_ACCESS_DENIED; +} + + +/************************************************************ + * NetGroupAddUser (NETAPI32.@) + * + */ +NET_API_STATUS +WINAPI +NetGroupAddUser(IN LPCWSTR servername, + IN LPCWSTR groupname, + IN LPCWSTR username) +{ + FIXME("(%s, %s, %s) stub!\n", debugstr_w(servername), + debugstr_w(groupname), debugstr_w(username)); + return ERROR_ACCESS_DENIED; +} + + +/************************************************************ + * NetGroupDel (NETAPI32.@) + * + */ +NET_API_STATUS +WINAPI +NetGroupDel(IN LPCWSTR servername, + IN LPCWSTR groupname) +{ + FIXME("(%s, %s) stub!\n", debugstr_w(servername), + debugstr_w(groupname)); + return ERROR_ACCESS_DENIED; +} + + +/************************************************************ + * NetGroupDelUser (NETAPI32.@) + * + */ +NET_API_STATUS +WINAPI +NetGroupDelUser(IN LPCWSTR servername, + IN LPCWSTR groupname, + IN LPCWSTR username) +{ + FIXME("(%s, %s, %s) stub!\n", debugstr_w(servername), + debugstr_w(groupname), debugstr_w(username)); + return ERROR_ACCESS_DENIED; +} + /************************************************************ * NetGroupEnum (NETAPI32.@) @@ -35,18 +93,19 @@ */ NET_API_STATUS WINAPI -NetGroupEnum(LPCWSTR servername, - DWORD level, - LPBYTE *bufptr, - DWORD prefmaxlen, - LPDWORD entriesread, - LPDWORD totalentries, - LPDWORD resume_handle) +NetGroupEnum(IN LPCWSTR servername, + IN DWORD level, + OUT LPBYTE *bufptr, + IN DWORD prefmaxlen, + OUT LPDWORD entriesread, + OUT LPDWORD totalentries, + IN OUT PDWORD_PTR resume_handle) { FIXME("(%s, %d, %p, %d, %p, %p, %p) stub!\n", debugstr_w(servername), level, bufptr, prefmaxlen, entriesread, totalentries, resume_handle); return ERROR_ACCESS_DENIED; } + /************************************************************ * NetGroupGetInfo (NETAPI32.@) @@ -54,17 +113,72 @@ */ NET_API_STATUS WINAPI -NetGroupGetInfo(LPCWSTR servername, - LPCWSTR groupname, - DWORD level, - LPBYTE *bufptr) +NetGroupGetInfo(IN LPCWSTR servername, + IN LPCWSTR groupname, + IN DWORD level, + OUT LPBYTE *bufptr) { - FIXME("(%s, %s, %d, %p) stub!\n", debugstr_w(servername), debugstr_w(groupname), level, bufptr); + FIXME("(%s, %s, %d, %p) stub!\n", debugstr_w(servername), + debugstr_w(groupname), level, bufptr); return ERROR_ACCESS_DENIED; } -/* -@ stub NetGroupGetUsers -@ stub NetGroupSetInfo -@ stub NetGroupSetUsers -*/ + +/************************************************************ + * NetGroupGetUsers (NETAPI32.@) + * + */ +NET_API_STATUS +WINAPI +NetGroupGetUsers(IN LPCWSTR servername, + IN LPCWSTR groupname, + IN DWORD level, + OUT LPBYTE *bufptr, + IN DWORD prefmaxlen, + OUT LPDWORD entriesread, + OUT LPDWORD totalentries, + IN OUT PDWORD_PTR resume_handle) +{ + FIXME("(%s, %s, %d, %p, %d, %p, %p, %p) stub!\n", debugstr_w(servername), + debugstr_w(groupname), level, bufptr, prefmaxlen, entriesread, + totalentries, resume_handle); + return ERROR_ACCESS_DENIED; +} + + +/************************************************************ + * NetGroupSetInfo (NETAPI32.@) + * + */ +NET_API_STATUS +WINAPI +NetGroupSetInfo(IN LPCWSTR servername, + IN LPCWSTR groupname, + IN DWORD level, + IN LPBYTE buf, + OUT LPDWORD parm_err) +{ + FIXME("(%s, %s, %d, %p, %p) stub!\n", debugstr_w(servername), + debugstr_w(groupname), level, buf, parm_err); + return ERROR_ACCESS_DENIED; +} + + +/************************************************************ + * NetGroupSetUsers (NETAPI32.@) + * + */ +NET_API_STATUS +WINAPI +NetGroupSetUsers(IN LPCWSTR servername, + IN LPCWSTR groupname, + IN DWORD level, + IN LPBYTE buf, + IN DWORD totalentries) +{ + FIXME("(%s, %s, %d, %p, %d) stub!\n", debugstr_w(servername), + debugstr_w(groupname), level, buf, totalentries); + return ERROR_ACCESS_DENIED; +} + +/* EOF */ Modified: trunk/reactos/dll/win32/netapi32/netapi32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/netapi3…
============================================================================== --- trunk/reactos/dll/win32/netapi32/netapi32.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netapi32/netapi32.spec [iso-8859-1] Thu May 23 15:20:29 2013 @@ -94,15 +94,15 @@ @ stdcall NetGetDCName(wstr wstr ptr) @ stub NetGetDisplayInformationIndex @ stdcall NetGetJoinInformation(wstr ptr ptr) -@ stub NetGroupAdd -@ stub NetGroupAddUser -@ stub NetGroupDel -@ stub NetGroupDelUser +@ stdcall NetGroupAdd(wstr long ptr ptr) +@ stdcall NetGroupAddUser(wstr wstr wstr) +@ stdcall NetGroupDel(wstr wstr) +@ stdcall NetGroupDelUser(wstr wstr wstr) @ stdcall NetGroupEnum(wstr long ptr long ptr ptr ptr) @ stdcall NetGroupGetInfo(wstr wstr long ptr) -@ stub NetGroupGetUsers -@ stub NetGroupSetInfo -@ stub NetGroupSetUsers +@ stdcall NetGroupGetUsers(wstr wstr long ptr long ptr ptr ptr) +@ stdcall NetGroupSetInfo(wstr wstr long ptr ptr) +@ stdcall NetGroupSetUsers(wstr wstr long ptr long) @ stdcall NetLocalGroupAdd(wstr long ptr ptr) @ stdcall NetLocalGroupAddMember(wstr wstr ptr) @ stdcall NetLocalGroupAddMembers(wstr wstr long ptr long) Modified: trunk/reactos/include/psdk/lmaccess.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/lmaccess.h?re…
============================================================================== --- trunk/reactos/include/psdk/lmaccess.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/lmaccess.h [iso-8859-1] Thu May 23 15:20:29 2013 @@ -614,12 +614,12 @@ NET_API_STATUS WINAPI NetUserChangePassword(LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR); NET_API_STATUS WINAPI NetGroupAdd(LPCWSTR,DWORD,PBYTE,PDWORD); NET_API_STATUS WINAPI NetGroupAddUser(LPCWSTR,LPCWSTR,LPCWSTR); -NET_API_STATUS WINAPI NetGroupEnum(LPCWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD); +NET_API_STATUS WINAPI NetGroupEnum(LPCWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD_PTR); NET_API_STATUS WINAPI NetGroupGetInfo(LPCWSTR,LPCWSTR,DWORD,PBYTE*); NET_API_STATUS WINAPI NetGroupSetInfo(LPCWSTR,LPCWSTR,DWORD,PBYTE,PDWORD); NET_API_STATUS WINAPI NetGroupDel(LPCWSTR,LPCWSTR); NET_API_STATUS WINAPI NetGroupDelUser(LPCWSTR,LPCWSTR,LPCWSTR); -NET_API_STATUS WINAPI NetGroupGetUsers(LPCWSTR,LPCWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD); +NET_API_STATUS WINAPI NetGroupGetUsers(LPCWSTR,LPCWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD_PTR); NET_API_STATUS WINAPI NetGroupSetUsers(LPCWSTR,LPCWSTR,DWORD,PBYTE,DWORD); NET_API_STATUS WINAPI NetLocalGroupAdd(LPCWSTR,DWORD,PBYTE,PDWORD); NET_API_STATUS WINAPI NetLocalGroupAddMember(LPCWSTR,LPCWSTR,PSID);
11 years, 7 months
1
0
0
0
[ekohl] 59069: [SAMSRV] Move some alias-specific code to alias.c, for later use by the setup code.
by ekohl@svn.reactos.org
Author: ekohl Date: Thu May 23 09:42:25 2013 New Revision: 59069 URL:
http://svn.reactos.org/svn/reactos?rev=59069&view=rev
Log: [SAMSRV] Move some alias-specific code to alias.c, for later use by the setup code. Modified: trunk/reactos/dll/win32/samsrv/alias.c trunk/reactos/dll/win32/samsrv/samrpc.c trunk/reactos/dll/win32/samsrv/samsrv.h Modified: trunk/reactos/dll/win32/samsrv/alias.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/alias.c?r…
============================================================================== --- trunk/reactos/dll/win32/samsrv/alias.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samsrv/alias.c [iso-8859-1] Thu May 23 09:42:25 2013 @@ -39,4 +39,191 @@ AliasObject); } + +NTSTATUS +SampAddMemberToAlias(IN PSAM_DB_OBJECT AliasObject, + IN PRPC_SID MemberId) +{ + LPWSTR MemberIdString = NULL; + HANDLE MembersKeyHandle = NULL; + HANDLE MemberKeyHandle = NULL; + ULONG MemberIdLength; + NTSTATUS Status; + + TRACE("(%p %p)\n", + AliasObject, MemberId); + + ConvertSidToStringSidW(MemberId, &MemberIdString); + TRACE("Member SID: %S\n", MemberIdString); + + MemberIdLength = RtlLengthSid(MemberId); + + Status = SampRegCreateKey(AliasObject->KeyHandle, + L"Members", + KEY_WRITE, + &MembersKeyHandle); + if (!NT_SUCCESS(Status)) + { + TRACE("SampRegCreateKey failed with status 0x%08lx\n", Status); + goto done; + } + + Status = SampRegSetValue(MembersKeyHandle, + MemberIdString, + REG_BINARY, + MemberId, + MemberIdLength); + if (!NT_SUCCESS(Status)) + { + TRACE("SampRegSetValue failed with status 0x%08lx\n", Status); + goto done; + } + + Status = SampRegCreateKey(AliasObject->MembersKeyHandle, + MemberIdString, + KEY_WRITE, + &MemberKeyHandle); + if (!NT_SUCCESS(Status)) + { + TRACE("SampRegCreateKey failed with status 0x%08lx\n", Status); + goto done; + } + + Status = SampRegSetValue(MemberKeyHandle, + AliasObject->Name, + REG_BINARY, + MemberId, + MemberIdLength); + if (!NT_SUCCESS(Status)) + { + TRACE("SampRegSetValue failed with status 0x%08lx\n", Status); + goto done; + } + +done: + if (MemberKeyHandle != NULL) + SampRegCloseKey(MemberKeyHandle); + + if (MembersKeyHandle != NULL) + SampRegCloseKey(MembersKeyHandle); + + if (MemberIdString != NULL) + LocalFree(MemberIdString); + + return Status; +} + + +NTSTATUS +NTAPI +SampRemoveMemberFromAlias(IN PSAM_DB_OBJECT AliasObject, + IN PRPC_SID MemberId) +{ + LPWSTR MemberIdString = NULL; + HANDLE MembersKeyHandle = NULL; + HANDLE MemberKeyHandle = NULL; + ULONG ulValueCount; + NTSTATUS Status; + + TRACE("(%p %p)\n", + AliasObject, MemberId); + + ConvertSidToStringSidW(MemberId, &MemberIdString); + TRACE("Member SID: %S\n", MemberIdString); + + Status = SampRegOpenKey(AliasObject->MembersKeyHandle, + MemberIdString, + KEY_WRITE | KEY_QUERY_VALUE, + &MemberKeyHandle); + if (!NT_SUCCESS(Status)) + { + TRACE("SampRegOpenKey failed with status 0x%08lx\n", Status); + goto done; + } + + Status = SampRegDeleteValue(MemberKeyHandle, + AliasObject->Name); + if (!NT_SUCCESS(Status)) + { + TRACE("SampRegDeleteValue failed with status 0x%08lx\n", Status); + goto done; + } + + Status = SampRegQueryKeyInfo(MemberKeyHandle, + NULL, + &ulValueCount); + if (!NT_SUCCESS(Status)) + { + TRACE("SampRegQueryKeyInfo failed with status 0x%08lx\n", Status); + goto done; + } + + if (ulValueCount == 0) + { + SampRegCloseKey(MemberKeyHandle); + MemberKeyHandle = NULL; + + Status = SampRegDeleteKey(AliasObject->MembersKeyHandle, + MemberIdString); + if (!NT_SUCCESS(Status)) + { + TRACE("SampRegDeleteKey failed with status 0x%08lx\n", Status); + goto done; + } + } + + Status = SampRegOpenKey(AliasObject->KeyHandle, + L"Members", + KEY_WRITE | KEY_QUERY_VALUE, + &MembersKeyHandle); + if (!NT_SUCCESS(Status)) + { + TRACE("SampRegOpenKey failed with status 0x%08lx\n", Status); + goto done; + } + + Status = SampRegDeleteValue(MembersKeyHandle, + MemberIdString); + if (!NT_SUCCESS(Status)) + { + TRACE("SampRegDeleteValue failed with status 0x%08lx\n", Status); + goto done; + } + + Status = SampRegQueryKeyInfo(MembersKeyHandle, + NULL, + &ulValueCount); + if (!NT_SUCCESS(Status)) + { + TRACE("SampRegQueryKeyInfo failed with status 0x%08lx\n", Status); + goto done; + } + + if (ulValueCount == 0) + { + SampRegCloseKey(MembersKeyHandle); + MembersKeyHandle = NULL; + + Status = SampRegDeleteKey(AliasObject->KeyHandle, + L"Members"); + if (!NT_SUCCESS(Status)) + { + TRACE("SampRegDeleteKey failed with status 0x%08lx\n", Status); + goto done; + } + } + +done: + if (MemberKeyHandle != NULL) + SampRegCloseKey(MemberKeyHandle); + + if (MembersKeyHandle != NULL) + SampRegCloseKey(MembersKeyHandle); + + if (MemberIdString != NULL) + LocalFree(MemberIdString); + + return Status; +} + /* EOF */ Modified: trunk/reactos/dll/win32/samsrv/samrpc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/samrpc.c?…
============================================================================== --- trunk/reactos/dll/win32/samsrv/samrpc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samsrv/samrpc.c [iso-8859-1] Thu May 23 09:42:25 2013 @@ -4669,7 +4669,7 @@ &AliasObject); if (!NT_SUCCESS(Status)) { - TRACE("failed with status 0x%08lx\n", Status); + TRACE("SampValidateDbObject failed (Status 0x%08lx)\n", Status); return Status; } @@ -4704,14 +4704,9 @@ IN PRPC_SID MemberId) { PSAM_DB_OBJECT AliasObject; - LPWSTR MemberIdString = NULL; - HANDLE MembersKeyHandle = NULL; - HANDLE MemberKeyHandle = NULL; - ULONG MemberIdLength; - NTSTATUS Status; - - TRACE("SamrAddMemberToAlias(%p %p)\n", - AliasHandle, MemberId); + NTSTATUS Status; + + TRACE("(%p %p)\n", AliasHandle, MemberId); /* Validate the alias handle */ Status = SampValidateDbObject(AliasHandle, @@ -4724,62 +4719,12 @@ return Status; } - ConvertSidToStringSidW(MemberId, &MemberIdString); - TRACE("Member SID: %S\n", MemberIdString); - - MemberIdLength = RtlLengthSid(MemberId); - - Status = SampRegCreateKey(AliasObject->KeyHandle, - L"Members", - KEY_WRITE, - &MembersKeyHandle); - if (!NT_SUCCESS(Status)) - { - TRACE("SampRegCreateKey failed with status 0x%08lx\n", Status); - goto done; - } - - Status = SampRegSetValue(MembersKeyHandle, - MemberIdString, - REG_BINARY, - MemberId, - MemberIdLength); - if (!NT_SUCCESS(Status)) - { - TRACE("SampRegSetValue failed with status 0x%08lx\n", Status); - goto done; - } - - Status = SampRegCreateKey(AliasObject->MembersKeyHandle, - MemberIdString, - KEY_WRITE, - &MemberKeyHandle); - if (!NT_SUCCESS(Status)) - { - TRACE("SampRegCreateKey failed with status 0x%08lx\n", Status); - goto done; - } - - Status = SampRegSetValue(MemberKeyHandle, - AliasObject->Name, - REG_BINARY, - MemberId, - MemberIdLength); - if (!NT_SUCCESS(Status)) - { - TRACE("SampRegSetValue failed with status 0x%08lx\n", Status); - goto done; - } - -done: - if (MemberKeyHandle != NULL) - SampRegCloseKey(MemberKeyHandle); - - if (MembersKeyHandle != NULL) - SampRegCloseKey(MembersKeyHandle); - - if (MemberIdString != NULL) - LocalFree(MemberIdString); + Status = SampAddMemberToAlias(AliasObject, + MemberId); + if (!NT_SUCCESS(Status)) + { + TRACE("failed with status 0x%08lx\n", Status); + } return Status; } @@ -4792,14 +4737,9 @@ IN PRPC_SID MemberId) { PSAM_DB_OBJECT AliasObject; - LPWSTR MemberIdString = NULL; - HANDLE MembersKeyHandle = NULL; - HANDLE MemberKeyHandle = NULL; - ULONG ulValueCount; - NTSTATUS Status; - - TRACE("SamrRemoveMemberFromAlias(%p %p)\n", - AliasHandle, MemberId); + NTSTATUS Status; + + TRACE("(%p %p)\n", AliasHandle, MemberId); /* Validate the alias handle */ Status = SampValidateDbObject(AliasHandle, @@ -4812,100 +4752,12 @@ return Status; } - ConvertSidToStringSidW(MemberId, &MemberIdString); - TRACE("Member SID: %S\n", MemberIdString); - - Status = SampRegOpenKey(AliasObject->MembersKeyHandle, - MemberIdString, - KEY_WRITE | KEY_QUERY_VALUE, - &MemberKeyHandle); - if (!NT_SUCCESS(Status)) - { - TRACE("SampRegOpenKey failed with status 0x%08lx\n", Status); - goto done; - } - - Status = SampRegDeleteValue(MemberKeyHandle, - AliasObject->Name); - if (!NT_SUCCESS(Status)) - { - TRACE("SampRegDeleteValue failed with status 0x%08lx\n", Status); - goto done; - } - - Status = SampRegQueryKeyInfo(MemberKeyHandle, - NULL, - &ulValueCount); - if (!NT_SUCCESS(Status)) - { - TRACE("SampRegQueryKeyInfo failed with status 0x%08lx\n", Status); - goto done; - } - - if (ulValueCount == 0) - { - SampRegCloseKey(MemberKeyHandle); - MemberKeyHandle = NULL; - - Status = SampRegDeleteKey(AliasObject->MembersKeyHandle, - MemberIdString); - if (!NT_SUCCESS(Status)) - { - TRACE("SampRegDeleteKey failed with status 0x%08lx\n", Status); - goto done; - } - } - - Status = SampRegOpenKey(AliasObject->KeyHandle, - L"Members", - KEY_WRITE | KEY_QUERY_VALUE, - &MembersKeyHandle); - if (!NT_SUCCESS(Status)) - { - TRACE("SampRegOpenKey failed with status 0x%08lx\n", Status); - goto done; - } - - Status = SampRegDeleteValue(MembersKeyHandle, - MemberIdString); - if (!NT_SUCCESS(Status)) - { - TRACE("SampRegDeleteValue failed with status 0x%08lx\n", Status); - goto done; - } - - Status = SampRegQueryKeyInfo(MembersKeyHandle, - NULL, - &ulValueCount); - if (!NT_SUCCESS(Status)) - { - TRACE("SampRegQueryKeyInfo failed with status 0x%08lx\n", Status); - goto done; - } - - if (ulValueCount == 0) - { - SampRegCloseKey(MembersKeyHandle); - MembersKeyHandle = NULL; - - Status = SampRegDeleteKey(AliasObject->KeyHandle, - L"Members"); - if (!NT_SUCCESS(Status)) - { - TRACE("SampRegDeleteKey failed with status 0x%08lx\n", Status); - goto done; - } - } - -done: - if (MemberKeyHandle != NULL) - SampRegCloseKey(MemberKeyHandle); - - if (MembersKeyHandle != NULL) - SampRegCloseKey(MembersKeyHandle); - - if (MemberIdString != NULL) - LocalFree(MemberIdString); + Status = SampRemoveMemberFromAlias(AliasObject, + MemberId); + if (!NT_SUCCESS(Status)) + { + TRACE("failed with status 0x%08lx\n", Status); + } return Status; } Modified: trunk/reactos/dll/win32/samsrv/samsrv.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/samsrv.h?…
============================================================================== --- trunk/reactos/dll/win32/samsrv/samsrv.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samsrv/samsrv.h [iso-8859-1] Thu May 23 09:42:25 2013 @@ -128,6 +128,15 @@ IN ACCESS_MASK DesiredAccess, OUT PSAM_DB_OBJECT *AliasObject); +NTSTATUS +SampAddMemberToAlias(IN PSAM_DB_OBJECT AliasObject, + IN PRPC_SID MemberId); + +NTSTATUS +NTAPI +SampRemoveMemberFromAlias(IN PSAM_DB_OBJECT AliasObject, + IN PRPC_SID MemberId); + /* database.c */
11 years, 7 months
1
0
0
0
[ekohl] 59068: [SAMSRV] Rename internal setup functions in order to avoid naming conflicts.
by ekohl@svn.reactos.org
Author: ekohl Date: Thu May 23 09:07:12 2013 New Revision: 59068 URL:
http://svn.reactos.org/svn/reactos?rev=59068&view=rev
Log: [SAMSRV] Rename internal setup functions in order to avoid naming conflicts. Modified: trunk/reactos/dll/win32/samsrv/setup.c Modified: trunk/reactos/dll/win32/samsrv/setup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/setup.c?r…
============================================================================== --- trunk/reactos/dll/win32/samsrv/setup.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samsrv/setup.c [iso-8859-1] Thu May 23 09:07:12 2013 @@ -24,9 +24,9 @@ /* FUNCTIONS ***************************************************************/ static BOOL -SampAddMemberToAlias(HKEY hDomainKey, - ULONG AliasId, - PSID MemberSid) +SampSetupAddMemberToAlias(HKEY hDomainKey, + ULONG AliasId, + PSID MemberSid) { DWORD dwDisposition; LPWSTR MemberSidString = NULL; @@ -89,10 +89,10 @@ static BOOL -SampCreateAliasAccount(HKEY hDomainKey, - LPCWSTR lpAccountName, - LPCWSTR lpDescription, - ULONG ulRelativeId) +SampSetupCreateAliasAccount(HKEY hDomainKey, + LPCWSTR lpAccountName, + LPCWSTR lpDescription, + ULONG ulRelativeId) { DWORD dwDisposition; WCHAR szAccountKeyName[32]; @@ -150,9 +150,9 @@ #if 0 static BOOL -SampCreateGroupAccount(HKEY hDomainKey, - LPCWSTR lpAccountName, - ULONG ulRelativeId) +SampSetupCreateGroupAccount(HKEY hDomainKey, + LPCWSTR lpAccountName, + ULONG ulRelativeId) { return FALSE; @@ -161,11 +161,11 @@ static BOOL -SampCreateUserAccount(HKEY hDomainKey, - LPCWSTR lpAccountName, - LPCWSTR lpComment, - ULONG ulRelativeId, - ULONG UserAccountControl) +SampSetupCreateUserAccount(HKEY hDomainKey, + LPCWSTR lpAccountName, + LPCWSTR lpComment, + ULONG ulRelativeId, + ULONG UserAccountControl) { SAM_USER_FIXED_DATA FixedUserData; UCHAR LogonHours[23]; @@ -354,11 +354,11 @@ static BOOL -SampCreateDomain(IN HKEY hDomainsKey, - IN LPCWSTR lpKeyName, - IN LPCWSTR lpDomainName, - IN PSID lpDomainSid, - OUT PHKEY lpDomainKey) +SampSetupCreateDomain(IN HKEY hDomainsKey, + IN LPCWSTR lpKeyName, + IN LPCWSTR lpDomainName, + IN PSID lpDomainSid, + OUT PHKEY lpDomainKey) { SAM_DOMAIN_FIXED_DATA FixedData; LPWSTR lpEmptyString = L""; @@ -634,52 +634,52 @@ SampLoadString(hInstance, IDS_DOMAIN_BUILTIN_NAME, szName, 80); /* Create the Builtin domain */ - if (SampCreateDomain(hDomainsKey, - L"Builtin", - szName, - pBuiltinSid, - &hDomainKey)) + if (SampSetupCreateDomain(hDomainsKey, + L"Builtin", + szName, + pBuiltinSid, + &hDomainKey)) { SampLoadString(hInstance, IDS_ALIAS_ADMINISTRATORS_NAME, szName, 80); SampLoadString(hInstance, IDS_ALIAS_ADMINISTRATORS_COMMENT, szComment, 256); - SampCreateAliasAccount(hDomainKey, - szName, - szComment, - DOMAIN_ALIAS_RID_ADMINS); + SampSetupCreateAliasAccount(hDomainKey, + szName, + szComment, + DOMAIN_ALIAS_RID_ADMINS); SampLoadString(hInstance, IDS_ALIAS_USERS_NAME, szName, 80); SampLoadString(hInstance, IDS_ALIAS_USERS_COMMENT, szComment, 256); - SampCreateAliasAccount(hDomainKey, - szName, - szComment, - DOMAIN_ALIAS_RID_USERS); + SampSetupCreateAliasAccount(hDomainKey, + szName, + szComment, + DOMAIN_ALIAS_RID_USERS); SampLoadString(hInstance, IDS_ALIAS_GUESTS_NAME, szName, 80); SampLoadString(hInstance, IDS_ALIAS_GUESTS_COMMENT, szComment, 256); - SampCreateAliasAccount(hDomainKey, - szName, - szComment, - DOMAIN_ALIAS_RID_GUESTS); + SampSetupCreateAliasAccount(hDomainKey, + szName, + szComment, + DOMAIN_ALIAS_RID_GUESTS); SampLoadString(hInstance, IDS_ALIAS_POWER_USERS_NAME, szName, 80); SampLoadString(hInstance, IDS_ALIAS_POWER_USERS_COMMENT, szComment, 256); - SampCreateAliasAccount(hDomainKey, - szName, - szComment, - DOMAIN_ALIAS_RID_POWER_USERS); + SampSetupCreateAliasAccount(hDomainKey, + szName, + szComment, + DOMAIN_ALIAS_RID_POWER_USERS); pSid = AppendRidToSid(AccountDomainInfo->DomainSid, DOMAIN_USER_RID_ADMIN); if (pSid != NULL) { - SampAddMemberToAlias(hDomainKey, - DOMAIN_ALIAS_RID_ADMINS, - pSid); + SampSetupAddMemberToAlias(hDomainKey, + DOMAIN_ALIAS_RID_ADMINS, + pSid); RtlFreeHeap(RtlGetProcessHeap(), 0, pSid); } @@ -689,29 +689,29 @@ } /* Create the Account domain */ - if (SampCreateDomain(hDomainsKey, - L"Account", - L"", - AccountDomainInfo->DomainSid, - &hDomainKey)) + if (SampSetupCreateDomain(hDomainsKey, + L"Account", + L"", + AccountDomainInfo->DomainSid, + &hDomainKey)) { SampLoadString(hInstance, IDS_USER_ADMINISTRATOR_NAME, szName, 80); SampLoadString(hInstance, IDS_USER_ADMINISTRATOR_COMMENT, szComment, 256); - SampCreateUserAccount(hDomainKey, - szName, - szComment, - DOMAIN_USER_RID_ADMIN, - USER_DONT_EXPIRE_PASSWORD | USER_NORMAL_ACCOUNT); + SampSetupCreateUserAccount(hDomainKey, + szName, + szComment, + DOMAIN_USER_RID_ADMIN, + USER_DONT_EXPIRE_PASSWORD | USER_NORMAL_ACCOUNT); SampLoadString(hInstance, IDS_USER_GUEST_NAME, szName, 80); SampLoadString(hInstance, IDS_USER_GUEST_COMMENT, szComment, 256); - SampCreateUserAccount(hDomainKey, - szName, - szComment, - DOMAIN_USER_RID_GUEST, - USER_ACCOUNT_DISABLED | USER_DONT_EXPIRE_PASSWORD | USER_NORMAL_ACCOUNT); + SampSetupCreateUserAccount(hDomainKey, + szName, + szComment, + DOMAIN_USER_RID_GUEST, + USER_ACCOUNT_DISABLED | USER_DONT_EXPIRE_PASSWORD | USER_NORMAL_ACCOUNT); RegCloseKey(hDomainKey); }
11 years, 7 months
1
0
0
0
[ekohl] 59067: [SAMSRV] - Remove dead code. - Use SampReg functions for access th the registry. - Improve error handling in SampCreateDbObject and SampOpenDbObject functions.
by ekohl@svn.reactos.org
Author: ekohl Date: Wed May 22 17:53:25 2013 New Revision: 59067 URL:
http://svn.reactos.org/svn/reactos?rev=59067&view=rev
Log: [SAMSRV] - Remove dead code. - Use SampReg functions for access th the registry. - Improve error handling in SampCreateDbObject and SampOpenDbObject functions. Modified: trunk/reactos/dll/win32/samsrv/database.c Modified: trunk/reactos/dll/win32/samsrv/database.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/database.…
============================================================================== --- trunk/reactos/dll/win32/samsrv/database.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samsrv/database.c [iso-8859-1] Wed May 22 17:53:25 2013 @@ -59,34 +59,6 @@ return Status; } -#if 0 - if (!LsapIsDatabaseInstalled()) - { - Status = LsapCreateDatabaseKeys(); - if (!NT_SUCCESS(Status)) - { - ERR("Failed to create the LSA database keys (Status: 0x%08lx)\n", Status); - return Status; - } - - Status = LsapCreateDatabaseObjects(); - if (!NT_SUCCESS(Status)) - { - ERR("Failed to create the LSA database objects (Status: 0x%08lx)\n", Status); - return Status; - } - } - else - { - Status = LsapUpdateDatabase(); - if (!NT_SUCCESS(Status)) - { - ERR("Failed to update the LSA database (Status: 0x%08lx)\n", Status); - return Status; - } - } -#endif - TRACE("SampInitDatabase() done\n"); return STATUS_SUCCESS; @@ -102,9 +74,7 @@ IN ACCESS_MASK DesiredAccess, OUT PSAM_DB_OBJECT *DbObject) { - PSAM_DB_OBJECT NewObject; - OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING KeyName; + PSAM_DB_OBJECT NewObject = NULL; HANDLE ParentKeyHandle; HANDLE ContainerKeyHandle = NULL; HANDLE ObjectKeyHandle = NULL; @@ -114,6 +84,8 @@ if (DbObject == NULL) return STATUS_INVALID_PARAMETER; + *DbObject = NULL; + if (ParentObject == NULL) ParentKeyHandle = SamKeyHandle; else @@ -122,90 +94,48 @@ if (ContainerName != NULL) { /* Open the container key */ - RtlInitUnicodeString(&KeyName, - ContainerName); - - InitializeObjectAttributes(&ObjectAttributes, - &KeyName, - OBJ_CASE_INSENSITIVE, - ParentKeyHandle, - NULL); - - Status = NtOpenKey(&ContainerKeyHandle, - KEY_ALL_ACCESS, - &ObjectAttributes); + Status = SampRegOpenKey(ParentKeyHandle, + ContainerName, + KEY_ALL_ACCESS, + &ContainerKeyHandle); if (!NT_SUCCESS(Status)) { - return Status; - } - - /* Open the object key */ - RtlInitUnicodeString(&KeyName, - ObjectName); - - InitializeObjectAttributes(&ObjectAttributes, - &KeyName, - OBJ_CASE_INSENSITIVE, - ContainerKeyHandle, - NULL); - - Status = NtCreateKey(&ObjectKeyHandle, - KEY_ALL_ACCESS, - &ObjectAttributes, - 0, - NULL, - 0, - NULL); + goto done; + } + + /* Create the object key */ + Status = SampRegCreateKey(ContainerKeyHandle, + ObjectName, + KEY_ALL_ACCESS, + &ObjectKeyHandle); + if (!NT_SUCCESS(Status)) + { + goto done; + } if (ObjectType == SamDbAliasObject) { - /* Open the object key */ - RtlInitUnicodeString(&KeyName, - L"Members"); - - InitializeObjectAttributes(&ObjectAttributes, - &KeyName, - OBJ_CASE_INSENSITIVE | OBJ_OPENIF, - ContainerKeyHandle, - NULL); - - Status = NtCreateKey(&MembersKeyHandle, - KEY_ALL_ACCESS, - &ObjectAttributes, - 0, - NULL, - 0, - NULL); - } - - NtClose(ContainerKeyHandle); - + /* Create the object key */ + Status = SampRegCreateKey(ContainerKeyHandle, + L"Members", + KEY_ALL_ACCESS, + &MembersKeyHandle); + if (!NT_SUCCESS(Status)) + { + goto done; + } + } + } + else + { + /* Create the object key */ + Status = SampRegCreateKey(ParentKeyHandle, + ObjectName, + KEY_ALL_ACCESS, + &ObjectKeyHandle); if (!NT_SUCCESS(Status)) { - return Status; - } - } - else - { - RtlInitUnicodeString(&KeyName, - ObjectName); - - InitializeObjectAttributes(&ObjectAttributes, - &KeyName, - OBJ_CASE_INSENSITIVE, - ParentKeyHandle, - NULL); - - Status = NtCreateKey(&ObjectKeyHandle, - KEY_ALL_ACCESS, - &ObjectAttributes, - 0, - NULL, - 0, - NULL); - if (!NT_SUCCESS(Status)) - { - return Status; + goto done; } } @@ -214,10 +144,8 @@ sizeof(SAM_DB_OBJECT)); if (NewObject == NULL) { - if (MembersKeyHandle != NULL) - NtClose(MembersKeyHandle); - NtClose(ObjectKeyHandle); - return STATUS_NO_MEMORY; + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; } NewObject->Name = RtlAllocateHeap(RtlGetProcessHeap(), @@ -225,11 +153,8 @@ (wcslen(ObjectName) + 1) * sizeof(WCHAR)); if (NewObject->Name == NULL) { - if (MembersKeyHandle != NULL) - NtClose(MembersKeyHandle); - NtClose(ObjectKeyHandle); - RtlFreeHeap(RtlGetProcessHeap(), 0, NewObject); - return STATUS_NO_MEMORY; + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; } wcscpy(NewObject->Name, ObjectName); @@ -248,7 +173,28 @@ *DbObject = NewObject; - return STATUS_SUCCESS; +done: + if (!NT_SUCCESS(Status)) + { + if (NewObject != NULL) + { + if (NewObject->Name != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, NewObject->Name); + + RtlFreeHeap(RtlGetProcessHeap(), 0, NewObject); + } + + if (MembersKeyHandle != NULL) + SampRegCloseKey(MembersKeyHandle); + + if (ObjectKeyHandle != NULL) + SampRegCloseKey(ObjectKeyHandle); + } + + if (ContainerKeyHandle != NULL) + SampRegCloseKey(ContainerKeyHandle); + + return Status; } @@ -261,9 +207,7 @@ IN ACCESS_MASK DesiredAccess, OUT PSAM_DB_OBJECT *DbObject) { - PSAM_DB_OBJECT NewObject; - OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING KeyName; + PSAM_DB_OBJECT NewObject = NULL; HANDLE ParentKeyHandle; HANDLE ContainerKeyHandle = NULL; HANDLE ObjectKeyHandle = NULL; @@ -273,6 +217,8 @@ if (DbObject == NULL) return STATUS_INVALID_PARAMETER; + *DbObject = NULL; + if (ParentObject == NULL) ParentKeyHandle = SamKeyHandle; else @@ -281,83 +227,48 @@ if (ContainerName != NULL) { /* Open the container key */ - RtlInitUnicodeString(&KeyName, - ContainerName); - - InitializeObjectAttributes(&ObjectAttributes, - &KeyName, - OBJ_CASE_INSENSITIVE, - ParentKeyHandle, - NULL); - - Status = NtOpenKey(&ContainerKeyHandle, - KEY_ALL_ACCESS, - &ObjectAttributes); + Status = SampRegOpenKey(ParentKeyHandle, + ContainerName, + KEY_ALL_ACCESS, + &ContainerKeyHandle); if (!NT_SUCCESS(Status)) { - return Status; + goto done; } /* Open the object key */ - RtlInitUnicodeString(&KeyName, - ObjectName); - - InitializeObjectAttributes(&ObjectAttributes, - &KeyName, - OBJ_CASE_INSENSITIVE, - ContainerKeyHandle, - NULL); - - Status = NtOpenKey(&ObjectKeyHandle, - KEY_ALL_ACCESS, - &ObjectAttributes); + Status = SampRegOpenKey(ContainerKeyHandle, + ObjectName, + KEY_ALL_ACCESS, + &ObjectKeyHandle); + if (!NT_SUCCESS(Status)) + { + goto done; + } if (ObjectType == SamDbAliasObject) { /* Open the object key */ - RtlInitUnicodeString(&KeyName, - L"Members"); - - InitializeObjectAttributes(&ObjectAttributes, - &KeyName, - OBJ_CASE_INSENSITIVE | OBJ_OPENIF, - ContainerKeyHandle, - NULL); - - Status = NtCreateKey(&MembersKeyHandle, - KEY_ALL_ACCESS, - &ObjectAttributes, - 0, - NULL, - 0, - NULL); - } - - NtClose(ContainerKeyHandle); - + Status = SampRegOpenKey(ContainerKeyHandle, + L"Members", + KEY_ALL_ACCESS, + &MembersKeyHandle); + if (!NT_SUCCESS(Status)) + { + goto done; + } + } + } + else + { + /* Open the object key */ + Status = SampRegOpenKey(ParentKeyHandle, + ObjectName, + KEY_ALL_ACCESS, + &ObjectKeyHandle); if (!NT_SUCCESS(Status)) { - return Status; - } - } - else - { - /* Open the object key */ - RtlInitUnicodeString(&KeyName, - ObjectName); - - InitializeObjectAttributes(&ObjectAttributes, - &KeyName, - OBJ_CASE_INSENSITIVE, - ParentKeyHandle, - NULL); - - Status = NtOpenKey(&ObjectKeyHandle, - KEY_ALL_ACCESS, - &ObjectAttributes); - if (!NT_SUCCESS(Status)) - { - return Status; + goto done; } } @@ -366,10 +277,8 @@ sizeof(SAM_DB_OBJECT)); if (NewObject == NULL) { - if (MembersKeyHandle != NULL) - NtClose(MembersKeyHandle); - NtClose(ObjectKeyHandle); - return STATUS_NO_MEMORY; + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; } NewObject->Name = RtlAllocateHeap(RtlGetProcessHeap(), @@ -377,11 +286,8 @@ (wcslen(ObjectName) + 1) * sizeof(WCHAR)); if (NewObject->Name == NULL) { - if (MembersKeyHandle != NULL) - NtClose(MembersKeyHandle); - NtClose(ObjectKeyHandle); - RtlFreeHeap(RtlGetProcessHeap(), 0, NewObject); - return STATUS_NO_MEMORY; + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; } wcscpy(NewObject->Name, ObjectName); @@ -399,7 +305,28 @@ *DbObject = NewObject; - return STATUS_SUCCESS; +done: + if (!NT_SUCCESS(Status)) + { + if (NewObject != NULL) + { + if (NewObject->Name != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, NewObject->Name); + + RtlFreeHeap(RtlGetProcessHeap(), 0, NewObject); + } + + if (MembersKeyHandle != NULL) + SampRegCloseKey(MembersKeyHandle); + + if (ObjectKeyHandle != NULL) + SampRegCloseKey(ObjectKeyHandle); + } + + if (ContainerKeyHandle != NULL) + SampRegCloseKey(ContainerKeyHandle); + + return Status; } @@ -460,10 +387,10 @@ return STATUS_SUCCESS; if (DbObject->KeyHandle != NULL) - NtClose(DbObject->KeyHandle); + SampRegCloseKey(DbObject->KeyHandle); if (DbObject->MembersKeyHandle != NULL) - NtClose(DbObject->MembersKeyHandle); + SampRegCloseKey(DbObject->MembersKeyHandle); if (DbObject->ParentObject != NULL) ParentObject = DbObject->ParentObject; @@ -541,12 +468,12 @@ } if (DbObject->KeyHandle != NULL) - NtClose(DbObject->KeyHandle); + SampRegCloseKey(DbObject->KeyHandle); if (DbObject->ObjectType == SamDbAliasObject) { if (DbObject->MembersKeyHandle != NULL) - NtClose(DbObject->MembersKeyHandle); + SampRegCloseKey(DbObject->MembersKeyHandle); SampRegDeleteKey(DbObject->KeyHandle, L"Members"); @@ -622,17 +549,11 @@ LPVOID AttributeData, ULONG AttributeSize) { - UNICODE_STRING ValueName; - - RtlInitUnicodeString(&ValueName, - AttributeName); - - return ZwSetValueKey(DbObject->KeyHandle, - &ValueName, - 0, - AttributeType, - AttributeData, - AttributeSize); + return SampRegSetValue(DbObject->KeyHandle, + AttributeName, + AttributeType, + AttributeData, + AttributeSize); } @@ -643,53 +564,11 @@ LPVOID AttributeData, PULONG AttributeSize) { - PKEY_VALUE_PARTIAL_INFORMATION ValueInfo; - UNICODE_STRING ValueName; - ULONG BufferLength = 0; - NTSTATUS Status; - - RtlInitUnicodeString(&ValueName, - AttributeName); - - if (AttributeSize != NULL) - BufferLength = *AttributeSize; - - BufferLength += FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data); - - /* Allocate memory for the value */ - ValueInfo = RtlAllocateHeap(RtlGetProcessHeap(), 0, BufferLength); - if (ValueInfo == NULL) - return STATUS_NO_MEMORY; - - /* Query the value */ - Status = ZwQueryValueKey(DbObject->KeyHandle, - &ValueName, - KeyValuePartialInformation, - ValueInfo, - BufferLength, - &BufferLength); - if ((NT_SUCCESS(Status)) || (Status == STATUS_BUFFER_OVERFLOW)) - { - if (AttributeType != NULL) - *AttributeType = ValueInfo->Type; - - if (AttributeSize != NULL) - *AttributeSize = ValueInfo->DataLength; - } - - /* Check if the caller wanted data back, and we got it */ - if ((NT_SUCCESS(Status)) && (AttributeData != NULL)) - { - /* Copy it */ - RtlMoveMemory(AttributeData, - ValueInfo->Data, - ValueInfo->DataLength); - } - - /* Free the memory and return status */ - RtlFreeHeap(RtlGetProcessHeap(), 0, ValueInfo); - - return Status; + return SampRegQueryValue(DbObject->KeyHandle, + AttributeName, + AttributeType, + AttributeData, + AttributeSize); }
11 years, 7 months
1
0
0
0
[ekohl] 59066: [SAMSRV] - Move some helper functions to a separate file. - Implement SamrRemoveMemberFromForeignDomain.
by ekohl@svn.reactos.org
Author: ekohl Date: Wed May 22 13:56:49 2013 New Revision: 59066 URL:
http://svn.reactos.org/svn/reactos?rev=59066&view=rev
Log: [SAMSRV] - Move some helper functions to a separate file. - Implement SamrRemoveMemberFromForeignDomain. Added: trunk/reactos/dll/win32/samsrv/utils.c (with props) Modified: trunk/reactos/dll/win32/samsrv/CMakeLists.txt trunk/reactos/dll/win32/samsrv/domain.c trunk/reactos/dll/win32/samsrv/samrpc.c trunk/reactos/dll/win32/samsrv/samsrv.h trunk/reactos/dll/win32/samsrv/setup.c Modified: trunk/reactos/dll/win32/samsrv/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/CMakeList…
============================================================================== --- trunk/reactos/dll/win32/samsrv/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samsrv/CMakeLists.txt [iso-8859-1] Wed May 22 13:56:49 2013 @@ -17,6 +17,7 @@ samsrv.c setup.c user.c + utils.c samsrv.rc ${CMAKE_CURRENT_BINARY_DIR}/samsrv_stubs.c ${CMAKE_CURRENT_BINARY_DIR}/samsrv.def Modified: trunk/reactos/dll/win32/samsrv/domain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/domain.c?…
============================================================================== --- trunk/reactos/dll/win32/samsrv/domain.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samsrv/domain.c [iso-8859-1] Wed May 22 13:56:49 2013 @@ -256,4 +256,93 @@ return Status; } + +NTSTATUS +SampRemoveMemberFromAllAliases(IN PSAM_DB_OBJECT DomainObject, + IN PRPC_SID MemberSid) +{ + WCHAR AliasKeyName[64]; + LPWSTR MemberSidString = NULL; + HANDLE AliasesKey; + HANDLE MembersKey; + HANDLE AliasKey; + ULONG Index; + NTSTATUS Status; + + TRACE("(%p %p)\n", DomainObject, MemberSid); + + ConvertSidToStringSidW(MemberSid, &MemberSidString); + TRACE("Member SID: %S\n", MemberSidString); + + Status = SampRegOpenKey(DomainObject->KeyHandle, + L"Aliases", + KEY_READ, + &AliasesKey); + if (NT_SUCCESS(Status)) + { + Index = 0; + while (TRUE) + { + Status = SampRegEnumerateSubKey(AliasesKey, + Index, + 64, + AliasKeyName); + if (!NT_SUCCESS(Status)) + { + if (Status == STATUS_NO_MORE_ENTRIES) + Status = STATUS_SUCCESS; + break; + } + + TRACE("Alias key name: %S\n", AliasKeyName); + + Status = SampRegOpenKey(AliasesKey, + AliasKeyName, + KEY_READ, + &AliasKey); + if (NT_SUCCESS(Status)) + { + Status = SampRegOpenKey(AliasKey, + L"Members", + KEY_WRITE, + &MembersKey); + if (NT_SUCCESS(Status)) + { + Status = SampRegDeleteValue(AliasKey, + MemberSidString); + + SampRegCloseKey(MembersKey); + } + else if (Status == STATUS_OBJECT_NAME_NOT_FOUND) + Status = STATUS_SUCCESS; + + SampRegCloseKey(AliasKey); + } + + Index++; + } + + Status = SampRegOpenKey(AliasesKey, + L"Members", + KEY_WRITE, + &MembersKey); + if (NT_SUCCESS(Status)) + { + Status = SampRegDeleteKey(MembersKey, + MemberSidString); + if (Status == STATUS_OBJECT_NAME_NOT_FOUND) + Status = STATUS_SUCCESS; + + SampRegCloseKey(MembersKey); + } + + SampRegCloseKey(AliasesKey); + } + + if (MemberSidString != NULL) + LocalFree(MemberSidString); + + return Status; +} + /* EOF */ Modified: trunk/reactos/dll/win32/samsrv/samrpc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/samrpc.c?…
============================================================================== --- trunk/reactos/dll/win32/samsrv/samrpc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samsrv/samrpc.c [iso-8859-1] Wed May 22 13:56:49 2013 @@ -7648,8 +7648,49 @@ SamrRemoveMemberFromForeignDomain(IN SAMPR_HANDLE DomainHandle, IN PRPC_SID MemberSid) { - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; + PSAM_DB_OBJECT DomainObject; + ULONG Rid = 0; + NTSTATUS Status; + + TRACE("(%p %p)\n", + DomainHandle, MemberSid); + + /* Validate the domain object */ + Status = SampValidateDbObject(DomainHandle, + SamDbDomainObject, + DOMAIN_LOOKUP, + &DomainObject); + if (!NT_SUCCESS(Status)) + { + TRACE("SampValidateDbObject failed with status 0x%08lx\n", Status); + return Status; + } + + /* Retrieve the RID from the MemberSID */ + Status = SampGetRidFromSid((PSID)MemberSid, + &Rid); + if (!NT_SUCCESS(Status)) + { + TRACE("SampGetRidFromSid failed with status 0x%08lx\n", Status); + return Status; + } + + /* Fail, if the RID represents a special account */ + if (Rid < 1000) + { + TRACE("Cannot remove a special account (RID: %lu)\n", Rid); + return STATUS_SPECIAL_ACCOUNT; + } + + /* Remove the member from all aliases in the domain */ + Status = SampRemoveMemberFromAllAliases(DomainObject, + MemberSid); + if (!NT_SUCCESS(Status)) + { + TRACE("SampRemoveMemberFromAllAliases failed with status 0x%08lx\n", Status); + } + + return Status; } Modified: trunk/reactos/dll/win32/samsrv/samsrv.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/samsrv.h?…
============================================================================== --- trunk/reactos/dll/win32/samsrv/samsrv.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samsrv/samsrv.h [iso-8859-1] Wed May 22 13:56:49 2013 @@ -201,6 +201,10 @@ SampCheckAccountNameInDomain(IN PSAM_DB_OBJECT DomainObject, IN LPCWSTR lpAccountName); +NTSTATUS +SampRemoveMemberFromAllAliases(IN PSAM_DB_OBJECT DomainObject, + IN PRPC_SID MemberSid); + /* group.h */ @@ -281,13 +285,14 @@ /* samspc.c */ -VOID SampStartRpcServer(VOID); +VOID +SampStartRpcServer(VOID); /* setup.c */ -BOOL SampIsSetupRunning(VOID); -BOOL SampInitializeSAM(VOID); +BOOL +SampInitializeSAM(VOID); /* user.c */ @@ -337,4 +342,24 @@ SampSetLogonHoursAttrbute(IN PSAM_DB_OBJECT UserObject, IN PSAMPR_LOGON_HOURS LogonHours); + +/* utils.c */ + +INT +SampLoadString(HINSTANCE hInstance, + UINT uId, + LPWSTR lpBuffer, + INT nBufferMax); + +BOOL +SampIsSetupRunning(VOID); + +PSID +AppendRidToSid(PSID SrcSid, + ULONG Rid); + +NTSTATUS +SampGetRidFromSid(IN PSID Sid, + OUT PULONG Rid); + /* EOF */ Modified: trunk/reactos/dll/win32/samsrv/setup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/setup.c?r…
============================================================================== --- trunk/reactos/dll/win32/samsrv/setup.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samsrv/setup.c [iso-8859-1] Wed May 22 13:56:49 2013 @@ -22,127 +22,6 @@ /* FUNCTIONS ***************************************************************/ - -static INT -SampLoadString(HINSTANCE hInstance, - UINT uId, - LPWSTR lpBuffer, - INT nBufferMax) -{ - HGLOBAL hmem; - HRSRC hrsrc; - WCHAR *p; - int string_num; - int i; - - /* Use loword (incremented by 1) as resourceid */ - hrsrc = FindResourceW(hInstance, - MAKEINTRESOURCEW((LOWORD(uId) >> 4) + 1), - (LPWSTR)RT_STRING); - if (!hrsrc) - return 0; - - hmem = LoadResource(hInstance, hrsrc); - if (!hmem) - return 0; - - p = LockResource(hmem); - string_num = uId & 0x000f; - for (i = 0; i < string_num; i++) - p += *p + 1; - - i = min(nBufferMax - 1, *p); - if (i > 0) - { - memcpy(lpBuffer, p + 1, i * sizeof(WCHAR)); - lpBuffer[i] = 0; - } - else - { - if (nBufferMax > 1) - { - lpBuffer[0] = 0; - return 0; - } - } - - return i; -} - - -BOOL -SampIsSetupRunning(VOID) -{ - DWORD dwError; - HKEY hKey; - DWORD dwType; - DWORD dwSize; - DWORD dwSetupType; - - TRACE("SampIsSetupRunning()\n"); - - /* Open key */ - dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, - L"SYSTEM\\Setup", - 0, - KEY_QUERY_VALUE, - &hKey); - if (dwError != ERROR_SUCCESS) - return FALSE; - - /* Read key */ - dwSize = sizeof(DWORD); - dwError = RegQueryValueExW(hKey, - L"SetupType", - NULL, - &dwType, - (LPBYTE)&dwSetupType, - &dwSize); - - /* Close key, and check if returned values are correct */ - RegCloseKey(hKey); - if (dwError != ERROR_SUCCESS || dwType != REG_DWORD || dwSize != sizeof(DWORD)) - return FALSE; - - TRACE("SampIsSetupRunning() returns %s\n", (dwSetupType != 0) ? "TRUE" : "FALSE"); - return (dwSetupType != 0); -} - - -static PSID -AppendRidToSid(PSID SrcSid, - ULONG Rid) -{ - ULONG Rids[8] = {0, 0, 0, 0, 0, 0, 0, 0}; - UCHAR RidCount; - PSID DstSid; - ULONG i; - - RidCount = *RtlSubAuthorityCountSid(SrcSid); - if (RidCount >= 8) - return NULL; - - for (i = 0; i < RidCount; i++) - Rids[i] = *RtlSubAuthoritySid(SrcSid, i); - - Rids[RidCount] = Rid; - RidCount++; - - RtlAllocateAndInitializeSid(RtlIdentifierAuthoritySid(SrcSid), - RidCount, - Rids[0], - Rids[1], - Rids[2], - Rids[3], - Rids[4], - Rids[5], - Rids[6], - Rids[7], - &DstSid); - - return DstSid; -} - static BOOL SampAddMemberToAlias(HKEY hDomainKey, @@ -757,7 +636,7 @@ /* Create the Builtin domain */ if (SampCreateDomain(hDomainsKey, L"Builtin", - szName, //L"Builtin", // SampGetResourceString(hInstance, IDS_DOMAIN_BUILTIN_NAME), + szName, pBuiltinSid, &hDomainKey)) { Added: trunk/reactos/dll/win32/samsrv/utils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/utils.c?r…
============================================================================== --- trunk/reactos/dll/win32/samsrv/utils.c (added) +++ trunk/reactos/dll/win32/samsrv/utils.c [iso-8859-1] Wed May 22 13:56:49 2013 @@ -0,0 +1,158 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: Security Account Manager (SAM) Server + * FILE: reactos/dll/win32/samsrv/utils.c + * PURPOSE: Utility functions + * + * PROGRAMMERS: Eric Kohl + */ + +/* INCLUDES ****************************************************************/ + +#include "samsrv.h" + +WINE_DEFAULT_DEBUG_CHANNEL(samsrv); + + +/* GLOBALS *****************************************************************/ + + +/* FUNCTIONS ***************************************************************/ + +INT +SampLoadString(HINSTANCE hInstance, + UINT uId, + LPWSTR lpBuffer, + INT nBufferMax) +{ + HGLOBAL hmem; + HRSRC hrsrc; + WCHAR *p; + int string_num; + int i; + + /* Use loword (incremented by 1) as resourceid */ + hrsrc = FindResourceW(hInstance, + MAKEINTRESOURCEW((LOWORD(uId) >> 4) + 1), + (LPWSTR)RT_STRING); + if (!hrsrc) + return 0; + + hmem = LoadResource(hInstance, hrsrc); + if (!hmem) + return 0; + + p = LockResource(hmem); + string_num = uId & 0x000f; + for (i = 0; i < string_num; i++) + p += *p + 1; + + i = min(nBufferMax - 1, *p); + if (i > 0) + { + memcpy(lpBuffer, p + 1, i * sizeof(WCHAR)); + lpBuffer[i] = 0; + } + else + { + if (nBufferMax > 1) + { + lpBuffer[0] = 0; + return 0; + } + } + + return i; +} + + +BOOL +SampIsSetupRunning(VOID) +{ + DWORD dwError; + HKEY hKey; + DWORD dwType; + DWORD dwSize; + DWORD dwSetupType; + + TRACE("SampIsSetupRunning()\n"); + + /* Open key */ + dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"SYSTEM\\Setup", + 0, + KEY_QUERY_VALUE, + &hKey); + if (dwError != ERROR_SUCCESS) + return FALSE; + + /* Read key */ + dwSize = sizeof(DWORD); + dwError = RegQueryValueExW(hKey, + L"SetupType", + NULL, + &dwType, + (LPBYTE)&dwSetupType, + &dwSize); + + /* Close key, and check if returned values are correct */ + RegCloseKey(hKey); + if (dwError != ERROR_SUCCESS || dwType != REG_DWORD || dwSize != sizeof(DWORD)) + return FALSE; + + TRACE("SampIsSetupRunning() returns %s\n", (dwSetupType != 0) ? "TRUE" : "FALSE"); + return (dwSetupType != 0); +} + + +PSID +AppendRidToSid(PSID SrcSid, + ULONG Rid) +{ + ULONG Rids[8] = {0, 0, 0, 0, 0, 0, 0, 0}; + UCHAR RidCount; + PSID DstSid; + ULONG i; + + RidCount = *RtlSubAuthorityCountSid(SrcSid); + if (RidCount >= 8) + return NULL; + + for (i = 0; i < RidCount; i++) + Rids[i] = *RtlSubAuthoritySid(SrcSid, i); + + Rids[RidCount] = Rid; + RidCount++; + + RtlAllocateAndInitializeSid(RtlIdentifierAuthoritySid(SrcSid), + RidCount, + Rids[0], + Rids[1], + Rids[2], + Rids[3], + Rids[4], + Rids[5], + Rids[6], + Rids[7], + &DstSid); + + return DstSid; +} + + +NTSTATUS +SampGetRidFromSid(IN PSID Sid, + OUT PULONG Rid) +{ + UCHAR RidCount; + + RidCount = *RtlSubAuthorityCountSid(Sid); + if (RidCount < 1) + return STATUS_INVALID_SID; + + *Rid = *RtlSubAuthoritySid(Sid, RidCount - 1); + + return STATUS_SUCCESS; +} + +/* EOF */ Propchange: trunk/reactos/dll/win32/samsrv/utils.c ------------------------------------------------------------------------------ svn:eol-style = native
11 years, 7 months
1
0
0
0
[akhaldi] 59065: [WINHTTP_WINETEST] * Sync with Wine 1.5.26.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue May 21 20:07:04 2013 New Revision: 59065 URL:
http://svn.reactos.org/svn/reactos?rev=59065&view=rev
Log: [WINHTTP_WINETEST] * Sync with Wine 1.5.26. Modified: trunk/rostests/winetests/winhttp/notification.c trunk/rostests/winetests/winhttp/testlist.c trunk/rostests/winetests/winhttp/url.c trunk/rostests/winetests/winhttp/winhttp.c Modified: trunk/rostests/winetests/winhttp/notification.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/winhttp/notific…
============================================================================== --- trunk/rostests/winetests/winhttp/notification.c [iso-8859-1] (original) +++ trunk/rostests/winetests/winhttp/notification.c [iso-8859-1] Tue May 21 20:07:04 2013 @@ -68,9 +68,9 @@ { active = (proxy_info.lpszProxy != NULL); if (active) - GlobalFree((HGLOBAL) proxy_info.lpszProxy); + GlobalFree(proxy_info.lpszProxy); if (proxy_info.lpszProxyBypass != NULL) - GlobalFree((HGLOBAL) proxy_info.lpszProxyBypass); + GlobalFree(proxy_info.lpszProxyBypass); } else active = FALSE; @@ -292,6 +292,8 @@ WinHttpCloseHandle( req ); WinHttpCloseHandle( con ); WinHttpCloseHandle( ses ); + + Sleep(2000); /* make sure connection is evicted from cache */ } static const struct notification redirect_test[] = Modified: trunk/rostests/winetests/winhttp/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/winhttp/testlis…
============================================================================== --- trunk/rostests/winetests/winhttp/testlist.c [iso-8859-1] (original) +++ trunk/rostests/winetests/winhttp/testlist.c [iso-8859-1] Tue May 21 20:07:04 2013 @@ -1,10 +1,7 @@ /* Automatically generated file; DO NOT EDIT!! */ -#define WIN32_LEAN_AND_MEAN -#include <windows.h> - #define STANDALONE -#include "wine/test.h" +#include <wine/test.h> extern void func_notification(void); extern void func_url(void); Modified: trunk/rostests/winetests/winhttp/url.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/winhttp/url.c?r…
============================================================================== --- trunk/rostests/winetests/winhttp/url.c [iso-8859-1] (original) +++ trunk/rostests/winetests/winhttp/url.c [iso-8859-1] Tue May 21 20:07:04 2013 @@ -142,7 +142,6 @@ ret = WinHttpCreateUrl( &uc, 0, NULL, NULL ); ok( !ret, "expected failure\n" ); ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %u\n", GetLastError() ); - ok( len == ~0u, "expected len ~0u got %u\n", len ); /* valid components, NULL url */ SetLastError( 0xdeadbeef ); Modified: trunk/rostests/winetests/winhttp/winhttp.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/winhttp/winhttp…
============================================================================== --- trunk/rostests/winetests/winhttp/winhttp.c [iso-8859-1] (original) +++ trunk/rostests/winetests/winhttp/winhttp.c [iso-8859-1] Tue May 21 20:07:04 2013 @@ -18,19 +18,26 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + #define COBJMACROS #include <stdarg.h> -#include <stdlib.h> +//#include <stdlib.h> #include <windef.h> #include <winbase.h> +#include <ole2.h> +#include <winsock2.h> +//#include <ws2tcpip.h> #include <winhttp.h> #include <wincrypt.h> #include <winreg.h> -#include <winsock.h> -#include "initguid.h" +//#include <winsock.h> +//#include "initguid.h" #include <httprequest.h> -#include "wine/test.h" +#include <wine/test.h> static const WCHAR test_useragent[] = {'W','i','n','e',' ','R','e','g','r','e','s','s','i','o','n',' ','T','e','s','t',0}; @@ -46,9 +53,9 @@ { active = (proxy_info.lpszProxy != NULL); if (active) - GlobalFree((HGLOBAL) proxy_info.lpszProxy); + GlobalFree(proxy_info.lpszProxy); if (proxy_info.lpszProxyBypass != NULL) - GlobalFree((HGLOBAL) proxy_info.lpszProxyBypass); + GlobalFree(proxy_info.lpszProxyBypass); } else active = FALSE; @@ -792,7 +799,7 @@ static const WCHAR google[] = {'w','w','w','.','g','o','o','g','l','e','.','c','o','m',0}; HINTERNET ses, con, req; - DWORD size, status, policy, bitness; + DWORD size, status, policy, bitness, read_size; BOOL ret; CERT_CONTEXT *cert; WINHTTP_CERTIFICATE_INFO info; @@ -873,13 +880,16 @@ ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_RAW_HEADERS_CRLF, NULL, NULL, &size, NULL); ok(!ret, "succeeded unexpectedly\n"); + read_size = 0; for (;;) { size = 0; ret = WinHttpReadData(req, buffer, sizeof(buffer), &size); ok(ret == TRUE, "WinHttpReadData failed: %u.\n", GetLastError()); if (!size) break; + read_size += size; } + ok(read_size > 2014, "read_size = %u\n", read_size); cleanup: WinHttpCloseHandle(req); @@ -1005,8 +1015,8 @@ static void test_set_default_proxy_config(void) { - static const WCHAR wideString[] = { 0x226f, 0x575b, 0 }; - static const WCHAR normalString[] = { 'f','o','o',0 }; + static WCHAR wideString[] = { 0x226f, 0x575b, 0 }; + static WCHAR normalString[] = { 'f','o','o',0 }; DWORD type, len; BYTE *saved_proxy_settings = NULL; WINHTTP_PROXY_INFO info; @@ -1070,23 +1080,23 @@ info.lpszProxy = wideString; SetLastError(0xdeadbeef); ret = WinHttpSetDefaultProxyConfiguration(&info); - ok((!ret && GetLastError() == ERROR_INVALID_PARAMETER) || - broken(ret), /* Earlier winhttp versions on W2K/XP */ - "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + if (!ret && GetLastError() == ERROR_ACCESS_DENIED) + skip("couldn't set default proxy configuration: access denied\n"); + else + ok((!ret && GetLastError() == ERROR_INVALID_PARAMETER) || + broken(ret), /* Earlier winhttp versions on W2K/XP */ + "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); info.lpszProxy = normalString; SetLastError(0xdeadbeef); ret = WinHttpSetDefaultProxyConfiguration(&info); - if (ret) - { - ok(ret, "always true\n"); - set_default_proxy_reg_value( saved_proxy_settings, len, type ); - } - else if (GetLastError() == ERROR_ACCESS_DENIED) + if (!ret && GetLastError() == ERROR_ACCESS_DENIED) skip("couldn't set default proxy configuration: access denied\n"); else ok(ret, "WinHttpSetDefaultProxyConfiguration failed: %d\n", GetLastError()); + + set_default_proxy_reg_value( saved_proxy_settings, len, type ); } static void test_Timeouts (void) @@ -2016,6 +2026,65 @@ WinHttpCloseHandle( ses ); } +static void test_connection_info( int port ) +{ + static const WCHAR basicW[] = {'/','b','a','s','i','c',0}; + HINTERNET ses, con, req; + WINHTTP_CONNECTION_INFO info; + DWORD size, error; + BOOL ret; + + ses = WinHttpOpen( test_useragent, 0, NULL, NULL, 0 ); + ok( ses != NULL, "failed to open session %u\n", GetLastError() ); + + con = WinHttpConnect( ses, localhostW, port, 0 ); + ok( con != NULL, "failed to open a connection %u\n", GetLastError() ); + + req = WinHttpOpenRequest( con, NULL, basicW, NULL, NULL, NULL, 0 ); + ok( req != NULL, "failed to open a request %u\n", GetLastError() ); + + size = sizeof(info); + SetLastError( 0xdeadbeef ); + ret = WinHttpQueryOption( req, WINHTTP_OPTION_CONNECTION_INFO, &info, &size ); + error = GetLastError(); + if (!ret && error == ERROR_INVALID_PARAMETER) + { + win_skip( "WINHTTP_OPTION_CONNECTION_INFO not supported\n" ); + return; + } + ok( !ret, "unexpected success\n" ); + ok( error == ERROR_WINHTTP_INCORRECT_HANDLE_STATE, "got %u\n", error ); + + ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); + ok( ret, "failed to send request %u\n", GetLastError() ); + + size = 0; + SetLastError( 0xdeadbeef ); + ret = WinHttpQueryOption( req, WINHTTP_OPTION_CONNECTION_INFO, &info, &size ); + error = GetLastError(); + ok( !ret, "unexpected success\n" ); + ok( error == ERROR_INSUFFICIENT_BUFFER, "got %u\n", error ); + + size = sizeof(info); + memset( &info, 0, sizeof(info) ); + ret = WinHttpQueryOption( req, WINHTTP_OPTION_CONNECTION_INFO, &info, &size ); + ok( ret, "failed to retrieve connection info %u\n", GetLastError() ); + ok( info.cbSize == sizeof(info), "wrong size %u\n", info.cbSize ); + + ret = WinHttpReceiveResponse( req, NULL ); + ok( ret, "failed to receive response %u\n", GetLastError() ); + + size = sizeof(info); + memset( &info, 0, sizeof(info) ); + ret = WinHttpQueryOption( req, WINHTTP_OPTION_CONNECTION_INFO, &info, &size ); + ok( ret, "failed to retrieve connection info %u\n", GetLastError() ); + ok( info.cbSize == sizeof(info), "wrong size %u\n", info.cbSize ); + + WinHttpCloseHandle( req ); + WinHttpCloseHandle( con ); + WinHttpCloseHandle( ses ); +} + static void test_credentials(void) { static WCHAR userW[] = {'u','s','e','r',0}; @@ -2417,14 +2486,14 @@ status = 0; hr = IWinHttpRequest_get_Status( req, &status ); ok( hr == S_OK, "got %08x\n", hr ); - trace("%d\n", status); + trace("Status=%d\n", status); hr = IWinHttpRequest_get_StatusText( req, NULL ); ok( hr == E_INVALIDARG, "got %08x\n", hr ); hr = IWinHttpRequest_get_StatusText( req, &status_text ); ok( hr == S_OK, "got %08x\n", hr ); - trace("%s\n", wine_dbgstr_w(status_text)); + trace("StatusText=%s\n", wine_dbgstr_w(status_text)); SysFreeString( status_text ); hr = IWinHttpRequest_get_ResponseBody( req, NULL ); @@ -2608,10 +2677,10 @@ ret = WinHttpGetIEProxyConfigForCurrentUser( &cfg ); ok( ret, "expected success\n" ); - trace("%d\n", cfg.fAutoDetect); - trace("%s\n", wine_dbgstr_w(cfg.lpszAutoConfigUrl)); - trace("%s\n", wine_dbgstr_w(cfg.lpszProxy)); - trace("%s\n", wine_dbgstr_w(cfg.lpszProxyBypass)); + trace("IEProxy.AutoDetect=%d\n", cfg.fAutoDetect); + trace("IEProxy.AutoConfigUrl=%s\n", wine_dbgstr_w(cfg.lpszAutoConfigUrl)); + trace("IEProxy.Proxy=%s\n", wine_dbgstr_w(cfg.lpszProxy)); + trace("IEProxy.ProxyBypass=%s\n", wine_dbgstr_w(cfg.lpszProxyBypass)); GlobalFree( cfg.lpszAutoConfigUrl ); GlobalFree( cfg.lpszProxy ); GlobalFree( cfg.lpszProxyBypass ); @@ -2620,6 +2689,7 @@ static void test_WinHttpGetProxyForUrl(void) { static const WCHAR urlW[] = {'h','t','t','p',':','/','/','w','i','n','e','h','q','.','o','r','g',0}; + static const WCHAR wpadW[] = {'h','t','t','p',':','/','/','w','p','a','d','/','w','p','a','d','.','d','a','t',0}; static const WCHAR emptyW[] = {0}; BOOL ret; DWORD error; @@ -2693,14 +2763,36 @@ options.dwAutoDetectFlags = WINHTTP_AUTO_DETECT_TYPE_DNS_A; memset( &info, 0, sizeof(info) ); + SetLastError(0xdeadbeef); ret = WinHttpGetProxyForUrl( session, urlW, &options, &info ); - if (ret) + error = GetLastError(); + if (!ret) ok( error == ERROR_WINHTTP_AUTODETECTION_FAILED || + error == ERROR_WINHTTP_UNABLE_TO_DOWNLOAD_SCRIPT, "got %u\n", error ); + else { - trace("%u\n", info.dwAccessType); - trace("%s\n", wine_dbgstr_w(info.lpszProxy)); - trace("%s\n", wine_dbgstr_w(info.lpszProxyBypass)); - GlobalFree( (WCHAR *)info.lpszProxy ); - GlobalFree( (WCHAR *)info.lpszProxyBypass ); + trace("Proxy.AccessType=%u\n", info.dwAccessType); + trace("Proxy.Proxy=%s\n", wine_dbgstr_w(info.lpszProxy)); + trace("Proxy.ProxyBypass=%s\n", wine_dbgstr_w(info.lpszProxyBypass)); + GlobalFree( info.lpszProxy ); + GlobalFree( info.lpszProxyBypass ); + } + + options.dwFlags = WINHTTP_AUTOPROXY_CONFIG_URL; + options.dwAutoDetectFlags = 0; + options.lpszAutoConfigUrl = wpadW; + + memset( &info, 0, sizeof(info) ); + SetLastError(0xdeadbeef); + ret = WinHttpGetProxyForUrl( session, urlW, &options, &info ); + error = GetLastError(); + if (!ret) ok( error == ERROR_WINHTTP_UNABLE_TO_DOWNLOAD_SCRIPT, "got %u\n", error ); + else + { + trace("Proxy.AccessType=%u\n", info.dwAccessType); + trace("Proxy.Proxy=%s\n", wine_dbgstr_w(info.lpszProxy)); + trace("Proxy.ProxyBypass=%s\n", wine_dbgstr_w(info.lpszProxyBypass)); + GlobalFree( info.lpszProxy ); + GlobalFree( info.lpszProxyBypass ); } WinHttpCloseHandle( session ); } @@ -2742,6 +2834,7 @@ if (ret != WAIT_OBJECT_0) return; + test_connection_info(si.port); test_basic_request(si.port, NULL, basicW); test_no_headers(si.port); test_basic_authentication(si.port);
11 years, 7 months
1
0
0
0
[akhaldi] 59064: [WINHTTP] * Sync with Wine 1.5.26. * Update winhttp_ros.diff. [PSDK] * Update winhttp.h.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue May 21 20:06:46 2013 New Revision: 59064 URL:
http://svn.reactos.org/svn/reactos?rev=59064&view=rev
Log: [WINHTTP] * Sync with Wine 1.5.26. * Update winhttp_ros.diff. [PSDK] * Update winhttp.h. Modified: trunk/reactos/dll/win32/winhttp/CMakeLists.txt trunk/reactos/dll/win32/winhttp/net.c trunk/reactos/dll/win32/winhttp/pac.js trunk/reactos/dll/win32/winhttp/request.c trunk/reactos/dll/win32/winhttp/session.c trunk/reactos/dll/win32/winhttp/winhttp_private.h trunk/reactos/dll/win32/winhttp/winhttp_ros.diff trunk/reactos/include/psdk/winhttp.h trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/winhttp/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winhttp/CMakeLis…
============================================================================== --- trunk/reactos/dll/win32/winhttp/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/winhttp/CMakeLists.txt [iso-8859-1] Tue May 21 20:06:46 2013 @@ -25,7 +25,7 @@ set_module_type(winhttp win32dll) target_link_libraries(winhttp uuid wine) -add_delay_importlibs(winhttp oleaut32 ole32 crypt32) +add_delay_importlibs(winhttp oleaut32 ole32 crypt32 secur32) add_importlibs(winhttp user32 advapi32 ws2_32 msvcrt kernel32 ntdll) # wininet_tlb.tlb needs stdole2.tlb Modified: trunk/reactos/dll/win32/winhttp/net.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winhttp/net.c?re…
============================================================================== --- trunk/reactos/dll/win32/winhttp/net.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/winhttp/net.c [iso-8859-1] Tue May 21 20:06:46 2013 @@ -1,5 +1,6 @@ /* * Copyright 2008 Hans Leidekker for CodeWeavers + * Copyright 2013 Jacek Caban for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -21,11 +22,12 @@ #define COM_NO_WINDOWS_H #include <config.h> -//#include "wine/port.h" +//#include <wine/port.h> //#include <stdarg.h> //#include <stdio.h> //#include <errno.h> +#include <assert.h> //#include <sys/types.h> #ifdef HAVE_SYS_SOCKET_H @@ -39,12 +41,6 @@ #endif #ifdef HAVE_POLL_H # include <poll.h> -#endif -#ifdef HAVE_OPENSSL_SSL_H -# include <openssl/ssl.h> -# include <openssl/opensslv.h> -#undef FAR -#undef DSA #endif #define NONAMELESSUNION @@ -56,6 +52,7 @@ //#include "winbase.h" #include <winhttp.h> //#include "wincrypt.h" +#include <schannel.h> #include "winhttp_private.h" @@ -76,90 +73,6 @@ 0, 0, { (DWORD_PTR)(__FILE__ ": cs_gethostbyname") } }; static CRITICAL_SECTION cs_gethostbyname = { &critsect_debug, -1, 0, 0, 0, 0 }; - -#endif - -#ifdef SONAME_LIBSSL - -#include <openssl/err.h> - -static CRITICAL_SECTION init_ssl_cs; -static CRITICAL_SECTION_DEBUG init_ssl_cs_debug = -{ - 0, 0, &init_ssl_cs, - { &init_ssl_cs_debug.ProcessLocksList, - &init_ssl_cs_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": init_ssl_cs") } -}; -static CRITICAL_SECTION init_ssl_cs = { &init_ssl_cs_debug, -1, 0, 0, 0, 0 }; - -static void *libssl_handle; -static void *libcrypto_handle; - -#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER > 0x10000000) -static const SSL_METHOD *method; -#else -static SSL_METHOD *method; -#endif -static SSL_CTX *ctx; -static int hostname_idx; -static int error_idx; -static int conn_idx; - -#define MAKE_FUNCPTR(f) static typeof(f) * p##f - -MAKE_FUNCPTR( SSL_library_init ); -MAKE_FUNCPTR( SSL_load_error_strings ); -MAKE_FUNCPTR( SSLv23_method ); -MAKE_FUNCPTR( SSL_CTX_free ); -MAKE_FUNCPTR( SSL_CTX_new ); -MAKE_FUNCPTR( SSL_new ); -MAKE_FUNCPTR( SSL_free ); -MAKE_FUNCPTR( SSL_set_fd ); -MAKE_FUNCPTR( SSL_connect ); -MAKE_FUNCPTR( SSL_shutdown ); -MAKE_FUNCPTR( SSL_write ); -MAKE_FUNCPTR( SSL_read ); -MAKE_FUNCPTR( SSL_pending ); -MAKE_FUNCPTR( SSL_get_error ); -MAKE_FUNCPTR( SSL_get_ex_new_index ); -MAKE_FUNCPTR( SSL_get_ex_data ); -MAKE_FUNCPTR( SSL_set_ex_data ); -MAKE_FUNCPTR( SSL_get_ex_data_X509_STORE_CTX_idx ); -MAKE_FUNCPTR( SSL_get_peer_certificate ); -MAKE_FUNCPTR( SSL_CTX_set_default_verify_paths ); -MAKE_FUNCPTR( SSL_CTX_set_verify ); -MAKE_FUNCPTR( SSL_get_current_cipher ); -MAKE_FUNCPTR( SSL_CIPHER_get_bits ); - -MAKE_FUNCPTR( CRYPTO_num_locks ); -MAKE_FUNCPTR( CRYPTO_set_id_callback ); -MAKE_FUNCPTR( CRYPTO_set_locking_callback ); -MAKE_FUNCPTR( ERR_free_strings ); -MAKE_FUNCPTR( ERR_get_error ); -MAKE_FUNCPTR( ERR_error_string ); -MAKE_FUNCPTR( X509_STORE_CTX_get_ex_data ); -MAKE_FUNCPTR( X509_STORE_CTX_get_chain ); -MAKE_FUNCPTR( i2d_X509 ); -MAKE_FUNCPTR( sk_value ); -MAKE_FUNCPTR( sk_num ); -#undef MAKE_FUNCPTR - -static CRITICAL_SECTION *ssl_locks; -static unsigned int num_ssl_locks; - -static unsigned long ssl_thread_id(void) -{ - return GetCurrentThreadId(); -} - -static void ssl_lock_callback(int mode, int type, const char *file, int line) -{ - if (mode & CRYPTO_LOCK) - EnterCriticalSection( &ssl_locks[type] ); - else - LeaveCriticalSection( &ssl_locks[type] ); -} #endif @@ -240,45 +153,9 @@ #define ioctlsocket unix_ioctl #endif -#ifdef SONAME_LIBSSL -static PCCERT_CONTEXT X509_to_cert_context(X509 *cert) -{ - unsigned char *buffer, *p; - int len; - BOOL malloc = FALSE; - PCCERT_CONTEXT ret; - - p = NULL; - if ((len = pi2d_X509( cert, &p )) < 0) return NULL; - /* - * SSL 0.9.7 and above malloc the buffer if it is null. - * however earlier version do not and so we would need to alloc the buffer. - * - * see the i2d_X509 man page for more details. - */ - if (!p) - { - if (!(buffer = heap_alloc( len ))) return NULL; - p = buffer; - len = pi2d_X509( cert, &p ); - } - else - { - buffer = p; - malloc = TRUE; - } - - ret = CertCreateCertificateContext( X509_ASN_ENCODING, buffer, len ); - - if (malloc) free( buffer ); - else heap_free( buffer ); - - return ret; -} - -static DWORD netconn_verify_cert( PCCERT_CONTEXT cert, HCERTSTORE store, - WCHAR *server, DWORD security_flags ) -{ +static DWORD netconn_verify_cert( PCCERT_CONTEXT cert, WCHAR *server, DWORD security_flags ) +{ + HCERTSTORE store = cert->hCertStore; BOOL ret; CERT_CHAIN_PARA chainPara = { sizeof(chainPara), { 0 } }; PCCERT_CHAIN_CONTEXT chain; @@ -369,234 +246,53 @@ return err; } -static int netconn_secure_verify( int preverify_ok, X509_STORE_CTX *ctx ) -{ - SSL *ssl; - WCHAR *server; - BOOL ret = FALSE; - netconn_t *conn; - HCERTSTORE store = CertOpenStore( CERT_STORE_PROV_MEMORY, 0, 0, - CERT_STORE_CREATE_NEW_FLAG, NULL ); - - ssl = pX509_STORE_CTX_get_ex_data( ctx, pSSL_get_ex_data_X509_STORE_CTX_idx() ); - server = pSSL_get_ex_data( ssl, hostname_idx ); - conn = pSSL_get_ex_data( ssl, conn_idx ); - if (store) - { - X509 *cert; - int i; - PCCERT_CONTEXT endCert = NULL; - struct stack_st *chain = (struct stack_st *)pX509_STORE_CTX_get_chain( ctx ); - - ret = TRUE; - for (i = 0; ret && i < psk_num(chain); i++) - { - PCCERT_CONTEXT context; - - cert = (X509 *)psk_value(chain, i); - if ((context = X509_to_cert_context( cert ))) - { - if (i == 0) - ret = CertAddCertificateContextToStore( store, context, - CERT_STORE_ADD_ALWAYS, &endCert ); - else - ret = CertAddCertificateContextToStore( store, context, - CERT_STORE_ADD_ALWAYS, NULL ); - CertFreeCertificateContext( context ); - } - } - if (!endCert) ret = FALSE; - if (ret) - { - DWORD_PTR err = netconn_verify_cert( endCert, store, server, - conn->security_flags ); - - if (err) - { - pSSL_set_ex_data( ssl, error_idx, (void *)err ); - ret = FALSE; - } - } - CertFreeCertificateContext( endCert ); - CertCloseStore( store, 0 ); - } +static SecHandle cred_handle; +static BOOL cred_handle_initialized; + +static CRITICAL_SECTION init_sechandle_cs; +static CRITICAL_SECTION_DEBUG init_sechandle_cs_debug = { + 0, 0, &init_sechandle_cs, + { &init_sechandle_cs_debug.ProcessLocksList, + &init_sechandle_cs_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": init_sechandle_cs") } +}; +static CRITICAL_SECTION init_sechandle_cs = { &init_sechandle_cs_debug, -1, 0, 0, 0, 0 }; + +static BOOL ensure_cred_handle(void) +{ + BOOL ret = TRUE; + + EnterCriticalSection(&init_sechandle_cs); + + if(!cred_handle_initialized) { + SECURITY_STATUS res; + + res = AcquireCredentialsHandleW(NULL, (WCHAR*)UNISP_NAME_W, SECPKG_CRED_OUTBOUND, NULL, NULL, + NULL, NULL, &cred_handle, NULL); + if(res == SEC_E_OK) { + cred_handle_initialized = TRUE; + }else { + WARN("AcquireCredentialsHandleW failed: %u\n", res); + ret = FALSE; + } + } + + LeaveCriticalSection(&init_sechandle_cs); return ret; } -#endif - -BOOL netconn_init( netconn_t *conn, BOOL secure ) -{ -#if defined(SONAME_LIBSSL) && defined(SONAME_LIBCRYPTO) - int i; -#endif - + +BOOL netconn_init( netconn_t *conn ) +{ + memset(conn, 0, sizeof(*conn)); conn->socket = -1; - if (!secure) return TRUE; - -#if defined(SONAME_LIBSSL) && defined(SONAME_LIBCRYPTO) - EnterCriticalSection( &init_ssl_cs ); - if (libssl_handle) - { - LeaveCriticalSection( &init_ssl_cs ); - return TRUE; - } - if (!(libssl_handle = wine_dlopen( SONAME_LIBSSL, RTLD_NOW, NULL, 0 ))) - { - ERR("Trying to use SSL but couldn't load %s. Expect trouble.\n", SONAME_LIBSSL); - set_last_error( ERROR_WINHTTP_SECURE_CHANNEL_ERROR ); - LeaveCriticalSection( &init_ssl_cs ); - return FALSE; - } - if (!(libcrypto_handle = wine_dlopen( SONAME_LIBCRYPTO, RTLD_NOW, NULL, 0 ))) - { - ERR("Trying to use SSL but couldn't load %s. Expect trouble.\n", SONAME_LIBCRYPTO); - set_last_error( ERROR_WINHTTP_SECURE_CHANNEL_ERROR ); - LeaveCriticalSection( &init_ssl_cs ); - return FALSE; - } -#define LOAD_FUNCPTR(x) \ - if (!(p##x = wine_dlsym( libssl_handle, #x, NULL, 0 ))) \ - { \ - ERR("Failed to load symbol %s\n", #x); \ - set_last_error( ERROR_WINHTTP_SECURE_CHANNEL_ERROR ); \ - LeaveCriticalSection( &init_ssl_cs ); \ - return FALSE; \ - } - LOAD_FUNCPTR( SSL_library_init ); - LOAD_FUNCPTR( SSL_load_error_strings ); - LOAD_FUNCPTR( SSLv23_method ); - LOAD_FUNCPTR( SSL_CTX_free ); - LOAD_FUNCPTR( SSL_CTX_new ); - LOAD_FUNCPTR( SSL_new ); - LOAD_FUNCPTR( SSL_free ); - LOAD_FUNCPTR( SSL_set_fd ); - LOAD_FUNCPTR( SSL_connect ); - LOAD_FUNCPTR( SSL_shutdown ); - LOAD_FUNCPTR( SSL_write ); - LOAD_FUNCPTR( SSL_read ); - LOAD_FUNCPTR( SSL_pending ); - LOAD_FUNCPTR( SSL_get_error ); - LOAD_FUNCPTR( SSL_get_ex_new_index ); - LOAD_FUNCPTR( SSL_get_ex_data ); - LOAD_FUNCPTR( SSL_set_ex_data ); - LOAD_FUNCPTR( SSL_get_ex_data_X509_STORE_CTX_idx ); - LOAD_FUNCPTR( SSL_get_peer_certificate ); - LOAD_FUNCPTR( SSL_CTX_set_default_verify_paths ); - LOAD_FUNCPTR( SSL_CTX_set_verify ); - LOAD_FUNCPTR( SSL_get_current_cipher ); - LOAD_FUNCPTR( SSL_CIPHER_get_bits ); -#undef LOAD_FUNCPTR - -#define LOAD_FUNCPTR(x) \ - if (!(p##x = wine_dlsym( libcrypto_handle, #x, NULL, 0 ))) \ - { \ - ERR("Failed to load symbol %s\n", #x); \ - set_last_error( ERROR_WINHTTP_SECURE_CHANNEL_ERROR ); \ - LeaveCriticalSection( &init_ssl_cs ); \ - return FALSE; \ - } - LOAD_FUNCPTR( CRYPTO_num_locks ); - LOAD_FUNCPTR( CRYPTO_set_id_callback ); - LOAD_FUNCPTR( CRYPTO_set_locking_callback ); - LOAD_FUNCPTR( ERR_free_strings ); - LOAD_FUNCPTR( ERR_get_error ); - LOAD_FUNCPTR( ERR_error_string ); - LOAD_FUNCPTR( X509_STORE_CTX_get_ex_data ); - LOAD_FUNCPTR( X509_STORE_CTX_get_chain ); - LOAD_FUNCPTR( i2d_X509 ); - LOAD_FUNCPTR( sk_value ); - LOAD_FUNCPTR( sk_num ); -#undef LOAD_FUNCPTR - - pSSL_library_init(); - pSSL_load_error_strings(); - - method = pSSLv23_method(); - ctx = pSSL_CTX_new( method ); - if (!pSSL_CTX_set_default_verify_paths( ctx )) - { - ERR("SSL_CTX_set_default_verify_paths failed: %s\n", pERR_error_string( pERR_get_error(), 0 )); - set_last_error( ERROR_OUTOFMEMORY ); - LeaveCriticalSection( &init_ssl_cs ); - return FALSE; - } - hostname_idx = pSSL_get_ex_new_index( 0, (void *)"hostname index", NULL, NULL, NULL ); - if (hostname_idx == -1) - { - ERR("SSL_get_ex_new_index failed: %s\n", pERR_error_string( pERR_get_error(), 0 )); - set_last_error( ERROR_OUTOFMEMORY ); - LeaveCriticalSection( &init_ssl_cs ); - return FALSE; - } - error_idx = pSSL_get_ex_new_index( 0, (void *)"error index", NULL, NULL, NULL ); - if (error_idx == -1) - { - ERR("SSL_get_ex_new_index failed: %s\n", pERR_error_string( pERR_get_error(), 0 )); - set_last_error( ERROR_OUTOFMEMORY ); - LeaveCriticalSection( &init_ssl_cs ); - return FALSE; - } - conn_idx = pSSL_get_ex_new_index( 0, (void *)"netconn index", NULL, NULL, NULL ); - if (conn_idx == -1) - { - ERR("SSL_get_ex_new_index failed: %s\n", pERR_error_string( pERR_get_error(), 0 )); - set_last_error( ERROR_OUTOFMEMORY ); - LeaveCriticalSection( &init_ssl_cs ); - return FALSE; - } - pSSL_CTX_set_verify( ctx, SSL_VERIFY_PEER, netconn_secure_verify ); - - pCRYPTO_set_id_callback(ssl_thread_id); - num_ssl_locks = pCRYPTO_num_locks(); - ssl_locks = heap_alloc(num_ssl_locks * sizeof(CRITICAL_SECTION)); - if (!ssl_locks) - { - set_last_error( ERROR_OUTOFMEMORY ); - LeaveCriticalSection( &init_ssl_cs ); - return FALSE; - } - for (i = 0; i < num_ssl_locks; i++) - { - InitializeCriticalSection( &ssl_locks[i] ); - ssl_locks[i].DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": ssl_locks"); - } - pCRYPTO_set_locking_callback(ssl_lock_callback); - - LeaveCriticalSection( &init_ssl_cs ); -#else - WARN("SSL support not compiled in.\n"); - set_last_error( ERROR_WINHTTP_SECURE_CHANNEL_ERROR ); - return FALSE; -#endif return TRUE; } void netconn_unload( void ) { -#if defined(SONAME_LIBSSL) && defined(SONAME_LIBCRYPTO) - if (libcrypto_handle) - { - pERR_free_strings(); - wine_dlclose( libcrypto_handle, NULL, 0 ); - } - if (libssl_handle) - { - if (ctx) - pSSL_CTX_free( ctx ); - wine_dlclose( libssl_handle, NULL, 0 ); - } - if (ssl_locks) - { - int i; - for (i = 0; i < num_ssl_locks; i++) - { - ssl_locks[i].DebugInfo->Spare[0] = 0; - DeleteCriticalSection( &ssl_locks[i] ); - } - heap_free( ssl_locks ); - } - DeleteCriticalSection(&init_ssl_cs); -#endif + if(cred_handle_initialized) + FreeCredentialsHandle(&cred_handle); + DeleteCriticalSection(&init_sechandle_cs); #ifndef HAVE_GETADDRINFO DeleteCriticalSection(&cs_gethostbyname); #endif @@ -622,21 +318,20 @@ { int res; -#ifdef SONAME_LIBSSL if (conn->secure) { heap_free( conn->peek_msg_mem ); conn->peek_msg_mem = NULL; conn->peek_msg = NULL; conn->peek_len = 0; - - pSSL_shutdown( conn->ssl_conn ); - pSSL_free( conn->ssl_conn ); - - conn->ssl_conn = NULL; + heap_free(conn->ssl_buf); + conn->ssl_buf = NULL; + heap_free(conn->extra_buf); + conn->extra_buf = NULL; + conn->extra_len = 0; + DeleteSecurityContext(&conn->ssl_ctx); conn->secure = FALSE; } -#endif res = closesocket( conn->socket ); conn->socket = -1; if (res == -1) @@ -650,7 +345,8 @@ BOOL netconn_connect( netconn_t *conn, const struct sockaddr *sockaddr, unsigned int addr_len, int timeout ) { BOOL ret = FALSE; - int res = 0, state; + int res = 0; + ULONG state; if (timeout > 0) { @@ -695,54 +391,164 @@ BOOL netconn_secure_connect( netconn_t *conn, WCHAR *hostname ) { -#ifdef SONAME_LIBSSL - if (!(conn->ssl_conn = pSSL_new( ctx ))) - { - ERR("SSL_new failed: %s\n", pERR_error_string( pERR_get_error(), 0 )); - set_last_error( ERROR_OUTOFMEMORY ); - goto fail; - } - if (!pSSL_set_ex_data( conn->ssl_conn, hostname_idx, hostname )) - { - ERR("SSL_set_ex_data failed: %s\n", pERR_error_string( pERR_get_error(), 0 )); - set_last_error( ERROR_WINHTTP_SECURE_CHANNEL_ERROR ); - goto fail; - } - if (!pSSL_set_ex_data( conn->ssl_conn, conn_idx, conn )) - { - ERR("SSL_set_ex_data failed: %s\n", pERR_error_string( pERR_get_error(), 0 )); - set_last_error( ERROR_WINHTTP_SECURE_CHANNEL_ERROR ); + SecBuffer out_buf = {0, SECBUFFER_TOKEN, NULL}, in_bufs[2] = {{0, SECBUFFER_TOKEN}, {0, SECBUFFER_EMPTY}}; + SecBufferDesc out_desc = {SECBUFFER_VERSION, 1, &out_buf}, in_desc = {SECBUFFER_VERSION, 2, in_bufs}; + BYTE *read_buf; + SIZE_T read_buf_size = 2048; + ULONG attrs = 0; + CtxtHandle ctx; + SSIZE_T size; + const CERT_CONTEXT *cert; + SECURITY_STATUS status; + DWORD res = ERROR_SUCCESS; + + const DWORD isc_req_flags = ISC_REQ_ALLOCATE_MEMORY|ISC_REQ_USE_SESSION_KEY|ISC_REQ_CONFIDENTIALITY + |ISC_REQ_SEQUENCE_DETECT|ISC_REQ_REPLAY_DETECT|ISC_REQ_MANUAL_CRED_VALIDATION; + + if(!ensure_cred_handle()) return FALSE; - } - if (!pSSL_set_fd( conn->ssl_conn, conn->socket )) - { - ERR("SSL_set_fd failed: %s\n", pERR_error_string( pERR_get_error(), 0 )); - set_last_error( ERROR_WINHTTP_SECURE_CHANNEL_ERROR ); - goto fail; - } - if (pSSL_connect( conn->ssl_conn ) <= 0) - { - DWORD err; - - err = (DWORD_PTR)pSSL_get_ex_data( conn->ssl_conn, error_idx ); - if (!err) err = ERROR_WINHTTP_SECURE_CHANNEL_ERROR; - ERR("couldn't verify server certificate (%d)\n", err); - set_last_error( err ); - goto fail; - } + + read_buf = heap_alloc(read_buf_size); + if(!read_buf) + return FALSE; + + status = InitializeSecurityContextW(&cred_handle, NULL, hostname, isc_req_flags, 0, 0, NULL, 0, + &ctx, &out_desc, &attrs, NULL); + + assert(status != SEC_E_OK); + + while(status == SEC_I_CONTINUE_NEEDED || status == SEC_E_INCOMPLETE_MESSAGE) { + if(out_buf.cbBuffer) { + assert(status == SEC_I_CONTINUE_NEEDED); + + TRACE("sending %u bytes\n", out_buf.cbBuffer); + + size = send(conn->socket, out_buf.pvBuffer, out_buf.cbBuffer, 0); + if(size != out_buf.cbBuffer) { + ERR("send failed\n"); + status = ERROR_WINHTTP_SECURE_CHANNEL_ERROR; + break; + } + + FreeContextBuffer(out_buf.pvBuffer); + out_buf.pvBuffer = NULL; + out_buf.cbBuffer = 0; + } + + if(status == SEC_I_CONTINUE_NEEDED) { + assert(in_bufs[1].cbBuffer < read_buf_size); + + memmove(read_buf, (BYTE*)in_bufs[0].pvBuffer+in_bufs[0].cbBuffer-in_bufs[1].cbBuffer, in_bufs[1].cbBuffer); + in_bufs[0].cbBuffer = in_bufs[1].cbBuffer; + + in_bufs[1].BufferType = SECBUFFER_EMPTY; + in_bufs[1].cbBuffer = 0; + in_bufs[1].pvBuffer = NULL; + } + + assert(in_bufs[0].BufferType == SECBUFFER_TOKEN); + assert(in_bufs[1].BufferType == SECBUFFER_EMPTY); + + if(in_bufs[0].cbBuffer + 1024 > read_buf_size) { + BYTE *new_read_buf; + + new_read_buf = heap_realloc(read_buf, read_buf_size + 1024); + if(!new_read_buf) { + status = E_OUTOFMEMORY; + break; + } + + in_bufs[0].pvBuffer = read_buf = new_read_buf; + read_buf_size += 1024; + } + + size = recv(conn->socket, (char *)(read_buf+in_bufs[0].cbBuffer), read_buf_size-in_bufs[0].cbBuffer, 0); + if(size < 1) { + WARN("recv error\n"); + status = ERROR_WINHTTP_SECURE_CHANNEL_ERROR; + break; + } + + TRACE("recv %lu bytes\n", size); + + in_bufs[0].cbBuffer += size; + in_bufs[0].pvBuffer = read_buf; + status = InitializeSecurityContextW(&cred_handle, &ctx, hostname, isc_req_flags, 0, 0, &in_desc, + 0, NULL, &out_desc, &attrs, NULL); + TRACE("InitializeSecurityContext ret %08x\n", status); + + if(status == SEC_E_OK) { + if(in_bufs[1].BufferType == SECBUFFER_EXTRA) + FIXME("SECBUFFER_EXTRA not supported\n"); + + status = QueryContextAttributesW(&ctx, SECPKG_ATTR_STREAM_SIZES, &conn->ssl_sizes); + if(status != SEC_E_OK) { + WARN("Could not get sizes\n"); + break; + } + + status = QueryContextAttributesW(&ctx, SECPKG_ATTR_REMOTE_CERT_CONTEXT, (void*)&cert); + if(status == SEC_E_OK) { + res = netconn_verify_cert(cert, hostname, conn->security_flags); + CertFreeCertificateContext(cert); + if(res != ERROR_SUCCESS) { + WARN("cert verify failed: %u\n", res); + break; + } + }else { + WARN("Could not get cert\n"); + break; + } + + conn->ssl_buf = heap_alloc(conn->ssl_sizes.cbHeader + conn->ssl_sizes.cbMaximumMessage + conn->ssl_sizes.cbTrailer); + if(!conn->ssl_buf) { + res = GetLastError(); + break; + } + } + } + + + if(status != SEC_E_OK || res != ERROR_SUCCESS) { + WARN("Failed to initialize security context failed: %08x\n", status); + heap_free(conn->ssl_buf); + conn->ssl_buf = NULL; + DeleteSecurityContext(&ctx); + set_last_error(res ? res : ERROR_WINHTTP_SECURE_CHANNEL_ERROR); + return FALSE; + } + + TRACE("established SSL connection\n"); conn->secure = TRUE; + conn->ssl_ctx = ctx; return TRUE; - -fail: - if (conn->ssl_conn) - { - pSSL_shutdown( conn->ssl_conn ); - pSSL_free( conn->ssl_conn ); - conn->ssl_conn = NULL; - } -#endif - return FALSE; +} + +static BOOL send_ssl_chunk(netconn_t *conn, const void *msg, size_t size) +{ + SecBuffer bufs[4] = { + {conn->ssl_sizes.cbHeader, SECBUFFER_STREAM_HEADER, conn->ssl_buf}, + {size, SECBUFFER_DATA, conn->ssl_buf+conn->ssl_sizes.cbHeader}, + {conn->ssl_sizes.cbTrailer, SECBUFFER_STREAM_TRAILER, conn->ssl_buf+conn->ssl_sizes.cbHeader+size}, + {0, SECBUFFER_EMPTY, NULL} + }; + SecBufferDesc buf_desc = {SECBUFFER_VERSION, sizeof(bufs)/sizeof(*bufs), bufs}; + SECURITY_STATUS res; + + memcpy(bufs[1].pvBuffer, msg, size); + res = EncryptMessage(&conn->ssl_ctx, 0, &buf_desc, 0); + if(res != SEC_E_OK) { + WARN("EncryptMessage failed\n"); + return FALSE; + } + + if(send(conn->socket, conn->ssl_buf, bufs[0].cbBuffer+bufs[1].cbBuffer+bufs[2].cbBuffer, 0) < 1) { + WARN("send failed\n"); + return FALSE; + } + + return TRUE; } BOOL netconn_send( netconn_t *conn, const void *msg, size_t len, int flags, int *sent ) @@ -750,20 +556,123 @@ if (!netconn_connected( conn )) return FALSE; if (conn->secure) { -#ifdef SONAME_LIBSSL - if (flags) FIXME("SSL_write doesn't support any flags (%08x)\n", flags); - *sent = pSSL_write( conn->ssl_conn, msg, len ); - if (*sent < 1 && len) return FALSE; + const BYTE *ptr = msg; + size_t chunk_size; + + if (flags) FIXME("flags %08x not supported in SSL\n", flags); + + *sent = 0; + + while(len) { + chunk_size = min(len, conn->ssl_sizes.cbMaximumMessage); + if(!send_ssl_chunk(conn, ptr, chunk_size)) + return FALSE; + + *sent += chunk_size; + ptr += chunk_size; + len -= chunk_size; + } + return TRUE; -#else - return FALSE; -#endif } if ((*sent = send( conn->socket, msg, len, flags )) == -1) { set_last_error( sock_get_error( errno ) ); return FALSE; } + return TRUE; +} + +static BOOL read_ssl_chunk(netconn_t *conn, void *buf, SIZE_T buf_size, SIZE_T *ret_size, BOOL *eof) +{ + const SIZE_T ssl_buf_size = conn->ssl_sizes.cbHeader+conn->ssl_sizes.cbMaximumMessage+conn->ssl_sizes.cbTrailer; + SecBuffer bufs[4]; + SecBufferDesc buf_desc = {SECBUFFER_VERSION, sizeof(bufs)/sizeof(*bufs), bufs}; + SSIZE_T size, buf_len; + unsigned int i; + SECURITY_STATUS res; + + assert(conn->extra_len < ssl_buf_size); + + if(conn->extra_len) { + memcpy(conn->ssl_buf, conn->extra_buf, conn->extra_len); + buf_len = conn->extra_len; + conn->extra_len = 0; + heap_free(conn->extra_buf); + conn->extra_buf = NULL; + }else { + buf_len = recv(conn->socket, conn->ssl_buf+conn->extra_len, ssl_buf_size-conn->extra_len, 0); + if(buf_len < 0) { + WARN("recv failed\n"); + return FALSE; + } + + if(!buf_len) { + *eof = TRUE; + return TRUE; + } + } + + *ret_size = 0; + *eof = FALSE; + + do { + memset(bufs, 0, sizeof(bufs)); + bufs[0].BufferType = SECBUFFER_DATA; + bufs[0].cbBuffer = buf_len; + bufs[0].pvBuffer = conn->ssl_buf; + + res = DecryptMessage(&conn->ssl_ctx, &buf_desc, 0, NULL); + switch(res) { + case SEC_E_OK: + break; + case SEC_I_CONTEXT_EXPIRED: + TRACE("context expired\n"); + *eof = TRUE; + return TRUE; + case SEC_E_INCOMPLETE_MESSAGE: + assert(buf_len < ssl_buf_size); + + size = recv(conn->socket, conn->ssl_buf+buf_len, ssl_buf_size-buf_len, 0); + if(size < 1) + return FALSE; + + buf_len += size; + continue; + default: + WARN("failed: %08x\n", res); + return FALSE; + } + } while(res != SEC_E_OK); + + for(i=0; i < sizeof(bufs)/sizeof(*bufs); i++) { + if(bufs[i].BufferType == SECBUFFER_DATA) { + size = min(buf_size, bufs[i].cbBuffer); + memcpy(buf, bufs[i].pvBuffer, size); + if(size < bufs[i].cbBuffer) { + assert(!conn->peek_len); + conn->peek_msg_mem = conn->peek_msg = heap_alloc(bufs[i].cbBuffer - size); + if(!conn->peek_msg) + return FALSE; + conn->peek_len = bufs[i].cbBuffer-size; + memcpy(conn->peek_msg, (char*)bufs[i].pvBuffer+size, conn->peek_len); + } + + *ret_size = size; + } + } + + for(i=0; i < sizeof(bufs)/sizeof(*bufs); i++) { + if(bufs[i].BufferType == SECBUFFER_EXTRA) { + conn->extra_buf = heap_alloc(bufs[i].cbBuffer); + if(!conn->extra_buf) + return FALSE; + + conn->extra_len = bufs[i].cbBuffer; + memcpy(conn->extra_buf, bufs[i].pvBuffer, conn->extra_len); + } + } + return TRUE; } @@ -775,18 +684,13 @@ if (conn->secure) { -#ifdef SONAME_LIBSSL - int ret; + SIZE_T size, cread; + BOOL res, eof; if (flags & ~(MSG_PEEK | MSG_WAITALL)) FIXME("SSL_read does not support the following flags: %08x\n", flags); - /* this ugly hack is all for MSG_PEEK */ - if (flags & MSG_PEEK && !conn->peek_msg) - { - if (!(conn->peek_msg = conn->peek_msg_mem = heap_alloc( len + 1 ))) return FALSE; - } - else if (flags & MSG_PEEK && conn->peek_msg) + if (flags & MSG_PEEK && conn->peek_msg) { if (len < conn->peek_len) FIXME("buffer isn't big enough, should we wrap?\n"); *recvd = min( len, conn->peek_len ); @@ -809,33 +713,36 @@ /* check if we have enough data from the peek buffer */ if (!(flags & MSG_WAITALL) || (*recvd == len)) return TRUE; } - ret = pSSL_read( conn->ssl_conn, (char *)buf + *recvd, len - *recvd ); - if (ret < 0) - return FALSE; - - /* check if EOF was received */ - if (!ret && (pSSL_get_error( conn->ssl_conn, ret ) == SSL_ERROR_ZERO_RETURN || - pSSL_get_error( conn->ssl_conn, ret ) == SSL_ERROR_SYSCALL )) - { - netconn_close( conn ); - return TRUE; - } - if (flags & MSG_PEEK) /* must copy into buffer */ - { - conn->peek_len = ret; - if (!ret) - { - heap_free( conn->peek_msg_mem ); - conn->peek_msg_mem = NULL; - conn->peek_msg = NULL; - } - else memcpy( conn->peek_msg, buf, ret ); - } - *recvd += ret; + size = *recvd; + + do { + res = read_ssl_chunk(conn, (BYTE*)buf+size, len-size, &cread, &eof); + if(!res) { + WARN("read_ssl_chunk failed\n"); + if(!size) + return FALSE; + break; + } + + if(eof) { + TRACE("EOF\n"); + break; + } + + size += cread; + }while(!size || ((flags & MSG_WAITALL) && size < len)); + + if(size && (flags & MSG_PEEK)) { + conn->peek_msg_mem = conn->peek_msg = heap_alloc(size); + if(!conn->peek_msg) + return FALSE; + + memcpy(conn->peek_msg, buf, size); + } + + TRACE("received %ld bytes\n", size); + *recvd = size; return TRUE; -#else - return FALSE; -#endif } if ((*recvd = recv( conn->socket, buf, len, flags )) == -1) { @@ -848,16 +755,15 @@ BOOL netconn_query_data_available( netconn_t *conn, DWORD *available ) { #ifdef FIONREAD - int ret, unread; + int ret; + ULONG unread; #endif *available = 0; if (!netconn_connected( conn )) return FALSE; if (conn->secure) { -#ifdef SONAME_LIBSSL - *available = pSSL_pending( conn->ssl_conn ) + conn->peek_len; -#endif + *available = conn->peek_len; return TRUE; } #ifdef FIONREAD @@ -877,7 +783,6 @@ if (conn->secure) { -#ifdef SONAME_LIBSSL while (recvd < *buflen) { int dummy; @@ -900,9 +805,6 @@ TRACE("received line %s\n", debugstr_a(buffer)); } return ret; -#else - return FALSE; -#endif } FD_ZERO(&infd); @@ -950,14 +852,13 @@ DWORD netconn_set_timeout( netconn_t *netconn, BOOL send, int value ) { - int res; struct timeval tv; /* value is in milliseconds, convert to struct timeval */ tv.tv_sec = value / 1000; tv.tv_usec = (value % 1000) * 1000; - if ((res = setsockopt( netconn->socket, SOL_SOCKET, send ? SO_SNDTIMEO : SO_RCVTIMEO, (void*)&tv, sizeof(tv) ) == -1)) + if (setsockopt( netconn->socket, SOL_SOCKET, send ? SO_SNDTIMEO : SO_RCVTIMEO, (void*)&tv, sizeof(tv) ) == -1) { WARN("setsockopt failed (%s)\n", strerror( errno )); return sock_get_error( errno ); @@ -965,7 +866,7 @@ return ERROR_SUCCESS; } -static DWORD resolve_hostname( WCHAR *hostnameW, INTERNET_PORT port, struct sockaddr *sa, socklen_t *sa_len ) +static DWORD resolve_hostname( const WCHAR *hostnameW, INTERNET_PORT port, struct sockaddr *sa, socklen_t *sa_len ) { char *hostname; #ifdef HAVE_GETADDRINFO @@ -1050,7 +951,7 @@ struct resolve_args { - WCHAR *hostname; + const WCHAR *hostname; INTERNET_PORT port; struct sockaddr *sa; socklen_t *sa_len; @@ -1097,35 +998,22 @@ const void *netconn_get_certificate( netconn_t *conn ) { -#ifdef SONAME_LIBSSL - X509 *cert; const CERT_CONTEXT *ret; + SECURITY_STATUS res; if (!conn->secure) return NULL; - - if (!(cert = pSSL_get_peer_certificate( conn->ssl_conn ))) return NULL; - ret = X509_to_cert_context( cert ); - return ret; -#else - return NULL; -#endif + res = QueryContextAttributesW(&conn->ssl_ctx, SECPKG_ATTR_REMOTE_CERT_CONTEXT, (void*)&ret); + return res == SEC_E_OK ? ret : NULL; } int netconn_get_cipher_strength( netconn_t *conn ) { -#ifdef SONAME_LIBSSL -#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x0090707f) - const SSL_CIPHER *cipher; -#else - SSL_CIPHER *cipher; -#endif - int bits = 0; + SecPkgContext_ConnectionInfo conn_info; + SECURITY_STATUS res; if (!conn->secure) return 0; - if (!(cipher = pSSL_get_current_cipher( conn->ssl_conn ))) return 0; - pSSL_CIPHER_get_bits( cipher, &bits ); - return bits; -#else - return 0; -#endif -} + res = QueryContextAttributesW(&conn->ssl_ctx, SECPKG_ATTR_CONNECTION_INFO, (void*)&conn_info); + if(res != SEC_E_OK) + WARN("QueryContextAttributesW failed: %08x\n", res); + return res == SEC_E_OK ? conn_info.dwCipherStrength : 0; +} Modified: trunk/reactos/dll/win32/winhttp/pac.js URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winhttp/pac.js?r…
============================================================================== --- trunk/reactos/dll/win32/winhttp/pac.js [iso-8859-1] (original) +++ trunk/reactos/dll/win32/winhttp/pac.js [iso-8859-1] Tue May 21 20:06:46 2013 @@ -134,7 +134,7 @@ if (isGMT) { argc--; } - // function will work even without explict handling of this case + // function will work even without explicit handling of this case if (argc == 1) { var tmp = parseInt(arguments[0]); if (isNaN(tmp)) { Modified: trunk/reactos/dll/win32/winhttp/request.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winhttp/request.…
============================================================================== --- trunk/reactos/dll/win32/winhttp/request.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/winhttp/request.c [iso-8859-1] Tue May 21 20:06:46 2013 @@ -1044,6 +1044,20 @@ return ret; } +static void clear_response_headers( request_t *request ) +{ + unsigned int i; + + for (i = 0; i < request->num_headers; i++) + { + if (!request->headers[i].field) continue; + if (!request->headers[i].value) continue; + if (request->headers[i].is_request) continue; + delete_header( request, i ); + i--; + } +} + static BOOL send_request( request_t *request, LPCWSTR headers, DWORD headers_len, LPVOID optional, DWORD optional_len, DWORD total_len, DWORD_PTR context, BOOL async ) { @@ -1058,6 +1072,8 @@ char *req_ascii; int bytes_sent; DWORD len, i, flags; + + clear_response_headers( request ); flags = WINHTTP_ADDREQ_FLAG_ADD|WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA; for (i = 0; i < request->num_accept_types; i++) @@ -1428,12 +1444,12 @@ switch (status) { - case 401: + case HTTP_STATUS_DENIED: target = WINHTTP_AUTH_TARGET_SERVER; level = WINHTTP_QUERY_WWW_AUTHENTICATE; break; - case 407: + case HTTP_STATUS_PROXY_AUTH_REQ: target = WINHTTP_AUTH_TARGET_PROXY; level = WINHTTP_QUERY_PROXY_AUTHENTICATE; break; @@ -1461,20 +1477,6 @@ FIXME("unsupported authentication scheme\n"); return FALSE; -} - -static void clear_response_headers( request_t *request ) -{ - unsigned int i; - - for (i = 0; i < request->num_headers; i++) - { - if (!request->headers[i].field) continue; - if (!request->headers[i].value) continue; - if (request->headers[i].is_request) continue; - delete_header( request, i ); - i--; - } } #define MAX_REPLY_LEN 1460 @@ -1578,101 +1580,6 @@ end: send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED, &received_len, sizeof(DWORD) ); return TRUE; -} - -static BOOL handle_redirect( request_t *request, DWORD status ) -{ - BOOL ret = FALSE; - DWORD size, len; - URL_COMPONENTS uc; - connect_t *connect = request->connect; - INTERNET_PORT port; - WCHAR *hostname = NULL, *location = NULL; - int index; - - size = 0; - query_headers( request, WINHTTP_QUERY_LOCATION, NULL, NULL, &size, NULL ); - if (!(location = heap_alloc( size ))) return FALSE; - if (!query_headers( request, WINHTTP_QUERY_LOCATION, NULL, location, &size, NULL )) goto end; - - send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_REDIRECT, location, size / sizeof(WCHAR) + 1 ); - - memset( &uc, 0, sizeof(uc) ); - uc.dwStructSize = sizeof(uc); - uc.dwSchemeLength = uc.dwHostNameLength = uc.dwUrlPathLength = uc.dwExtraInfoLength = ~0u; - - if (!WinHttpCrackUrl( location, size / sizeof(WCHAR), 0, &uc )) /* assume relative redirect */ - { - WCHAR *path, *p; - - len = strlenW( location ) + 1; - if (location[0] != '/') len++; - if (!(p = path = heap_alloc( len * sizeof(WCHAR) ))) goto end; - - if (location[0] != '/') *p++ = '/'; - strcpyW( p, location ); - - heap_free( request->path ); - request->path = path; - } - else - { - if (uc.nScheme == INTERNET_SCHEME_HTTP && request->hdr.flags & WINHTTP_FLAG_SECURE) - { - TRACE("redirect from secure page to non-secure page\n"); - request->hdr.flags &= ~WINHTTP_FLAG_SECURE; - } - else if (uc.nScheme == INTERNET_SCHEME_HTTPS && !(request->hdr.flags & WINHTTP_FLAG_SECURE)) - { - TRACE("redirect from non-secure page to secure page\n"); - request->hdr.flags |= WINHTTP_FLAG_SECURE; - } - - len = uc.dwHostNameLength; - if (!(hostname = heap_alloc( (len + 1) * sizeof(WCHAR) ))) goto end; - memcpy( hostname, uc.lpszHostName, len * sizeof(WCHAR) ); - hostname[len] = 0; - - port = uc.nPort ? uc.nPort : (uc.nScheme == INTERNET_SCHEME_HTTPS ? 443 : 80); - if (strcmpiW( connect->hostname, hostname ) || connect->serverport != port) - { - heap_free( connect->hostname ); - connect->hostname = hostname; - connect->hostport = port; - if (!(ret = set_server_for_hostname( connect, hostname, port ))) goto end; - - netconn_close( &request->netconn ); - if (!(ret = netconn_init( &request->netconn, request->hdr.flags & WINHTTP_FLAG_SECURE ))) goto end; - } - if (!(ret = add_host_header( request, WINHTTP_ADDREQ_FLAG_REPLACE ))) goto end; - if (!(ret = open_connection( request ))) goto end; - - heap_free( request->path ); - request->path = NULL; - if (uc.dwUrlPathLength) - { - len = uc.dwUrlPathLength + uc.dwExtraInfoLength; - if (!(request->path = heap_alloc( (len + 1) * sizeof(WCHAR) ))) goto end; - strcpyW( request->path, uc.lpszUrlPath ); - } - else request->path = strdupW( slashW ); - } - - /* remove content-type/length headers */ - if ((index = get_header_index( request, attr_content_type, 0, TRUE )) >= 0) delete_header( request, index ); - if ((index = get_header_index( request, attr_content_length, 0, TRUE )) >= 0 ) delete_header( request, index ); - - if (status != HTTP_STATUS_REDIRECT_KEEP_VERB && !strcmpW( request->verb, postW )) - { - heap_free( request->verb ); - request->verb = strdupW( getW ); - } - ret = TRUE; - -end: - if (!ret) heap_free( hostname ); - heap_free( location ); - return ret; } static BOOL receive_data( request_t *request, void *buffer, DWORD size, DWORD *read, BOOL async ) @@ -1857,6 +1764,117 @@ } } +static WCHAR *get_redirect_url( request_t *request, DWORD *len ) +{ + DWORD size; + WCHAR *ret; + + query_headers( request, WINHTTP_QUERY_LOCATION, NULL, NULL, &size, NULL ); + if (get_last_error() != ERROR_INSUFFICIENT_BUFFER) return FALSE; + if (!(ret = heap_alloc( size ))) return NULL; + *len = size / sizeof(WCHAR); + if (query_headers( request, WINHTTP_QUERY_LOCATION, NULL, ret, &size, NULL )) return ret; + heap_free( ret ); + return NULL; +} + +static BOOL handle_redirect( request_t *request, DWORD status ) +{ + BOOL ret = FALSE; + DWORD len, len_url; + URL_COMPONENTS uc; + connect_t *connect = request->connect; + INTERNET_PORT port; + WCHAR *hostname = NULL, *location; + int index; + + if (!(location = get_redirect_url( request, &len_url ))) return FALSE; + + memset( &uc, 0, sizeof(uc) ); + uc.dwStructSize = sizeof(uc); + uc.dwSchemeLength = uc.dwHostNameLength = uc.dwUrlPathLength = uc.dwExtraInfoLength = ~0u; + + if (!WinHttpCrackUrl( location, len_url, 0, &uc )) /* assume relative redirect */ + { + WCHAR *path, *p; + + len = strlenW( location ) + 1; + if (location[0] != '/') len++; + if (!(p = path = heap_alloc( len * sizeof(WCHAR) ))) goto end; + + if (location[0] != '/') *p++ = '/'; + strcpyW( p, location ); + + heap_free( request->path ); + request->path = path; + + drain_content( request ); + send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_REDIRECT, location, len_url + 1 ); + } + else + { + if (uc.nScheme == INTERNET_SCHEME_HTTP && request->hdr.flags & WINHTTP_FLAG_SECURE) + { + if (request->hdr.redirect_policy == WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP) goto end; + TRACE("redirect from secure page to non-secure page\n"); + request->hdr.flags &= ~WINHTTP_FLAG_SECURE; + } + else if (uc.nScheme == INTERNET_SCHEME_HTTPS && !(request->hdr.flags & WINHTTP_FLAG_SECURE)) + { + TRACE("redirect from non-secure page to secure page\n"); + request->hdr.flags |= WINHTTP_FLAG_SECURE; + } + + drain_content( request ); + send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_REDIRECT, location, len_url + 1 ); + + len = uc.dwHostNameLength; + if (!(hostname = heap_alloc( (len + 1) * sizeof(WCHAR) ))) goto end; + memcpy( hostname, uc.lpszHostName, len * sizeof(WCHAR) ); + hostname[len] = 0; + + port = uc.nPort ? uc.nPort : (uc.nScheme == INTERNET_SCHEME_HTTPS ? 443 : 80); + if (strcmpiW( connect->hostname, hostname ) || connect->serverport != port) + { + heap_free( connect->hostname ); + connect->hostname = hostname; + connect->hostport = port; + if (!(ret = set_server_for_hostname( connect, hostname, port ))) goto end; + + netconn_close( &request->netconn ); + if (!(ret = netconn_init( &request->netconn ))) goto end; + } + if (!(ret = add_host_header( request, WINHTTP_ADDREQ_FLAG_REPLACE ))) goto end; + if (!(ret = open_connection( request ))) goto end; + + heap_free( request->path ); + request->path = NULL; + if (uc.dwUrlPathLength) + { + len = uc.dwUrlPathLength + uc.dwExtraInfoLength; + if (!(request->path = heap_alloc( (len + 1) * sizeof(WCHAR) ))) goto end; + strcpyW( request->path, uc.lpszUrlPath ); + } + else request->path = strdupW( slashW ); + } + + /* remove content-type/length headers */ + if ((index = get_header_index( request, attr_content_type, 0, TRUE )) >= 0) delete_header( request, index ); + if ((index = get_header_index( request, attr_content_length, 0, TRUE )) >= 0 ) delete_header( request, index ); + + if (status != HTTP_STATUS_REDIRECT_KEEP_VERB && !strcmpW( request->verb, postW )) + { + heap_free( request->verb ); + request->verb = strdupW( getW ); + } + ret = TRUE; + +end: + if (!ret) heap_free( hostname ); + heap_free( location ); + return ret; +} + static BOOL receive_response( request_t *request, BOOL async ) { BOOL ret; @@ -1882,16 +1900,15 @@ if (status == HTTP_STATUS_MOVED || status == HTTP_STATUS_REDIRECT || status == HTTP_STATUS_REDIRECT_KEEP_VERB) { - if (request->hdr.disable_flags & WINHTTP_DISABLE_REDIRECTS) break; - - drain_content( request ); + if (request->hdr.disable_flags & WINHTTP_DISABLE_REDIRECTS || + request->hdr.redirect_policy == WINHTTP_OPTION_REDIRECT_POLICY_NEVER) break; + if (!(ret = handle_redirect( request, status ))) break; - clear_response_headers( request ); send_request( request, NULL, 0, NULL, 0, 0, 0, FALSE ); /* recurse synchronously */ continue; } - else if (status == 401 || status == 407) + else if (status == HTTP_STATUS_DENIED || status == HTTP_STATUS_PROXY_AUTH_REQ) { if (request->hdr.disable_flags & WINHTTP_DISABLE_AUTHENTICATION) break; @@ -1901,7 +1918,6 @@ ret = TRUE; break; } - clear_response_headers( request ); send_request( request, NULL, 0, NULL, 0, 0, 0, FALSE ); continue; } @@ -2819,7 +2835,7 @@ static HRESULT request_receive( struct winhttp_request *request ) { - DWORD err, size, total_bytes_read, buflen = 4096; + DWORD err, size, buflen = 4096; wait_set_status_callback( request, WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE ); if (!WinHttpReceiveResponse( request->hrequest, NULL )) @@ -2834,7 +2850,7 @@ } if (!(request->buffer = heap_alloc( buflen ))) return E_OUTOFMEMORY; request->buffer[0] = 0; - size = total_bytes_read = 0; + size = 0; do { wait_set_status_callback( request, WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE ); @@ -2865,7 +2881,6 @@ goto error; } if ((err = wait_for_completion( request ))) goto error; - total_bytes_read += request->bytes_read; request->offset += request->bytes_read; } while (request->bytes_read); @@ -2918,7 +2933,6 @@ char *ptr = NULL; LONG size = 0; HRESULT hr; - BOOL ret; DWORD err; if ((err = request_set_parameters( request ))) return HRESULT_FROM_WIN32( err ); @@ -2927,9 +2941,9 @@ VariantInit( &data ); if (V_VT( &request->data ) == VT_BSTR) { - UINT i, cp = CP_ACP; + UINT cp = CP_ACP; const WCHAR *str = V_BSTR( &request->data ); - int len = strlenW( str ); + int i, len = strlenW( str ); for (i = 0; i < len; i++) { @@ -2957,7 +2971,7 @@ } } wait_set_status_callback( request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT ); - if (!(ret = WinHttpSendRequest( request->hrequest, NULL, 0, ptr, size, size, 0 ))) + if (!WinHttpSendRequest( request->hrequest, NULL, 0, ptr, size, size, 0 )) { err = get_last_error(); goto error; @@ -3047,6 +3061,7 @@ if (!WinHttpQueryHeaders( request->hrequest, flags, NULL, &status_code, &len, &index )) { err = get_last_error(); + goto done; } *status = status_code; Modified: trunk/reactos/dll/win32/winhttp/session.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winhttp/session.…
============================================================================== --- trunk/reactos/dll/win32/winhttp/session.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/winhttp/session.c [iso-8859-1] Tue May 21 20:06:46 2013 @@ -29,6 +29,7 @@ #include <windef.h> #include <winbase.h> +#include <winsock2.h> #include <winhttp.h> #include <wincrypt.h> #include <winreg.h> @@ -188,6 +189,9 @@ return TRUE; case WINHTTP_OPTION_RECEIVE_TIMEOUT: session->recv_timeout = *(DWORD *)buffer; + return TRUE; + case WINHTTP_OPTION_CONFIGURE_PASSPORT_AUTH: + FIXME("WINHTTP_OPTION_CONFIGURE_PASSPORT_AUTH: 0x%x\n", *(DWORD *)buffer); return TRUE; default: FIXME("unimplemented option %u\n", option); @@ -521,6 +525,7 @@ connect->hdr.callback = session->hdr.callback; connect->hdr.notify_mask = session->hdr.notify_mask; connect->hdr.context = session->hdr.context; + connect->hdr.redirect_policy = session->hdr.redirect_policy; list_init( &connect->hdr.children ); addref_object( &session->hdr ); @@ -593,6 +598,71 @@ CertNameToStrW( encoding, blob, format, ret, size ); return ret; +} + +static BOOL convert_sockaddr( const struct sockaddr *addr, SOCKADDR_STORAGE *addr_storage ) +{ +#if !defined(__MINGW32__) && !defined(_MSC_VER) + switch (addr->sa_family) + { + case AF_INET: + { + const struct sockaddr_in *addr_unix = (const struct sockaddr_in *)addr; + struct WS_sockaddr_in *addr_win = (struct WS_sockaddr_in *)addr_storage; + char *p; + + addr_win->sin_family = WS_AF_INET; + addr_win->sin_port = addr_unix->sin_port; + memcpy( &addr_win->sin_addr, &addr_unix->sin_addr, 4 ); + p = (char *)&addr_win->sin_addr + 4; + memset( p, 0, sizeof(*addr_storage) - (p - (char *)addr_win) ); + return TRUE; + } + case AF_INET6: + { + const struct sockaddr_in6 *addr_unix = (const struct sockaddr_in6 *)addr; + struct WS_sockaddr_in6 *addr_win = (struct WS_sockaddr_in6 *)addr_storage; + + addr_win->sin6_family = WS_AF_INET6; + addr_win->sin6_port = addr_unix->sin6_port; + addr_win->sin6_flowinfo = addr_unix->sin6_flowinfo; + memcpy( &addr_win->sin6_addr, &addr_unix->sin6_addr, 16 ); +#ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID + addr_win->sin6_scope_id = addr_unix->sin6_scope_id; +#else + addr_win->sin6_scope_id = 0; +#endif + memset( addr_win + 1, 0, sizeof(*addr_storage) - sizeof(*addr_win) ); + return TRUE; + } + default: + ERR("unhandled family %u\n", addr->sa_family); + return FALSE; + } +#else + switch (addr->sa_family) + { + case AF_INET: + { + struct sockaddr_in *addr_in = (struct sockaddr_in *)addr_storage; + + memcpy( addr_in, addr, sizeof(*addr_in) ); + memset( addr_in + 1, 0, sizeof(*addr_storage) - sizeof(*addr_in) ); + return TRUE; + } + case AF_INET6: + { + struct sockaddr_in6 *addr_in6 = (struct sockaddr_in6 *)addr_storage; + + memcpy( addr_in6, addr, sizeof(*addr_in6) ); + memset( addr_in6 + 1, 0, sizeof(*addr_storage) - sizeof(*addr_in6) ); + return TRUE; + } + default: + ERR("unhandled family %u\n", addr->sa_family); + return FALSE; + } +#endif } static BOOL request_query_option( object_header_t *hdr, DWORD option, LPVOID buffer, LPDWORD buflen ) @@ -691,6 +761,30 @@ *buflen = sizeof(DWORD); return TRUE; } + case WINHTTP_OPTION_CONNECTION_INFO: + { + WINHTTP_CONNECTION_INFO *info = buffer; + struct sockaddr local; + socklen_t len = sizeof(local); + const struct sockaddr *remote = (const struct sockaddr *)&request->connect->sockaddr; + + if (!buffer || *buflen < sizeof(*info)) + { + *buflen = sizeof(*info); + set_last_error( ERROR_INSUFFICIENT_BUFFER ); + return FALSE; + } + if (!netconn_connected( &request->netconn )) + { + set_last_error( ERROR_WINHTTP_INCORRECT_HANDLE_STATE ); + return FALSE; + } + if (getsockname( request->netconn.socket, &local, &len )) return FALSE; + if (!convert_sockaddr( &local, &info->LocalAddress )) return FALSE; + if (!convert_sockaddr( remote, &info->RemoteAddress )) return FALSE; + info->cbSize = sizeof(*info); + return TRUE; + } case WINHTTP_OPTION_RESOLVE_TIMEOUT: *(DWORD *)buffer = request->resolve_timeout; *buflen = sizeof(DWORD); @@ -886,7 +980,7 @@ static BOOL store_accept_types( request_t *request, const WCHAR **accept_types ) { const WCHAR **types = accept_types; - int i; + DWORD i; if (!types) return TRUE; while (*types) @@ -905,7 +999,7 @@ { if (!(request->accept_types[i] = strdupW( *types ))) { - for (; i >= 0; i--) heap_free( request->accept_types[i] ); + for ( ; i > 0; --i) heap_free( request->accept_types[i - 1] ); heap_free( request->accept_types ); request->accept_types = NULL; request->num_accept_types = 0; @@ -960,13 +1054,14 @@ request->hdr.callback = connect->hdr.callback; request->hdr.notify_mask = connect->hdr.notify_mask; request->hdr.context = connect->hdr.context; + request->hdr.redirect_policy = connect->hdr.redirect_policy; list_init( &request->hdr.children ); addref_object( &connect->hdr ); request->connect = connect; list_add_head( &connect->hdr.children, &request->hdr.entry ); - if (!netconn_init( &request->netconn, request->hdr.flags & WINHTTP_FLAG_SECURE )) goto end; + if (!netconn_init( &request->netconn )) goto end; request->resolve_timeout = connect->session->resolve_timeout; request->connect_timeout = connect->session->connect_timeout; request->send_timeout = connect->session->send_timeout; @@ -1177,18 +1272,34 @@ (unsigned int)(ntohl( addr->sin_addr.s_addr ) & 0xff) ); } -static WCHAR *build_wpad_url( const struct addrinfo *ai ) -{ - static const WCHAR fmtW[] = - {'h','t','t','p',':','/','/','%','u','.','%','u','.','%','u','.','%','u', - '/','w','p','a','d','.','d','a','t',0}; - WCHAR *ret; - - while (ai && ai->ai_family != AF_INET) ai = ai->ai_next; +static int reverse_lookup( const struct addrinfo *ai, char *hostname, size_t len ) +{ + int ret = -1; +#ifdef HAVE_GETNAMEINFO + ret = getnameinfo( ai->ai_addr, ai->ai_addrlen, hostname, len, NULL, 0, 0 ); +#endif + return ret; +} + +static WCHAR *build_wpad_url( const char *hostname, const struct addrinfo *ai ) +{ + static const WCHAR httpW[] = {'h','t','t','p',':','/','/',0}; + static const WCHAR wpadW[] = {'/','w','p','a','d','.','d','a','t',0}; + char name[NI_MAXHOST]; + WCHAR *ret, *p; + int len; + + while (ai && ai->ai_family != AF_INET && ai->ai_family != AF_INET6) ai = ai->ai_next; if (!ai) return NULL; - if (!(ret = GlobalAlloc( 0, sizeof(fmtW) + 12 * sizeof(WCHAR) ))) return NULL; - printf_addr( fmtW, ret, (struct sockaddr_in *)ai->ai_addr ); + if (!reverse_lookup( ai, name, sizeof(name) )) hostname = name; + + len = strlenW( httpW ) + strlen( hostname ) + strlenW( wpadW ); + if (!(ret = p = GlobalAlloc( 0, (len + 1) * sizeof(WCHAR) ))) return NULL; + strcpyW( p, httpW ); + p += strlenW( httpW ); + while (*hostname) { *p++ = *hostname++; } + strcpyW( p, wpadW ); return ret; } @@ -1206,7 +1317,11 @@ set_last_error( ERROR_INVALID_PARAMETER ); return FALSE; } - if (flags & WINHTTP_AUTO_DETECT_TYPE_DHCP) FIXME("discovery via DHCP not supported\n"); + if (flags & WINHTTP_AUTO_DETECT_TYPE_DHCP) + { + static int fixme_shown; + if (!fixme_shown++) FIXME("discovery via DHCP not supported\n"); + } if (flags & WINHTTP_AUTO_DETECT_TYPE_DNS_A) { #ifdef HAVE_GETADDRINFO @@ -1234,18 +1349,19 @@ strcpy( name, "wpad" ); strcat( name, p ); res = getaddrinfo( name, NULL, NULL, &ai ); - heap_free( name ); if (!res) { - *url = build_wpad_url( ai ); + *url = build_wpad_url( name, ai ); freeaddrinfo( ai ); if (*url) { TRACE("returning %s\n", debugstr_w(*url)); + heap_free( name ); ret = TRUE; break; } } + heap_free( name ); p++; } heap_free( domain ); @@ -1836,6 +1952,16 @@ return ret; } +#ifdef _WIN64 +#define IActiveScriptParse_Release IActiveScriptParse64_Release +#define IActiveScriptParse_InitNew IActiveScriptParse64_InitNew +#define IActiveScriptParse_ParseScriptText IActiveScriptParse64_ParseScriptText +#else +#define IActiveScriptParse_Release IActiveScriptParse32_Release +#define IActiveScriptParse_InitNew IActiveScriptParse32_InitNew +#define IActiveScriptParse_ParseScriptText IActiveScriptParse32_ParseScriptText +#endif + static BOOL run_script( const BSTR script, const WCHAR *url, WINHTTP_PROXY_INFO *info ) { static const WCHAR jscriptW[] = {'J','S','c','r','i','p','t',0}; @@ -1870,7 +1996,7 @@ hr = IActiveScript_QueryInterface( engine, &IID_IActiveScriptParse, (void **)&parser ); if (hr != S_OK) goto done; - hr = IActiveScriptParse64_InitNew( parser ); + hr = IActiveScriptParse_InitNew( parser ); if (hr != S_OK) goto done; hr = IActiveScript_SetScriptSite( engine, &script_site ); @@ -1881,7 +2007,7 @@ if (!(full_script = include_pac_utils( script ))) goto done; - hr = IActiveScriptParse64_ParseScriptText( parser, full_script, NULL, NULL, NULL, 0, 0, 0, NULL, NULL ); + hr = IActiveScriptParse_ParseScriptText( parser, full_script, NULL, NULL, NULL, 0, 0, 0, NULL, NULL ); if (hr != S_OK) goto done; hr = IActiveScript_SetScriptState( engine, SCRIPTSTATE_STARTED ); @@ -1918,7 +2044,7 @@ SysFreeString( hostname ); SysFreeString( func ); if (dispatch) IDispatch_Release( dispatch ); - if (parser) IUnknown_Release( parser ); + if (parser) IActiveScriptParse_Release( parser ); if (engine) IActiveScript_Release( engine ); if (SUCCEEDED( init )) CoUninitialize(); if (!ret) set_last_error( ERROR_WINHTTP_BAD_AUTO_PROXY_SCRIPT ); @@ -1932,7 +2058,7 @@ HINTERNET ses, con = NULL, req = NULL; WCHAR *hostname; URL_COMPONENTSW uc; - DWORD size = 4096, offset, to_read, bytes_read, flags = 0; + DWORD status, size = sizeof(status), offset, to_read, bytes_read, flags = 0; char *tmp, *buffer = NULL; BSTR script = NULL; int len; @@ -1949,8 +2075,12 @@ if (uc.nScheme == INTERNET_SCHEME_HTTPS) flags |= WINHTTP_FLAG_SECURE; if (!(req = WinHttpOpenRequest( con, NULL, uc.lpszUrlPath, NULL, NULL, acceptW, flags ))) goto done; if (!WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 )) goto done; + if (!(WinHttpReceiveResponse( req, 0 ))) goto done; - + if (!WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, + &size, NULL ) || status != HTTP_STATUS_OK) goto done; + + size = 4096; if (!(buffer = heap_alloc( size ))) goto done; to_read = size; offset = 0; @@ -2020,10 +2150,8 @@ } if (options->dwFlags & WINHTTP_AUTOPROXY_AUTO_DETECT && !WinHttpDetectAutoProxyConfigUrl( options->dwAutoDetectFlags, &detected_pac_url )) - { - set_last_error( ERROR_WINHTTP_AUTO_PROXY_SERVICE_ERROR ); goto done; - } + if (options->dwFlags & WINHTTP_AUTOPROXY_CONFIG_URL) pac_url = options->lpszAutoConfigUrl; else pac_url = detected_pac_url; Modified: trunk/reactos/dll/win32/winhttp/winhttp_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winhttp/winhttp_…
============================================================================== --- trunk/reactos/dll/win32/winhttp/winhttp_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/winhttp/winhttp_private.h [iso-8859-1] Tue May 21 20:06:46 2013 @@ -43,6 +43,7 @@ # define ioctlsocket ioctl #endif #include <ole2.h> +#include <sspi.h> static const WCHAR getW[] = {'G','E','T',0}; static const WCHAR postW[] = {'P','O','S','T',0}; @@ -127,7 +128,11 @@ { int socket; BOOL secure; /* SSL active on connection? */ - void *ssl_conn; + CtxtHandle ssl_ctx; + SecPkgContext_StreamSizes ssl_sizes; + char *ssl_buf; + char *extra_buf; + size_t extra_len; char *peek_msg; char *peek_msg_mem; size_t peek_len; @@ -225,7 +230,7 @@ BOOL netconn_connected( netconn_t * ) DECLSPEC_HIDDEN; BOOL netconn_create( netconn_t *, int, int, int ) DECLSPEC_HIDDEN; BOOL netconn_get_next_line( netconn_t *, char *, DWORD * ) DECLSPEC_HIDDEN; -BOOL netconn_init( netconn_t *, BOOL ) DECLSPEC_HIDDEN; +BOOL netconn_init( netconn_t * ) DECLSPEC_HIDDEN; void netconn_unload( void ) DECLSPEC_HIDDEN; BOOL netconn_query_data_available( netconn_t *, DWORD * ) DECLSPEC_HIDDEN; BOOL netconn_recv( netconn_t *, void *, size_t, int, int * ) DECLSPEC_HIDDEN; Modified: trunk/reactos/dll/win32/winhttp/winhttp_ros.diff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winhttp/winhttp_…
============================================================================== --- trunk/reactos/dll/win32/winhttp/winhttp_ros.diff [iso-8859-1] (original) +++ trunk/reactos/dll/win32/winhttp/winhttp_ros.diff [iso-8859-1] Tue May 21 20:06:46 2013 @@ -1,6 +1,7 @@ ---- wine-1.5.4/dlls/winhttp/net.c 2012-06-20 14:30:41 +0200 -+++ dll/win32/winhttp/net.c 2012-06-21 18:00:53 +0200 -@@ -160,6 +160,7 @@ static void ssl_lock_callback(int mode, +diff -prudN e:\Wine\dlls\winhttp/net.c e:\reactos-clean\dll\win32\winhttp/net.c +--- e:\Wine\dlls\winhttp/net.c 2013-03-16 11:54:52.602606100 +0100 ++++ e:\reactos-clean\dll\win32\winhttp/net.c 2013-05-21 20:25:32.595598100 +0100 +@@ -73,6 +77,7 @@ static CRITICAL_SECTION cs_gethostbyname #endif /* translate a unix error code into a winsock error code */ @@ -8,7 +9,7 @@ static int sock_get_error( int err ) { #if !defined(__MINGW32__) && !defined (_MSC_VER) -@@ -225,6 +226,15 @@ static int sock_get_error( int err ) +@@ -138,6 +143,15 @@ static int sock_get_error( int err ) #endif return err; } @@ -22,9 +23,9 @@ +#define ioctlsocket unix_ioctl +#endif - #ifdef SONAME_LIBSSL - static PCCERT_CONTEXT X509_to_cert_context(X509 *cert) -@@ -648,11 +658,17 @@ BOOL netconn_connect( netconn_t *conn, c + static DWORD netconn_verify_cert( PCCERT_CONTEXT cert, WCHAR *server, DWORD security_flags ) + { +@@ -344,11 +358,17 @@ BOOL netconn_connect( netconn_t *conn, c res = sock_get_error( errno ); if (res == WSAEWOULDBLOCK || res == WSAEINPROGRESS) { @@ -46,7 +47,16 @@ ret = TRUE; else res = sock_get_error( errno ); -@@ -848,7 +864,8 @@ BOOL netconn_query_data_available( netco +@@ -442,7 +462,7 @@ BOOL netconn_secure_connect( netconn_t * + read_buf_size += 1024; + } + +- size = recv(conn->socket, read_buf+in_bufs[0].cbBuffer, read_buf_size-in_bufs[0].cbBuffer, 0); ++ size = recv(conn->socket, (char *)(read_buf+in_bufs[0].cbBuffer), read_buf_size-in_bufs[0].cbBuffer, 0); + if(size < 1) { + WARN("recv error\n"); + status = ERROR_WINHTTP_SECURE_CHANNEL_ERROR; +@@ -754,7 +774,8 @@ BOOL netconn_query_data_available( netco BOOL netconn_get_next_line( netconn_t *conn, char *buffer, DWORD *buflen ) { @@ -56,8 +66,8 @@ BOOL ret = FALSE; DWORD recvd = 0; -@@ -884,19 +901,21 @@ BOOL netconn_get_next_line( netconn_t *c - #endif +@@ -786,19 +807,21 @@ BOOL netconn_get_next_line( netconn_t *c + return ret; } - pfd.fd = conn->socket; @@ -85,19 +95,59 @@ { if ((res = recv( conn->socket, &buffer[recvd], 1, 0 )) <= 0) { ---- wine-1.5.4/dlls/winhttp/request.c 2012-06-20 14:30:41 +0200 -+++ dll/win32/winhttp/request.c 2012-06-21 17:32:47 +0200 -@@ -38,6 +38,8 @@ - - #include "winhttp_private.h" - -+#include "inet_ntop.c" -+ - WINE_DEFAULT_DEBUG_CHANNEL(winhttp); - - static const WCHAR attr_accept[] = {'A','c','c','e','p','t',0}; ---- wine-1.5.4/dlls/winhttp/rsrc.rc 2012-06-20 14:30:41 +0200 -+++ dll/win32/winhttp/rsrc.rc 2012-07-14 15:25:28 +0200 +diff -prudN e:\Wine\dlls\winhttp/request.c e:\reactos-clean\dll\win32\winhttp/request.c +--- e:\Wine\dlls\winhttp/request.c 2013-03-16 11:54:52.603606700 +0100 ++++ e:\reactos-clean\dll\win32\winhttp/request.c 2013-05-21 20:05:12.642413600 +0100 +@@ -2254,8 +2260,8 @@ static void free_request( struct winhttp + CloseHandle( request->thread ); + CloseHandle( request->wait ); + CloseHandle( request->cancel ); +- heap_free( request->proxy.lpszProxy ); +- heap_free( request->proxy.lpszProxyBypass ); ++ heap_free( (WCHAR *)request->proxy.lpszProxy ); ++ heap_free( (WCHAR *)request->proxy.lpszProxyBypass ); + heap_free( request->buffer ); + heap_free( request->verb ); + VariantClear( &request->data ); +@@ -2446,16 +2452,16 @@ static HRESULT WINAPI winhttp_request_Se + { + case HTTPREQUEST_PROXYSETTING_DEFAULT: + request->proxy.dwAccessType = WINHTTP_ACCESS_TYPE_DEFAULT_PROXY; +- heap_free( request->proxy.lpszProxy ); +- heap_free( request->proxy.lpszProxyBypass ); ++ heap_free( (WCHAR *)request->proxy.lpszProxy ); ++ heap_free( (WCHAR *)request->proxy.lpszProxyBypass ); + request->proxy.lpszProxy = NULL; + request->proxy.lpszProxyBypass = NULL; + break; + + case HTTPREQUEST_PROXYSETTING_DIRECT: + request->proxy.dwAccessType = WINHTTP_ACCESS_TYPE_NO_PROXY; +- heap_free( request->proxy.lpszProxy ); +- heap_free( request->proxy.lpszProxyBypass ); ++ heap_free( (WCHAR *)request->proxy.lpszProxy ); ++ heap_free( (WCHAR *)request->proxy.lpszProxyBypass ); + request->proxy.lpszProxy = NULL; + request->proxy.lpszProxyBypass = NULL; + break; +@@ -2464,12 +2470,12 @@ static HRESULT WINAPI winhttp_request_Se + request->proxy.dwAccessType = WINHTTP_ACCESS_TYPE_NAMED_PROXY; + if (V_VT( &proxy_server ) == VT_BSTR) + { +- heap_free( request->proxy.lpszProxy ); ++ heap_free( (WCHAR *)request->proxy.lpszProxy ); + request->proxy.lpszProxy = strdupW( V_BSTR( &proxy_server ) ); + } + if (V_VT( &bypass_list ) == VT_BSTR) + { +- heap_free( request->proxy.lpszProxyBypass ); ++ heap_free( (WCHAR *)request->proxy.lpszProxyBypass ); + request->proxy.lpszProxyBypass = strdupW( V_BSTR( &bypass_list ) ); + } + break; +diff -prudN e:\Wine\dlls\winhttp/rsrc.rc e:\reactos-clean\dll\win32\winhttp/rsrc.rc +--- e:\Wine\dlls\winhttp/rsrc.rc 2011-11-24 17:55:02.335439900 +0100 ++++ e:\reactos-clean\dll\win32\winhttp/rsrc.rc 2012-07-20 21:40:58.173741700 +0100 @@ -16,6 +16,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ @@ -111,9 +161,10 @@ /* @makedep: pac.js */ pac.js 40 "pac.js" ---- wine-1.5.4/dlls/winhttp/session.c 2012-07-13 15:34:57 +0200 -+++ dll/win32/winhttp/session.c 2012-06-23 17:51:47 +0200 -@@ -95,6 +95,9 @@ static void session_destroy( object_head +diff -prudN e:\Wine\dlls\winhttp/session.c e:\reactos-clean\dll\win32\winhttp/session.c +--- e:\Wine\dlls\winhttp/session.c 2013-03-16 11:54:52.604607400 +0100 ++++ e:\reactos-clean\dll\win32\winhttp/session.c 2013-05-21 20:19:52.231665900 +0100 +@@ -100,6 +100,9 @@ static void session_destroy( object_head heap_free( session->proxy_username ); heap_free( session->proxy_password ); heap_free( session ); @@ -123,7 +174,7 @@ } static BOOL session_query_option( object_header_t *hdr, DWORD option, LPVOID buffer, LPDWORD buflen ) -@@ -203,6 +206,11 @@ HINTERNET WINAPI WinHttpOpen( LPCWSTR ag +@@ -211,6 +214,11 @@ HINTERNET WINAPI WinHttpOpen( LPCWSTR ag { session_t *session; HINTERNET handle = NULL; @@ -135,3 +186,31 @@ TRACE("%s, %u, %s, %s, 0x%08x\n", debugstr_w(agent), access, debugstr_w(proxy), debugstr_w(bypass), flags); +@@ -237,14 +245,14 @@ HINTERNET WINAPI WinHttpOpen( LPCWSTR ag + session->access = info.dwAccessType; + if (info.lpszProxy && !(session->proxy_server = strdupW( info.lpszProxy ))) + { +- GlobalFree( info.lpszProxy ); +- GlobalFree( info.lpszProxyBypass ); ++ GlobalFree( (LPWSTR)info.lpszProxy ); ++ GlobalFree( (LPWSTR)info.lpszProxyBypass ); + goto end; + } + if (info.lpszProxyBypass && !(session->proxy_bypass = strdupW( info.lpszProxyBypass ))) + { +- GlobalFree( info.lpszProxy ); +- GlobalFree( info.lpszProxyBypass ); ++ GlobalFree( (LPWSTR)info.lpszProxy ); ++ GlobalFree( (LPWSTR)info.lpszProxyBypass ); + goto end; + } + } +@@ -594,7 +602,7 @@ static WCHAR *blob_to_str( DWORD encodin + + static BOOL convert_sockaddr( const struct sockaddr *addr, SOCKADDR_STORAGE *addr_storage ) + { +-#ifndef __MINGW32__ ++#if !defined(__MINGW32__) && !defined(_MSC_VER) + switch (addr->sa_family) + { + case AF_INET: Modified: trunk/reactos/include/psdk/winhttp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winhttp.h?rev…
============================================================================== --- trunk/reactos/include/psdk/winhttp.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/winhttp.h [iso-8859-1] Tue May 21 20:06:46 2013 @@ -18,6 +18,12 @@ #ifndef __WINE_WINHTTP_H #define __WINE_WINHTTP_H + +#ifdef _WIN64 +#include <pshpack8.h> +#else +#include <pshpack4.h> +#endif #define WINHTTPAPI #define BOOLAPI WINHTTPAPI BOOL WINAPI @@ -487,8 +493,8 @@ typedef struct { DWORD dwAccessType; - LPCWSTR lpszProxy; - LPCWSTR lpszProxyBypass; + LPWSTR lpszProxy; + LPWSTR lpszProxyBypass; } WINHTTP_PROXY_INFO, *LPWINHTTP_PROXY_INFO; typedef WINHTTP_PROXY_INFO WINHTTP_PROXY_INFOW; typedef LPWINHTTP_PROXY_INFO LPWINHTTP_PROXY_INFOW; @@ -527,6 +533,14 @@ DWORD dwMinorVersion; } HTTP_VERSION_INFO, *LPHTTP_VERSION_INFO; +#ifdef _WS2DEF_ +typedef struct +{ + DWORD cbSize; + SOCKADDR_STORAGE LocalAddress; + SOCKADDR_STORAGE RemoteAddress; +} WINHTTP_CONNECTION_INFO; +#endif #ifdef __cplusplus extern "C" { @@ -565,4 +579,6 @@ } #endif +#include <poppack.h> + #endif /* __WINE_WINHTTP_H */ Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue May 21 20:06:46 2013 @@ -190,7 +190,7 @@ reactos/dll/win32/windowscodecs # Synced to Wine-1.5.19 reactos/dll/win32/winemp3.acm # Synced to Wine-1.5.19 reactos/dll/win32/wing32 # Out of sync -reactos/dll/win32/winhttp # Synced to Wine-1.5.4 +reactos/dll/win32/winhttp # Synced to Wine-1.5.26 reactos/dll/win32/wininet # Synced to Wine-1.5.26 reactos/dll/win32/winmm # Forked at Wine-20050628 reactos/dll/win32/winmm/midimap # Forked at Wine-20050628
11 years, 7 months
1
0
0
0
[akhaldi] 59063: [WININET_WINETEST] * Improve the headers inclusion for urlcache.c.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue May 21 19:56:35 2013 New Revision: 59063 URL:
http://svn.reactos.org/svn/reactos?rev=59063&view=rev
Log: [WININET_WINETEST] * Improve the headers inclusion for urlcache.c. Modified: trunk/rostests/winetests/wininet/urlcache.c Modified: trunk/rostests/winetests/wininet/urlcache.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wininet/urlcach…
============================================================================== --- trunk/rostests/winetests/wininet/urlcache.c [iso-8859-1] (original) +++ trunk/rostests/winetests/wininet/urlcache.c [iso-8859-1] Tue May 21 19:56:35 2013 @@ -21,6 +21,10 @@ #include <stdarg.h> //#include <stdio.h> //#include <stdlib.h> + +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H #include <windef.h> #include <winbase.h>
11 years, 7 months
1
0
0
0
[akhaldi] 59062: [WININET_WINETEST] * Sync with Wine 1.5.26.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon May 20 21:42:42 2013 New Revision: 59062 URL:
http://svn.reactos.org/svn/reactos?rev=59062&view=rev
Log: [WININET_WINETEST] * Sync with Wine 1.5.26. Modified: trunk/rostests/winetests/wininet/CMakeLists.txt trunk/rostests/winetests/wininet/ftp.c trunk/rostests/winetests/wininet/generated.c trunk/rostests/winetests/wininet/http.c trunk/rostests/winetests/wininet/internet.c trunk/rostests/winetests/wininet/testlist.c trunk/rostests/winetests/wininet/url.c trunk/rostests/winetests/wininet/urlcache.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/rostests/winetests/wininet/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wininet/CMakeLi…
Modified: trunk/rostests/winetests/wininet/ftp.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wininet/ftp.c?r…
Modified: trunk/rostests/winetests/wininet/generated.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wininet/generat…
Modified: trunk/rostests/winetests/wininet/http.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wininet/http.c?…
Modified: trunk/rostests/winetests/wininet/internet.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wininet/interne…
Modified: trunk/rostests/winetests/wininet/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wininet/testlis…
Modified: trunk/rostests/winetests/wininet/url.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wininet/url.c?r…
Modified: trunk/rostests/winetests/wininet/urlcache.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wininet/urlcach…
11 years, 7 months
1
0
0
0
[akhaldi] 59061: [WININET] * Sync with Wine 1.5.26. * Update wininet_ros.diff. [PSDK] * Update wininet.h and winineti.h.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon May 20 21:42:26 2013 New Revision: 59061 URL:
http://svn.reactos.org/svn/reactos?rev=59061&view=rev
Log: [WININET] * Sync with Wine 1.5.26. * Update wininet_ros.diff. [PSDK] * Update wininet.h and winineti.h. Modified: trunk/reactos/dll/win32/wininet/cookie.c trunk/reactos/dll/win32/wininet/dialogs.c trunk/reactos/dll/win32/wininet/ftp.c trunk/reactos/dll/win32/wininet/http.c trunk/reactos/dll/win32/wininet/internet.c trunk/reactos/dll/win32/wininet/internet.h trunk/reactos/dll/win32/wininet/netconnection.c trunk/reactos/dll/win32/wininet/urlcache.c trunk/reactos/dll/win32/wininet/utility.c trunk/reactos/dll/win32/wininet/wininet.spec trunk/reactos/dll/win32/wininet/wininet_ros.diff trunk/reactos/include/psdk/wininet.h trunk/reactos/include/psdk/winineti.h trunk/reactos/media/doc/README.WINE [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/win32/wininet/cookie.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/cookie.c…
Modified: trunk/reactos/dll/win32/wininet/dialogs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/dialogs.…
Modified: trunk/reactos/dll/win32/wininet/ftp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/ftp.c?re…
Modified: trunk/reactos/dll/win32/wininet/http.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/http.c?r…
Modified: trunk/reactos/dll/win32/wininet/internet.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/internet…
Modified: trunk/reactos/dll/win32/wininet/internet.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/internet…
Modified: trunk/reactos/dll/win32/wininet/netconnection.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/netconne…
Modified: trunk/reactos/dll/win32/wininet/urlcache.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/urlcache…
Modified: trunk/reactos/dll/win32/wininet/utility.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/utility.…
Modified: trunk/reactos/dll/win32/wininet/wininet.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/wininet.…
Modified: trunk/reactos/dll/win32/wininet/wininet_ros.diff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/wininet_…
Modified: trunk/reactos/include/psdk/wininet.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/wininet.h?rev…
Modified: trunk/reactos/include/psdk/winineti.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winineti.h?re…
Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
11 years, 7 months
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
24
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
Results per page:
10
25
50
100
200