From 3d4e111dd6c4201476e7447fdfaa27ed630032c5 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sun, 28 Aug 2011 12:03:53 -0400 Subject: [PATCH] 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. Change-Id: I4ba233b38bda547af35aa4b363edc819bcc3792c Reviewed-on: http://gerrit.openafs.org/5316 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/WINNT/afsd/afslogon.c | 13 +++++++++++-- src/WINNT/afsd/afslogon.h | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/WINNT/afsd/afslogon.c b/src/WINNT/afsd/afslogon.c index 7f018517f..ccac524d2 100644 --- a/src/WINNT/afsd/afslogon.c +++ b/src/WINNT/afsd/afslogon.c @@ -40,6 +40,7 @@ #include DWORD TraceOption = 0; +DWORD Debug = 0; HANDLE hDLL; @@ -49,7 +50,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); @@ -66,7 +67,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); @@ -866,6 +867,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" -- 2.39.5