Source code of Windows XP (NT5)
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.

85 lines
1.3 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. msgalias.c
  5. Abstract:
  6. This file contains routines for adding and deleting message aliases
  7. when a user logs on/off.
  8. Author:
  9. Dan Lafferty (danl) 21-Aug-1992
  10. Environment:
  11. User Mode -Win32
  12. Revision History:
  13. 21-Aug-1992 danl
  14. created
  15. --*/
  16. // #include <nt.h>
  17. // #include <ntrtl.h>
  18. // #include <nturtl.h>
  19. #include <windows.h>
  20. #define LPTSTR LPWSTR
  21. #include <lmcons.h>
  22. #include <lmerr.h>
  23. #include <lmmsg.h>
  24. #include <stdlib.h>
  25. #include <msgalias.h>
  26. VOID
  27. AddMsgAlias(
  28. LPWSTR Username
  29. )
  30. /*++
  31. Routine Description:
  32. This function adds the Username to the list of message aliases.
  33. If unsuccessful, we don't care.
  34. Arguments:
  35. Username - This is a pointer to a unicode Username.
  36. Return Value:
  37. none.
  38. --*/
  39. {
  40. HANDLE dllHandle;
  41. PMSG_NAME_ADD NetMessageNameAdd = NULL;
  42. dllHandle = LoadLibraryW(L"netapi32.dll");
  43. if (dllHandle != NULL) {
  44. NetMessageNameAdd = (PMSG_NAME_ADD) GetProcAddress(
  45. dllHandle,
  46. "NetMessageNameAdd");
  47. if (NetMessageNameAdd != NULL) {
  48. NetMessageNameAdd(NULL,Username);
  49. }
  50. FreeLibrary(dllHandle);
  51. }
  52. }