[PATCH 2/2] rasapi32: Add RasSetCredentialsA/W stubs

Chip Davis cdavis at codeweavers.com
Thu Aug 20 10:04:51 CDT 2020


August 20, 2020 6:33 AM, "Oleg Dubinskiy" <oleg.dubinskij2013 at yandex.ua> wrote:

> diff --git a/dlls/rasapi32/rasapi.c b/dlls/rasapi32/rasapi.c
> index 791b0dab13..7200cee4f1 100644
> --- a/dlls/rasapi32/rasapi.c
> +++ b/dlls/rasapi32/rasapi.c
> @@ -496,6 +496,22 @@ DWORD WINAPI RasRenameEntryW(LPCWSTR lpszPhonebook, LPCWSTR lpszOldEntry, LPCWST
>      return 0;
>  }
> 
> +DWORD WINAPI RasSetCredentialsA(LPCSTR lpszPhonebook, LPCSTR lpszOldEntry, LPRASCREDENTIALSA lprascredentials,

In new code, we prefer raw pointer types to pointer typedefs (e.g. "const char *" is preferred over "LPCSTR"). Struct typedefs (e.g. "RASCREDENTIALSA *" instead of "LPRASCREDENTIALSA") are fine. We also prefer to avoid Hungarian notation (e.g. use "phonebook" instead of "lpszPhonebook"). See the two functions immediately below these two you added for an example.

> +                                BOOL clear)
> +{
> +    FIXME("(%s,%s,%p,0x%x), stub!\n", debugstr_a(lpszPhonebook), debugstr_a(lpszOldEntry),
> +          lprascredentials, clear);
> +    return ERROR_UNKNOWN;
> +}
> +
> +DWORD WINAPI RasSetCredentialsW(LPCWSTR lpszPhonebook, LPCWSTR lpszOldEntry, LPRASCREDENTIALSW lprascredentials,
> +                                BOOL clear)
> +{
> +    FIXME("(%s,%s,%p,0x%x), stub!\n", debugstr_w(lpszPhonebook), debugstr_w(lpszOldEntry),
> +          lprascredentials, clear);
> +    return ERROR_UNKNOWN;
> +}
> +
>  DWORD WINAPI RasSetCustomAuthDataA(const char *phonebook, const char *entry, BYTE *authdata, DWORD size)
>  {
>      FIXME("(%s,%s,%p,0x%08x), stub!\n", debugstr_a(phonebook), debugstr_a(entry), authdata, size);
> diff --git a/include/ras.h b/include/ras.h
> index bd29343dc5..458128be61 100644
> --- a/include/ras.h
> +++ b/include/ras.h
> @@ -532,6 +532,9 @@ DWORD WINAPI RasSetAutodialAddressW(LPCWSTR,DWORD,LPRASAUTODIALENTRYW,DWORD,DWOR
>  DWORD WINAPI RasSetAutodialParamA(DWORD,LPVOID,DWORD);
>  DWORD WINAPI RasSetAutodialParamW(DWORD,LPVOID,DWORD);
>  #define RasSetAutodialParam WINELIB_NAME_AW(RasSetAutodialParam)
> +DWORD WINAPI RasSetCredentialsA(LPCSTR,LPCSTR,LPRASCREDENTIALSA,BOOL)
> +DWORD WINAPI RasSetCredentialsW(LPCWSTR,LPCWSTR,LPRASCREDENTIALSW,BOOL)

Avoid pointer typedefs here, too.

> +#define RasSetCredentials WINELIB_NAME_AW(RasSetCredentials)
>  DWORD WINAPI RasSetCustomAuthDataA(const CHAR *,const CHAR *,BYTE *,DWORD);
>  DWORD WINAPI RasSetCustomAuthDataW(const WCHAR *,const WCHAR *,BYTE *,DWORD);
>  #define RasSetCustomAuthData WINELIB_NAME_AW(RasSetCustomAuthData)
> -- 
> 2.28.0


Chip



More information about the wine-devel mailing list