mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 17:44:45 +00:00
strip whitespace from end of lines
svn path=/trunk/; revision=15169
This commit is contained in:
parent
395f5dc9e5
commit
189e9fae5c
15 changed files with 196 additions and 196 deletions
|
@ -270,7 +270,7 @@ BOOL WINAPI CryptAcquireContextA (HCRYPTPROV *phProv, LPCSTR pszContainer,
|
||||||
SetLastError(NTE_BAD_PROV_TYPE);
|
SetLastError(NTE_BAD_PROV_TYPE);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!phProv)
|
if (!phProv)
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_INVALID_PARAMETER);
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|
@ -1001,19 +1001,19 @@ BOOL WINAPI CryptEnumProvidersW (DWORD dwIndex, DWORD *pdwReserved,
|
||||||
{
|
{
|
||||||
DWORD numkeys;
|
DWORD numkeys;
|
||||||
WCHAR *provNameW;
|
WCHAR *provNameW;
|
||||||
|
|
||||||
RegQueryInfoKeyW(hKey, NULL, NULL, NULL, &numkeys, pcbProvName,
|
RegQueryInfoKeyW(hKey, NULL, NULL, NULL, &numkeys, pcbProvName,
|
||||||
NULL, NULL, NULL, NULL, NULL, NULL);
|
NULL, NULL, NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
if (!(provNameW = CRYPT_Alloc(*pcbProvName * sizeof(WCHAR))))
|
if (!(provNameW = CRYPT_Alloc(*pcbProvName * sizeof(WCHAR))))
|
||||||
CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY);
|
CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
|
|
||||||
RegEnumKeyExW(hKey, dwIndex, provNameW, pcbProvName, NULL, NULL, NULL, NULL);
|
RegEnumKeyExW(hKey, dwIndex, provNameW, pcbProvName, NULL, NULL, NULL, NULL);
|
||||||
(*pcbProvName)++;
|
(*pcbProvName)++;
|
||||||
*pcbProvName *= sizeof(WCHAR);
|
*pcbProvName *= sizeof(WCHAR);
|
||||||
|
|
||||||
CRYPT_Free(provNameW);
|
CRYPT_Free(provNameW);
|
||||||
|
|
||||||
if (dwIndex >= numkeys)
|
if (dwIndex >= numkeys)
|
||||||
CRYPT_ReturnLastError(ERROR_NO_MORE_ITEMS);
|
CRYPT_ReturnLastError(ERROR_NO_MORE_ITEMS);
|
||||||
}
|
}
|
||||||
|
@ -1022,7 +1022,7 @@ BOOL WINAPI CryptEnumProvidersW (DWORD dwIndex, DWORD *pdwReserved,
|
||||||
DWORD size = sizeof(DWORD);
|
DWORD size = sizeof(DWORD);
|
||||||
DWORD result;
|
DWORD result;
|
||||||
HKEY subkey;
|
HKEY subkey;
|
||||||
|
|
||||||
result = RegEnumKeyW(hKey, dwIndex, pszProvName, *pcbProvName / sizeof(WCHAR));
|
result = RegEnumKeyW(hKey, dwIndex, pszProvName, *pcbProvName / sizeof(WCHAR));
|
||||||
if (result)
|
if (result)
|
||||||
CRYPT_ReturnLastError(result);
|
CRYPT_ReturnLastError(result);
|
||||||
|
@ -1123,7 +1123,7 @@ BOOL WINAPI CryptEnumProviderTypesA (DWORD dwIndex, DWORD *pdwReserved,
|
||||||
*pdwProvType += (*(--ch) - '0') * 10;
|
*pdwProvType += (*(--ch) - '0') * 10;
|
||||||
*pdwProvType += (*(--ch) - '0') * 100;
|
*pdwProvType += (*(--ch) - '0') * 100;
|
||||||
CRYPT_Free(keyname);
|
CRYPT_Free(keyname);
|
||||||
|
|
||||||
result = RegQueryValueExA(hSubkey, "TypeName", NULL, &dwType, (LPBYTE)pszTypeName, pcbTypeName);
|
result = RegQueryValueExA(hSubkey, "TypeName", NULL, &dwType, (LPBYTE)pszTypeName, pcbTypeName);
|
||||||
if (result)
|
if (result)
|
||||||
CRYPT_ReturnLastError(result);
|
CRYPT_ReturnLastError(result);
|
||||||
|
@ -1162,7 +1162,7 @@ BOOL WINAPI CryptEnumProviderTypesW (DWORD dwIndex, DWORD *pdwReserved,
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* CryptExportKey (ADVAPI32.@)
|
* CryptExportKey (ADVAPI32.@)
|
||||||
*
|
*
|
||||||
* Exports a cryptographic key from a CSP.
|
* Exports a cryptographic key from a CSP.
|
||||||
*
|
*
|
||||||
* PARAMS
|
* PARAMS
|
||||||
|
@ -1280,18 +1280,18 @@ BOOL WINAPI CryptGetDefaultProviderA (DWORD dwProvType, DWORD *pdwReserved,
|
||||||
CRYPT_ReturnLastError(NTE_PROV_TYPE_NOT_DEF);
|
CRYPT_ReturnLastError(NTE_PROV_TYPE_NOT_DEF);
|
||||||
}
|
}
|
||||||
CRYPT_Free(keyname);
|
CRYPT_Free(keyname);
|
||||||
|
|
||||||
result = RegQueryValueExA(hKey, "Name", NULL, NULL, (LPBYTE)pszProvName, pcbProvName);
|
result = RegQueryValueExA(hKey, "Name", NULL, NULL, (LPBYTE)pszProvName, pcbProvName);
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
if (result != ERROR_MORE_DATA)
|
if (result != ERROR_MORE_DATA)
|
||||||
SetLastError(NTE_PROV_TYPE_ENTRY_BAD);
|
SetLastError(NTE_PROV_TYPE_ENTRY_BAD);
|
||||||
else
|
else
|
||||||
SetLastError(result);
|
SetLastError(result);
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1498,7 +1498,7 @@ BOOL WINAPI CryptHashData (HCRYPTHASH hHash, BYTE *pbData, DWORD dwDataLen, DWOR
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* CryptHashSessionKey (ADVAPI32.@)
|
* CryptHashSessionKey (ADVAPI32.@)
|
||||||
*
|
*
|
||||||
* PARAMS
|
* PARAMS
|
||||||
* hHash [I] Handle to the hash object.
|
* hHash [I] Handle to the hash object.
|
||||||
* hKey [I] Handle to the key to be hashed.
|
* hKey [I] Handle to the key to be hashed.
|
||||||
* dwFlags [I] Can be CRYPT_LITTLE_ENDIAN.
|
* dwFlags [I] Can be CRYPT_LITTLE_ENDIAN.
|
||||||
|
@ -1729,7 +1729,7 @@ BOOL WINAPI CryptSetProviderExA (LPCSTR pszProvName, DWORD dwProvType, DWORD *pd
|
||||||
if (dwFlags & ~(CRYPT_MACHINE_DEFAULT | CRYPT_USER_DEFAULT | CRYPT_DELETE_DEFAULT)
|
if (dwFlags & ~(CRYPT_MACHINE_DEFAULT | CRYPT_USER_DEFAULT | CRYPT_DELETE_DEFAULT)
|
||||||
|| dwFlags == CRYPT_DELETE_DEFAULT)
|
|| dwFlags == CRYPT_DELETE_DEFAULT)
|
||||||
CRYPT_ReturnLastError(NTE_BAD_FLAGS);
|
CRYPT_ReturnLastError(NTE_BAD_FLAGS);
|
||||||
|
|
||||||
if (!(keyname = CRYPT_GetTypeKeyName(dwProvType, dwFlags & CRYPT_USER_DEFAULT)))
|
if (!(keyname = CRYPT_GetTypeKeyName(dwProvType, dwFlags & CRYPT_USER_DEFAULT)))
|
||||||
CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY);
|
CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
if (RegOpenKeyA((dwFlags & CRYPT_USER_DEFAULT) ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE,
|
if (RegOpenKeyA((dwFlags & CRYPT_USER_DEFAULT) ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE,
|
||||||
|
@ -1739,7 +1739,7 @@ BOOL WINAPI CryptSetProviderExA (LPCSTR pszProvName, DWORD dwProvType, DWORD *pd
|
||||||
CRYPT_ReturnLastError(NTE_BAD_PROVIDER);
|
CRYPT_ReturnLastError(NTE_BAD_PROVIDER);
|
||||||
}
|
}
|
||||||
CRYPT_Free(keyname);
|
CRYPT_Free(keyname);
|
||||||
|
|
||||||
if (dwFlags & CRYPT_DELETE_DEFAULT)
|
if (dwFlags & CRYPT_DELETE_DEFAULT)
|
||||||
{
|
{
|
||||||
RegDeleteValueA(hTypeKey, "Name");
|
RegDeleteValueA(hTypeKey, "Name");
|
||||||
|
@ -1759,14 +1759,14 @@ BOOL WINAPI CryptSetProviderExA (LPCSTR pszProvName, DWORD dwProvType, DWORD *pd
|
||||||
CRYPT_ReturnLastError(NTE_BAD_PROVIDER);
|
CRYPT_ReturnLastError(NTE_BAD_PROVIDER);
|
||||||
}
|
}
|
||||||
CRYPT_Free(keyname);
|
CRYPT_Free(keyname);
|
||||||
|
|
||||||
if (RegSetValueExA(hTypeKey, "Name", 0, REG_SZ, (LPBYTE)pszProvName, strlen(pszProvName) + 1))
|
if (RegSetValueExA(hTypeKey, "Name", 0, REG_SZ, (LPBYTE)pszProvName, strlen(pszProvName) + 1))
|
||||||
{
|
{
|
||||||
RegCloseKey(hTypeKey);
|
RegCloseKey(hTypeKey);
|
||||||
RegCloseKey(hProvKey);
|
RegCloseKey(hProvKey);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
RegCloseKey(hProvKey);
|
RegCloseKey(hProvKey);
|
||||||
}
|
}
|
||||||
RegCloseKey(hTypeKey);
|
RegCloseKey(hTypeKey);
|
||||||
|
|
|
@ -221,7 +221,7 @@ VOID WINAPI MD4Update(MD4_CTX *ctx, const unsigned char *buf, unsigned int len)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Final wrapup - pad to 64-byte boundary with the bit pattern
|
* Final wrapup - pad to 64-byte boundary with the bit pattern
|
||||||
* 1 0* (64-bit count of bits processed, MSB-first)
|
* 1 0* (64-bit count of bits processed, MSB-first)
|
||||||
*/
|
*/
|
||||||
VOID WINAPI MD4Final(MD4_CTX *ctx)
|
VOID WINAPI MD4Final(MD4_CTX *ctx)
|
||||||
|
|
|
@ -231,7 +231,7 @@ VOID WINAPI MD5Update(MD5_CTX *ctx, const unsigned char *buf, unsigned int len)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Final wrapup - pad to 64-byte boundary with the bit pattern
|
* Final wrapup - pad to 64-byte boundary with the bit pattern
|
||||||
* 1 0* (64-bit count of bits processed, MSB-first)
|
* 1 0* (64-bit count of bits processed, MSB-first)
|
||||||
*/
|
*/
|
||||||
VOID WINAPI MD5Final( MD5_CTX *ctx )
|
VOID WINAPI MD5Final( MD5_CTX *ctx )
|
||||||
|
|
|
@ -1229,7 +1229,7 @@ RegEnumValueA( HKEY hKey, DWORD index, LPSTR value, LPDWORD val_count,
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* RegEnumValueW [ADVAPI32.@]
|
* RegEnumValueW [ADVAPI32.@]
|
||||||
* @implemented
|
* @implemented
|
||||||
*
|
*
|
||||||
* PARAMS
|
* PARAMS
|
||||||
* hkey [I] Handle to key to query
|
* hkey [I] Handle to key to query
|
||||||
* index [I] Index of value to query
|
* index [I] Index of value to query
|
||||||
|
@ -1260,7 +1260,7 @@ RegEnumValueW( HKEY hKey, DWORD index, LPWSTR value, PDWORD val_count,
|
||||||
|
|
||||||
/* NT only checks count, not val_count */
|
/* NT only checks count, not val_count */
|
||||||
if ((data && !count) || reserved) return ERROR_INVALID_PARAMETER;
|
if ((data && !count) || reserved) return ERROR_INVALID_PARAMETER;
|
||||||
|
|
||||||
status = MapDefaultKey (&KeyHandle, hKey);
|
status = MapDefaultKey (&KeyHandle, hKey);
|
||||||
if (!NT_SUCCESS(status))
|
if (!NT_SUCCESS(status))
|
||||||
{
|
{
|
||||||
|
@ -1690,7 +1690,7 @@ RegOpenKeyExW (HKEY hKey,
|
||||||
|
|
||||||
DPRINT("RegOpenKeyExW hKey 0x%x lpSubKey %S ulOptions 0x%x samDesired 0x%x phkResult %p\n",
|
DPRINT("RegOpenKeyExW hKey 0x%x lpSubKey %S ulOptions 0x%x samDesired 0x%x phkResult %p\n",
|
||||||
hKey, lpSubKey, ulOptions, samDesired, phkResult);
|
hKey, lpSubKey, ulOptions, samDesired, phkResult);
|
||||||
|
|
||||||
Status = MapDefaultKey (&KeyHandle, hKey);
|
Status = MapDefaultKey (&KeyHandle, hKey);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -1738,13 +1738,13 @@ RegOpenUserClassesRoot (IN HANDLE hToken,
|
||||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
LONG ErrorCode;
|
LONG ErrorCode;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
/* check parameters */
|
/* check parameters */
|
||||||
if (hToken == NULL || dwOptions != 0 || phkResult == NULL)
|
if (hToken == NULL || dwOptions != 0 || phkResult == NULL)
|
||||||
{
|
{
|
||||||
return ERROR_INVALID_PARAMETER;
|
return ERROR_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get the user sid from the token
|
* Get the user sid from the token
|
||||||
*/
|
*/
|
||||||
|
@ -1789,14 +1789,14 @@ ReadTokenSid:
|
||||||
/* the information appears to have changed?! try again */
|
/* the information appears to have changed?! try again */
|
||||||
goto ReadTokenSid;
|
goto ReadTokenSid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* NOTE - as opposed to all other registry functions windows does indeed
|
/* NOTE - as opposed to all other registry functions windows does indeed
|
||||||
change the last error code in case the caller supplied a invalid
|
change the last error code in case the caller supplied a invalid
|
||||||
handle for example! */
|
handle for example! */
|
||||||
ErrorCode = RtlNtStatusToDosError (Status);
|
ErrorCode = RtlNtStatusToDosError (Status);
|
||||||
return ErrorCode;
|
return ErrorCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Build the absolute path for the user's registry in the form
|
* Build the absolute path for the user's registry in the form
|
||||||
* "\Registry\User\<SID>_Classes"
|
* "\Registry\User\<SID>_Classes"
|
||||||
|
@ -1814,7 +1814,7 @@ ReadTokenSid:
|
||||||
{
|
{
|
||||||
return RtlNtStatusToDosError (Status);
|
return RtlNtStatusToDosError (Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* allocate enough memory for the entire key string */
|
/* allocate enough memory for the entire key string */
|
||||||
UserClassesKeyRoot.Length = 0;
|
UserClassesKeyRoot.Length = 0;
|
||||||
UserClassesKeyRoot.MaximumLength = UserSidString.Length +
|
UserClassesKeyRoot.MaximumLength = UserSidString.Length +
|
||||||
|
@ -1828,7 +1828,7 @@ ReadTokenSid:
|
||||||
RtlFreeUnicodeString(&UserSidString);
|
RtlFreeUnicodeString(&UserSidString);
|
||||||
return RtlNtStatusToDosError (Status);
|
return RtlNtStatusToDosError (Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* build the string */
|
/* build the string */
|
||||||
RtlAppendUnicodeToString(&UserClassesKeyRoot,
|
RtlAppendUnicodeToString(&UserClassesKeyRoot,
|
||||||
UserClassesKeyPrefix);
|
UserClassesKeyPrefix);
|
||||||
|
@ -1836,7 +1836,7 @@ ReadTokenSid:
|
||||||
&UserSidString);
|
&UserSidString);
|
||||||
RtlAppendUnicodeToString(&UserClassesKeyRoot,
|
RtlAppendUnicodeToString(&UserClassesKeyRoot,
|
||||||
UserClassesKeySuffix);
|
UserClassesKeySuffix);
|
||||||
|
|
||||||
DPRINT("RegOpenUserClassesRoot: Absolute path: %wZ\n", &UserClassesKeyRoot);
|
DPRINT("RegOpenUserClassesRoot: Absolute path: %wZ\n", &UserClassesKeyRoot);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1848,19 +1848,19 @@ ReadTokenSid:
|
||||||
OBJ_CASE_INSENSITIVE,
|
OBJ_CASE_INSENSITIVE,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
Status = NtOpenKey((PHANDLE)phkResult,
|
Status = NtOpenKey((PHANDLE)phkResult,
|
||||||
samDesired,
|
samDesired,
|
||||||
&ObjectAttributes);
|
&ObjectAttributes);
|
||||||
|
|
||||||
RtlFreeUnicodeString(&UserSidString);
|
RtlFreeUnicodeString(&UserSidString);
|
||||||
RtlFreeUnicodeString(&UserClassesKeyRoot);
|
RtlFreeUnicodeString(&UserClassesKeyRoot);
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
return RtlNtStatusToDosError (Status);
|
return RtlNtStatusToDosError (Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3037,7 +3037,7 @@ RegSetValueExA (HKEY hKey,
|
||||||
{
|
{
|
||||||
cbData++;
|
cbData++;
|
||||||
}
|
}
|
||||||
|
|
||||||
RtlInitAnsiString (&AnsiString,
|
RtlInitAnsiString (&AnsiString,
|
||||||
NULL);
|
NULL);
|
||||||
AnsiString.Buffer = (PSTR)lpData;
|
AnsiString.Buffer = (PSTR)lpData;
|
||||||
|
@ -3116,7 +3116,7 @@ RegSetValueExW (HKEY hKey,
|
||||||
RtlInitUnicodeString (&ValueName, L"");
|
RtlInitUnicodeString (&ValueName, L"");
|
||||||
}
|
}
|
||||||
pValueName = &ValueName;
|
pValueName = &ValueName;
|
||||||
|
|
||||||
if (((dwType == REG_SZ) ||
|
if (((dwType == REG_SZ) ||
|
||||||
(dwType == REG_MULTI_SZ) ||
|
(dwType == REG_MULTI_SZ) ||
|
||||||
(dwType == REG_EXPAND_SZ)) &&
|
(dwType == REG_EXPAND_SZ)) &&
|
||||||
|
@ -3155,12 +3155,12 @@ RegSetValueA (HKEY hKey,
|
||||||
{
|
{
|
||||||
LONG ret;
|
LONG ret;
|
||||||
HKEY hSubKey;
|
HKEY hSubKey;
|
||||||
|
|
||||||
if (dwType != REG_SZ)
|
if (dwType != REG_SZ)
|
||||||
{
|
{
|
||||||
return ERROR_INVALID_PARAMETER;
|
return ERROR_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lpSubKey != NULL && lpSubKey[0] != '\0')
|
if (lpSubKey != NULL && lpSubKey[0] != '\0')
|
||||||
{
|
{
|
||||||
ret = RegCreateKeyA(hKey,
|
ret = RegCreateKeyA(hKey,
|
||||||
|
@ -3174,14 +3174,14 @@ RegSetValueA (HKEY hKey,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
hSubKey = hKey;
|
hSubKey = hKey;
|
||||||
|
|
||||||
ret = RegSetValueExA(hSubKey,
|
ret = RegSetValueExA(hSubKey,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
REG_SZ,
|
REG_SZ,
|
||||||
(CONST BYTE*)lpData,
|
(CONST BYTE*)lpData,
|
||||||
strlen(lpData) + 1);
|
strlen(lpData) + 1);
|
||||||
|
|
||||||
if (hSubKey != hKey)
|
if (hSubKey != hKey)
|
||||||
{
|
{
|
||||||
RegCloseKey(hSubKey);
|
RegCloseKey(hSubKey);
|
||||||
|
|
|
@ -53,7 +53,7 @@ AreAnyAccessesGranted(DWORD GrantedAccess,
|
||||||
*
|
*
|
||||||
* RETURNS
|
* RETURNS
|
||||||
* Success: TRUE. pSecurityDescriptor contains the requested information.
|
* Success: TRUE. pSecurityDescriptor contains the requested information.
|
||||||
* Failure: FALSE. lpnLengthNeeded contains the required space to return the info.
|
* Failure: FALSE. lpnLengthNeeded contains the required space to return the info.
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* The information returned is constrained by the callers access rights and
|
* The information returned is constrained by the callers access rights and
|
||||||
|
@ -476,7 +476,7 @@ GetUserNameA( LPSTR lpszName, LPDWORD lpSize )
|
||||||
UNICODE_STRING NameW;
|
UNICODE_STRING NameW;
|
||||||
ANSI_STRING NameA;
|
ANSI_STRING NameA;
|
||||||
BOOL Ret;
|
BOOL Ret;
|
||||||
|
|
||||||
/* apparently Win doesn't check whether lpSize is valid at all! */
|
/* apparently Win doesn't check whether lpSize is valid at all! */
|
||||||
|
|
||||||
NameW.Length = 0;
|
NameW.Length = 0;
|
||||||
|
@ -487,23 +487,23 @@ GetUserNameA( LPSTR lpszName, LPDWORD lpSize )
|
||||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
NameA.Length = 0;
|
NameA.Length = 0;
|
||||||
NameA.MaximumLength = ((*lpSize) < 0xFFFF ? (USHORT)(*lpSize) : 0xFFFF);
|
NameA.MaximumLength = ((*lpSize) < 0xFFFF ? (USHORT)(*lpSize) : 0xFFFF);
|
||||||
NameA.Buffer = lpszName;
|
NameA.Buffer = lpszName;
|
||||||
|
|
||||||
Ret = GetUserNameW(NameW.Buffer,
|
Ret = GetUserNameW(NameW.Buffer,
|
||||||
lpSize);
|
lpSize);
|
||||||
if(Ret)
|
if(Ret)
|
||||||
{
|
{
|
||||||
RtlUnicodeStringToAnsiString(&NameA, &NameW, FALSE);
|
RtlUnicodeStringToAnsiString(&NameA, &NameW, FALSE);
|
||||||
NameA.Buffer[NameA.Length] = '\0';
|
NameA.Buffer[NameA.Length] = '\0';
|
||||||
|
|
||||||
*lpSize = NameA.Length + 1;
|
*lpSize = NameA.Length + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalFree(NameW.Buffer);
|
LocalFree(NameW.Buffer);
|
||||||
|
|
||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -634,18 +634,18 @@ LookupAccountSidA (LPCSTR lpSystemName,
|
||||||
UNICODE_STRING NameW, ReferencedDomainNameW, SystemNameW;
|
UNICODE_STRING NameW, ReferencedDomainNameW, SystemNameW;
|
||||||
DWORD szName, szReferencedDomainName;
|
DWORD szName, szReferencedDomainName;
|
||||||
BOOL Ret;
|
BOOL Ret;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* save the buffer sizes the caller passed to us, as they may get modified and
|
* save the buffer sizes the caller passed to us, as they may get modified and
|
||||||
* we require the original values when converting back to ansi
|
* we require the original values when converting back to ansi
|
||||||
*/
|
*/
|
||||||
szName = *cchName;
|
szName = *cchName;
|
||||||
szReferencedDomainName = *cchReferencedDomainName;
|
szReferencedDomainName = *cchReferencedDomainName;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* allocate buffers for the unicode strings to receive
|
* allocate buffers for the unicode strings to receive
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(szName > 0)
|
if(szName > 0)
|
||||||
{
|
{
|
||||||
NameW.Length = 0;
|
NameW.Length = 0;
|
||||||
|
@ -659,7 +659,7 @@ LookupAccountSidA (LPCSTR lpSystemName,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
NameW.Buffer = NULL;
|
NameW.Buffer = NULL;
|
||||||
|
|
||||||
if(szReferencedDomainName > 0)
|
if(szReferencedDomainName > 0)
|
||||||
{
|
{
|
||||||
ReferencedDomainNameW.Length = 0;
|
ReferencedDomainNameW.Length = 0;
|
||||||
|
@ -677,11 +677,11 @@ LookupAccountSidA (LPCSTR lpSystemName,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ReferencedDomainNameW.Buffer = NULL;
|
ReferencedDomainNameW.Buffer = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* convert the system name to unicode - if present
|
* convert the system name to unicode - if present
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(lpSystemName != NULL)
|
if(lpSystemName != NULL)
|
||||||
{
|
{
|
||||||
ANSI_STRING SystemNameA;
|
ANSI_STRING SystemNameA;
|
||||||
|
@ -691,11 +691,11 @@ LookupAccountSidA (LPCSTR lpSystemName,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
SystemNameW.Buffer = NULL;
|
SystemNameW.Buffer = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* it's time to call the unicode version
|
* it's time to call the unicode version
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Ret = LookupAccountSidW(SystemNameW.Buffer,
|
Ret = LookupAccountSidW(SystemNameW.Buffer,
|
||||||
lpSid,
|
lpSid,
|
||||||
NameW.Buffer,
|
NameW.Buffer,
|
||||||
|
@ -713,15 +713,15 @@ LookupAccountSidA (LPCSTR lpSystemName,
|
||||||
if(lpName != NULL)
|
if(lpName != NULL)
|
||||||
{
|
{
|
||||||
ANSI_STRING NameA;
|
ANSI_STRING NameA;
|
||||||
|
|
||||||
NameA.Length = 0;
|
NameA.Length = 0;
|
||||||
NameA.MaximumLength = ((szName <= 0xFFFF) ? (USHORT)szName : 0xFFFF);
|
NameA.MaximumLength = ((szName <= 0xFFFF) ? (USHORT)szName : 0xFFFF);
|
||||||
NameA.Buffer = lpName;
|
NameA.Buffer = lpName;
|
||||||
|
|
||||||
RtlUnicodeStringToAnsiString(&NameA, &NameW, FALSE);
|
RtlUnicodeStringToAnsiString(&NameA, &NameW, FALSE);
|
||||||
NameA.Buffer[NameA.Length] = '\0';
|
NameA.Buffer[NameA.Length] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(lpReferencedDomainName != NULL)
|
if(lpReferencedDomainName != NULL)
|
||||||
{
|
{
|
||||||
ANSI_STRING ReferencedDomainNameA;
|
ANSI_STRING ReferencedDomainNameA;
|
||||||
|
@ -735,7 +735,7 @@ LookupAccountSidA (LPCSTR lpSystemName,
|
||||||
ReferencedDomainNameA.Buffer[ReferencedDomainNameA.Length] = '\0';
|
ReferencedDomainNameA.Buffer[ReferencedDomainNameA.Length] = '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* free previously allocated buffers
|
* free previously allocated buffers
|
||||||
*/
|
*/
|
||||||
|
@ -752,7 +752,7 @@ LookupAccountSidA (LPCSTR lpSystemName,
|
||||||
{
|
{
|
||||||
LocalFree(ReferencedDomainNameW.Buffer);
|
LocalFree(ReferencedDomainNameW.Buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1196,19 +1196,19 @@ SetSecurityInfo(HANDLE handle,
|
||||||
* GetSecurityInfoExW EXPORTED
|
* GetSecurityInfoExW EXPORTED
|
||||||
*/
|
*/
|
||||||
DWORD WINAPI GetSecurityInfoExA(
|
DWORD WINAPI GetSecurityInfoExA(
|
||||||
HANDLE hObject,
|
HANDLE hObject,
|
||||||
SE_OBJECT_TYPE ObjectType,
|
SE_OBJECT_TYPE ObjectType,
|
||||||
SECURITY_INFORMATION SecurityInfo,
|
SECURITY_INFORMATION SecurityInfo,
|
||||||
LPCSTR lpProvider,
|
LPCSTR lpProvider,
|
||||||
LPCSTR lpProperty,
|
LPCSTR lpProperty,
|
||||||
PACTRL_ACCESSA *ppAccessList,
|
PACTRL_ACCESSA *ppAccessList,
|
||||||
PACTRL_AUDITA *ppAuditList,
|
PACTRL_AUDITA *ppAuditList,
|
||||||
LPSTR *lppOwner,
|
LPSTR *lppOwner,
|
||||||
LPSTR *lppGroup
|
LPSTR *lppGroup
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
DPRINT1("GetSecurityInfoExA stub!\n");
|
DPRINT1("GetSecurityInfoExA stub!\n");
|
||||||
return ERROR_BAD_PROVIDER;
|
return ERROR_BAD_PROVIDER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1216,19 +1216,19 @@ DWORD WINAPI GetSecurityInfoExA(
|
||||||
* GetSecurityInfoExW EXPORTED
|
* GetSecurityInfoExW EXPORTED
|
||||||
*/
|
*/
|
||||||
DWORD WINAPI GetSecurityInfoExW(
|
DWORD WINAPI GetSecurityInfoExW(
|
||||||
HANDLE hObject,
|
HANDLE hObject,
|
||||||
SE_OBJECT_TYPE ObjectType,
|
SE_OBJECT_TYPE ObjectType,
|
||||||
SECURITY_INFORMATION SecurityInfo,
|
SECURITY_INFORMATION SecurityInfo,
|
||||||
LPCWSTR lpProvider,
|
LPCWSTR lpProvider,
|
||||||
LPCWSTR lpProperty,
|
LPCWSTR lpProperty,
|
||||||
PACTRL_ACCESSW *ppAccessList,
|
PACTRL_ACCESSW *ppAccessList,
|
||||||
PACTRL_AUDITW *ppAuditList,
|
PACTRL_AUDITW *ppAuditList,
|
||||||
LPWSTR *lppOwner,
|
LPWSTR *lppOwner,
|
||||||
LPWSTR *lppGroup
|
LPWSTR *lppGroup
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
DPRINT1("GetSecurityInfoExW stub!\n");
|
DPRINT1("GetSecurityInfoExW stub!\n");
|
||||||
return ERROR_BAD_PROVIDER;
|
return ERROR_BAD_PROVIDER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* $Id$
|
/* $Id$
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS system libraries
|
* PROJECT: ReactOS system libraries
|
||||||
* FILE: lib/advapi32/service/sctrl.c
|
* FILE: lib/advapi32/service/sctrl.c
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* $Id$
|
/* $Id$
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS system libraries
|
* PROJECT: ReactOS system libraries
|
||||||
* FILE: lib/advapi32/service/undoc.c
|
* FILE: lib/advapi32/service/undoc.c
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id$
|
/* $Id$
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS system libraries
|
* PROJECT: ReactOS system libraries
|
||||||
|
|
|
@ -261,7 +261,7 @@ DuplicateTokenEx (IN HANDLE ExistingTokenHandle,
|
||||||
HANDLE NewToken;
|
HANDLE NewToken;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
SECURITY_QUALITY_OF_SERVICE Sqos;
|
SECURITY_QUALITY_OF_SERVICE Sqos;
|
||||||
|
|
||||||
Sqos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE);
|
Sqos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE);
|
||||||
Sqos.ImpersonationLevel = ImpersonationLevel;
|
Sqos.ImpersonationLevel = ImpersonationLevel;
|
||||||
Sqos.ContextTrackingMode = 0;
|
Sqos.ContextTrackingMode = 0;
|
||||||
|
@ -285,7 +285,7 @@ DuplicateTokenEx (IN HANDLE ExistingTokenHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
ObjectAttributes.SecurityQualityOfService = &Sqos;
|
ObjectAttributes.SecurityQualityOfService = &Sqos;
|
||||||
|
|
||||||
Status = NtDuplicateToken (ExistingTokenHandle,
|
Status = NtDuplicateToken (ExistingTokenHandle,
|
||||||
dwDesiredAccess,
|
dwDesiredAccess,
|
||||||
&ObjectAttributes,
|
&ObjectAttributes,
|
||||||
|
@ -334,26 +334,26 @@ CheckTokenMembership (HANDLE ExistingTokenHandle,
|
||||||
DWORD i;
|
DWORD i;
|
||||||
PTOKEN_GROUPS lpGroups = NULL;
|
PTOKEN_GROUPS lpGroups = NULL;
|
||||||
TOKEN_TYPE TokenInformation;
|
TOKEN_TYPE TokenInformation;
|
||||||
|
|
||||||
if (IsMember == NULL)
|
if (IsMember == NULL)
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_INVALID_PARAMETER);
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ExistingTokenHandle == NULL)
|
if (ExistingTokenHandle == NULL)
|
||||||
{
|
{
|
||||||
/* Get impersonation token of the calling thread */
|
/* Get impersonation token of the calling thread */
|
||||||
if (!OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, FALSE, &ExistingTokenHandle))
|
if (!OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, FALSE, &ExistingTokenHandle))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (!DuplicateToken(ExistingTokenHandle, SecurityAnonymous, &AccessToken))
|
if (!DuplicateToken(ExistingTokenHandle, SecurityAnonymous, &AccessToken))
|
||||||
{
|
{
|
||||||
CloseHandle(ExistingTokenHandle);
|
CloseHandle(ExistingTokenHandle);
|
||||||
goto ByeBye;
|
goto ByeBye;
|
||||||
}
|
}
|
||||||
CloseHandle(ExistingTokenHandle);
|
CloseHandle(ExistingTokenHandle);
|
||||||
ReleaseToken = TRUE;
|
ReleaseToken = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -369,7 +369,7 @@ CheckTokenMembership (HANDLE ExistingTokenHandle,
|
||||||
else
|
else
|
||||||
AccessToken = ExistingTokenHandle;
|
AccessToken = ExistingTokenHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
*IsMember = FALSE;
|
*IsMember = FALSE;
|
||||||
/* Search in groups of the token */
|
/* Search in groups of the token */
|
||||||
if (!GetTokenInformation(AccessToken, TokenGroups, NULL, 0, &dwSize))
|
if (!GetTokenInformation(AccessToken, TokenGroups, NULL, 0, &dwSize))
|
||||||
|
@ -391,13 +391,13 @@ CheckTokenMembership (HANDLE ExistingTokenHandle,
|
||||||
/* FIXME: Search in users of the token? */
|
/* FIXME: Search in users of the token? */
|
||||||
DPRINT1("CheckTokenMembership() partially implemented!\n");
|
DPRINT1("CheckTokenMembership() partially implemented!\n");
|
||||||
Result = TRUE;
|
Result = TRUE;
|
||||||
|
|
||||||
ByeBye:
|
ByeBye:
|
||||||
if (lpGroups != NULL)
|
if (lpGroups != NULL)
|
||||||
HeapFree(GetProcessHeap(), 0, lpGroups);
|
HeapFree(GetProcessHeap(), 0, lpGroups);
|
||||||
if (ReleaseToken)
|
if (ReleaseToken)
|
||||||
CloseHandle(AccessToken);
|
CloseHandle(AccessToken);
|
||||||
|
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,7 @@ static void init_function_pointers(void)
|
||||||
static void init_environment(void)
|
static void init_environment(void)
|
||||||
{
|
{
|
||||||
HCRYPTPROV hProv;
|
HCRYPTPROV hProv;
|
||||||
|
|
||||||
/* Ensure that container "wine_test_keyset" does exist */
|
/* Ensure that container "wine_test_keyset" does exist */
|
||||||
if (!pCryptAcquireContextA(&hProv, szKeySet, szRsaBaseProv, PROV_RSA_FULL, 0))
|
if (!pCryptAcquireContextA(&hProv, szKeySet, szRsaBaseProv, PROV_RSA_FULL, 0))
|
||||||
{
|
{
|
||||||
|
@ -155,39 +155,39 @@ static void test_acquire_context(void)
|
||||||
BOOL result;
|
BOOL result;
|
||||||
HCRYPTPROV hProv;
|
HCRYPTPROV hProv;
|
||||||
|
|
||||||
/* Provoke all kinds of error conditions (which are easy to provoke).
|
/* Provoke all kinds of error conditions (which are easy to provoke).
|
||||||
* The order of the error tests seems to match Windows XP's rsaenh.dll CSP,
|
* The order of the error tests seems to match Windows XP's rsaenh.dll CSP,
|
||||||
* but since this is likely to change between CSP versions, we don't check
|
* but since this is likely to change between CSP versions, we don't check
|
||||||
* this. Please don't change the order of tests. */
|
* this. Please don't change the order of tests. */
|
||||||
result = pCryptAcquireContextA(&hProv, NULL, NULL, 0, 0);
|
result = pCryptAcquireContextA(&hProv, NULL, NULL, 0, 0);
|
||||||
ok(!result && GetLastError()==NTE_BAD_PROV_TYPE, "%ld\n", GetLastError());
|
ok(!result && GetLastError()==NTE_BAD_PROV_TYPE, "%ld\n", GetLastError());
|
||||||
|
|
||||||
result = pCryptAcquireContextA(&hProv, NULL, NULL, 1000, 0);
|
result = pCryptAcquireContextA(&hProv, NULL, NULL, 1000, 0);
|
||||||
ok(!result && GetLastError()==NTE_BAD_PROV_TYPE, "%ld\n", GetLastError());
|
ok(!result && GetLastError()==NTE_BAD_PROV_TYPE, "%ld\n", GetLastError());
|
||||||
|
|
||||||
result = pCryptAcquireContextA(&hProv, NULL, NULL, NON_DEF_PROV_TYPE, 0);
|
result = pCryptAcquireContextA(&hProv, NULL, NULL, NON_DEF_PROV_TYPE, 0);
|
||||||
ok(!result && GetLastError()==NTE_PROV_TYPE_NOT_DEF, "%ld\n", GetLastError());
|
ok(!result && GetLastError()==NTE_PROV_TYPE_NOT_DEF, "%ld\n", GetLastError());
|
||||||
|
|
||||||
result = pCryptAcquireContextA(&hProv, szKeySet, szNonExistentProv, PROV_RSA_FULL, 0);
|
result = pCryptAcquireContextA(&hProv, szKeySet, szNonExistentProv, PROV_RSA_FULL, 0);
|
||||||
ok(!result && GetLastError()==NTE_KEYSET_NOT_DEF, "%ld\n", GetLastError());
|
ok(!result && GetLastError()==NTE_KEYSET_NOT_DEF, "%ld\n", GetLastError());
|
||||||
|
|
||||||
result = pCryptAcquireContextA(&hProv, szKeySet, szRsaBaseProv, NON_DEF_PROV_TYPE, 0);
|
result = pCryptAcquireContextA(&hProv, szKeySet, szRsaBaseProv, NON_DEF_PROV_TYPE, 0);
|
||||||
ok(!result && GetLastError()==NTE_PROV_TYPE_NO_MATCH, "%ld\n", GetLastError());
|
ok(!result && GetLastError()==NTE_PROV_TYPE_NO_MATCH, "%ld\n", GetLastError());
|
||||||
|
|
||||||
/* This test fails under Win2k SP4:
|
/* This test fails under Win2k SP4:
|
||||||
result = TRUE, GetLastError() == ERROR_INVALID_PARAMETER
|
result = TRUE, GetLastError() == ERROR_INVALID_PARAMETER
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
result = pCryptAcquireContextA(NULL, szKeySet, szRsaBaseProv, PROV_RSA_FULL, 0);
|
result = pCryptAcquireContextA(NULL, szKeySet, szRsaBaseProv, PROV_RSA_FULL, 0);
|
||||||
ok(!result && GetLastError()==ERROR_INVALID_PARAMETER, "%d/%ld\n", result, GetLastError());
|
ok(!result && GetLastError()==ERROR_INVALID_PARAMETER, "%d/%ld\n", result, GetLastError());
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Last not least, try to really acquire a context. */
|
/* Last not least, try to really acquire a context. */
|
||||||
hProv = 0;
|
hProv = 0;
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
result = pCryptAcquireContextA(&hProv, szKeySet, szRsaBaseProv, PROV_RSA_FULL, 0);
|
result = pCryptAcquireContextA(&hProv, szKeySet, szRsaBaseProv, PROV_RSA_FULL, 0);
|
||||||
ok(result && (GetLastError() == ERROR_ENVVAR_NOT_FOUND || GetLastError() == ERROR_SUCCESS || GetLastError() == ERROR_RING2_STACK_IN_USE || GetLastError() == NTE_FAIL), "%d/%ld\n", result, GetLastError());
|
ok(result && (GetLastError() == ERROR_ENVVAR_NOT_FOUND || GetLastError() == ERROR_SUCCESS || GetLastError() == ERROR_RING2_STACK_IN_USE || GetLastError() == NTE_FAIL), "%d/%ld\n", result, GetLastError());
|
||||||
|
|
||||||
if (hProv)
|
if (hProv)
|
||||||
pCryptReleaseContext(hProv, 0);
|
pCryptReleaseContext(hProv, 0);
|
||||||
|
|
||||||
/* Try again, witch an empty ("\0") szProvider parameter */
|
/* Try again, witch an empty ("\0") szProvider parameter */
|
||||||
|
@ -196,7 +196,7 @@ static void test_acquire_context(void)
|
||||||
result = pCryptAcquireContextA(&hProv, szKeySet, "", PROV_RSA_FULL, 0);
|
result = pCryptAcquireContextA(&hProv, szKeySet, "", PROV_RSA_FULL, 0);
|
||||||
ok(result && (GetLastError() == ERROR_ENVVAR_NOT_FOUND || GetLastError() == ERROR_SUCCESS || GetLastError() == ERROR_RING2_STACK_IN_USE || GetLastError() == NTE_FAIL), "%d/%ld\n", result, GetLastError());
|
ok(result && (GetLastError() == ERROR_ENVVAR_NOT_FOUND || GetLastError() == ERROR_SUCCESS || GetLastError() == ERROR_RING2_STACK_IN_USE || GetLastError() == NTE_FAIL), "%d/%ld\n", result, GetLastError());
|
||||||
|
|
||||||
if (hProv)
|
if (hProv)
|
||||||
pCryptReleaseContext(hProv, 0);
|
pCryptReleaseContext(hProv, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,17 +209,17 @@ static void test_incorrect_api_usage(void)
|
||||||
BYTE temp;
|
BYTE temp;
|
||||||
DWORD dwLen, dwTemp;
|
DWORD dwLen, dwTemp;
|
||||||
|
|
||||||
/* This is to document incorrect api usage in the
|
/* This is to document incorrect api usage in the
|
||||||
* "Uru - Ages beyond Myst Demo" installer as reported by Paul Vriens.
|
* "Uru - Ages beyond Myst Demo" installer as reported by Paul Vriens.
|
||||||
*
|
*
|
||||||
* The installer destroys a hash object after having released the context
|
* The installer destroys a hash object after having released the context
|
||||||
* with which the hash was created. This is not allowed according to MSDN,
|
* with which the hash was created. This is not allowed according to MSDN,
|
||||||
* since CryptReleaseContext destroys all hash and key objects belonging to
|
* since CryptReleaseContext destroys all hash and key objects belonging to
|
||||||
* the respective context. However, while wine used to crash, Windows is more
|
* the respective context. However, while wine used to crash, Windows is more
|
||||||
* robust here and returns an ERROR_INVALID_PARAMETER code.
|
* robust here and returns an ERROR_INVALID_PARAMETER code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
result = pCryptAcquireContextA(&hProv, szBadKeySet, szRsaBaseProv,
|
result = pCryptAcquireContextA(&hProv, szBadKeySet, szRsaBaseProv,
|
||||||
PROV_RSA_FULL, CRYPT_NEWKEYSET);
|
PROV_RSA_FULL, CRYPT_NEWKEYSET);
|
||||||
ok (result, "%08lx\n", GetLastError());
|
ok (result, "%08lx\n", GetLastError());
|
||||||
if (!result) return;
|
if (!result) return;
|
||||||
|
@ -239,15 +239,15 @@ static void test_incorrect_api_usage(void)
|
||||||
result = pCryptDestroyKey(hKey2);
|
result = pCryptDestroyKey(hKey2);
|
||||||
ok (result, "%ld\n", GetLastError());
|
ok (result, "%ld\n", GetLastError());
|
||||||
|
|
||||||
dwTemp = CRYPT_MODE_ECB;
|
dwTemp = CRYPT_MODE_ECB;
|
||||||
result = pCryptSetKeyParam(hKey2, KP_MODE, (BYTE*)&dwTemp, sizeof(DWORD));
|
result = pCryptSetKeyParam(hKey2, KP_MODE, (BYTE*)&dwTemp, sizeof(DWORD));
|
||||||
ok (!result && GetLastError() == ERROR_INVALID_PARAMETER, "%ld\n", GetLastError());
|
ok (!result && GetLastError() == ERROR_INVALID_PARAMETER, "%ld\n", GetLastError());
|
||||||
|
|
||||||
result = pCryptAcquireContextA(&hProv2, szBadKeySet, NULL, PROV_RSA_FULL,
|
result = pCryptAcquireContextA(&hProv2, szBadKeySet, NULL, PROV_RSA_FULL,
|
||||||
CRYPT_DELETEKEYSET);
|
CRYPT_DELETEKEYSET);
|
||||||
ok (result, "%ld\n", GetLastError());
|
ok (result, "%ld\n", GetLastError());
|
||||||
if (!result) return;
|
if (!result) return;
|
||||||
|
|
||||||
result = pCryptReleaseContext(hProv, 0);
|
result = pCryptReleaseContext(hProv, 0);
|
||||||
ok (result, "%ld\n", GetLastError());
|
ok (result, "%ld\n", GetLastError());
|
||||||
if (!result) return;
|
if (!result) return;
|
||||||
|
@ -303,7 +303,7 @@ static void test_incorrect_api_usage(void)
|
||||||
dwLen = 1;
|
dwLen = 1;
|
||||||
result = pCryptGetProvParam(hProv, 0, &temp, &dwLen, 0);
|
result = pCryptGetProvParam(hProv, 0, &temp, &dwLen, 0);
|
||||||
ok (!result && GetLastError() == ERROR_INVALID_PARAMETER, "%ld\n", GetLastError());
|
ok (!result && GetLastError() == ERROR_INVALID_PARAMETER, "%ld\n", GetLastError());
|
||||||
|
|
||||||
result = pCryptGetUserKey(hProv, 0, &hKey2);
|
result = pCryptGetUserKey(hProv, 0, &hKey2);
|
||||||
ok (!result && GetLastError() == ERROR_INVALID_PARAMETER, "%ld\n", GetLastError());
|
ok (!result && GetLastError() == ERROR_INVALID_PARAMETER, "%ld\n", GetLastError());
|
||||||
|
|
||||||
|
@ -336,37 +336,37 @@ static void test_incorrect_api_usage(void)
|
||||||
|
|
||||||
result = pCryptDestroyHash(hHash);
|
result = pCryptDestroyHash(hHash);
|
||||||
ok (!result && GetLastError() == ERROR_INVALID_PARAMETER, "%ld\n", GetLastError());
|
ok (!result && GetLastError() == ERROR_INVALID_PARAMETER, "%ld\n", GetLastError());
|
||||||
|
|
||||||
result = pCryptDestroyKey(hKey);
|
result = pCryptDestroyKey(hKey);
|
||||||
ok (!result && GetLastError() == ERROR_INVALID_PARAMETER, "%ld\n", GetLastError());
|
ok (!result && GetLastError() == ERROR_INVALID_PARAMETER, "%ld\n", GetLastError());
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL FindProvRegVals(DWORD dwIndex, DWORD *pdwProvType, LPSTR *pszProvName,
|
static BOOL FindProvRegVals(DWORD dwIndex, DWORD *pdwProvType, LPSTR *pszProvName,
|
||||||
DWORD *pcbProvName, DWORD *pdwProvCount)
|
DWORD *pcbProvName, DWORD *pdwProvCount)
|
||||||
{
|
{
|
||||||
HKEY hKey;
|
HKEY hKey;
|
||||||
HKEY subkey;
|
HKEY subkey;
|
||||||
DWORD size = sizeof(DWORD);
|
DWORD size = sizeof(DWORD);
|
||||||
|
|
||||||
if (RegOpenKey(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Cryptography\\Defaults\\Provider", &hKey))
|
if (RegOpenKey(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Cryptography\\Defaults\\Provider", &hKey))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
RegQueryInfoKey(hKey, NULL, NULL, NULL, pdwProvCount, pcbProvName,
|
RegQueryInfoKey(hKey, NULL, NULL, NULL, pdwProvCount, pcbProvName,
|
||||||
NULL, NULL, NULL, NULL, NULL, NULL);
|
NULL, NULL, NULL, NULL, NULL, NULL);
|
||||||
(*pcbProvName)++;
|
(*pcbProvName)++;
|
||||||
|
|
||||||
if (!(*pszProvName = ((LPSTR)LocalAlloc(LMEM_ZEROINIT, *pcbProvName))))
|
if (!(*pszProvName = ((LPSTR)LocalAlloc(LMEM_ZEROINIT, *pcbProvName))))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
RegEnumKeyEx(hKey, dwIndex, *pszProvName, pcbProvName, NULL, NULL, NULL, NULL);
|
RegEnumKeyEx(hKey, dwIndex, *pszProvName, pcbProvName, NULL, NULL, NULL, NULL);
|
||||||
(*pcbProvName)++;
|
(*pcbProvName)++;
|
||||||
|
|
||||||
RegOpenKey(hKey, *pszProvName, &subkey);
|
RegOpenKey(hKey, *pszProvName, &subkey);
|
||||||
RegQueryValueEx(subkey, "Type", NULL, NULL, (BYTE*)pdwProvType, &size);
|
RegQueryValueEx(subkey, "Type", NULL, NULL, (BYTE*)pdwProvType, &size);
|
||||||
|
|
||||||
RegCloseKey(subkey);
|
RegCloseKey(subkey);
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -378,7 +378,7 @@ static void test_enum_providers(void)
|
||||||
DWORD dwType;
|
DWORD dwType;
|
||||||
DWORD provCount;
|
DWORD provCount;
|
||||||
DWORD dwIndex = 0;
|
DWORD dwIndex = 0;
|
||||||
|
|
||||||
/* actual results */
|
/* actual results */
|
||||||
CHAR *provider = NULL;
|
CHAR *provider = NULL;
|
||||||
DWORD providerLen;
|
DWORD providerLen;
|
||||||
|
@ -387,24 +387,24 @@ static void test_enum_providers(void)
|
||||||
BOOL result;
|
BOOL result;
|
||||||
DWORD notNull = 5;
|
DWORD notNull = 5;
|
||||||
DWORD notZeroFlags = 5;
|
DWORD notZeroFlags = 5;
|
||||||
|
|
||||||
if(!pCryptEnumProvidersA)
|
if(!pCryptEnumProvidersA)
|
||||||
{
|
{
|
||||||
trace("skipping CryptEnumProviders tests\n");
|
trace("skipping CryptEnumProviders tests\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!FindProvRegVals(dwIndex, &dwType, &pszProvName, &cbName, &provCount))
|
if (!FindProvRegVals(dwIndex, &dwType, &pszProvName, &cbName, &provCount))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* check pdwReserved flag for NULL */
|
/* check pdwReserved flag for NULL */
|
||||||
result = pCryptEnumProvidersA(dwIndex, ¬Null, 0, &type, NULL, &providerLen);
|
result = pCryptEnumProvidersA(dwIndex, ¬Null, 0, &type, NULL, &providerLen);
|
||||||
ok(!result && GetLastError()==ERROR_INVALID_PARAMETER, "%ld\n", GetLastError());
|
ok(!result && GetLastError()==ERROR_INVALID_PARAMETER, "%ld\n", GetLastError());
|
||||||
|
|
||||||
/* check dwFlags == 0 */
|
/* check dwFlags == 0 */
|
||||||
result = pCryptEnumProvidersA(dwIndex, NULL, notZeroFlags, &type, NULL, &providerLen);
|
result = pCryptEnumProvidersA(dwIndex, NULL, notZeroFlags, &type, NULL, &providerLen);
|
||||||
ok(!result && GetLastError()==NTE_BAD_FLAGS, "%ld\n", GetLastError());
|
ok(!result && GetLastError()==NTE_BAD_FLAGS, "%ld\n", GetLastError());
|
||||||
|
|
||||||
/* alloc provider to half the size required
|
/* alloc provider to half the size required
|
||||||
* cbName holds the size required */
|
* cbName holds the size required */
|
||||||
providerLen = cbName / 2;
|
providerLen = cbName / 2;
|
||||||
|
@ -417,7 +417,7 @@ static void test_enum_providers(void)
|
||||||
|
|
||||||
LocalFree(provider);
|
LocalFree(provider);
|
||||||
|
|
||||||
/* loop through the providers to get the number of providers
|
/* loop through the providers to get the number of providers
|
||||||
* after loop ends, count should be provCount + 1 so subtract 1
|
* after loop ends, count should be provCount + 1 so subtract 1
|
||||||
* to get actual number of providers */
|
* to get actual number of providers */
|
||||||
count = 0;
|
count = 0;
|
||||||
|
@ -425,48 +425,48 @@ static void test_enum_providers(void)
|
||||||
;
|
;
|
||||||
count--;
|
count--;
|
||||||
ok(count==provCount, "expected %i, got %i\n", (int)provCount, (int)count);
|
ok(count==provCount, "expected %i, got %i\n", (int)provCount, (int)count);
|
||||||
|
|
||||||
/* loop past the actual number of providers to get the error
|
/* loop past the actual number of providers to get the error
|
||||||
* ERROR_NO_MORE_ITEMS */
|
* ERROR_NO_MORE_ITEMS */
|
||||||
for (count = 0; count < provCount + 1; count++)
|
for (count = 0; count < provCount + 1; count++)
|
||||||
result = pCryptEnumProvidersA(count, NULL, 0, &type, NULL, &providerLen);
|
result = pCryptEnumProvidersA(count, NULL, 0, &type, NULL, &providerLen);
|
||||||
ok(!result && GetLastError()==ERROR_NO_MORE_ITEMS, "expected %i, got %ld\n",
|
ok(!result && GetLastError()==ERROR_NO_MORE_ITEMS, "expected %i, got %ld\n",
|
||||||
ERROR_NO_MORE_ITEMS, GetLastError());
|
ERROR_NO_MORE_ITEMS, GetLastError());
|
||||||
|
|
||||||
/* check expected versus actual values returned */
|
/* check expected versus actual values returned */
|
||||||
result = pCryptEnumProvidersA(dwIndex, NULL, 0, &type, NULL, &providerLen);
|
result = pCryptEnumProvidersA(dwIndex, NULL, 0, &type, NULL, &providerLen);
|
||||||
ok(result && providerLen==cbName, "expected %i, got %i\n", (int)cbName, (int)providerLen);
|
ok(result && providerLen==cbName, "expected %i, got %i\n", (int)cbName, (int)providerLen);
|
||||||
if (!(provider = ((LPSTR)LocalAlloc(LMEM_ZEROINIT, providerLen))))
|
if (!(provider = ((LPSTR)LocalAlloc(LMEM_ZEROINIT, providerLen))))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
result = pCryptEnumProvidersA(dwIndex, NULL, 0, &type, provider, &providerLen);
|
result = pCryptEnumProvidersA(dwIndex, NULL, 0, &type, provider, &providerLen);
|
||||||
ok(result && type==dwType, "expected %ld, got %ld\n",
|
ok(result && type==dwType, "expected %ld, got %ld\n",
|
||||||
dwType, type);
|
dwType, type);
|
||||||
ok(result && !strcmp(pszProvName, provider), "expected %s, got %s\n", pszProvName, provider);
|
ok(result && !strcmp(pszProvName, provider), "expected %s, got %s\n", pszProvName, provider);
|
||||||
ok(result && cbName==providerLen, "expected %ld, got %ld\n",
|
ok(result && cbName==providerLen, "expected %ld, got %ld\n",
|
||||||
cbName, providerLen);
|
cbName, providerLen);
|
||||||
|
|
||||||
LocalFree(provider);
|
LocalFree(provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL FindProvTypesRegVals(DWORD dwIndex, DWORD *pdwProvType, LPSTR *pszTypeName,
|
static BOOL FindProvTypesRegVals(DWORD dwIndex, DWORD *pdwProvType, LPSTR *pszTypeName,
|
||||||
DWORD *pcbTypeName, DWORD *pdwTypeCount)
|
DWORD *pcbTypeName, DWORD *pdwTypeCount)
|
||||||
{
|
{
|
||||||
HKEY hKey;
|
HKEY hKey;
|
||||||
HKEY hSubKey;
|
HKEY hSubKey;
|
||||||
PSTR ch;
|
PSTR ch;
|
||||||
|
|
||||||
if (RegOpenKey(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Cryptography\\Defaults\\Provider Types", &hKey))
|
if (RegOpenKey(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Cryptography\\Defaults\\Provider Types", &hKey))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (RegQueryInfoKey(hKey, NULL, NULL, NULL, pdwTypeCount, pcbTypeName, NULL,
|
if (RegQueryInfoKey(hKey, NULL, NULL, NULL, pdwTypeCount, pcbTypeName, NULL,
|
||||||
NULL, NULL, NULL, NULL, NULL))
|
NULL, NULL, NULL, NULL, NULL))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
(*pcbTypeName)++;
|
(*pcbTypeName)++;
|
||||||
|
|
||||||
if (!(*pszTypeName = ((LPSTR)LocalAlloc(LMEM_ZEROINIT, *pcbTypeName))))
|
if (!(*pszTypeName = ((LPSTR)LocalAlloc(LMEM_ZEROINIT, *pcbTypeName))))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (RegEnumKeyEx(hKey, dwIndex, *pszTypeName, pcbTypeName, NULL, NULL, NULL, NULL))
|
if (RegEnumKeyEx(hKey, dwIndex, *pszTypeName, pcbTypeName, NULL, NULL, NULL, NULL))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
(*pcbTypeName)++;
|
(*pcbTypeName)++;
|
||||||
|
@ -475,22 +475,22 @@ static BOOL FindProvTypesRegVals(DWORD dwIndex, DWORD *pdwProvType, LPSTR *pszTy
|
||||||
*pdwProvType = *(--ch) - '0';
|
*pdwProvType = *(--ch) - '0';
|
||||||
*pdwProvType += (*(--ch) - '0') * 10;
|
*pdwProvType += (*(--ch) - '0') * 10;
|
||||||
*pdwProvType += (*(--ch) - '0') * 100;
|
*pdwProvType += (*(--ch) - '0') * 100;
|
||||||
|
|
||||||
if (RegOpenKey(hKey, *pszTypeName, &hSubKey))
|
if (RegOpenKey(hKey, *pszTypeName, &hSubKey))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (RegQueryValueEx(hSubKey, "TypeName", NULL, NULL, NULL, pcbTypeName))
|
if (RegQueryValueEx(hSubKey, "TypeName", NULL, NULL, NULL, pcbTypeName))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (!(*pszTypeName = ((LPSTR)LocalAlloc(LMEM_ZEROINIT, *pcbTypeName))))
|
if (!(*pszTypeName = ((LPSTR)LocalAlloc(LMEM_ZEROINIT, *pcbTypeName))))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (RegQueryValueEx(hSubKey, "TypeName", NULL, NULL, *pszTypeName, pcbTypeName))
|
if (RegQueryValueEx(hSubKey, "TypeName", NULL, NULL, *pszTypeName, pcbTypeName))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
RegCloseKey(hSubKey);
|
RegCloseKey(hSubKey);
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -501,7 +501,7 @@ static void test_enum_provider_types()
|
||||||
LPSTR pszTypeName = NULL;
|
LPSTR pszTypeName = NULL;
|
||||||
DWORD cbTypeName;
|
DWORD cbTypeName;
|
||||||
DWORD dwTypeCount;
|
DWORD dwTypeCount;
|
||||||
|
|
||||||
/* actual values */
|
/* actual values */
|
||||||
DWORD index = 0;
|
DWORD index = 0;
|
||||||
DWORD provType;
|
DWORD provType;
|
||||||
|
@ -511,29 +511,29 @@ static void test_enum_provider_types()
|
||||||
DWORD result;
|
DWORD result;
|
||||||
DWORD notNull = 5;
|
DWORD notNull = 5;
|
||||||
DWORD notZeroFlags = 5;
|
DWORD notZeroFlags = 5;
|
||||||
|
|
||||||
if(!pCryptEnumProviderTypesA)
|
if(!pCryptEnumProviderTypesA)
|
||||||
{
|
{
|
||||||
trace("skipping CryptEnumProviderTypes tests\n");
|
trace("skipping CryptEnumProviderTypes tests\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!FindProvTypesRegVals(index, &dwProvType, &pszTypeName, &cbTypeName, &dwTypeCount))
|
if (!FindProvTypesRegVals(index, &dwProvType, &pszTypeName, &cbTypeName, &dwTypeCount))
|
||||||
{
|
{
|
||||||
trace("could not find provider types in registry, skipping the test\n");
|
trace("could not find provider types in registry, skipping the test\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check pdwReserved for NULL */
|
/* check pdwReserved for NULL */
|
||||||
result = pCryptEnumProviderTypesA(index, ¬Null, 0, &provType, typeName, &typeNameSize);
|
result = pCryptEnumProviderTypesA(index, ¬Null, 0, &provType, typeName, &typeNameSize);
|
||||||
ok(!result && GetLastError()==ERROR_INVALID_PARAMETER, "expected %i, got %ld\n",
|
ok(!result && GetLastError()==ERROR_INVALID_PARAMETER, "expected %i, got %ld\n",
|
||||||
ERROR_INVALID_PARAMETER, GetLastError());
|
ERROR_INVALID_PARAMETER, GetLastError());
|
||||||
|
|
||||||
/* check dwFlags == zero */
|
/* check dwFlags == zero */
|
||||||
result = pCryptEnumProviderTypesA(index, NULL, notZeroFlags, &provType, typeName, &typeNameSize);
|
result = pCryptEnumProviderTypesA(index, NULL, notZeroFlags, &provType, typeName, &typeNameSize);
|
||||||
ok(!result && GetLastError()==NTE_BAD_FLAGS, "expected %i, got %ld\n",
|
ok(!result && GetLastError()==NTE_BAD_FLAGS, "expected %i, got %ld\n",
|
||||||
ERROR_INVALID_PARAMETER, GetLastError());
|
ERROR_INVALID_PARAMETER, GetLastError());
|
||||||
|
|
||||||
/* alloc provider type to half the size required
|
/* alloc provider type to half the size required
|
||||||
* cbTypeName holds the size required */
|
* cbTypeName holds the size required */
|
||||||
typeNameSize = cbTypeName / 2;
|
typeNameSize = cbTypeName / 2;
|
||||||
|
@ -547,10 +547,10 @@ static void test_enum_provider_types()
|
||||||
ok(!result && GetLastError()==ERROR_MORE_DATA, "expected 0/ERROR_MORE_DATA, got %d/%08lx\n",
|
ok(!result && GetLastError()==ERROR_MORE_DATA, "expected 0/ERROR_MORE_DATA, got %d/%08lx\n",
|
||||||
result, GetLastError());
|
result, GetLastError());
|
||||||
*/
|
*/
|
||||||
|
|
||||||
LocalFree(typeName);
|
LocalFree(typeName);
|
||||||
|
|
||||||
/* loop through the provider types to get the number of provider types
|
/* loop through the provider types to get the number of provider types
|
||||||
* after loop ends, count should be dwTypeCount + 1 so subtract 1
|
* after loop ends, count should be dwTypeCount + 1 so subtract 1
|
||||||
* to get actual number of provider types */
|
* to get actual number of provider types */
|
||||||
typeCount = 0;
|
typeCount = 0;
|
||||||
|
@ -558,21 +558,21 @@ static void test_enum_provider_types()
|
||||||
;
|
;
|
||||||
typeCount--;
|
typeCount--;
|
||||||
ok(typeCount==dwTypeCount, "expected %ld, got %ld\n", dwTypeCount, typeCount);
|
ok(typeCount==dwTypeCount, "expected %ld, got %ld\n", dwTypeCount, typeCount);
|
||||||
|
|
||||||
/* loop past the actual number of provider types to get the error
|
/* loop past the actual number of provider types to get the error
|
||||||
* ERROR_NO_MORE_ITEMS */
|
* ERROR_NO_MORE_ITEMS */
|
||||||
for (typeCount = 0; typeCount < dwTypeCount + 1; typeCount++)
|
for (typeCount = 0; typeCount < dwTypeCount + 1; typeCount++)
|
||||||
result = pCryptEnumProviderTypesA(typeCount, NULL, 0, &provType, NULL, &typeNameSize);
|
result = pCryptEnumProviderTypesA(typeCount, NULL, 0, &provType, NULL, &typeNameSize);
|
||||||
ok(!result && GetLastError()==ERROR_NO_MORE_ITEMS, "expected %i, got %ld\n",
|
ok(!result && GetLastError()==ERROR_NO_MORE_ITEMS, "expected %i, got %ld\n",
|
||||||
ERROR_NO_MORE_ITEMS, GetLastError());
|
ERROR_NO_MORE_ITEMS, GetLastError());
|
||||||
|
|
||||||
|
|
||||||
/* check expected versus actual values returned */
|
/* check expected versus actual values returned */
|
||||||
result = pCryptEnumProviderTypesA(index, NULL, 0, &provType, NULL, &typeNameSize);
|
result = pCryptEnumProviderTypesA(index, NULL, 0, &provType, NULL, &typeNameSize);
|
||||||
ok(result && typeNameSize==cbTypeName, "expected %ld, got %ld\n", cbTypeName, typeNameSize);
|
ok(result && typeNameSize==cbTypeName, "expected %ld, got %ld\n", cbTypeName, typeNameSize);
|
||||||
if (!(typeName = ((LPSTR)LocalAlloc(LMEM_ZEROINIT, typeNameSize))))
|
if (!(typeName = ((LPSTR)LocalAlloc(LMEM_ZEROINIT, typeNameSize))))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
typeNameSize = 0xdeadbeef;
|
typeNameSize = 0xdeadbeef;
|
||||||
result = pCryptEnumProviderTypesA(index, NULL, 0, &provType, typeName, &typeNameSize);
|
result = pCryptEnumProviderTypesA(index, NULL, 0, &provType, typeName, &typeNameSize);
|
||||||
ok(result, "expected TRUE, got %ld\n", result);
|
ok(result, "expected TRUE, got %ld\n", result);
|
||||||
|
@ -580,7 +580,7 @@ static void test_enum_provider_types()
|
||||||
if (pszTypeName)
|
if (pszTypeName)
|
||||||
ok(!strcmp(pszTypeName, typeName), "expected %s, got %s\n", pszTypeName, typeName);
|
ok(!strcmp(pszTypeName, typeName), "expected %s, got %s\n", pszTypeName, typeName);
|
||||||
ok(typeNameSize==cbTypeName, "expected %ld, got %ld\n", cbTypeName, typeNameSize);
|
ok(typeNameSize==cbTypeName, "expected %ld, got %ld\n", cbTypeName, typeNameSize);
|
||||||
|
|
||||||
LocalFree(typeName);
|
LocalFree(typeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -590,10 +590,10 @@ static BOOL FindDfltProvRegVals(DWORD dwProvType, DWORD dwFlags, LPSTR *pszProvN
|
||||||
PSTR keyname;
|
PSTR keyname;
|
||||||
PSTR ptr;
|
PSTR ptr;
|
||||||
DWORD user = dwFlags & CRYPT_USER_DEFAULT;
|
DWORD user = dwFlags & CRYPT_USER_DEFAULT;
|
||||||
|
|
||||||
LPSTR MACHINESTR = "Software\\Microsoft\\Cryptography\\Defaults\\Provider Types\\Type XXX";
|
LPSTR MACHINESTR = "Software\\Microsoft\\Cryptography\\Defaults\\Provider Types\\Type XXX";
|
||||||
LPSTR USERSTR = "Software\\Microsoft\\Cryptography\\Provider Type XXX";
|
LPSTR USERSTR = "Software\\Microsoft\\Cryptography\\Provider Type XXX";
|
||||||
|
|
||||||
keyname = LocalAlloc(LMEM_ZEROINIT, (user ? strlen(USERSTR) : strlen(MACHINESTR)) + 1);
|
keyname = LocalAlloc(LMEM_ZEROINIT, (user ? strlen(USERSTR) : strlen(MACHINESTR)) + 1);
|
||||||
if (keyname)
|
if (keyname)
|
||||||
{
|
{
|
||||||
|
@ -604,33 +604,33 @@ static BOOL FindDfltProvRegVals(DWORD dwProvType, DWORD dwFlags, LPSTR *pszProvN
|
||||||
*(--ptr) = (dwProvType / 100) + '0';
|
*(--ptr) = (dwProvType / 100) + '0';
|
||||||
} else
|
} else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (RegOpenKey((dwFlags & CRYPT_USER_DEFAULT) ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE ,keyname, &hKey))
|
if (RegOpenKey((dwFlags & CRYPT_USER_DEFAULT) ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE ,keyname, &hKey))
|
||||||
{
|
{
|
||||||
LocalFree(keyname);
|
LocalFree(keyname);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
LocalFree(keyname);
|
LocalFree(keyname);
|
||||||
|
|
||||||
if (RegQueryValueEx(hKey, "Name", NULL, NULL, *pszProvName, pcbProvName))
|
if (RegQueryValueEx(hKey, "Name", NULL, NULL, *pszProvName, pcbProvName))
|
||||||
{
|
{
|
||||||
if (GetLastError() != ERROR_MORE_DATA)
|
if (GetLastError() != ERROR_MORE_DATA)
|
||||||
SetLastError(NTE_PROV_TYPE_ENTRY_BAD);
|
SetLastError(NTE_PROV_TYPE_ENTRY_BAD);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(*pszProvName = LocalAlloc(LMEM_ZEROINIT, *pcbProvName)))
|
if (!(*pszProvName = LocalAlloc(LMEM_ZEROINIT, *pcbProvName)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (RegQueryValueEx(hKey, "Name", NULL, NULL, *pszProvName, pcbProvName))
|
if (RegQueryValueEx(hKey, "Name", NULL, NULL, *pszProvName, pcbProvName))
|
||||||
{
|
{
|
||||||
if (GetLastError() != ERROR_MORE_DATA)
|
if (GetLastError() != ERROR_MORE_DATA)
|
||||||
SetLastError(NTE_PROV_TYPE_ENTRY_BAD);
|
SetLastError(NTE_PROV_TYPE_ENTRY_BAD);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -641,7 +641,7 @@ static void test_get_default_provider()
|
||||||
DWORD dwFlags = CRYPT_MACHINE_DEFAULT;
|
DWORD dwFlags = CRYPT_MACHINE_DEFAULT;
|
||||||
LPSTR pszProvName = NULL;
|
LPSTR pszProvName = NULL;
|
||||||
DWORD cbProvName;
|
DWORD cbProvName;
|
||||||
|
|
||||||
/* actual results */
|
/* actual results */
|
||||||
DWORD provType = PROV_RSA_FULL;
|
DWORD provType = PROV_RSA_FULL;
|
||||||
DWORD flags = CRYPT_MACHINE_DEFAULT;
|
DWORD flags = CRYPT_MACHINE_DEFAULT;
|
||||||
|
@ -649,27 +649,27 @@ static void test_get_default_provider()
|
||||||
DWORD provNameSize;
|
DWORD provNameSize;
|
||||||
DWORD result;
|
DWORD result;
|
||||||
DWORD notNull = 5;
|
DWORD notNull = 5;
|
||||||
|
|
||||||
if(!pCryptGetDefaultProviderA)
|
if(!pCryptGetDefaultProviderA)
|
||||||
{
|
{
|
||||||
trace("skipping CryptGetDefaultProvider tests\n");
|
trace("skipping CryptGetDefaultProvider tests\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
FindDfltProvRegVals(dwProvType, dwFlags, &pszProvName, &cbProvName);
|
FindDfltProvRegVals(dwProvType, dwFlags, &pszProvName, &cbProvName);
|
||||||
|
|
||||||
/* check pdwReserved for NULL */
|
/* check pdwReserved for NULL */
|
||||||
result = pCryptGetDefaultProviderA(provType, ¬Null, flags, provName, &provNameSize);
|
result = pCryptGetDefaultProviderA(provType, ¬Null, flags, provName, &provNameSize);
|
||||||
ok(!result && GetLastError()==ERROR_INVALID_PARAMETER, "expected %i, got %ld\n",
|
ok(!result && GetLastError()==ERROR_INVALID_PARAMETER, "expected %i, got %ld\n",
|
||||||
ERROR_INVALID_PARAMETER, GetLastError());
|
ERROR_INVALID_PARAMETER, GetLastError());
|
||||||
|
|
||||||
/* check for invalid flag */
|
/* check for invalid flag */
|
||||||
flags = 0xdeadbeef;
|
flags = 0xdeadbeef;
|
||||||
result = pCryptGetDefaultProviderA(provType, NULL, flags, provName, &provNameSize);
|
result = pCryptGetDefaultProviderA(provType, NULL, flags, provName, &provNameSize);
|
||||||
ok(!result && GetLastError()==NTE_BAD_FLAGS, "expected %ld, got %ld\n",
|
ok(!result && GetLastError()==NTE_BAD_FLAGS, "expected %ld, got %ld\n",
|
||||||
NTE_BAD_FLAGS, GetLastError());
|
NTE_BAD_FLAGS, GetLastError());
|
||||||
flags = CRYPT_MACHINE_DEFAULT;
|
flags = CRYPT_MACHINE_DEFAULT;
|
||||||
|
|
||||||
/* check for invalid prov type */
|
/* check for invalid prov type */
|
||||||
provType = 0xdeadbeef;
|
provType = 0xdeadbeef;
|
||||||
result = pCryptGetDefaultProviderA(provType, NULL, flags, provName, &provNameSize);
|
result = pCryptGetDefaultProviderA(provType, NULL, flags, provName, &provNameSize);
|
||||||
|
@ -678,29 +678,29 @@ static void test_get_default_provider()
|
||||||
"expected NTE_BAD_PROV_TYPE or ERROR_INVALID_PARAMETER, got %ld/%ld\n",
|
"expected NTE_BAD_PROV_TYPE or ERROR_INVALID_PARAMETER, got %ld/%ld\n",
|
||||||
result, GetLastError());
|
result, GetLastError());
|
||||||
provType = PROV_RSA_FULL;
|
provType = PROV_RSA_FULL;
|
||||||
|
|
||||||
SetLastError(0);
|
SetLastError(0);
|
||||||
|
|
||||||
/* alloc provName to half the size required
|
/* alloc provName to half the size required
|
||||||
* cbProvName holds the size required */
|
* cbProvName holds the size required */
|
||||||
provNameSize = cbProvName / 2;
|
provNameSize = cbProvName / 2;
|
||||||
if (!(provName = LocalAlloc(LMEM_ZEROINIT, provNameSize)))
|
if (!(provName = LocalAlloc(LMEM_ZEROINIT, provNameSize)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
result = pCryptGetDefaultProviderA(provType, NULL, flags, provName, &provNameSize);
|
result = pCryptGetDefaultProviderA(provType, NULL, flags, provName, &provNameSize);
|
||||||
ok(!result && GetLastError()==ERROR_MORE_DATA, "expected %i, got %ld\n",
|
ok(!result && GetLastError()==ERROR_MORE_DATA, "expected %i, got %ld\n",
|
||||||
ERROR_MORE_DATA, GetLastError());
|
ERROR_MORE_DATA, GetLastError());
|
||||||
|
|
||||||
LocalFree(provName);
|
LocalFree(provName);
|
||||||
|
|
||||||
/* check expected versus actual values returned */
|
/* check expected versus actual values returned */
|
||||||
result = pCryptGetDefaultProviderA(provType, NULL, flags, NULL, &provNameSize);
|
result = pCryptGetDefaultProviderA(provType, NULL, flags, NULL, &provNameSize);
|
||||||
ok(result && provNameSize==cbProvName, "expected %ld, got %ld\n", cbProvName, provNameSize);
|
ok(result && provNameSize==cbProvName, "expected %ld, got %ld\n", cbProvName, provNameSize);
|
||||||
provNameSize = cbProvName;
|
provNameSize = cbProvName;
|
||||||
|
|
||||||
if (!(provName = LocalAlloc(LMEM_ZEROINIT, provNameSize)))
|
if (!(provName = LocalAlloc(LMEM_ZEROINIT, provNameSize)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
result = pCryptGetDefaultProviderA(provType, NULL, flags, provName, &provNameSize);
|
result = pCryptGetDefaultProviderA(provType, NULL, flags, provName, &provNameSize);
|
||||||
ok(result && !strcmp(pszProvName, provName), "expected %s, got %s\n", pszProvName, provName);
|
ok(result && !strcmp(pszProvName, provName), "expected %s, got %s\n", pszProvName, provName);
|
||||||
ok(result && provNameSize==cbProvName, "expected %ld, got %ld\n", cbProvName, provNameSize);
|
ok(result && provNameSize==cbProvName, "expected %ld, got %ld\n", cbProvName, provNameSize);
|
||||||
|
@ -712,11 +712,11 @@ static void test_set_provider_ex()
|
||||||
{
|
{
|
||||||
DWORD result;
|
DWORD result;
|
||||||
DWORD notNull = 5;
|
DWORD notNull = 5;
|
||||||
|
|
||||||
/* results */
|
/* results */
|
||||||
LPSTR pszProvName = NULL;
|
LPSTR pszProvName = NULL;
|
||||||
DWORD cbProvName;
|
DWORD cbProvName;
|
||||||
|
|
||||||
if(!pCryptGetDefaultProviderA || !pCryptSetProviderExA)
|
if(!pCryptGetDefaultProviderA || !pCryptSetProviderExA)
|
||||||
{
|
{
|
||||||
trace("skipping CryptSetProviderEx tests\n");
|
trace("skipping CryptSetProviderEx tests\n");
|
||||||
|
@ -734,7 +734,7 @@ static void test_set_provider_ex()
|
||||||
|
|
||||||
result = pCryptSetProviderExA(MS_DEF_PROV, PROV_RSA_FULL, NULL, CRYPT_MACHINE_DEFAULT);
|
result = pCryptSetProviderExA(MS_DEF_PROV, PROV_RSA_FULL, NULL, CRYPT_MACHINE_DEFAULT);
|
||||||
ok(result, "%ld\n", GetLastError());
|
ok(result, "%ld\n", GetLastError());
|
||||||
|
|
||||||
/* call CryptGetDefaultProvider to see if they match */
|
/* call CryptGetDefaultProvider to see if they match */
|
||||||
result = pCryptGetDefaultProviderA(PROV_RSA_FULL, NULL, CRYPT_MACHINE_DEFAULT, NULL, &cbProvName);
|
result = pCryptGetDefaultProviderA(PROV_RSA_FULL, NULL, CRYPT_MACHINE_DEFAULT, NULL, &cbProvName);
|
||||||
if (!(pszProvName = LocalAlloc(LMEM_ZEROINIT, cbProvName)))
|
if (!(pszProvName = LocalAlloc(LMEM_ZEROINIT, cbProvName)))
|
||||||
|
@ -756,7 +756,7 @@ START_TEST(crypt)
|
||||||
test_incorrect_api_usage();
|
test_incorrect_api_usage();
|
||||||
clean_up_environment();
|
clean_up_environment();
|
||||||
}
|
}
|
||||||
|
|
||||||
test_enum_providers();
|
test_enum_providers();
|
||||||
test_enum_provider_types();
|
test_enum_provider_types();
|
||||||
test_get_default_provider();
|
test_get_default_provider();
|
||||||
|
|
|
@ -32,7 +32,7 @@ static void test_SystemFunction006()
|
||||||
static unsigned char lmhash[16 + 1];
|
static unsigned char lmhash[16 + 1];
|
||||||
|
|
||||||
unsigned char passwd[] = { 's','e','c','r','e','t', 0, 0, 0, 0, 0, 0, 0, 0 };
|
unsigned char passwd[] = { 's','e','c','r','e','t', 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||||
unsigned char expect[] =
|
unsigned char expect[] =
|
||||||
{ 0x85, 0xf5, 0x28, 0x9f, 0x09, 0xdc, 0xa7, 0xeb,
|
{ 0x85, 0xf5, 0x28, 0x9f, 0x09, 0xdc, 0xa7, 0xeb,
|
||||||
0xaa, 0xd3, 0xb4, 0x35, 0xb5, 0x14, 0x04, 0xee };
|
0xaa, 0xd3, 0xb4, 0x35, 0xb5, 0x14, 0x04, 0xee };
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ START_TEST(crypt_lmhash)
|
||||||
|
|
||||||
if (!pSystemFunction006) goto out;
|
if (!pSystemFunction006) goto out;
|
||||||
|
|
||||||
if (pSystemFunction006)
|
if (pSystemFunction006)
|
||||||
test_SystemFunction006();
|
test_SystemFunction006();
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
|
|
@ -55,7 +55,7 @@ void test_md4_ctx()
|
||||||
HMODULE module;
|
HMODULE module;
|
||||||
|
|
||||||
MD4_CTX ctx;
|
MD4_CTX ctx;
|
||||||
MD4_CTX ctx_initialized =
|
MD4_CTX ctx_initialized =
|
||||||
{
|
{
|
||||||
{ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476 },
|
{ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476 },
|
||||||
{ 0, 0 }
|
{ 0, 0 }
|
||||||
|
|
|
@ -55,7 +55,7 @@ void test_md5_ctx()
|
||||||
HMODULE module;
|
HMODULE module;
|
||||||
|
|
||||||
MD5_CTX ctx;
|
MD5_CTX ctx;
|
||||||
MD5_CTX ctx_initialized =
|
MD5_CTX ctx_initialized =
|
||||||
{
|
{
|
||||||
{ 0, 0 },
|
{ 0, 0 },
|
||||||
{ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476 }
|
{ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476 }
|
||||||
|
|
|
@ -64,14 +64,14 @@ static void create_test_entries(void)
|
||||||
SetEnvironmentVariableA("LONGSYSTEMVAR", "bar");
|
SetEnvironmentVariableA("LONGSYSTEMVAR", "bar");
|
||||||
SetEnvironmentVariableA("FOO", "ImARatherLongButIndeedNeededString");
|
SetEnvironmentVariableA("FOO", "ImARatherLongButIndeedNeededString");
|
||||||
|
|
||||||
ok(!RegSetValueExA(hkey_main,"Test1",0,REG_EXPAND_SZ, sTestpath1, strlen(sTestpath1)+1),
|
ok(!RegSetValueExA(hkey_main,"Test1",0,REG_EXPAND_SZ, sTestpath1, strlen(sTestpath1)+1),
|
||||||
"RegSetValueExA failed\n");
|
"RegSetValueExA failed\n");
|
||||||
ok(!RegSetValueExA(hkey_main,"Test2",0,REG_SZ, sTestpath1, strlen(sTestpath1)+1),
|
ok(!RegSetValueExA(hkey_main,"Test2",0,REG_SZ, sTestpath1, strlen(sTestpath1)+1),
|
||||||
"RegSetValueExA failed\n");
|
"RegSetValueExA failed\n");
|
||||||
ok(!RegSetValueExA(hkey_main,"Test3",0,REG_EXPAND_SZ, sTestpath2, strlen(sTestpath2)+1),
|
ok(!RegSetValueExA(hkey_main,"Test3",0,REG_EXPAND_SZ, sTestpath2, strlen(sTestpath2)+1),
|
||||||
"RegSetValueExA failed\n");
|
"RegSetValueExA failed\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_enum_value(void)
|
static void test_enum_value(void)
|
||||||
{
|
{
|
||||||
DWORD res;
|
DWORD res;
|
||||||
|
@ -248,7 +248,7 @@ static void test_query_value_ex()
|
||||||
DWORD ret;
|
DWORD ret;
|
||||||
DWORD size;
|
DWORD size;
|
||||||
DWORD type;
|
DWORD type;
|
||||||
|
|
||||||
ret = RegQueryValueExA(hkey_main, "Test2", NULL, &type, NULL, &size);
|
ret = RegQueryValueExA(hkey_main, "Test2", NULL, &type, NULL, &size);
|
||||||
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", ret);
|
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", ret);
|
||||||
ok(size == strlen(sTestpath1) + 1, "(%ld,%ld)\n", (DWORD)strlen(sTestpath1) + 1, size);
|
ok(size == strlen(sTestpath1) + 1, "(%ld,%ld)\n", (DWORD)strlen(sTestpath1) + 1, size);
|
||||||
|
@ -341,7 +341,7 @@ static void test_reg_close_key()
|
||||||
ret = RegCloseKey(hkHandle); /* Windows 95 doesn't mind. */
|
ret = RegCloseKey(hkHandle); /* Windows 95 doesn't mind. */
|
||||||
ok(ret == ERROR_INVALID_HANDLE || ret == ERROR_SUCCESS,
|
ok(ret == ERROR_INVALID_HANDLE || ret == ERROR_SUCCESS,
|
||||||
"expected ERROR_INVALID_HANDLE or ERROR_SUCCESS, got %ld\n", ret);
|
"expected ERROR_INVALID_HANDLE or ERROR_SUCCESS, got %ld\n", ret);
|
||||||
|
|
||||||
/* try to close a NULL handle */
|
/* try to close a NULL handle */
|
||||||
ret = RegCloseKey(NULL);
|
ret = RegCloseKey(NULL);
|
||||||
ok(ret == ERROR_INVALID_HANDLE || ret == ERROR_BADKEY, /* Windows 95 returns BADKEY */
|
ok(ret == ERROR_INVALID_HANDLE || ret == ERROR_BADKEY, /* Windows 95 returns BADKEY */
|
||||||
|
@ -406,7 +406,7 @@ static BOOL set_privileges(LPCSTR privilege, BOOL set)
|
||||||
|
|
||||||
tp.PrivilegeCount = 1;
|
tp.PrivilegeCount = 1;
|
||||||
tp.Privileges[0].Luid = luid;
|
tp.Privileges[0].Luid = luid;
|
||||||
|
|
||||||
if (set)
|
if (set)
|
||||||
tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
|
tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
|
||||||
else
|
else
|
||||||
|
|
|
@ -169,7 +169,7 @@ void test_trustee()
|
||||||
pBuildTrusteeWithSidA( &trustee, psid );
|
pBuildTrusteeWithSidA( &trustee, psid );
|
||||||
|
|
||||||
ok( trustee.pMultipleTrustee == NULL, "pMultipleTrustee wrong\n");
|
ok( trustee.pMultipleTrustee == NULL, "pMultipleTrustee wrong\n");
|
||||||
ok( trustee.MultipleTrusteeOperation == NO_MULTIPLE_TRUSTEE,
|
ok( trustee.MultipleTrusteeOperation == NO_MULTIPLE_TRUSTEE,
|
||||||
"MultipleTrusteeOperation wrong\n");
|
"MultipleTrusteeOperation wrong\n");
|
||||||
ok( trustee.TrusteeForm == TRUSTEE_IS_SID, "TrusteeForm wrong\n");
|
ok( trustee.TrusteeForm == TRUSTEE_IS_SID, "TrusteeForm wrong\n");
|
||||||
ok( trustee.TrusteeType == TRUSTEE_IS_UNKNOWN, "TrusteeType wrong\n");
|
ok( trustee.TrusteeType == TRUSTEE_IS_UNKNOWN, "TrusteeType wrong\n");
|
||||||
|
@ -181,13 +181,13 @@ void test_trustee()
|
||||||
pBuildTrusteeWithNameA( &trustee, str );
|
pBuildTrusteeWithNameA( &trustee, str );
|
||||||
|
|
||||||
ok( trustee.pMultipleTrustee == NULL, "pMultipleTrustee wrong\n");
|
ok( trustee.pMultipleTrustee == NULL, "pMultipleTrustee wrong\n");
|
||||||
ok( trustee.MultipleTrusteeOperation == NO_MULTIPLE_TRUSTEE,
|
ok( trustee.MultipleTrusteeOperation == NO_MULTIPLE_TRUSTEE,
|
||||||
"MultipleTrusteeOperation wrong\n");
|
"MultipleTrusteeOperation wrong\n");
|
||||||
ok( trustee.TrusteeForm == TRUSTEE_IS_NAME, "TrusteeForm wrong\n");
|
ok( trustee.TrusteeForm == TRUSTEE_IS_NAME, "TrusteeForm wrong\n");
|
||||||
ok( trustee.TrusteeType == TRUSTEE_IS_UNKNOWN, "TrusteeType wrong\n");
|
ok( trustee.TrusteeType == TRUSTEE_IS_UNKNOWN, "TrusteeType wrong\n");
|
||||||
ok( trustee.ptstrName == str, "ptstrName wrong\n" );
|
ok( trustee.ptstrName == str, "ptstrName wrong\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If the first isn't defined, assume none is */
|
/* If the first isn't defined, assume none is */
|
||||||
#ifndef SE_MIN_WELL_KNOWN_PRIVILEGE
|
#ifndef SE_MIN_WELL_KNOWN_PRIVILEGE
|
||||||
#define SE_MIN_WELL_KNOWN_PRIVILEGE 2L
|
#define SE_MIN_WELL_KNOWN_PRIVILEGE 2L
|
||||||
|
@ -425,9 +425,9 @@ static void test_FileSecurity(void)
|
||||||
|
|
||||||
SetLastError(NO_ERROR);
|
SetLastError(NO_ERROR);
|
||||||
result = pGetFileSecurityA( directory,OWNER_SECURITY_INFORMATION,buffer,0x40,&outSize);
|
result = pGetFileSecurityA( directory,OWNER_SECURITY_INFORMATION,buffer,0x40,&outSize);
|
||||||
ok(!result, "GetFileSecurityA should fail for not existing directories/files\n");
|
ok(!result, "GetFileSecurityA should fail for not existing directories/files\n");
|
||||||
ok( (GetLastError() == ERROR_FILE_NOT_FOUND ) ||
|
ok( (GetLastError() == ERROR_FILE_NOT_FOUND ) ||
|
||||||
(GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) ,
|
(GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) ,
|
||||||
"last error ERROR_FILE_NOT_FOUND / ERROR_CALL_NOT_IMPLEMENTED (98) "
|
"last error ERROR_FILE_NOT_FOUND / ERROR_CALL_NOT_IMPLEMENTED (98) "
|
||||||
"expected, got %ld\n", GetLastError());
|
"expected, got %ld\n", GetLastError());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue