windows-nt/Source/XPSP1/NT/ds/security/gina/userinit/msgalias.c

86 lines
1.3 KiB
C
Raw Normal View History

2020-09-26 03:20:57 -05:00
/*++
Copyright (c) 1991 Microsoft Corporation
Module Name:
msgalias.c
Abstract:
This file contains routines for adding and deleting message aliases
when a user logs on/off.
Author:
Dan Lafferty (danl) 21-Aug-1992
Environment:
User Mode -Win32
Revision History:
21-Aug-1992 danl
created
--*/
// #include <nt.h>
// #include <ntrtl.h>
// #include <nturtl.h>
#include <windows.h>
#define LPTSTR LPWSTR
#include <lmcons.h>
#include <lmerr.h>
#include <lmmsg.h>
#include <stdlib.h>
#include <msgalias.h>
VOID
AddMsgAlias(
LPWSTR Username
)
/*++
Routine Description:
This function adds the Username to the list of message aliases.
If unsuccessful, we don't care.
Arguments:
Username - This is a pointer to a unicode Username.
Return Value:
none.
--*/
{
HANDLE dllHandle;
PMSG_NAME_ADD NetMessageNameAdd = NULL;
dllHandle = LoadLibraryW(L"netapi32.dll");
if (dllHandle != NULL) {
NetMessageNameAdd = (PMSG_NAME_ADD) GetProcAddress(
dllHandle,
"NetMessageNameAdd");
if (NetMessageNameAdd != NULL) {
NetMessageNameAdd(NULL,Username);
}
FreeLibrary(dllHandle);
}
}