windows-nt/Source/XPSP1/NT/ds/security/gina/userinit/msgalias.c
2020-09-26 16:20:57 +08:00

86 lines
1.3 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*++
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);
}
}