From: Jeffrey Altman Date: Sun, 28 Aug 2011 16:03:53 +0000 (-0400) Subject: Windows: afslogon network provider debug registry value X-Git-Tag: upstream/1.6.1.pre4^2~39 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=15f3a7ed4ef9cd47a291cca2ad877d1214c02eaf;p=packages%2Fo%2Fopenafs.git Windows: afslogon network provider debug registry value create a new TransarcAFSDaemon\NetworkProvider "Debug" value to be used for activating the network provider debugging. The overlapping use of TransarcAFSDaemon\Parameters "TraceOption" is just too confusing. Permit both methods to be used. Reviewed-on: http://gerrit.openafs.org/5316 Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit 3d4e111dd6c4201476e7447fdfaa27ed630032c5) Change-Id: Ibc8b56d64aa843076b191afa42c4a3e93cf7a26f Reviewed-on: http://gerrit.openafs.org/6802 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/WINNT/afsd/afslogon.c b/src/WINNT/afsd/afslogon.c index 0ced1bbd5..a536117cb 100644 --- a/src/WINNT/afsd/afslogon.c +++ b/src/WINNT/afsd/afslogon.c @@ -37,6 +37,7 @@ #include DWORD TraceOption = 0; +DWORD Debug = 0; HANDLE hDLL; @@ -46,7 +47,7 @@ void DebugEvent0(char *a) { HANDLE h; char *ptbuf[1]; - if (!ISLOGONTRACE(TraceOption)) + if (!Debug && !ISLOGONTRACE(TraceOption)) return; h = RegisterEventSource(NULL, AFS_LOGON_EVENT_NAME); @@ -63,7 +64,7 @@ void DebugEvent(char *b,...) HANDLE h; char *ptbuf[1],buf[MAXBUF_+1]; va_list marker; - if (!ISLOGONTRACE(TraceOption)) + if (!Debug && !ISLOGONTRACE(TraceOption)) return; h = RegisterEventSource(NULL, AFS_LOGON_EVENT_NAME); @@ -863,6 +864,14 @@ DWORD APIENTRY NPLogonNotify( RegCloseKey (NPKey); + (void) RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PROVIDER_SUBKEY, + 0, KEY_QUERY_VALUE, &NPKey); + LSPsize=sizeof(Debug); + RegQueryValueEx(NPKey, REG_CLIENT_DEBUG_PARM, NULL, + &LSPtype, (LPBYTE)&Debug, &LSPsize); + + RegCloseKey (NPKey); + DebugEvent("NPLogonNotify - LoginId(%d,%d)", lpLogonId->HighPart, lpLogonId->LowPart); /* Make sure the AFS Libraries are initialized */ diff --git a/src/WINNT/afsd/afslogon.h b/src/WINNT/afsd/afslogon.h index 25590aaec..44a0baec5 100644 --- a/src/WINNT/afsd/afslogon.h +++ b/src/WINNT/afsd/afslogon.h @@ -45,6 +45,7 @@ SOFTWARE. #define REG_CLIENT_TRACE_OPTION_PARM "TraceOption" #define REG_CLIENT_LOGON_OPTION_PARM "LogonOptions" #define REG_CLIENT_LOGON_SCRIPT_PARMW L"LogonScript" +#define REG_CLIENT_DEBUG_PARM "Debug" #define REG_CLIENT_REALM_PARM "Realm" #define REG_CLIENT_THESE_CELLS_PARM "TheseCells" #define REG_CLIENT_LOGOFF_TOKENS_PARM "LogoffPreserveTokens"