ntdll / kernel32: #52

Alexandre Julliard julliard at winehq.org
Thu Feb 3 10:58:56 CST 2005


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

> +/******************************************************************
> + *		NtAddAtom (NTDLL.@)
> + */
> +NTSTATUS WINAPI NtAddAtom( const WCHAR* name, ULONG length, ATOM* atom )
> +{
> +    WCHAR       full_name[MAX_ATOM_LEN + 1];
> +
> +    if (length / sizeof(WCHAR) > MAX_ATOM_LEN) return STATUS_INVALID_PARAMETER;
> +    memcpy(full_name, name, length);
> +    full_name[length / sizeof(WCHAR)] = 0;
> +    return RtlAddAtomToAtomTable( get_global_table(), full_name, atom );

That will work, but it's really ugly to copy the string just so we can
do a strlenW on it and convert it back to a counted string for the
server call. I think you really want the Nt* functions to make direct
server calls, and the Rtl* to manipulate a local table. If we don't do
things the way NT does we can just as well keep the current
implementation.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list