winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
May 2006
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
863 discussions
Start a n
N
ew thread
Robert Shearman : rpcrt4: Pass in the buffer value before incrementing to PointerMarshall in NdrPointerMarshall .
by Alexandre Julliard
15 May '06
15 May '06
Module: wine Branch: refs/heads/master Commit: 3e988bfc4ff196b98750e40deecd259d7fb990d8 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=3e988bfc4ff196b98750e40…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Sat May 13 17:00:00 2006 +0100 rpcrt4: Pass in the buffer value before incrementing to PointerMarshall in NdrPointerMarshall. --- dlls/rpcrt4/ndr_marshall.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c index 43aceb9..a868173 100644 --- a/dlls/rpcrt4/ndr_marshall.c +++ b/dlls/rpcrt4/ndr_marshall.c @@ -1298,7 +1298,7 @@ unsigned char * WINAPI NdrPointerMarshal else Buffer = pStubMsg->Buffer; - PointerMarshall(pStubMsg, pStubMsg->Buffer, pMemory, pFormat); + PointerMarshall(pStubMsg, Buffer, pMemory, pFormat); STD_OVERFLOW_CHECK(pStubMsg);
1
0
0
0
Robert Shearman : rpcrt4: Implement NdrComplexStructMemorySize.
by Alexandre Julliard
15 May '06
15 May '06
Module: wine Branch: refs/heads/master Commit: 22bf15049c7cbc201c7a8abb00f1b86cd67b5d0b URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=22bf15049c7cbc201c7a8ab…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Sat May 13 16:59:50 2006 +0100 rpcrt4: Implement NdrComplexStructMemorySize. --- dlls/rpcrt4/ndr_marshall.c | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c index 72634b1..43aceb9 100644 --- a/dlls/rpcrt4/ndr_marshall.c +++ b/dlls/rpcrt4/ndr_marshall.c @@ -1922,11 +1922,14 @@ void WINAPI NdrComplexStructBufferSize(P unsigned long WINAPI NdrComplexStructMemorySize(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat) { - /* unsigned size = *(LPWORD)(pFormat+2); */ + unsigned size = *(const WORD*)(pFormat+2); PFORMAT_STRING conf_array = NULL; PFORMAT_STRING pointer_desc = NULL; + unsigned long saved_memory_size; - FIXME("(%p,%p): stub\n", pStubMsg, pFormat); + TRACE("(%p,%p)\n", pStubMsg, pFormat); + + ALIGN_POINTER(pStubMsg->Buffer, pFormat[1] + 1); pFormat += 4; if (*(const WORD*)pFormat) conf_array = pFormat + *(const WORD*)pFormat; @@ -1934,7 +1937,14 @@ unsigned long WINAPI NdrComplexStructMem if (*(const WORD*)pFormat) pointer_desc = pFormat + *(const WORD*)pFormat; pFormat += 2; - return 0; + saved_memory_size = pStubMsg->MemorySize; + ComplexStructSize(pStubMsg, pFormat); + pStubMsg->MemorySize = saved_memory_size; + + if (conf_array) + NdrConformantArrayMemorySize(pStubMsg, conf_array); + + return size; } /***********************************************************************
1
0
0
0
Robert Shearman : rpcrt4: Implement NdrComplexArrayMemorySize.
by Alexandre Julliard
15 May '06
15 May '06
Module: wine Branch: refs/heads/master Commit: cedbddbfde27fa7fa1b31cd351dd4ac400c397a1 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=cedbddbfde27fa7fa1b31cd…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Sat May 13 16:59:20 2006 +0100 rpcrt4: Implement NdrComplexArrayMemorySize. --- dlls/rpcrt4/ndr_marshall.c | 32 ++++++++++++++++++++++++++------ 1 files changed, 26 insertions(+), 6 deletions(-) diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c index 7897695..72634b1 100644 --- a/dlls/rpcrt4/ndr_marshall.c +++ b/dlls/rpcrt4/ndr_marshall.c @@ -2374,8 +2374,13 @@ void WINAPI NdrComplexArrayBufferSize(PM unsigned long WINAPI NdrComplexArrayMemorySize(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat) { - DWORD size = 0; - FIXME("(%p,%p): stub\n", pStubMsg, pFormat); + ULONG count, esize; + unsigned char alignment; + unsigned char *Buffer; + unsigned long SavedMemorySize; + unsigned long MemorySize; + + TRACE("(%p,%p)\n", pStubMsg, pFormat); if (pFormat[0] != RPC_FC_BOGUS_ARRAY) { @@ -2384,15 +2389,30 @@ unsigned long WINAPI NdrComplexArrayMemo return 0; } + alignment = pFormat[1] + 1; + pFormat += 4; pFormat = ReadConformance(pStubMsg, pFormat); - size = pStubMsg->MaxCount; - TRACE("conformance=%ld\n", size); + pFormat = ReadVariance(pStubMsg, pFormat); - pFormat += 4; + ALIGN_POINTER(pStubMsg->Buffer, alignment); - return 0; + SavedMemorySize = pStubMsg->MemorySize; + + Buffer = pStubMsg->Buffer; + esize = ComplexStructSize(pStubMsg, pFormat); + pStubMsg->Buffer = Buffer; + + MemorySize = esize * pStubMsg->MaxCount; + + for (count = 0; count < pStubMsg->ActualCount; count++) + ComplexStructSize(pStubMsg, pFormat); + + pStubMsg->MemorySize = SavedMemorySize; + + pStubMsg->MemorySize += MemorySize; + return MemorySize; } /***********************************************************************
1
0
0
0
Robert Shearman : rpcrt4: Fix the fault packet structure to comply with the DCE/RPC specification.
by Alexandre Julliard
15 May '06
15 May '06
Module: wine Branch: refs/heads/master Commit: 7ea0b860c5ade99f9d7d20d81e3e37644ca0e39a URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=7ea0b860c5ade99f9d7d20d…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Sat May 13 16:58:56 2006 +0100 rpcrt4: Fix the fault packet structure to comply with the DCE/RPC specification. --- dlls/rpcrt4/rpc_defs.h | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/rpcrt4/rpc_defs.h b/dlls/rpcrt4/rpc_defs.h index 5d23600..454c1c6 100644 --- a/dlls/rpcrt4/rpc_defs.h +++ b/dlls/rpcrt4/rpc_defs.h @@ -58,10 +58,10 @@ typedef struct RpcPktCommonHdr common; unsigned long alloc_hint; /* Data size in bytes excluding header and tail. */ unsigned short context_id; /* Presentation context identifier */ - unsigned char alert_count; /* Pending alert count */ - unsigned char padding[3]; /* Force alignment! */ + unsigned char cancel_count; /* Received cancel count */ + unsigned char reserved; /* Force alignment! */ unsigned long status; /* Runtime fault code (RPC_STATUS) */ - unsigned long reserved; + unsigned long reserved2; } RpcPktFaultHdr; typedef struct
1
0
0
0
Robert Shearman : rpcrt4: The NDR memory sizing functions should increment the buffer pointer, so make sure to save it before calling one of these and restore it afterwards .
by Alexandre Julliard
15 May '06
15 May '06
Module: wine Branch: refs/heads/master Commit: 628c5e9bafacb8fe0258e6690a453bdfff88b38e URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=628c5e9bafacb8fe0258e66…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Sat May 13 16:58:43 2006 +0100 rpcrt4: The NDR memory sizing functions should increment the buffer pointer, so make sure to save it before calling one of these and restore it afterwards. --- dlls/rpcrt4/ndr_marshall.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c index 6dc1a03..7897695 100644 --- a/dlls/rpcrt4/ndr_marshall.c +++ b/dlls/rpcrt4/ndr_marshall.c @@ -2289,6 +2289,7 @@ unsigned char * WINAPI NdrComplexArrayUn ULONG count, esize; unsigned char alignment; unsigned char *pMemory; + unsigned char *Buffer; TRACE("(%p,%p,%p,%d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc); @@ -2306,7 +2307,9 @@ unsigned char * WINAPI NdrComplexArrayUn pFormat = ReadConformance(pStubMsg, pFormat); pFormat = ReadVariance(pStubMsg, pFormat); + Buffer = pStubMsg->Buffer; esize = ComplexStructSize(pStubMsg, pFormat); + pStubMsg->Buffer = Buffer; if (fMustAlloc || !*ppMemory) { @@ -3423,7 +3426,11 @@ static unsigned char *WINAPI NdrBaseType TRACE("pStubMsg: %p, ppMemory: %p, type: 0x%02x, fMustAlloc: %s\n", pStubMsg, ppMemory, *pFormat, fMustAlloc ? "true" : "false"); if (fMustAlloc || !*ppMemory) + { + unsigned char *Buffer = pStubMsg->Buffer; *ppMemory = NdrAllocate(pStubMsg, NdrBaseTypeMemorySize(pStubMsg, pFormat)); + pStubMsg->Buffer = Buffer; + } TRACE("*ppMemory: %p\n", *ppMemory);
1
0
0
0
Robert Shearman : rpcrt4: Make NdrBaseTypeMemorySize increment the buffer and memory size fields of MIDL_STUB_MESSAGE .
by Alexandre Julliard
15 May '06
15 May '06
Module: wine Branch: refs/heads/master Commit: dcd0a39d4cecb64321ff2f4a672d9e4af4403e4f URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=dcd0a39d4cecb64321ff2f4…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Sat May 13 16:59:06 2006 +0100 rpcrt4: Make NdrBaseTypeMemorySize increment the buffer and memory size fields of MIDL_STUB_MESSAGE. --- dlls/rpcrt4/ndr_marshall.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c index 65fd57d..6dc1a03 100644 --- a/dlls/rpcrt4/ndr_marshall.c +++ b/dlls/rpcrt4/ndr_marshall.c @@ -3553,24 +3553,40 @@ static unsigned long WINAPI NdrBaseTypeM case RPC_FC_CHAR: case RPC_FC_SMALL: case RPC_FC_USMALL: + pStubMsg->Buffer += sizeof(UCHAR); + pStubMsg->MemorySize += sizeof(UCHAR); return sizeof(UCHAR); case RPC_FC_WCHAR: case RPC_FC_SHORT: case RPC_FC_USHORT: + pStubMsg->Buffer += sizeof(USHORT); + pStubMsg->MemorySize += sizeof(USHORT); return sizeof(USHORT); case RPC_FC_LONG: case RPC_FC_ULONG: + pStubMsg->Buffer += sizeof(ULONG); + pStubMsg->MemorySize += sizeof(ULONG); return sizeof(ULONG); case RPC_FC_FLOAT: + pStubMsg->Buffer += sizeof(float); + pStubMsg->MemorySize += sizeof(float); return sizeof(float); case RPC_FC_DOUBLE: + pStubMsg->Buffer += sizeof(double); + pStubMsg->MemorySize += sizeof(double); return sizeof(double); case RPC_FC_HYPER: + pStubMsg->Buffer += sizeof(ULONGLONG); + pStubMsg->MemorySize += sizeof(ULONGLONG); return sizeof(ULONGLONG); case RPC_FC_ERROR_STATUS_T: + pStubMsg->Buffer += sizeof(error_status_t); + pStubMsg->MemorySize += sizeof(error_status_t); return sizeof(error_status_t); case RPC_FC_ENUM16: case RPC_FC_ENUM32: + pStubMsg->Buffer += sizeof(INT); + pStubMsg->MemorySize += sizeof(INT); return sizeof(INT); default: FIXME("Unhandled base type: 0x%02x\n", *pFormat);
1
0
0
0
Robert Shearman : rpcrt4: Make NdrConformantStringUnmarshall use the new Read{Variance, Conformance}
by Alexandre Julliard
15 May '06
15 May '06
Module: wine Branch: refs/heads/master Commit: 4d65110b906e7247f7fd312651a25962372bcd0b URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=4d65110b906e7247f7fd312…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Sat May 13 16:58:31 2006 +0100 rpcrt4: Make NdrConformantStringUnmarshall use the new Read{Variance,Conformance} functions and adapt them to be callable without having a correlation descriptor. --- dlls/rpcrt4/ndr_marshall.c | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-) diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c index 6c9e852..65fd57d 100644 --- a/dlls/rpcrt4/ndr_marshall.c +++ b/dlls/rpcrt4/ndr_marshall.c @@ -320,7 +320,7 @@ PFORMAT_STRING ReadConformance(MIDL_STUB static inline PFORMAT_STRING ReadVariance(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat) { - if (!IsConformanceOrVariancePresent(pFormat)) + if (pFormat && !IsConformanceOrVariancePresent(pFormat)) { pStubMsg->Offset = 0; pStubMsg->ActualCount = pStubMsg->MaxCount; @@ -626,18 +626,15 @@ unsigned long WINAPI NdrConformantString unsigned char *WINAPI NdrConformantStringUnmarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char** ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc ) { - unsigned long len, esize, ofs; + unsigned long len, esize; TRACE("(pStubMsg == ^%p, *pMemory == ^%p, pFormat == ^%p, fMustAlloc == %u)\n", pStubMsg, *ppMemory, pFormat, fMustAlloc); assert(pFormat && ppMemory && pStubMsg); - pStubMsg->Buffer += 4; - ofs = NDR_LOCAL_UINT32_READ(pStubMsg->Buffer); - pStubMsg->Buffer += 4; - len = NDR_LOCAL_UINT32_READ(pStubMsg->Buffer); - pStubMsg->Buffer += 4; + ReadConformance(pStubMsg, NULL); + ReadVariance(pStubMsg, NULL); if (*pFormat == RPC_FC_C_CSTRING) esize = 1; else if (*pFormat == RPC_FC_C_WSTRING) esize = 2; @@ -651,6 +648,8 @@ unsigned char *WINAPI NdrConformantStrin FIXME("sized string format=%d\n", pFormat[1]); } + len = pStubMsg->ActualCount; + if (fMustAlloc || !*ppMemory) *ppMemory = NdrAllocate(pStubMsg, len*esize + BUFFER_PARANOIA);
1
0
0
0
Robert Shearman : advapi32: Add tests for getting the groups, user and privileges of a token.
by Alexandre Julliard
15 May '06
15 May '06
Module: wine Branch: refs/heads/master Commit: a33a63712f1a08e471eea2e6e2fbfe4f28145637 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=a33a63712f1a08e471eea2e…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Sat May 13 16:56:59 2006 +0100 advapi32: Add tests for getting the groups, user and privileges of a token. --- dlls/advapi32/tests/security.c | 70 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 70 insertions(+), 0 deletions(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index 1c9ab5d..df2ba61 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -26,6 +26,7 @@ #include "winbase.h" #include "winerror.h" #include "aclapi.h" #include "winnt.h" +#include "sddl.h" typedef VOID (WINAPI *fnBuildTrusteeWithSidA)( PTRUSTEEA pTrustee, PSID pSid ); typedef VOID (WINAPI *fnBuildTrusteeWithNameA)( PTRUSTEEA pTrustee, LPSTR pName ); @@ -693,6 +694,74 @@ static void test_AccessCheck(void) HeapFree(GetProcessHeap(), 0, PrivSet); } +/* test GetTokenInformation for the various attributes */ +static void test_token_attr(void) +{ + HANDLE Token; + DWORD Size; + TOKEN_PRIVILEGES *Privileges; + TOKEN_GROUPS *Groups; + TOKEN_USER *User; + BOOL ret; + DWORD i; + LPTSTR SidString; + + ret = OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &Token); + ok(ret, "OpenProcessToken failed with error %ld\n", GetLastError()); + + /* groups */ + ret = GetTokenInformation(Token, TokenGroups, NULL, 0, &Size); + Groups = HeapAlloc(GetProcessHeap(), 0, Size); + ret = GetTokenInformation(Token, TokenGroups, Groups, Size, &Size); + ok(ret, "GetTokenInformation(TokenGroups) failed with error %ld\n", GetLastError()); + trace("TokenGroups:\n"); + for (i = 0; i < Groups->GroupCount; i++) + { + DWORD NameLength = 255; + TCHAR Name[255]; + DWORD DomainLength = 255; + TCHAR Domain[255]; + SID_NAME_USE SidNameUse; + ConvertSidToStringSid(Groups->Groups[i].Sid, &SidString); + Name[0] = '\0'; + Domain[0] = '\0'; + ret = LookupAccountSid(NULL, Groups->Groups[i].Sid, Name, &NameLength, Domain, &DomainLength, &SidNameUse); + ok(ret, "LookupAccountSid failed with error %ld\n", GetLastError()); + trace("\t%s, %s\\%s attr: 0x%08lx\n", SidString, Domain, Name, Groups->Groups[i].Attributes); + LocalFree(SidString); + } + + /* user */ + ret = GetTokenInformation(Token, TokenUser, NULL, 0, &Size); + ok(!ret && (GetLastError() == ERROR_INSUFFICIENT_BUFFER), + "GetTokenInformation(TokenUser) failed with error %ld\n", GetLastError()); + User = HeapAlloc(GetProcessHeap(), 0, Size); + ret = GetTokenInformation(Token, TokenUser, User, Size, &Size); + ok(ret, + "GetTokenInformation(TokenUser) failed with error %ld\n", GetLastError()); + + ConvertSidToStringSid(User->User.Sid, &SidString); + trace("TokenUser: %s attr: 0x%08lx\n", SidString, User->User.Attributes); + LocalFree(SidString); + + /* privileges */ + ret = GetTokenInformation(Token, TokenPrivileges, NULL, 0, &Size); + ok(!ret && (GetLastError() == ERROR_INSUFFICIENT_BUFFER), + "GetTokenInformation(TokenPrivileges) failed with error %ld\n", GetLastError()); + Privileges = HeapAlloc(GetProcessHeap(), 0, Size); + ret = GetTokenInformation(Token, TokenPrivileges, Privileges, Size, &Size); + ok(ret, + "GetTokenInformation(TokenPrivileges) failed with error %ld\n", GetLastError()); + trace("TokenPrivileges:\n"); + for (i = 0; i < Privileges->PrivilegeCount; i++) + { + TCHAR Name[256]; + DWORD NameLen = sizeof(Name)/sizeof(Name[0]); + LookupPrivilegeName(NULL, &Privileges->Privileges[i].Luid, Name, &NameLen); + trace("\t%s, 0x%lx\n", Name, Privileges->Privileges[i].Attributes); + } +} + START_TEST(security) { init(); @@ -702,4 +771,5 @@ START_TEST(security) test_luid(); test_FileSecurity(); test_AccessCheck(); + test_token_attr(); }
1
0
0
0
Mike McCormack : advapi32: Implement and test SystemFunction004.
by Alexandre Julliard
15 May '06
15 May '06
Module: wine Branch: refs/heads/master Commit: dcfb0f44d1bef8516620d0886f220429ae9a2a56 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=dcfb0f44d1bef8516620d08…
Author: Mike McCormack <mike(a)codeweavers.com> Date: Sun May 14 17:11:16 2006 +0900 advapi32: Implement and test SystemFunction004. --- dlls/advapi32/advapi32.spec | 2 - dlls/advapi32/crypt.h | 6 ++ dlls/advapi32/crypt_arc4.c | 8 +-- dlls/advapi32/crypt_lmhash.c | 62 +++++++++++++++++++++++++ dlls/advapi32/tests/crypt_lmhash.c | 88 ++++++++++++++++++++++++++++++++++++ 5 files changed, 159 insertions(+), 7 deletions(-) diff --git a/dlls/advapi32/advapi32.spec b/dlls/advapi32/advapi32.spec index f9b909b..9f815f5 100644 --- a/dlls/advapi32/advapi32.spec +++ b/dlls/advapi32/advapi32.spec @@ -598,7 +598,7 @@ # @ stub StopTraceW @ stdcall SystemFunction001(ptr ptr ptr) @ stdcall SystemFunction002(ptr ptr ptr) @ stdcall SystemFunction003(ptr ptr) -@ stub SystemFunction004 +@ stdcall SystemFunction004(ptr ptr ptr) @ stub SystemFunction005 @ stdcall SystemFunction006(ptr ptr) @ stdcall SystemFunction007(ptr ptr) diff --git a/dlls/advapi32/crypt.h b/dlls/advapi32/crypt.h index 207ef5d..7959fcc 100644 --- a/dlls/advapi32/crypt.h +++ b/dlls/advapi32/crypt.h @@ -88,4 +88,10 @@ extern unsigned char *CRYPT_DEShash( uns extern unsigned char *CRYPT_DESunhash( unsigned char *dst, const unsigned char *key, const unsigned char *src ); +struct ustring { + DWORD Length; + DWORD MaximumLength; + unsigned char *Buffer; +}; + #endif /* __WINE_CRYPT_H_ */ diff --git a/dlls/advapi32/crypt_arc4.c b/dlls/advapi32/crypt_arc4.c index 9ee4b5e..2bdb5d3 100644 --- a/dlls/advapi32/crypt_arc4.c +++ b/dlls/advapi32/crypt_arc4.c @@ -27,6 +27,8 @@ #define WIN32_NO_STATUS #include "windef.h" #include "winternl.h" +#include "crypt.h" + typedef struct tag_arc4_info { unsigned char state[256]; unsigned char x, y; @@ -76,12 +78,6 @@ static void arc4_ProcessString(arc4_info a4i->y = y; } -struct ustring { - DWORD Length; - DWORD MaximumLength; - unsigned char *Buffer; -}; - /****************************************************************************** * SystemFunction032 [ADVAPI32.@] * diff --git a/dlls/advapi32/crypt_lmhash.c b/dlls/advapi32/crypt_lmhash.c index 0d00777..7070154 100644 --- a/dlls/advapi32/crypt_lmhash.c +++ b/dlls/advapi32/crypt_lmhash.c @@ -157,3 +157,65 @@ NTSTATUS WINAPI SystemFunction003(const CRYPT_DEShash(output, key, CRYPT_LMhash_Magic); return STATUS_SUCCESS; } + +/****************************************************************************** + * SystemFunction004 [ADVAPI32.@] + * + * Encrypts a block of data with DES in ECB mode, preserving the length + * + * PARAMS + * data [I] data to encrypt + * key [I] key data (up to 7 bytes) + * output [O] buffer to receive encrypted data + * + * RETURNS + * Success: STATUS_SUCCESS + * Failure: STATUS_BUFFER_TOO_SMALL if the output buffer is too small + * Failure: STATUS_INVALID_PARAMETER_2 if the key is zero length + * + * NOTES + * Encrypt buffer size should be input size rounded up to 8 bytes + * plus an extra 8 bytes. + */ +NTSTATUS WINAPI SystemFunction004(const struct ustring *in, + const struct ustring *key, + struct ustring *out) +{ + union { + unsigned char uc[8]; + unsigned int ui[2]; + } data; + unsigned char deskey[7]; + int crypt_len, ofs; + + if (key->Length<=0) + return STATUS_INVALID_PARAMETER_2; + + crypt_len = ((in->Length+7)&~7); + if (out->MaximumLength < (crypt_len+8)) + return STATUS_BUFFER_TOO_SMALL; + + data.ui[0] = in->Length; + data.ui[1] = 1; + + if (key->Length<sizeof deskey) + { + memset(deskey, 0, sizeof deskey); + memcpy(deskey, key->Buffer, key->Length); + } + else + memcpy(deskey, key->Buffer, sizeof deskey); + + CRYPT_DEShash(out->Buffer, deskey, data.uc); + + for(ofs=0; ofs<(crypt_len-8); ofs+=8) + CRYPT_DEShash(out->Buffer+8+ofs, deskey, in->Buffer+ofs); + + memset(data.uc, 0, sizeof data.uc); + memcpy(data.uc, in->Buffer+ofs, in->Length +8-crypt_len); + CRYPT_DEShash(out->Buffer+8+ofs, deskey, data.uc); + + out->Length = crypt_len+8; + + return STATUS_SUCCESS; +} diff --git a/dlls/advapi32/tests/crypt_lmhash.c b/dlls/advapi32/tests/crypt_lmhash.c index 207a3e6..2edb843 100644 --- a/dlls/advapi32/tests/crypt_lmhash.c +++ b/dlls/advapi32/tests/crypt_lmhash.c @@ -37,6 +37,7 @@ struct ustring { typedef NTSTATUS (WINAPI *fnSystemFunction001)(const LPBYTE, const LPBYTE, LPBYTE); typedef NTSTATUS (WINAPI *fnSystemFunction002)(const LPBYTE, const LPBYTE, LPBYTE); typedef NTSTATUS (WINAPI *fnSystemFunction003)(const LPBYTE, LPBYTE); +typedef NTSTATUS (WINAPI *fnSystemFunction004)(const struct ustring *, const struct ustring *, struct ustring *); typedef VOID (WINAPI *fnSystemFunction006)( PCSTR passwd, PSTR lmhash ); typedef NTSTATUS (WINAPI *fnSystemFunction008)(const LPBYTE, const LPBYTE, LPBYTE); typedef NTSTATUS (WINAPI *fnSystemFunction032)(struct ustring *, struct ustring *); @@ -44,6 +45,7 @@ typedef NTSTATUS (WINAPI *fnSystemFuncti fnSystemFunction001 pSystemFunction001; fnSystemFunction002 pSystemFunction002; fnSystemFunction003 pSystemFunction003; +fnSystemFunction004 pSystemFunction004; fnSystemFunction006 pSystemFunction006; fnSystemFunction008 pSystemFunction008; fnSystemFunction032 pSystemFunction032; @@ -190,6 +192,88 @@ static void test_SystemFunction003(void) ok( !memcmp(exp2, output, sizeof output), "decrypted message wrong\n"); } +static void test_SystemFunction004(void) +{ + unsigned char inbuf[0x100], keybuf[0x100], resbuf[0x100]; + unsigned char output[8]; + int r; + struct ustring in, key, out; + + /* crash + r = pSystemFunction004(NULL, NULL, NULL); + ok(r == STATUS_UNSUCCESSFUL, "function failed\n"); + */ + + memset(inbuf, 0, sizeof inbuf); + memset(keybuf, 0, sizeof keybuf); + memset(resbuf, 0, sizeof resbuf); + + in.Buffer = NULL; + in.Length = in.MaximumLength = 0; + + key.Buffer = NULL; + key.Length = key.MaximumLength = 0; + + out.Buffer = NULL; + out.Length = out.MaximumLength = 0; + + r = pSystemFunction004(&in, &key, &out); + ok(r == STATUS_INVALID_PARAMETER_2, "function failed\n"); + + key.Buffer = keybuf; + key.Length = 0x100; + key.MaximumLength = 0x100; + + r = pSystemFunction004(&in, &key, (struct ustring *)&out); + ok(r == STATUS_BUFFER_TOO_SMALL, "function failed\n"); + + in.Buffer = inbuf; + in.Length = 0x0c; + in.MaximumLength = 0; + + /* add two identical blocks... */ + inbuf[0] = 1; + inbuf[1] = 2; + inbuf[2] = 3; + inbuf[3] = 4; + + inbuf[8] = 1; + inbuf[9] = 2; + inbuf[10] = 3; + inbuf[11] = 4; + + /* check that the Length field is really obeyed */ + keybuf[6] = 1; + + key.Buffer = keybuf; + key.Length = 6; + key.MaximumLength = 0; + + keybuf[1] = 0x33; + + out.Buffer = resbuf; + out.Length = 0; + out.MaximumLength = 0x40; + r = pSystemFunction004(&in, &key, &out); + ok(r == STATUS_SUCCESS, "function failed\n"); + + keybuf[6] = 0; + + memset(output, 0, sizeof output); + r = pSystemFunction002(out.Buffer, key.Buffer, output); + + ok(((unsigned int*)output)[0] == in.Length, "crypted length wrong\n"); + ok(((unsigned int*)output)[1] == 1, "crypted value wrong\n"); + + memset(output, 0, sizeof output); + r = pSystemFunction002(out.Buffer+8, key.Buffer, output); + ok(!memcmp(output, inbuf, sizeof output), "crypted data wrong\n"); + + memset(output, 0, sizeof output); + r = pSystemFunction002(out.Buffer+16, key.Buffer, output); + ok(!memcmp(output, inbuf, sizeof output), "crypted data wrong\n"); +} + START_TEST(crypt_lmhash) { HMODULE module; @@ -208,6 +292,10 @@ START_TEST(crypt_lmhash) if (pSystemFunction003) test_SystemFunction003(); + pSystemFunction004 = (fnSystemFunction004)GetProcAddress( module, "SystemFunction004" ); + if (pSystemFunction004) + test_SystemFunction004(); + pSystemFunction006 = (fnSystemFunction006)GetProcAddress( module, "SystemFunction006" ); if (pSystemFunction006) test_SystemFunction006();
1
0
0
0
Mike McCormack : advapi32: Implement and test SystemFunction003.
by Alexandre Julliard
15 May '06
15 May '06
Module: wine Branch: refs/heads/master Commit: 09fc7e046a594443ffbe82a6687f4ffe92369b42 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=09fc7e046a594443ffbe82a…
Author: Mike McCormack <mike(a)codeweavers.com> Date: Sun May 14 17:06:22 2006 +0900 advapi32: Implement and test SystemFunction003. --- dlls/advapi32/advapi32.spec | 2 + dlls/advapi32/crypt_lmhash.c | 22 ++++++++++++++ dlls/advapi32/tests/crypt_lmhash.c | 55 ++++++++++++++++++++++++++++-------- 3 files changed, 66 insertions(+), 13 deletions(-) diff --git a/dlls/advapi32/advapi32.spec b/dlls/advapi32/advapi32.spec index cb747b0..f9b909b 100644 --- a/dlls/advapi32/advapi32.spec +++ b/dlls/advapi32/advapi32.spec @@ -597,7 +597,7 @@ # @ stub StopTraceW @ stdcall SynchronizeWindows31FilesAndWindowsNTRegistry(long long long long) @ stdcall SystemFunction001(ptr ptr ptr) @ stdcall SystemFunction002(ptr ptr ptr) -@ stub SystemFunction003 +@ stdcall SystemFunction003(ptr ptr) @ stub SystemFunction004 @ stub SystemFunction005 @ stdcall SystemFunction006(ptr ptr) diff --git a/dlls/advapi32/crypt_lmhash.c b/dlls/advapi32/crypt_lmhash.c index 85e29fb..0d00777 100644 --- a/dlls/advapi32/crypt_lmhash.c +++ b/dlls/advapi32/crypt_lmhash.c @@ -135,3 +135,25 @@ NTSTATUS WINAPI SystemFunction002(const CRYPT_DESunhash(output, key, data); return STATUS_SUCCESS; } + +/****************************************************************************** + * SystemFunction003 [ADVAPI32.@] + * + * Hashes a key using DES and a fixed datablock + * + * PARAMS + * key [I] key data (7 bytes) + * output [O] hashed key (8 bytes) + * + * RETURNS + * Success: STATUS_SUCCESS + * Failure: STATUS_UNSUCCESSFUL + * + */ +NTSTATUS WINAPI SystemFunction003(const LPBYTE key, LPBYTE output) +{ + if (!output) + return STATUS_UNSUCCESSFUL; + CRYPT_DEShash(output, key, CRYPT_LMhash_Magic); + return STATUS_SUCCESS; +} diff --git a/dlls/advapi32/tests/crypt_lmhash.c b/dlls/advapi32/tests/crypt_lmhash.c index c0353d3..207a3e6 100644 --- a/dlls/advapi32/tests/crypt_lmhash.c +++ b/dlls/advapi32/tests/crypt_lmhash.c @@ -34,16 +34,18 @@ struct ustring { unsigned char *Buffer; }; -typedef VOID (WINAPI *fnSystemFunction006)( PCSTR passwd, PSTR lmhash ); -typedef NTSTATUS (WINAPI *fnSystemFunction008)(const LPBYTE, const LPBYTE, LPBYTE); typedef NTSTATUS (WINAPI *fnSystemFunction001)(const LPBYTE, const LPBYTE, LPBYTE); typedef NTSTATUS (WINAPI *fnSystemFunction002)(const LPBYTE, const LPBYTE, LPBYTE); +typedef NTSTATUS (WINAPI *fnSystemFunction003)(const LPBYTE, LPBYTE); +typedef VOID (WINAPI *fnSystemFunction006)( PCSTR passwd, PSTR lmhash ); +typedef NTSTATUS (WINAPI *fnSystemFunction008)(const LPBYTE, const LPBYTE, LPBYTE); typedef NTSTATUS (WINAPI *fnSystemFunction032)(struct ustring *, struct ustring *); -fnSystemFunction006 pSystemFunction006; -fnSystemFunction008 pSystemFunction008; fnSystemFunction001 pSystemFunction001; fnSystemFunction002 pSystemFunction002; +fnSystemFunction003 pSystemFunction003; +fnSystemFunction006 pSystemFunction006; +fnSystemFunction008 pSystemFunction008; fnSystemFunction032 pSystemFunction032; static void test_SystemFunction006(void) @@ -163,12 +165,49 @@ static void test_SystemFunction032(void) ok(!memcmp(expected, data.Buffer, data.Length), "wrong result\n"); } +static void test_SystemFunction003(void) +{ + unsigned char output[8], data[8]; + unsigned char key[7] = { 0xff, 0x37, 0x50, 0xbc, 0xc2, 0xb2, 0x24 }; + unsigned char exp1[8] = { 0x9d, 0x21, 0xc8, 0x86, 0x6c, 0x21, 0xcf, 0x43 }; + char exp2[] = "KGS!@#$%"; + int r; + + r = pSystemFunction003(NULL, NULL); + ok(r == STATUS_UNSUCCESSFUL, "function failed\n"); + + r = pSystemFunction003(key, NULL); + ok(r == STATUS_UNSUCCESSFUL, "function failed\n"); + + memset(data, 0, sizeof data); + r = pSystemFunction003(key, data); + ok(r == STATUS_SUCCESS, "function failed\n"); + ok( !memcmp(exp1, data, sizeof data), "decrypted message wrong\n"); + + memset(output, 0, sizeof output); + r = pSystemFunction002(data, key, output); + + ok( !memcmp(exp2, output, sizeof output), "decrypted message wrong\n"); +} + START_TEST(crypt_lmhash) { HMODULE module; if (!(module = LoadLibrary("advapi32.dll"))) return; + pSystemFunction001 = (fnSystemFunction001)GetProcAddress( module, "SystemFunction001" ); + if (pSystemFunction001) + test_SystemFunction001(); + + pSystemFunction002 = (fnSystemFunction002)GetProcAddress( module, "SystemFunction002" ); + if (pSystemFunction002) + test_SystemFunction002(); + + pSystemFunction003 = (fnSystemFunction003)GetProcAddress( module, "SystemFunction003" ); + if (pSystemFunction003) + test_SystemFunction003(); + pSystemFunction006 = (fnSystemFunction006)GetProcAddress( module, "SystemFunction006" ); if (pSystemFunction006) test_SystemFunction006(); @@ -177,17 +216,9 @@ START_TEST(crypt_lmhash) if (pSystemFunction008) test_SystemFunction008(); - pSystemFunction001 = (fnSystemFunction001)GetProcAddress( module, "SystemFunction001" ); - if (pSystemFunction001) - test_SystemFunction001(); - pSystemFunction032 = (fnSystemFunction032)GetProcAddress( module, "SystemFunction032" ); if (pSystemFunction032) test_SystemFunction032(); - pSystemFunction002 = (fnSystemFunction002)GetProcAddress( module, "SystemFunction002" ); - if (pSystemFunction002) - test_SystemFunction002(); - FreeLibrary( module ); }
1
0
0
0
← Newer
1
...
47
48
49
50
51
52
53
...
87
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
Results per page:
10
25
50
100
200