Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
977 B

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. ULToW.c
  5. Abstract:
  6. ULToW converts an unsigned long to a wide-character string.
  7. Author:
  8. John Rogers (JohnRo) 10-Jan-1992
  9. Environment:
  10. Win32 - User mode only.
  11. Requires ANSI C extensions: slash-slash comments, long external names,
  12. _ultoa().
  13. Revision History:
  14. 10-Jan-1992 JohnRo
  15. Created.
  16. --*/
  17. #include <windef.h>
  18. #include <netdebug.h> // _ultoa().
  19. #include <stdlib.h> // _ultoa().
  20. #include <tstring.h> // My prototypes.
  21. LPWSTR
  22. ultow (
  23. IN DWORD Value,
  24. OUT LPWSTR Area,
  25. IN DWORD Radix
  26. )
  27. {
  28. CHAR TempStr[33]; // Space for 32 bit num in base 2, and null.
  29. NetpAssert( Area != NULL );
  30. NetpAssert( Radix >= 2 );
  31. NetpAssert( Radix <= 36 );
  32. (void) _ultoa(Value, TempStr, Radix);
  33. NetpCopyStrToWStr( Area, TempStr );
  34. return (Area);
  35. }