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
September 2016
----- 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
18 participants
342 discussions
Start a n
N
ew thread
[mjansen] 72760: [NETSHELL.RGS] set eol-style so that hopefully the patchbot will eat a patch without choking on it.
by mjansen@svn.reactos.org
Author: mjansen Date: Wed Sep 21 17:55:35 2016 New Revision: 72760 URL:
http://svn.reactos.org/svn/reactos?rev=72760&view=rev
Log: [NETSHELL.RGS] set eol-style so that hopefully the patchbot will eat a patch without choking on it. Modified: trunk/reactos/dll/shellext/netshell/res/netshell.rgs (contents, props changed) Modified: trunk/reactos/dll/shellext/netshell/res/netshell.rgs URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/netshell/res/…
============================================================================== --- trunk/reactos/dll/shellext/netshell/res/netshell.rgs [iso-8859-1] (original) +++ trunk/reactos/dll/shellext/netshell/res/netshell.rgs [iso-8859-1] Wed Sep 21 17:55:35 2016 @@ -1,60 +1,60 @@ -HKCR -{ - NoRemove CLSID - { - ForceRemove {7007ACC7-3202-11D1-AAD2-00805FC1270E} = s 'Network Connections' - { - InprocServer32 = s '%MODULE%' - { - val ThreadingModel = s 'Both' - } - DefaultIcon = s '%MODULE%' - ShellFolder - { - val Attributes = d '0x00000020' - } - val LocalizedString = s '@%MODULE%,-10000' - } - ForceRemove {7007ACC5-3202-11D1-AAD2-00805FC1270E} = s 'LAN Connection UI' - { - InprocServer32 = s '%MODULE%' - { - val ThreadingModel = s 'Both' - } - } - ForceRemove {7007ACCF-3202-11D1-AAD2-00805FC1270E} = s 'Network Connections Status Icon' - { - InprocServer32 = s '%MODULE%' - { - val ThreadingModel = s 'Both' - } - } - } -} -HKLM -{ - NoRemove Software - { - NoRemove Microsoft - { - NoRemove Windows - { - NoRemove CurrentVersion - { - NoRemove Explorer - { - NoRemove ControlPanel - { - NoRemove NameSpace - { - ForceRemove {7007ACC7-3202-11D1-AAD2-00805FC1270E} = s 'Network Connections' - { - } - } - } - } - } - } - } - } -} +HKCR +{ + NoRemove CLSID + { + ForceRemove {7007ACC7-3202-11D1-AAD2-00805FC1270E} = s 'Network Connections' + { + InprocServer32 = s '%MODULE%' + { + val ThreadingModel = s 'Both' + } + DefaultIcon = s '%MODULE%' + ShellFolder + { + val Attributes = d '0x00000020' + } + val LocalizedString = s '@%MODULE%,-10000' + } + ForceRemove {7007ACC5-3202-11D1-AAD2-00805FC1270E} = s 'LAN Connection UI' + { + InprocServer32 = s '%MODULE%' + { + val ThreadingModel = s 'Both' + } + } + ForceRemove {7007ACCF-3202-11D1-AAD2-00805FC1270E} = s 'Network Connections Status Icon' + { + InprocServer32 = s '%MODULE%' + { + val ThreadingModel = s 'Both' + } + } + } +} +HKLM +{ + NoRemove Software + { + NoRemove Microsoft + { + NoRemove Windows + { + NoRemove CurrentVersion + { + NoRemove Explorer + { + NoRemove ControlPanel + { + NoRemove NameSpace + { + ForceRemove {7007ACC7-3202-11D1-AAD2-00805FC1270E} = s 'Network Connections' + { + } + } + } + } + } + } + } + } +} Propchange: trunk/reactos/dll/shellext/netshell/res/netshell.rgs ------------------------------------------------------------------------------ svn:eol-style = native
8 years, 3 months
1
0
0
0
[akhaldi] 72759: [IPHLPAPI] Fix all testIcmpSendEcho tests. By Peter Hater. Please see CORE-11993 for the list of changes.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Sep 21 15:53:17 2016 New Revision: 72759 URL:
http://svn.reactos.org/svn/reactos?rev=72759&view=rev
Log: [IPHLPAPI] Fix all testIcmpSendEcho tests. By Peter Hater. Please see CORE-11993 for the list of changes. Modified: trunk/reactos/dll/win32/iphlpapi/icmp.c trunk/reactos/dll/win32/iphlpapi/ip.h Modified: trunk/reactos/dll/win32/iphlpapi/icmp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/iphlpapi/icmp.c?…
============================================================================== --- trunk/reactos/dll/win32/iphlpapi/icmp.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/iphlpapi/icmp.c [iso-8859-1] Wed Sep 21 15:53:17 2016 @@ -538,8 +538,23 @@ return 0; } - if (ReplySize<sizeof(ICMP_ECHO_REPLY)+ICMP_MINLEN) { - SetLastError(IP_BUF_TOO_SMALL); + if (ReplySize<sizeof(ICMP_ECHO_REPLY)) { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + + if (ReplySize-RequestSize<sizeof(ICMP_ECHO_REPLY)) { + SetLastError(IP_GENERAL_FAILURE); + return 0; + } + + if (!ReplyBuffer) { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + + if (Timeout == 0 || Timeout == -1) { + SetLastError(ERROR_INVALID_PARAMETER); return 0; } /* check the request size against SO_MAX_MSG_SIZE using getsockopt */ @@ -564,7 +579,9 @@ #endif seq=InterlockedIncrement(&icmp_sequence) & 0xFFFF; - reqsize=ICMP_MINLEN+RequestSize; + reqsize=ICMP_MINLEN; + if (RequestData && RequestSize > 0) + reqsize += RequestSize; reqbuf=HeapAlloc(GetProcessHeap(), 0, reqsize); if (reqbuf==NULL) { SetLastError(ERROR_OUTOFMEMORY); @@ -577,7 +594,8 @@ icmp_header->icmp_cksum=0; icmp_header->icmp_id=id; icmp_header->icmp_seq=seq; - memcpy(reqbuf+ICMP_MINLEN, RequestData, RequestSize); + if (RequestData && RequestSize > 0) + memcpy(reqbuf+ICMP_MINLEN, RequestData, RequestSize); icmp_header->icmp_cksum=cksum=in_cksum((u_short*)reqbuf,reqsize); addr.sin_family=AF_INET; @@ -633,9 +651,8 @@ #endif addrlen=sizeof(addr); ier=ReplyBuffer; - ip_header=(struct ip *) ((char *) ReplyBuffer+sizeof(ICMP_ECHO_REPLY)); - endbuf=(char *) ReplyBuffer+ReplySize; - maxlen=ReplySize-sizeof(ICMP_ECHO_REPLY); + endbuf=((char *) ReplyBuffer)+ReplySize; + maxlen=sizeof(struct ip)+ICMP_MINLEN+RequestSize; /* Send the packet */ TRACE("Sending %d bytes (RequestSize=%d) to %s\n", reqsize, RequestSize, inet_ntoa(addr.sin_addr)); @@ -673,6 +690,7 @@ } /* Get the reply */ + ip_header=HeapAlloc(GetProcessHeap(), 0, maxlen); ip_header_len=0; /* because gcc was complaining */ #ifdef __REACTOS__ while ((res=select(icp->sid+1,&fdr,NULL,NULL,&timeout))>0) { @@ -683,6 +701,8 @@ res=recvfrom(icp->sid, (char*)ip_header, maxlen, 0, (struct sockaddr*)&addr,(int*)&addrlen); TRACE("received %d bytes from %s\n",res, inet_ntoa(addr.sin_addr)); ier->Status=IP_REQ_TIMED_OUT; + if (res < 0) + break; /* Check whether we should ignore this packet */ if ((ip_header->ip_p==IPPROTO_ICMP) && (res>=sizeof(struct ip)+ICMP_MINLEN)) { @@ -704,7 +724,7 @@ case ICMP_UNREACH_ISOLATED: #endif #ifdef ICMP_UNREACH_HOST_PROHIB - case ICMP_UNREACH_HOST_PROHIB: + case ICMP_UNREACH_HOST_PROHIB: #endif #ifdef ICMP_UNREACH_TOSHOST case ICMP_UNREACH_TOSHOST: @@ -744,9 +764,9 @@ rep_ip_header=(struct ip*)(((char*)icmp_header)+ICMP_MINLEN); rep_icmp_header=(struct icmp*)(((char*)rep_ip_header)+(rep_ip_header->ip_hl << 2)); - /* Make sure that this is really a reply to our packet */ + /* Make sure that this is really a reply to our packet */ if (ip_header_len+ICMP_MINLEN+(rep_ip_header->ip_hl << 2)+ICMP_MINLEN>ip_header->ip_len) { - ier->Status=IP_REQ_TIMED_OUT; + ier->Status=IP_REQ_TIMED_OUT; } else if ((rep_icmp_header->icmp_type!=ICMP_ECHO) || (rep_icmp_header->icmp_code!=0) || (rep_icmp_header->icmp_id!=id) || @@ -762,11 +782,11 @@ TRACE("expected type,code=8,0 id,seq=%d,%d cksum=%d\n", id,seq, cksum); - ier->Status=IP_REQ_TIMED_OUT; - } + ier->Status=IP_REQ_TIMED_OUT; + } } - } - } + } + } if (ier->Status==IP_REQ_TIMED_OUT) { /* This packet was not for us. @@ -778,6 +798,8 @@ if (t < 0) t = 0; timeout.tv_sec = t / 1000; timeout.tv_usec = (t % 1000) * 1000; + FD_ZERO(&fdr); + FD_SET(icp->sid, &fdr); #else DWORD t = (recv_time - send_time); if (Timeout > t) Timeout -= t; @@ -809,8 +831,6 @@ /* Prepare for the next packet */ ier++; - ip_header=(struct ip*)(((char*)ip_header)+sizeof(ICMP_ECHO_REPLY)); - maxlen=endbuf-(char*)ip_header; /* Check out whether there is more but don't wait this time */ #ifdef __REACTOS__ @@ -825,6 +845,7 @@ FD_SET(icp->sid,&fdr); #endif } + HeapFree(GetProcessHeap(), 0, ip_header); res=ier-(ICMP_ECHO_REPLY*)ReplyBuffer; if (res==0) SetLastError(IP_REQ_TIMED_OUT); Modified: trunk/reactos/dll/win32/iphlpapi/ip.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/iphlpapi/ip.h?re…
============================================================================== --- trunk/reactos/dll/win32/iphlpapi/ip.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/iphlpapi/ip.h [iso-8859-1] Wed Sep 21 15:53:17 2016 @@ -61,6 +61,16 @@ #ifdef _IP_VHL u_char ip_vhl; /* version << 4 | header length >> 2 */ #else +#ifdef __REACTOS__ +#if BYTE_ORDER == LITTLE_ENDIAN + u_char ip_hl : 4, /* header length */ + ip_v : 4; /* version */ +#endif +#if BYTE_ORDER == BIG_ENDIAN + u_char ip_v : 4, /* version */ + ip_hl : 4; /* header length */ +#endif +#else #if BYTE_ORDER == LITTLE_ENDIAN u_int ip_hl:4, /* header length */ ip_v:4; /* version */ @@ -69,6 +79,7 @@ u_int ip_v:4, /* version */ ip_hl:4; /* header length */ #endif +#endif /* __REACTOS__ */ #endif /* not _IP_VHL */ u_char ip_tos; /* type of service */ u_short ip_len; /* total length */ @@ -151,6 +162,16 @@ u_char ipt_code; /* IPOPT_TS */ u_char ipt_len; /* size of structure (variable) */ u_char ipt_ptr; /* index of current entry */ +#ifdef __REACTOS__ +#if BYTE_ORDER == LITTLE_ENDIAN + u_char ipt_flg:4, /* flags, see below */ + ipt_oflw:4; /* overflow counter */ +#endif +#if BYTE_ORDER == BIG_ENDIAN + u_char ipt_oflw:4, /* overflow counter */ + ipt_flg:4; /* flags, see below */ +#endif +#else #if BYTE_ORDER == LITTLE_ENDIAN u_int ipt_flg:4, /* flags, see below */ ipt_oflw:4; /* overflow counter */ @@ -159,6 +180,7 @@ u_int ipt_oflw:4, /* overflow counter */ ipt_flg:4; /* flags, see below */ #endif +#endif /* __REACTOS__ */ union ipt_timestamp { n_long ipt_time[1]; struct ipt_ta {
8 years, 3 months
1
0
0
0
[hbelusca] 72758: [LSALIB]: Fix build (and 2 dprints in the process).
by hbelusca@svn.reactos.org
Author: hbelusca Date: Wed Sep 21 14:02:54 2016 New Revision: 72758 URL:
http://svn.reactos.org/svn/reactos?rev=72758&view=rev
Log: [LSALIB]: Fix build (and 2 dprints in the process). Modified: trunk/reactos/sdk/lib/lsalib/lsa.c Modified: trunk/reactos/sdk/lib/lsalib/lsa.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/lsalib/lsa.c?rev=7…
============================================================================== --- trunk/reactos/sdk/lib/lsalib/lsa.c [iso-8859-1] (original) +++ trunk/reactos/sdk/lib/lsalib/lsa.c [iso-8859-1] Wed Sep 21 14:02:54 2016 @@ -278,7 +278,7 @@ &ObjectAttributes); if (!NT_SUCCESS(Status)) { - DPRINT"NtOpenEvent failed (Status 0x%08lx)\n", Status); + DPRINT("ZwOpenEvent failed (Status 0x%08lx)\n", Status); Status = ZwCreateEvent(&EventHandle, SYNCHRONIZE, @@ -287,7 +287,7 @@ FALSE); if (!NT_SUCCESS(Status)) { - DPRINT1("NtCreateEvent failed (Status 0x%08lx)\n", Status); + DPRINT1("ZwCreateEvent failed (Status 0x%08lx)\n", Status); return Status; } } @@ -298,7 +298,7 @@ ZwClose(EventHandle); if (!NT_SUCCESS(Status)) { - DPRINT1("NtWaitForSingleObject failed (Status 0x%08lx)\n", Status); + DPRINT1("ZwWaitForSingleObject failed (Status 0x%08lx)\n", Status); return Status; }
8 years, 3 months
1
0
0
0
[ekohl] 72757: [LSASRV] Revert all pointless changes from r72751.
by ekohl@svn.reactos.org
Author: ekohl Date: Wed Sep 21 10:49:40 2016 New Revision: 72757 URL:
http://svn.reactos.org/svn/reactos?rev=72757&view=rev
Log: [LSASRV] Revert all pointless changes from r72751. Modified: trunk/reactos/sdk/lib/lsalib/lsa.c Modified: trunk/reactos/sdk/lib/lsalib/lsa.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/lsalib/lsa.c?rev=7…
============================================================================== --- trunk/reactos/sdk/lib/lsalib/lsa.c [iso-8859-1] (original) +++ trunk/reactos/sdk/lib/lsalib/lsa.c [iso-8859-1] Wed Sep 21 10:49:40 2016 @@ -35,8 +35,8 @@ OUT PULONG ReturnBufferLength, OUT PNTSTATUS ProtocolStatus) { - NTSTATUS Status; LSA_API_MSG ApiMessage; + NTSTATUS Status; DPRINT1("LsaCallAuthenticationPackage()\n"); @@ -77,9 +77,50 @@ */ NTSTATUS NTAPI +LsaDeregisterLogonProcess(IN HANDLE LsaHandle) +{ + LSA_API_MSG ApiMessage; + NTSTATUS Status; + + DPRINT("LsaDeregisterLogonProcess()\n"); + + ApiMessage.ApiNumber = LSASS_REQUEST_DEREGISTER_LOGON_PROCESS; + ApiMessage.h.u1.s1.DataLength = LSA_PORT_DATA_SIZE(ApiMessage.DeregisterLogonProcess); + ApiMessage.h.u1.s1.TotalLength = LSA_PORT_MESSAGE_SIZE; + ApiMessage.h.u2.ZeroInit = 0; + + Status = ZwRequestWaitReplyPort(LsaHandle, + (PPORT_MESSAGE)&ApiMessage, + (PPORT_MESSAGE)&ApiMessage); + if (!NT_SUCCESS(Status)) + { + DPRINT1("ZwRequestWaitReplyPort() failed (Status 0x%08lx)\n", Status); + return Status; + } + + if (!NT_SUCCESS(ApiMessage.Status)) + { + DPRINT1("ZwRequestWaitReplyPort() failed (ApiMessage.Status 0x%08lx)\n", ApiMessage.Status); + return ApiMessage.Status; + } + + ZwClose(LsaHandle); + + DPRINT("LsaDeregisterLogonProcess() done (Status 0x%08lx)\n", Status); + + return Status; +} + + +/* + * @implemented + */ +NTSTATUS +NTAPI LsaFreeReturnBuffer(IN PVOID Buffer) { SIZE_T Size = 0; + return ZwFreeVirtualMemory(NtCurrentProcess(), &Buffer, &Size, @@ -96,8 +137,8 @@ IN PLSA_STRING PackageName, OUT PULONG AuthenticationPackage) { - NTSTATUS Status; LSA_API_MSG ApiMessage; + NTSTATUS Status; /* Check the package name length */ if (PackageName->Length > LSASS_MAX_PACKAGE_NAME_LENGTH) @@ -155,8 +196,8 @@ OUT PQUOTA_LIMITS Quotas, OUT PNTSTATUS SubStatus) { - NTSTATUS Status; LSA_API_MSG ApiMessage; + NTSTATUS Status; ApiMessage.ApiNumber = LSASS_REQUEST_LOGON_USER; ApiMessage.h.u1.s1.DataLength = LSA_PORT_DATA_SIZE(ApiMessage.LogonUser); @@ -301,43 +342,3 @@ return ConnectInfo.Status; } - - -/* - * @implemented - */ -NTSTATUS -NTAPI -LsaDeregisterLogonProcess(IN HANDLE LsaHandle) -{ - NTSTATUS Status; - LSA_API_MSG ApiMessage; - - DPRINT("LsaDeregisterLogonProcess()\n"); - - ApiMessage.ApiNumber = LSASS_REQUEST_DEREGISTER_LOGON_PROCESS; - ApiMessage.h.u1.s1.DataLength = LSA_PORT_DATA_SIZE(ApiMessage.DeregisterLogonProcess); - ApiMessage.h.u1.s1.TotalLength = LSA_PORT_MESSAGE_SIZE; - ApiMessage.h.u2.ZeroInit = 0; - - Status = ZwRequestWaitReplyPort(LsaHandle, - (PPORT_MESSAGE)&ApiMessage, - (PPORT_MESSAGE)&ApiMessage); - if (!NT_SUCCESS(Status)) - { - DPRINT1("ZwRequestWaitReplyPort() failed (Status 0x%08lx)\n", Status); - return Status; - } - - if (!NT_SUCCESS(ApiMessage.Status)) - { - DPRINT1("ZwRequestWaitReplyPort() failed (ApiMessage.Status 0x%08lx)\n", ApiMessage.Status); - return ApiMessage.Status; - } - - ZwClose(LsaHandle); - - DPRINT("LsaDeregisterLogonProcess() done (Status 0x%08lx)\n", Status); - - return Status; -}
8 years, 3 months
1
0
0
0
[ekohl] 72756: [LSALIB] - LsaRegisterLogonProcess: Wait for the LSA_AUTHENTICATION_INITIALIZED event. - LsaDeregisterLogonProcess: Use ZwClose to close the port handle.
by ekohl@svn.reactos.org
Author: ekohl Date: Wed Sep 21 10:27:06 2016 New Revision: 72756 URL:
http://svn.reactos.org/svn/reactos?rev=72756&view=rev
Log: [LSALIB] - LsaRegisterLogonProcess: Wait for the LSA_AUTHENTICATION_INITIALIZED event. - LsaDeregisterLogonProcess: Use ZwClose to close the port handle. Modified: trunk/reactos/sdk/lib/lsalib/lsa.c Modified: trunk/reactos/sdk/lib/lsalib/lsa.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/lsalib/lsa.c?rev=7…
============================================================================== --- trunk/reactos/sdk/lib/lsalib/lsa.c [iso-8859-1] (original) +++ trunk/reactos/sdk/lib/lsalib/lsa.c [iso-8859-1] Wed Sep 21 10:27:06 2016 @@ -209,17 +209,14 @@ OUT PHANDLE LsaHandle, OUT PLSA_OPERATIONAL_MODE OperationalMode) { - NTSTATUS Status; -#if 0 - HANDLE EventHandle; -#endif - UNICODE_STRING PortName; // = RTL_CONSTANT_STRING(L"\\LsaAuthenticationPort"); -#if 0 - OBJECT_ATTRIBUTES ObjectAttributes; -#endif SECURITY_QUALITY_OF_SERVICE SecurityQos; LSA_CONNECTION_INFO ConnectInfo; ULONG ConnectInfoLength = sizeof(ConnectInfo); + UNICODE_STRING PortName; + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING EventName; + HANDLE EventHandle; + NTSTATUS Status; DPRINT("LsaRegisterLogonProcess()\n"); @@ -227,36 +224,46 @@ if (LogonProcessName->Length > LSASS_MAX_LOGON_PROCESS_NAME_LENGTH) return STATUS_NAME_TOO_LONG; -#if 0 - /* - * First check whether the LSA server is ready: - * open the LSA event and wait on it. - */ - // Note that we just reuse the 'PortName' variable here. - RtlInitUnicodeString(&PortName, L"\\SECURITY\\LSA_AUTHENTICATION_INITIALIZED"); + /* Wait for the LSA authentication thread */ + RtlInitUnicodeString(&EventName, + L"\\SECURITY\\LSA_AUTHENTICATION_INITIALIZED"); InitializeObjectAttributes(&ObjectAttributes, - &PortName, - OBJ_CASE_INSENSITIVE, + &EventName, + OBJ_CASE_INSENSITIVE | OBJ_PERMANENT, NULL, NULL); - Status = NtOpenEvent(&EventHandle, SYNCHRONIZE, &ObjectAttributes); - if (!NT_SUCCESS(Status)) - { - DPRINT1("NtOpenEvent failed (Status 0x%08lx)\n", Status); - return Status; - } - - Status = NtWaitForSingleObject(EventHandle, TRUE, NULL); - NtClose(EventHandle); + Status = ZwOpenEvent(&EventHandle, + SYNCHRONIZE, + &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + DPRINT"NtOpenEvent failed (Status 0x%08lx)\n", Status); + + Status = ZwCreateEvent(&EventHandle, + SYNCHRONIZE, + &ObjectAttributes, + NotificationEvent, + FALSE); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtCreateEvent failed (Status 0x%08lx)\n", Status); + return Status; + } + } + + Status = ZwWaitForSingleObject(EventHandle, + TRUE, + NULL); + ZwClose(EventHandle); if (!NT_SUCCESS(Status)) { DPRINT1("NtWaitForSingleObject failed (Status 0x%08lx)\n", Status); return Status; } -#endif - - /* Now attempt the connection */ - RtlInitUnicodeString(&PortName, L"\\LsaAuthenticationPort"); + + /* Establish the connection */ + RtlInitUnicodeString(&PortName, + L"\\LsaAuthenticationPort"); SecurityQos.Length = sizeof(SecurityQos); SecurityQos.ImpersonationLevel = SecurityIdentification; @@ -328,7 +335,7 @@ return ApiMessage.Status; } - NtClose(LsaHandle); + ZwClose(LsaHandle); DPRINT("LsaDeregisterLogonProcess() done (Status 0x%08lx)\n", Status);
8 years, 3 months
1
0
0
0
[ekohl] 72755: [LSASRV] Open/Create and set the \\SECURITY\\LSA_AUTHENTICATION_INITIALIZED event after the LsaAuthenticationPort has been created.
by ekohl@svn.reactos.org
Author: ekohl Date: Wed Sep 21 07:27:18 2016 New Revision: 72755 URL:
http://svn.reactos.org/svn/reactos?rev=72755&view=rev
Log: [LSASRV] Open/Create and set the \\SECURITY\\LSA_AUTHENTICATION_INITIALIZED event after the LsaAuthenticationPort has been created. Modified: trunk/reactos/dll/win32/lsasrv/authport.c trunk/reactos/dll/win32/lsasrv/lsasrv.h Modified: trunk/reactos/dll/win32/lsasrv/authport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/authport.…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/authport.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/authport.c [iso-8859-1] Wed Sep 21 07:27:18 2016 @@ -262,7 +262,11 @@ OBJECT_ATTRIBUTES ObjectAttributes; UNICODE_STRING PortName; DWORD ThreadId; + UNICODE_STRING EventName; + HANDLE EventHandle; NTSTATUS Status; + + TRACE("StartAuthenticationPort()\n"); /* Initialize the logon context list */ InitializeListHead(&LsapLogonContextList); @@ -283,7 +287,41 @@ sizeof(LSA_API_MSG) * 32); if (!NT_SUCCESS(Status)) { - TRACE("NtCreatePort() failed (Status %lx)\n", Status); + WARN("NtCreatePort() failed (Status %lx)\n", Status); + return Status; + } + + RtlInitUnicodeString(&EventName, + L"\\SECURITY\\LSA_AUTHENTICATION_INITIALIZED"); + InitializeObjectAttributes(&ObjectAttributes, + &EventName, + OBJ_CASE_INSENSITIVE | OBJ_PERMANENT, + NULL, + NULL); + Status = NtOpenEvent(&EventHandle, + EVENT_MODIFY_STATE, + &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + TRACE("NtOpenEvent failed (Status 0x%08lx)\n", Status); + + Status = NtCreateEvent(&EventHandle, + EVENT_MODIFY_STATE, + &ObjectAttributes, + NotificationEvent, + FALSE); + if (!NT_SUCCESS(Status)) + { + WARN("NtCreateEvent failed (Status 0x%08lx)\n", Status); + return Status; + } + } + + Status = NtSetEvent(EventHandle, NULL); + NtClose(EventHandle); + if (!NT_SUCCESS(Status)) + { + WARN("NtSetEvent failed (Status 0x%08lx)\n", Status); return Status; } Modified: trunk/reactos/dll/win32/lsasrv/lsasrv.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/lsasrv.h?…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/lsasrv.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/lsasrv.h [iso-8859-1] Wed Sep 21 07:27:18 2016 @@ -22,6 +22,7 @@ #define NTOS_MODE_USER #include <ndk/cmfuncs.h> +#include <ndk/exfuncs.h> #include <ndk/kefuncs.h> #include <ndk/mmfuncs.h> #include <ndk/obfuncs.h>
8 years, 3 months
1
0
0
0
[ekohl] 72754: [LSALIB][SECUR32] - Move LsaConnectUntrusted() from sdk/lib/lsalib/lsa.c to dll/win32/secur32/lsalpc.c as it is not exported from ntoskrnl. - Remove obsolete code from lsalib.
by ekohl@svn.reactos.org
Author: ekohl Date: Wed Sep 21 06:19:22 2016 New Revision: 72754 URL:
http://svn.reactos.org/svn/reactos?rev=72754&view=rev
Log: [LSALIB][SECUR32] - Move LsaConnectUntrusted() from sdk/lib/lsalib/lsa.c to dll/win32/secur32/lsalpc.c as it is not exported from ntoskrnl. - Remove obsolete code from lsalib. Modified: trunk/reactos/dll/win32/secur32/lsalpc.c trunk/reactos/sdk/lib/lsalib/lsa.c Modified: trunk/reactos/dll/win32/secur32/lsalpc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/secur32/lsalpc.c…
============================================================================== --- trunk/reactos/dll/win32/secur32/lsalpc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/secur32/lsalpc.c [iso-8859-1] Wed Sep 21 06:19:22 2016 @@ -108,6 +108,62 @@ */ NTSTATUS NTAPI +LsaConnectUntrusted( + OUT PHANDLE LsaHandle) +{ + UNICODE_STRING PortName; + SECURITY_QUALITY_OF_SERVICE SecurityQos; + LSA_CONNECTION_INFO ConnectInfo; + ULONG ConnectInfoLength = sizeof(ConnectInfo); + NTSTATUS Status; + + TRACE("LsaConnectUntrusted(%p)\n", LsaHandle); + + // TODO: Wait on L"\\SECURITY\\LSA_AUTHENTICATION_INITIALIZED" event + // for the LSA server to be ready, and because we are untrusted, + // we may need to impersonate ourselves before! + + RtlInitUnicodeString(&PortName, + L"\\LsaAuthenticationPort"); + + SecurityQos.Length = sizeof(SecurityQos); + SecurityQos.ImpersonationLevel = SecurityIdentification; + SecurityQos.ContextTrackingMode = SECURITY_DYNAMIC_TRACKING; + SecurityQos.EffectiveOnly = TRUE; + + RtlZeroMemory(&ConnectInfo, + ConnectInfoLength); + + ConnectInfo.CreateContext = TRUE; + + Status = NtConnectPort(LsaHandle, + &PortName, + &SecurityQos, + NULL, + NULL, + NULL, + &ConnectInfo, + &ConnectInfoLength); + if (!NT_SUCCESS(Status)) + { + ERR("NtConnectPort failed (Status 0x%08lx)\n", Status); + return Status; + } + + if (!NT_SUCCESS(ConnectInfo.Status)) + { + ERR("ConnectInfo.Status: 0x%08lx\n", ConnectInfo.Status); + } + + return ConnectInfo.Status; +} + + +/* + * @implemented + */ +NTSTATUS +NTAPI LsaEnumerateLogonSessions( PULONG LogonSessionCount, PLUID *LogonSessionList) Modified: trunk/reactos/sdk/lib/lsalib/lsa.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/lsalib/lsa.c?rev=7…
============================================================================== --- trunk/reactos/sdk/lib/lsalib/lsa.c [iso-8859-1] (original) +++ trunk/reactos/sdk/lib/lsalib/lsa.c [iso-8859-1] Wed Sep 21 06:19:22 2016 @@ -15,76 +15,12 @@ #include <ndk/mmfuncs.h> #include <ndk/rtlfuncs.h> #include <ndk/obfuncs.h> -// #include <psdk/ntsecapi.h> #include <lsass/lsass.h> #define NDEBUG #include <debug.h> -/* GLOBALS *******************************************************************/ - -// FIXME: Do we really need this?! -#if !defined(__NTOSKRNL__) && !defined(_NTOSKRNL_) && !defined(_NTSYSTEM_) -extern HANDLE Secur32Heap; -#endif - /* FUNCTIONS *****************************************************************/ - -/* This API is not defined and exported by NTOSKRNL */ -#if !defined(__NTOSKRNL__) && !defined(_NTOSKRNL_) && !defined(_NTSYSTEM_) -/* - * @implemented - */ -NTSTATUS -NTAPI -LsaConnectUntrusted(OUT PHANDLE LsaHandle) -{ - NTSTATUS Status; - UNICODE_STRING PortName; // = RTL_CONSTANT_STRING(L"\\LsaAuthenticationPort"); - SECURITY_QUALITY_OF_SERVICE SecurityQos; - LSA_CONNECTION_INFO ConnectInfo; - ULONG ConnectInfoLength = sizeof(ConnectInfo); - - DPRINT("LsaConnectUntrusted(%p)\n", LsaHandle); - - // TODO: Wait on L"\\SECURITY\\LSA_AUTHENTICATION_INITIALIZED" event - // for the LSA server to be ready, and because we are untrusted, - // we may need to impersonate ourselves before! - - RtlInitUnicodeString(&PortName, L"\\LsaAuthenticationPort"); - - SecurityQos.Length = sizeof(SecurityQos); - SecurityQos.ImpersonationLevel = SecurityIdentification; - SecurityQos.ContextTrackingMode = SECURITY_DYNAMIC_TRACKING; - SecurityQos.EffectiveOnly = TRUE; - - RtlZeroMemory(&ConnectInfo, - ConnectInfoLength); - - ConnectInfo.CreateContext = TRUE; - - Status = ZwConnectPort(LsaHandle, - &PortName, - &SecurityQos, - NULL, - NULL, - NULL, - &ConnectInfo, - &ConnectInfoLength); - if (!NT_SUCCESS(Status)) - { - DPRINT1("ZwConnectPort failed (Status 0x%08lx)\n", Status); - return Status; - } - - if (!NT_SUCCESS(ConnectInfo.Status)) - { - DPRINT1("ConnectInfo.Status: 0x%08lx\n", ConnectInfo.Status); - } - - return ConnectInfo.Status; -} -#endif /* * @implemented
8 years, 3 months
1
0
0
0
[ekohl] 72753: [LSALIB] LsaRegisterLogonProcess: Do not wait for \\SECURITY\\LSA_AUTHENTICATION_INITIALIZED to get signaled as it breaks the boot.
by ekohl@svn.reactos.org
Author: ekohl Date: Wed Sep 21 06:11:02 2016 New Revision: 72753 URL:
http://svn.reactos.org/svn/reactos?rev=72753&view=rev
Log: [LSALIB] LsaRegisterLogonProcess: Do not wait for \\SECURITY\\LSA_AUTHENTICATION_INITIALIZED to get signaled as it breaks the boot. Modified: trunk/reactos/sdk/lib/lsalib/lsa.c Modified: trunk/reactos/sdk/lib/lsalib/lsa.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/lsalib/lsa.c?rev=7…
============================================================================== --- trunk/reactos/sdk/lib/lsalib/lsa.c [iso-8859-1] (original) +++ trunk/reactos/sdk/lib/lsalib/lsa.c [iso-8859-1] Wed Sep 21 06:11:02 2016 @@ -274,9 +274,13 @@ OUT PLSA_OPERATIONAL_MODE OperationalMode) { NTSTATUS Status; +#if 0 HANDLE EventHandle; +#endif UNICODE_STRING PortName; // = RTL_CONSTANT_STRING(L"\\LsaAuthenticationPort"); +#if 0 OBJECT_ATTRIBUTES ObjectAttributes; +#endif SECURITY_QUALITY_OF_SERVICE SecurityQos; LSA_CONNECTION_INFO ConnectInfo; ULONG ConnectInfoLength = sizeof(ConnectInfo); @@ -287,6 +291,7 @@ if (LogonProcessName->Length > LSASS_MAX_LOGON_PROCESS_NAME_LENGTH) return STATUS_NAME_TOO_LONG; +#if 0 /* * First check whether the LSA server is ready: * open the LSA event and wait on it. @@ -312,6 +317,7 @@ DPRINT1("NtWaitForSingleObject failed (Status 0x%08lx)\n", Status); return Status; } +#endif /* Now attempt the connection */ RtlInitUnicodeString(&PortName, L"\\LsaAuthenticationPort");
8 years, 3 months
1
0
0
0
[ekohl] 72752: [NTOSKRNL] - Move the session notification routines from se/lsa.c to se/srm.c. - Get rid of se/lsa.c.
by ekohl@svn.reactos.org
Author: ekohl Date: Wed Sep 21 04:57:25 2016 New Revision: 72752 URL:
http://svn.reactos.org/svn/reactos?rev=72752&view=rev
Log: [NTOSKRNL] - Move the session notification routines from se/lsa.c to se/srm.c. - Get rid of se/lsa.c. Removed: trunk/reactos/ntoskrnl/se/lsa.c Modified: trunk/reactos/ntoskrnl/ntos.cmake trunk/reactos/ntoskrnl/se/srm.c Modified: trunk/reactos/ntoskrnl/ntos.cmake URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntos.cmake?rev=72…
============================================================================== --- trunk/reactos/ntoskrnl/ntos.cmake [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ntos.cmake [iso-8859-1] Wed Sep 21 04:57:25 2016 @@ -259,7 +259,6 @@ ${REACTOS_SOURCE_DIR}/ntoskrnl/se/accesschk.c ${REACTOS_SOURCE_DIR}/ntoskrnl/se/acl.c ${REACTOS_SOURCE_DIR}/ntoskrnl/se/audit.c - ${REACTOS_SOURCE_DIR}/ntoskrnl/se/lsa.c ${REACTOS_SOURCE_DIR}/ntoskrnl/se/priv.c ${REACTOS_SOURCE_DIR}/ntoskrnl/se/sd.c ${REACTOS_SOURCE_DIR}/ntoskrnl/se/semgr.c Removed: trunk/reactos/ntoskrnl/se/lsa.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/lsa.c?rev=72751
============================================================================== --- trunk/reactos/ntoskrnl/se/lsa.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/se/lsa.c (removed) @@ -1,62 +0,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/se/lsa.c - * PURPOSE: Security manager - * - * PROGRAMMERS: David Welch <welch(a)cwcom.net> - */ - -/* INCLUDES *******************************************************************/ - -#include <ntoskrnl.h> -#define NDEBUG -#include <debug.h> - -/* FUNCTIONS ******************************************************************/ - -/* - * NOTE: The following LSA functions: - * LsaCallAuthenticationPackage - * LsaFreeReturnBuffer - * LsaLogonUser - * LsaLookupAuthenticationPackage - * LsaRegisterLogonProcess - * LsaDeregisterLogonProcess - * are already implemented in the 'lsalib' library (sdk/lib/lsalib/lsa.c). - */ - -/* - * @unimplemented - */ -NTSTATUS -NTAPI -SeMarkLogonSessionForTerminationNotification(IN PLUID LogonId) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} - -/* - * @unimplemented - */ -NTSTATUS -NTAPI -SeRegisterLogonSessionTerminatedRoutine(IN PSE_LOGON_SESSION_TERMINATED_ROUTINE CallbackRoutine) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} - -/* - * @unimplemented - */ -NTSTATUS -NTAPI -SeUnregisterLogonSessionTerminatedRoutine(IN PSE_LOGON_SESSION_TERMINATED_ROUTINE CallbackRoutine) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} - -/* EOF */ Modified: trunk/reactos/ntoskrnl/se/srm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/srm.c?rev=7275…
============================================================================== --- trunk/reactos/ntoskrnl/se/srm.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/se/srm.c [iso-8859-1] Wed Sep 21 04:57:25 2016 @@ -687,3 +687,44 @@ ObCloseHandle(SepRmCommandMessagePort, KernelMode); ObCloseHandle(SeRmCommandPort, KernelMode); } + + +/* PUBLIC FUNCTIONS ***********************************************************/ + +/* + * @unimplemented + */ +NTSTATUS +NTAPI +SeMarkLogonSessionForTerminationNotification( + IN PLUID LogonId) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + + +/* + * @unimplemented + */ +NTSTATUS +NTAPI +SeRegisterLogonSessionTerminatedRoutine( + IN PSE_LOGON_SESSION_TERMINATED_ROUTINE CallbackRoutine) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + + +/* + * @unimplemented + */ +NTSTATUS +NTAPI +SeUnregisterLogonSessionTerminatedRoutine( + IN PSE_LOGON_SESSION_TERMINATED_ROUTINE CallbackRoutine) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +}
8 years, 3 months
1
0
0
0
[hbelusca] 72751: [SECUR32][NTOS]: Update the LSA export signatures for the functions that are implemented in the "lsalib" library. [LSALIB] - Add old-school annotations (as we currently do in our ...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Tue Sep 20 23:43:16 2016 New Revision: 72751 URL:
http://svn.reactos.org/svn/reactos?rev=72751&view=rev
Log: [SECUR32][NTOS]: Update the LSA export signatures for the functions that are implemented in the "lsalib" library. [LSALIB] - Add old-school annotations (as we currently do in our main .c code of our stuff). - Mention that LsaConnectUntrusted is not an API that is exported (& implemented) by ntoskrnl. - For LsaRegisterLogonProcess, we first wait for the LSA server to be ready (by waiting on its initialization event). This is TODO for LsaConnectUntrusted on the contrary. [LSALIB][NTOS] Usa the lsalib as the implementation of the LSA functions exported by ntoskrnl. But for that we need to recompile the lsalib as a library that can be used from inside ntoskrnl, because it needs some functions that are normally exported by ntos. For this purpose I add the library target "ntlsalib" (which also specify different #defines), to differentiate it from the (user-mode) "lsalib" one that is used by secur32.dll (Amine, if you have a better idea on how to do that, please let me know!). Modified: trunk/reactos/dll/win32/secur32/secur32.spec trunk/reactos/ntoskrnl/CMakeLists.txt trunk/reactos/ntoskrnl/ntkrnlmp/CMakeLists.txt trunk/reactos/ntoskrnl/ntoskrnl.spec trunk/reactos/ntoskrnl/se/lsa.c trunk/reactos/sdk/lib/lsalib/CMakeLists.txt trunk/reactos/sdk/lib/lsalib/lsa.c Modified: trunk/reactos/dll/win32/secur32/secur32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/secur32/secur32.…
============================================================================== --- trunk/reactos/dll/win32/secur32/secur32.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/secur32/secur32.spec [iso-8859-1] Tue Sep 20 23:43:16 2016 @@ -32,13 +32,13 @@ @ stdcall InitializeSecurityContextA(ptr ptr str long long long ptr long ptr ptr ptr ptr) @ stdcall InitializeSecurityContextW(ptr ptr wstr long long long ptr long ptr ptr ptr ptr) @ stdcall LsaCallAuthenticationPackage(long long ptr long ptr ptr ptr) -@ stdcall LsaConnectUntrusted(long) +@ stdcall LsaConnectUntrusted(ptr) @ stdcall LsaDeregisterLogonProcess(long) @ stdcall LsaEnumerateLogonSessions(ptr ptr) @ stdcall LsaFreeReturnBuffer(ptr) @ stdcall LsaGetLogonSessionData(ptr ptr) -@ stdcall LsaLogonUser(ptr ptr long long ptr long ptr ptr ptr ptr ptr ptr ptr ptr) -@ stdcall LsaLookupAuthenticationPackage(ptr ptr ptr) +@ stdcall LsaLogonUser(long ptr long long ptr long ptr ptr ptr ptr ptr ptr ptr ptr) +@ stdcall LsaLookupAuthenticationPackage(long ptr ptr) @ stdcall LsaRegisterLogonProcess(ptr ptr ptr) @ stdcall LsaRegisterPolicyChangeNotification(long ptr) @ stdcall LsaUnregisterPolicyChangeNotification(long ptr) Modified: trunk/reactos/ntoskrnl/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/CMakeLists.txt?re…
============================================================================== --- trunk/reactos/ntoskrnl/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/CMakeLists.txt [iso-8859-1] Tue Sep 20 23:43:16 2016 @@ -37,7 +37,7 @@ endif() endif() -target_link_libraries(ntoskrnl cportlib csq ${PSEH_LIB} cmlib rtl ${ROSSYM_LIB} libcntpr wdmguid ioevent) +target_link_libraries(ntoskrnl cportlib csq ${PSEH_LIB} cmlib ntlsalib rtl ${ROSSYM_LIB} libcntpr wdmguid ioevent) if(STACK_PROTECTOR) target_link_libraries(ntoskrnl gcc_ssp) Modified: trunk/reactos/ntoskrnl/ntkrnlmp/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntkrnlmp/CMakeLis…
============================================================================== --- trunk/reactos/ntoskrnl/ntkrnlmp/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ntkrnlmp/CMakeLists.txt [iso-8859-1] Tue Sep 20 23:43:16 2016 @@ -39,7 +39,7 @@ target_link_libraries(ntkrnlmp runtmchk) endif() -target_link_libraries(ntkrnlmp cportlib csq ${PSEH_LIB} cmlib rtl ${ROSSYM_LIB} libcntpr wdmguid ioevent) +target_link_libraries(ntkrnlmp cportlib csq ${PSEH_LIB} cmlib ntlsalib rtl ${ROSSYM_LIB} libcntpr wdmguid ioevent) add_importlibs(ntkrnlmp hal kdcom bootvid) add_pch(ntkrnlmp ${REACTOS_SOURCE_DIR}/ntoskrnl/include/ntoskrnl.h NTKRNLMP_SOURCE) add_dependencies(ntkrnlmp psdk bugcodes asm) Modified: trunk/reactos/ntoskrnl/ntoskrnl.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl.spec?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ntoskrnl.spec [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ntoskrnl.spec [iso-8859-1] Tue Sep 20 23:43:16 2016 @@ -742,11 +742,11 @@ @ extern LpcPortObjectType @ stdcall LpcRequestPort(ptr ptr) @ stdcall LpcRequestWaitReplyPort(ptr ptr ptr) -@ stdcall LsaCallAuthenticationPackage(long long long long long long long) -@ stdcall LsaDeregisterLogonProcess(long long) +@ stdcall LsaCallAuthenticationPackage(long long ptr long ptr ptr ptr) +@ stdcall LsaDeregisterLogonProcess(long) @ stdcall LsaFreeReturnBuffer(ptr) -@ stdcall LsaLogonUser(ptr ptr long long ptr long ptr ptr ptr ptr ptr ptr ptr ptr) -@ stdcall LsaLookupAuthenticationPackage(long long long) +@ stdcall LsaLogonUser(long ptr long long ptr long ptr ptr ptr ptr ptr ptr ptr ptr) +@ stdcall LsaLookupAuthenticationPackage(long ptr ptr) @ stdcall LsaRegisterLogonProcess(ptr ptr ptr) @ extern Mm64BitPhysicalAddress @ stdcall MmAddPhysicalMemory(ptr ptr) Modified: trunk/reactos/ntoskrnl/se/lsa.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/lsa.c?rev=7275…
============================================================================== --- trunk/reactos/ntoskrnl/se/lsa.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/se/lsa.c [iso-8859-1] Tue Sep 20 23:43:16 2016 @@ -16,92 +16,15 @@ /* FUNCTIONS ******************************************************************/ /* - * @unimplemented + * NOTE: The following LSA functions: + * LsaCallAuthenticationPackage + * LsaFreeReturnBuffer + * LsaLogonUser + * LsaLookupAuthenticationPackage + * LsaRegisterLogonProcess + * LsaDeregisterLogonProcess + * are already implemented in the 'lsalib' library (sdk/lib/lsalib/lsa.c). */ -NTSTATUS -NTAPI -LsaCallAuthenticationPackage(ULONG Unknown0, - ULONG Unknown1, - ULONG Unknown2, - ULONG Unknown3, - ULONG Unknown4, - ULONG Unknown5, - ULONG Unknown6) -{ - return STATUS_NOT_IMPLEMENTED; -} - -/* - * @unimplemented - */ -NTSTATUS -NTAPI -LsaDeregisterLogonProcess(ULONG Unknown0, - ULONG Unknown1) -{ - return STATUS_NOT_IMPLEMENTED; -} - -/* - * @implemented - */ -NTSTATUS -NTAPI -LsaFreeReturnBuffer(PVOID Buffer) -{ - SIZE_T Size = 0; - return ZwFreeVirtualMemory(NtCurrentProcess(), - &Buffer, - &Size, - MEM_RELEASE); -} - -/* - * @unimplemented - */ -NTSTATUS -NTAPI -LsaLogonUser(IN HANDLE LsaHandle, - IN PLSA_STRING OriginName, - IN SECURITY_LOGON_TYPE LogonType, - IN ULONG AuthenticationPackage, - IN PVOID AuthenticationInformation, - IN ULONG AuthenticationInformationLength, - IN PTOKEN_GROUPS LocalGroups OPTIONAL, - IN PTOKEN_SOURCE SourceContext, - OUT PVOID *ProfileBuffer, - OUT PULONG ProfileBufferLength, - OUT PLUID LogonId, - OUT PHANDLE Token, - OUT PQUOTA_LIMITS Quotas, - OUT PNTSTATUS SubStatus) -{ - return STATUS_NOT_IMPLEMENTED; -} - -/* - * @unimplemented - */ -NTSTATUS -NTAPI -LsaLookupAuthenticationPackage(ULONG Unknown0, - ULONG Unknown1, - ULONG Unknown2) -{ - return STATUS_NOT_IMPLEMENTED; -} - -/* - * @unimplemented - */ -NTSTATUS -NTAPI -LsaRegisterLogonProcess(IN PLSA_STRING LogonProcessName, - OUT PHANDLE LsaHandle, - OUT PLSA_OPERATIONAL_MODE SecurityMode) -{ - return STATUS_NOT_IMPLEMENTED; -} /* * @unimplemented Modified: trunk/reactos/sdk/lib/lsalib/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/lsalib/CMakeLists.…
============================================================================== --- trunk/reactos/sdk/lib/lsalib/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/sdk/lib/lsalib/CMakeLists.txt [iso-8859-1] Tue Sep 20 23:43:16 2016 @@ -1,4 +1,9 @@ include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/subsys) + add_library(lsalib lsa.c) add_dependencies(lsalib xdk) + +add_library(ntlsalib lsa.c) +add_target_compile_definitions(ntlsalib _NTSYSTEM_) +add_dependencies(ntlsalib xdk) Modified: trunk/reactos/sdk/lib/lsalib/lsa.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/lsalib/lsa.c?rev=7…
============================================================================== --- trunk/reactos/sdk/lib/lsalib/lsa.c [iso-8859-1] (original) +++ trunk/reactos/sdk/lib/lsalib/lsa.c [iso-8859-1] Tue Sep 20 23:43:16 2016 @@ -9,12 +9,13 @@ /* INCLUDES ******************************************************************/ +#include <ndk/exfuncs.h> #include <ndk/lpctypes.h> #include <ndk/lpcfuncs.h> #include <ndk/mmfuncs.h> #include <ndk/rtlfuncs.h> #include <ndk/obfuncs.h> -#include <psdk/ntsecapi.h> +// #include <psdk/ntsecapi.h> #include <lsass/lsass.h> #define NDEBUG @@ -22,67 +23,35 @@ /* GLOBALS *******************************************************************/ +// FIXME: Do we really need this?! +#if !defined(__NTOSKRNL__) && !defined(_NTOSKRNL_) && !defined(_NTSYSTEM_) extern HANDLE Secur32Heap; +#endif /* FUNCTIONS *****************************************************************/ -/* - * @implemented - */ -NTSTATUS -WINAPI -LsaDeregisterLogonProcess(HANDLE LsaHandle) -{ - LSA_API_MSG ApiMessage; - NTSTATUS Status; - - DPRINT("LsaDeregisterLogonProcess()\n"); - - ApiMessage.ApiNumber = LSASS_REQUEST_DEREGISTER_LOGON_PROCESS; - ApiMessage.h.u1.s1.DataLength = LSA_PORT_DATA_SIZE(ApiMessage.DeregisterLogonProcess); - ApiMessage.h.u1.s1.TotalLength = LSA_PORT_MESSAGE_SIZE; - ApiMessage.h.u2.ZeroInit = 0; - - Status = ZwRequestWaitReplyPort(LsaHandle, - (PPORT_MESSAGE)&ApiMessage, - (PPORT_MESSAGE)&ApiMessage); - if (!NT_SUCCESS(Status)) - { - DPRINT1("ZwRequestWaitReplyPort() failed (Status 0x%08lx)\n", Status); - return Status; - } - - if (!NT_SUCCESS(ApiMessage.Status)) - { - DPRINT1("ZwRequestWaitReplyPort() failed (ApiMessage.Status 0x%08lx)\n", ApiMessage.Status); - return ApiMessage.Status; - } - - NtClose(LsaHandle); - - DPRINT("LsaDeregisterLogonProcess() done (Status 0x%08lx)\n", Status); - - return Status; -} - - -/* - * @implemented - */ -NTSTATUS -WINAPI -LsaConnectUntrusted(PHANDLE LsaHandle) -{ +/* This API is not defined and exported by NTOSKRNL */ +#if !defined(__NTOSKRNL__) && !defined(_NTOSKRNL_) && !defined(_NTSYSTEM_) +/* + * @implemented + */ +NTSTATUS +NTAPI +LsaConnectUntrusted(OUT PHANDLE LsaHandle) +{ + NTSTATUS Status; UNICODE_STRING PortName; // = RTL_CONSTANT_STRING(L"\\LsaAuthenticationPort"); SECURITY_QUALITY_OF_SERVICE SecurityQos; LSA_CONNECTION_INFO ConnectInfo; ULONG ConnectInfoLength = sizeof(ConnectInfo); - NTSTATUS Status; DPRINT("LsaConnectUntrusted(%p)\n", LsaHandle); - RtlInitUnicodeString(&PortName, - L"\\LsaAuthenticationPort"); + // TODO: Wait on L"\\SECURITY\\LSA_AUTHENTICATION_INITIALIZED" event + // for the LSA server to be ready, and because we are untrusted, + // we may need to impersonate ourselves before! + + RtlInitUnicodeString(&PortName, L"\\LsaAuthenticationPort"); SecurityQos.Length = sizeof(SecurityQos); SecurityQos.ImpersonationLevel = SecurityIdentification; @@ -115,23 +84,23 @@ return ConnectInfo.Status; } - - -/* - * @implemented - */ -NTSTATUS -WINAPI -LsaCallAuthenticationPackage(HANDLE LsaHandle, - ULONG AuthenticationPackage, - PVOID ProtocolSubmitBuffer, - ULONG SubmitBufferLength, - PVOID *ProtocolReturnBuffer, - PULONG ReturnBufferLength, - PNTSTATUS ProtocolStatus) -{ +#endif + +/* + * @implemented + */ +NTSTATUS +NTAPI +LsaCallAuthenticationPackage(IN HANDLE LsaHandle, + IN ULONG AuthenticationPackage, + IN PVOID ProtocolSubmitBuffer, + IN ULONG SubmitBufferLength, + OUT PVOID *ProtocolReturnBuffer, + OUT PULONG ReturnBufferLength, + OUT PNTSTATUS ProtocolStatus) +{ + NTSTATUS Status; LSA_API_MSG ApiMessage; - NTSTATUS Status; DPRINT1("LsaCallAuthenticationPackage()\n"); @@ -171,14 +140,13 @@ * @implemented */ NTSTATUS -WINAPI -LsaFreeReturnBuffer(PVOID Buffer) -{ - ULONG Length = 0; - +NTAPI +LsaFreeReturnBuffer(IN PVOID Buffer) +{ + SIZE_T Size = 0; return ZwFreeVirtualMemory(NtCurrentProcess(), &Buffer, - &Length, + &Size, MEM_RELEASE); } @@ -187,13 +155,13 @@ * @implemented */ NTSTATUS -WINAPI -LsaLookupAuthenticationPackage(HANDLE LsaHandle, - PLSA_STRING PackageName, - PULONG AuthenticationPackage) -{ +NTAPI +LsaLookupAuthenticationPackage(IN HANDLE LsaHandle, + IN PLSA_STRING PackageName, + OUT PULONG AuthenticationPackage) +{ + NTSTATUS Status; LSA_API_MSG ApiMessage; - NTSTATUS Status; /* Check the package name length */ if (PackageName->Length > LSASS_MAX_PACKAGE_NAME_LENGTH) @@ -210,7 +178,7 @@ strncpy(ApiMessage.LookupAuthenticationPackage.Request.PackageName, PackageName->Buffer, ApiMessage.LookupAuthenticationPackage.Request.PackageNameLength); - ApiMessage.LookupAuthenticationPackage.Request.PackageName[ApiMessage.LookupAuthenticationPackage.Request.PackageNameLength] = '\0'; + ApiMessage.LookupAuthenticationPackage.Request.PackageName[ApiMessage.LookupAuthenticationPackage.Request.PackageNameLength] = ANSI_NULL; Status = ZwRequestWaitReplyPort(LsaHandle, (PPORT_MESSAGE)&ApiMessage, @@ -235,24 +203,24 @@ * @implemented */ NTSTATUS -WINAPI -LsaLogonUser(HANDLE LsaHandle, - PLSA_STRING OriginName, - SECURITY_LOGON_TYPE LogonType, - ULONG AuthenticationPackage, - PVOID AuthenticationInformation, - ULONG AuthenticationInformationLength, - PTOKEN_GROUPS LocalGroups, - PTOKEN_SOURCE SourceContext, - PVOID *ProfileBuffer, - PULONG ProfileBufferLength, - PLUID LogonId, - PHANDLE Token, - PQUOTA_LIMITS Quotas, - PNTSTATUS SubStatus) -{ +NTAPI +LsaLogonUser(IN HANDLE LsaHandle, + IN PLSA_STRING OriginName, + IN SECURITY_LOGON_TYPE LogonType, + IN ULONG AuthenticationPackage, + IN PVOID AuthenticationInformation, + IN ULONG AuthenticationInformationLength, + IN PTOKEN_GROUPS LocalGroups OPTIONAL, + IN PTOKEN_SOURCE SourceContext, + OUT PVOID *ProfileBuffer, + OUT PULONG ProfileBufferLength, + OUT PLUID LogonId, + OUT PHANDLE Token, + OUT PQUOTA_LIMITS Quotas, + OUT PNTSTATUS SubStatus) +{ + NTSTATUS Status; LSA_API_MSG ApiMessage; - NTSTATUS Status; ApiMessage.ApiNumber = LSASS_REQUEST_LOGON_USER; ApiMessage.h.u1.s1.DataLength = LSA_PORT_DATA_SIZE(ApiMessage.LogonUser); @@ -300,25 +268,53 @@ * @implemented */ NTSTATUS -WINAPI -LsaRegisterLogonProcess(PLSA_STRING LsaLogonProcessName, - PHANDLE Handle, - PLSA_OPERATIONAL_MODE OperationalMode) -{ +NTAPI +LsaRegisterLogonProcess(IN PLSA_STRING LogonProcessName, + OUT PHANDLE LsaHandle, + OUT PLSA_OPERATIONAL_MODE OperationalMode) +{ + NTSTATUS Status; + HANDLE EventHandle; UNICODE_STRING PortName; // = RTL_CONSTANT_STRING(L"\\LsaAuthenticationPort"); + OBJECT_ATTRIBUTES ObjectAttributes; SECURITY_QUALITY_OF_SERVICE SecurityQos; LSA_CONNECTION_INFO ConnectInfo; ULONG ConnectInfoLength = sizeof(ConnectInfo); - NTSTATUS Status; DPRINT("LsaRegisterLogonProcess()\n"); /* Check the logon process name length */ - if (LsaLogonProcessName->Length > LSASS_MAX_LOGON_PROCESS_NAME_LENGTH) + if (LogonProcessName->Length > LSASS_MAX_LOGON_PROCESS_NAME_LENGTH) return STATUS_NAME_TOO_LONG; - RtlInitUnicodeString(&PortName, - L"\\LsaAuthenticationPort"); + /* + * First check whether the LSA server is ready: + * open the LSA event and wait on it. + */ + // Note that we just reuse the 'PortName' variable here. + RtlInitUnicodeString(&PortName, L"\\SECURITY\\LSA_AUTHENTICATION_INITIALIZED"); + InitializeObjectAttributes(&ObjectAttributes, + &PortName, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + Status = NtOpenEvent(&EventHandle, SYNCHRONIZE, &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtOpenEvent failed (Status 0x%08lx)\n", Status); + return Status; + } + + Status = NtWaitForSingleObject(EventHandle, TRUE, NULL); + NtClose(EventHandle); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtWaitForSingleObject failed (Status 0x%08lx)\n", Status); + return Status; + } + + /* Now attempt the connection */ + RtlInitUnicodeString(&PortName, L"\\LsaAuthenticationPort"); SecurityQos.Length = sizeof(SecurityQos); SecurityQos.ImpersonationLevel = SecurityIdentification; @@ -326,13 +322,13 @@ SecurityQos.EffectiveOnly = TRUE; strncpy(ConnectInfo.LogonProcessNameBuffer, - LsaLogonProcessName->Buffer, - LsaLogonProcessName->Length); - ConnectInfo.Length = LsaLogonProcessName->Length; - ConnectInfo.LogonProcessNameBuffer[ConnectInfo.Length] = '\0'; + LogonProcessName->Buffer, + LogonProcessName->Length); + ConnectInfo.Length = LogonProcessName->Length; + ConnectInfo.LogonProcessNameBuffer[ConnectInfo.Length] = ANSI_NULL; ConnectInfo.CreateContext = TRUE; - Status = ZwConnectPort(Handle, + Status = ZwConnectPort(LsaHandle, &PortName, &SecurityQos, NULL, @@ -357,3 +353,42 @@ return ConnectInfo.Status; } + +/* + * @implemented + */ +NTSTATUS +NTAPI +LsaDeregisterLogonProcess(IN HANDLE LsaHandle) +{ + NTSTATUS Status; + LSA_API_MSG ApiMessage; + + DPRINT("LsaDeregisterLogonProcess()\n"); + + ApiMessage.ApiNumber = LSASS_REQUEST_DEREGISTER_LOGON_PROCESS; + ApiMessage.h.u1.s1.DataLength = LSA_PORT_DATA_SIZE(ApiMessage.DeregisterLogonProcess); + ApiMessage.h.u1.s1.TotalLength = LSA_PORT_MESSAGE_SIZE; + ApiMessage.h.u2.ZeroInit = 0; + + Status = ZwRequestWaitReplyPort(LsaHandle, + (PPORT_MESSAGE)&ApiMessage, + (PPORT_MESSAGE)&ApiMessage); + if (!NT_SUCCESS(Status)) + { + DPRINT1("ZwRequestWaitReplyPort() failed (Status 0x%08lx)\n", Status); + return Status; + } + + if (!NT_SUCCESS(ApiMessage.Status)) + { + DPRINT1("ZwRequestWaitReplyPort() failed (ApiMessage.Status 0x%08lx)\n", ApiMessage.Status); + return ApiMessage.Status; + } + + NtClose(LsaHandle); + + DPRINT("LsaDeregisterLogonProcess() done (Status 0x%08lx)\n", Status); + + return Status; +}
8 years, 3 months
1
0
0
0
← Newer
1
...
9
10
11
12
13
14
15
...
35
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
Results per page:
10
25
50
100
200