Author: dchapyshev
Date: Sat Jan 31 14:22:17 2009
New Revision: 39250
URL: http://svn.reactos.org/svn/reactos?rev=39250&view=rev
Log:
- Implement GetComputerObjectNameA/W (from Wine)
Modified:
trunk/reactos/dll/win32/secur32/secext.c
Modified: trunk/reactos/dll/win32/secur32/secext.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/secur32/secext.c…
==============================================================================
--- trunk/reactos/dll/win32/secur32/secext.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/secur32/secext.c [iso-8859-1] Sat Jan 31 14:22:17 2009
@@ -1,31 +1,191 @@
+/*
+ * Copyright (C) 2004 Juan Lang
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
#include <precomp.h>
#define NDEBUG
#include <debug.h>
-BOOLEAN
-WINAPI
-GetComputerObjectNameA (
- EXTENDED_NAME_FORMAT extended_name_format,
- LPSTR lpstr,
- PULONG pulong
- )
-{
- UNIMPLEMENTED;
- return ERROR_CALL_NOT_IMPLEMENTED;
-}
-
-BOOLEAN
-WINAPI
-GetComputerObjectNameW (
- EXTENDED_NAME_FORMAT extended_name_format,
- LPWSTR lpstr,
- PULONG pulong
- )
-{
- UNIMPLEMENTED;
- return ERROR_CALL_NOT_IMPLEMENTED;
+/***********************************************************************
+ * GetComputerObjectNameA (SECUR32.@) Wine 1.1.14
+ *
+ * Get the local computer's name using the format specified.
+ *
+ * PARAMS
+ * NameFormat [I] The format for the name.
+ * lpNameBuffer [O] Pointer to buffer to receive the name.
+ * nSize [I/O] Size in characters of buffer.
+ *
+ * RETURNS
+ * TRUE If the name was written to lpNameBuffer.
+ * FALSE If the name couldn't be written.
+ *
+ * NOTES
+ * If lpNameBuffer is NULL, then the size of the buffer needed to hold the
+ * name will be returned in *nSize.
+ *
+ * nSize returns the number of characters written when lpNameBuffer is not
+ * NULL or the size of the buffer needed to hold the name when the buffer
+ * is too short or lpNameBuffer is NULL.
+ *
+ * It the buffer is too short, ERROR_INSUFFICIENT_BUFFER error will be set.
+ */
+BOOLEAN WINAPI GetComputerObjectNameA(
+ EXTENDED_NAME_FORMAT NameFormat, LPSTR lpNameBuffer, PULONG nSize)
+{
+ BOOLEAN rc;
+ LPWSTR bufferW = NULL;
+ ULONG sizeW = *nSize;
+ DPRINT("(%d %p %p)\n", NameFormat, lpNameBuffer, nSize);
+ if (lpNameBuffer) {
+ bufferW = HeapAlloc(GetProcessHeap(), 0, sizeW * sizeof(WCHAR));
+ if (bufferW == NULL) {
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+ return FALSE;
+ }
+ }
+ rc = GetComputerObjectNameW(NameFormat, bufferW, &sizeW);
+ if (rc && bufferW) {
+ ULONG len = WideCharToMultiByte(CP_ACP, 0, bufferW, -1, NULL, 0, NULL, NULL);
+ WideCharToMultiByte(CP_ACP, 0, bufferW, -1, lpNameBuffer, *nSize, NULL, NULL);
+ *nSize = len;
+ }
+ else
+ *nSize = sizeW;
+ HeapFree(GetProcessHeap(), 0, bufferW);
+ return rc;
+}
+
+/***********************************************************************
+ * GetComputerObjectNameW (SECUR32.@) Wine 1.1.14
+ */
+BOOLEAN WINAPI GetComputerObjectNameW(
+ EXTENDED_NAME_FORMAT NameFormat, LPWSTR lpNameBuffer, PULONG nSize)
+{
+ LSA_HANDLE policyHandle;
+ LSA_OBJECT_ATTRIBUTES objectAttributes;
+ PPOLICY_DNS_DOMAIN_INFO domainInfo;
+ NTSTATUS ntStatus;
+ BOOLEAN status;
+ DPRINT("(%d %p %p)\n", NameFormat, lpNameBuffer, nSize);
+
+ if (NameFormat == NameUnknown)
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+
+ ZeroMemory(&objectAttributes, sizeof(objectAttributes));
+ objectAttributes.Length = sizeof(objectAttributes);
+
+ ntStatus = LsaOpenPolicy(NULL, &objectAttributes,
+ POLICY_VIEW_LOCAL_INFORMATION,
+ &policyHandle);
+ if (ntStatus != STATUS_SUCCESS)
+ {
+ SetLastError(LsaNtStatusToWinError(ntStatus));
+ DPRINT1("LsaOpenPolicy failed with NT status %u\n", GetLastError());
+ return FALSE;
+ }
+
+ ntStatus = LsaQueryInformationPolicy(policyHandle,
+ PolicyDnsDomainInformation,
+ (PVOID *)&domainInfo);
+ if (ntStatus != STATUS_SUCCESS)
+ {
+ SetLastError(LsaNtStatusToWinError(ntStatus));
+ DPRINT1("LsaQueryInformationPolicy failed with NT status %u\n",
+ GetLastError());
+ LsaClose(policyHandle);
+ return FALSE;
+ }
+
+ if (domainInfo->Sid)
+ {
+ switch (NameFormat)
+ {
+ case NameSamCompatible:
+ {
+ WCHAR name[MAX_COMPUTERNAME_LENGTH + 1];
+ DWORD size = sizeof(name)/sizeof(name[0]);
+ if (GetComputerNameW(name, &size))
+ {
+ DWORD len = domainInfo->Name.Length + size + 3;
+ if (lpNameBuffer)
+ {
+ if (*nSize < len)
+ {
+ *nSize = len;
+ SetLastError(ERROR_INSUFFICIENT_BUFFER);
+ status = FALSE;
+ }
+ else
+ {
+ WCHAR bs[] = { '\\', 0 };
+ WCHAR ds[] = { '$', 0 };
+ lstrcpyW(lpNameBuffer, domainInfo->Name.Buffer);
+ lstrcatW(lpNameBuffer, bs);
+ lstrcatW(lpNameBuffer, name);
+ lstrcatW(lpNameBuffer, ds);
+ status = TRUE;
+ }
+ }
+ else /* just requesting length required */
+ {
+ *nSize = len;
+ status = TRUE;
+ }
+ }
+ else
+ {
+ SetLastError(ERROR_INTERNAL_ERROR);
+ status = FALSE;
+ }
+ }
+ break;
+ case NameFullyQualifiedDN:
+ case NameDisplay:
+ case NameUniqueId:
+ case NameCanonical:
+ case NameUserPrincipal:
+ case NameCanonicalEx:
+ case NameServicePrincipal:
+ case NameDnsDomain:
+ DPRINT1("NameFormat %d not implemented\n", NameFormat);
+ SetLastError(ERROR_CANT_ACCESS_DOMAIN_INFO);
+ status = FALSE;
+ break;
+ default:
+ SetLastError(ERROR_INVALID_PARAMETER);
+ status = FALSE;
+ }
+ }
+ else
+ {
+ SetLastError(ERROR_CANT_ACCESS_DOMAIN_INFO);
+ status = FALSE;
+ }
+
+ LsaFreeMemory(domainInfo);
+ LsaClose(policyHandle);
+
+ return status;
}
Author: cfinck
Date: Sat Jan 31 11:23:09 2009
New Revision: 39246
URL: http://svn.reactos.org/svn/reactos?rev=39246&view=rev
Log:
Update mIRC to 6.35, works under 0.3.8 and as long as this version is the latest one, it doesn't ask for updates all the time :-)
Modified:
trunk/rosapps/applications/downloader/downloader.xml
Modified: trunk/rosapps/applications/downloader/downloader.xml
URL: http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/downloader/do…
==============================================================================
--- trunk/rosapps/applications/downloader/downloader.xml [iso-8859-1] (original)
+++ trunk/rosapps/applications/downloader/downloader.xml [iso-8859-1] Sat Jan 31 11:23:09 2009
@@ -48,9 +48,9 @@
<application name="mIRC">
<regname>mIRC</regname>
<licence>Shareware</licence>
- <version>6.33</version>
- <description>The most popular client for the Internet Relay Chat (IRC).</description>
- <location>http://mirc.bigchief.dk/mirc633.exe</location>
+ <version>6.35</version>
+ <description>The most popular client for the Internet Relay Chat (IRC)</description>
+ <location>http://mirc.bigchief.dk/mirc635.exe</location>
</application>
<application name="Samba TNG">
<description>This tool allows you to access your Windows shared folders/printers with ReactOS.</description>