threadvar
  W: PWideChar;
    W: WideString;

function TestWideChar(Input: PWideChar): PWideChar; cdecl; export;
begin
  W := Input;
  Result := W;
end;

Может так?

Ответить