3 Copyright 2004 by the Massachusetts Institute of Technology
7 Permission to use, copy, modify, and distribute this software and its
8 documentation for any purpose and without fee is hereby granted,
9 provided that the above copyright notice appear in all copies and that
10 both that copyright notice and this permission notice appear in
11 supporting documentation, and that the name of the Massachusetts
12 Institute of Technology (M.I.T.) not be used in advertising or publicity
13 pertaining to distribution of the software without specific, written
16 M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
17 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
18 M.I.T. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
19 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
20 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
21 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
26 /* We only support VC 1200 and above anyway */
35 #define REG_CLIENT_PARMS_KEY "SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters"
36 #define REG_CLIENT_PROVIDER_KEY "SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\NetworkProvider"
37 #define REG_CLIENT_DOMAINS_SUBKEY "Domain"
38 #define REG_CLIENT_RETRY_INTERVAL_PARM "LoginRetryInterval"
39 #define REG_CLIENT_SLEEP_INTERVAL_PARM "LoginSleepInterval"
40 #define REG_CLIENT_FAIL_SILENTLY_PARM "FailLoginsSilently"
41 #define REG_CLIENT_TRACE_OPTION_PARM "TraceOption"
42 #define REG_CLIENT_LOGON_OPTION_PARM "LogonOptions"
43 #define REG_CLIENT_LOGON_SCRIPT_PARMW L"LogonScript"
44 #define DEFAULT_RETRY_INTERVAL 30 /* seconds*/
45 #define DEFAULT_FAIL_SILENTLY FALSE
46 #define DEFAULT_SLEEP_INTERVAL 5 /* seconds*/
47 #define DEFAULT_LOGON_OPTION 1
49 #define TRACE_OPTION_EVENT 1
51 #define ISLOGONTRACE(v) ( ((v) & TRACE_OPTION_EVENT)==TRACE_OPTION_EVENT)
53 #define ISLOGONINTEGRATED(v) ( ((v) & LOGON_OPTION_INTEGRATED)==LOGON_OPTION_INTEGRATED)
54 #define ISHIGHSECURITY(v) ( ((v) & LOGON_OPTION_HIGHSECURITY)==LOGON_OPTION_HIGHSECURITY)
56 #define ISREMOTE(v) ( ((v) & LOGON_FLAG_REMOTE)==LOGON_FLAG_REMOTE)
57 #define ISADREALM(v) ( ((v) & LOGON_FLAG_AD_REALM)==LOGON_FLAG_AD_REALM)
58 extern DWORD TraceOption;
60 #define LOGON_FLAG_LOCAL 0
61 #define LOGON_FLAG_REMOTE 1
62 #define LOGON_FLAG_AD_REALM 2
64 typedef struct LogonOptions_type {
71 DWORD flags; /* LOGON_FLAG_* */
75 #define MAX_USERNAME_LENGTH 256
76 #define MAX_PASSWORD_LENGTH 256
77 #define MAX_DOMAIN_LENGTH 256
79 BOOLEAN APIENTRY DllEntryPoint(HANDLE dll, DWORD reason, PVOID reserved);
81 DWORD APIENTRY NPGetCaps(DWORD index);
83 DWORD APIENTRY NPLogonNotify(
85 LPCWSTR lpAuthentInfoType,
87 LPCWSTR lpPreviousAuthentInfoType,
88 LPVOID lpPreviousAuthentInfo,
91 LPWSTR *lpLogonScript);
93 DWORD APIENTRY NPPasswordChangeNotify(
94 LPCWSTR lpAuthentInfoType,
96 LPCWSTR lpPreviousAuthentInfoType,
97 LPVOID lpPreviousAuthentInfo,
106 void DebugEvent0(char *a);
107 void DebugEvent(char *a,char *b,...);
109 CHAR *GenRandomName(CHAR *pbuf);
111 BOOLEAN AFSWillAutoStart(void);
113 DWORD MapAuthError(DWORD code);
115 BOOL IsServiceRunning (void);
117 static BOOL WINAPI UnicodeStringToANSI(UNICODE_STRING uInputString, LPSTR lpszOutputString, int nOutStringLen);
119 void GetDomainLogonOptions( PLUID lpLogonId, char * username, char * domain, LogonOptions_t *opt );
120 DWORD GetFileCellName(char * path, char * cell, size_t cellLen);
121 DWORD GetAdHomePath(char * homePath, size_t homePathLen, PLUID lpLogonId, LogonOptions_t * opt);