ntdll / kernel32 #39-2

Dmitry Timoshkov dmitry at baikal.ru
Sun Jan 18 02:51:53 CST 2004


"Eric Pouech" <pouech-eric at wanadoo.fr> wrote:

> +DWORD WINAPI GetFullPathNameW( LPCWSTR name, DWORD len, LPWSTR buffer,
> +                               LPWSTR *lastpart )
> +{
> +    LPWSTR      dst = HeapAlloc(GetProcessHeap(), 0, len * sizeof(buffer));
> +    DWORD       ret;
> +
> +    if (!dst) return 0;
> +    ret = RtlGetFullPathName_U(name, len * sizeof(WCHAR), dst, lastpart) / sizeof(WCHAR);

I don't quite understand the above bit of code:

1. HeapAlloc(GetProcessHeap(), 0, len * sizeof(buffer)) when buffer is
a pointer
2. Why you don't pass buffer directly to RtlGetFullPathName_U without 
allocating an intermediate storage.

-- 
Dmitry.





More information about the wine-devel mailing list