Some Lsa* functionality is partially implemented. This patch allows applications to "successfully open" the LSA Policy handle and use implemented functionality or fail later if the functionality is not implemented. Changelog: LsaOpenPolicy return success. __________________________________________________ Do you Yahoo!? Yahoo! News - Today's headlines http://news.yahoo.com
--- dlls/advapi32/security.c.orig Tue Sep 17 11:14:42 2002 +++ dlls/advapi32/security.c Tue Sep 17 11:32:58 2002 @@ -49,6 +49,42 @@ } } +/************************************************************ + * ADVAPI_IsLocalComputer + * + * Checks whether the server name indicates local machine. + */ +BOOL ADVAPI_IsLocalComputer(LPCWSTR ServerName) +{ + if (!ServerName) + { + return TRUE; + } + else + { + DWORD dwSize = MAX_COMPUTERNAME_LENGTH + 1; + BOOL Result; + LPWSTR buf; + + buf = HeapAlloc(GetProcessHeap(), 0, dwSize * sizeof(WCHAR)); + Result = GetComputerNameW(buf, &dwSize); + if (Result && (ServerName[0] == '\\') && (ServerName[1] == '\\')) + ServerName += 2; + Result = Result && !lstrcmpW(ServerName, buf); + HeapFree(GetProcessHeap(), 0, buf); + + return Result; + } +} + +#define ADVAPI_ForceLocalComputer(ServerName, FailureCode) \ + if (!ADVAPI_IsLocalComputer(ServerName)) \ + { \ + FIXME("Action Implemented for local computer only. " \ + "Requested for server %s\n", debugstr_w(ServerName)); \ + return FailureCode; \ + } + /* ############################## ###### TOKEN FUNCTIONS ###### ############################## @@ -802,9 +838,11 @@ FIXME("(%s,%p,0x%08lx,%p):stub\n", SystemName?debugstr_w(SystemName->Buffer):"null", ObjectAttributes, DesiredAccess, PolicyHandle); + ADVAPI_ForceLocalComputer(SystemName ? SystemName->Buffer : NULL, + STATUS_ACCESS_VIOLATION); dumpLsaAttributes(ObjectAttributes); if(PolicyHandle) *PolicyHandle = (LSA_HANDLE)0xcafe; - return TRUE; + return STATUS_SUCCESS; } /******************************************************************************