Eric Pouech pouech-eric@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 a écrit :
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.
the drawback of this is that we'll be duplicating atom table handling between ntdll and server... but since Rtl* atom tables are local to the process (and not manipulated outside of the process), the way to go you suggest would be closer to NT behavior (not implementation of course, as the global atom table is shared - in memory - across all processes).
A+